fe54ddfc7ae9d08f6a9b3a378e580ca420affd2a
2 /***************************************************************************
3 * Copyright (C) 2003-2004 Polytechnique.org *
4 * http://opensource.polytechnique.org/ *
6 * This program is free software; you can redistribute it and/or modify *
7 * it under the terms of the GNU General Public License as published by *
8 * the Free Software Foundation; either version 2 of the License, or *
9 * (at your option) any later version. *
11 * This program is distributed in the hope that it will be useful, *
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
14 * GNU General Public License for more details. *
16 * You should have received a copy of the GNU General Public License *
17 * along with this program; if not, write to the Free Software *
19 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA *
20 ***************************************************************************/
22 require_once("xorg.inc.php");
24 new_skinned_page('index.tpl', AUTH_COOKIE
);
25 $promo = Env
::getInt('promo', Session
::getInt('promo'));
30 //recupere le nombre d'inscriptions par jour sur la plage concernée
31 $res = $globals->xdb
->iterRow(
32 "SELECT promo, SUM(perms IN ('admin', 'user')) / COUNT(*) * 100
34 WHERE promo >= $depart AND deces = 0
37 //genere des donnees compatibles avec GNUPLOT
40 // la première ligne contient le total des inscrits avant la date de départ
41 list($annee, $nb) = $res->next();
43 for ($i=$depart;$i<=date("Y");$i++
) {
45 if(!list($annee, $nb) = $res->next()) {
50 if ($nb > 0 ||
$i < date("Y"))
51 $inscrits .= $i." ".$nb."\n";
54 //Genere le graphique à la volée avec GNUPLOT
55 header( "Content-type: image/png");
65 set term png small color
67 set timefmt
"%d/%m/%y"
72 set title
"Nombre d'inscrits par promotion depuis $depart."
74 plot
"-" using
1:2 title
'inscrits' with boxes
;