query (" SELECT hlstats_Games.name FROM hlstats_Games WHERE hlstats_Games.code = '$game' "); if ($db->num_rows() < 1) error("No such game '$game'."); list($gamename) = $db->fetch_row(); $db->free_result(); pageHeader ( array ($gamename, 'Map Statistics'), array ($gamename=>"%s?game=$game", 'Map Statistics'=>'') ); $tblMaps = new Table ( array ( new TableColumn ( 'map', 'Map', 'width=20&align=left&link=' . urlencode("mode=mapinfo&map=%k&game=$game") ), new TableColumn ( 'kills', 'Kills', 'width=8&align=right' ), new TableColumn ( 'kpercent', '%', 'width=7&sort=no&align=right&append=' . urlencode('%') ), new TableColumn ( 'kpercent', 'Ratio', 'width=16&sort=no&type=bargraph' ), new TableColumn ( 'headshots', 'Headshots', 'width=8&align=right' ), new TableColumn ( 'hpercent', '%', 'width=7&sort=no&align=right&append=' . urlencode('%') ), new TableColumn ( 'hpercent', 'Ratio', 'width=16&sort=no&type=bargraph' ), new TableColumn ( 'hpk', 'HS:K', 'width=9&align=right' ), new TableColumn ( 'map', 'HeatMap', 'width=4&type=heatmap' ) ), 'map', 'kills', 'map', true, 9999, 'maps_page', 'maps_sort', 'maps_sortorder' ); $db->query (" SELECT SUM(hlstats_Maps_Counts.kills), SUM(hlstats_Maps_Counts.headshots) FROM hlstats_Maps_Counts WHERE hlstats_Maps_Counts.game = '$game' "); list($realkills, $realheadshots) = $db->fetch_row(); $result = $db->query (" SELECT IF(hlstats_Maps_Counts.map = '', '(Unaccounted)', hlstats_Maps_Counts.map) AS map, hlstats_Maps_Counts.kills, ROUND(kills / ".(($realkills==0)?1:$realkills)." * 100, 2) AS kpercent, hlstats_Maps_Counts.headshots, ROUND(hlstats_Maps_Counts.headshots / IF(hlstats_Maps_Counts.kills = 0, 1, hlstats_Maps_Counts.kills), 2) AS hpk, ROUND(hlstats_Maps_Counts.headshots / ".(($realheadshots==0)?1:$realheadshots)." * 100, 2) AS hpercent FROM hlstats_Maps_Counts WHERE hlstats_Maps_Counts.game = '$game' ORDER BY $tblMaps->sort $tblMaps->sortorder, $tblMaps->sort2 $tblMaps->sortorder "); ?>
From a total of kills with headshots


draw($result, $db->num_rows($result), 95); ?>

Go to: ">