-
Notifications
You must be signed in to change notification settings - Fork 0
/
farm_standings.php
807 lines (730 loc) · 42.4 KB
/
farm_standings.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
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
<?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_Change = "CHANGE SEASON";
$l_GF_D = "Goals For";
$l_GA_D = "Goals Against";
$l_GP = "GP";
$l_P = "Pts";
$l_W = "W";
$l_L = "L";
$l_OT = "OT";
$l_PCT = "PCT";
$l_GP_D = "Games Played";
$l_P_D = "Points";
$l_W_D = "Wins";
$l_L_D = "Loss";
$l_OT_D = "Overtime";
$l_HomeTeam = "HOME";
$l_AwayTeam = "AWAY";
$l_PointsSystem = "Point System";
$l_Win = "Win";
$l_Loss = "Loss";
$l_OTW = "OT Win";
$l_OTL = "OT Loss";
$l_SHOOT = "Shootout";
$l_Record = "Overall Record";
$l_Last10 = "Last 10 Games";
$l_L10 = "LAST 10";
$l_GF = "GF";
$l_GA = "GA";
$l_Streak = "Streak";
$l_PlayoffsbyRound = "Playoffs by Round";
$l_PlayoffsbyRecord = "Playoffs by Record";
$l_Playoff_R1 = "Conference Quarter-Finals";
$l_Playoff_R2 = "Conference Semi-Finals";
$l_Playoff_R3 = "Conference Finals";
$l_Playoff_R4 = "Finals";
$l_Leads="leads";
$l_Over="over";
$l_Tied = "tied";
$l_Series = "Series";
$l_Winner = "Winner";
$l_Looser = "Looser";
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_Change = "Changer de saison";
$l_GF_D = "But";
$l_GA_D = "But contre";
$l_GP = "PJ";
$l_P = "Pts";
$l_W = "V";
$l_L = "D";
$l_OT = "PR";
$l_PCT = "%EFF";
$l_GP_D = "Parties jouées";
$l_P_D = "Points";
$l_GAA_D = "Moyenne";
$l_W_D = "Victoires";
$l_L_D = "Défaites";
$l_OT_D = "Prolongation";
$l_HomeTeam = "DOMICILE";
$l_AwayTeam = "À L'ÉTRANGER";
$l_PointsSystem = "Système de pointage";
$l_Win = "Victoire";
$l_Loss = "Défaite";
$l_OTW = "Victoire en prolongation";
$l_OTL = "Défaite en prolongation";
$l_SHOOT = "Défaite en fusillade";
$l_Record = "Global";
$l_Last10 = "Dernieres 10 parties";
$l_L10 = "10 Derniers";
$l_GF = "BP";
$l_GA = "BC";
$l_Streak = "Séquence";
$l_PlayoffsbyRound = "Séries éliminatoires par rond";
$l_PlayoffsbyRecord = "Séries éliminatoires";
$l_Leads="leads";
$l_Over="au dessus";
$l_Tied = "tied";
$l_Playoff_R1 = "Division Semi-Final Conference";
$l_Playoff_R2 = "Série Demi-finale de conférence";
$l_Playoff_R3 = "Semi-Final Series";
$l_Playoff_R4 = "Finals";
$l_Series = "Séries";
$l_Winner = "Gagnant";
$l_Looser = "Défaite";
break;
}
$season_id = $_SESSION['current_SeasonID'];
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']);
}
$SID_GetStandings=$season_id;
$SORT = "Conference";
if (isset($_GET['sort'])) {
$SORT = (get_magic_quotes_gpc()) ? $_GET['sort'] : addslashes($_GET['sort']);
}
$query_GetInfo = sprintf("SELECT * FROM config");
$GetInfo = mysql_query($query_GetInfo, $connection) or die(mysql_error());
$row_GetInfo = mysql_fetch_assoc($GetInfo);
if($row_GetInfo['DivisionLeader'] == 'True'){
$tmpDivisionLeaderSQL = " DivisionLeader desc, ";
} else {
$tmpDivisionLeaderSQL = "";
}
$query_GetSeasonInfo = sprintf("SELECT * FROM seasons where S_ID=%s", $season_id);
$GetSeasonInfo = mysql_query($query_GetSeasonInfo, $connection) or die(mysql_error());
$row_GetSeasonInfo = mysql_fetch_assoc($GetSeasonInfo);
$query_GetSeasonsLink = sprintf("SELECT * FROM seasons");
$GetSeasonsLink = mysql_query($query_GetSeasonsLink, $connection) or die(mysql_error());
$row_GetSeasonsLink = mysql_fetch_assoc($GetSeasonsLink);
$totalRows_GetSeasonsLink = mysql_num_rows($GetSeasonsLink);
?>
<!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_standings;?> - <?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/ui.tabs.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/jquery.tablesorter.min.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.ttabs.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/ui.tabs.js"></script>
<script type="text/javascript" src="<?php echo $_SESSION['DomainName']; ?>/js/reflection.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(){
$("#tabs").ttabs();
$("table").tablesorter();
$('#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']; ?>;}
a:active {color:#<?php echo $_SESSION['current_Farm_SecondaryColor']; ?>;}
a:hover {color:#<?php echo $_SESSION['current_Farm_SecondaryColor']; ?>;}
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>
<div style="float:left; padding-bottom:2px"><h1><?php echo $l_nav_standings;?></h1></div>
<div style="float:right; padding-top:5px;">
<form action="farm_standings.php?sort=<?php echo $SORT; ?>" method="post" name="form1">
<select name="season_id" id="season_id">
<?php do {
if ($row_GetSeasonsLink['SeasonType'] == 2){
$SeasonType = $l_preseason;
} else if ($row_GetSeasonsLink['SeasonType'] == 1){
$SeasonType = $l_regularseason;
} else if ($row_GetSeasonsLink['SeasonType'] == 0){
$SeasonType = $l_playoffs;
}
?>
<option value="<?php echo $row_GetSeasonsLink['S_ID']; ?>" <?php if ($SID_GetStandings == $row_GetSeasonsLink['S_ID']){ echo "selected"; } ?>>
<?php
if ($row_GetSeasonsLink['SeasonType'] == 2){
echo $row_GetSeasonsLink['Season']." ".$SeasonType;
} else if ($row_GetSeasonsLink['SeasonType'] == 1){
echo $row_GetSeasonsLink['Season']."-".($row_GetSeasonsLink['Season']+1)." ".$SeasonType;
} else if ($row_GetSeasonsLink['SeasonType'] == 0){
echo ($row_GetSeasonsLink['Season']+1)." ".$SeasonType;
}
?></option>
<?php } while ($row_GetSeasonsLink = mysql_fetch_assoc($GetSeasonsLink)); ?>
</select><input type="submit" value="<?php echo $l_Change;?>" class="button" />
</form>
</div>
<br clear="all" />
<br />
<?php if ($row_GetSeasonInfo['SeasonType'] == 0){ ?>
<div id="tabs">
<div id="tabs-1">
<h3><?php echo $l_PlayoffsbyRound;?></h3>
<?php
$query_GetTotalRounds = sprintf("SELECT Round FROM farmschedule WHERE Season_ID=%s ORDER BY Round desc LIMIT 0,1", $SID_GetStandings);
$GetTotalRounds = mysql_query($query_GetTotalRounds, $connection) or die(mysql_error());
$row_GetTotalRounds = mysql_fetch_assoc($GetTotalRounds);
$totalRows_GetTotalRounds = mysql_num_rows($GetTotalRounds);
$query_GetRounds = sprintf("SELECT * FROM farmschedule WHERE Season_ID=%s GROUP BY VisitorTeam ORDER BY Round desc, VisitorTeam, Day", $SID_GetStandings);
$GetRounds = mysql_query($query_GetRounds, $connection) or die(mysql_error());
$row_GetRounds = mysql_fetch_assoc($GetRounds);
$totalRows_GetRounds = mysql_num_rows($GetRounds);
for( $r = $row_GetTotalRounds['Round']; $r > 0; $r-- ){
$query_GetRounds = sprintf("SELECT * FROM farmschedule WHERE Season_ID=%s AND Round=%s ORDER BY Round desc, VisitorTeam, Day", $SID_GetStandings, $r);
$GetRounds = mysql_query($query_GetRounds, $connection) or die(mysql_error());
$row_GetRounds = mysql_fetch_assoc($GetRounds);
$totalRows_GetRounds = mysql_num_rows($GetRounds);
$i=0;
$teamA = array();
$teamB = array();
$teamCurrent = array();
$Round = array();
$tmpRound=0;
$tmpSkipFirst=0;
$tmpRound = 0;
$CurrentRound = 0;
$tmpSkipFirst=0;
$FinalsCount=0;
do {
if($tmpRound != $row_GetRounds['Round']){$tmpRound = $row_GetRounds['Round'];}
if (! in_array($row_GetRounds['VisitorTeam'], $teamA)) {
if (! in_array($row_GetRounds['HomeTeam'], $teamA)) {
$i = $i + 1;
$Round[$i] = $row_GetRounds['Round'];
$teamA[$i] = $row_GetRounds['VisitorTeam'];
$teamB[$i] = $row_GetRounds['HomeTeam'];
}
}
} while ($row_GetRounds = mysql_fetch_assoc($GetRounds));
for( $j = 1; $j <= $i; $j++ )
{
$query_GetTeamA = sprintf("SELECT LogoSmall, City, Name, Number FROM farmteam WHERE Number=%s", $teamA[$j]);
$GetTeamA = mysql_query($query_GetTeamA, $connection) or die(mysql_error());
$row_GetTeamA = mysql_fetch_assoc($GetTeamA);
$totalRows_GetTeamA = mysql_num_rows($GetTeamA);
$query_GetTeamB = sprintf("SELECT LogoSmall, City, Name, Number FROM farmteam WHERE Number=%s", $teamB[$j]);
$GetTeamB = mysql_query($query_GetTeamB, $connection) or die(mysql_error());
$row_GetTeamB = mysql_fetch_assoc($GetTeamB);
$totalRows_GetTeamB = mysql_num_rows($GetTeamB);
$query_GetW = sprintf("SELECT * FROM farmschedule WHERE Season_ID=%s AND (VisitorTeam=%s OR HomeTeam=%s) AND Round=%s ORDER BY Day asc", $SID_GetStandings, $teamA[$j], $teamA[$j], $r);
$GetW = mysql_query($query_GetW, $connection) or die(mysql_error());
$row_GetW = mysql_fetch_assoc($GetW);
$totalRows_GetW = mysql_num_rows($GetW);
$tmpTS1=0;
$tmpTS2=0;
$k = 0;
$lastWin = "Home";
do{
$k=$k+1;
if($row_GetW['VisitorScore'] > $row_GetW['HomeScore'] && $k==1){$tmpTS1 = $tmpTS1 + 1;}
if($row_GetW['HomeScore'] > $row_GetW['VisitorScore'] && $k==1){$tmpTS2 = $tmpTS2 + 1;}
if($row_GetW['VisitorScore'] > $row_GetW['HomeScore'] && $k==2){$tmpTS1 = $tmpTS1 + 1;}
if($row_GetW['HomeScore'] > $row_GetW['VisitorScore'] && $k==2){$tmpTS2 = $tmpTS2 + 1;}
if($row_GetW['VisitorScore'] < $row_GetW['HomeScore'] && $k==3){$tmpTS1 = $tmpTS1 + 1;}
if($row_GetW['HomeScore'] < $row_GetW['VisitorScore'] && $k==3){$tmpTS2 = $tmpTS2 + 1;}
if($row_GetW['VisitorScore'] < $row_GetW['HomeScore'] && $k==4){$tmpTS1 = $tmpTS1 + 1;}
if($row_GetW['HomeScore'] < $row_GetW['VisitorScore'] && $k==4){$tmpTS2 = $tmpTS2 + 1;}
if($row_GetW['VisitorScore'] > $row_GetW['HomeScore'] && $k==5){$tmpTS1 = $tmpTS1 + 1;}
if($row_GetW['HomeScore'] > $row_GetW['VisitorScore'] && $k==5){$tmpTS2 = $tmpTS2 + 1;}
if($row_GetW['VisitorScore'] < $row_GetW['HomeScore'] && $k==6){$tmpTS1 = $tmpTS1 + 1;}
if($row_GetW['HomeScore'] < $row_GetW['VisitorScore'] && $k==6){$tmpTS2 = $tmpTS2 + 1;}
if($row_GetW['VisitorScore'] > $row_GetW['HomeScore'] && $k==7){$tmpTS1 = $tmpTS1 + 1;}
if($row_GetW['HomeScore'] > $row_GetW['VisitorScore'] && $k==7){$tmpTS2 = $tmpTS2 + 1;}
if($row_GetW['VisitorScore'] > $row_GetW['HomeScore']){$lastWin = "Visitor"; $lastHome=$row_GetW['HomeTeam']; $lastVisitor=$row_GetW['VisitorTeam'];}
if($row_GetW['VisitorScore'] < $row_GetW['HomeScore']){$lastWin = "Home"; $lastHome=$row_GetW['HomeTeam']; $lastVisitor=$row_GetW['VisitorTeam'];}
} while ($row_GetW = mysql_fetch_assoc($GetW));
if($r != $CurrentRound){
$CurrentRound = $r;
if($j >= 1){
echo '</tbody></table><br clear="all" />';
}
echo '<h3>';
if($r == 1){
echo $l_Playoff_R1;
} else if($r == 2){
echo $l_Playoff_R2;
} else if($r == 3){
echo $l_Playoff_R3;
} else if($r == 4){
echo $l_Playoff_R4;
}
echo '</h3>';
echo '<table cellspacing="0" border="0" width="100%" class="tablesorter">';
echo '<thead>';
echo '<tr>';
echo '<th width="50">'.$l_Series.'</th>';
echo '<th width="200">'.$l_Winner.'</th>';
echo '<th width="200">'.$l_Looser.'</th>';
echo '<th>'.$l_view_details.'</th>';
echo '</tr>';
echo '</thead>';
echo '<tbody>';
}
echo "<tr><td align=center style='vertical-align:middle;'><h1>";
if($tmpTS1 > $tmpTS2){
echo $tmpTS1."-".$tmpTS2;
} else if($tmpTS1 < $tmpTS2){
echo $tmpTS2."-".$tmpTS1;
} else {
echo $tmpTS2."-".$tmpTS1;
}
echo "</h1></td>";
if($lastWin=="Home"){
if($lastHome==$row_GetTeamB['Number']){
echo "<td align=center style='vertical-align:middle; height:150px'><a href='farm_stats.php?team=".$row_GetTeamB['Number']."&season_id=".$SID_GetStandings."'><img border='0' src='".$_SESSION['DomainName']."/image/logos/medium/".$row_GetTeamB['LogoSmall']."' alt='".$row_GetTeamB['City']." ".$row_GetTeamB['Name']."'></img></a></td>";
echo "<td align=center style='vertical-align:middle; height:150px'><a href='farm_stats.php?team=".$row_GetTeamA['Number']."&season_id=".$SID_GetStandings."'><img border='0' src='".$_SESSION['DomainName']."/image/logos/medium/".$row_GetTeamA['LogoSmall']."' alt='".$row_GetTeamA['City']." ".$row_GetTeamA['Name']."'></img></a></td>";
} else {
echo "<td align=center style='vertical-align:middle; height:150px'><a href='farm_stats.php?team=".$row_GetTeamA['Number']."&season_id=".$SID_GetStandings."'><img border='0' src='".$_SESSION['DomainName']."/image/logos/medium/".$row_GetTeamA['LogoSmall']."' alt='".$row_GetTeamA['City']." ".$row_GetTeamA['Name']."'></img></a></td>";
echo "<td align=center style='vertical-align:middle; height:150px'><a href='farm_stats.php?team=".$row_GetTeamB['Number']."&season_id=".$SID_GetStandings."'><img border='0' src='".$_SESSION['DomainName']."/image/logos/medium/".$row_GetTeamB['LogoSmall']."' alt='".$row_GetTeamB['City']." ".$row_GetTeamB['Name']."'></img></a></td>";
}
} else if($lastWin=="Visitor") {
if($lastVisitor==$row_GetTeamB['Number']){
echo "<td align=center style='vertical-align:middle; height:150px'><a href='farm_stats.php?team=".$row_GetTeamB['Number']."&season_id=".$SID_GetStandings."'><img border='0' src='".$_SESSION['DomainName']."/image/logos/medium/".$row_GetTeamB['LogoSmall']."' alt='".$row_GetTeamB['City']." ".$row_GetTeamB['Name']."'></img></a></td>";
echo "<td align=center style='vertical-align:middle; height:150px'><a href='farm_stats.php?team=".$row_GetTeamA['Number']."&season_id=".$SID_GetStandings."'><img border='0' src='".$_SESSION['DomainName']."/image/logos/medium/".$row_GetTeamA['LogoSmall']."' alt='".$row_GetTeamA['City']." ".$row_GetTeamA['Name']."'></img></a></td>";
} else {
echo "<td align=center style='vertical-align:middle; height:150px'><a href='farm_stats.php?team=".$row_GetTeamA['Number']."&season_id=".$SID_GetStandings."'><img border='0' src='".$_SESSION['DomainName']."/image/logos/medium/".$row_GetTeamA['LogoSmall']."' alt='".$row_GetTeamA['City']." ".$row_GetTeamA['Name']."'></img></a></td>";
echo "<td align=center style='vertical-align:middle; height:150px'><a href='farm_stats.php?team=".$row_GetTeamB['Number']."&season_id=".$SID_GetStandings."'><img border='0' src='".$_SESSION['DomainName']."/image/logos/medium/".$row_GetTeamB['LogoSmall']."' alt='".$row_GetTeamB['City']." ".$row_GetTeamB['Name']."'></img></a></td>";
}
}
echo "<td align=center>";
echo "<table width=100%>";
$tmpGameCount = 0;
mysql_data_seek($GetW,0);
while ($row_GetW = mysql_fetch_assoc($GetW)){
$tmpGameCount = $tmpGameCount + 1;
$query_GetHT = sprintf("SELECT Name FROM farmteam WHERE Number=%s", $row_GetW['HomeTeam']);
$GetHT = mysql_query($query_GetHT, $connection) or die(mysql_error());
$row_GetHT = mysql_fetch_assoc($GetHT);
$HomeTeam=$row_GetHT['Name'];
$query_GetVT = sprintf("SELECT Name FROM farmteam WHERE Number=%s", $row_GetW['VisitorTeam']);
$GetVT = mysql_query($query_GetVT, $connection) or die(mysql_error());
$row_GetVT = mysql_fetch_assoc($GetVT);
$VisitorTeam=$row_GetVT['Name'];
$query_GetLink = sprintf("SELECT todaysgame.Link FROM todaysgame WHERE todaysgame.GameNumber=CONCAT('Farm',CAST(".$row_GetW['Number']." as CHAR)) AND todaysgame.Season_ID=%s", $SID_GetStandings);
$GetLink = mysql_query($query_GetLink, $connection) or die(mysql_error());
$row_GetLink = mysql_fetch_assoc($GetLink);
$GameLink = $row_GetLink['Link'];
echo "<tr><td align=center width=75><a href='".$_SESSION['DomainName']."/File/".$row_GetSeasons['Folder']."/".$GameLink."'>Game ".$tmpGameCount."</a></td><td>".$HomeTeam."</td><td align=center width=20>".$row_GetW['HomeScore']."</td><td>".$VisitorTeam."</td><td align=center width=20>".$row_GetW['VisitorScore']."</td></tr>";
}
echo "</table>";
echo "</td>";
echo "</tr>";
$tmpRound = $r;
}
}
echo "</table>";
?>
</div>
<div id="tabs-2">
<h3><?php echo $l_PlayoffsbyRecord;?></h3>
<table cellspacing="0" border="0" width="100%" class="tablesorter" >
<thead>
<tr>
<th colspan="2"><div align="left"></div></th>
<th width="30"><a title="<?php echo $l_GP_D;?>"><?php echo $l_GP;?></a></th>
<th width="30"><a title="<?php echo $l_W_D;?>"><?php echo $l_W;?></a></th>
<th width="30"><a title="<?php echo $l_L_D;?>"><?php echo $l_L;?></a></th>
<th width="30"><a title="<?php echo $l_OT_D;?>"><?php echo $l_OT;?></a></th>
<th width="30"><a title="<?php echo $l_P_D;?>"><?php echo $l_P;?></a></th>
<th width="50"><a title="<?php echo $l_GF_D;?>"><?php echo $l_GF;?></a></th>
<th width="50"><a title="<?php echo $l_GA_D;?>"><?php echo $l_GA;?></a></th>
<th width="80"><a title="<?php echo $l_HomeTeam;?>"><?php echo $l_HomeTeam;?></a></th>
<th width="80"><a title="<?php echo $l_AwayTeam;?>"><?php echo $l_AwayTeam;?></a></th>
<th width="80"><a title="<?php echo $l_Last10;?>"><?php echo $l_L10;?></a></th>
<th width="80"><?php echo $l_Streak;?></th>
</tr>
</thead>
<tbody>
<?php
$query_GetStandings = sprintf("SELECT farmteamstandings.Last10SOW, farmteamstandings.Last10SOL, farmteamstandings.Last10OTW, farmteamstandings.Last10OTL, farmteamstandings.Last10W, farmteamstandings.Last10L, farmteamstandings.Last10T, farmteamstandings.Streak, farmteamstandings.StandingPlayoffTitle, farmteamstandings.DivisionLeader, 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, farmteam.LogoTiny FROM farmteamstandings, farmteam WHERE farmteam.Number=farmteamstandings.Number AND farmteamstandings.Season_ID='%s' AND farmteamstandings.GP > 0 ORDER BY farmteamstandings.W desc, farmteamstandings.GP asc", $SID_GetStandings);
$GetStandings = mysql_query($query_GetStandings, $connection) or die(mysql_error());
$row_GetStandings = mysql_fetch_assoc($GetStandings);
do {
$tmpCurrentRnk = $tmpCurrentRnk + 1;
$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"><img border="0" src="<?php echo $_SESSION['DomainName']; ?>/image/logos/small/<?php echo $row_GetStandings['LogoTiny']; ?>"></img></td>
<td nowrap="nowrap" style="vertical-align:middle;"><?php
if($row_GetStandings['StandingPlayoffTitle']=="E"){
echo "";
} else if($row_GetStandings['StandingPlayoffTitle']=="X"){
echo "X -";
} else if($row_GetStandings['StandingPlayoffTitle']=="Y"){
echo "Y -";
} else if($row_GetStandings['StandingPlayoffTitle']=="Z"){
echo "Z -";
} else if($row_GetStandings['StandingPlayoffTitle']=="Z" && $row_GetStandings['PowerRanking']==1){
echo "P -";
}
?>
<a href="farm_roster.php?team=<?php echo $row_GetStandings['Number']; ?>"><?php echo $row_GetStandings['City']." ".$row_GetStandings['Name']; ?></a></td>
<td align="center" style="vertical-align:middle;"><?php echo $row_GetStandings['GP']; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $TotalWins; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $row_GetStandings['L']; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $TotalOT; ?></td>
<td align="center" style="vertical-align:middle;"><strong><?php echo $row_GetStandings['Point']; ?></strong></td>
<td align="center" style="vertical-align:middle;"><?php echo $row_GetStandings['GF']; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $row_GetStandings['GA']; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $HomeRecord; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $VisitRecord; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo ($row_GetStandings['Last10W'] + $row_GetStandings['Last10OTW'] + $row_GetStandings['Last10SOW'])."-".$row_GetStandings['Last10L']."-".($row_GetStandings['Last10OTL']+$row_GetStandings['Last10SOL']); ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $row_GetStandings['Streak']; ?></td>
</tr>
<?php } while ($row_GetStandings = mysql_fetch_assoc($GetStandings)); ?>
</tbody>
</table>
<br />
</div>
</div>
<?php } else { ?>
<div id="tabs">
<div id="tabs-1"><h3>Division</h3>
<?php
$query_GetDivision = sprintf("SELECT farmteam.Division, farmteam.Conference FROM farmteam GROUP BY farmteam.Division ORDER BY farmteam.Conference, farmteam.Division ");
$GetDivision = mysql_query($query_GetDivision, $connection) or die(mysql_error());
$row_GetDivision = mysql_fetch_assoc($GetDivision);
$tmpLastConference="";
$tmpLastDivision="";
do {
if ($tmpLastConference != $row_GetDivision['Conference']){
echo "<h3 style='float:left;'>".$row_GetDivision['Conference']."</h3>";
}
$tmpLastConference=$row_GetDivision['Conference'];
?>
<div style="font-size:9px; float:right; padding-top:13px; padding-bottom:2px">
X = <?php echo $l_Playoff_E;?>
Y = <?php echo $l_Playoff_Y;?>
Z = <?php echo $l_Playoff_Z;?>
P = <?php echo $l_Playoff_P;?>
</div>
<br clear="all" />
<table cellspacing="0" border="0" width="100%" class="tablesorter" >
<thead>
<tr>
<th colspan="2"><div align="left"><?php echo $row_GetDivision['Division']; ?></div></th>
<th width="30"><a title="<?php echo $l_GP_D;?>"><?php echo $l_GP;?></a></th>
<th width="30"><a title="<?php echo $l_W_D;?>"><?php echo $l_W;?></a></th>
<th width="30"><a title="<?php echo $l_L_D;?>"><?php echo $l_L;?></a></th>
<th width="30"><a title="<?php echo $l_OT_D;?>"><?php echo $l_OT;?></a></th>
<th width="30"><a title="<?php echo $l_P_D;?>"><?php echo $l_P;?></a></th>
<th width="50"><a title="<?php echo $l_GF_D;?>"><?php echo $l_GF;?></a></th>
<th width="50"><a title="<?php echo $l_GA_D;?>"><?php echo $l_GA;?></a></th>
<th width="80"><a title="<?php echo $l_HomeTeam;?>"><?php echo $l_HomeTeam;?></a></th>
<th width="80"><a title="<?php echo $l_AwayTeam;?>"><?php echo $l_AwayTeam;?></a></th>
<th width="80"><a title="<?php echo $l_Last10;?>"><?php echo $l_L10;?></a></th>
<th width="80"><?php echo $l_Streak;?></th>
</tr>
</thead>
<tbody>
<?php
$query_GetStandings = sprintf("SELECT farmteamstandings.PowerRanking, farmteamstandings.Last10SOW, farmteamstandings.Last10SOL, farmteamstandings.Last10OTW, farmteamstandings.Last10OTL, farmteamstandings.Last10W, farmteamstandings.Last10L, farmteamstandings.Last10T, farmteamstandings.Streak, farmteamstandings.StandingPlayoffTitle, farmteamstandings.DivisionLeader, 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, farmteam.LogoTiny FROM farmteamstandings, farmteam WHERE farmteam.Number=farmteamstandings.Number AND farmteamstandings.Season_ID='%s' AND farmteam.Division='%s' ORDER BY farmteamstandings.StandingPlayoffTitle desc, ".$tmpDivisionLeaderSQL." farmteamstandings.Point desc, farmteamstandings.W desc, farmteamstandings.PowerRanking asc", $SID_GetStandings, $row_GetDivision['Division']);
$GetStandings = mysql_query($query_GetStandings, $connection) or die(mysql_error());
$row_GetStandings = mysql_fetch_assoc($GetStandings);
$tmpCurrentRnk = 0;
do {
$tmpCurrentRnk = $tmpCurrentRnk + 1;
$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"><img border="0" src="<?php echo $_SESSION['DomainName']; ?>/image/logos/small/<?php echo $row_GetStandings['LogoTiny']; ?>"></img></td>
<td nowrap="nowrap" style="vertical-align:middle;"><?php
if($row_GetStandings['StandingPlayoffTitle']=="E"){
echo "";
} else if($row_GetStandings['StandingPlayoffTitle']=="X"){
echo "X -";
} else if($row_GetStandings['StandingPlayoffTitle']=="Y"){
echo "Y -";
} else if($row_GetStandings['StandingPlayoffTitle']=="Z"){
echo "Z -";
} else if($row_GetStandings['StandingPlayoffTitle']=="Z" && $row_GetStandings['PowerRanking']==1){
echo "P -";
}
?>
<a href="farm_roster.php?team=<?php echo $row_GetStandings['Number']; ?>"><?php echo $row_GetStandings['City']." ".$row_GetStandings['Name']; ?></a></td>
<td align="center" style="vertical-align:middle;"><?php echo $row_GetStandings['GP']; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $TotalWins; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $row_GetStandings['L']; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $TotalOT; ?></td>
<td align="center" style="vertical-align:middle;"><strong><?php echo $row_GetStandings['Point']; ?></strong></td>
<td align="center" style="vertical-align:middle;"><?php echo $row_GetStandings['GF']; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $row_GetStandings['GA']; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $HomeRecord; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $VisitRecord; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo ($row_GetStandings['Last10W'] + $row_GetStandings['Last10OTW'] + $row_GetStandings['Last10SOW'])."-".$row_GetStandings['Last10L']."-".($row_GetStandings['Last10OTL']+$row_GetStandings['Last10SOL']); ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $row_GetStandings['Streak']; ?></td>
</tr>
<?php } while ($row_GetStandings = mysql_fetch_assoc($GetStandings)); ?>
</tbody>
</table>
<?php } while ($row_GetDivision = mysql_fetch_assoc($GetDivision)); ?>
<br />
</div>
<div id="tabs-2">
<h3><?php echo $l_Conference;?>e</h3>
<?php
$query_GetDivision = sprintf("SELECT farmteam.Division, farmteam.Conference FROM farmteam GROUP BY farmteam.Conference ORDER BY farmteam.Conference");
$GetDivision = mysql_query($query_GetDivision, $connection) or die(mysql_error());
$row_GetDivision = mysql_fetch_assoc($GetDivision);
$tmpLastConference="";
do {
if ($tmpLastConference != $row_GetDivision['Conference']){
echo "<h3 style='float:left;'>".$row_GetDivision['Conference']."</h3>";
}
$tmpLastConference=$row_GetDivision['Conference'];
?>
<div style="font-size:9px; float:right; padding-top:13px; padding-bottom:2px">
X = <?php echo $l_Playoff_E;?>
Y = <?php echo $l_Playoff_Y;?>
Z = <?php echo $l_Playoff_Z;?>
P = <?php echo $l_Playoff_P;?>
</div>
<br clear="all" />
<table cellspacing="0" border="0" width="100%" class="tablesorter" >
<thead>
<tr>
<th colspan="2"><div align="left"></div></th>
<th width="30"><a title="<?php echo $l_GP_D;?>"><?php echo $l_GP;?></a></th>
<th width="30"><a title="<?php echo $l_W_D;?>"><?php echo $l_W;?></a></th>
<th width="30"><a title="<?php echo $l_L_D;?>"><?php echo $l_L;?></a></th>
<th width="30"><a title="<?php echo $l_OT_D;?>"><?php echo $l_OT;?></a></th>
<th width="30"><a title="<?php echo $l_P_D;?>"><?php echo $l_P;?></a></th>
<th width="50"><a title="<?php echo $l_GF_D;?>"><?php echo $l_GF;?></a></th>
<th width="50"><a title="<?php echo $l_GA_D;?>"><?php echo $l_GA;?></a></th>
<th width="80"><a title="<?php echo $l_HomeTeam;?>"><?php echo $l_HomeTeam;?></a></th>
<th width="80"><a title="<?php echo $l_AwayTeam;?>"><?php echo $l_AwayTeam;?></a></th>
<th width="80"><a title="<?php echo $l_Last10;?>"><?php echo $l_L10;?></a></th>
<th width="80"><?php echo $l_Streak;?></th>
</tr>
</thead>
<tbody>
<?php
$query_GetStandings = sprintf("SELECT farmteamstandings.Last10SOW, farmteamstandings.Last10SOL, farmteamstandings.Last10OTW, farmteamstandings.Last10OTL, farmteamstandings.Last10W, farmteamstandings.Last10L, farmteamstandings.Last10T, farmteamstandings.Streak, farmteamstandings.StandingPlayoffTitle, farmteamstandings.DivisionLeader, 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, farmteam.LogoTiny FROM farmteamstandings, farmteam WHERE farmteam.Number=farmteamstandings.Number AND farmteamstandings.Season_ID='%s' AND farmteam.Conference='%s' ORDER BY farmteamstandings.StandingPlayoffTitle desc, ".$tmpDivisionLeaderSQL." farmteamstandings.Point desc, farmteamstandings.W desc, farmteamstandings.PowerRanking asc", $SID_GetStandings, $row_GetDivision['Conference']);
$GetStandings = mysql_query($query_GetStandings, $connection) or die(mysql_error());
$row_GetStandings = mysql_fetch_assoc($GetStandings);
do {
$tmpCurrentRnk = $tmpCurrentRnk + 1;
$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"><img border="0" src="<?php echo $_SESSION['DomainName']; ?>/image/logos/small/<?php echo $row_GetStandings['LogoTiny']; ?>"></img></td>
<td nowrap="nowrap" style="vertical-align:middle;"><?php
if($row_GetStandings['StandingPlayoffTitle']=="E"){
echo "";
} else if($row_GetStandings['StandingPlayoffTitle']=="X"){
echo "X -";
} else if($row_GetStandings['StandingPlayoffTitle']=="Y"){
echo "Y -";
} else if($row_GetStandings['StandingPlayoffTitle']=="Z"){
echo "Z -";
} else if($row_GetStandings['StandingPlayoffTitle']=="Z" && $row_GetStandings['PowerRanking']==1){
echo "P -";
}
?>
<a href="farm_roster.php?team=<?php echo $row_GetStandings['Number']; ?>"><?php echo $row_GetStandings['City']." ".$row_GetStandings['Name']; ?></a></td>
<td align="center" style="vertical-align:middle;"><?php echo $row_GetStandings['GP']; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $TotalWins; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $row_GetStandings['L']; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $TotalOT; ?></td>
<td align="center" style="vertical-align:middle;"><strong><?php echo $row_GetStandings['Point']; ?></strong></td>
<td align="center" style="vertical-align:middle;"><?php echo $row_GetStandings['GF']; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $row_GetStandings['GA']; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $HomeRecord; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $VisitRecord; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo ($row_GetStandings['Last10W'] + $row_GetStandings['Last10OTW'] + $row_GetStandings['Last10SOW'])."-".$row_GetStandings['Last10L']."-".($row_GetStandings['Last10OTL']+$row_GetStandings['Last10SOL']); ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $row_GetStandings['Streak']; ?></td>
</tr>
<?php } while ($row_GetStandings = mysql_fetch_assoc($GetStandings)); ?>
</tbody>
</table>
<?php } while ($row_GetDivision = mysql_fetch_assoc($GetDivision)); ?>
<br />
</div>
<div id="tabs-3">
<h3><?php echo $l_nav_league;?></h3>
<div style="float:left;"><h3><?php echo $l_nav_league;?></h3></div>
<div style="font-size:9px; float:right; padding-top:13px; padding-bottom:2px">
X = <?php echo $l_Playoff_E;?>
Y = <?php echo $l_Playoff_Y;?>
Z = <?php echo $l_Playoff_Z;?>
P = <?php echo $l_Playoff_P;?>
</div>
<br clear="all" />
<table cellspacing="0" border="0" width="100%" class="tablesorter" >
<thead>
<tr>
<th colspan="2"><div align="left"></div></th>
<th width="30"><a title="<?php echo $l_GP_D;?>"><?php echo $l_GP;?></a></th>
<th width="30"><a title="<?php echo $l_W_D;?>"><?php echo $l_W;?></a></th>
<th width="30"><a title="<?php echo $l_L_D;?>"><?php echo $l_L;?></a></th>
<th width="30"><a title="<?php echo $l_OT_D;?>"><?php echo $l_OT;?></a></th>
<th width="30"><a title="<?php echo $l_P_D;?>"><?php echo $l_P;?></a></th>
<th width="50"><a title="<?php echo $l_GF_D;?>"><?php echo $l_GF;?></a></th>
<th width="50"><a title="<?php echo $l_GA_D;?>"><?php echo $l_GA;?></a></th>
<th width="80"><a title="<?php echo $l_HomeTeam;?>"><?php echo $l_HomeTeam;?></a></th>
<th width="80"><a title="<?php echo $l_AwayTeam;?>"><?php echo $l_AwayTeam;?></a></th>
<th width="80"><a title="<?php echo $l_Last10;?>"><?php echo $l_L10;?></a></th>
<th width="80"><?php echo $l_Streak;?></th>
</tr>
</thead>
<tbody>
<?php
$query_GetStandings = sprintf("SELECT farmteamstandings.Last10SOW, farmteamstandings.Last10SOL, farmteamstandings.Last10OTW, farmteamstandings.Last10OTL, farmteamstandings.Last10W, farmteamstandings.Last10L, farmteamstandings.Last10T, farmteamstandings.Streak, farmteamstandings.StandingPlayoffTitle, farmteamstandings.DivisionLeader, 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, farmteam.LogoTiny FROM farmteamstandings, farmteam WHERE farmteam.Number=farmteamstandings.Number AND farmteamstandings.Season_ID='%s' ORDER BY farmteamstandings.StandingPlayoffTitle desc, ".$tmpDivisionLeaderSQL." farmteamstandings.Point desc, farmteamstandings.W desc, farmteamstandings.PowerRanking asc", $SID_GetStandings);
$GetStandings = mysql_query($query_GetStandings, $connection) or die(mysql_error());
$row_GetStandings = mysql_fetch_assoc($GetStandings);
do {
$tmpCurrentRnk = $tmpCurrentRnk + 1;
$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"><img border="0" src="<?php echo $_SESSION['DomainName']; ?>/image/logos/small/<?php echo $row_GetStandings['LogoTiny']; ?>"></img></td>
<td nowrap="nowrap" style="vertical-align:middle;"><?php
if($row_GetStandings['StandingPlayoffTitle']=="E"){
echo "";
} else if($row_GetStandings['StandingPlayoffTitle']=="X"){
echo "X -";
} else if($row_GetStandings['StandingPlayoffTitle']=="Y"){
echo "Y -";
} else if($row_GetStandings['StandingPlayoffTitle']=="Z"){
echo "Z -";
} else if($row_GetStandings['StandingPlayoffTitle']=="Z" && $row_GetStandings['PowerRanking']==1){
echo "P -";
}
?>
<a href="farm_roster.php?team=<?php echo $row_GetStandings['Number']; ?>"><?php echo $row_GetStandings['City']." ".$row_GetStandings['Name']; ?></a></td>
<td align="center" style="vertical-align:middle;"><?php echo $row_GetStandings['GP']; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $TotalWins; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $row_GetStandings['L']; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $TotalOT; ?></td>
<td align="center" style="vertical-align:middle;"><strong><?php echo $row_GetStandings['Point']; ?></strong></td>
<td align="center" style="vertical-align:middle;"><?php echo $row_GetStandings['GF']; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $row_GetStandings['GA']; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $HomeRecord; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $VisitRecord; ?></td>
<td align="center" style="vertical-align:middle;"><?php echo ($row_GetStandings['Last10W'] + $row_GetStandings['Last10OTW'] + $row_GetStandings['Last10SOW'])."-".$row_GetStandings['Last10L']."-".($row_GetStandings['Last10OTL']+$row_GetStandings['Last10SOL']); ?></td>
<td align="center" style="vertical-align:middle;"><?php echo $row_GetStandings['Streak']; ?></td>
</tr>
<?php } while ($row_GetStandings = mysql_fetch_assoc($GetStandings)); ?>
</tbody>
</table>
<br />
</div>
</div>
<?php } ?>
</section>
</article>
<?php include("includes/footer.php"); ?>
<?php include("includes/statusBar.php"); ?>
</div>
</div>
</body>
</html>