function generate_global_score_table()
{
+ $return = array();
+
/* get all ids */
$gameids = DB_get_gameids_of_finished_games_by_session(0);
}
}
- echo "<table>\n <tr>\n";
function cmp($a,$b)
{
if($a['nr']==0 ) return 1;
return ($a > $b) ? -1 : 1;
}
usort($player,"cmp");
+
foreach($player as $pl)
{
+ /* limit to players with at least 10 games */
if($pl['nr']>10)
- echo " <tr><td>",$pl['name'],"</td><td>",round($pl['points']/$pl['nr'],3),"</td></tr>\n";
+ $return[] = array( $pl['name'], round($pl['points']/$pl['nr'],3) );
}
- echo "</table>\n";
- return;
+ return $return;
}