526 |
* \param htmlname Nom de la zone select |
* \param htmlname Nom de la zone select |
527 |
* \param filtretype Pour filtre sur type de produit |
* \param filtretype Pour filtre sur type de produit |
528 |
* \param limit Limite sur le nombre de lignes retournées |
* \param limit Limite sur le nombre de lignes retournées |
|
* \param filtre Pour filtre |
|
529 |
*/ |
*/ |
530 |
function select_produits($selected='',$htmlname='productid',$filtretype='',$limit=20,$filtre) |
function select_produits($selected='',$htmlname='productid',$filtretype='',$limit=20) |
531 |
{ |
{ |
532 |
global $langs,$conf; |
global $langs,$conf; |
533 |
|
|
535 |
$sql.= " FROM ".MAIN_DB_PREFIX."product as p "; |
$sql.= " FROM ".MAIN_DB_PREFIX."product as p "; |
536 |
$sql.= " WHERE p.envente = 1"; |
$sql.= " WHERE p.envente = 1"; |
537 |
if ($filtretype && $filtretype != '') $sql.=" AND p.fk_product_type=".$filtretype; |
if ($filtretype && $filtretype != '') $sql.=" AND p.fk_product_type=".$filtretype; |
|
if ($filtre) $sql.="$filtre"; |
|
538 |
$sql.= " ORDER BY p.nbvente DESC"; |
$sql.= " ORDER BY p.nbvente DESC"; |
539 |
if ($limit) $sql.= " LIMIT $limit"; |
if ($limit) $sql.= " LIMIT $limit"; |
540 |
|
|