[ 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/boutique/commande/ -> ca.php (source)

   1  <?php
   2  /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   * Copyright (C) 2004 Laurent Destailleur  <eldy@users.sourceforge.net>
   4   *
   5   * This program is free software; you can redistribute it and/or modify
   6   * it under the terms of the GNU General Public License as published by
   7   * the Free Software Foundation; either version 2 of the License, or
   8   * (at your option) any later version.
   9   *
  10   * This program is distributed in the hope that it will be useful,
  11   * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13   * GNU General Public License for more details.
  14   *
  15   * You should have received a copy of the GNU General Public License
  16   * along with this program; if not, write to the Free Software
  17   * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  18   *
  19   * $Id: ca.php,v 1.8 2005/07/09 14:34:44 eldy Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/boutique/commande/ca.php,v $
  21   *
  22   */
  23  
  24  require ("./pre.inc.php");
  25  
  26  llxHeader();
  27  
  28  if ($sortfield == "")
  29  {
  30    $sortfield="date_purchased";
  31  }
  32  if ($sortorder == "")
  33  {
  34    $sortorder="DESC";
  35  }
  36  
  37  if ($page == -1) { $page = 0 ; }
  38  $limit = $conf->liste_limit;
  39  $offset = $limit * $page ;
  40  
  41  print_barre_liste("Liste des commandes", $page, "ca.php");
  42  
  43  print '<table class="noborder" cellspacing="0" cellpadding="3">';
  44  print '<tr class="liste_titre"><td>'.$langs->trans("Description").'</td>';
  45  print '<td align="right">'.$langs->trans("Lastname").'</td></tr>';
  46  
  47  $sql = "SELECT sum(t.value) as value";
  48  $sql .= " FROM ".OSC_DB_NAME.".orders_total as t";
  49  $sql .= " WHERE t.class = 'ot_subtotal'";
  50   
  51  if ( $db->query($sql) )
  52  {
  53    $num = $db->num_rows();
  54  
  55    $var=True;
  56    if ($num > 0)
  57      {
  58        $objp = $db->fetch_object();
  59        $var=!$var;
  60        print "<tr $bc[$var]>";
  61        print '<td>Somme des commandes</td>';
  62        print '<td align="right">'.price($objp->value).'</td>';
  63  
  64        print "</tr>\n";
  65        $i++;
  66      }
  67  
  68    $db->free();
  69  }
  70  else
  71  {
  72    dolibarr_print_error($db);
  73  }
  74  
  75  $sql = "SELECT sum(t.value) as value";
  76  $sql .= " FROM ".OSC_DB_NAME.".orders_total as t";
  77  $sql .= " WHERE t.class = 'ot_shipping'";
  78   
  79  if ( $db->query($sql) )
  80  {
  81    $num = $db->num_rows();
  82  
  83    $var=True;
  84    if ($num > 0)
  85      {
  86        $objp = $db->fetch_object();
  87        $var=!$var;
  88        print "<tr $bc[$var]>";
  89        print '<td>Somme des frais de port</td>';
  90        print '<td align="right">'.price($objp->value).'</td></tr>';
  91        $i++;
  92      }
  93  
  94    $db->free();
  95  }
  96  else
  97  {
  98    dolibarr_print_error($db);
  99  }
 100  
 101  
 102  print "</table>";
 103  
 104  $db->close();
 105  
 106  llxFooter("<em>Derni&egrave;re modification $Date: 2005/07/09 14:34:44 $ r&eacute;vision $Revision: 1.8 $</em>");
 107  ?>


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