[ 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/ca/ -> 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.6 2005/09/02 11:32:34 rodolphe Exp $
  19   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/telephonie/ca/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->ca->lire)
  28    accessforbidden();
  29  
  30  llxHeader('','Telephonie');
  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  /*
  42   * Mode Liste
  43   *
  44   *
  45   *
  46   */
  47  
  48  print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
  49  
  50  print '<tr><td width="50%" valign="top">';
  51  
  52  $sql = "SELECT date, sum(cout_vente), sum(gain), count(ligne)";
  53  $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_facture";
  54  $sql .= " GROUP BY date DESC";
  55  $resql = $db->query($sql);
  56  if ($resql)
  57  {
  58    $num = $db->num_rows($resql);
  59    $i = 0;
  60    $ligne = new LigneTel($db);
  61  
  62    print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
  63    print '<tr class="liste_titre"><td>Mois</td><td align="right">Chiffre d\'affaire</td>';
  64    print '<td align="right">Gain</td><td align="right">Marge</td>';
  65    print "</tr>\n";
  66    $var=True;
  67  
  68    while ($i < min($num,$conf->liste_limit))
  69      {
  70        $row = $db->fetch_row($resql);    
  71        $var=!$var;
  72  
  73        print "<tr $bc[$var]>";
  74        print "<td>".substr($row[0],5,2)." ".substr($row[0],0,4)."</td>\n";
  75        print '<td align="right">'.price($row[1])." HT</td>\n";
  76        print '<td align="right">'.price($row[2])." HT</td>\n";
  77        print '<td align="right">'.number_format(round(($row[2]/$row[1])*100,2),2)." %</td>\n";
  78        print "</tr>\n";
  79        $i++;
  80      }
  81    print "</table>";
  82    $db->free($resql);
  83  }
  84  else 
  85  {
  86    dolibarr_print_error($db);
  87  }
  88  
  89  print '</td><td valign="top" width="50%">'."\n";
  90  
  91  print '<img src="'.DOL_URL_ROOT.'/viewimage.php?modulepart=telephoniegraph&file=ca/ca.mensuel.png" alt="CA Mensuel"><br /><br />';
  92  
  93  print "\n</td></tr>\n";
  94  print '</table>';
  95  
  96  $db->close();
  97  
  98  llxFooter("<em>Derni&egrave;re modification $Date: 2005/09/02 11:32:34 $ r&eacute;vision $Revision: 1.6 $</em>");
  99  ?>


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