X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=include%2Fstats.php;h=8c83b6d87a6238b8ed7a42a0bcaa60df85981315;hp=83c11ad1ce1f091f25fe548bdb3c5212f554b453;hb=ed0ffd0d14904b661622a29e95661fc03728c2c4;hpb=2666bb58429c385b716d2ffd5d5fe9a9e7af4f45 diff --git a/include/stats.php b/include/stats.php index 83c11ad..8c83b6d 100644 --- a/include/stats.php +++ b/include/stats.php @@ -207,6 +207,21 @@ if( !$content = getCache("cache/stats.html",60*60*24) ) array_unshift($result,array("Name","Number of active games")); echo output_table($result,"Active games","stats"); + /* response time of users*/ + $result = DB_query_array_all("SELECT User.fullname,". + "IFNULL(AVG(if(P1.sequence in (2,3,4),". + "-timestampdiff(MINUTE,mod_date,(select mod_date from Play P2 where P1.trick_id=P2.trick_id and P2.sequence=P1.sequence-1)),NULL )),1e9) as a, ". + " COUNT(*) as na ". + "FROM Play P1 ". + "LEFT JOIN Hand_Card ON P1.hand_card_id=Hand_Card.id ". + "LEFT JOIN Hand ON Hand.id=Hand_Card.hand_id ". + "LEFT JOIN User ON Hand.user_id=User.id ". + "GROUP BY user_id ". + "HAVING na>8 ". + "ORDER BY a " ); + array_unshift($result,array("Name","Average minutes before response","trick count")); + echo output_table($result,"Response","stats"); + /* does the party win more often if they start