From be822a9e10abfe00339a89cd25a05ce5f914c751 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 16 Mar 2005 16:02:44 +0000 Subject: [PATCH] Bugfix --- .../stats/ProcessGraphContrats.class.php | 20 +++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/htdocs/telephonie/stats/ProcessGraphContrats.class.php b/htdocs/telephonie/stats/ProcessGraphContrats.class.php index acdf96cbf41..36c8f398f5d 100644 --- a/htdocs/telephonie/stats/ProcessGraphContrats.class.php +++ b/htdocs/telephonie/stats/ProcessGraphContrats.class.php @@ -57,7 +57,7 @@ class ProcessGraphContrats function go($contrat_id = 0) { - if ($contrat_id = 0) + if ($contrat_id == 0) { $min = $this->ident * $this->cpc; $max = ($this->ident + 1 ) * $this->cpc; @@ -75,13 +75,18 @@ class ProcessGraphContrats * Lecture des contrats * */ - $sql = "SELECT c.rowid, count(l.ligne) as ligne"; + $sql = "SELECT c.rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_contrat as c"; - $sql .= ",".MAIN_DB_PREFIX."telephonie_societe_ligne as l"; - $sql .= " WHERE l.fk_contrat = c.rowid "; - $sql .= " AND c.rowid >= ".$min; - $sql .= " AND c.rowid < ".$max; - $sql .= " GROUP BY c.rowid"; + + if ($contrat_id == 0) + { + $sql .= " WHERE c.rowid >= ".$min; + $sql .= " AND c.rowid < ".$max; + } + else + { + $sql .= " WHERE c.rowid = ".$min; + } if ($this->db->query($sql)) { @@ -95,7 +100,6 @@ class ProcessGraphContrats $obj = $this->db->fetch_object(); $contrats[$i] = $obj->rowid; - $i++; } }