1 |
<?PHP |
<?PHP |
2 |
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> |
/* Copyright (C) 2004-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> |
3 |
* |
* |
4 |
* This program is free software; you can redistribute it and/or modify |
* This program is free software; you can redistribute it and/or modify |
5 |
* it under the terms of the GNU General Public License as published by |
* it under the terms of the GNU General Public License as published by |
19 |
* $Source$ |
* $Source$ |
20 |
* |
* |
21 |
* |
* |
22 |
* Generation des graphiques |
* Generation de graphiques |
23 |
* |
* |
24 |
* |
* |
25 |
* |
* |
65 |
|
|
66 |
$img_root = DOL_DATA_ROOT."/graph/telephonie/"; |
$img_root = DOL_DATA_ROOT."/graph/telephonie/"; |
67 |
|
|
|
|
|
|
|
|
68 |
/**********************************************************************/ |
/**********************************************************************/ |
69 |
/* |
/* |
70 |
/* Stats sur les factures |
/* Stats sur les factures |
98 |
$gain_moyen = array(); |
$gain_moyen = array(); |
99 |
|
|
100 |
$num = $db->num_rows($resql); |
$num = $db->num_rows($resql); |
101 |
print "$num lignes de comm a traiter\n"; |
|
102 |
$i = 0; |
$i = 0; |
103 |
|
|
104 |
while ($i < $num) |
while ($i < $num) |
148 |
$graph = new GraphBar ($db, $file); |
$graph = new GraphBar ($db, $file); |
149 |
$graph->titre = "Chiffre d'affaire par mois en euros HT"; |
$graph->titre = "Chiffre d'affaire par mois en euros HT"; |
150 |
$graph->width = 440; |
$graph->width = 440; |
|
print $graph->titre."\n"; |
|
151 |
$graph->GraphDraw($file, $cout_vente, $labels); |
$graph->GraphDraw($file, $cout_vente, $labels); |
152 |
|
|
153 |
$file = $img_root . "/factures/facture_moyenne.png"; |
$file = $img_root . "/factures/facture_moyenne.png"; |
154 |
$graph = new GraphBar ($db, $file, $labels); |
$graph = new GraphBar ($db, $file, $labels); |
155 |
$graph->titre = "Facture moyenne"; |
$graph->titre = "Facture moyenne"; |
|
print $graph->titre."\n"; |
|
156 |
$graph->barcolor = "blue"; |
$graph->barcolor = "blue"; |
157 |
$graph->width = 440; |
$graph->width = 440; |
158 |
$graph->GraphDraw($file, $cout_vente_moyen, $labels); |
$graph->GraphDraw($file, $cout_vente_moyen, $labels); |
161 |
$graph = new GraphBar ($db, $file); |
$graph = new GraphBar ($db, $file); |
162 |
$graph->titre = "Gain par mois en euros HT"; |
$graph->titre = "Gain par mois en euros HT"; |
163 |
$graph->width = 440; |
$graph->width = 440; |
|
print $graph->titre."\n"; |
|
164 |
$graph->GraphDraw($file, $gain, $labels); |
$graph->GraphDraw($file, $gain, $labels); |
165 |
|
|
166 |
$file = $img_root . "/factures/gain_moyen.png"; |
$file = $img_root . "/factures/gain_moyen.png"; |
167 |
$graph = new GraphBar ($db, $file); |
$graph = new GraphBar ($db, $file); |
168 |
$graph->titre = "Gain moyen par facture par mois"; |
$graph->titre = "Gain moyen par facture par mois"; |
169 |
$graph->width = 440; |
$graph->width = 440; |
|
print $graph->titre."\n"; |
|
170 |
$graph->barcolor = "blue"; |
$graph->barcolor = "blue"; |
171 |
$graph->GraphDraw($file, $gain_moyen, $labels); |
$graph->GraphDraw($file, $gain_moyen, $labels); |
172 |
|
|
173 |
$file = $img_root . "/factures/nb_facture.png"; |
$file = $img_root . "/factures/nb_facture.png"; |
174 |
$graph = new GraphBar ($db, $file); |
$graph = new GraphBar ($db, $file); |
175 |
$graph->titre = "Nb de facture mois"; |
$graph->titre = "Nb de facture mois"; |
|
print $graph->titre."\n"; |
|
176 |
$graph->width = 440; |
$graph->width = 440; |
177 |
$graph->barcolor = "yellow"; |
$graph->barcolor = "yellow"; |
178 |
$graph->GraphDraw($file, $nb_factures, $labels); |
$graph->GraphDraw($file, $nb_factures, $labels); |
282 |
} |
} |
283 |
|
|
284 |
|
|
|
|
|
285 |
$i = 0; |
$i = 0; |
286 |
foreach ($labels as $labl) |
foreach ($labels as $labl) |
287 |
{ |
{ |
295 |
$file = $img_root . "/factures/ca_mensuel_preleve.png"; |
$file = $img_root . "/factures/ca_mensuel_preleve.png"; |
296 |
$graph = new GraphBarAccumul ($db, $file); |
$graph = new GraphBarAccumul ($db, $file); |
297 |
$graph->titre = "Chiffre d'affaire par méthode de réglement"; |
$graph->titre = "Chiffre d'affaire par méthode de réglement"; |
|
print $graph->titre."\n"; |
|
298 |
$graph->width = 440; |
$graph->width = 440; |
299 |
$graph->height = 360; |
$graph->height = 360; |
300 |
$graph->barcolor = "yellow"; |
$graph->barcolor = "yellow"; |
310 |
|
|
311 |
$graph->GraphDraw($file, $labels, $cout_vente); |
$graph->GraphDraw($file, $labels, $cout_vente); |
312 |
|
|
|
|
|
313 |
?> |
?> |