From 144a9fa2087a8f7ea6b9854592e6d54bd0c201fd Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Mon, 11 Oct 2004 19:30:53 +0000 Subject: [PATCH] Ajout formulaire de recherche rapide --- htdocs/comm/clients.php | 34 +++++++++++++++++++++++----------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/htdocs/comm/clients.php b/htdocs/comm/clients.php index 6c7a47a2b5c..cedcb31b14d 100644 --- a/htdocs/comm/clients.php +++ b/htdocs/comm/clients.php @@ -31,7 +31,6 @@ if ($user->societe_id > 0) $socidp = $user->societe_id; } - $page=$_GET["page"]; $begin=$_GET["begin"]; $sortorder=$_GET["sortorder"]; @@ -44,17 +43,18 @@ $pageprev = $_GET["page"] - 1; $pagenext = $_GET["page"] + 1; -$sql = "SELECT s.idp, s.nom, s.ville, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, st.libelle as stcomm, s.prefix_comm FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st WHERE s.fk_stcomm = st.id AND s.client=1"; +$sql = "SELECT s.idp, s.nom, s.ville, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, st.libelle as stcomm, s.prefix_comm "; +$sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st "; +$sql .= " WHERE s.fk_stcomm = st.id AND s.client=1"; if ($socidp) { $sql .= " AND s.idp = $socidp"; } - -if (strlen($stcomm)) +if ($_GET["search_nom"]) { - $sql .= " AND s.fk_stcomm=$stcomm"; + $sql .= " AND s.nom like '%".strtolower($_GET["search_nom"])."%'"; } if (strlen($begin)) @@ -127,12 +127,24 @@ if ($result) print ''; print ''; - print ""; - print "\n"; + print ""; + print "\n"; + + print ''; + print ''; + print '"; + print "\n"; + $var=True; while ($i < min($num,$conf->liste_limit))
"; - print_liste_field_titre("Société","clients.php","s.nom","&page=$page&begin=$begin"); - print ""; - print_liste_field_titre("Ville","clients.php","s.ville","&page=$page&begin=$begin"); - print "
"; + + $addu = "&page=$page&begin=$begin&search_nom=".$_GET["search_nom"]; + + print_liste_field_titre("Société","clients.php","s.nom",$addu); + print ""; + print_liste_field_titre("Ville","clients.php","s.ville",$addu); + print "
'; + print ''; + print " "; + print "