diff --git a/htdocs/contact/index.php b/htdocs/contact/index.php index ee8929a2acb..eed3589bd5b 100644 --- a/htdocs/contact/index.php +++ b/htdocs/contact/index.php @@ -89,9 +89,14 @@ if (strlen($_GET["userid"])) // statut commercial $sql .= " WHERE p.fk_user=".$_GET["userid"]; } -if (strlen($_GET["begin"])) // filtre sur la premiere lettre du nom +if (strlen($_GET["search_nom"])) // filtre sur la premiere lettre du nom { - $sql .= " WHERE upper(p.name) like '".$_GET["begin"]."%'"; + $sql .= " WHERE upper(p.name) like '%".$_GET["search_nom"]."%'"; +} + +if (strlen($_GET["search_prenom"])) // filtre sur la premiere lettre du nom +{ + $sql .= " WHERE upper(p.firstname) like '%".$_GET["search_prenom"]."%'"; } if ($contactname) @@ -122,33 +127,9 @@ if ($result) print_barre_liste($titre ,$page, "index.php", '&begin='.$_GET["begin"].'&view='.$_GET["view"].'&userid='.$_GET["userid"], $sortfield, $sortorder,'',$num); - print "
| '; print_liste_field_titre($langs->trans("Lastname"),"index.php","lower(p.name)", $begin); print " | "; @@ -170,6 +151,22 @@ if ($result) } print " |