-
Notifications
You must be signed in to change notification settings - Fork 0
/
depth_chart.php
791 lines (711 loc) · 29.8 KB
/
depth_chart.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
<?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_D_G = "Defence and Goalies";
$l_forwards = "Forwards";
$l_Year = "Year";
$l_draftpicks = "Draft Picks";
$l_Prospects = "Prospects";
$l_NextYear = "Next Season";
$l_CurrentYear = "Current Season";
$l_OV_D = "Overall";
break;
case 'fr':
$l_D_G = "Défenseurs/Gardiens";
$l_forwards = "Attaquants";
$l_Year = "Année";
$l_draftpicks = "Choix au repêchage";
$l_Prospects = "Relève";
$l_NextYear = "Saison prochaine";
$l_CurrentYear = "Saison courante";
$l_OV_D = "Total";
break;
}
// Class draft picks
class draft_pick
{
var $iYearIdx;
var $iRound;
var $strPickOwner;
var $strTeam;
}
// Class player
class player
{
var $iID;
var $iAge;
var $iPos;
var $iCountry;
var $iPO;
var $strName;
var $strTeam;
var $iOV;
var $fSalary;
var $iYearsLeft;
var $iStatus;
var $bRookie;
}
$strTmp = "";
$text = "";
$ACTION = "";
$SQL_ACTION = "";
$SQL_ACTION_GOALIE = "";
if (isset($_GET['action'])) {
$ACTION = (get_magic_quotes_gpc()) ? $_GET['action'] : addslashes($_GET['action']);
}
if ($ACTION == "next"){
$SQL_ACTION = " AND (players.Contract > 1 OR players.Number = (SELECT playerscontractoffers.Player FROM playerscontractoffers WHERE playerscontractoffers.Player=players.Number AND playerscontractoffers.Type='Extension' AND PlayerType='player')) ";
$SQL_ACTION_GOALIE = " AND (goalies.Contract > 1 OR goalies.Number = (SELECT playerscontractoffers.Player FROM playerscontractoffers WHERE playerscontractoffers.Player=goalies.Number AND playerscontractoffers.Type='Extension' AND PlayerType='goalie')) ";
}
if ($_SESSION['JuniorLeague'] == 'True'){
$SQL_ACTION = $SQL_ACTION." AND players.Suspension < 99 ";
$SQL_ACTION_GOALIE = $SQL_ACTION_GOALIE." AND goalies.Suspension < 99 ";
}
$SORT = "Overall";
if (isset($_GET['sort'])) {
$SORT = (get_magic_quotes_gpc()) ? $_GET['sort'] : addslashes($_GET['sort']);
}
$SORT_GOALIE = "Overall";
if (isset($_GET['sort_goalie'])) {
$SORT_GOALIE = (get_magic_quotes_gpc()) ? $_GET['sort_goalie'] : addslashes($_GET['sort_goalie']);
}
$SID_GetTop5 = "1";
if (isset($_SESSION['current_SeasonID'])) {
$SID_GetTop5 = (get_magic_quotes_gpc()) ? $_SESSION['current_SeasonID'] : addslashes($_SESSION['current_SeasonID']);
}
$TID_GetTop5 = "1";
if (isset($_SESSION['current_Team'])) {
$TID_GetTop5 = (get_magic_quotes_gpc()) ? $_SESSION['current_Team'] : addslashes($_SESSION['current_Team']);
}
$TID_GetProspects = "1";
if (isset($_SESSION['current_Team_ID'])) {
$TID_GetProspects = (get_magic_quotes_gpc()) ? $_SESSION['current_Team_ID'] : addslashes($_SESSION['current_Team_ID']);
}
$query_GetSkaters = sprintf( "SELECT players.* FROM playerstats, players WHERE players.Team=%s AND playerstats.Season_ID=%s AND players.Name=playerstats.Name AND players.Retired=0 AND players.Contract > 0 ".$SQL_ACTION." GROUP BY players.Name ORDER BY players.Position, players.Overall DESC", $TID_GetProspects, $SID_GetTop5 );
$GetSkaters = mysql_query($query_GetSkaters, $connection) or die(mysql_error());
$row_GetSkaters = mysql_fetch_assoc($GetSkaters);
$totalRows_GetSkaters = mysql_num_rows($GetSkaters);
$query_GetGoalies = sprintf( "SELECT goalies.* FROM goaliestats, goalies WHERE goalies.Team=%s AND goaliestats.Season_ID=%s AND goalies.Name=goaliestats.Name AND goalies.Retired=0 AND goalies.Contract > 0 ".$SQL_ACTION_GOALIE." GROUP BY goalies.Name ORDER BY goalies.Overall DESC", $TID_GetProspects, $SID_GetTop5 );
$GetGoalies = mysql_query($query_GetGoalies, $connection) or die(mysql_error());
$row_GetGoalies = mysql_fetch_assoc($GetGoalies);
$totalRows_GetGoalies = mysql_num_rows($GetGoalies);
$query_GetProspects = sprintf("SELECT prospects.* FROM prospects WHERE prospects.TeamNumber=%s ORDER BY prospects.Position, prospects.ProspectGrade DESC, prospects.ProspectLevel, prospects.Name", $TID_GetProspects );
$GetProspects = mysql_query($query_GetProspects, $connection) or die(mysql_error());
$totalRows_GetProspects = mysql_num_rows($GetProspects);
$tmpYear = $_SESSION['current_DraftYear'];
$query_GetDraftPicks = sprintf("SELECT draftpicks.*, proteam.Abbre, proteam.LogoTiny FROM draftpicks, proteam WHERE draftpicks.TeamName=proteam.Number AND draftpicks.OwnBy=%s AND draftpicks.Year >=%s ORDER BY draftpicks.Year, draftpicks.Round", $_SESSION['current_Team_ID'],$tmpYear);
$GetDraftPicks = mysql_query($query_GetDraftPicks, $connection) or die(mysql_error());
$query_GetSeasons = sprintf("SELECT * FROM draftpicks WHERE Year >= %s group by Year Order By Year",$tmpYear);
$GetSeasons = mysql_query($query_GetSeasons, $connection) or die(mysql_error());
$row_GetSeasons = mysql_fetch_assoc($GetSeasons);
$totalRows_GetSeasons = mysql_num_rows($GetSeasons);
// Initialize the players array
$a_players = array();
$a_players[ 1 ] = array();
$a_players[ 2 ] = array();
$a_players[ 3 ] = array();
$a_players[ 4 ] = array();
$a_players[ 5 ] = array();
$a_players[ 6 ] = array();
$a_prospects = array();
// Draft picks!
$iRounds = 8;
$iYear = $row_GetSeasons[ 'Year' ];
// Initialize the structures that will be used to store the draft picks
$a_Picks = array();
for( $i = $iYear; $i < $iYear + $totalRows_GetSeasons; $i++ )
{
$a_Picks[ $i ] = array();
for( $j = 0; $j < $iRounds; $j++ )
{
$a_Picks[$i][$j] = array();
}
}
// Retrieve all players from the database
// Store in a structure indexed on player positions
do {
$a_player = new player;
$a_player->iID = $row_GetSkaters[ 'ID' ];
$a_player->strName = $row_GetSkaters[ 'Name' ];
$a_player->strNumber = $row_GetSkaters[ 'Number' ];
$a_player->iAge = $row_GetSkaters[ 'Age' ];
$a_player->iCountry = $row_GetSkaters[ 'Country' ];
$a_player->iPO = $row_GetSkaters[ 'PO' ];
$a_player->iPos = $row_GetSkaters[ 'Position' ];
if ($_SESSION['DisplayOV'] == 1) {
$a_player->iOV = $row_GetSkaters[ 'Overall' ];
} else {
$a_player->iOV = "N/A";
}
$a_player->bRookie = $row_GetSkaters[ 'Rookie' ] == "True";
$a_player->iContract = $row_GetSkaters[ 'Contract' ];
$a_players[ $a_player->iPos ][] = (object)$a_player;
} while ($row_GetSkaters = mysql_fetch_assoc($GetSkaters));
do {
$a_player = new player;
$a_player->iID = $row_GetGoalies[ 'ID' ];
$a_player->strName = $row_GetGoalies[ 'Name' ];
$a_player->strNumber = $row_GetGoalies[ 'Number' ];
$a_player->iAge = $row_GetGoalies[ 'Age' ];
$a_player->iCountry = $row_GetGoalies[ 'Country' ];
$a_player->iPO = $row_GetGoalies[ 'PO' ];
$a_player->iPos = $row_GetGoalies[ 'Position' ];
if ($_SESSION['DisplayOV'] == 1) {
$a_player->iOV = $row_GetGoalies[ 'Overall' ];
} else {
$a_player->iOV = "N/A";
}
$a_player->bRookie = $row_GetGoalies[ 'Rookie' ] == "True";
$a_player->iContract = $row_GetGoalies[ 'Contract' ];
$a_players[ $a_player->iPos ][] = (object)$a_player;
} while ($row_GetGoalies = mysql_fetch_assoc($GetGoalies));
// Now find the highest count for the forward positions to properly structure the grid
$iMax = 0;
if( count($a_players[ 1 ]) > $iMax ) { $iMax = count($a_players[1]); }
if( count($a_players[ 2 ]) > $iMax ) { $iMax = count($a_players[2]); }
if( count($a_players[ 3 ]) > $iMax ) { $iMax = count($a_players[3]); }
// Retrieve the prospects now
while($row = mysql_fetch_assoc($GetProspects))
{
$a_player = new player;
$a_player->iID = $row[ 'P_ID' ];
$a_player->strName = $row[ 'Name' ];
if($row[ 'Position' ] <> ''){
$a_player->strPos = $row[ 'Position' ];
}else{
$a_player->strPos = '1';
}
$a_player->iOV = number_format( $row[ 'ProspectGrade' ], 1, '.', '' ) . $row[ 'ProspectLevel' ];
$a_prospects[ $a_player->strPos ][] = (object)$a_player;
}
// Select the picks and sort them in a way that will make them easier to display
while($row = mysql_fetch_assoc($GetDraftPicks))
{
$pick = new draft_pick;
$pick->iYearIdx = $row['Year'];
$pick->iRound = $row['Round'];
$pick->strPickOwner = $row['OwnBy'];
$pick->strTeam = $row['LogoTiny'];
$a_Picks[$row['Year']][$row['Round']][] = (object)$pick;
}
?>
<!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_depth;?> - <?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_HeaderImage']; ?>); background-color:#<?php echo $_SESSION['current_PrimaryColor'];?>;}
a {color:#<?php echo $_SESSION['current_PrimaryColor']; ?>;}
table.tablesorter thead tr th { background-color: #<?php echo $_SESSION['current_SecondaryColor']; ?>; color:#<?php echo $_SESSION['current_TextColor']; ?>;}
table.tablesorterRates thead tr th { background-color: #<?php echo $_SESSION['current_SecondaryColor']; ?>; color:#<?php echo $_SESSION['current_TextColor']; ?>;}
table.tablesorter thead tr th a{ color:#<?php echo $_SESSION['current_TextColor']; ?>;}
table.tablesorterRates thead tr th a{ color:#<?php echo $_SESSION['current_TextColor']; ?>;}
footer { background-color:#<?php echo $_SESSION['current_PrimaryColor']; ?>;}
#FatFooter { background-color:#<?php echo $_SESSION['current_SecondaryColor']; ?>; color:#<?php echo $_SESSION['current_TextColor']; ?>;}
<?php if ($_SESSION['current_SecondaryColor'] == $_SESSION['current_PrimaryColor']){ echo "#FatFooter a { color:#".$_SESSION['current_TextColor']."; } "; } ?>
h3 {color:#<?php echo $_SESSION['current_PrimaryColor']; ?>;}
#cssdropdown, #cssdropdown ul {background-color:#<?php echo $_SESSION['current_PrimaryColor']; ?>;}
nav {background-color:#<?php echo $_SESSION['current_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>
<?php
if ($ACTION == "next"){
echo '<table align="right" border="0"><tr><td><a href="depth_chart.php">'.$l_CurrentYear.'</a></td></tr></table>';
} else {
echo '<table align="right" border="0"><tr><td><a href="depth_chart.php?action=next">'.$l_NextYear.'</a></td></tr></table>';
}
?><h1><?php echo $l_nav_depth;?></h1>
<table cellspacing="0" border="0" width="100%" class="tablesorter" >
<thead>
<tr>
<th colspan="3" colspan="3" align="center"><?php echo $l_forwards;?></th>
</tr>
<tr>
<th width="33%"><?php echo $l_LeftWing;?></th>
<th width="33%"><?php echo $l_Center;?></th>
<th width="33%"><?php echo $l_RightWing;?></th>
</tr>
</thead>
<tbody>
<?php
$tmpRowColor="000000";
$tmpRowCount=0;
$tmpCount=0;
for( $i = 0; $i < $iMax; $i++ ) {
// Change row color
if ($tmpRowCount==1){
$tmpRowColor="E9ECF3";
$tmpRowCount=0;
}
else {
$tmpRowColor="FFFFFF";
$tmpRowCount=1;
}
if ($i==3){
$ProBorderStyle = 'style="border-bottom-width:2px; border-bottom-style:dotted; border-bottom-color:#'.$_SESSION['current_PrimaryColor'].';"';
} else {
$ProBorderStyle = '';
}
echo( '<tr bgcolor="#'.$tmpRowColor.'" '.$ProBorderStyle.'>');
// Show left wings
echo( "<td style='width:33%'>" );
if( count( $a_players[ 2 ] ) > $i )
{
$a_player = (object)$a_players[ 2 ][$i];
echo '<div style="display:block; float:left; width:140px; text-align:center; vertical-align:middle">';
echo( '<a href="player.php?team=' . $_SESSION['current_Team_ID'] . '&player=' . $a_player->strNumber . '">' );
if( $a_player->bRookie ) { echo( '*' ); }
echo( $a_player->strName . '</a></div>');
echo '<div style="display:block; float:left; width:30px; text-align:left; vertical-align:middle"><img height="12" width="12" src="'.$_SESSION['DomainName'].'/image/flags/'.$a_player->iCountry.'.png" border="0"/></div>';
echo '<div style="display:block; float:left; width:50px; text-align:left; vertical-align:middle">AGE:'.$a_player->iAge.'</div>';
echo '<div style="display:block; float:left; width:40px; text-align:left; vertical-align:middle">PO:'.$a_player->iPO.'</div>';
echo '<div style="display:block; float:left; width:40px; text-align:left; vertical-align:middle">OV:'.$a_player->iOV.'</div>';
}
else {
echo( " " );
}
echo( "</td>" );
// Show centers
echo( "<td style='text-align:center;width:33%'>" );
if( count( $a_players[ 1 ] ) > $i )
{
$a_player = $a_players[ 1 ][$i];
echo '<div style="display:block; float:left; width:140px; text-align:center; vertical-align:middle">';
echo( '<a href="player.php?team=' . $_SESSION['current_Team_ID'] . '&player=' . $a_player->strNumber . '">' );
if( $a_player->bRookie ) { echo( '*' ); }
echo( $a_player->strName . '</a></div>');
echo '<div style="display:block; float:left; width:30px; text-align:left; vertical-align:middle"><img height="12" width="12" src="'.$_SESSION['DomainName'].'/image/flags/'.$a_player->iCountry.'.png" border="0"/></div>';
echo '<div style="display:block; float:left; width:50px; text-align:left; vertical-align:middle">AGE:'.$a_player->iAge.'</div>';
echo '<div style="display:block; float:left; width:40px; text-align:left; vertical-align:middle">PO:'.$a_player->iPO.'</div>';
echo '<div style="display:block; float:left; width:40px; text-align:left; vertical-align:middle">OV:'.$a_player->iOV.'</div>';
}
else {
echo( " " );
}
echo( "</td>" );
// Show right wings
echo( "<td style='text-align:center;width:33%'>" );
if( count( $a_players[ 3 ] ) > $i )
{
$a_player = $a_players[ 3 ][$i];
echo '<div style="display:block; float:left; width:140px; text-align:center; vertical-align:middle">';
echo( '<a href="player.php?team=' . $_SESSION['current_Team_ID'] . '&player=' . $a_player->strNumber . '">' );
if( $a_player->bRookie ) { echo( '*' ); }
echo( $a_player->strName . '</a></div>');
echo '<div style="display:block; float:left; width:30px; text-align:left; vertical-align:middle"><img height="12" width="12" src="'.$_SESSION['DomainName'].'/image/flags/'.$a_player->iCountry.'.png" border="0"/></div>';
echo '<div style="display:block; float:left; width:50px; text-align:left; vertical-align:middle">AGE:'.$a_player->iAge.'</div>';
echo '<div style="display:block; float:left; width:40px; text-align:left; vertical-align:middle">PO:'.$a_player->iPO.'</div>';
echo '<div style="display:block; float:left; width:40px; text-align:left; vertical-align:middle">OV:'.$a_player->iOV.'</div>';
}
else {
echo( " " );
}
echo( $strTmp .= "</td>" );
// End of row
echo( "</tr>" );
}
?>
</tbody>
</table>
<br clear="all" />
<table cellspacing="0" border="0" width="100%" class="tablesorter" style="border-bottom-style:ridge">
<thead>
<tr>
<th colspan="3"><?php echo $l_D_G;?></th>
</tr>
<tr>
<th width="33%"><?php echo $l_Defence;?> 1</th>
<th width="33%"><?php echo $l_Defence;?> 2</th>
<th width="33%"><?php echo $l_Goalie;?></th>
</tr>
</thead>
<tbody>
<?php
// Show the defense players and goalies
// First find the highest count for the defence players to properly structure the grid
$iMax = 0;
if( (count($a_players[ 4 ]) % 2) == 1 )
{
$iDefRows = floor((count($a_players[ 4 ]) / 2) + 1);
}
else
{
$iDefRows = floor((count($a_players[ 4 ]) / 2));
}
if( $iDefRows > $iMax ) { $iMax = $iDefRows; }
if( count($a_players[ 5 ]) > $iMax ) { $iMax = count($a_players[5]); }
$tmpRowColor="000000";
$tmpRowCount=0;
$tmpCount=0;
for( $i = 0; $i < $iMax; $i++ ) {
// Change row color
if ($tmpRowCount==1){
$tmpRowColor="E9ECF3";
$tmpRowCount=0;
}
else {
$tmpRowColor="FFFFFF";
$tmpRowCount=1;
}
if ($i==2){
$ProBorderStyle = 'style="border-bottom-width:2px; border-bottom-style:dotted; border-bottom-color:#'.$_SESSION['current_PrimaryColor'].';"';
} else {
$ProBorderStyle = '';
}
echo( '<tr bgcolor="#'.$tmpRowColor.'" '.$ProBorderStyle.'>');
// Show 1st D
echo( "<td style='text-align:center;width:33%'>" );
if( count( $a_players[ 4 ] ) > (2*$i) )
{
$a_player = (object)$a_players[ 4 ][2*$i];
echo '<div style="display:block; float:left; width:140px; text-align:center; vertical-align:middle">';
echo( '<a href="player.php?team=' . $_SESSION['current_Team_ID'] . '&player=' . $a_player->strNumber . '">' );
if( $a_player->bRookie ) { echo( '*' ); }
echo( $a_player->strName . '</a></div>');
echo '<div style="display:block; float:left; width:30px; text-align:left; vertical-align:middle"><img height="12" width="12" src="'.$_SESSION['DomainName'].'/image/flags/'.$a_player->iCountry.'.png" border="0"/></div>';
echo '<div style="display:block; float:left; width:50px; text-align:left; vertical-align:middle">AGE:'.$a_player->iAge.'</div>';
echo '<div style="display:block; float:left; width:40px; text-align:left; vertical-align:middle">PO:'.$a_player->iPO.'</div>';
echo '<div style="display:block; float:left; width:40px; text-align:left; vertical-align:middle">OV:'.$a_player->iOV.'</div>';
}
else {
echo( " " );
}
echo( "</td>" );
// Show 2nd D
echo( "<td style='text-align:center;width:33%'>" );
if( count( $a_players[ 4 ] ) > (2*$i)+1 )
{
$a_player = $a_players[ 4 ][(2*$i)+1];
echo '<div style="display:block; float:left; width:140px; text-align:center; vertical-align:middle">';
echo( '<a href="player.php?team=' . $_SESSION['current_Team_ID'] . '&player=' . $a_player->strNumber . '">' );
if( $a_player->bRookie ) { echo( '*' ); }
echo( $a_player->strName . '</a></div>');
echo '<div style="display:block; float:left; width:30px; text-align:left; vertical-align:middle"><img height="12" width="12" src="'.$_SESSION['DomainName'].'/image/flags/'.$a_player->iCountry.'.png" border="0"/></div>';
echo '<div style="display:block; float:left; width:50px; text-align:left; vertical-align:middle">AGE:'.$a_player->iAge.'</div>';
echo '<div style="display:block; float:left; width:40px; text-align:left; vertical-align:middle">PO:'.$a_player->iPO.'</div>';
echo '<div style="display:block; float:left; width:40px; text-align:left; vertical-align:middle">OV:'.$a_player->iOV.'</div>';
}
else {
echo( " " );
}
echo( $text .= "</td>" );
// Show goalie
echo( "<td style='text-align:center;width:33%'>" );
if( count( $a_players[ 5 ] ) > $i )
{
$a_player = $a_players[ 5 ][$i];
echo '<div style="display:block; float:left; width:140px; text-align:center; vertical-align:middle">';
echo( '<a href="goalie.php?team=' . $_SESSION['current_Team_ID'] . '&player=' . $a_player->strNumber . '">' );
if( $a_player->bRookie == true ) { echo( '*' ); }
echo( $a_player->strName . '</a></div>');
echo '<div style="display:block; float:left; width:30px; text-align:left; vertical-align:middle"><img height="12" width="12" src="'.$_SESSION['DomainName'].'/image/flags/'.$a_player->iCountry.'.png" border="0"/></div>';
echo '<div style="display:block; float:left; width:50px; text-align:left; vertical-align:middle">AGE:'.$a_player->iAge.'</div>';
echo '<div style="display:block; float:left; width:40px; text-align:left; vertical-align:middle">PO:'.$a_player->iPO.'</div>';
echo '<div style="display:block; float:left; width:40px; text-align:left; vertical-align:middle">OV:'.$a_player->iOV.'</div>';
}
else {
echo( " " );
}
echo( "</td>" );
// End of row
echo( "</tr>" );
}
?>
</tbody>
</table>
<br clear="all" />
<?php
$iMax = 0;
if($totalRows_GetProspects > 0){
// Now find the highest count for the forward positions to properly structure the grid
$iMax = 0;
if (array_key_exists('1',$a_prospects)){ if( count($a_prospects[1]) > $iMax ) { $iMax = count($a_prospects['1']); }}
if (array_key_exists('2',$a_prospects)){ if( count($a_prospects[2]) > $iMax ) { $iMax = count($a_prospects['2']); }}
if (array_key_exists('3',$a_prospects)){ if( count($a_prospects[3]) > $iMax ) { $iMax = count($a_prospects['3']); }}
?>
<h1><?php echo $l_Prospects ;?></h1>
<table cellspacing="0" border="0" width="100%" class="tablesorter" >
<thead>
<tr>
<th colspan="3" colspan="3" align="center"><?php echo $l_forwards;?></th>
</tr>
<tr>
<th width="33%"><?php echo $l_LeftWing;?></th>
<th width="33%"><?php echo $l_Center;?></th>
<th width="33%"><?php echo $l_RightWing;?></th>
</tr>
</thead>
<tbody>
<?php
$tmpRowColor="000000";
$tmpRowCount=0;
$tmpCount=0;
for( $i = 0; $i < $iMax; $i++ ) {
// Change row color
if ($tmpRowCount==1){
$tmpRowColor="E9ECF3";
$tmpRowCount=0;
}
else {
$tmpRowColor="FFFFFF";
$tmpRowCount=1;
}
echo( '<tr bgcolor="#' . $tmpRowColor . '">');
// Show left wings
echo( "<td style='text-align:center;width:33%'>" );
if (array_key_exists('2',$a_prospects)){
if( count( $a_prospects[2] ) > $i )
{
$a_player = (object)$a_prospects[2][$i];
echo '<div style="display:block; float:left; width:220px; text-align:center; vertical-align:middle; padding-left:40px;">';
echo( '<a href="prospect.php?team=' . $_SESSION['current_Team_ID'] . '&player=' . $a_player->strName . '">' );
echo( $a_player->strName . '</a></div>');
echo '<div style="display:block; float:left; width:40px; text-align:left; vertical-align:middle">PO:'.$a_player->iOV.'</div>';
}
else {
echo( " " );
}
}
echo( "</td>" );
// Show centers
echo( "<td style='text-align:center;width:33%'>" );
if (array_key_exists('1',$a_prospects)){
if( count( $a_prospects[1] ) > $i )
{
$a_player = $a_prospects[1][$i];
echo '<div style="display:block; float:left; width:220px; text-align:center; vertical-align:middle; padding-left:40px;">';
echo( '<a href="prospect.php?team=' . $_SESSION['current_Team_ID'] . '&player=' . $a_player->strName . '">' );
echo( $a_player->strName . '</a></div>');
echo '<div style="display:block; float:left; width:40px; text-align:left; vertical-align:middle">PO:'.$a_player->iOV.'</div>';
}
else {
echo( " " );
}
}
echo( "</td>" );
// Show right wings
echo( "<td style='text-align:center;width:33%'>" );
if (array_key_exists('3',$a_prospects)){
if( count( $a_prospects[3] ) > $i )
{
$a_player = $a_prospects[3][$i];
echo '<div style="display:block; float:left; width:220px; text-align:center; vertical-align:middle; padding-left:40px;">';
echo( '<a href="prospect.php?team=' . $_SESSION['current_Team_ID'] . '&player=' . $a_player->strName . '">' );
echo( $a_player->strName . '</a></div>');
echo '<div style="display:block; float:left; width:40px; text-align:left; vertical-align:middle">PO:'.$a_player->iOV.'</div>';
}
else {
echo( " " );
}
}
echo( $strTmp .= "</td>" );
// End of row
echo( "</tr>" );
}
?>
</tbody>
</table>
<br clear="all" />
<table cellspacing="0" border="0" width="100%" class="tablesorter" >
<thead>
<tr>
<th colspan="3"><?php echo $l_D_G;?></th>
</tr>
<tr>
<th width="33%"><?php echo $l_Defence;?> 1</th>
<th width="33%"><?php echo $l_Defence;?> 2</th>
<th width="33%"><?php echo $l_Goalie;?></th>
</tr>
</thead>
<tbody>
<?php
// Show the defense players and goalies
// First find the highest count for the defence players to properly structure the grid
$iMax = 0;
if (array_key_exists(4,$a_prospects) || array_key_exists(5,$a_prospects)){
if( (count($a_prospects['4']) % 2) == 1 )
{
$iDefRows = floor((count($a_prospects[4]) / 2) + 1);
}
else
{
$iDefRows = floor((count($a_prospects[4]) / 2));
}
}
if(isset($a_prospects['5']) && count($a_prospects['5']) > 0 )
{
$iDefRows = $iDefRows + count($a_prospects['5']);
}
if( $iDefRows > $iMax ) { $iMax = $iDefRows; }
if (array_key_exists(4,$a_prospects) || array_key_exists(5,$a_prospects) ){;
if( count($a_prospects[4]) + count($a_prospects[5]) > $iMax ) { $iMax = count($a_prospects[4]) + count($a_prospects[5]); }
$tmpRowColor="000000";
$tmpRowCount=0;
$tmpCount=0;
for( $i = 0; $i < $iMax; $i++ ) {
// Change row color
if ($tmpRowCount==1){
$tmpRowColor="E9ECF3";
$tmpRowCount=0;
}
else {
$tmpRowColor="FFFFFF";
$tmpRowCount=1;
}
echo( '<tr bgcolor="#' . $tmpRowColor . '">');
// Show 1st D
echo( "<td style='text-align:center;width:33%'>" );
if( count( $a_prospects[4] ) > (2*$i) )
{
$a_player = (object)$a_prospects[4][2*$i];
echo '<div style="display:block; float:left; width:220px; text-align:center; vertical-align:middle; padding-left:40px;">';
echo( '<a href="prospect.php?team=' . $_SESSION['current_Team_ID'] . '&player=' . $a_player->strName . '">' );
echo( $a_player->strName . '</a></div>');
echo '<div style="display:block; float:left; width:40px; text-align:left; vertical-align:middle">PO:'.$a_player->iOV.'</div>';
}
else {
echo( " " );
}
echo( "</td>" );
// Show 2nd D
echo( "<td style='text-align:center;width:33%'>" );
if( count( $a_prospects[4] ) > (2*$i)+1 )
{
$a_player = $a_prospects[4][(2*$i)+1];
echo '<div style="display:block; float:left; width:220px; text-align:center; vertical-align:middle; padding-left:40px;">';
echo( '<a href="prospect.php?team=' . $_SESSION['current_Team_ID'] . '&player=' . $a_player->strName . '">' );
echo( $a_player->strName . '</a></div>');
echo '<div style="display:block; float:left; width:40px; text-align:left; vertical-align:middle">PO:'.$a_player->iOV.'</div>';
}
else {
echo( " " );
}
echo( $text .= "</td>" );
// Show goalie
echo( "<td style='text-align:center;width:33%'>" );
if( count( $a_prospects[5] ) > $i )
{
$a_player = $a_prospects[5][$i];
echo '<div style="display:block; float:left; width:220px; text-align:center; vertical-align:middle; padding-left:40px;">';
echo( '<a href="prospect.php?team=' . $_SESSION['current_Team_ID'] . '&player=' . $a_player->strName . '">' );
echo( $a_player->strName . '</a></div>');
echo '<div style="display:block; float:left; width:40px; text-align:left; vertical-align:middle">PO:'.$a_player->iOV.'</div>';
}
else {
echo( " " );
}
echo( "</td>" );
// End of row
echo( "</tr>" );
}
}
?>
</tbody>
</table>
<?php } ?>
<br clear="all" />
<h1><?php echo $l_draftpicks;?></h1>
<table cellspacing="0" border="0" width="100%" class="tablesorter" >
<thead>
<tr>
<th width="50"><?php echo $l_Year;?></th>
<?php
for( $i = 0; $i < $iRounds; $i++ )
{
echo ("<th>R" . ($i+1) . "</th>" );
}
?>
</tr>
</thead>
<tbody>
<?php
$tmpRowCount=0;
$tmpRowColor="FFFFFF";
// Now, display the picks for each year
for( $i = $iYear; $i < $iYear + $totalRows_GetSeasons; $i++ )
{
if ($tmpRowCount==1){
$tmpRowColor="E9ECF3";
$tmpRowCount=0;
}
else {
$tmpRowColor="FFFFFF";
$tmpRowCount=1;
}
echo( '<tr>');
echo( "<td align=center>" . ($i) . "</td>" );
for( $j = 1; $j <= $iRounds; $j++ )
{
echo( "<td align=center>" );
if( count( isset($a_Picks[$i][$j] )) == 0 ) {
echo( " " );
}
if (isset($a_Picks[$i][$j])){
for( $k = 0; $k < count( $a_Picks[$i][$j] ); $k++ )
{
$pick = (object) $a_Picks[$i][$j][$k];
echo( '<img src="image/logos/small/' . str_replace( "%20", " ", $pick->strTeam) . '" alt="' . $pick->strTeam . '">' );
}
}
echo( "</td>" );
}
echo( "</tr>" );
}
?>
</tbody>
</table>
<br clear="all" />
</section>
</article>
<?php include("includes/footer.php"); ?>
<?php include("includes/statusBar.php"); ?>
</div>
</div>
</body>
</html>