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

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

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

revision 1.2 by rodolphe, Mon Nov 14 08:30:16 2005 UTC revision 1.3 by rodolphe, Mon Nov 14 09:56:22 2005 UTC
# Line 28  class GraphDistributeurCommission extend Line 28  class GraphDistributeurCommission extend
28    {    {
29      $this->db = $DB;      $this->db = $DB;
30      $this->file = $file;      $this->file = $file;
31        $this->year = strftime("%Y",time());
32      $this->client = 0;      $this->client = 0;
33      $this->titre = "Commission mensuelle";      $this->titre = "Commission mensuelle ".$this->year;
34    
35      $this->barcolor = "orange";      $this->barcolor = "orange";
36      $this->showframe = true;      $this->showframe = true;
# Line 65  class GraphDistributeurCommission extend Line 65  class GraphDistributeurCommission extend
65              $row = $this->db->fetch_row($resql);                      $row = $this->db->fetch_row($resql);        
66                                            
67              $datas[$i] = $row[1];              $datas[$i] = $row[1];
68                $comms[$row[0]] = $row[1];
69              $labels[$i] = substr($row[0],-2)."/".substr($row[0],2,2);              $labels[$i] = substr($row[0],-2)."/".substr($row[0],2,2);
70                            
71              $sqli = "INSERT INTO ".MAIN_DB_PREFIX."telephonie_stats";              $sqli = "INSERT INTO ".MAIN_DB_PREFIX."telephonie_stats";
72              $sqli .= " (graph,ord,legend,valeur)";              $sqli .= " (graph,ord,legend,valeur)";
73              $sqli .= " VALUES ('distributeur.commission.mensuel.".$distributeur."'";              $sqli .= " VALUES ('distributeur.commission.mensuel.".$distributeur."'";
74              $sqli .= ",'$i','".$row[0]."','".$datas[$i]."');";              $sqli .= ",'$i','".$row[0]."','".$datas[$i]."');";
   
75              $resqli = $this->db->query($sqli);              $resqli = $this->db->query($sqli);
76    
77              $i++;              $i++;
78            }            }    
           
79          $this->db->free($resql);          $this->db->free($resql);
80        }        }
81      else      else
# Line 84  class GraphDistributeurCommission extend Line 83  class GraphDistributeurCommission extend
83          print $this->db->error() . ' ' . $sql;          print $this->db->error() . ' ' . $sql;
84        }                          }                  
85    
86        for ($i = 1 ; $i < 13 ; $i++)
87          {
88            $idx = $this->year.substr('0'.$i,-2);
89            $datas[$i-1] = $comms[$idx];
90            $labels[$i-1] = $i;
91          }
92    
93      if (sizeof($datas))      if (sizeof($datas))
94        {        {
95          $this->GraphDraw($this->file, $datas, $labels);          $this->GraphDraw($this->file, $datas, $labels);

Legend:
Removed from v.1.2  
changed lines
  Added in v.1.3

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