From 0e67b2d0f2c9c01db01af212f092d38748c6b854 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Sun, 3 Aug 2003 11:07:48 +0000 Subject: [PATCH] modif pour la gestion des services --- htdocs/product/index.php3 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/htdocs/product/index.php3 b/htdocs/product/index.php3 index b706ae0bf1c..0d0f0ca2ff7 100644 --- a/htdocs/product/index.php3 +++ b/htdocs/product/index.php3 @@ -21,6 +21,11 @@ */ require("./pre.inc.php3"); +if (strlen($type) == 0) +{ +$type = 0; +} + $db = new Db(); if ($action == 'update') @@ -46,14 +51,14 @@ if ($sortorder == "") } $sql = "SELECT p.rowid, p.label, p.price, p.ref FROM llx_product as p"; - +$sql .= " WHERE p.fk_product_type = $type"; if ($sref) { - $sql .= " WHERE lower(p.ref) like '%".strtolower($sref)."%'"; + $sql .= " AND lower(p.ref) like '%".strtolower($sref)."%'"; } if ($snom) { - $sql .= " WHERE lower(p.label) like '%".strtolower($snom)."%'"; + $sql .= " AND lower(p.label) like '%".strtolower($snom)."%'"; } $sql .= " ORDER BY $sortfield $sortorder "; $sql .= $db->plimit($limit + 1 ,$offset); @@ -109,7 +114,7 @@ if ( $db->query($sql) ) } else { - print $db->error(); + print $db->error() . "
" .$sql; }