[ 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/graph/ -> joursemaine.class.php (source)

   1  <?PHP
   2  /* Copyright (C) 2004 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: joursemaine.class.php,v 1.4 2005/02/14 16:04:27 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/stats/graph/joursemaine.class.php,v $
  20   *
  21   */
  22  
  23  require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/graph/brouzouf.class.php");
  24  
  25  class GraphJoursemaine extends GraphBrouzouf{
  26  
  27  
  28    Function GraphJoursemaine($DB, $file)
  29    {
  30      $this->db = $DB;
  31      $this->file = $file;
  32  
  33      $this->client = 0;
  34      $this->titre = "Jour de la semaine";
  35  
  36      $this->width = 400;
  37      $this->LabelAngle = 45;
  38  
  39      $this->barcolor = "green";
  40    }
  41  
  42    Function GraphDraw()
  43    {
  44      $sql = "SELECT ".$this->db->pdate("date")." as date, duree";
  45      $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_communications_details";
  46      
  47      if ($this->db->query($sql))
  48        {
  49  
  50      $jour_semaine_nb = array();
  51      $jour_semaine_duree = array();
  52      
  53      $num = $this->db->num_rows();
  54  
  55      $i = 0;
  56      
  57      while ($i < $num)
  58        {
  59          $obj = $this->db->fetch_object();    
  60      
  61          $u = strftime("%u",$obj->date) - 1; // 1 pour Lundi
  62          
  63          $jour_semaine_nb[$u]++;
  64          $jour_semaine_duree[$u] += $obj->duree;
  65          
  66          $i++;
  67        }
  68        }
  69  
  70      if ($num > 0)
  71        {        
  72      $this->GraphMakeGraph($jour_semaine_nb,array('Lun','Mar','Mer','Jeu','Ven','Sam','Dim'));
  73        }
  74    }
  75  
  76  }
  77  ?>


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