Server IP : 149.202.105.228 / Your IP : 216.73.216.18 Web Server : Apache System : Linux webm129.cluster030.gra.hosting.ovh.net 5.15.167-ovh-vps-grsec-zfs-classid #1 SMP Tue Sep 17 08:14:20 UTC 2024 x86_64 User : atfycaf ( 116275) PHP Version : 7.4.33 Disable Function : _dyuweyrj4,_dyuweyrj4r,dl MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : OFF | Pkexec : OFF Directory : /home/atfycaf/www/admin/ |
Upload File : |
<?php $thisCheckID = 34; include "globalVars.php"; include "header.php"; ?> <h2>Create a New Photo Gallery Category</h2> <?php if (isset($_POST["createGalleryCat"])) { $catTitle = cleanPost($_POST["catTitle"], $conn); $pageURL = str_replace($badURL, $goodURL, $catTitle); $pageURL = strtolower($pageURL) ; $dupQuery = mysqli_query($conn, "SELECT id FROM photoGalleryCats WHERE pageURL LIKE '$pageURL%%'"); $isDup = mysqli_num_rows($dupQuery); if ($isDup > 0) { $pageURL .= "-". ($isDup + 1); } if(!is_dir($SERVER_ROOT ."/images/gallery/$pageURL")) { mkdir($SERVER_ROOT ."/images/gallery/$pageURL"); } mysqli_query($conn, "INSERT INTO photoGalleryCats (pageURL, catTitle) VALUES ('$pageURL', '". addslashes($catTitle) ."')") or die (mysqli_error($conn)); $catID = mysqli_insert_id($conn); if (isset($_POST["forComp"])) { $compSelected = $_POST["compID"]; list($compType, $compID) = explode("|", $compSelected); mysqli_query($conn, "UPDATE photoGalleryCats SET tournLeague = '$compType', compID = '$compID' WHERE id = '$catID'"); mysqli_query($conn, "UPDATE knockoutConfig SET photoGallery = '$catID' WHERE id = '$compID'"); } $trackDate = date("Y-m-d H:i:s"); mysqli_query($conn, "INSERT INTO userActions (dateCreated, adminID, pageTracking, databaseUpdated, updateDetails) VALUES ('$trackDate', '$adminID', 'admin/galleryCatNew.html', 'photoGalleryCats', 'The User ". addslashes($adminName) ." <$adminEmail> created the ". addslashes($catTitle) ." photo gallery')"); echo "<p><strong>Success!</strong> The new Gallery Category $catTitle has been created.</p>"; } else { ?> <form action="galleryCatNew.html" method="post"> <div class="descStTab"> <div class="pFormRow"> <div class="pFormTitle">Category Title:</div> <div class="pFormInput"> <input type="text" name="catTitle" size="50" required /> <div class="pFormLabel"> <label class="labelName">Category Title:</label> </div> </div> </div> <div class="pFormRow"> <div class="pFormTitle">For a Competition?:</div> <div class="pFormFilterInput"> <input type="checkbox" name="forComp" id="forComp" value="1"> <div class="pFormLabel"> <label class="labelName">For a Tournament?:</label> </div> </div> </div> <div class="pFormRow" id="compSelect" style="display:none;"> <div class="pFormTitle">Which Competition?:</div> <div class="pFormSelect"> <select name="compID" id="compID"> <option value="" selected disabled>Select</option> <optgroup label="Knockout Tournaments"> <?php $knockoutSQLquery = mysqli_query($conn, "SELECT id, tournType, tournTitle, tournStartDate, tournLocation FROM knockoutConfig ORDER BY tournStartDate DESC"); while ($kSQ = mysqli_fetch_array($knockoutSQLquery)) { $tournID = $kSQ["id"]; $tournType = $kSQ["tournType"]; $tournTitle = $kSQ["tournTitle"]; $tournStartDate = $kSQ["tournStartDate"]; $tStartMonth = date("F", strtotime($tournStartDate)); $tStartYear = date("Y", strtotime($tournStartDate)); $startDisplay = date("jS F, Y", strtotime($tournStartDate)); $tournLocation = $kSQ["tournLocation"]; if (trim($tournTitle) == "") { $tournTitle = "$tournLocation $tStartMonth $tStartYear"; } $tournamentIDQuery = mysqli_query($conn, "SELECT groupTitle FROM knockoutGroups WHERE id = '$tournType'"); while ($tIQ = mysqli_fetch_array($tournamentIDQuery)) { $tournamentGroup = $tIQ["groupTitle"]; } ?> <option value="1|<?php echo $tournID ?>" data-grp="<?php echo $tournamentGroup ?>"><?php echo "$tournTitle" ?></option> <?php } ?> </optgroup> </select> <div class="pFormLabel"> <label class="labelName">Which Competition?:</label> </div> </div> </div> </div> <input type="submit" class="submitButton" name="createGalleryCat" value="Create New Category" /> </form> <?php } ?> <?php include "footer.php"; ?>