| Line 12... |
Line 12... |
| 12 |
echo 'Message DBMS/Utilisateur : ' . $db->getUserInfo() . "\n";
|
12 |
echo 'Message DBMS/Utilisateur : ' . $db->getUserInfo() . "\n";
|
| 13 |
echo 'Message DBMS/Déboguage : ' . $db->getDebugInfo() . "\n";
|
13 |
echo 'Message DBMS/Déboguage : ' . $db->getDebugInfo() . "\n";
|
| 14 |
exit;
|
14 |
exit;
|
| 15 |
}
|
15 |
}
|
| Line 16... |
Line 16... |
| 16 |
|
16 |
|
| 17 |
$tab_mois = array("Jan","Fev","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Dec");
|
17 |
$tab_mois = array('Jan', 'Fev', 'Mar', 'Avr', 'Mai', 'Juin', 'Juil', 'Août', 'Sep', 'Oct', 'Nov', 'Dec');
|
| - |
|
18 |
$tab_donnees = array() ;
|
| - |
|
19 |
if (isset($_GET['annee'])) {
|
| - |
|
20 |
$tps_debut = mktime(0,0,0,1,1, $_GET['annee']);
|
| - |
|
21 |
$tps_fin = mktime(23,59,59,12,31, $_GET['annee']);
|
| - |
|
22 |
$annee = $_GET['annee'];
|
| 18 |
$tab_donnees = array() ;
|
23 |
} else {
|
| - |
|
24 |
$tps_debut = mktime(0,0,0,1,1);
|
| - |
|
25 |
$tps_fin = time();// jour courrant
|
| - |
|
26 |
$annee = date('Y', $tps_fin);
|
| 19 |
$tps_debut = mktime(0,0,0,1,1);
|
27 |
}
|
| 20 |
$tps_courrant = $tps_debut;
|
- |
|
| 21 |
$tps_fin = time();// jour courrant
|
28 |
$tps_courrant = $tps_debut;
|
| 22 |
$i = 1;
|
29 |
$i = 1;
|
| 23 |
//Requete par mois
|
30 |
//Requete par mois
|
| 24 |
while ($tps_courrant <= $tps_fin) {
|
31 |
while ($tps_courrant <= $tps_fin) {
|
| 25 |
//$tps_semaine_suivante = $tps_courrant + (7 * 24 * 60 * 60);
|
32 |
//$tps_semaine_suivante = $tps_courrant + (7 * 24 * 60 * 60);
|
| 26 |
$tps_mois_suivant = mktime(0,0,0,$i+1,1);
|
33 |
$tps_mois_suivant = mktime(0,0,0,$i+1,1,$annee);
|
| 27 |
//echo date('Y-m-d H:i:s', $tps_courrant).' - '.date('Y-m-d H:i:s', $tps_mois_suivant);
|
34 |
//echo date('Y-m-d H:i:s', $tps_courrant).' - '.date('Y-m-d H:i:s', $tps_mois_suivant);
|
| 28 |
$requete = 'SELECT U_DATE '.
|
35 |
$requete = 'SELECT U_DATE '.
|
| 29 |
'FROM annuaire_tela '.
|
36 |
'FROM annuaire_tela '.
|
| 30 |
'WHERE U_DATE >= "'.date('Y-m-d H:i:s', $tps_courrant).'" '.
|
37 |
'WHERE U_DATE >= "'.date('Y-m-d H:i:s', $tps_courrant).'" '.
|
| Line 35... |
Line 42... |
| 35 |
$tps_courrant = $tps_mois_suivant;
|
42 |
$tps_courrant = $tps_mois_suivant;
|
| 36 |
}
|
43 |
}
|
| 37 |
//echo '<pre>'.print_r($tab_donnees, true).'</pre>';
|
44 |
//echo '<pre>'.print_r($tab_donnees, true).'</pre>';
|
| 38 |
$tab_donnees = array_values($tab_donnees);
|
45 |
$tab_donnees = array_values($tab_donnees);
|
| Line 39... |
Line 46... |
| 39 |
|
46 |
|
| 40 |
$graph = new Graph(500,400,"auto");
|
47 |
$graph = new Graph(500, 400, 'auto');
|
| 41 |
$graph->img->SetMargin(30,30,30,40);
|
48 |
$graph->img->SetMargin(30, 30, 30, 40);
|
| 42 |
$graph->SetMarginColor("white");
|
49 |
$graph->SetMarginColor('white');
|
| 43 |
$graph->SetScale('textint');
|
50 |
$graph->SetScale('textint');
|
| 44 |
$graph->xaxis->SetTickLabels($tab_mois);
|
51 |
$graph->xaxis->SetTickLabels($tab_mois);
|
| 45 |
$graph->SetShadow();
|
52 |
$graph->SetShadow();
|
| 46 |
$graph->title->Set("Nombre d'inscrits au Réseau au ".date('d-m-Y', $tps_fin));
|
53 |
$graph->title->Set("Nombre d'inscrits au Réseau au ".date('d-m-Y', $tps_fin));
|
| 47 |
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
54 |
$graph->title->SetFont(FF_FONT1,FS_BOLD);
|
| Line 48... |
Line 55... |
| 48 |
$graph->xaxis->title->Set("Mois depuis le 1er janvier ".date('Y'));
|
55 |
$graph->xaxis->title->Set("Mois depuis le 1er janvier $annee");
|
| 49 |
|
56 |
|
| 50 |
$bPlot = new BarPlot($tab_donnees);
|
57 |
$bPlot = new BarPlot($tab_donnees);
|
| 51 |
$bPlot->value->Show();
|
58 |
$bPlot->value->Show();
|
| Line 52... |
Line 59... |
| 52 |
$bPlot->value->SetFormat("%s");
|
59 |
$bPlot->value->SetFormat('%s');
|
| 53 |
$bPlot->SetColor("brown") ;
|
60 |
$bPlot->SetColor('brown') ;
|
| 54 |
|
61 |
|
| 55 |
$graph->Add($bPlot);
|
62 |
$graph->Add($bPlot);
|