$mem_limit= $mem_x*$mem_y; $mem_offset=($mempage*$mem_limit)-$mem_limit; switch ($memtyperecherche){ case "express": $sql="SELECT produits.* FROM produits where produits.actif and mid(code,1,1)='".trim($memrecherche)."' order by triegloblale ASC,code ASC"; break; case "recherche": // memtitre="Recherche ("+memrecherche+")" $sql="SELECT produits.* FROM produits where produits.actif and (instr(code+titre,'".trim($memrecherche)."')<>0 or instr(mot1+mot2+mot3+mot4+mot5,'"+trim($memrecherche)+"')<>0 or instr(description,'"+trim($memrecherche)+"')<>0 )order by triegloblale ASC,code ASC"; break; case "categorie": $sql="SELECT distinct produits.id,code,titre_ang,titre,prix,prixspecial,pi_image FROM produits left join produits_images on produits_images.pro_id=produits.id and produits_images.pi_langue='bo' where produits.actif and instr(recherche,'".$memrecherche."')<>0 order by triegloblale ASC,code ASC limit ".$mem_limit." offset ".$mem_offset ; $sqlmax="SELECT produits.* FROM produits where produits.actif and instr(recherche,'".$memrecherche."')<>0 "; break; } fxConnect(); $qryproduits = mysql_query($sqlmax); $nbproduitsmax = mysql_num_rows($qryproduits); $nbproduitsmaxpage= ceil($nbproduitsmax/$mem_limit); $qryproduits = mysql_query($sql); $nbproduits = mysql_num_rows($qryproduits); // suite $mem_suite=""; if ($memtypepage!="catphoto") { if ($mempage>1) { $mem_suite=$mem_suite.'[<< Précédente]'; } for($xxx=1;$nbproduitsmaxpage>=$xxx;$xxx++) { if ($mempage==$xxx) $mem_suite=$mem_suite. $xxx; else { $mem_suite=$mem_suite.''. $xxx.''; } } if ($nbproduitsmaxpage>$mempage) { $mem_suite=$mem_suite.'[Suivante >>]'; } } else { $mem_suite=$mem_suite.'[Suivante >>]'; width="47%" height="323">
|
|