[ 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/ -> heureappel.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: heureappel.class.php,v 1.3 2005/02/14 16:01:01 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/stats/graph/heureappel.class.php,v $
  20   *
  21   */
  22  
  23  require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/graph/brouzouf.class.php");
  24  
  25  class GraphHeureAppel extends GraphBrouzouf
  26  {
  27    Function GraphHeureAppel($DB, $file)
  28    {
  29      $this->db = $DB;
  30      $this->file = $file;
  31  
  32      $this->client = 0;
  33      $this->titre = "Heure d'appel";
  34  
  35      $this->width = 400;
  36      $this->LabelAngle = 90;
  37  
  38      $this->barcolor = "blue";
  39    }
  40  
  41    Function GraphDraw()
  42    {
  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      $heure_appel = array();
  50      $num = $this->db->num_rows();
  51      $i = 0;
  52      
  53      while ($i < $num)
  54        {
  55          $obj = $this->db->fetch_object();    
  56          
  57          $h = ceil(strftime("%H",$obj->date)); // suppression du 0
  58          
  59          $heure_appel_nb[$h]++;
  60          $heure_appel_duree[$h] += $obj->duree;
  61          
  62          $i++;
  63        }
  64        }
  65  
  66      if ($num > 0)
  67        {
  68      $this->GraphMakeGraph($heure_appel_nb, $labels);
  69        }
  70    }
  71  
  72  }
  73  ?>


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