[ 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/commerciaux/ -> commercial.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: commercial.php,v 1.8 2005/03/10 15:08:31 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/stats/commerciaux/commercial.php,v $
  20   *
  21   */
  22  require ("./pre.inc.php");
  23  
  24  if (!$user->rights->telephonie->lire) accessforbidden();
  25  
  26  llxHeader('','Telephonie - Statistiques - Commerciaux');
  27  
  28  /*
  29   *
  30   *
  31   *
  32   */
  33  
  34  
  35  $h = 0;
  36  
  37  $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/commerciaux/index.php';
  38  $head[$h][1] = "Global";
  39  $h++;
  40  
  41  if ($_GET["commid"])
  42  {
  43    $comm = new User($db, $_GET["commid"]);
  44    $comm->fetch();
  45  
  46    $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/commerciaux/commercial.php?commid='.$comm->id;
  47    $head[$h][1] = $comm->fullname;
  48    $hselected = $h;
  49    $h++;
  50  
  51    $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/commerciaux/commercialca.php?commid='.$comm->id;
  52    $head[$h][1] = "CA";
  53    $h++;
  54  
  55    $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/commerciaux/lignes.php?commid='.$comm->id;
  56    $head[$h][1] = "Lignes";
  57    $h++;
  58  
  59    dolibarr_fiche_head($head, $hselected, "Commerciaux");
  60  
  61    print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
  62  
  63    print '<tr><td width="30%" valign="top">';
  64    
  65    print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
  66    
  67    print '<tr class="liste_titre"><td width="50%" valign="top">Nom</td><td align="center">Nb Lignes</td></tr>';
  68    
  69    $sql = "SELECT count(*) as cc,date_format(date_commande,'%m %Y')";
  70    $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne as l";
  71    $sql .= " WHERE l.fk_commercial = ".$comm->id;
  72    $sql .= " AND date_commande IS NOT NULL";
  73    $sql .= " AND l.statut <> 7";
  74    $sql .= " GROUP BY date_format(date_commande,'%Y/%m') DESC";
  75   
  76   $result = $db->query($sql);
  77   if ($result)
  78     {
  79       $num = $db->num_rows();
  80       $i = 0;
  81       $datas = array();
  82       $legends = array();
  83       
  84       while ($i < $num)
  85         {
  86       $row = $db->fetch_row($i);         
  87       $var=!$var;
  88       
  89       print "<tr $bc[$var]>";     
  90       print '<td width="50%" valign="top">';
  91       print $row[2]." ". $row[1].'</td><td align="center">'.$row[0].'</td></tr>';     
  92       $i++;
  93         }
  94       $db->free();
  95     }
  96   else 
  97     {
  98       print $db->error() . ' ' . $sql;
  99     }
 100   
 101   print '</table>';
 102   
 103   print '</td><td valign="top" width="70%">';
 104  
 105   print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=commercials/'.$comm->id.'/clients.hebdomadaire.png" alt="Commandes de lignes par semaine" title="Lignes Actives"><br /><br />'."\n";
 106  
 107   print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=commercials/'.$comm->id.'/clientsmoyenne.hebdomadaire.png" alt="Commandes de lignes par semaine" title="Lignes Actives"><br /><br />'."\n";
 108  
 109   print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=commercials/'.$comm->id.'/lignes.commandes.hebdomadaire.png" alt="Commandes de lignes par semaine" title="Lignes Actives"><br /><br />'."\n"; 
 110  
 111   print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=commercials/'.$comm->id.'/lignes.commandes.mensuels.png" alt="Commandes de ligne par mois" title="Lignes Actives"><br /><br />'."\n";
 112  
 113  
 114  
 115   print '</td></tr>';
 116   
 117   print '</table>';
 118   
 119   $db->close();
 120   
 121  }
 122  
 123  llxFooter("<em>Derni&egrave;re modification $Date: 2005/03/10 15:08:31 $ r&eacute;vision $Revision: 1.8 $</em>");
 124  ?>


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