[ 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/factures/ -> index.php (source)

   1  <?PHP
   2  /* Copyright (C) 2004 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.6 2005/12/06 09:56:20 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/stats/factures/index.php,v $
  20   *
  21   */
  22  require ("./pre.inc.php");
  23  
  24  if (!$user->rights->telephonie->lire) accessforbidden();
  25  if (!$user->rights->telephonie->stats->lire) accessforbidden();
  26  
  27  llxHeader('','Telephonie - Ligne');
  28  
  29  /*
  30   * Sécurité accés client
  31   */
  32  if ($user->societe_id > 0) 
  33  {
  34    $action = '';
  35    $socidp = $user->societe_id;
  36  }
  37  
  38  $h = 0;
  39  
  40  $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/factures/index.php';
  41  $head[$h][1] = "Global";
  42  $hselected = $h;
  43  $h++;
  44  
  45  $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/factures/marge.php';
  46  $head[$h][1] = "Marge";
  47  $h++;
  48  
  49  $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/factures/type.php';
  50  $head[$h][1] = "Méthode de paiement";
  51  $h++;
  52  
  53  //$head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/factures/lastmonth.php';
  54  //$head[$h][1] = "3 derniers mois";
  55  //$h++;
  56  
  57  dolibarr_fiche_head($head, $hselected, "Satistiques Factures");
  58  
  59  print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
  60  
  61  print '<tr><td valign="top" width="50%">';
  62  
  63  print '<img src="'.DOL_URL_ROOT.'/showgraph.php?graph='.DOL_DATA_ROOT.'/graph/telephonie/factures/ca_mensuel.png" alt="ca_mensuel">';
  64  
  65  print '</td><td align="left" valign="top">';
  66  _legend($db, "factures.ca_mensuel", "%11.2f");
  67  
  68  print '</td></tr>';
  69  
  70  print '<tr><td valign="top" width="50%">';
  71  
  72  print '<img src="'.DOL_URL_ROOT.'/showgraph.php?graph='.DOL_DATA_ROOT.'/graph/telephonie/factures/facture_moyenne.png" alt="facture_moyenne">';
  73  
  74  print '</td><td align="left" valign="top">';
  75  _legend($db, "factures.facture_moyenne","%01.1f");
  76  
  77  print '</td></tr>';
  78  print '<tr><td valign="top" width="50%">';
  79  
  80  print '<img src="'.DOL_URL_ROOT.'/showgraph.php?graph='.DOL_DATA_ROOT.'/graph/telephonie/factures/nb_facture.png" alt="nb_facture">';
  81  
  82  print '</td><td align="left" valign="top">';
  83  _legend($db, "factures.nb_mensuel","%01.0f");
  84  
  85  print '</td></tr>';
  86  
  87  print '</table>';
  88  
  89  $db->close();
  90  
  91  
  92  function _legend($db, $graph, $format)
  93  {
  94    print '<table class="noborder" cellspacing="0" cellpadding="4">';
  95    print '<tr class="liste_titre">';
  96    print '<td colspan="2">Légende</td></tr>';
  97    $sql = "SELECT legend, valeur";
  98    $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_stats";
  99    $sql .= " WHERE graph = '".$graph."'";
 100    $sql .= " ORDER BY ord DESC";
 101    
 102    $resql = $db->query($sql);
 103    
 104    if ($resql)
 105      {
 106        while ($row = $db->fetch_row($resql))
 107      {
 108        $var = !$var;
 109        print "<tr $bc[$var]>";
 110        print '<td>'.$row[0].'</td><td align="right">';
 111        print sprintf($format ,$row[1]);
 112        print '</td></tr>';
 113      }
 114      }
 115    print '</table>';
 116  }
 117  
 118  
 119  llxFooter("<em>Derni&egrave;re modification $Date: 2005/12/06 09:56:20 $ r&eacute;vision $Revision: 1.6 $</em>");
 120  ?>


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