Server IP : 149.202.105.228 / Your IP : 216.73.216.123 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/ |
Upload File : |
<?php error_reporting(E_ALL); ini_set("display_errors", 1); include "globalVars.php"; $tournamentGroupURL = cleanPost($_GET["group"], $conn); $pageURL = $tournamentGroupURL; $tournamentType = $tournamentGroupURL; $thisParentID = 3; $thisPageID = 4; $tournamentIDQuery = mysqli_query($conn, "SELECT id, groupTitle FROM knockoutGroups WHERE pageURL = '$tournamentType'"); while ($tIQ = mysqli_fetch_array($tournamentIDQuery)) { $groupType = $tIQ["id"]; $groupTitle = $tIQ["groupTitle"]; } $headerTitle = $groupTitle; $pageTitle = $groupTitle; $metaKey = ""; $metaDesc = ""; $showTournament = true; $tournamentQuery = mysqli_query($conn, "SELECT * FROM knockoutConfig WHERE tournType = '$groupType' ORDER BY tournStartDate DESC LIMIT 0,1"); if (mysqli_num_rows($tournamentQuery) == 0) { $showTournament = false; } else { $todaysDate = date("Y-m-d"); while ($tQ = mysqli_fetch_array($tournamentQuery)) { $tournamentID = $tQ["id"]; $tournLink = $tQ["pageURL"]; $tournTitle = $tQ["tournTitle"]; $tFullSDate = $tQ["tournStartDate"]; $tFullEDate = $tQ["tournEndDate"]; $tStartDate = date("jS", strtotime($tFullSDate)); $tStartMonth = date("F", strtotime($tFullSDate)); $tStartYear = date("Y", strtotime($tFullSDate)); $tEndDate = date("jS", strtotime($tFullEDate)); $tEndMonth = date("F", strtotime($tFullEDate)); $tEndYear = date("Y", strtotime($tFullEDate)); $tournStartDate = $tStartDate; if ($tStartMonth != $tEndMonth) { $tournStartDate .= " $tStartMonth"; } if ($tStartYear != $tEndYear) { $tournStartDate .= " $tStartYear"; } $tournLocation = $tQ["tournLocation"]; if (trim($tournTitle) == "") { $tournTitle = "$tournLocation $tStartMonth $tStartYear"; } $tournEndDate = date("jS F, Y", strtotime($tQ["tournEndDate"])); $noCompetitors = $tQ["noCompetitors"]; $hasPrelims = $tQ["hasPrelims"]; $showScores = $tQ["showScores"]; } $compLeft = $noCompetitors; $noRounds = 1; do { $compLeft = $compLeft / 2; $noRounds++; } while ($compLeft > 2); if ($hasPrelims == 1) { $rCount = 0; } else { $rCount = 1; } $noMatches = 1; $roundMatches = array(); $roundMatches[$noRounds] = $noMatches; for ($r = $noRounds; $r >= $rCount; $r--) { if ($r == $noRounds) { $noMatches = 1; } else { $noMatches = $noMatches * 2; } $roundMatches[$r] = $noMatches; } } include "header.php"; ?> <div id="pageBreadcrumb"> <div class="container"> <ol id="pagesBreadcrumb" itemscope itemtype="http://schema.org/BreadcrumbList"> <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="<?php echo $url ?>" itemprop="item"><span itemprop="name"><i class="fa fa-home" aria-hidden="true" title="<?php echo $LANG_MENU_HOME_TITLE ?>"></i></span></a><meta itemprop="position" content="1" /></li> <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="<?php echo $url . $LANG_MENU_KNOCKOUT_URL ?>" itemprop="item"><span itemprop="name"><?php echo $LANG_MENU_KNOCKOUT_TITLE ?></span></a><meta itemprop="position" content="2" /></li> <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="<?php echo $url . $LANG_MENU_KNOCKOUT_URL ."/". $tournamentGroupURL ?>" itemprop="item"><span itemprop="name"><?php echo $groupTitle ?></span></a><meta itemprop="position" content="3" /></li> </ol> </div> </div> <div class="mainContent tb40"> <div class="container"> <div class="pageLeft"> <?php if ($showTournament == false) { ?> <p><?php echo str_replace("[[TOURN_TYPE]]", $groupTitle, $LANG_NO_RECENT_TEXT) ?></p> <?php } else { ?> <h2><a href="<?php echo $url . $LANG_MENU_KNOCKOUT_URL ."/". $tournamentGroupURL ."/". $tournLink ?>.html"><?php echo $tournTitle ?></a></h2> <?php if ($tFullEDate > $todaysDate) { ?> <p><?php echo str_replace(array("[[TOURN_LOC]]", "[[FROM_DATE]]", "[[TO_DATE]]"), array($tournLocation, $tournStartDate, $tournEndDate), $LANG_KNOCKOUT_DATES_ONGOING) ?></p> <?php } else { ?> <p><?php echo str_replace(array("[[TOURN_LOC]]", "[[FROM_DATE]]", "[[TO_DATE]]"), array($tournLocation, $tournStartDate, $tournEndDate), $LANG_KNOCKOUT_DATES) ?></p> <?php } $htmlTemplate = "knockout-"; $fixturesCSS = "knockout"; if ($hasPrelims == 1) { $htmlTemplate .= "pre-"; $fixturesCSS .= "Pre"; } if ($noCompetitors <= 4) { $htmlTemplate .= "4"; $fixturesCSS .= "4"; if ($hasPrelims == 1) { $roundsArray = array(0 => 2, 1 => 2, 2 => 1); } else { $roundsArray = array(1 => 2, 2 => 1); } } elseif ($noCompetitors <= 8) { $htmlTemplate .= "8"; $fixturesCSS .= "8"; if ($hasPrelims == 1) { $roundsArray = array(0 => 4, 1 => 4, 2 => 2, 3 => 1); } else { $roundsArray = array(1 => 4, 2 => 2, 3 => 1); } } elseif ($noCompetitors <= 16) { $htmlTemplate .= "16"; $fixturesCSS .= "16"; if ($hasPrelims == 1) { $roundsArray = array(0 => 8, 1 => 8, 2 => 4, 3 => 2, 4 => 1); } else { $roundsArray = array(1 => 8, 2 => 4, 3 => 2, 4 => 1); } } elseif ($noCompetitors <= 32) { $htmlTemplate .= "32"; $fixturesCSS .= "32"; if ($hasPrelims == 1) { $roundsArray = array(0 => 16, 1 => 16, 2 => 8, 3 => 4, 4 => 2, 5 => 1); } else { $roundsArray = array(1 => 16, 2 => 8, 3 => 4, 4 => 2, 5 => 1); } } elseif ($noCompetitors <= 64) { $htmlTemplate .= "64"; $fixturesCSS .= "64"; if ($hasPrelims == 1) { $roundsArray = array(0 => 32, 1 => 32, 2 => 16, 3 => 8, 4 => 4, 5 => 2, 6 => 1); } else { $roundsArray = array(1 => 32, 2 => 16, 3 => 8, 4 => 4, 5 => 2, 6 => 1); } } $rawTemplate = file_get_contents($SERVER_ROOT ."/". $htmlTemplate .".html"); $final = $noRounds; ?> <div class="knockoutContainer knockoutContainerD"> <div class="knockoutFixtures"> <div class="knockoutFixturesS <?php echo $fixturesCSS ?>"> <?php foreach($roundsArray as $roundID => $noMatches) { for ($m = 1; $m <= $noMatches; $m++) { $replaceTD = "[[ROUND_". $roundID ."_". $m ."]]"; $matchReplace = ""; $participantName = ""; $matchScore = ""; $opponentName = ""; $opponentScore = ""; $nextFixtureQuery = mysqli_query($conn, "SELECT * FROM knockoutRounds WHERE tournID = '$tournamentID' AND (roundID = '$roundID') AND (matchNo = '$m') ORDER BY id ASC LIMIT 0,1"); while ($nFQ = mysqli_fetch_array($nextFixtureQuery)) { $playerID = $nFQ["id"]; $roundDate = $nFQ["roundDate"]; $participantName = $nFQ["participantName"]; $matchScore = $nFQ["matchScore"]; } $matchTime = date("H:i", strtotime($roundDate)); if (trim($matchTime) == "00:00") { $matchDate = '<span class="kFixtureDate">'. date("D jS M Y", strtotime($roundDate)) .'</span>'; } else { $matchDate = '<span class="kFixtureDate">'. date("g:ia D jS M Y", strtotime($roundDate)) .'</span>'; } if ($matchScore == -1) { $matchScore = ""; } $opponentsQuery = mysqli_query($conn, "SELECT * FROM knockoutRounds WHERE tournID = '$tournamentID' AND (roundID = '$roundID') AND (matchNo = '$m') AND (id != '$playerID') ORDER BY id ASC LIMIT 0,1"); if (mysqli_num_rows($opponentsQuery) == 0) { $opponentName = '<span class="knockoutPH">-</span>'; $opponentScore = ""; } else { while ($oQ = mysqli_fetch_array($opponentsQuery)) { $opponentName = $oQ["participantName"]; $opponentScore = $oQ["matchScore"]; } } if ($opponentScore == -1) { $opponentScore = ""; } if ($roundID == $final) { if (($matchScore > $opponentScore) || ($matchScore == 9999) || ($opponentScore == 99999)) { $tourneyWinner = $participantName; } elseif (($opponentScore > $matchScore) || ($matchScore == 99999) || ($opponentScore == 9999)) { $tourneyWinner = $opponentName; } else { $tourneyWinner = ""; } } if ($matchScore == 9999 || $opponentScore == 9999) { $matchReplace = '<br><span class="knockoutPH">-</span>'; } elseif ($matchScore == 99999 || $opponentScore == 99999) { if (trim($participantName) == '') { $matchReplace = '<div class="knockoutInd"> </div>'; } else { $matchReplace = '<div class="knockoutInd" title="'. $participantName .'">'. $participantName .'</div>'; } if ($opponentName == '<span class="knockoutPH">-</span>') { $matchReplace .= '<div class="knockoutInd"> </div>'; } else { $matchReplace .= '<div class="knockoutInd" title="'. $opponentName .'">'. $opponentName .'</div>'; } } elseif ($opponentScore == $matchScore) { if (trim($participantName) == '') { $matchReplace = '<div class="knockoutInd"> </div>'; } else { $matchReplace = '<div class="knockoutInd" title="'. $participantName .'">'. $participantName .'</div>'; } if ($opponentName == '<span class="knockoutPH">-</span>') { $matchReplace .= '<div class="knockoutInd"> </div>'; } else { $matchReplace .= '<div class="knockoutInd" title="'. $opponentName .'">'. $opponentName .'</div>'; } } else { if ($showScores == 1) { $matchReplace = '<div class="knockoutInd knockoutIndWS" title="'. $participantName .'">'. $participantName .'</div><div class="knockoutScore">'. $matchScore .'</div>'; if ($opponentName == '<span class="knockoutPH">-</span>') { $matchReplace .= '<div class="knockoutInd"> </div>'; } else { $matchReplace .= ' <div class="knockoutInd knockoutIndWS" title="'. $opponentName .'">'. $opponentName .'</div><div class="knockoutScore">'. $opponentScore .'</div>'; } } else { $matchReplace = '<div class="knockoutInd" title="'. $participantName .'">'. $participantName .'</div>'; if ($opponentName == '<span class="knockoutPH">-</span>') { $matchReplace .= '<div class="knockoutInd"> </div>'; } else { $matchReplace .= ' <div class="knockoutInd" title="'. $opponentName .'">'. $opponentName .'</div><div class="knockoutScore">'. $opponentScore .'</div>'; } } } if ($matchReplace != '<br><span class="knockoutPH">-</span>') { $matchReplace .= $matchDate; } // echo "REPLACE $replaceTD, $matchReplace<br>"; $rawTemplate = str_replace($replaceTD, $matchReplace, $rawTemplate); } } } echo $rawTemplate; ?> <div id="tournWinner"> Winner: <?php echo $tourneyWinner ?> </div> </div> </div> </div> </div> <div class="pageRight"> <?php if ($showTournament == true) { $otherResultsQuery = mysqli_query($conn, "SELECT * FROM knockoutConfig WHERE tournType = '$groupType' ORDER BY tournStartDate DESC LIMIT 1,99999999"); if (mysqli_num_rows($otherResultsQuery) > 0) { ?> <div class="pageLinks"> <h3><?php echo str_replace("[[TOURN_TYPE]]", $groupTitle, $LANG_RECENT_KNOCKOUTS) ?></h3> <ul> <?php while ($oRQ = mysqli_fetch_array($otherResultsQuery)) { $otherResultURL = $oRQ["pageURL"]; $otherResultTitle = $oRQ["tournTitle"]; $otherResultStartM = date("F", strtotime($oRQ["tournStartDate"])); $otherResultStartY = date("Y", strtotime($oRQ["tournStartDate"])); $otherResultLoc = $oRQ["tournLocation"]; if (trim($otherResultTitle) == "") { $otherResultTitle = "$otherResultLoc $otherResultStartM $otherResultStartY"; } ?> <li><a href="<?php echo $url . $LANG_MENU_KNOCKOUT_URL ."/". $tournamentGroupURL ."/". $otherResultURL ?>.html"><?php echo $otherResultTitle ?></a></li> <?php } ?> </ul> </div> <?php } ?> <a id="rulesLink" data-t="k" data-r="<?php echo $groupType ?>"><?php echo $LANG_KNOCKOUT_RULES ?></a> <?php } ?> <div class="pageLinks"> <h3><?php echo $LANG_OTHER_KNOCKOUTS ?></h3> <ul> <?php $tournamentGroupsQuery = mysqli_query($conn, "SELECT * FROM knockoutGroups WHERE id != '$tournamentType' ORDER BY id ASC"); while ($tGQ = mysqli_fetch_array($tournamentGroupsQuery)) { $tournamentGroupID = $tGQ["id"]; $tournamentGroupURL = $tGQ["pageURL"]; $tournamentGroupTitle = $tGQ["groupTitle"]; ?> <li><a href="<?php echo $url . $LANG_MENU_KNOCKOUT_URL ."/". $tournamentGroupURL ?>"><?php echo $tournamentGroupTitle ?></a></li> <?php } ?> </ul> </div> </div> </div> </div> <?php include "footer.php"; ?>