-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfarm_power_rankings.php
203 lines (182 loc) · 9.83 KB
/
farm_power_rankings.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
<?php include('Connections/settings.php'); ?>
<?php include("includes/sessionInfo.php") ?>
<?php include("includes/functions.php") ?>
<?php include("includes/langfile.php") ?>
<?php include("includes/langs.php") ?>
<?php
switch ($lang){
case 'en':
$l_Playoff_Z = "Clinched Conference";
$l_Playoff_E = "Clinched Playoff spot";
$l_Playoff_Y = "Clinched Division";
$l_Playoff_P = "Clinched League Title";
$l_Playoff_X = "";
$l_GF_D = "Goals For";
$l_GA_D = "Goals Against";
$l_TeamName = "Team";
$l_Rank = "Rank";
$l_W = "W";
$l_L = "L";
$l_OT = "OT";
$l_Key = "Key Injuries";
$l_Record = "Overall Record";
$l_Last10 = "Last 10 Games";
$l_Streak = "Streak";
break;
case 'fr':
$l_Playoff_Z = "assuré du titre de conférence";
$l_Playoff_E = "assuré d'une place en séries";
$l_Playoff_Y = "assuré du titre de division";
$l_Playoff_P = "assuré du titre de league";
$l_GF_D = "But";
$l_GA_D = "But contre";
$l_TeamName = "équipe";
$l_Rank = "Rank";
$l_W = "V";
$l_L = "D";
$l_OT = "PR";
$l_Key = "Dommages";
$l_Record = "Overall Record";
$l_Last10 = "Dernieres 10 parties";
$l_L10 = "10 Derniers";
$l_Streak = "Séquence";
break;
}
$season_id = 0;
if (isset($_POST['season_id'])) {
$season_id = (get_magic_quotes_gpc()) ? $_POST['season_id'] : addslashes($_POST['season_id']);
}
if (isset($_GET['season_id'])) {
$season_id = (get_magic_quotes_gpc()) ? $_GET['season_id'] : addslashes($_GET['season_id']);
}
if ($season_id == ""){
$season_id = $_SESSION['current_SeasonID'];
}
$query_GetStandings = sprintf("SELECT farmteamstandings.Last10SOW, farmteamstandings.Last10SOL, farmteamstandings.Last10OTW, farmteamstandings.Last10OTL, farmteamstandings.Last10W, farmteamstandings.Last10L, farmteamstandings.Last10T, farmteamstandings.Streak, farmteamstandings.StandingPlayoffTitle, farmteamstandings.PowerRanking, ((farmteamstandings.W + farmteamstandings.OTW + farmteamstandings.SOW) / farmteamstandings.GP) as WinPercentage, (farmteamstandings.GF / farmteamstandings.GA) as GoalPercentage, farmteam.LogoSmall, farmteam.LogoTiny, farmteamstandings.HomeW, farmteamstandings.HomeL, farmteamstandings.HomeSOL, farmteamstandings.HomeSOW, farmteamstandings.HomeOTL, farmteamstandings.HomeOTW, farmteamstandings.GP, farmteamstandings.W, farmteamstandings.Point, farmteamstandings.L, farmteamstandings.OTW, farmteamstandings.GF, farmteamstandings.GA, farmteamstandings.OTL, farmteamstandings.SOW, farmteamstandings.SOL, farmteam.Division, farmteam.Conference, farmteam.Name, farmteam.City, farmteam.Number FROM farmteamstandings, farmteam WHERE farmteam.Number=farmteamstandings.Number AND farmteamstandings.Season_ID='%s' ORDER BY farmteamstandings.PowerRanking asc",$_SESSION['current_SeasonID']);
$GetStandings = mysql_query($query_GetStandings, $connection) or die(mysql_error());
$row_GetStandings = mysql_fetch_assoc($GetStandings);
?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title><?php echo $l_nav_PowerRankings;?> - <?php echo $_SESSION['SiteName'] ; ?></title>
<link rel="shortcut icon" type="image/png" href="<?php echo $_SESSION['DomainName']; ?>/image/<?php echo $_SESSION['FavIcon'];?>" />
<link rel="stylesheet" type="text/css" href="<?php echo $_SESSION['DomainName']; ?>/css/reset.css">
<link rel="stylesheet" type="text/css" href="<?php echo $_SESSION['DomainName']; ?>/css/html5.css">
<link rel="stylesheet" type="text/css" href="<?php echo $_SESSION['DomainName']; ?>/css/menu.css">
<link rel="stylesheet" type="text/css" href="<?php echo $_SESSION['DomainName']; ?>/css/jquery.accessible-news-slider.css" />
<link rel="stylesheet" type="text/css" href="<?php echo $_SESSION['DomainName']; ?>/css/jquery-ui-1.8.custom.css" />
<link rel="stylesheet" type="text/css" href="<?php echo $_SESSION['DomainName']; ?>/css/header.css" />
<link rel="stylesheet" type="text/css" href="<?php echo $_SESSION['DomainName']; ?>/css/tipsy.css">
<link rel="stylesheet" type="text/css" href="<?php echo $_SESSION['DomainName']; ?>/css/bubbletip.css" />
<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/jcarousellite_1.0.1c4.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/formly.min.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/jquery.pop.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/jquery.tipsy.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/ui.core.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/jquery-ui-1.8.custom.min.js"></script>
<?php if(isset($_SESSION['username'])){ ?>
<link rel="stylesheet" type="text/css" href="<?php echo $_SESSION['DomainName']; ?>/css/chat.css" />
<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/chat.js"></script>
<?php } ?>
<!--[if lte IE 9]>
<script src="<?php echo $_SESSION['DomainName']; ?>/js/html5.js" type="text/javascript"></script>
<![endif]-->
<script type="text/javascript">
$(function(){
$('#cssdropdown li.headlink').hover(
function() { $('ul', this).css('display', 'block'); },
function() { $('ul', this).css('display', 'none'); });
});;
</script>
<style media="all" type="text/css">
#container {background-image:url(<?php echo $_SESSION['DomainName']; ?>/image/headers/<?php echo $_SESSION['current_Farm_HeaderImage']; ?>); background-color:#<?php echo $_SESSION['current_Farm_PrimaryColor'];?>;}
a {color:#<?php echo $_SESSION['current_Farm_PrimaryColor']; ?>;}
table.tablesorter thead tr th { background-color: #<?php echo $_SESSION['current_Farm_SecondaryColor']; ?>; color:#<?php echo $_SESSION['current_Farm_TextColor']; ?>;}
table.tablesorterRates thead tr th { background-color: #<?php echo $_SESSION['current_Farm_SecondaryColor']; ?>; color:#<?php echo $_SESSION['current_Farm_TextColor']; ?>;}
table.tablesorter thead tr th a{ color:#<?php echo $_SESSION['current_Farm_TextColor']; ?>;}
table.tablesorterRates thead tr th a{ color:#<?php echo $_SESSION['current_Farm_TextColor']; ?>;}
footer { background-color:#<?php echo $_SESSION['current_Farm_PrimaryColor']; ?>;}
h3 {color:#<?php echo $_SESSION['current_Farm_PrimaryColor']; ?>;}
#cssdropdown, #cssdropdown ul {
background-color:#<?php echo $_SESSION['current_Farm_PrimaryColor']; ?>;
}
</style>
</head>
<body>
<div align="center">
<div id="wrapper">
<?php include("includes/header.php"); ?>
<?php include("includes/nav.php"); ?>
<article>
<!-- RIGHT HAND SIDE BAR GOES HERE -->
<!--<aside></aside>-->
<!-- MAIN PAGE CONTENT GOES HERE -->
<section>
<h1><?php echo $l_nav_PowerRankings;?></h1>
<br clear="all" />
<table cellspacing="0" border="0" width="100%" class="tablesorterRates" >
<thead>
<tr>
<th width="20"><?php echo $l_Rank;?></th>
<th width="20"></th>
<th width="150"><?php echo $l_TeamName;?></th>
<th width="100"><?php echo $l_Last10;?></th>
<th width="100"><?php echo $l_Streak;?></th>
<th><?php echo $l_Key;?></th>
</tr>
</thead>
<tbody>
<?php do {
$TotalWins = $row_GetStandings['W'] + $row_GetStandings['OTW'] + $row_GetStandings['SOW'];
$TotalOT = $row_GetStandings['OTL'] + $row_GetStandings['SOL'];
$HomeWins = $row_GetStandings['HomeW'] + $row_GetStandings['HomeOTW'] + $row_GetStandings['HomeSOW'];
$HomeOTLosses = $row_GetStandings['HomeOTL'] + $row_GetStandings['HomeSOL'];
$HomeRecord = $HomeWins."-".$row_GetStandings['HomeL']."-".$HomeOTLosses;
$VisitWins = $TotalWins - $HomeWins;
$VisitOTLosses = $TotalOT - $HomeOTLosses;
$VisitLoss = $row_GetStandings['L'] - $row_GetStandings['HomeL'];
$VisitRecord = $VisitWins."-".$VisitLoss."-".$VisitOTLosses;
?>
<tr>
<td align="center"><?php echo $row_GetStandings['PowerRanking']; ?></td>
<td align="center"><img border="0" src="<?php echo $_SESSION['DomainName']; ?>/image/logos/small/<?php echo $row_GetStandings['LogoTiny']; ?>"></img></td>
<td nowrap="nowrap" align="center"><a href="farm_roster.php?team=<?php echo $row_GetStandings['Number']; ?>"><?php echo $row_GetStandings['City']." ".$row_GetStandings['Name']; ?></a></td>
<td align="center"><?php echo ($row_GetStandings['Last10W'] + $row_GetStandings['Last10OTW'] + $row_GetStandings['Last10SOW'])."-".$row_GetStandings['Last10L']."-".($row_GetStandings['Last10OTL']+$row_GetStandings['Last10SOL']); ?></td>
<td align="center"><?php echo $row_GetStandings['Streak']; ?></td>
<td align="center"><?php
$query_GetSkaters = sprintf("SELECT players.Name, '1' as Position FROM players WHERE players.Team='%s' AND players.Injury <> '' AND players.Status1 <= 1 UNION ALL SELECT goalies.Name, '5' as Position FROM goalies WHERE goalies.Team='%s' AND goalies.Injury <> '' AND goalies.Status1 <= 1", $row_GetStandings['Number'], $row_GetStandings['Number'] );
$GetSkaters = mysql_query($query_GetSkaters, $connection) or die(mysql_error());
$row_GetSkaters = mysql_fetch_assoc($GetSkaters);
$totalRows_GetSkaters = mysql_num_rows($GetSkaters);
$TempSkaterCount = 1;
do {
if($row_GetSkaters['Position']==5){
$tmpTargetFile="goalie.php";
} else {
$tmpTargetFile="player.php";
}
echo '<a href="'.$tmpTargetFile.'?team='.$row_GetStandings['Number'].'&Player='.$row_GetSkaters['Name'].'">'.$row_GetSkaters['Name']."</a>";
if ($TempSkaterCount << ($totalRows_GetSkaters) && $totalRows_GetSkaters != 0){
echo ", ";
}
$TempSkaterCount = $TempSkaterCount + 1;
} while ($row_GetSkaters = mysql_fetch_assoc($GetSkaters));
mysql_free_result($GetSkaters);
$TempSkaterCount = 0;
?></td>
</tr>
<?php
} while ($row_GetStandings = mysql_fetch_assoc($GetStandings));
echo "</tbody></table>";
?>
</section>
</article>
<?php include("includes/footer.php"); ?>
<?php include("includes/statusBar.php"); ?>
</div>
</div>
</body>
</html>