include "header.php"; ?> $top = 15; $now = strtotime("-1 day"); $weekday = date("w"); //if (date("Hi") < date("Hi",strtotime($cutoffTime))) if ($isTooLate) $now = time(); $today = date("Y-m-d", $now); include "mysqlConnection.php"; $db = new mysqlConnection(); $db->debug = TRUE; $db->setTable("selections"); $db->query("select selections.race, selection, name from selections, programs, contestants where selections.racedate = '$today' and selections.selection = programs.number and selections.racedate = programs.racedate and selections.race = programs.race and contestants.uid = selections.uid order by selections.race"); while ($r = $db->fetchRow()) { $rce[$r[2]] = $r[0]; $prog[$r[2]] = $r[1]; $selections[$r[2]]++; } $db->free(); ?>
Top echo $top ?> Contest Favorites: echo date("l F jS", $now) ?>
if ($selections) { arsort($selections); $cnt = 0; $tot = $db->pullVal('count(*)','racedate',$today,'selections'); while (list($h, $c) = each($selections)) { if ($cnt > $top) { break; } //print "include "footer.php" ?>".ceil(($c / $tot)*100)."% selected #$prog[$h] $h in race $rce[$h]
"; print "".$c." ".($c > 1 ? 'people' : 'person')." selected #$prog[$h] $h in race $rce[$h]
"; $cnt++; } } else { print "No Selections Available"; } ?>