From cbab41321ce8004aaeb650ac211f8c7908dcc611 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Tue, 30 Nov 2004 19:23:38 +0000 Subject: [PATCH] Ajout formulaire de recherche --- htdocs/fourn/commande/liste.php | 48 +++++++++++++++++++++++++++------ 1 file changed, 40 insertions(+), 8 deletions(-) diff --git a/htdocs/fourn/commande/liste.php b/htdocs/fourn/commande/liste.php index 738c4003f2a..49ebeb4de4e 100644 --- a/htdocs/fourn/commande/liste.php +++ b/htdocs/fourn/commande/liste.php @@ -54,8 +54,6 @@ $offset = $conf->liste_limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; - - /* * Mode Liste * @@ -63,14 +61,30 @@ $pagenext = $page + 1; * */ -$sql = "SELECT s.idp, s.nom, s.ville, ".$db->pdate("s.datea")." as datea"; +$sql = "SELECT s.idp, s.nom, ".$db->pdate("cf.date_commande")." as dc"; $sql .= " ,cf.rowid,cf.ref, cf.fk_statut"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s "; $sql .= " , ".MAIN_DB_PREFIX."commande_fournisseur as cf"; $sql .= " WHERE cf.fk_soc = s.idp "; -if ($socidp) { - $sql .= " AND s.idp=$socidp"; +if ($socid) +{ + $sql .= " AND s.idp=".$_GET["socid"]; +} + +if (strlen($_GET["statut"])) +{ + $sql .= " AND fk_statut =".$_GET["statut"]; +} + +if (strlen($_GET["search_ref"])) +{ + $sql .= " AND cf.ref LIKE '%".$_GET["search_ref"]."%'"; +} + +if (strlen($_GET["search_nom"])) +{ + $sql .= " AND s.nom LIKE '%".$_GET["search_nom"]."%'"; } $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); @@ -93,9 +107,17 @@ if ($result) print ''; print ''; print_liste_field_titre("Société","index.php","s.nom"); - - print ""; + print ''; print "\n"; + + print ''; + print ''; + print ''; + print ''; + print ''; + $var=True; while ($i < min($num,$conf->liste_limit)) @@ -108,7 +130,17 @@ if ($result) print ' '.$obj->ref.''."\n"; print ''."\n"; - print "\n"; + + print "'; print "\n"; $i++; }
RéfVilleDate
 '; + print ''; + print '
'.img_file().''; print ' '.$obj->nom.'".$obj->ville.""; + if ($obj->dc) + { + print dolibarr_print_date($obj->dc); + } + else + { + print "-"; + } + print '