X-Git-Url: https://git.nubati.net/cgi-bin/gitweb.cgi?p=e-DoKo.git;a=blobdiff_plain;f=stats.php;h=267b33284a5f2ca1fd87d6912ea67e2e326540fb;hp=ec1d9b7f109c267589c7c19ac3b453af21b0baa0;hb=4fc2c543112c4734b71272b1e4a1392406d63455;hpb=42aae8a38789ec102478db6dc58795c4b095546e diff --git a/stats.php b/stats.php index ec1d9b7..267b332 100644 --- a/stats.php +++ b/stats.php @@ -2,9 +2,9 @@ error_reporting(E_ALL); include_once("config.php"); -include_once("output.php"); /* html output only */ -include_once("db.php"); /* database only */ -include_once("functions.php"); /* the rest */ +include_once("./include/output.php"); /* html output only */ +include_once("./include/db.php"); /* database only */ +include_once("./include/functions.php"); /* the rest */ config_check(); @@ -162,7 +162,7 @@ else if( isset($_SESSION["name"]) ) " fullname FROM Reminder". " LEFT JOIN User ON User.id=user_id". " GROUP BY user_id". - " ORDER BY c DESC LIMIT 3" ); + " ORDER BY c DESC LIMIT 5" ); while( $r = mysql_fetch_array($result,MYSQL_NUM)) echo $r[1]." (".$r[0].")
\n"; echo "

\n"; @@ -196,6 +196,20 @@ else if( isset($_SESSION["name"]) ) echo $r[1]." (".$r[0].")
\n"; echo "

\n"; + echo "

These players lost their fox least often per game:
\n"; + $result = mysql_query("SELECT COUNT(*) /" . + " (SELECT COUNT(*) FROM Hand". + " WHERE user_id=User.id) as c,". + " fullname". + " FROM Score". + " LEFT JOIN User ON User.id=looser_id". + " WHERE score='fox'". + " GROUP BY looser_id". + " ORDER BY c ASC LIMIT 5" ); + while( $r = mysql_fetch_array($result,MYSQL_NUM)) + echo $r[1]." (".$r[0].")
\n"; + echo "

\n"; + /* which position wins the most tricks */ echo "

Which positions at the table make the most tricks:
\n"; $result = mysql_query("SELECT COUNT(*) AS c,winner FROM Trick". @@ -213,6 +227,31 @@ else if( isset($_SESSION["name"]) ) echo " bottom ".$r[0]."
\n"; echo "

\n"; + /* most games */ + echo "

Most games played on the server:
\n"; + $result = mysql_query("SELECT COUNT(*) as c, " . + " fullname FROM Hand". + " LEFT JOIN User ON User.id=user_id". + " GROUP BY user_id". + " ORDER BY c DESC LIMIT 7" ); + while( $r = mysql_fetch_array($result,MYSQL_NUM)) + echo $r[1]." (".$r[0].")
\n"; + echo "

\n"; + + /* most active games */ + echo "

These players are involved in this many active games:
\n"; + $result = mysql_query("SELECT COUNT(*) as c, " . + " fullname FROM Hand". + " LEFT JOIN User ON User.id=user_id". + " LEFT JOIN Game ON Game.id=game_id". + " WHERE Game.status<>'gameover'". + " GROUP BY user_id". + " ORDER BY c DESC LIMIT 7" ); + while( $r = mysql_fetch_array($result,MYSQL_NUM)) + echo $r[1]." (".$r[0].")
\n"; + echo "

\n"; + + /* does the party win more often if they start