-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathCupWinner.php
64 lines (55 loc) · 3.21 KB
/
CupWinner.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
<?php include "Header.php";
If ($lang == "fr"){include 'LanguageFR-League.php';}else{include 'LanguageEN-League.php';}
$Title = (string)"";
If (file_exists($DatabaseFile) == false){
Goto STHSErrorCupWinner;
}else{try{
$LeagueName = (string)"";
$db = new SQLite3($DatabaseFile);
$Query = "Select Name, NumbersOfTeam from LeagueGeneral";
$LeagueGeneral = $db->querySingle($Query,true);
$LeagueName = $LeagueGeneral['Name'];
If (file_exists($CareerStatDatabaseFile) == true){ /* CareerStat */
$CareerStatdb = new SQLite3($CareerStatDatabaseFile);
$CareerDBFormatV2CheckCheck = $CareerStatdb->querySingle("SELECT Count(name) AS CountName FROM sqlite_master WHERE type='table' AND name='LeagueGeneral'",true);
If ($CareerDBFormatV2CheckCheck['CountName'] == 1){
$Query = "Select MainTable.*, TeamProInfoHistory.Name as ProTeam , TeamFarmInfoHistory.Name as FarmTeam FROM (SELECT Year,Playoff, PlayOffWinnerPro, PlayOffWinnerFarm From LeagueGeneral Where Playoff = 'True' ORDER BY Year DESC) as MainTable LEFT JOIN TeamFarmInfoHistory ON (MainTable.PlayOffWinnerFarm = TeamFarmInfoHistory.Number) AND (MainTable.Year = TeamFarmInfoHistory.Year) AND (MainTable.Playoff = TeamFarmInfoHistory.Playoff) LEFT JOIN TeamProInfoHistory ON (MainTable.PlayOffWinnerPro = TeamProInfoHistory.Number) AND (MainTable.Year = TeamProInfoHistory.Year) AND (MainTable.Playoff = TeamProInfoHistory.Playoff)";
$CupWinner = $CareerStatdb->query($Query);
}else{
$CupWinner = Null;
}
}
echo "<title>" . $LeagueName . " - " . $CupWinnerLang['StanleyCupWinner'] . "</title>";
} catch (Exception $e) {
STHSErrorCupWinner:
$LeagueName = $DatabaseNotFound;
echo "<title>" . $DatabaseNotFound ."</title>";
echo "<style>.STHSCupWinner_MainDiv{display:none;}</style>";
}}?>
</head><body>
<?php include "Menu.php";?>
<div style="width:99%;margin:auto;" class="STHSCupWinner_MainDiv">
<?php echo "<h1>" . $CupWinnerLang['StanleyCupWinner'] . "</h1>"; ?>
<table class="STHSCupWinner_MainTable">
<thead><tr>
<th class="STHSCupWinner_Year"><?php echo $CupWinnerLang['Year'];?></th>
<th class="STHSCupWinner_Team"><?php echo $CupWinnerLang['ProTeam'];?></th>
<th class="STHSCupWinner_Team"><?php echo $CupWinnerLang['FarmTeam'];?></th>
</tr></thead><tbody>
<?php
if (empty($CupWinner) == false){while ($row = $CupWinner ->fetchArray()) {
echo "<tr><td>" . $row['Year'] . "</td><td>";
$Query = "Select TeamThemeID From TeamProInfo WHERE Number = " . $row['PlayOffWinnerPro'];
$TeamImage = $db->querySingle($Query,true);
If (isset($TeamImage['TeamThemeID']) == True){If ($TeamImage['TeamThemeID'] > 0){echo "<img src=\"" . $ImagesCDNPath . "/images/" . $TeamImage['TeamThemeID'] .".png\" alt=\"\" class=\"STHSCupWinner_Image\" /><br>";}}
echo $row['ProTeam'] . "</td><td>";
$Query = "Select TeamThemeID From TeamFarmInfo WHERE Number = " . $row['PlayOffWinnerFarm'];
$TeamImage = $db->querySingle($Query,true);
If (isset($TeamImage['TeamThemeID']) == True){If ($TeamImage['TeamThemeID'] > 0){echo "<img src=\"" . $ImagesCDNPath . "/images/" . $TeamImage['TeamThemeID'] .".png\" alt=\"\" class=\"STHSCupWinner_Image\" /><br>";}}
echo $row['FarmTeam'] . "</td></tr>";
}}
?>
</tbody></table>
<br>
</div>
<?php include "Footer.php";?>