[ 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/livre/ -> 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.11 2004/10/31 13:00:22 eldy Exp $
  20   * $Source: /cvsroot/dolibarr/dolibarr/htdocs/boutique/livre/index.php,v $
  21   *
  22   */
  23  
  24  require ("./pre.inc.php");
  25  
  26  llxHeader();
  27  
  28  if ($sortfield == "")
  29  {
  30    $sortfield="lower(l.title)";
  31  }
  32  if ($sortorder == "")
  33  {
  34    $sortorder="ASC";
  35  }
  36  
  37  if ($page == -1) { $page = 0 ; }
  38  $limit = $conf->liste_limit;
  39  $offset = $limit * $page ;
  40  
  41  $form = '<form action="index.php">'.
  42  '<input type="hidden" name="mode" value="search">'.
  43  '<input type="hidden" name="mode-search" value="soc">'.
  44  'Titre : <input type="text" name="searchvalue" class="flat" size="15">&nbsp;'.
  45  '<input type="submit" class="flat" value="go"></form>';
  46  
  47  
  48  print_barre_liste("Liste des Livres", $page, "index.php", "", $sortfield, $sortorder, $form);
  49  
  50  $sql = "SELECT l.rowid, l.title, l.oscid, l.ref, l.status FROM ".MAIN_DB_PREFIX."livre as l";
  51  
  52  if ($searchvalue)
  53  {
  54    $sql .= " WHERE l.title like '%$searchvalue%'";
  55  }
  56    
  57  $sql .= " ORDER BY $sortfield $sortorder ";
  58  $sql .= $db->plimit( $limit ,$offset);
  59   
  60  if ( $db->query($sql) )
  61  {
  62    $num = $db->num_rows();
  63    $i = 0;
  64    print "<table class=\"noborder\" width=\"100%\">";
  65    print "<tr class=\"liste_titre\">";
  66    print_liste_field_titre($langs->trans("Ref"),"index.php", "l.ref");
  67    print_liste_field_titre($langs->trans("Title"),"index.php", "l.title");
  68    print '<td colspan="3">&nbsp;</td>';
  69    print "</tr>\n";
  70    $var=True;
  71    while ($i < $num) {
  72      $objp = $db->fetch_object();
  73      $var=!$var;
  74      print "<tr $bc[$var]>";
  75  
  76      print '<td><a href="fiche.php?id='.$objp->rowid.'"><img src="/theme/'.$conf->theme.'/img/filenew.png" border="0" alt="Fiche livre"></a>&nbsp;';
  77  
  78      print "<a href=\"fiche.php?id=$objp->rowid\">$objp->ref</a></TD>\n";
  79      print "<TD width='70%'><a href=\"fiche.php?id=$objp->rowid\">$objp->title</a></TD>\n";
  80  
  81  
  82      if ($objp->status == 1)
  83        {
  84      print '<td align="center"><img src="/theme/'.$conf->theme.'/img/icon_status_green.png" border="0"></a></td>';
  85      print '<td align="center"><img src="/theme/'.$conf->theme.'/img/icon_status_red_light.png" border="0"></a></td>';
  86      print '<td align="right"><a href="'.OSC_CATALOG_URL.'product_info.php?products_id='.$objp->oscid.'">Fiche en ligne</a></TD>';
  87        }
  88      else
  89        {
  90      print '<td align="center"><img src="/theme/'.$conf->theme.'/img/icon_status_green_light.png" border="0"></a></td>';
  91      print '<td align="center"><img src="/theme/'.$conf->theme.'/img/icon_status_red.png" border="0"></a></td>';
  92      print '<td>&nbsp;</td>';
  93        }
  94  
  95      print "</tr>\n";
  96      $i++;
  97    }
  98    print "</table>";
  99    $db->free();
 100  }
 101  else
 102  {
 103    dolibarr_print_error($db);
 104  }
 105  
 106  $db->close();
 107  
 108  llxFooter("<em>Derni&egrave;re modification $Date: 2004/10/31 13:00:22 $ r&eacute;vision $Revision: 1.11 $</em>");
 109  ?>


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