Linux lhjmq-records 5.15.0-118-generic #128-Ubuntu SMP Fri Jul 5 09:28:59 UTC 2024 x86_64
Your IP : 18.191.54.190
<?php
//Get the current season
$seasons = season_list($mysql_link, SEASON_TYPE_REG, 'DESC');
if(!isset($id_saison)){ $id_saison = 0; }
if(!isset($seasons[$id_saison])){
if(isset($seasons['currentseason'])){
$id_saison = $seasons['currentseason']['id'];
}else{
$keys = array_keys($seasons);
$id_saison = $keys[0];
}
}
$current_season = $seasons[$id_saison];
$sql_segments = mysql_query($sql='SELECT * FROM season_segments WHERE active = 1 AND id_saison = '.$current_season['id'].' ORDER BY date_begin DESC, date_end DESC', $mysql_link);
if(isset($appSettings)) { $appSettings->logInfo( "Season segments qry = [" . $sql . "]"); } // else { echo 'appSettings not defined !'; }
$sql_segments_season_year_id = "";
$sql_segments_season_year_start = 2049;
while($sql_segment = mysql_fetch_assoc($sql_segments)){
$segments[$sql_segment['id_segment']] = $sql_segment;
$sql_season_segment_year_start = substr($sql_segment['date_begin'], 0, 4);
if (0 + $sql_season_segment_year_start < $sql_segments_season_year_start) {
$sql_segments_season_year_start = $sql_season_segment_year_start;
}
}
if(isset($appSettings)) { $appSettings->logInfo( "Season year = $sql_segments_season_year_start"); } // else { echo 'appSettings not defined !'; }
if (($sql_segments_season_year_start < 2005) || ($sql_segments_season_year_start == 2049)) $sql_segments_season_year_start = 2005; // just in case!
$sql_segments_season_year_id = ""
. substr("" . $sql_segments_season_year_start, 2, 2)
. substr("" . ($sql_segments_season_year_start + 1), 2, 2);
if(isset($appSettings)) { $appSettings->logInfo( "Season year id = $sql_segments_season_year_id"); } // else { echo 'appSettings not defined !'; }
?>
<style type="text/css">
<!--
.bg { background-image: url(../images/canadapostcup/imgfull.jpg);
background-repeat: no-repeat;
background-position: center top;
font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #000000;
background-color: #FFFFFF;
}
.txt { font-family: Verdana, Arial, Helvetica, sans-serif;
font-size: 11px;
color: #000000;
}
-->
</style>
<table width="640" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="center" valign="middle"> </td>
<td width="522" align="center" valign="middle">
<p> </p>
<table width="522" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="1" bgcolor="#747E9C"></td>
<td>
<table width="520" border="0" cellpadding="0" cellspacing="0" bgcolor="#000000" class="bg">
<tr>
<td height="55" colspan="3"> </td>
</tr>
<tr>
<td height="333" width="25"></td>
<td width="470" height="333" valign="top">
<p>The Canada Post Cup recognizes the players who are selected among the three stars for every game. Players receive 10 points for a first star selection, five points for a second star selection and two points for a third star selection.<br>
<br>
There are three segments for the Canada Post Cup, with the divisional winners from each segment receiving a $100 donation from Canada Post for their team's education funds. The overall winner from the OHL, QMJHL and WHL will be recognized at the national awards ceremony and they will receive a $2,500 donation from Canada Post for their respective league's education funds.</p>
<div align="center">
<table width="100%" border="0" cellpadding="2" cellspacing="0" class="txt">
<tr>
<td valign="top" class="content-sm-k">
<div align="center"><strong><font color="#000000">Canada Post Cup: LHJMQ Division Leaders</font></strong></div>
</td>
</tr>
</table>
<?php
if(isset($appSettings)) { $appSettings->logInfo( 'Canada Post Cup Data'); } // else { echo 'appSettings not defined !'; }
foreach($segments as $id_segment => $segment){
$sql_segments_season_divisions_count = 0;
$dw_res = mysql_query($sql="SELECT * FROM ".$stat_db.'.'.'reg_'.$sql_segments_season_year_id.'_'.'v2'."_PlayersCPCupLeaders WHERE STAT_DIV = 'DW' AND CPCupSegment = ".$id_segment." ORDER BY CPCupPoints DESC, Star1 DESC, Star2 DESC, Star3 DESC LIMIT 5", $mysql_link);
if(isset($appSettings)) { $appSettings->logInfo( 'Western Div. [' . $sql . ']'); }
$sql_segments_season_divisions_count++;
$de_res = mysql_query($sql="SELECT * FROM ".$stat_db.'.'.'reg_'.$sql_segments_season_year_id.'_'.'v2'."_PlayersCPCupLeaders WHERE STAT_DIV = 'DE' AND CPCupSegment = ".$id_segment." ORDER BY CPCupPoints DESC, Star1 DESC, Star2 DESC, Star3 DESC LIMIT 5", $mysql_link);
if(isset($appSettings)) { $appSettings->logInfo( 'Eastern Div. [' . $sql . ']'); }
$sql_segments_season_divisions_count++;
if ($sql_segments_season_year_start < 2005) {
$da_res = mysql_query($sql="SELECT * FROM ".$stat_db.'.'.'reg_'.$sql_segments_season_year_id.'_'.'v2'."_PlayersCPCupLeaders WHERE STAT_DIV = 'DA' AND CPCupSegment = ".$id_segment." ORDER BY CPCupPoints DESC, Star1 DESC, Star2 DESC, Star3 DESC LIMIT 5", $mysql_link);
if(isset($appSettings)) { $appSettings->logInfo( 'Atlantic Div. [' . $sql . ']'); }
$sql_segments_season_divisions_count++;
}
?>
<table width="100%" border="0" cellpadding="2" cellspacing="0" class="txt">
<tr>
<td colspan="<?php echo "" . $sql_segments_season_divisions_count; ?>"> </td>
</tr>
<tr>
<td colspan="<?php echo "" . $sql_segments_season_divisions_count; ?>"><i><?php echo "From: " . $segment['date_begin'] . " to " . $segment['date_end']; ?></i></td>
</tr>
<tr>
<td colspan="<?php echo "" . $sql_segments_season_divisions_count; ?>"> </td>
</tr>
<tr>
<td width="33%" valign="top" class="content-sm-k"> <b>Western:</b><br>
<?php while($dw_res_item = mysql_fetch_assoc($dw_res)){
echo substr($dw_res_item['PNOM'], 0, 1) . ". " . $dw_res_item['NOM'] . " (" . $dw_res_item['CPCupPoints'] . ")<br>";
} ?>
</td>
<td width="33%" valign="top" class="content-sm-k"> <b>Eastern:</b><br>
<?php while($de_res_item = mysql_fetch_assoc($de_res)){
echo substr($de_res_item['PNOM'], 0, 1) . ". " . $de_res_item['NOM'] . " (" . $de_res_item['CPCupPoints'] . ")<br>";
} ?>
</td>
<?php if ($sql_segments_season_year_start < 2005) { ?>
<td width="33%" valign="top" class="content-sm-k"> <b><b>Atlantic</b>:</b><br>
<?php while($da_res_item = mysql_fetch_assoc($da_res)){
echo substr($da_res_item['PNOM'], 0, 1) . ". " . $da_res_item['NOM'] . " (" . $da_res_item['CPCupPoints'] . ")<br>";
} ?>
</td>
<?php } ?>
</tr>
<?php } ?>
</table>
<br>
<br>
</div>
</td>
<td width="25" height="333"></td>
</tr>
<tr>
<td colspan="3"><img src="../images/canadapostcup/bottom.jpg" width="520" height="9"></td>
</tr>
</table>
</td>
<td width="1" bgcolor="747E9C"></td>
</tr>
</table>
<p> </p>
</td>
<td align="center" valign="middle"> </td>
</tr>
</table>
<p> </p>
<?php
//close the stat server
$stat_server->close();
?>
|