$pagetitle - "BTS Week 27 Results" ;
error_reporting(0);
include("indexedit.php") ;
list($width, $height, $type, $attr) = getimagesize("$weekrace");
list($twidth, $theight, $ttype, $tattr) = getimagesize("$weekrace");
// ADDITIONAL WINNER IF RACE ENDS IN A TIE FOR SCORE
$iftiewinner="" ;
$iftiewinnerwins="";
?>
2016 Champion: Go Left Dale
$year=2017;
$week1=29;
$lastweek=$week1-1;
$weekrace="Dover";
?>
echo "
Week $week1 Results in $weekrace" ?> |
Pos |
Name |
Score |
Selection |
Pts |
Bonus |
include ("db.php");
$btsquery=mysql_query("SELECT *,score+bonus as total FROM seasonstandings WHERE wk=$week1 Order by total DESC ") ;
$position_current = 0;
$position_count = 0;
$points_current = 0;
while ($row=mysql_fetch_array($btsquery)) {
//Set position count
$position_count++;
if ($points_current !== $row['total']) {
//New position
$points_current = $row['total'];
$position_current = $position_count;
}
//Display the current position
echo "$position_current |
{$row['name']} |
{$row['total']} |
{$row['selection']} |
{$row['score']} |
{$row['bonus']} |
";
}
echo " " ;
?>
|
$week = 29 ;
?>
Season Standings
(After Week echo $week ; ?>)
Pos |
Name |
Points |
$query = mysql_query("SELECT * , sum(score)+sum(bonus) as total FROM `seasonstandings` WHERE wk=1 or wk=2
or wk=3 or wk=4 or wk=5 OR wk=6 OR wk=7 OR wk=8 OR wk=9 OR wk=10 OR wk=11 OR wk=12
OR wk=13 OR wk=14 OR wk=15 OR wk=16 OR wk=17 OR wk=18 OR wk=19 OR wk=20 OR wk=21 OR wk=22
OR wk=23 OR wk=24 OR wk=25 OR wk=26 OR wk=27 OR wk=28 OR wk=29
GROUP BY name ORDER BY total DESC ");
$position_current = 0;
$position_count = 0;
$points_current = 0;
while ($row=mysql_fetch_array($query)) {
//Set position count
$position_count++;
if ($points_current !== $row['total']) {
//New position
$points_current = $row['total'];
$position_current = $position_count;
}
//Display the current position
echo "$position_current | {$row['name']} | {$row['total']} | ";
}
echo " " ;
?>
|