[ 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/lignes/ -> commandes.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: commandes.class.php,v 1.2 2005/02/18 12:42:00 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/stats/lignes/commandes.class.php,v $
  20   *
  21   */
  22  
  23  require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/graph/bar.class.php");
  24  
  25  class GraphLignesCommandes extends GraphBar {
  26  
  27    Function GraphLignesCommandes($DB, $file)
  28    {
  29      $this->db = $DB;
  30      $this->file = $file;
  31  
  32      $this->client = 0;
  33      $this->titre = "Commandes Lignes par mois";
  34  
  35      $this->barcolor = "blue";
  36      $this->showframe = true;
  37  
  38      $this->LabelAngle = 0;
  39    }
  40  
  41    Function GraphMakeGraph($commercial=0)
  42    {
  43      $num = 0;
  44  
  45      $sql = "SELECT date_format(date_commande,'%Y%m'), count(*)";
  46      $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne";
  47      $sql .= " WHERE date_commande IS NOT NULL ";
  48  
  49      if ($commercial > 0)
  50        {
  51      $sql .= " AND fk_commercial = ".$commercial;
  52        }
  53  
  54      $sql .= " GROUP BY date_format(date_commande,'%Y%m') ASC";
  55  
  56      $result = $this->db->query($sql);
  57  
  58      if ($result)
  59        {
  60      $num = $this->db->num_rows();
  61      $i = 0;
  62      $j = -1;
  63      $attente = array();
  64      $acommander = array();
  65      $commandee = array();
  66      $active = array();
  67      $last = 0;
  68      
  69      while ($i < $num)
  70        {
  71          $row = $this->db->fetch_row();    
  72                  
  73          $datas[$i] = $row[1];
  74          $labels[$i] = substr($row[0],-2);//."/".substr($row[0],2,2);
  75  
  76          $i++;
  77        }
  78      
  79      $this->db->free();
  80        }
  81      else 
  82        {
  83      print $this->db->error() . ' ' . $sql;
  84        }                  
  85  
  86      $this->GraphDraw($this->file, $datas, $labels);
  87  
  88    }
  89  
  90  }   
  91  
  92  ?>


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