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/ |
Upload File : |
<?php include "globalVars.php"; $leagueGroupURL = cleanPost($_GET["group"], $conn); $leagueURL = cleanPost($_GET["leagueURL"], $conn); $leagueType = $leagueGroupURL; $thisParentID = 3; $thisPageID = 5; $leagueIDQuery = mysqli_query($conn, "SELECT id, groupTitle FROM leagueGroups WHERE pageURL = '$leagueType'"); while ($lIQ = mysqli_fetch_array($leagueIDQuery)) { $groupType = $lIQ["id"]; $groupTitle = $lIQ["groupTitle"]; } $tournamentGroup = $groupTitle; $leagueQuery = mysqli_query($conn, "SELECT * FROM leagueConfig WHERE leagueType = '$groupType' AND (pageURL = '$leagueURL')"); if (mysqli_num_rows($leagueQuery) == 0) { $leagueTypeParentURL = $url . $LANG_MENU_LEAGUE_URL ."/". $leagueGroupURL; header("Location:$leagueTypeParentURL"); } else { while ($lQ = mysqli_fetch_array($leagueQuery)) { $leagueID = $lQ["id"]; $leagueLink = $lQ["pageURL"]; $lFullSDate = $lQ["startDate"]; $lStartDate = date("jS", strtotime($lFullSDate)); $lStartMonth = date("F", strtotime($lFullSDate)); $lStartYear = date("Y", strtotime($lFullSDate)); $leagueStartDate = "$lStartMonth $lStartYear"; $leagueTitle = "$lStartMonth $lStartYear"; $hasMiniLeagues = $lQ["hasMiniLeagues"]; $hasPlayoff = $lQ["hasPlayoff"]; $pointsWin = $lQ["pointsWin"]; $pointsDraw = $lQ["pointsDraw"]; $pointsRink = $lQ["pointsRink"]; $leagueText = $lQ["leagueText"]; } $headerTitle = "$groupTitle $leagueTitle"; $pageTitle = $leagueTitle; if ($hasMiniLeagues > 1) { $tablesTitle = $LANG_LEAGUE_TABLES_TITLE; } else { $tablesTitle = $LANG_LEAGUE_TABLE_TITLE; } $miniLeaguesArray = array(); $miniLeaguesQuery = mysqli_query($conn, "SELECT * FROM leagueMiniLeagues WHERE leagueID = '$leagueID' ORDER BY id ASC"); while ($mLQ = mysqli_fetch_array($miniLeaguesQuery)) { $miniLeaguesArray[] = $mLQ["id"]; } $fixturesWeekQuery = mysqli_query($conn, "SELECT DISTINCT(weekID) FROM leagueResults WHERE miniLeagueID IN ('". implode("', '", $miniLeaguesArray) ."') AND (homeScore < '0') AND (awayScore < '0') ORDER BY weekID ASC"); $hasFixtures = mysqli_num_rows($fixturesWeekQuery); if ($hasFixtures == 0) { $resultsOrder = "ASC"; } else { $resultsOrder = "DESC"; } $resultsWeekQuery = mysqli_query($conn, "SELECT DISTINCT(weekID) FROM leagueResults WHERE miniLeagueID IN ('". implode("', '", $miniLeaguesArray) ."') AND (homeScore >= '0') AND (awayScore >= '0') ORDER BY weekID $resultsOrder"); $hasResults = mysqli_num_rows($resultsWeekQuery); } $roundTitles = array(9999 => $LANG_ROUND_FINAL, 9998 => $LANG_ROUND_SEMI_FINAL, 9997 => $LANG_ROUND_QTR_FINAL, 99999 => $LANG_ROUND_FINAL, 99998 => $LANG_ROUND_SEMI_FINAL, 99997 => $LANG_ROUND_QTR_FINAL); 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_LEAGUE_URL ?>" itemprop="item"><span itemprop="name"><?php echo $LANG_MENU_LEAGUE_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_LEAGUE_URL ."/". $leagueGroupURL ?>" itemprop="item"><span itemprop="name"><?php echo $groupTitle ?></span></a><meta itemprop="position" content="3" /></li> <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="<?php echo $url . $LANG_MENU_LEAGUE_URL ."/". $leagueGroupURL ."/". $leagueLink ?>.html" itemprop="item"><span itemprop="name"><?php echo $leagueTitle ?></span></a><meta itemprop="position" content="4" /></li> </ol> </div> </div> <div class="mainContent tb40"> <div class="container"> <div class="pageLeft"> <div class="mainContent b20"> <h2><?php echo $leagueTitle ?></h2> <?php echo $leagueText; ?> </div> <div id="tabNav"> <?php if ($hasResults > 0) { ?> <a id="showResultsTab" class="currentSelTab"><?php echo $LANG_LEAGUE_RESULTS_TITLE ?></a> <?php } if ($hasFixtures > 0) { ?> <a id="showFixturesTab"<?php if ($hasResults == 0) {?> class="currentSelTab"<?php } ?>><?php echo $LANG_LEAGUE_FIXTURES_TITLE ?></a> <?php } ?> <a id="showTableTab"<?php if ( ($hasResults == 0) && ($hasFixtures == 0)) {?> class="currentSelTab"<?php } ?>><?php echo $tablesTitle ?></a> </div> <?php if ($hasResults > 0) { ?> <div id="ResultsTab" class="mainContent tabContent currentTab"> <h3><?php echo $LANG_LEAGUE_RESULTS_TITLE ?></h3> <div class="resultsContainer"> <?php while ($rWQ = mysqli_fetch_array($resultsWeekQuery)) { $weekID = $rWQ["weekID"]; if ($weekID > 999) { $weekTitle = $roundTitles[$weekID]; } else { $weekTitle = "$LANG_LEAGUE_WEEK_TITLE $weekID"; } $leg = 0; $resultsDateQuery = mysqli_query($conn, "SELECT DISTINCT(fixtureDate) FROM leagueResults WHERE miniLeagueID IN ('". implode("', '", $miniLeaguesArray) ."') AND (weekID = '$weekID') ORDER BY fixtureDate $resultsOrder, id $resultsOrder"); while ($rDQ = mysqli_fetch_array($resultsDateQuery)) { $weekDateSQL = $rDQ["fixtureDate"]; $weekDate = date("jS F, Y", strtotime($weekDateSQL)); $weekDateTitle = $weekTitle; if ($weekID > 999) { if ($hasPlayoff == 1 || $hasPlayoff == 3) { if ($resultsOrder == "ASC") { $firstLegID = 0; } else { $firstLegID = 1; } if ($leg == $firstLegID) { $weekDateTitle .= " 1st Leg"; } else { $weekDateTitle .= " 2nd Leg"; } } } ?> <div class="weekFixtureResult"> <div class="weekTitle"><?php echo $weekDateTitle ?></div> <div class="weekDate"><?php echo $weekDate ?></div> <div class="fixturesLegend"> <div class="homeTeam"> <div class="teamName"> </div> <?php if ($pointsRink != 0) { ?> <div class="teamRink">Rink Pts</div> <?php } ?> <div class="teamScore">Score</div> </div> <div class="fixturesVersus"> </div> <div class="awayTeam"> <div class="teamScore">Score</div> <?php if ($pointsRink != 0) { ?> <div class="teamRink">Rink Pts</div> <?php } ?> <div class="teamName"> </div> </div> </div> <?php $miniLeagueQuery = mysqli_query($conn, "SELECT * FROM leagueMiniLeagues WHERE leagueID = '$leagueID' ORDER BY id ASC"); while ($mLQ = mysqli_fetch_array($miniLeagueQuery)) { $miniLeagueID = $mLQ["id"]; $miniLeagueTitle = $mLQ["miniLeagueTitle"]; if ( (mysqli_num_rows($miniLeagueQuery) > 1) && ($weekID < 1000)) { ?> <div class="fixturesGroup"> <div class="fixturesGroupTitle"><?php echo $miniLeagueTitle ?></div> <?php } $fixturesVenue = 0; $fixturesVenueQuery = mysqli_query($conn, "SELECT fixtureVenue FROM leagueResults WHERE miniLeagueID = '$miniLeagueID' AND (weekID = '$weekID') AND (fixtureDate = '$weekDateSQL')"); while ($fVQ = mysqli_fetch_array($fixturesVenueQuery)) { $fixturesVenue = $fVQ["fixtureVenue"]; } if ($fixturesVenue > 0) { $venueQuery = mysqli_query($conn, "SELECT clubName FROM localClubs WHERE id = '$fixturesVenue'"); while ($vQ = mysqli_fetch_array($venueQuery)) { $clubVenue = $vQ["clubName"]; } ?> <div class="<?php if ($weekID < 1000) {?>fixturesGroupTitle<?php } else {?>fixturesGroupTitleR<?php } ?> fixturesGroupVenue">Venue: <?php echo $clubVenue ?></div> <?php } $resultsQuery = mysqli_query($conn, "SELECT * FROM leagueResults WHERE miniLeagueID = '$miniLeagueID' AND (weekID = '$weekID') AND (fixtureDate = '$weekDateSQL') AND (homeScore >= '0') AND (awayScore >= '0') ORDER BY id ASC"); while ($rQ = mysqli_fetch_array($resultsQuery)) { $homeTeam = $rQ["homeTeam"]; $homeScore = $rQ["homeScore"]; $homeRinkPts = $rQ["homeRinkPts"]; $awayTeam = $rQ["awayTeam"]; $awayScore = $rQ["awayScore"]; $awayRinkPts = $rQ["awayRinkPts"]; ?> <div class="fixturesMatch"> <div class="homeTeam"> <div class="teamName"><?php echo $homeTeam ?></div> <?php if ($pointsRink != 0) { ?> <div class="teamRink"><?php echo $homeRinkPts ?></div> <?php } ?> <div class="teamScore"><?php echo $homeScore ?></div> </div> <div class="fixturesVersus">Vs</div> <div class="awayTeam"> <div class="teamScore"><?php echo $awayScore ?></div> <?php if ($pointsRink != 0) { ?> <div class="teamRink"><?php echo $awayRinkPts ?></div> <?php } ?> <div class="teamName"><?php echo $awayTeam ?></div> </div> </div> <?php } if ( (mysqli_num_rows($miniLeagueQuery) > 1) && ($weekID < 1000)) { ?> </div> <?php } } ?> </div> <?php $leg++; } } ?> </div> </div> <?php } if ($hasFixtures > 0) { ?> <div id="FixturesTab" class="mainContent tabContent<?php if ($hasResults == 0) {?> currentTab<?php } ?>"> <h3><?php echo $LANG_LEAGUE_FIXTURES_TITLE ?></h3> <div class="fixturesContainer"> <?php while ($fWQ = mysqli_fetch_array($fixturesWeekQuery)) { $weekID = $fWQ["weekID"]; if ($weekID > 999) { $weekTitle = $roundTitles[$weekID]; } else { $weekTitle = "$LANG_LEAGUE_WEEK_TITLE $weekID"; } $leg = 0; $fixturesDateQuery = mysqli_query($conn, "SELECT DISTINCT(fixtureDate) FROM leagueResults WHERE miniLeagueID IN ('". implode("', '", $miniLeaguesArray) ."') AND (weekID = '$weekID') ORDER BY fixtureDate ASC, id ASC"); while ($fDQ = mysqli_fetch_array($fixturesDateQuery)) { $weekDateSQL = $fDQ["fixtureDate"]; $weekDate = date("jS F, Y", strtotime($weekDateSQL)); $weekDateTitle = $weekTitle; if ($weekID > 999) { if ($hasPlayoff == 1 || $hasPlayoff == 3) { if ($leg == 0) { $weekDateTitle .= " 1st Leg"; } else { $weekDateTitle .= " 2nd Leg"; } } } ?> <div class="weekFixtureResult"> <div class="weekTitle"><?php echo $weekDateTitle ?></div> <div class="weekDate"><?php echo $weekDate ?></div> <?php $miniLeagueQuery = mysqli_query($conn, "SELECT * FROM leagueMiniLeagues WHERE leagueID = '$leagueID' ORDER BY id ASC"); while ($mLQ = mysqli_fetch_array($miniLeagueQuery)) { $miniLeagueID = $mLQ["id"]; $miniLeagueTitle = $mLQ["miniLeagueTitle"]; if ( (mysqli_num_rows($miniLeagueQuery) > 1) && ($weekID < 1000)) { ?> <div class="fixturesGroup fixturesGroupNL"> <div class="fixturesGroupTitle"><?php echo $miniLeagueTitle ?></div> <?php } $fixturesVenue = 0; $fixturesVenueQuery = mysqli_query($conn, "SELECT fixtureVenue FROM leagueResults WHERE miniLeagueID = '$miniLeagueID' AND (weekID = '$weekID') AND (fixtureDate = '$weekDateSQL')"); while ($fVQ = mysqli_fetch_array($fixturesVenueQuery)) { $fixturesVenue = $fVQ["fixtureVenue"]; } if ($fixturesVenue > 0) { $venueQuery = mysqli_query($conn, "SELECT clubName FROM localClubs WHERE id = '$fixturesVenue'"); while ($vQ = mysqli_fetch_array($venueQuery)) { $clubVenue = $vQ["clubName"]; } ?> <div class="<?php if ($weekID < 1000) {?>fixturesGroupTitle<?php } else {?>fixturesGroupTitleR<?php } ?> fixturesGroupVenue">Venue: <?php echo $clubVenue ?></div> <?php } $resultsQuery = mysqli_query($conn, "SELECT * FROM leagueResults WHERE miniLeagueID = '$miniLeagueID' AND (weekID = '$weekID') AND (fixtureDate = '$weekDateSQL') AND (homeScore < '0') AND (awayScore < '0') ORDER BY id ASC"); while ($rQ = mysqli_fetch_array($resultsQuery)) { $homeTeam = $rQ["homeTeam"]; $homeScore = ""; $homeRinkPts = ""; $awayTeam = $rQ["awayTeam"]; $awayScore = ""; $awayRinkPts = ""; ?> <div class="fixturesMatch"> <div class="homeTeam"> <div class="teamName"><?php echo $homeTeam ?></div> <?php if ($pointsRink != 0) { ?> <div class="teamRink"><?php echo $homeRinkPts ?></div> <?php } ?> <div class="teamScore"><?php echo $homeScore ?></div> </div> <div class="fixturesVersus">Vs</div> <div class="awayTeam"> <div class="teamScore"><?php echo $awayScore ?></div> <?php if ($pointsRink != 0) { ?> <div class="teamRink"><?php echo $awayRinkPts ?></div> <?php } ?> <div class="teamName"><?php echo $awayTeam ?></div> </div> </div> <?php } if ( (mysqli_num_rows($miniLeagueQuery) > 1) && ($weekID < 1000)) { ?> </div> <?php } } ?> </div> <?php $leg++; } } ?> </div> </div> <?php } ?> <div id="TableTab" class="mainContent tabContent<?php if ( ($hasResults == 0) && ($hasFixtures == 0)) {?> currentTab<?php } ?>"> <h3><?php echo $tablesTitle ?></h3> <?php $miniLeagueQuery = mysqli_query($conn, "SELECT * FROM leagueMiniLeagues WHERE leagueID = '$leagueID' ORDER BY id ASC"); while ($mLQ = mysqli_fetch_array($miniLeagueQuery)) { $miniLeagueID = $mLQ["id"]; $miniLeagueTitle = $mLQ["miniLeagueTitle"]; ?> <h4><?php echo $miniLeagueTitle ?></h4> <table class="leagueTable"> <thead> <th class="tN"> </th> <th class="tS" title="<?php echo $LANG_LEAGUE_PLD_TITLE ?>">P</th> <th class="tS" title="<?php echo $LANG_LEAGUE_W_TITLE ?>">W</th> <th class="tS" title="<?php echo $LANG_LEAGUE_D_TITLE ?>">D</th> <th class="tS" title="<?php echo $LANG_LEAGUE_L_TITLE ?>">L</th> <th class="tM" title="<?php echo $LANG_LEAGUE_SHOT_F_TITLE ?>">SF</th> <th class="tM" title="<?php echo $LANG_LEAGUE_SHOT_A_TITLE ?>">SA</th> <th class="tL" title="<?php echo $LANG_LEAGUE_SHOT_DIFF_TITLE ?>">Diff</th> <?php if ($pointsRink != 0) { ?> <th class="tL" title="<?php echo $LANG_LEAGUE_RINK_PTS_TITLE ?>">Rink Pts</th> <?php } ?> <th class="tL tP" title="<?php echo $LANG_LEAGUE_PTS_TITLE ?>">Pts</th> </thead> <tbody> <?php $leagueStandingQuery = mysqli_query($conn, "SELECT team, COUNT(*) AS played, COUNT(CASE WHEN homeScore > awayScore THEN 1 END) AS won, COUNT(CASE WHEN homeScore = awayScore THEN 1 END) AS drawn, COUNT(CASE WHEN awayScore> homeScore THEN 1 END) AS lost, SUM(homeScore) AS shotsFor, SUM(awayScore) AS shotsAgainst, SUM(homeScore) - SUM(awayScore) AS shotsDiff, SUM(homeRinkPts) AS rinkPts, SUM( CASE WHEN homeScore > awayScore THEN $pointsWin ELSE 0 END + CASE WHEN homeScore = awayScore THEN $pointsDraw ELSE 0 END + homeRinkPts ) AS pts FROM ( SELECT homeTeam AS team, homeScore, awayScore, homeRinkPts, awayRinkPts from leagueResults WHERE miniLeagueID = '$miniLeagueID' AND ((homeTeam != '') AND (awayTeam != '')) AND ((homeScore >= 0) AND (awayScore >= 0)) AND (weekID < 900) UNION ALL SELECT awayTeam AS team, awayScore, homeScore, awayRinkPts, homeRinkPts from leagueResults WHERE miniLeagueID = '$miniLeagueID' AND ((homeTeam != '') AND (awayTeam != '')) AND ((homeScore >= 0) AND (awayScore >= 0)) AND (weekID < 900) ) AS a GROUP BY team ORDER BY pts DESC, shotsDiff DESC") or die (mysqli_error($conn)); if (mysqli_num_rows($leagueStandingQuery) > 0) { $addedTeams = array(); while ($lSQ = mysqli_fetch_array($leagueStandingQuery)) { $teamName = $lSQ["team"]; $addedTeams[] = $teamName; $matchesPlayed = $lSQ["played"]; $matchesWon = $lSQ["won"]; $matchesDrawn = $lSQ["drawn"]; $matchesLost = $lSQ["lost"]; $shotsFor = $lSQ["shotsFor"]; $shotsAgainst = $lSQ["shotsAgainst"]; $shotsDiff = $lSQ["shotsDiff"]; $rinkPts = $lSQ["rinkPts"]; $totalPts = $lSQ["pts"]; ?> <tr> <td class="tN"><?php echo $teamName ?></td> <td class="tS"><?php echo $matchesPlayed ?></td> <td class="tS"><?php echo $matchesWon ?></td> <td class="tS"><?php echo $matchesDrawn ?></td> <td class="tS"><?php echo $matchesLost ?></td> <td class="tM"><?php echo $shotsFor ?></td> <td class="tM"><?php echo $shotsAgainst ?></td> <td class="tL"><?php echo $shotsDiff ?></td> <?php if ($pointsRink != 0) { ?> <td class="tL"><?php echo $rinkPts ?></td> <?php } ?> <td class="tL tP"><?php echo $totalPts ?></td> </tr> <?php } $defaultLeagueQuery = mysqli_query($conn, "SELECT * FROM leagueMiniLeaguesTeams WHERE miniLeagueID = '$miniLeagueID' AND (teamName NOT IN ('". implode("', '", $addedTeams) ."')) ORDER BY teamName ASC"); while ($dLQ = mysqli_fetch_array($defaultLeagueQuery)) { $missingTeamName = $dLQ["teamName"]; ?> <tr> <td class="tN ttt"><?php echo $missingTeamName ?></td> <td class="tS">0</td> <td class="tS">0</td> <td class="tS">0</td> <td class="tS">0</td> <td class="tM">0</td> <td class="tM">0</td> <td class="tL">0</td> <?php if ($pointsRink != 0) { ?> <td class="tL">0</td> <?php } ?> <td class="tL tP">0</td> </tr> <?php } } else { $defaultLeagueQuery = mysqli_query($conn, "SELECT * FROM leagueMiniLeaguesTeams WHERE miniLeagueID = '$miniLeagueID' ORDER BY teamName ASC"); while ($dLQ = mysqli_fetch_array($defaultLeagueQuery)) { $teamName = $dLQ["teamName"]; ?> <tr> <td class="tN"><?php echo $teamName ?></td> <td>0</td> <td>0</td> <td>0</td> <td>0</td> <td>0</td> <td>0</td> <td>0</td> <?php if ($pointsRink != 0) { ?> <td>0</td> <?php } ?> <td class="tP">0</td> </tr> <?php } } ?> </tbody> </table> <?php } ?> </div> </div> <div class="pageRight"> <?php $otherResultsQuery = mysqli_query($conn, "SELECT * FROM leagueConfig WHERE leagueType = '$groupType' ORDER BY startDate DESC LIMIT 0,10"); if (mysqli_num_rows($otherResultsQuery) > 0) { ?> <div class="pageLinks"> <h3><?php echo str_replace("[[LEAGUE_TYPE]]", $groupTitle, $LANG_RECENT_LEAGUES) ?></h3> <ul> <?php while ($oRQ = mysqli_fetch_array($otherResultsQuery)) { $otherResultID = $oRQ["id"]; $otherResultURL = $oRQ["pageURL"]; $otherResultStartM = date("F", strtotime($oRQ["startDate"])); $otherResultStartY = date("Y", strtotime($oRQ["startDate"])); $otherResultTitle = "$groupTitle $otherResultStartM $otherResultStartY"; ?> <li><a href="<?php echo $url . $LANG_MENU_LEAGUE_URL ."/". $leagueGroupURL ."/". $otherResultURL ?>.html"><?php if ($otherResultID == $leagueID) { echo "<strong>"; } echo $otherResultTitle; if ($otherResultID == $leagueID) { echo "</strong>"; } ?></a></li> <?php } ?> </ul> </div> <?php } ?> <a id="rulesLink" data-t="l" data-r="<?php echo $groupType ?>"><?php echo $LANG_LEAGUE_RULES ?></a> <div class="pageLinks"> <h3><?php echo $LANG_OTHER_LEAGUES ?></h3> <ul> <?php $leagueGroupsQuery = mysqli_query($conn, "SELECT * FROM leagueGroups WHERE id != '$leagueType' ORDER BY id ASC"); while ($lGQ = mysqli_fetch_array($leagueGroupsQuery)) { $leagueGroupID = $lGQ["id"]; $leagueGroupURL = $lGQ["pageURL"]; $leagueGroupTitle = $lGQ["groupTitle"]; ?> <li><a href="<?php echo $url . $LANG_MENU_LEAGUE_URL ."/". $leagueGroupURL ?>"><?php echo $leagueGroupTitle ?></a></li> <?php } ?> </ul> </div> </div> </div> </div> <?php include "footer.php"; ?>