projects
/
e-DoKo.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
LAYOUT: more tables on the statistics page
[e-DoKo.git]
/
include
/
functions.php
diff --git
a/include/functions.php
b/include/functions.php
index 9f58f51f969fb610a024637213c5ff9cdd726d5a..a338f388df0bb2822a654f3a13afb27e01d39a3a 100644
(file)
--- a/
include/functions.php
+++ b/
include/functions.php
@@
-934,6
+934,8
@@
function generate_score_table($session)
function generate_global_score_table()
{
function generate_global_score_table()
{
+ $return = array();
+
/* get all ids */
$gameids = DB_get_gameids_of_finished_games_by_session(0);
/* get all ids */
$gameids = DB_get_gameids_of_finished_games_by_session(0);
@@
-967,7
+969,6
@@
function generate_global_score_table()
}
}
}
}
- echo "<table>\n <tr>\n";
function cmp($a,$b)
{
if($a['nr']==0 ) return 1;
function cmp($a,$b)
{
if($a['nr']==0 ) return 1;
@@
-981,14
+982,15
@@
function generate_global_score_table()
return ($a > $b) ? -1 : 1;
}
usort($player,"cmp");
return ($a > $b) ? -1 : 1;
}
usort($player,"cmp");
+
foreach($player as $pl)
{
foreach($player as $pl)
{
+ /* limit to players with at least 10 games */
if($pl['nr']>10)
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
;
}
}