test

get_results(« SELECT AwardDate FROM `InSeasonAwards` WHERE Season=(SELECT MAX(Season) FROM InSeasonAwards WHERE Award=’POW’) AND Award=’POW' »);
$date_max=00000000;
$AwardDate_max=0;
foreach ($rqt_date as $row){
$date=$row->AwardDate;
$date= explode(« / », $date);
$date= $date[2].$date[0].$date[1];
if ($date>$date_max) {$date_max=$date;$AwardDate_max=$row->AwardDate;}
}

$rqt_id=$wpdb->get_results(« SELECT I.PlayerID, I.Award, I.AwardDate, P.ID, P.CurrentTeam, T.Name, T.Conference FROM InSeasonAwards I,
Team T, Player P WHERE I.PlayerID=P.ID AND P.CurrentTeam=T.Name AND I.Season=(SELECT MAX(Season) FROM InSeasonAwards WHERE Award=’POW’)
AND I.AwardDate=’$AwardDate_max’ AND I.Award=’POW’ AND T.conference=’East' »);

foreach ($rqt_id as $row){
$POW_East=$row->ID;
}

$rqt_id=$wpdb->get_results(« SELECT I.PlayerID, I.Award, I.AwardDate, P.ID, P.CurrentTeam, T.Name, T.Conference FROM InSeasonAwards I,
Team T, Player P WHERE I.PlayerID=P.ID AND P.CurrentTeam=T.Name AND I.Season=(SELECT MAX(Season) FROM InSeasonAwards WHERE Award=’POW’)
AND I.AwardDate=’$AwardDate_max’ AND I.Award=’POW’ AND T.conference=’West' »);

foreach ($rqt_id as $row){
$POW_West=$row->ID;
}

$rqt_stats=$wpdb->get_results(« SELECT I.AwardDate, I.PlayerID FROM InSeasonAwards I, Team T,
Player P WHERE I.PlayerID=P.ID AND P.CurrentTeam=T.Name AND I.Season=(SELECT MAX(Season) FROM InSeasonAwards WHERE Award=’POM’)
AND I.Award=’POM’ AND T.conference=’East’ « );
$month=0;
foreach ($rqt_stats as $row2){
if (checkmonth($row2->AwardDate)>$month) {$month=checkmonth($row2->AwardDate);$monthAwardPOM=$row2->AwardDate;$POM_East=$row2->PlayerID;} else {}
}

$rqt_stats=$wpdb->get_results(« SELECT I.AwardDate, I.PlayerID FROM InSeasonAwards I, Team T,
Player P WHERE I.PlayerID=P.ID AND P.CurrentTeam=T.Name AND I.Season=(SELECT MAX(Season) FROM InSeasonAwards WHERE Award=’POM’)
AND I.Award=’POM’ AND T.conference=’West’ « );
$month=0;
foreach ($rqt_stats as $row2){
if (checkmonth($row2->AwardDate)>$month) {$month=checkmonth($row2->AwardDate);$monthAwardPOM=$row2->AwardDate;$POM_West=$row2->PlayerID;} else {}
}

$rqt_stats=$wpdb->get_results(« SELECT I.AwardDate, I.PlayerID FROM InSeasonAwards I, Team T,
Player P WHERE I.PlayerID=P.ID AND P.CurrentTeam=T.Name AND I.Season=(SELECT MAX(Season) FROM InSeasonAwards WHERE Award=’ROM’)
AND I.Award=’ROM’ AND T.conference=’East’ « );
$month=0;
foreach ($rqt_stats as $row2){
if (checkmonth($row2->AwardDate)>$month) {$month=checkmonth($row2->AwardDate);$monthAward=$row2->AwardDate;$ROM_East=$row2->PlayerID;} else {}
}

$rqt_stats=$wpdb->get_results(« SELECT I.AwardDate, I.PlayerID FROM InSeasonAwards I, Team T,
Player P WHERE I.PlayerID=P.ID AND P.CurrentTeam=T.Name AND I.Season=(SELECT MAX(Season) FROM InSeasonAwards WHERE Award=’ROM’)
AND I.Award=’ROM’ AND T.conference=’West’ « );
$month=0;
foreach ($rqt_stats as $row2){
if (checkmonth($row2->AwardDate)>$month) {$month=checkmonth($row2->AwardDate);$monthAward=$row2->AwardDate;$ROM_West=$row2->PlayerID;} else {}
}
?>

POW PO RO
E

get_results(« SELECT * From InSeasonAwards WHERE PlayerID=$POW_East AND Season=(SELECT MAX(Season)
FROM InSeasonAwards WHERE Award=’POW’) AND AwardDate=’$AwardDate_max' »);

foreach ($rqt_stats as $row2){
?>

Player;
$lien = « http://www.hnblnba.fr/player/?id= »;
$lien .= $IDJr;
$nomJr = $nom; ?>

‘;
echo round($row2->PPG,1);
echo ‘ Pts – ‘;
echo round($row2->RPG,1);
echo ‘ Reb
‘;
echo round($row2->APG,1);
echo ‘ Ast – ‘;
echo round($row2->SPG,1);
echo ‘ Stl – ‘;
echo round($row2->BPG,1);
echo ‘ Blk’;
}?>
get_results(« SELECT * From InSeasonAwards WHERE PlayerID=’$POM_East’ AND Season=(SELECT MAX(Season) FROM InSeasonAwards WHERE Award=’POM’) AND AwardDate=’$monthAwardPOM' »);

foreach ($rqt_stats as $row2){
?>

Player;
$lien = « http://www.hnblnba.fr/player/?id= »;
$lien .= $IDJr;
$nomJr = $nom;?>

‘;
echo round($row2->PPG,1);
echo ‘ Pts – ‘;
echo round($row2->RPG,1);
echo ‘ Reb
‘;
echo round($row2->APG,1);
echo ‘ Ast – ‘;
echo round($row2->SPG,1);
echo ‘ Stl – ‘;
echo round($row2->BPG,1);
echo ‘ Blk’; ?>

get_results(« SELECT * From InSeasonAwards WHERE PlayerID=’$ROM_East’ AND Season=(SELECT MAX(Season) FROM InSeasonAwards WHERE Award=’POM’) AND AwardDate=’$monthAwardPOM' »);

foreach ($rqt_stats as $row2){
?>

Player;
$lien = « http://www.hnblnba.fr/player/?id= »;
$lien .= $IDJr;
$nomJr = $nom;?>

‘;
echo round($row2->PPG,1);
echo ‘ Pts – ‘;
echo round($row2->RPG,1);
echo ‘ Reb
‘;
echo round($row2->APG,1);
echo ‘ Ast – ‘;
echo round($row2->SPG,1);
echo ‘ Stl – ‘;
echo round($row2->BPG,1);
echo ‘ Blk’; ?>

W get_results(« SELECT * From InSeasonAwards WHERE PlayerID=$POW_West AND Season=(SELECT MAX(Season)
FROM InSeasonAwards WHERE Award=’POW’) AND AwardDate=’$AwardDate_max' »);

foreach ($rqt_stats as $row2){
?>

Player;
$lien = « http://www.hnblnba.fr/player/?id= »;
$lien .= $IDJr;
$nomJr = $nom; ?>

‘;
echo round($row2->PPG,1);
echo ‘Pts – ‘;
echo round($row2->RPG,1);
echo ‘ Reb
‘;
echo round($row2->APG,1);
echo ‘ Ast – ‘;
echo round($row2->SPG,1);
echo ‘ Stl – ‘;
echo round($row2->BPG,1);
echo ‘ Blk’;
}?>

get_results(« SELECT * From InSeasonAwards WHERE PlayerID=’$POM_West’ AND Season=(SELECT MAX(Season) FROM InSeasonAwards WHERE Award=’POM’) AND AwardDate=’$monthAwardPOM' »);

foreach ($rqt_stats as $row2){
?>

Player;
$lien = « http://www.hnblnba.fr/player/?id= »;
$lien .= $IDJr;
$nomJr = $nom;?>

‘;
echo round($row2->PPG,1);
echo ‘ Pts – ‘;
echo round($row2->RPG,1);
echo ‘ Reb
‘;
echo round($row2->APG,1);
echo ‘ Ast – ‘;
echo round($row2->SPG,1);
echo ‘ Stl – ‘;
echo round($row2->BPG,1);
echo ‘ Blk’; ?>

get_results(« SELECT * From InSeasonAwards WHERE PlayerID=’$ROM_West’ AND Season=(SELECT MAX(Season) FROM InSeasonAwards WHERE Award=’POM’) AND AwardDate=’$monthAwardPOM' »);

foreach ($rqt_stats as $row2){
?>

Player;
$lien = « http://www.hnblnba.fr/player/?id= »;
$lien .= $IDJr;
$nomJr = $nom;?>

‘;
echo round($row2->PPG,1);
echo ‘ Pts – ‘;
echo round($row2->RPG,1);
echo ‘ Reb
‘;
echo round($row2->APG,1);
echo ‘ Ast – ‘;
echo round($row2->SPG,1);
echo ‘ Stl – ‘;
echo round($row2->BPG,1);
echo ‘ Blk’; ?>

« ;
$classement==1;
// OK
foreach ($rqt_clsst as $row) {
$couleur = ($compteur % 2 == 0) ?  » : ‘#eee’;
$compteur++;
$classement++;
echo’

‘;
?>

‘;
$matchsTotalGagne==0;
$matchsTotalPerdu==0;
}
echo « 

Standings
« ;
$rqt_clsst=$wpdb->get_results(« SELECT Name, HomeWins, RoadWins, HomeLosses,RoadLosses,City,
((HomeWins + RoadWins) / (HomeWins + RoadWins + HomeLosses + RoadLosses)) as monPourcentage FROM Team ORDER BY monPourcentage DESC LIMIT 0,6 »);

echo « 

# Team W L %
‘.$classement.’ ‘;
echo $matchsTotalGagne;
echo ‘
‘;
echo $matchsTotalPerdu;
//OK
if ($matchsTotalPerdu==0){echo «  »;}else{
$monPct = ($matchsTotalGagne/($matchsTotalGagne + $matchsTotalPerdu))*100;
}
echo ‘
‘;
echo number_format($monPct,0, ‘,’, ‘ ‘);
echo ‘%

« ;
?> Top 5
get_results(« SELECT S.ID, P.ID, P.Name, P.LastName, S.FGA as FGA, S.FGM as FGM, S.FTA as FTA, S.FTM as FTM, S.Points,
S.Rebounds, S.Assists, S.Blocks, S.Steals, S.SeasonDay as leJour,
(S.Points – S.Turnovers + S.Blocks + S.Steals + S.Assists + S.Rebounds – S.FGA + S.FGM – S.FTA + S.FTM) as Evaluation FROM PlayerGameStats S, Player P WHERE SeasonDay <= (SELECT MAX(SeasonDay) FROM PlayerGameStats) AND S.ID=P.ID AND S.SeasonDay >= (SELECT MAX(SeasonDay) FROM PlayerGameStats)-10 ORDER BY Evaluation DESC limit 0,5 « );
echo « 

« ;
echo « 

« ;

foreach($rqt_journee as $row)
{
$couleur = ($compteur % 2 == 0) ?  » : ‘#FFFFFF’;
// echo’

‘;
echo ‘

‘;
echo’

‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
echo ‘

‘;
$compteur++;
}
echo « 

Day Player Pts Reb Ast Blk Stl Rkg
‘.$row->leJour.’ ‘;
// ‘.$row->Points.’
‘.$row->Rebounds.’ ‘.$row->Assists.’ ‘.$row->Blocks.’ ‘.$row->Steals.’ ‘.$row->Evaluation.’

« ;
?>