diff --git a/htdocs/societe.php b/htdocs/societe.php index ecd1f9e2abf..31c77f27a91 100644 --- a/htdocs/societe.php +++ b/htdocs/societe.php @@ -75,7 +75,6 @@ if ($mode == 'search') { * * */ -print_barre_liste("Liste des societes", $page, $PHP_SELF); $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, s.client, s.fournisseur"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."c_stcomm as st WHERE s.fk_stcomm = st.id"; @@ -95,17 +94,19 @@ if (strlen($begin)) { if ($socname) { $sql .= " AND lower(s.nom) like '%".strtolower($socname)."%'"; - $sortfield = "lower(s.nom)"; - $sortorder = "ASC"; } -$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset); +$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit+1, $offset); $result = $db->query($sql); if ($result) { $num = $db->num_rows(); $i = 0; + + $params = "&socname=$socname"; + + print_barre_liste("Liste des societes", $page, $PHP_SELF,$params,$sortfield,$sortorder,'',$num); if ($sortorder == "DESC") { @@ -119,13 +120,14 @@ if ($result) print '
| '; - print_liste_field_titre("Société",$PHP_SELF,"s.nom"); + print_liste_field_titre("Société",$PHP_SELF,"s.nom", $params); print " | "; - print_liste_field_titre("Ville",$PHP_SELF,"s.ville"); - print ' | Fiches | '; + print_liste_field_titre("Ville",$PHP_SELF,"s.ville",$params); + print ' | Fiches | '; print "Notifications | '; - - print "\n"; + print ''."\n"; $i++; }|