From 4ab2f75844fcb63b0e218b142df4f8a1c10e094d Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 16 Mar 2005 15:16:39 +0000 Subject: [PATCH] =?UTF-8?q?Utilisation=20de=20la=20class=20Bar,=20au=20lie?= =?UTF-8?q?u=20de=20la=20class=20Brouzouf,=20plus=20appropri=E9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../stats/graph/appelsdureemoyenne.class.php | 28 +++++++++++-------- 1 file changed, 17 insertions(+), 11 deletions(-) diff --git a/htdocs/telephonie/stats/graph/appelsdureemoyenne.class.php b/htdocs/telephonie/stats/graph/appelsdureemoyenne.class.php index ea0930a3816..6dc9f8e4469 100644 --- a/htdocs/telephonie/stats/graph/appelsdureemoyenne.class.php +++ b/htdocs/telephonie/stats/graph/appelsdureemoyenne.class.php @@ -20,9 +20,9 @@ * */ -require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/graph/brouzouf.class.php"); +require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/graph/bar.class.php"); -class GraphAppelsDureeMoyenne extends GraphBrouzouf{ +class GraphAppelsDureeMoyenne extends GraphBar{ Function GraphAppelsDureeMoyenne($DB, $file) @@ -30,6 +30,9 @@ class GraphAppelsDureeMoyenne extends GraphBrouzouf{ $this->db = $DB; $this->file = $file; + $this->datas = array(); + $this->labels = array(); + $this->client = 0; $this->contrat = 0; $this->ligne = 0; @@ -40,8 +43,17 @@ class GraphAppelsDureeMoyenne extends GraphBrouzouf{ $this->barcolor = "pink"; } + Function Graph($datas='', $labels='') + { + $this->GetDatas(); - Function GraphDraw() + if (sizeof($this->datas)) + { + $this->GraphDraw($this->file, $this->datas, $this->labels); + } + } + + Function GetDatas() { $num = 0; @@ -83,14 +95,13 @@ class GraphAppelsDureeMoyenne extends GraphBrouzouf{ { $num = $this->db->num_rows(); $i = 0; - $labels = array(); while ($i < $num) { $row = $this->db->fetch_row(); - $labels[$i] = substr($row[0],4,2) . '/'.substr($row[0],2,2); - $datas[$i] = ($row[1] / $row[2] ) ; + $this->labels[$i] = substr($row[0],4,2) . '/'.substr($row[0],2,2); + $$this->datas[$i] = ($row[1] / $row[2] ) ; $i++; } @@ -108,11 +119,6 @@ class GraphAppelsDureeMoyenne extends GraphBrouzouf{ { print $this->client . " " . $cv[$i - 1]."\n"; } - - if ($num > 1) - { - $this->GraphMakeGraph($datas, $labels); - } } }