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 = 11; include "globalVars.php"; if (isset($_POST["leagueID"])) { $leagueID = $_POST["leagueID"]; } else { header("Location: /admin/leagueEdit.html"); } $leagueURLQuery = mysqli_query($conn, "SELECT * FROM leagueConfig WHERE id = '$leagueID'"); while ($lUQ = mysqli_fetch_array($leagueURLQuery)) { $leagueURL = $lUQ["pageURL"]; $leagueType = $lUQ["leagueType"]; $hasMiniLeagues = $lUQ["hasMiniLeagues"]; $noTeams = $lUQ["noTeams"]; $hasPlayoff = $lUQ["hasPlayoff"]; $pointsWin = $lUQ["pointsWin"]; $pointsDraw = $lUQ["pointsDraw"]; $pointsRink = $lUQ["pointsRink"]; } $leagueTypeURLQuery = mysqli_query($conn, "SELECT pageURL FROM leagueGroups WHERE id = '$leagueType'"); while ($lTQ = mysqli_fetch_array($leagueTypeURLQuery)) { $leagueTypeURL = $lTQ["pageURL"]; } include "header.php"; ?> <h2>Update a League - Playoff Fixtures</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" 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" class="functionSelected" 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> <p>The fixtures are available as a PDF to send in emails or print. This PDF is automatically updated with the latest scores once you have saved them.</p> <a href="/pdf/<?php echo $leagueTypeURL ?>-<?php echo $leagueURL ?>-league-fixtures.pdf" class="submitButton" target="_blank">Print League Fixtures</a> <?php $seasonFinished = true; $miniLeaguesArray = array(); $miniLeaguesQuery = mysqli_query($conn, "SELECT * FROM leagueMiniLeagues WHERE leagueID = '$leagueID' ORDER BY id ASC"); while ($mLQ = mysqli_fetch_array($miniLeaguesQuery)) { $miniLeagueID = $mLQ["id"]; $miniLeaguesArray[] = $miniLeagueID; $matchesToPlayQuery = mysqli_query($conn, "SELECT id from leagueResults WHERE miniLeagueID = '$miniLeagueID' AND ((homeTeam != '') AND (awayTeam != '')) AND ((homeScore = '-1') OR (awayScore = '-1')) AND (weekID < 900)"); $matchesToPlay = mysqli_num_rows($matchesToPlayQuery); if ($matchesToPlay > 0) { $seasonFinished = false; } } if ($seasonFinished == false) { ?> <p style="float:left; width:100%;">The Playoffs shown below are based simply on the current standings and will not be finalised until all season matches have been played.</p> <?php } ?> <?php $hasPlayoffFixturesQuery = mysqli_query($conn, "SELECT id from leagueResults WHERE miniLeagueID IN('". implode("', '", $miniLeaguesArray) ."') AND (weekID > 1000) ORDER BY weekID ASC"); if (mysqli_num_rows($hasPlayoffFixturesQuery) > 0) { $playoffFixturesQuery = mysqli_query($conn, "SELECT id from leagueResults WHERE miniLeagueID IN('". implode("', '", $miniLeaguesArray) ."') AND (weekID > 10000) ORDER BY weekID ASC"); if (mysqli_num_rows($playoffFixturesQuery) > 0) { ///// TO BE DRAWN - POSSIBLY MIGHT HAVE ALREADY BEEN DRAWN \\\\\ $noRoundsQuery = mysqli_query($conn, "SELECT DISTINCT(weekID) FROM leagueResults WHERE miniLeagueID IN('". implode("', '", $miniLeaguesArray) ."') AND (weekID BETWEEN 10000 AND 100000) ORDER BY weekID ASC LIMIT 0,1"); while ($nRQ = mysqli_fetch_array($noRoundsQuery)) { $lowestWeek = $nRQ["weekID"]; } ?> <div id="roundSelect"> <?php for ($thisRound = $lowestWeek; $thisRound <= 99999; $thisRound++) { if ($thisRound == 99999) { $roundTitle = "Final"; } elseif ($thisRound == 99998) { $roundTitle = "Semi-Finals"; } elseif ($thisRound == 99997) { $roundTitle = "Quarter-Finals"; } else { $thisRound = ($weekID - $lowestWeek) + 1; $roundTitle = "Round $thisRound"; } ?> <a id="round<?php echo $thisRound ?>"<?php if ($thisRound == $lowestWeek) {?> class="selectedRound"<?php } ?>><?php echo $roundTitle ?></a> <?php } ?> </div> <div id="roundDisplay"> <?php for ($thisRound = $lowestWeek; $thisRound <= 99999; $thisRound++) { if ($thisRound == 99999) { $roundTitle = "Final"; } elseif ($thisRound == 99998) { $roundTitle = "Semi-Finals"; } elseif ($thisRound == 99997) { $roundTitle = "Quarter-Finals"; } else { $thisRound = ($weekID - $lowestWeek) + 1; $roundTitle = "Round $thisRound"; } $fixtureDateQuery = mysqli_query($conn, "SELECT id, miniLeagueID, fixtureDate FROM leagueResults WHERE miniLeagueID IN('". implode("', '", $miniLeaguesArray) ."') AND (weekID = '$thisRound') ORDER BY id ASC LIMIT 0,1"); while ($fDQ = mysqli_fetch_array($fixtureDateQuery)) { $fixtureID = $fDQ["id"]; $fixtureMLid = $fDQ["miniLeagueID"]; $fixtureDate = date("d/m/Y", strtotime($fDQ["fixtureDate"])); } $drawnTeamsArray = array(); $playoffsSetTeamsQuery = mysqli_query($conn, "SELECT homeTeam, awayTeam FROM leagueResults WHERE miniLeagueID IN('". implode("', '", $miniLeaguesArray) ."') AND (weekID = '$thisRound') ORDER BY id ASC"); while ($pSTQ = mysqli_fetch_array($playoffsSetTeamsQuery)) { if (trim($pSTQ["homeTeam"])) { $drawnTeamsArray[] = $pSTQ["homeTeam"]; } if (trim($pSTQ["awayTeam"])) { $drawnTeamsArray[] = $pSTQ["awayTeam"]; } } ?> <div id="round<?php echo $thisRound ?>Display" class="<?php if ($thisRound == $lowestWeek) {?>selectedRoundDisplay <?php } ?>roundDisplay"> <h3><?php echo $roundTitle ?></h3> <div class="roundDateInp">Date: <input type="text" id="fixtureDate<?php echo $fixtureID ?>" name="fixtureDate[<?php echo $fixtureID ?>]" class="roundDate" size="50" value="<?php echo $fixtureDate ?>"></div> <div class="listTitle">Qualified Teams</div> <div class="listTitle listTitleW">Round Draw</div> <div class="playersListC"> <ul id="players<?php echo $thisRound ?>" class="playersSet ui-sortable"> <?php $undrawnTeamsQuery = mysqli_query($conn, "SELECT teamName FROM leagueKnockout WHERE leagueID IN('". implode("', '", $miniLeaguesArray) ."') AND (weekID = '$thisRound') AND teamName NOT IN('". implode("', '", $drawnTeamsArray) ."') ORDER BY id ASC"); while ($uTQ = mysqli_fetch_array($undrawnTeamsQuery)) { $teamName = $uTQ["teamName"]; ?> <li><i class="fas fa-grip-horizontal"></i><input type="text" class="teamName" size="50" value="<?php echo $teamName ?>" readonly /></li> <?php } ?> </ul> </div> <div class="fixturesListC"> <?php $playoffsQuery = mysqli_query($conn, "SELECT * FROM leagueResults WHERE miniLeagueID IN('". implode("', '", $miniLeaguesArray) ."') AND (weekID = '$thisRound') ORDER BY id ASC"); $noTeams = mysqli_num_rows($playoffsQuery) * 2; ?> <ul id="fixtures<?php echo $thisRound ?>" class="fixtureSet ui-sortable" data-fc="<?php echo $noTeams ?>" data-mlid="<?php echo $fixtureMLid ?>"> <?php while ($pFQ = mysqli_fetch_array($playoffsQuery)) { $fixtureID = $pFQ["id"]; $weekID = $pFQ["weekID"]; $fixtureDate = date("d/m/Y", strtotime($pFQ["fixtureDate"])); $fixtureVenue = $pFQ["fixtureVenue"]; $homeTeam = $pFQ["homeTeam"]; $homeScore = $pFQ["homeScore"]; $homeRinkPts = $pFQ["homeRinkPts"]; $awayTeam = $pFQ["awayTeam"]; $awayScore = $pFQ["awayScore"]; $awayRinkPts = $pFQ["awayRinkPts"]; $firstLegID = $pFQ["firstLegID"]; if ($homeScore == -1) { $homeScore = ""; $homeRinkPts = ""; } if ($awayScore == -1) { $awayScore = ""; $awayRinkPts = ""; } ?> <div class="matchVenueInp">Venue: <select class="matchVenue" data-mid="<?php echo $fixtureID ?>"> <?php $clubsQuery = mysqli_query($conn, "SELECT id, clubName FROM localClubs ORDER BY clubName ASC"); while ($cQ = mysqli_fetch_array($clubsQuery)) { $clubID = $cQ["id"]; $clubName = $cQ["clubName"]; if ($fixtureVenue == 0) { ?> <option value="0" selected>None Set</option> <?php } ?> <option value="<?php echo $clubID ?>"<?php if ($clubID == $fixtureVenue) {?> selected<?php } ?>><?php echo $clubName ?></option> <?php } ?> </select> </div> <?php if (trim($homeTeam) == "") { ?> <li id="home<?php echo $fixtureID ?>" class="ui-sortable-placeholder ui-sortable-handle"></li> <?php } else { ?> <li id="home<?php echo $fixtureID ?>" class="ui-sortable-handle"><input type="text" class="teamName" size="50" value="<?php echo $homeTeam ?>" readonly /> <input type="number" class="fixtureRinkPts" placeholder="Rink Points" value="<?php echo $homeRinkPts ?>" min="0" max="<?php echo $pointsRink ?>" step="1"> <input type="number" class="kFixtureScore" placeholder="Shots" value="<?php echo $homeScore ?>" min="0" step="1"></li> <?php } if (trim($awayTeam) == "") { ?> <li id="away<?php echo $fixtureID ?>" class="ui-sortable-placeholder ui-sortable-handle"></li> <?php } else { ?> <li id="away<?php echo $fixtureID ?>" class="ui-sortable-handle"><input type="text" class="teamName" size="50" value="<?php echo $awayTeam ?>" readonly /> <input type="number" class="fixtureRinkPts" placeholder="Rink Points" value="<?php echo $awayRinkPts ?>" min="0" max="<?php echo $pointsRink ?>" step="1"> <input type="number" class="kFixtureScore" placeholder="Shots" value="<?php echo $awayScore ?>" min="0" step="1"></li> <?php } } ?> </ul> </div> </div> <?php } ?> </div> <?php } else { ?> <div id="roundDisplay"> <div id="round1Display" class="roundDisplay selectedRoundDisplay"> <?php ///// ALREADY SETUP FIXTURES - ONCE SCORES ENTERED THE WINNER ADVANCES \\\\\ $noRoundsQuery = mysqli_query($conn, "SELECT DISTINCT(weekID) FROM leagueResults WHERE miniLeagueID IN('". implode("', '", $miniLeaguesArray) ."') AND (weekID BETWEEN 1000 AND 10000) ORDER BY weekID ASC LIMIT 0,1"); while ($nRQ = mysqli_fetch_array($noRoundsQuery)) { $lowestWeek = $nRQ["weekID"]; } $playoffsQuery = mysqli_query($conn, "SELECT * FROM leagueResults WHERE miniLeagueID IN('". implode("', '", $miniLeaguesArray) ."') AND (weekID BETWEEN 1000 AND 10000) ORDER BY id ASC"); while ($pFQ = mysqli_fetch_array($playoffsQuery)) { $fixtureID = $pFQ["id"]; $weekID = $pFQ["weekID"]; $fixtureDate = date("d/m/Y", strtotime($pFQ["fixtureDate"])); $fixtureVenue = $pFQ["fixtureVenue"]; $homeTeam = $pFQ["homeTeam"]; $homeScore = $pFQ["homeScore"]; $homeRinkPts = $pFQ["homeRinkPts"]; $awayTeam = $pFQ["awayTeam"]; $awayScore = $pFQ["awayScore"]; $awayRinkPts = $pFQ["awayRinkPts"]; $firstLegID = $pFQ["firstLegID"]; if ($homeScore == -1) { $homeScore = ""; $homeRinkPts = ""; } if ($awayScore == -1) { $awayScore = ""; $awayRinkPts = ""; } if ($weekID == 9999) { $roundTitle = "Final"; } elseif ($weekID == 9998) { $roundTitle = "Semi-Finals"; } elseif ($weekID == 9997) { $roundTitle = "Quarter-Finals"; } else { $thisRound = ($weekID - $lowestWeek) + 1; $roundTitle = "Round $thisRound"; } if ($hasPlayoff == 1 || $hasPlayoff == 3) { if ($firstLegID == 0) { $roundTitle .= " 1st Leg"; } else { $roundTitle .= " 2nd Leg"; } } ?> <div class="roundDisplay scoreFixtures selectedRoundDisplay"> <div class="listTitle listTitleAG"><?php echo $roundTitle ?></div> <div class="roundDateInp">Date: <input type="text" id="fixtureDate<?php echo $fixtureID ?>" name="fixtureDate[<?php echo $fixtureID ?>]" class="roundDate" size="50" value="<?php echo $fixtureDate ?>"></div> <div class="fixturesListC"> <div class="matchVenueNInp">Venue: <select class="matchVenue" data-mid="<?php echo $fixtureID ?>"> <?php $clubsQuery = mysqli_query($conn, "SELECT id, clubName FROM localClubs ORDER BY clubName ASC"); while ($cQ = mysqli_fetch_array($clubsQuery)) { $clubID = $cQ["id"]; $clubName = $cQ["clubName"]; if ($fixtureVenue == 0) { ?> <option value="0" selected>None Set</option> <?php } ?> <option value="<?php echo $clubID ?>"<?php if ($clubID == $fixtureVenue) {?> selected<?php } ?>><?php echo $clubName ?></option> <?php } ?> </select> </div> <ul class="fixtureSet ui-sortable"> <?php if (trim($homeTeam) == "") { ?> <li id="home<?php echo $fixtureID ?>" class="ui-sortable-placeholder ui-sortable-handle"></li> <?php } else { ?> <li id="home<?php echo $fixtureID ?>" class="ui-sortable-handle"><input type="text" class="teamName" size="50" value="<?php echo $homeTeam ?>" readonly /> <input type="number" class="fixtureRinkPts" placeholder="Rink Points" value="<?php echo $homeRinkPts ?>" min="0" max="<?php echo $pointsRink ?>" step="1"> <input type="number" class="fixtureScore" placeholder="Shots" value="<?php echo $homeScore ?>" min="0" step="1"></li> <?php } if (trim($awayTeam) == "") { ?> <li id="away<?php echo $fixtureID ?>" class="ui-sortable-placeholder ui-sortable-handle"></li> <?php } else { ?> <li id="away<?php echo $fixtureID ?>" class="ui-sortable-handle"><input type="text" class="teamName" size="50" value="<?php echo $awayTeam ?>" readonly /> <input type="number" class="fixtureRinkPts" placeholder="Rink Points" value="<?php echo $awayRinkPts ?>" min="0" max="<?php echo $pointsRink ?>" step="1"> <input type="number" class="fixtureScore" placeholder="Shots" value="<?php echo $awayScore ?>" min="0" step="1"></li> <?php } ?> </ul> </div> </div> <?php } ?> </div> </div> <?php } } ?> <?php include "footer.php"; ?>