[ 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/script/ -> graph-statistiques-lignes.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: graph-statistiques-lignes.php,v 1.5 2005/10/19 09:04:01 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/script/graph-statistiques-lignes.php,v $
  20   *
  21   *
  22   * Generation des graphiques sur les lignes
  23   *
  24   *
  25   */
  26  require  ("../../master.inc.php");
  27  require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/ProcessGraphLignes.class.php");
  28  
  29  $graph_all = 0;
  30  
  31  //loop through our arguments and see what the user selected
  32  for ($i = 1; $i < sizeof($GLOBALS["argv"]); $i++)
  33  {
  34    switch($GLOBALS["argv"][$i])
  35      {
  36      case "-v":
  37      case "--version":
  38        echo  $GLOBALS['argv'][0]." $Revision: 1.5 $\n";
  39        exit;
  40        break;
  41      case "--all":
  42        $graph_all = 1;
  43        break;
  44      }
  45  }
  46  
  47  print strftime("%H:%M:%S",time())."\n";
  48  
  49  $datetime = time();
  50  $month = strftime("%m", $datetime);
  51  $year = strftime("%Y", $datetime);
  52  
  53  if ($month == 1)
  54  {
  55    $month = "12";
  56    $year = $year - 1;
  57  }
  58  else
  59  {
  60    $month = substr("00".($month - 1), -2) ;
  61  }
  62  
  63  $sql = "SELECT distinct(fk_ligne)";
  64  $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_communications_details";
  65  if ($graph_all == 0)
  66  {
  67    $sql .= " WHERE date_format(date,'%m%Y') = '".$month.$year."'";
  68  }
  69  
  70  $resql = $db->query($sql);
  71  
  72  if ($resql)
  73  {
  74    $num = $db->num_rows($resql);
  75    $i = 0;
  76  
  77    print "$num lignes\n";
  78  
  79    while ($i < $num)
  80      {
  81        print substr("0000".($i+1), -4) . "/".substr("0000".$num, -4)."\n";
  82        $row = $db->fetch_row($resql);
  83  
  84        $gr = new ProcessGraphLignes($db);
  85        $gr->go($row[0]);
  86  
  87        $i++;
  88      }
  89  }
  90  ?>


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