37 |
require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/commerciaux/groupes/groupe.ca.class.php"); |
require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/commerciaux/groupes/groupe.ca.class.php"); |
38 |
|
|
39 |
$error = 0; |
$error = 0; |
40 |
|
$year = strftime("%Y",time()); |
41 |
/* |
/* |
42 |
* Création des répertoires |
* Création des répertoires |
43 |
* |
* |
68 |
} |
} |
69 |
} |
} |
70 |
} |
} |
71 |
|
require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/distributeurs/distributeur.gain.class.php"); |
72 |
|
require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/distributeurs/distributeur.commission.class.php"); |
73 |
|
require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/distributeurs/distributeur.resultat.class.php"); |
74 |
/* |
/* |
75 |
* Distributeurs |
* Distributeurs |
76 |
* |
* |
84 |
while ($row = $db->fetch_row($resql)) |
while ($row = $db->fetch_row($resql)) |
85 |
{ |
{ |
86 |
/* Gain */ |
/* Gain */ |
|
require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/distributeurs/distributeur.gain.class.php"); |
|
87 |
$dir = $img_root . "distributeurs/".$row[0]."/"; |
$dir = $img_root . "distributeurs/".$row[0]."/"; |
88 |
_cdir($dir); |
_cdir($dir); |
89 |
$file = $dir."gain.mensuel.png"; |
$file = $dir."gain.mensuel.png"; |
90 |
if ($verbose) print "Graph : gain distributeur $file\n"; |
if ($verbose) print "Graph : gain distributeur $file\n"; |
91 |
$graph = new GraphDistributeurGain($db, $file); |
$graph = new GraphDistributeurGain($db, $file); |
92 |
$graph->width = 500; |
$graph->width = 500; |
93 |
$graph->height = 300; |
$graph->height = 260; |
94 |
$graph->GraphMakeGraph($row[0]); |
$graph->GraphMakeGraph($row[0]); |
95 |
|
|
96 |
/* Commission */ |
/* Commission */ |
|
require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/distributeurs/distributeur.commission.class.php"); |
|
97 |
$dir = $img_root . "distributeurs/".$row[0]."/"; |
$dir = $img_root . "distributeurs/".$row[0]."/"; |
98 |
_cdir($dir); |
_cdir($dir); |
99 |
$file = $dir."commission.mensuel.png"; |
$file = $dir."commission.mensuel.png"; |
100 |
if ($verbose) print "Graph : commission distributeur $file\n"; |
if ($verbose) print "Graph : commission distributeur $file\n"; |
101 |
$graph = new GraphDistributeurCommission($db, $file); |
$graph = new GraphDistributeurCommission($db, $file); |
102 |
$graph->width = 500; |
$graph->width = 500; |
103 |
$graph->height = 300; |
$graph->height = 260; |
104 |
$graph->GraphMakeGraph($row[0]); |
$graph->GraphMakeGraph($row[0]); |
105 |
|
|
106 |
/* Resultat */ |
/* Resultat */ |
|
require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/distributeurs/distributeur.resultat.class.php"); |
|
107 |
$dir = $img_root . "distributeurs/".$row[0]."/"; |
$dir = $img_root . "distributeurs/".$row[0]."/"; |
108 |
_cdir($dir); |
_cdir($dir); |
109 |
$file = $dir."resultat.mensuel.png"; |
$file = $dir."resultat.mensuel.png"; |
110 |
if ($verbose) print "Graph : resultat distributeur $file\n"; |
if ($verbose) print "Graph : resultat distributeur $file\n"; |
111 |
$graph = new GraphDistributeurResultat($db, $file); |
$graph = new GraphDistributeurResultat($db, $file); |
112 |
$graph->width = 500; |
$graph->width = 500; |
113 |
$graph->height = 300; |
$graph->height = 260; |
114 |
$graph->GraphMakeGraph($row[0]); |
$graph->GraphMakeGraph($row[0]); |
115 |
} |
} |
116 |
} |
} |
117 |
|
|
118 |
|
/* |
119 |
|
* Globaux |
120 |
|
* |
121 |
|
*/ |
122 |
|
/* Gain */ |
123 |
|
$file = $img_root . "distributeurs/gain.mensuel.$year.png"; |
124 |
|
if ($verbose) print "Graph : gain distributeur $file\n"; |
125 |
|
$graph = new GraphDistributeurGain($db, $file); |
126 |
|
$graph->width = 500; |
127 |
|
$graph->height = 260; |
128 |
|
$graph->GraphMakeGraph(0); |
129 |
|
|
130 |
|
$file = $img_root . "distributeurs/commission.mensuel.$year.png"; |
131 |
|
if ($verbose) print "Graph : commission distributeur $file\n"; |
132 |
|
$graph = new GraphDistributeurCommission($db, $file); |
133 |
|
$graph->width = 500; |
134 |
|
$graph->height = 260; |
135 |
|
$graph->GraphMakeGraph(0); |
136 |
|
|
137 |
|
$file = $img_root . "distributeurs/resultat.mensuel.$year.png"; |
138 |
|
if ($verbose) print "Graph : resultat distributeur $file\n"; |
139 |
|
$graph = new GraphDistributeurResultat($db, $file); |
140 |
|
$graph->width = 500; |
141 |
|
$graph->height = 260; |
142 |
|
$graph->GraphMakeGraph(0); |
143 |
|
|
144 |
|
|
145 |
function _cdir($dir) |
function _cdir($dir) |
146 |
{ |
{ |