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 = 11; include "globalVars.php"; include "header.php"; if (isset($_POST["leagueID"])) { $leagueID = $_POST["leagueID"]; } else { header("Location: /admin/leagueEdit.html"); } $leagueURLQuery = mysqli_query($conn, "SELECT pageURL, leagueType, hasPlayoff FROM leagueConfig WHERE id = '$leagueID'"); while ($lUQ = mysqli_fetch_array($leagueURLQuery)) { $leagueURL = $lUQ["pageURL"]; $leagueType = $lUQ["leagueType"]; $hasPlayoff = $lUQ["hasPlayoff"]; } $leagueTypeURLQuery = mysqli_query($conn, "SELECT pageURL FROM leagueGroups WHERE id = '$leagueType'"); while ($lTQ = mysqli_fetch_array($leagueTypeURLQuery)) { $leagueTypeURL = $lTQ["pageURL"]; } ?> <h2>Update a League - Basic Information</h2> <div class="formContainer"> <div class="functionButtons"> <form action="leagueEdit-1.html" method="post"> <input type="hidden" name="leagueID" value="<?php echo $leagueID ?>" /> <input type="submit" class="functionSelected" name="getLeague" value="Basic Details" /> </form> <form action="leagueEdit-2.html" method="post"> <input type="hidden" name="leagueID" value="<?php echo $leagueID ?>" /> <input type="submit" name="getLeague" value="Fixtures" /> </form> <?php if ($hasPlayoff > 0) { ?> <form action="leagueEdit-2-playoffs.html" method="post"> <input type="hidden" name="leagueID" value="<?php echo $leagueID ?>" /> <input type="submit" name="getLeague" value="Playoffs" /> </form> <?php } ?> <form action="leagueEdit-3.html" method="post"> <input type="hidden" name="leagueID" value="<?php echo $leagueID ?>" /> <input type="submit" name="getLeague" value="Page Content" /> </form> </div> </div> <?php if (isset($_POST["updateLeague"])) { ///// 8 RINK POINTS - MANUALLY ENTERED (AWAY AUTO SET AFTER HOME INPUT 8 - X = AWAY RINK) \\\\\ ///// 2 MATCH POINTS FOR HIGHEST SHOTS - AUTO ENTERED AFTER SHOTS ENTERED) \\\\\ $leagueType = cleanPost($_POST["leagueType"], $conn); $hasPlayoff = cleanPost($_POST["hasPlayoff"], $conn); $matchDay = cleanPost($_POST["matchDay"], $conn); $leagueStartDate = cleanPost($_POST["leagueStartDate"], $conn); list($startDay, $startMonth, $startYear) = explode("/", $leagueStartDate); $leagueStartDate = $startYear ."-". $startMonth ."-". $startDay; $lStartMonth = date("F", strtotime($leagueStartDate)); $pointsWin = cleanPost($_POST["pointsWin"], $conn); $pointsDraw = cleanPost($_POST["pointsDraw"], $conn); $pointsRink = cleanPost($_POST["pointsRink"], $conn); if ($_POST["customRules"] == 1) { $additonalRules = $_POST["additionalRules"]; } else { $additonalRules = ""; } mysqli_query($conn, "UPDATE leagueConfig SET leagueType = '$leagueType', hasPlayoff = '$hasPlayoff', matchDay = '$matchDay', startDate = '$leagueStartDate', pointsWin = '$pointsWin', pointsDraw = '$pointsDraw', pointsRink = '$pointsRink', customRules = '". addslashes($additonalRules) ."' WHERE id = '$leagueID'"); $leagueIDQuery = mysqli_query($conn, "SELECT groupTitle FROM leagueGroups WHERE id = '$leagueType'"); while ($lIQ = mysqli_fetch_array($leagueIDQuery)) { $groupTitle = $lIQ["groupTitle"]; } $trackDate = date("Y-m-d H:i:s"); $trackTitle = "$groupTitle $lStartMonth $startYear"; mysqli_query($conn, "INSERT INTO userActions (dateCreated, adminID, pageTracking, databaseUpdated, updateDetails) VALUES ('$trackDate', '$adminID', 'admin/leagueEdit-1.html', 'leagueConfig', 'The User ". addslashes($adminName) ." <$adminEmail> updated the details for league ID: $leagueID (". addslashes($trackTitle) .")')"); echo "<p><strong>The changes to this league configuration have been saved.</strong></p>"; } if (isset($_POST["leagueID"])) { $leagueDetailsQuery = mysqli_query($conn, "SELECT * FROM leagueConfig WHERE id = '$leagueID'"); while ($lDQ = mysqli_fetch_array($leagueDetailsQuery)) { $leagueType = $lDQ["leagueType"]; $hasMiniLeagues = $lDQ["hasMiniLeagues"]; $noTeams = $lDQ["noTeams"]; $homeAndAway = $lDQ["homeAndAway"]; $hasPlayoff = $lDQ["hasPlayoff"]; $matchDay = $lDQ["matchDay"]; $startDate = date("d/m/Y", strtotime($lDQ["startDate"])); $pointsWin = $lDQ["pointsWin"]; $pointsDraw = $lDQ["pointsDraw"]; $pointsRink = $lDQ["pointsRink"]; $customRules = $lDQ["customRules"]; $photoGallery = $lDQ["photoGallery"]; } ?> <form action="leagueEdit-1.html" method="post"> <input type="hidden" name="leagueID" id="leagueID" value="<?php echo $leagueID ?>"> <div class="descStTab"> <div class="pFormRow"> <div class="pFormTitle">League Type:</div> <div class="pFormSelect"> <select name="leagueType" id="leagueType" required> <option value="" selected disabled>Select</option> <?php $groupQuery = mysqli_query($conn, "SELECT * FROM leagueGroups ORDER BY id ASC"); while ($gQ = mysqli_fetch_array($groupQuery)) { $groupID = $gQ["id"]; $groupName = $gQ["groupTitle"]; ?> <option value="<?php echo $groupID ?>"<?php if ($groupID == $leagueType) {?> selected<?php } ?>><?php echo $groupName ?></option> <?php } ?> </select> <div class="pFormLabel"> <label class="labelName">League Type:</label> </div> </div> </div> <div class="pFormRow"> <div class="pFormTitle">Play-off after league finished?:</div> <div class="pFormSelect"> <select name="hasPlayoff"> <option value="0"<?php if ($hasPlayoff == 0) {?> selected<?php } ?>>No Playoff</option> <option value="1"<?php if ($hasPlayoff == 1) {?> selected<?php } ?>>Top teams from each group Home and Away</option> <option value="2"<?php if ($hasPlayoff == 2) {?> selected<?php } ?>>Top teams from each group One off match</option> <option value="3"<?php if ($hasPlayoff == 3) {?> selected<?php } ?>>Top two from each group Home and Away</option> <option value="4"<?php if ($hasPlayoff == 4) {?> selected<?php } ?>>Top two from each group One off matches</option> </select> <div class="pFormLabel"> <label class="labelName">Play-off after league finished?:</label> </div> </div> </div> <div class="pFormRow"> <div class="pFormTitle">Match Day:</div> <div class="pFormSelect"> <select name="matchDay"> <?php $dayWeek = array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"); for ($d = 0; $d <= 6; $d++) { ?> <option value="<?php echo $d ?>"<?php if ($d == $matchDay) {?> selected<?php } ?>><?php echo $dayWeek[$d] ?></option> <?php } ?> </select> <div class="pFormLabel"> <label class="labelName">Match Day:</label> </div> </div> </div> <div class="pFormRow"> <div class="pFormTitle">League Start Date:</div> <div class="pFormInput"> <input type="text" name="leagueStartDate" id="leagueStartDate" size="50" value="<?php echo $startDate ?>" required /> <div class="pFormLabel"> <label class="labelName">League Start Date:</label> </div> </div> </div> <div class="pFormRow"> <div class="pFormTitle">Points for a win:</div> <div class="pFormInput"> <input type="number" name="pointsWin" min="2" step="1" value="<?php echo $pointsWin ?>"> <div class="pFormLabel"> <label class="labelName">Points for a win:</label> </div> </div> </div> <div class="pFormRow"> <div class="pFormTitle">Points for a draw:</div> <div class="pFormInput"> <input type="number" name="pointsDraw" min="1" step="1" value="<?php echo $pointsDraw ?>"> <div class="pFormLabel"> <label class="labelName">Points for a draw:</label> </div> </div> </div> <div class="pFormRow"> <div class="pFormTitle">Rink Points per match:</div> <div class="pFormInput"> <input type="number" name="pointsRink" step="1" value="<?php echo $pointsRink ?>"> <div class="pFormLabel"> <label class="labelName">Rink Points per match:</label> </div> </div> </div> <div class="pFormRow"> <div class="pFormTitle">Custom League Rules?:</div> <div class="pFormSelect"> <select name="customRules" id="customRules"> <option value="0"<?php if (trim($customRules) == "") {?> selected<?php } ?>>No, Standard league rules</option> <option value="1"<?php if (trim($customRules) != "") {?> selected<?php } ?>>Yes</option> </select> <div class="pFormLabel"> <label class="labelName">Custom League Rules?:</label> </div> </div> </div> <div class="pFormRow" id="addRules"<?php if (trim($customRules) != "") {?> style="display:block"<?php } ?>> <div class="pFormRow pFormTxtRow"> <div class="pFormTitle">Custom Rules:</div> <div id="additionalRules" class="tinyTxtEditor"><?php echo $customRules ?></div> <div class="pFormLabel"> <label class="labelName">Custom Rules:</label> </div> </div> </div> <div class="pFormRow"> <?php if ($photoGallery == 0) { if (in_array(34, $adminPriv)) { ?> <button type="button" class="submitButton galleryBtn" id="photoGallery" data-gid="<?php echo $photoGallery ?>">Create a Photo Gallery for this league</button> <?php } } else { if (in_array(35, $adminPriv)) { ?> <button type="button" class="submitButton galleryBtn" id="photoGalleryU" data-gid="<?php echo $photoGallery ?>">Update the Photo Gallery for this league</button> <?php } } ?> </div> </div> <input type="submit" class="submitButton" id="updateLeague" name="updateLeague" value="Update this League" /> </form> <?php } ?> <?php include "footer.php"; ?>