Gestion du module de recherche
This commit is contained in:
parent
a29e4721ff
commit
50bc28e75b
@ -42,33 +42,30 @@ if ($action == 'update')
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if ($page < 0) {
|
||||||
|
$page = 0 ; }
|
||||||
|
|
||||||
if ($page == -1) {
|
$limit = $conf->liste_limit;
|
||||||
$page = 0 ;
|
$offset = $limit * $page ;
|
||||||
}
|
|
||||||
|
|
||||||
$limit = $conf->liste_limit;
|
if ($sortfield == "") {
|
||||||
$offset = $limit * $page ;
|
$sortfield="p.tms"; }
|
||||||
|
|
||||||
if ($sortfield == "")
|
if ($sortorder == "")
|
||||||
{
|
{
|
||||||
$sortfield="p.tms";
|
$sortorder="DESC";
|
||||||
}
|
}
|
||||||
if ($sortorder == "")
|
|
||||||
{
|
|
||||||
$sortorder="DESC";
|
|
||||||
}
|
|
||||||
|
|
||||||
$sql = "SELECT p.rowid, p.label, p.price, p.ref FROM llx_product as p";
|
$sql = "SELECT p.rowid, p.label, p.price, p.ref FROM llx_product as p";
|
||||||
$sql .= " WHERE p.fk_product_type = $type";
|
$sql .= " WHERE p.fk_product_type = $type";
|
||||||
if ($sref)
|
if ($sref)
|
||||||
{
|
{
|
||||||
$sql .= " AND lower(p.ref) like '%".strtolower($sref)."%'";
|
$sql .= " AND lower(p.ref) like '%".strtolower($sref)."%'";
|
||||||
}
|
}
|
||||||
if ($snom)
|
if ($snom)
|
||||||
{
|
{
|
||||||
$sql .= " AND lower(p.label) like '%".strtolower($snom)."%'";
|
$sql .= " AND lower(p.label) like '%".strtolower($snom)."%'";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql .= " ORDER BY $sortfield $sortorder ";
|
$sql .= " ORDER BY $sortfield $sortorder ";
|
||||||
$sql .= $db->plimit($limit + 1 ,$offset);
|
$sql .= $db->plimit($limit + 1 ,$offset);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user