[ 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/product/ -> osc-liste.php (source)

   1  <?php
   2  /* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   * Copyright (C) 2005 Éric Seigne <eric.seigne@ryxeo.com>
   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: osc-liste.php,v 1.7 2005/07/09 14:34:44 eldy Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/product/osc-liste.php,v $
  21   *
  22   */
  23  
  24  require ("./pre.inc.php");
  25  
  26  llxHeader();
  27  
  28  if ($_GET['sortfield'] == "") {
  29    $sortfield="lower(p.label),p.price";
  30  }
  31  if ($_GET['sortorder'] == "") {
  32    $sortorder="ASC";
  33  }
  34  
  35  
  36  if ($_GET['page'] == -1) {
  37    $page = 0 ;
  38  }
  39  else {
  40    $page = $_GET['page'];
  41  }
  42  $limit = $conf->liste_limit;
  43  $offset = $limit * $page ;
  44  
  45  
  46  print_barre_liste("Liste des produits oscommerce", $page, "osc-liste.php");
  47  
  48  $sql = "SELECT p.products_id, p.products_model, p.products_quantity, p.products_status, d.products_name, m.manufacturers_name, m.manufacturers_id";
  49  $sql .= " FROM ".OSC_DB_NAME.".products as p, ".OSC_DB_NAME.".products_description as d, ".OSC_DB_NAME.".manufacturers as m";
  50  $sql .= " WHERE p.products_id = d.products_id AND d.language_id =" . OSC_LANGUAGE_ID;
  51  $sql .= " AND p.manufacturers_id=m.manufacturers_id";
  52  if ($_GET['reqstock']=='epuise')
  53  {
  54    $sql .= " AND p.products_quantity <= 0";
  55  }  
  56  
  57  //$sql .= " ORDER BY $sortfield $sortorder ";
  58  $sql .= $db->plimit( $limit ,$offset);
  59  
  60  print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
  61  print '<TR class="liste_titre">';
  62  print "<td>id</td>";
  63  print "<td>Ref</td>";
  64  print "<td>Titre</td>";
  65  print "<td>Groupe</td>";
  66  print '<td align="center">Stock</td>';
  67  print '<TD align="center">Status</TD>';
  68    print "</TR>\n";
  69   
  70  if ( $db->query($sql) ) {
  71    $num = $db->num_rows();
  72    $i = 0;
  73  
  74    $var=True;
  75    while ($i < $num) {
  76      $objp = $db->fetch_object( $i);
  77      $var=!$var;
  78      print "<TR $bc[$var]>";
  79      print "<TD>$objp->products_id</TD>\n";
  80      print "<TD>$objp->products_model</TD>\n";
  81      print "<TD>$objp->products_name</TD>\n";
  82      print "<TD>$objp->manufacturers_name</TD>\n";
  83      print '<TD align="center">'.$objp->products_quantity."</TD>\n";
  84      print '<TD align="center">'.$objp->products_status."</TD>\n";
  85      print "</TR>\n";
  86      $i++;
  87    }
  88    $db->free();
  89  }
  90  
  91  print "</TABLE>";
  92  
  93  
  94  $db->close();
  95  
  96  llxFooter("<em>Derni&egrave;re modification $Date: 2005/07/09 14:34:44 $ r&eacute;vision $Revision: 1.7 $</em>");
  97  ?>


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