/[dolibarr]/dolibarr/htdocs/telephonie/stats/distributeurs/distributeur.gain.class.php
ViewVC logotype

Diff of /dolibarr/htdocs/telephonie/stats/distributeurs/distributeur.gain.class.php

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.7 by rodolphe, Thu Nov 10 15:44:52 2005 UTC revision 1.8 by rodolphe, Mon Nov 14 09:56:31 2005 UTC
# Line 30  class GraphDistributeurGain extends Grap Line 30  class GraphDistributeurGain extends Grap
30      $this->file = $file;      $this->file = $file;
31    
32      $this->client = 0;      $this->client = 0;
33      $this->titre = "Gain mensuel";      $this->titre = "Gain mensuel ".strftime("%Y",time());
34    
35      $this->barcolor = "pink";      $this->barcolor = "pink";
36      $this->showframe = true;      $this->showframe = true;
# Line 39  class GraphDistributeurGain extends Grap Line 39  class GraphDistributeurGain extends Grap
39    Function GraphMakeGraph($distributeur=0)    Function GraphMakeGraph($distributeur=0)
40    {    {
41      $num = 0;      $num = 0;
42        $year = strftime("%Y",time());
43    
44      $sql = "DELETE FROM ".MAIN_DB_PREFIX."telephonie_stats";      $sql = "DELETE FROM ".MAIN_DB_PREFIX."telephonie_stats";
45      $sql .= " WHERE graph='distributeur.gain.mensuel.".$distributeur."';";      $sql .= " WHERE graph='distributeur.gain.mensuel.".$distributeur."';";
# Line 62  class GraphDistributeurGain extends Grap Line 63  class GraphDistributeurGain extends Grap
63          $i = 0;          $i = 0;
64          $j = -1;          $j = -1;
65          $datas = array();          $datas = array();
66            $gains = array();
67          $labels = array();          $labels = array();
68                    
69          while ($i < $num)          while ($i < $num)
# Line 69  class GraphDistributeurGain extends Grap Line 71  class GraphDistributeurGain extends Grap
71              $row = $this->db->fetch_row($resql);                      $row = $this->db->fetch_row($resql);        
72                                            
73              $datas[$i] = $row[1];              $datas[$i] = $row[1];
74                $gains[$row[0]] = $row[1];
75              $labels[$i] = substr($row[0],-2)."/".substr($row[0],2,2);              $labels[$i] = substr($row[0],-2)."/".substr($row[0],2,2);
76                            
77              $sqli = "INSERT INTO ".MAIN_DB_PREFIX."telephonie_stats";              $sqli = "INSERT INTO ".MAIN_DB_PREFIX."telephonie_stats";
# Line 88  class GraphDistributeurGain extends Grap Line 91  class GraphDistributeurGain extends Grap
91          print $this->db->error() . ' ' . $sql;          print $this->db->error() . ' ' . $sql;
92        }                          }                  
93    
94        for ($i = 1 ; $i < 13 ; $i++)
95          {
96            $idx = $year.substr('0'.$i,-2);
97            $datas[$i-1] = $gains[$idx];
98            $labels[$i-1] = $i;
99          }
100    
101      if (sizeof($datas))      if (sizeof($datas))
102        {        {
103          $this->GraphDraw($this->file, $datas, $labels);          $this->GraphDraw($this->file, $datas, $labels);

Legend:
Removed from v.1.7  
changed lines
  Added in v.1.8

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26