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

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

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

revision 1.1 by rodolphe, Mon Nov 14 08:33:10 2005 UTC revision 1.2 by rodolphe, Mon Nov 14 10:45:42 2005 UTC
# Line 30  class GraphDistributeurResultat extends Line 30  class GraphDistributeurResultat extends
30      $this->file = $file;      $this->file = $file;
31      $this->client = 0;      $this->client = 0;
32      $this->titre = "Resultat mensuel";      $this->titre = "Resultat mensuel";
33        $this->year = strftime("%Y",time());
34      $this->barcolor = "green";      $this->barcolor = "green";
35      $this->showframe = true;      $this->showframe = true;
36    }    }
# Line 40  class GraphDistributeurResultat extends Line 40  class GraphDistributeurResultat extends
40      $comms = array();      $comms = array();
41      $gains = array();      $gains = array();
42      $num = 0;      $num = 0;
   
43      $this->no_xaxis_title=1;      $this->no_xaxis_title=1;
44    
45        $sql = "DELETE FROM ".MAIN_DB_PREFIX."telephonie_stats";
46        $sql .= " WHERE graph='distributeur.resultat.mensuel.".$distributeur."';";
47        $sql .= " AND legend like '".$this->year."%';";
48        $resql = $this->db->query($sql);
49    
50      $sql = "SELECT legend, valeur";      $sql = "SELECT legend, valeur";
51      $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_stats";      $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_stats";
52      $sql .= " WHERE graph = 'distributeur.gain.mensuel.".$distributeur."'";      $sql .= " WHERE graph = 'distributeur.gain.mensuel.".$distributeur."'";
# Line 73  class GraphDistributeurResultat extends Line 77  class GraphDistributeurResultat extends
77    
78      $datas = array();      $datas = array();
79      $labels = array();      $labels = array();
80      $year = strftime("%Y",time());  
81      for ($i = 1 ; $i < 13 ; $i++)      for ($i = 1 ; $i < 13 ; $i++)
82        {        {
83          $idx = $year.substr('0'.$i,-2);          $idx = $this->year.substr('0'.$i,-2);
84          $datas[$i-1] = $gains[$idx] - $comms[$idx];          $datas[$i-1] = $gains[$idx] - $comms[$idx];
85          $labels[$i-1] = $i;          $labels[$i-1] = $i;
86    
87            $sqli = "INSERT INTO ".MAIN_DB_PREFIX."telephonie_stats";
88            $sqli .= " (graph,ord,legend,valeur)";
89            $sqli .= " VALUES ('distributeur.resultat.mensuel.".$distributeur."'";
90            $sqli .= ",'$i','".$idx."','".$datas[$i-1]."');";      
91            $resqli = $this->db->query($sqli);
92        }        }
93    
94      if (sizeof($datas))      if (sizeof($datas))

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

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