Ajout logs
This commit is contained in:
parent
7f03d7e52f
commit
bcf6c1fec0
@ -30,7 +30,7 @@ class GraphDistributeurResultat extends GraphBar {
|
|||||||
$this->file = $file;
|
$this->file = $file;
|
||||||
$this->client = 0;
|
$this->client = 0;
|
||||||
$this->titre = "Resultat mensuel";
|
$this->titre = "Resultat mensuel";
|
||||||
|
$this->year = strftime("%Y",time());
|
||||||
$this->barcolor = "green";
|
$this->barcolor = "green";
|
||||||
$this->showframe = true;
|
$this->showframe = true;
|
||||||
}
|
}
|
||||||
@ -40,9 +40,13 @@ class GraphDistributeurResultat extends GraphBar {
|
|||||||
$comms = array();
|
$comms = array();
|
||||||
$gains = array();
|
$gains = array();
|
||||||
$num = 0;
|
$num = 0;
|
||||||
|
|
||||||
$this->no_xaxis_title=1;
|
$this->no_xaxis_title=1;
|
||||||
|
|
||||||
|
$sql = "DELETE FROM ".MAIN_DB_PREFIX."telephonie_stats";
|
||||||
|
$sql .= " WHERE graph='distributeur.resultat.mensuel.".$distributeur."';";
|
||||||
|
$sql .= " AND legend like '".$this->year."%';";
|
||||||
|
$resql = $this->db->query($sql);
|
||||||
|
|
||||||
$sql = "SELECT legend, valeur";
|
$sql = "SELECT legend, valeur";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_stats";
|
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_stats";
|
||||||
$sql .= " WHERE graph = 'distributeur.gain.mensuel.".$distributeur."'";
|
$sql .= " WHERE graph = 'distributeur.gain.mensuel.".$distributeur."'";
|
||||||
@ -73,12 +77,18 @@ class GraphDistributeurResultat extends GraphBar {
|
|||||||
|
|
||||||
$datas = array();
|
$datas = array();
|
||||||
$labels = array();
|
$labels = array();
|
||||||
$year = strftime("%Y",time());
|
|
||||||
for ($i = 1 ; $i < 13 ; $i++)
|
for ($i = 1 ; $i < 13 ; $i++)
|
||||||
{
|
{
|
||||||
$idx = $year.substr('0'.$i,-2);
|
$idx = $this->year.substr('0'.$i,-2);
|
||||||
$datas[$i-1] = $gains[$idx] - $comms[$idx];
|
$datas[$i-1] = $gains[$idx] - $comms[$idx];
|
||||||
$labels[$i-1] = $i;
|
$labels[$i-1] = $i;
|
||||||
|
|
||||||
|
$sqli = "INSERT INTO ".MAIN_DB_PREFIX."telephonie_stats";
|
||||||
|
$sqli .= " (graph,ord,legend,valeur)";
|
||||||
|
$sqli .= " VALUES ('distributeur.resultat.mensuel.".$distributeur."'";
|
||||||
|
$sqli .= ",'$i','".$idx."','".$datas[$i-1]."');";
|
||||||
|
$resqli = $this->db->query($sqli);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (sizeof($datas))
|
if (sizeof($datas))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user