[ 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/distributeurs/ -> stats.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: stats.php,v 1.6 2005/09/14 14:35:08 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/distributeurs/stats.php,v $
  20   *
  21   */
  22  require ("./pre.inc.php");
  23  
  24  if ($user->distributeur_id && $user->responsable_distributeur_id == 0)
  25  {
  26    accessforbidden();
  27  }
  28  
  29  if (!$user->rights->telephonie->lire) accessforbidden();
  30  
  31  llxHeader('','Telephonie - Statistiques - Distributeur');
  32  
  33  if ($user->distributeur_id)
  34  {
  35    $_GET["id"] = $user->distributeur_id;
  36  }
  37  
  38  /*
  39   *
  40   *
  41   *
  42   */
  43  
  44  if ($_GET["id"])
  45  {
  46    $distri = new DistributeurTelephonie($db);
  47    $distri->fetch($_GET["id"]);
  48  
  49    $h = 0;
  50    $head[$h][0] = DOL_URL_ROOT.'/telephonie/distributeurs/distributeur.php?id='.$distri->id;
  51    $head[$h][1] = $distri->nom;
  52    $h++;
  53  
  54    $head[$h][0] = DOL_URL_ROOT.'/telephonie/distributeurs/contrat.php?id='.$distri->id;
  55    $head[$h][1] = "Contrat";
  56    $h++;
  57  
  58    $head[$h][0] = DOL_URL_ROOT.'/telephonie/distributeurs/remuneration.php?id='.$distri->id;
  59    $head[$h][1] = "Rémunérations";
  60    $h++;
  61  
  62    $head[$h][0] = DOL_URL_ROOT.'/telephonie/distributeurs/po.php?id='.$distri->id;
  63    $head[$h][1] = "Prises d'ordre";
  64    $h++;
  65  
  66    $head[$h][0] = DOL_URL_ROOT.'/telephonie/distributeurs/stats.php?id='.$distri->id;
  67    $head[$h][1] = "Statistiques";
  68    $hselected = $h;
  69    $h++;
  70  
  71    dolibarr_fiche_head($head, $hselected, "Distributeur");
  72  
  73    print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
  74  
  75    print '<tr><td width="30%" valign="top">';
  76    
  77    print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
  78    print '<tr class="liste_titre">';
  79    print '<td>Mois</td><td align="right">Prise d\'ordre</td></tr>';
  80    
  81    $sql = "SELECT sum(p.montant), date_format(datepo, '%m-%Y')";
  82    $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_contrat_priseordre as p";
  83    
  84    $sql .= " WHERE p.fk_distributeur = ".$_GET["id"];
  85    $sql .= " GROUP BY date_format(p.datepo, '%Y%m') DESC";
  86    
  87    $resql = $db->query($sql);
  88    
  89    if ($resql)
  90      {
  91        $num = $db->num_rows();
  92        $i = 0;
  93        $total = 0;
  94        
  95        while ($i < $num)
  96      {
  97        $row = $db->fetch_row($i);    
  98        
  99        $var=!$var;
 100        
 101        print "<tr $bc[$var]>";
 102        
 103        print '<td>'.$row[1].'</td>';
 104        
 105        print '<td align="right">'.price($row[0]).'</td></tr>';
 106        $i++;
 107      }
 108        $db->free();
 109      }
 110    else 
 111      {
 112        print $db->error() . ' ' . $sql;
 113      }
 114    print '</table><br />';
 115  
 116   
 117    print '</td><td valign="top" width="70%">';
 118  
 119    print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=distributeurs/'.$_GET["id"].'/po.month.png" alt="Prise d\'ordre" title="Prise d\'ordre"><br /><br />'."\n";
 120  
 121    print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=distributeurs/'.$_GET["id"].'/clients.hebdomadaire.png" alt="Nouveaux clients" title="Nouveaux clients"><br /><br />'."\n";
 122    
 123    
 124    print '</td></tr>';
 125    print '</table>';
 126   
 127   $db->close();
 128  }
 129  
 130  llxFooter("<em>Derni&egrave;re modification $Date: 2005/09/14 14:35:08 $ r&eacute;vision $Revision: 1.6 $</em>");
 131  ?>


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