[ 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/ -> type.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: type.php,v 1.3 2005/12/06 09:56:06 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/stats/factures/type.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)
  28    accessforbidden();
  29  
  30  llxHeader('','Telephonie - Ligne');
  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/factures/index.php';
  44  $head[$h][1] = "Global";
  45  $h++;
  46  
  47  $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/factures/marge.php';
  48  $head[$h][1] = "Marge";
  49  $h++;
  50  
  51  $head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/factures/type.php';
  52  $head[$h][1] = "Méthode de paiement";
  53  $hselected = $h;
  54  $h++;
  55  
  56  //$head[$h][0] = DOL_URL_ROOT.'/telephonie/stats/factures/lastmonth.php';
  57  //$head[$h][1] = "3 derniers mois";
  58  //$h++;
  59  
  60  dolibarr_fiche_head($head, $hselected, "Satistiques Factures");
  61  
  62  print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
  63  
  64  print '<tr><td valign="top" width="50%">';
  65  
  66  print '<img src="'.DOL_URL_ROOT.'/showgraph.php?graph='.DOL_DATA_ROOT.'/graph/telephonie/factures/ca_mensuel_preleve.png" alt="ca_mensuel">';
  67  
  68  print '</td><td align="left" valign="top">';
  69  
  70  _legend($db, "Prélèvement","factures.ca_mensuel_preleve");
  71  print '</td><td align="left" valign="top">';
  72  _legend($db, "Autres","factures.ca_mensuel_autre");
  73  
  74  print '</td></tr>';
  75  
  76  
  77  
  78  print '</table>';
  79  
  80  $db->close();
  81  
  82  
  83  function _legend($db, $legend, $graph)
  84  {
  85    global $bc;
  86    print '<table class="noborder" cellspacing="0" cellpadding="4">';
  87    print '<tr class="liste_titre">';
  88    print '<td colspan="2">'.$legend.'</td></tr>';
  89    $sql = "SELECT legend, valeur";
  90    $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_stats";
  91    $sql .= " WHERE graph = '".$graph."'";
  92    $sql .= " ORDER BY ord DESC";
  93    
  94    $resql = $db->query($sql);
  95    
  96    if ($resql)
  97      {
  98        $num = $db->num_rows($resql);
  99        $i = 0;
 100        while ($i < $num)
 101      {
 102        $row = $db->fetch_row($resql);
 103        $var = !$var;
 104        print "<tr $bc[$var]>";
 105        print '<td>mois '.$row[0].'</td><td align="right">'.ceil($row[1]).' euros HT</td></tr>';
 106        
 107        $i++;
 108      }
 109      }
 110    print '</table>';
 111  }
 112  
 113  
 114  
 115  
 116  
 117  
 118  llxFooter("<em>Derni&egrave;re modification $Date: 2005/12/06 09:56:06 $ r&eacute;vision $Revision: 1.3 $</em>");
 119  ?>


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