[ 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/notification/ -> produits.php (source)

   1  <?php
   2  /* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
   3   * Copyright (C) 2003 Éric Seigne <erics@rycks.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: produits.php,v 1.8 2005/07/09 14:34:44 eldy Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/boutique/notification/produits.php,v $
  21   *
  22   */
  23  
  24  require ("./pre.inc.php");
  25  
  26  llxHeader();
  27  
  28  if ($sortfield == "") {
  29    $sortfield="lower(p.products_name)";
  30  }
  31  if ($sortorder == "") {
  32    $sortorder="ASC";
  33  }
  34  
  35  
  36  if ($page == -1) { $page = 0 ; }
  37  $limit = $conf->liste_limit;
  38  $offset = $limit * $page ;
  39  
  40  print_barre_liste("Liste des produits suivis", $page, "produits.php");
  41  
  42  $sql = "SELECT p.products_name, p.products_id, count(p.products_id) as nb";
  43  $sql .= " FROM ".OSC_DB_NAME.".products_notifications as n,".OSC_DB_NAME.".products_description as p";
  44  $sql .= " WHERE p.products_id=n.products_id";
  45  $sql .= " AND p.language_id = ".OSC_LANGUAGE_ID;
  46  $sql .= " GROUP BY p.products_name, p.products_id";
  47  $sql .= $db->plimit( $limit ,$offset);
  48   
  49  if ( $db->query($sql) )
  50  {
  51    $num = $db->num_rows();
  52    $i = 0;
  53    print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
  54    print "<TR class=\"liste_titre\">";
  55    print '<td>Produit</td><td align="center">Nb.</td>';
  56    print "<td></td>";
  57    print "<td></td>";
  58    print "</TR>\n";
  59    $var=True;
  60    while ($i < $num)
  61      {
  62        $objp = $db->fetch_object();
  63        $var=!$var;
  64        print "<TR $bc[$var]>";
  65  
  66        print '<td><a href="'.DOL_URL_ROOT.'/boutique/livre/fiche.php?oscid='.$objp->products_id.'">'.$objp->products_name."</a></td>";
  67        print '<td align="center">'.$objp->nb.'</td>';
  68  
  69        print '<td align="center"><a href="index.php?products_id='.$objp->products_id.'">Voir les clients</td>';
  70        print '<td align="center"><a href="newsletter?products_id='.$objp->products_id.'">Envoyer une news</a></td>';
  71  
  72        print "</TR>\n";
  73        $i++;
  74      }
  75    print "</TABLE>";
  76    $db->free();
  77  }
  78  else
  79  {
  80    print $db->error();
  81  }
  82  
  83  $db->close();
  84  
  85  llxFooter("<em>Derni&egrave;re modification $Date: 2005/07/09 14:34:44 $ r&eacute;vision $Revision: 1.8 $</em>");
  86  ?>


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