X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=modules%2Fstats.php;h=2a741843989b9e4d6996b07a13606f627bd14be3;hb=be5a4adb62c3abe6c12fb020cf321bdb244ebc4b;hp=58ee7d1645c1a0bbf828f9147f5c57f3e7ab4a49;hpb=eaf30d86cc99df2414cf4f171a9b0f11b0561e3b;p=platal.git diff --git a/modules/stats.php b/modules/stats.php index 58ee7d1..2a74184 100644 --- a/modules/stats.php +++ b/modules/stats.php @@ -1,6 +1,6 @@ $this->make_hook('stats', AUTH_COOKIE), - 'stats/evolution' => $this->make_hook('evolution', AUTH_COOKIE), - 'stats/graph' => $this->make_hook('graph', AUTH_COOKIE), - 'stats/graph/evolution' - => $this->make_hook('graph_evo', AUTH_COOKIE), - 'stats/promos' => $this->make_hook('promos', AUTH_COOKIE), - - 'stats/coupures' => $this->make_hook('coupures', AUTH_PUBLIC), + 'stats' => $this->make_hook('stats', AUTH_COOKIE), + 'stats/evolution' => $this->make_hook('evolution', AUTH_COOKIE), + 'stats/graph' => $this->make_hook('graph', AUTH_COOKIE), + 'stats/graph/evolution' => $this->make_hook('graph_evo', AUTH_COOKIE), + 'stats/promos' => $this->make_hook('promos', AUTH_COOKIE), + + 'stats/coupures' => $this->make_hook('coupures', AUTH_PUBLIC), ); } @@ -69,7 +68,7 @@ class StatsModule extends PLModule ".(-($jours+1)).") AS jour, COUNT(user_id) AS nb FROM auth_user_md5 - WHERE perms IN ('admin','user') + WHERE perms IN ('admin','user') AND deces = 0 GROUP BY jour"); //genere des donnees compatibles avec GNUPLOT @@ -125,7 +124,7 @@ EOF2; { if ($promo == 'all') { // date de départ - $depart = 1920; + $depart = 1930; //recupere le nombre d'inscriptions par jour sur la plage concernée $res = XDB::iterRow( @@ -164,7 +163,7 @@ set timefmt "%d/%m/%y" set xr [$depart:$fin] set yr [0:100] -set title "Nombre d'inscrits par promotion depuis $depart." +set title "Proportion d'inscrits par promotion depuis $depart, en %." plot "-" using 1:2 title 'inscrits' with boxes; {$inscrits} @@ -175,11 +174,11 @@ EOF2; //nombre de jours sur le graph $jours = 365; define('DUREEJOUR',24*3600); - $res = XDB::query("SELECT min(TO_DAYS(date_ins)-TO_DAYS(now())) - FROM auth_user_md5 - WHERE promo = {?} - AND perms IN ('admin', 'user')", - $promo); + $res = XDB::query( + "SELECT min(TO_DAYS(date_ins)-TO_DAYS(now())) + FROM auth_user_md5 + WHERE promo = {?} AND perms IN ('admin', 'user') AND deces = 0", + $promo); $jours = -$res->fetchOneCell(); //recupere le nombre d'inscriptions par jour sur la plage concernée @@ -189,7 +188,7 @@ EOF2; ".(-($jours+1)).") AS jour, COUNT(user_id) AS nb FROM auth_user_md5 - WHERE promo = {?} AND perms IN ('admin','user') + WHERE promo = {?} AND perms IN ('admin','user') AND deces = 0 GROUP BY jour", $promo); //genere des donnees compatibles avec GNUPLOT @@ -249,7 +248,7 @@ EOF2; $res = XDB::iterRow( "SELECT promo,COUNT(*) FROM auth_user_md5 - WHERE promo > 1900 AND perms IN ('admin','user') + WHERE promo > 1900 AND perms IN ('admin','user') AND deces = 0 GROUP BY promo ORDER BY promo"); $max=0; $min=3000;