30 |
$this->file = $file; |
$this->file = $file; |
31 |
$this->client = 0; |
$this->client = 0; |
32 |
$this->titre = "Resultat mensuel"; |
$this->titre = "Resultat mensuel"; |
33 |
|
$this->year = strftime("%Y",time()); |
34 |
$this->barcolor = "green"; |
$this->barcolor = "green"; |
35 |
$this->showframe = true; |
$this->showframe = true; |
36 |
} |
} |
40 |
$comms = array(); |
$comms = array(); |
41 |
$gains = array(); |
$gains = array(); |
42 |
$num = 0; |
$num = 0; |
|
|
|
43 |
$this->no_xaxis_title=1; |
$this->no_xaxis_title=1; |
44 |
|
|
45 |
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."telephonie_stats"; |
46 |
|
$sql .= " WHERE graph='distributeur.resultat.mensuel.".$distributeur."';"; |
47 |
|
$sql .= " AND legend like '".$this->year."%';"; |
48 |
|
$resql = $this->db->query($sql); |
49 |
|
|
50 |
$sql = "SELECT legend, valeur"; |
$sql = "SELECT legend, valeur"; |
51 |
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_stats"; |
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_stats"; |
52 |
$sql .= " WHERE graph = 'distributeur.gain.mensuel.".$distributeur."'"; |
$sql .= " WHERE graph = 'distributeur.gain.mensuel.".$distributeur."'"; |
77 |
|
|
78 |
$datas = array(); |
$datas = array(); |
79 |
$labels = array(); |
$labels = array(); |
80 |
$year = strftime("%Y",time()); |
|
81 |
for ($i = 1 ; $i < 13 ; $i++) |
for ($i = 1 ; $i < 13 ; $i++) |
82 |
{ |
{ |
83 |
$idx = $year.substr('0'.$i,-2); |
$idx = $this->year.substr('0'.$i,-2); |
84 |
$datas[$i-1] = $gains[$idx] - $comms[$idx]; |
$datas[$i-1] = $gains[$idx] - $comms[$idx]; |
85 |
$labels[$i-1] = $i; |
$labels[$i-1] = $i; |
86 |
|
|
87 |
|
$sqli = "INSERT INTO ".MAIN_DB_PREFIX."telephonie_stats"; |
88 |
|
$sqli .= " (graph,ord,legend,valeur)"; |
89 |
|
$sqli .= " VALUES ('distributeur.resultat.mensuel.".$distributeur."'"; |
90 |
|
$sqli .= ",'$i','".$idx."','".$datas[$i-1]."');"; |
91 |
|
$resqli = $this->db->query($sqli); |
92 |
} |
} |
93 |
|
|
94 |
if (sizeof($datas)) |
if (sizeof($datas)) |