[ 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/client/ -> index.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: index.php,v 1.8 2005/07/09 14:34:44 eldy Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/boutique/client/index.php,v $
  21   *
  22   */
  23  
  24  require ("./pre.inc.php");
  25  
  26  $langs->load("companies");
  27  
  28  llxHeader();
  29  
  30  if ($sortfield == "") {
  31    $sortfield="lower(c.customers_lastname)";
  32  }
  33  if ($sortorder == "") {
  34    $sortorder="ASC";
  35  }
  36  
  37  
  38  if ($page == -1) { $page = 0 ; }
  39  $limit = $conf->liste_limit;
  40  $offset = $limit * $page ;
  41  
  42  print_barre_liste("Liste des clients", $page, "index.php");
  43  
  44  $sql = "SELECT c.customers_id, c.customers_lastname, c.customers_firstname, c.customers_email_address, c.customers_newsletter";
  45  $sql .= " FROM ".OSC_DB_NAME.".customers as c";
  46  $sql .= " ORDER BY $sortfield $sortorder ";
  47  $sql .= $db->plimit( $limit ,$offset);
  48   
  49  if ( $db->query($sql) )
  50  {
  51    $num = $db->num_rows();
  52    $i = 0;
  53    print "<table class=\"noborder\" width=\"100%\">";
  54    print "<tr class=\"liste_titre\">";
  55    print_liste_field_titre($langs->trans("Firstname"),"index.php", "c.customers_firstname");
  56    print_liste_field_titre($langs->trans("Lastname"),"index.php", "c.customers_lastname");
  57    print '<td>'.$langs->trans("EMail").'</td><td align="center">'.$langs->trans("Newsletter").'</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        print '<td><a href="fiche.php?id='.$objp->customers_id.'">'.$objp->customers_firstname."</a></td>\n";
  66        print '<td><a href="fiche.php?id='.$objp->customers_id.'">'.$objp->customers_lastname."</a></td>\n";
  67        print "<td>$objp->customers_email_address</td>\n";
  68        print "<td align=\"center\">$objp->customers_newsletter</td>\n";
  69        print "</tr>\n";
  70        $i++;
  71      }
  72    print "</table>";
  73    $db->free();
  74  }
  75  else
  76  {
  77    dolibarr_print_error($db);
  78  }
  79  
  80  $db->close();
  81  
  82  llxFooter("<em>Derni&egrave;re modification $Date: 2005/07/09 14:34:44 $ r&eacute;vision $Revision: 1.8 $</em>");
  83  ?>


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