14,16 → 14,24 |
exit; |
} |
|
$tab_mois = array('', "Jan","Fev","Mar","Avr","Mai","Juin","Juil","Août","Sep","Oct","Nov","Dec"); |
$tab_mois = array('', 'Jan', 'Fev', 'Mar', 'Avr', 'Mai', 'Juin', 'Juil', 'Août', 'Sep', 'Oct', 'Nov', 'Dec'); |
$tab_donnees = array(0); |
$tps_debut = mktime(0,0,0,1,1); |
if (isset($_GET['annee'])) { |
$tps_debut = mktime(0,0,0,1,1, $_GET['annee']); |
$tps_fin = mktime(23,59,59,12,31, $_GET['annee']); |
$annee = $_GET['annee']; |
} else { |
$tps_debut = mktime(0,0,0,1,1); |
$tps_fin = time();// jour courrant |
$annee = date('Y', $tps_fin); |
} |
$tps_courrant = $tps_debut; |
$tps_fin = time();// jour courrant |
|
$i = 1; |
//Requete par mois |
while ($tps_courrant <= $tps_fin) { |
//$tps_semaine_suivante = $tps_courrant + (7 * 24 * 60 * 60); |
$tps_mois_suivant = mktime(0,0,0,$i+1,1); |
$tps_mois_suivant = mktime(0,0,0,$i+1,1,$annee); |
//echo date('Y-m-d H:i:s', $tps_courrant).' - '.date('Y-m-d H:i:s', $tps_mois_suivant); |
$requete = 'SELECT U_DATE '. |
'FROM annuaire_tela '. |
37,20 → 45,20 |
} |
//echo '<pre>'.print_r($tab_donnees, true).'</pre>'; |
|
$graph = new Graph(500,440,"auto"); |
$graph->img->SetMargin(50,50,30,50); |
$graph->SetMarginColor("white"); |
$graph = new Graph(500, 440, 'auto'); |
$graph->img->SetMargin(50, 50, 30, 50); |
$graph->SetMarginColor('white'); |
$graph->SetScale('textint'); |
$graph->xaxis->SetTickLabels($tab_mois); |
$graph->SetShadow(); |
$graph->title->Set("Évolution des inscrits au Réseau au ".date('d-m-Y', $tps_fin)); |
$graph->title->Set('Évolution des inscrits au Réseau au '.date('d-m-Y', $tps_fin)); |
$graph->title->SetFont(FF_FONT1,FS_BOLD); |
$graph->xaxis->title->Set("Mois depuis le 1er janvier ".date('Y')); |
$graph->xaxis->title->Set("Mois depuis le 1er janvier $annee"); |
|
$LinePlot = new LinePlot($tab_donnees); |
$LinePlot->value->Show(); |
$LinePlot->value->SetFormat("%s"); |
$LinePlot->SetColor("brown") ; |
$LinePlot->value->SetFormat('%s'); |
$LinePlot->SetColor('brown') ; |
|
$graph->Add($LinePlot); |
$graph->Stroke(); |