[ Index ]
 

Code source de Dolibarr 2.0.1

Accédez au Source d'autres logiciels libres

Classes | Fonctions | Variables | Constantes | Tables

title

Body

[fermer]

/htdocs/telephonie/stats/distributeurs/ -> distributeur.po.month.class.php (source)

   1  <?PHP
   2  /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   *
   4   * This program is free software; you can redistribute it and/or modify
   5   * it under the terms of the GNU General Public License as published by
   6   * the Free Software Foundation; either version 2 of the License, or
   7   * (at your option) any later version.
   8   *
   9   * This program is distributed in the hope that it will be useful,
  10   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  11   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  12   * GNU General Public License for more details.
  13   *
  14   * You should have received a copy of the GNU General Public License
  15   * along with this program; if not, write to the Free Software
  16   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  17   *
  18   * $Id: distributeur.po.month.class.php,v 1.1 2005/05/19 09:43:42 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/stats/distributeurs/distributeur.po.month.class.php,v $
  20   *
  21   */
  22  
  23  require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/graph/bar.class.php");
  24  
  25  class GraphDistributeurPoMensuel extends GraphBar {
  26  
  27    Function GraphDistributeurPoMensuel($DB, $file)
  28    {
  29      $this->db = $DB;
  30      $this->file = $file;
  31  
  32      $this->client = 0;
  33      $this->titre = "Prise d'ordre mensuelle";
  34  
  35      $this->barcolor = "blue";
  36      $this->showframe = true;
  37    }
  38  
  39    Function GraphMakeGraph($id=0, $nom='')
  40    {
  41      $num = 0;
  42  
  43      $this->titre = "Prise d'ordre mensuelle pour $nom";
  44  
  45      $labels = array();
  46  
  47      
  48      $sql = "SELECT date_format(datepo, '%m-%Y'), sum(p.montant)";
  49      $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_contrat_priseordre as p";
  50      
  51      $sql .= " WHERE p.fk_distributeur = ".$id;
  52      $sql .= " GROUP BY date_format(p.datepo, '%Y%m') ASC";
  53  
  54  
  55      if ($this->db->query($sql))
  56        {
  57      $num = $this->db->num_rows();
  58      
  59      $i = 0;
  60      $datas = array();
  61          
  62      while ($i < $num)
  63        {
  64          $row = $this->db->fetch_row();        
  65          array_push($datas, $row[1]);
  66          array_push($labels, $row[0]);
  67          $i++;
  68        }
  69      
  70      $this->db->free();
  71        }
  72      else 
  73        {
  74      dolibarr_syslog($this->db->error());
  75        }
  76  
  77      if (sizeof($datas) > 0)
  78        {
  79      $this->GraphDraw($this->file, $datas, $labels);
  80        }
  81    }
  82  }   
  83  ?>


Généré le : Mon Nov 26 12:29:37 2007 par Balluche grâce à PHPXref 0.7
  Clicky Web Analytics