19 |
* $Source$ |
* $Source$ |
20 |
* |
* |
21 |
* |
* |
22 |
* Generation des graphiques |
* Generation des graphiques relatifs aux commerciaux |
|
* |
|
|
* |
|
23 |
* |
* |
24 |
*/ |
*/ |
25 |
require ("../../master.inc.php"); |
require ("../../master.inc.php"); |
46 |
$dirs[0] = DOL_DATA_ROOT."/graph/"; |
$dirs[0] = DOL_DATA_ROOT."/graph/"; |
47 |
$dirs[1] = DOL_DATA_ROOT."/graph/telephonie/"; |
$dirs[1] = DOL_DATA_ROOT."/graph/telephonie/"; |
48 |
$dirs[2] = DOL_DATA_ROOT."/graph/telephonie/commercials/"; |
$dirs[2] = DOL_DATA_ROOT."/graph/telephonie/commercials/"; |
49 |
|
$dirs[2] = DOL_DATA_ROOT."/graph/telephonie/distributeurs/"; |
50 |
|
|
51 |
$img_root = DOL_DATA_ROOT."/graph/telephonie/"; |
$img_root = DOL_DATA_ROOT."/graph/telephonie/"; |
52 |
|
|
115 |
} |
} |
116 |
} |
} |
117 |
/* |
/* |
118 |
|
* Distributeurs |
119 |
|
* |
120 |
|
*/ |
121 |
|
$sql = "SELECT distinct fk_distributeur"; |
122 |
|
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_distributeur_commerciaux"; |
123 |
|
|
124 |
|
$resql = $db->query($sql); |
125 |
|
if ($resql) |
126 |
|
{ |
127 |
|
while ($row = $db->fetch_row($resql)) |
128 |
|
{ |
129 |
|
/* Gain */ |
130 |
|
|
131 |
|
$dir = $img_root . "distributeurs/".$row[0]."/"; |
132 |
|
_cdir($dir); |
133 |
|
$file = $dir."gain.mensuel.png"; |
134 |
|
if ($verbose) print "Graph : gain distributeur $file\n"; |
135 |
|
$graph = new GraphDistributeurGain($db, $file); |
136 |
|
$graph->width = 400; |
137 |
|
$graph->GraphMakeGraph($row[0]); |
138 |
|
} |
139 |
|
} |
140 |
|
/* |
141 |
* Groupes |
* Groupes |
142 |
* |
* |
143 |
*/ |
*/ |
170 |
$graph->width = 400; |
$graph->width = 400; |
171 |
$graph->GraphMakeGraph($row[0]); |
$graph->GraphMakeGraph($row[0]); |
172 |
|
|
|
|
|
173 |
$i++; |
$i++; |
174 |
} |
} |
175 |
} |
} |
176 |
|
|
|
|
|
|
|
|
177 |
/* |
/* |
178 |
* Contrats |
* Contrats |
179 |
* |
* |
228 |
$graph->GraphMakeGraph($value); |
$graph->GraphMakeGraph($value); |
229 |
} |
} |
230 |
} |
} |
231 |
|
|
232 |
|
function _cdir($dir) |
233 |
|
{ |
234 |
|
if (! file_exists($dir)) |
235 |
|
{ |
236 |
|
umask(0); |
237 |
|
if (! @mkdir($dir, 0755)) |
238 |
|
{ |
239 |
|
print "Erreur: Le répertoire '$dir' n'existe pas et Dolibarr n'a pu le créer."; |
240 |
|
} |
241 |
|
else |
242 |
|
{ |
243 |
|
//print $dir ." créé\n"; |
244 |
|
} |
245 |
|
} |
246 |
|
} |
247 |
|
|
248 |
?> |
?> |