[ 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/destinations/ -> index.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: index.php,v 1.8 2005/09/22 14:12:13 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/stats/destinations/index.php,v $
  20   *
  21   */
  22  require ("./pre.inc.php");
  23  
  24  $page = $_GET["page"];
  25  $sortorder = $_GET["sortorder"];
  26  
  27  if (!$user->rights->telephonie->lire) accessforbidden();
  28  if (!$user->rights->telephonie->stats->lire) accessforbidden();
  29  
  30  llxHeader('','Telephonie - Statistiques');
  31  
  32  /*
  33   * Sécurité accés client
  34   */
  35  if ($user->societe_id > 0) 
  36  {
  37    $action = '';
  38    $socidp = $user->societe_id;
  39  }
  40  
  41  $h = 0;
  42  
  43  $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/destinations/index.php';
  44  $head[$h][1] = "Destinations";
  45  $hselected = $h;
  46  $h++;
  47  
  48  dolibarr_fiche_head($head, $hselected, "Destinations");
  49  
  50  print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
  51  
  52  print '<tr><td valign="top">';
  53  
  54  $sql = "SELECT destination, nbappels, ca, duree, duree_moy";
  55  $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_stats_destination";
  56  $sql .= " ORDER BY ca DESC";
  57  
  58  if ($db->query($sql))
  59  {
  60    $num = $db->num_rows();
  61    $i = 0;
  62  
  63    print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
  64    print '<tr class="liste_titre"><td>Destination</td><td align="right">CA</td>';
  65    print '<td align="right">Nb Appels</td>';
  66    print '<td align="right">Durée (sec)</td><td align="right">Durée moyenne (sec)</td></tr>';
  67    $var=True;
  68  
  69    while ($i < $num)
  70      {
  71        $row = $db->fetch_row();    
  72  
  73        $var=!$var;
  74  
  75        print "<tr $bc[$var]>";
  76        print '<td>'.$row[0].'</td>'."\n";
  77        print '<td align="right">'.sprintf("%01.2f",$row[2])."</td>\n";
  78        print '<td align="right">'.$row[1]."</td>\n";
  79        print '<td align="right">'.$row[3]."</td>\n";
  80        print '<td align="right">'.sprintf("%01.2f",$row[4])."</td>\n";
  81  
  82  
  83        print "</tr>\n";
  84        $i++;
  85      }
  86    print "</table>";
  87    $db->free();
  88  }
  89  else 
  90  {
  91    print $db->error() . ' ' . $sql;
  92  }
  93  
  94  
  95  print '</td><td valign="top">';
  96  
  97  print '</td></tr>';
  98  
  99  print '</table>';
 100  
 101  $db->close();
 102  
 103  llxFooter("<em>Derni&egrave;re modification $Date: 2005/09/22 14:12:13 $ r&eacute;vision $Revision: 1.8 $</em>");
 104  ?>


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