Server IP : 149.202.105.228 / Your IP : 216.73.216.134 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/a/t/f/atfycaf/www/admin/ |
Upload File : |
<?php $thisCheckID = 10; include "globalVars.php"; include "header.php"; ?> <h2>Create a New League</h2> <?php if (isset($_POST["createLeague"])) { ///// 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); $noTeams = cleanPost($_POST["noTeams"], $conn); $hasMiniLeagues = cleanPost($_POST["hasMiniLeagues"], $conn); $homeAndAway = cleanPost($_POST["homeAndAway"], $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 = ""; } $pageURL = $lStartMonth ."-". $startYear; $pageURL = str_replace($badURL, $goodURL, $pageURL); $pageURL = strtolower($pageURL) ; $dupQuery = mysqli_query($conn, "SELECT pageURL FROM leagueConfig WHERE leagueType = '$leagueType' AND (pageURL LIKE '$pageURL%%')"); $isDup = mysqli_num_rows($dupQuery); if ($isDup > 0) { $pageURL .= "-". ($isDup + 1); } mysqli_query($conn, "INSERT INTO leagueConfig (pageURL, leagueType, leagueTitle, hasMiniLeagues, noTeams, homeAndAway, hasPlayoff, matchDay, startDate, pointsWin, pointsDraw, pointsRink, customRules) VALUES ('$pageURL', '$leagueType', '". addslashes($leagueTitle) ."', '$hasMiniLeagues', '$noTeams', '$homeAndAway', '$hasPlayoff', '$matchDay', '$leagueStartDate', '$pointsWin', '$pointsDraw', '$pointsRink', '". addslashes($additonalRules) ."')"); $leagueID = mysqli_insert_id($conn); $miniLeagueTitles = $_POST["miniLeagueTitle"]; $miniLeagueTeams = $_POST["team"]; if ($hasMiniLeagues == 1) { mysqli_query($conn, "INSERT INTO leagueMiniLeagues (leagueID, miniLeagueTitle) VALUES ('$leagueID', '')"); $miniLeagueID = mysqli_insert_id($conn); foreach($miniLeagueTeams[1] as $teamName) { mysqli_query($conn, "INSERT INTO leagueMiniLeaguesTeams (miniLeagueID, teamName) VALUES ('$miniLeagueID', '". addslashes($teamName) ."')"); } } else { foreach($miniLeagueTitles as $miniArray => $miniLeagueTitle) { mysqli_query($conn, "INSERT INTO leagueMiniLeagues (leagueID, miniLeagueTitle) VALUES ('$leagueID', '". addslashes($miniLeagueTitle) ."')"); $miniLeagueID = mysqli_insert_id($conn); foreach($miniLeagueTeams[$miniArray] as $teamName) { mysqli_query($conn, "INSERT INTO leagueMiniLeaguesTeams (miniLeagueID, teamName) VALUES ('$miniLeagueID', '". addslashes($teamName) ."')"); } } } ?> <form action="leagueNew-2.html" method="post" id="leagueNext"> <input type="hidden" name="leagueID" value="<?php echo $leagueID ?>" /> </form> <script type="text/javascript"> document.getElementById('leagueNext').submit(); </script> <?php } else { ?> <form action="leagueNew.html" method="post"> <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 echo $groupName ?></option> <?php } ?> </select> <div class="pFormLabel"> <label class="labelName">League Type:</label> </div> </div> </div> <div class="pFormRow"> <div class="pFormTitle">Nº of Teams:</div> <div class="pFormInput"> <input type="number" name="noTeams" id="noTeams" min="2" step="1"> <div class="pFormLabel"> <label class="labelName">Nº of Teams:</label> </div> </div> </div> <div class="pFormRow"> <div class="pFormTitle">How many league groups?:</div> <div class="pFormSelect"> <select name="hasMiniLeagues" id="hasMiniLeagues"> <option value="1">1 League</option> <option value="2">2 Mini Leagues</option> <option value="3">3 Mini Leagues</option> <option value="4">4 Mini Leagues</option> <option value="5">5 Mini Leagues</option> <option value="6">6 Mini Leagues</option> <option value="7">7 Mini Leagues</option> <option value="8">8 Mini Leagues</option> <option value="9">9 Mini Leagues</option> <option value="10">10 Mini Leagues</option> </select> <div class="pFormLabel"> <label class="labelName">How many league groups?:</label> </div> </div> </div> <div class="pFormRow"> <div class="pFormTitle">One-off matches or Home and Away?:</div> <div class="pFormSelect"> <select name="homeAndAway"> <option value="1">One-off matches</option> <option value="0">Home and Away</option> </select> <div class="pFormLabel"> <label class="labelName">One-off matches or Home and Away?:</label> </div> </div> </div> <div class="pFormRow"> <div class="pFormTitle">Play-off after league finished?:</div> <div class="pFormSelect"> <select name="hasPlayoff" id="hasPlayoff"> <option value="0">No Playoff</option> <option value="1" disabled>Top team from each group Home and Away</option> <option value="2" disabled>Top team from each group One off match</option> <option value="3">Top two teams from each group Home and Away</option> <option value="4">Top two teams 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 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" 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="2"> <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="1"> <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" min="0" step="1" value="8"> <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">No, Standard league rules</option> <option value="1">Yes</option> </select> <div class="pFormLabel"> <label class="labelName">Custom League Rules?:</label> </div> </div> </div> <div class="pFormRow" id="addRules"> <div class="pFormRow pFormTxtRow"> <div class="pFormTitle">Custom Rules:</div> <div id="additionalRules" class="tinyTxtEditor"></div> <div class="pFormLabel"> <label class="labelName">Custom Rules:</label> </div> </div> </div> </div> <div class="descStTab" id="teamsList"> </div> <input type="submit" class="submitButton" id="createLeague" name="createLeague" value="Create this League" disabled /> </form> <?php } ?> <?php include "footer.php"; ?>