[ 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/ -> actives.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: actives.class.php,v 1.4 2005/11/09 16:45:57 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/stats/lignes/actives.class.php,v $
  20   *
  21   */
  22  require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/graph/line.class.php");
  23  
  24  class GraphLignesActives extends GraphLine {
  25  
  26    Function GraphLignesActives($DB, $file)
  27    {
  28      $this->db = $DB;
  29      $this->file = $file;
  30  
  31      $this->client = 0;
  32      $this->titre = "Lignes en présélections";
  33  
  34      $this->barcolor = "green";
  35      $this->showframe = true;
  36    }
  37  
  38  
  39    Function GraphMakeGraph()
  40    {
  41      $num = 0;
  42  
  43      $sql = "SELECT dates, statut,nb";
  44      $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_ligne_statistique";
  45      $sql .= " WHERE statut = 3";
  46      $sql .= " ORDER BY dates ASC";
  47      
  48      $resql = $this->db->query($sql);
  49      if ($resql)
  50        {
  51      $num = $this->db->num_rows($resql);
  52      $i = 0;
  53      $j = -1;
  54      $attente = array();
  55      $acommander = array();
  56      $commandee = array();
  57      $active = array();
  58      $last = 0;
  59      
  60      while ($i < $num)
  61        {
  62          $row = $this->db->fetch_row($resql);    
  63  
  64          $j++;
  65          $labels[$j] = substr($row[0],5,2)."/".substr($row[0],2,2);
  66          $attente[$j]    = 0;
  67          $acommander[$j] = 0;
  68          $commandee[$j]  = 0;
  69          $active[$j]     = 0;
  70          $last = substr($row[0],5,2)."/".substr($row[0],2,2);
  71          
  72          if ($row[1] == 3)
  73            {
  74          $active[$j] = $row[2];
  75            }
  76          
  77          $i++;
  78        }
  79      
  80      $this->db->free();
  81        }
  82      else 
  83        {
  84      print $this->db->error() . ' ' . $sql;
  85        }
  86      
  87      $this->LabelInterval = 1;
  88  
  89      $a = round($num / 20,0);
  90  
  91      if ($a > 1)
  92        {
  93      $this->LabelInterval = $a;
  94        }
  95  
  96      $this->GraphDraw($this->file, $active, $labels);
  97    }
  98  }
  99  
 100  
 101  class GraphLignesCommandees extends GraphLine {
 102  
 103    Function GraphLignesCommandees($DB, $file)
 104    {
 105      $this->db = $DB;
 106      $this->file = $file;
 107  
 108      $this->client = 0;
 109      $this->titre = "Lignes en commandes";
 110  
 111      $this->barcolor = "green";
 112      $this->showframe = true;
 113    }
 114  
 115  
 116    Function GraphMakeGraph()
 117    {
 118      $num = 0;
 119  
 120      $sql = "SELECT dates, statut,nb";
 121      $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_ligne_statistique";
 122      $sql .= " WHERE statut = 2";
 123      $sql .= " ORDER BY dates ASC";
 124      
 125      $resql = $this->db->query($sql);
 126      if ($resql)
 127        {
 128      $num = $this->db->num_rows($resql);
 129      $i = 0;
 130      $j = -1;
 131      $attente = array();
 132      $acommander = array();
 133      $commandee = array();
 134      $active = array();
 135      $last = 0;
 136      
 137      while ($i < $num)
 138        {
 139          $row = $this->db->fetch_row($resql);    
 140  
 141          $j++;
 142          $labels[$j] = substr($row[0],5,2)."/".substr($row[0],2,2);
 143          $attente[$j]    = 0;
 144          $acommander[$j] = 0;
 145          $commandee[$j]  = 0;
 146          $active[$j]     = 0;
 147          $last = substr($row[0],5,2)."/".substr($row[0],2,2);
 148          
 149          if ($row[1] == 2)
 150            {
 151          $active[$j] = $row[2];
 152            }
 153          
 154          $i++;
 155        }
 156      
 157      $this->db->free();
 158        }
 159      else 
 160        {
 161      print $this->db->error() . ' ' . $sql;
 162        }
 163      
 164      $this->LabelInterval = 1;
 165  
 166      $a = round($num / 20,0);
 167  
 168      if ($a > 1)
 169        {
 170      $this->LabelInterval = $a;
 171        }
 172  
 173      $this->GraphDraw($this->file, $active, $labels);
 174    }
 175  }
 176  
 177  
 178  ?>


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