LAYOUT: wrap some text for status of sickness better
[e-DoKo.git] / include / stats.php
index 97e1979a86a27f6d837a636168fc099e006cb634..095296edcd919223a5d340fc646a6a06c8a66d54 100644 (file)
@@ -104,15 +104,16 @@ if( !$content = getCache("cache/stats.html",60*60*24) )
  select g1.id, g2.id from game g1 left join game g2 on g1.randomnumbers=g2.randomnumbers where g1.id<g2.id order by g1.id
  select id from game where randomnumbers like "blablabl%"; the % is like .* in regexp
  select id,type,solo,status from game where id in (select id from game where randomnumbers in (select randomnumbers from game where id=27));
   */
-  $result = DB_query_array_all("SELECT fullname,COUNT(*) as c FROM Score".
-                              " LEFT JOIN User ON User.id=winner_id" .
-                              " WHERE score IN ('fox','doko','karlchen')".
-                              " GROUP BY game_id,fullname".
-                              " ORDER BY c DESC LIMIT 3" );
-  array_unshift($result,array("Name","Points"));
-  echo output_table($result,"Most extra points in a single game","stats");
+
+  /* number of calls*/
+  $result = DB_query_array_all("SELECT CONCAT_WS(' ',party,IFNULL(point_call,'no call')),COUNT(*) from Hand".
+                              " LEFT JOIN Game on Game.id=Hand.game_id ".
+                              " WHERE Game.status='gameover'".
+                              " GROUP BY party,point_call");
+  array_unshift($result,array("call","Frequency"));
+  echo output_table($result,"Kind of call","stats");
+
   
   /* most reminders */
   $result = DB_query_array_all("SELECT fullname, COUNT(*)  /" .
@@ -188,7 +189,7 @@ if( !$content = getCache("cache/stats.html",60*60*24) )
                               " FROM Game ".
                               " LEFT JOIN Hand ON Hand.position=startplayer AND Game.id=Hand.game_id ".
                               " LEFT JOIN User ON User.id=Hand.user_id ".
-                              " WHERE type='solo' AND Game.solo<>'silent' AND Game.status='gameover' ".
+                              " WHERE type='solo' AND Game.status='gameover' ".
                               " GROUP BY user_id ".
                               " ORDER BY c DESC;");
   array_unshift($result,array("Name","Number of solos","Solos/game"));
@@ -227,6 +228,9 @@ if( !$content = getCache("cache/stats.html",60*60*24) )
  how often is the last trick a non-trump trick
   */
   
+  /* needs this so that all tables are within the div and don't float around */
+  echo "<p style=\"clear:both;\">&nbsp;</p>\n";
+
   echo "</div>\n"; /* end output */
 
   /* write file to cache */