| 12
 3
 4
 5
 6
 7
 8
 9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 
 | <?php
/* Statistiques sur la base 
 * Created on 19 janv. 09
 *
 * To change the template for this generated file go to
 * Window - Preferences - PHPeclipse - PHP - Code Templates
 */
 
 include("config_bd.php");
 require_once "../BarPlot.class.php";
 
$conn=OCILogon($oracle_user,$oracle_password,$oracle_server);
if (!$conn) {echo "accès à la base impossible";}
else
{
	for ($mois = 1; $mois < 13; $mois++)
	{
	$query0="select count(*) from compt_util where dat_creat<='01/".$mois."/08'";	
    $state0=ociparse($conn,$query0);
    OCIexecute($state0);   
 
      while (ociFetchInto($state0,$result0))
      {
        $stats[$mois] = $result0[0];       
      }            
	}
OCILogoff($conn);
}
 
// affichage du graphique
$graph = new Graph(400, 400);
$graph->title->set('Nombre d adhésions');
 
$values = array($stats[1], $stats[2], $stats[3], $stats[4], $stats[5], $stats[6], $stats[7], $stats[8], $stats[9], $stats[10], $stats[11], $stats[12]);
 
$group = new PlotGroup;
$group->setPadding(NULL, NULL, 35, NULL);
 
$plot = new BarPlot($values, 1, 2);
$plot->setBarColor(new LightBlue(25));
$plot->setBarSpace(5);
 
$group->add($plot);
 
$values = array(0, 0, 0, 0);
 
$plot = new BarPlot($values, 2, 2);
$plot->setBarColor(new LightOrange(25));
$plot->setBarSpace(5);
 
$group->add($plot);
 
$graph->add($group);
$graph->draw();
 
?> | 
Partager