session_start();
if (!($SESSION_LEVEL=='administrator' || $SESSION_LEVEL=='moderator' || $SESSION_LEVEL=='gloperator'))
die("OMG");
require("../include/top.php");
require("../include/awardscategories.inc.php");
$year = $sceneorgyear;
if ($_GET["forceyear"])
$year = (int)$_GET["forceyear"];
?>
$n = mysql_num_rows(mysql_query("select * from awardscand_".$year.""));
printf("
%d total votes
\n",$n);
foreach($awardscat[$year] as $x=>$name) {
$sql = "SELECT prods.id,prods.name,prods.type,count(*) as c ";
$sql .= " FROM awardscand_".$year." ";
$sql .= " JOIN prods ON awardscand_".$year.".cat".$x."=prods.id ";
$sql .= " GROUP BY prods.id ORDER BY c DESC,name";
$r = mysql_query($sql) or die(mysql_error());
echo "
\n";
echo "#".$x." - ".$name." |
\n";
while ($o = mysql_fetch_object($r)) {
printf("\n",($n++&1)+1);
echo "";
foreach(explode(",",$o->type) as $v) {
printf("",$types[$v]);
}
echo "".$o->name."";
echo " | ".$o->c." votes | \n";
echo "
\n";
}
echo "
\n";
}
?>
require("../include/bottom.php");
?>