From 88494dc62292e1994ecb153c84d7cadb6e25d8b6 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 14 Feb 2005 15:45:42 +0000 Subject: [PATCH] =?UTF-8?q?Am=E9lioration=20g=E9n=E9rale?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../telephonie/stats/graph/camoyen.class.php | 21 ++++++++----------- 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/htdocs/telephonie/stats/graph/camoyen.class.php b/htdocs/telephonie/stats/graph/camoyen.class.php index dfc8d580596..37e86817bce 100644 --- a/htdocs/telephonie/stats/graph/camoyen.class.php +++ b/htdocs/telephonie/stats/graph/camoyen.class.php @@ -22,8 +22,8 @@ require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/graph/brouzouf.class.php"); -class GraphCaMoyen extends GraphBrouzouf{ - +class GraphCaMoyen extends GraphBrouzouf +{ Function GraphCaMoyen($DB, $file) { @@ -41,7 +41,6 @@ class GraphCaMoyen extends GraphBrouzouf{ Function GraphDraw() { - $num = 0; $ligne = new LigneTel($this->db); $sql = "SELECT date, sum(gain), sum(cout_vente), sum(fourn_montant)"; @@ -49,17 +48,16 @@ class GraphCaMoyen extends GraphBrouzouf{ $sql .= " WHERE fk_facture is not null"; $sql .= " GROUP BY date ASC"; - $result = $this->db->query($sql); - if ($result) + if ($this->db->query($sql)) { - $num = $this->db->num_rows(); + $num1 = $this->db->num_rows(); $i = 0; $labels = array(); $cf = array(); $cv = array(); $gg = array(); - while ($i < $num) + while ($i < $num1) { $row = $this->db->fetch_row(); @@ -86,15 +84,14 @@ class GraphCaMoyen extends GraphBrouzouf{ $sql .= " AND l.rowid = f.fk_ligne"; $sql .= " GROUP BY f.date ASC"; - $result = $this->db->query($sql); - if ($result) + if ($this->db->query($sql)) { - $num = $this->db->num_rows(); + $num2 = $this->db->num_rows(); $i = 0; $nbc = array(); - while ($i < $num) + while ($i < $num2) { $row = $this->db->fetch_row(); @@ -129,7 +126,7 @@ class GraphCaMoyen extends GraphBrouzouf{ } - if ($num > 0) + if (($num1 * $num2) > 0) { $this->GraphMakeGraph($camoy, $labels); }