Bugfis sur les couleurs
This commit is contained in:
parent
cbfeafef9e
commit
1b18ea8ed9
@ -36,13 +36,27 @@ class GraphLignesStatut extends GraphPie {
|
|||||||
$this->showframe = true;
|
$this->showframe = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
Function GraphMakeGraph()
|
Function GraphMakeGraph($commercial_id=0)
|
||||||
{
|
{
|
||||||
$num = 0;
|
$num = 0;
|
||||||
|
|
||||||
|
if ($commercial_id > 0)
|
||||||
|
{
|
||||||
|
$cuser = new User($this->db, $commercial_id);
|
||||||
|
$cuser->fetch();
|
||||||
|
$this->titre = "Statuts des lignes de ".$cuser->fullname;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$sql = "SELECT statut, count(*)";
|
$sql = "SELECT statut, count(*)";
|
||||||
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne";
|
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne";
|
||||||
$sql .= " WHERE statut in (2,3,6,7)";
|
$sql .= " WHERE statut in (2,3,6,7)";
|
||||||
|
|
||||||
|
if ($commercial_id > 0)
|
||||||
|
{
|
||||||
|
$sql .= " AND fk_commercial_sign =".$commercial_id;
|
||||||
|
}
|
||||||
|
|
||||||
$sql .= " GROUP BY statut ASC";
|
$sql .= " GROUP BY statut ASC";
|
||||||
|
|
||||||
|
|
||||||
@ -55,10 +69,15 @@ class GraphLignesStatut extends GraphPie {
|
|||||||
$statuts[6] = "Resiliée";
|
$statuts[6] = "Resiliée";
|
||||||
$statuts[7] = "Rejetée";
|
$statuts[7] = "Rejetée";
|
||||||
|
|
||||||
$this->colors = array('blue','green','red','black');
|
|
||||||
|
|
||||||
$result = $this->db->query($sql);
|
$colors_def[2] = 'blue';
|
||||||
if ($result)
|
$colors_def[3] = 'green';
|
||||||
|
$colors_def[6] = 'red';
|
||||||
|
$colors_def[7] = 'black';
|
||||||
|
|
||||||
|
$this->colors = array();
|
||||||
|
|
||||||
|
if ($this->db->query($sql))
|
||||||
{
|
{
|
||||||
$num = $this->db->num_rows();
|
$num = $this->db->num_rows();
|
||||||
$i = 0;
|
$i = 0;
|
||||||
@ -71,7 +90,7 @@ class GraphLignesStatut extends GraphPie {
|
|||||||
|
|
||||||
$datas[$i] = $row[1];
|
$datas[$i] = $row[1];
|
||||||
$labels[$i] = $statuts[$row[0]];
|
$labels[$i] = $statuts[$row[0]];
|
||||||
|
array_push($this->colors, $colors_def[$row[0]]);
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -81,7 +100,8 @@ class GraphLignesStatut extends GraphPie {
|
|||||||
{
|
{
|
||||||
print $this->db->error() . ' ' . $sql;
|
print $this->db->error() . ' ' . $sql;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$this->GraphDraw($this->file, $datas, $labels);
|
$this->GraphDraw($this->file, $datas, $labels);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user