Ajout formulaire de recherche rapide
This commit is contained in:
parent
b709eec945
commit
144a9fa208
@ -31,7 +31,6 @@ if ($user->societe_id > 0)
|
|||||||
$socidp = $user->societe_id;
|
$socidp = $user->societe_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$page=$_GET["page"];
|
$page=$_GET["page"];
|
||||||
$begin=$_GET["begin"];
|
$begin=$_GET["begin"];
|
||||||
$sortorder=$_GET["sortorder"];
|
$sortorder=$_GET["sortorder"];
|
||||||
@ -44,17 +43,18 @@ $pageprev = $_GET["page"] - 1;
|
|||||||
$pagenext = $_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)
|
if ($socidp)
|
||||||
{
|
{
|
||||||
$sql .= " AND s.idp = $socidp";
|
$sql .= " AND s.idp = $socidp";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ($_GET["search_nom"])
|
||||||
if (strlen($stcomm))
|
|
||||||
{
|
{
|
||||||
$sql .= " AND s.fk_stcomm=$stcomm";
|
$sql .= " AND s.nom like '%".strtolower($_GET["search_nom"])."%'";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen($begin))
|
if (strlen($begin))
|
||||||
@ -127,12 +127,24 @@ if ($result)
|
|||||||
|
|
||||||
print '<table class="liste">';
|
print '<table class="liste">';
|
||||||
print '<tr class="liste_titre">';
|
print '<tr class="liste_titre">';
|
||||||
print "<th valign=\"center\">";
|
print "<td valign=\"right\">";
|
||||||
print_liste_field_titre("Société","clients.php","s.nom","&page=$page&begin=$begin");
|
|
||||||
print "</th><th>";
|
$addu = "&page=$page&begin=$begin&search_nom=".$_GET["search_nom"];
|
||||||
print_liste_field_titre("Ville","clients.php","s.ville","&page=$page&begin=$begin");
|
|
||||||
print "</th>";
|
print_liste_field_titre("Société","clients.php","s.nom",$addu);
|
||||||
print "</TR>\n";
|
print "</td><td>";
|
||||||
|
print_liste_field_titre("Ville","clients.php","s.ville",$addu);
|
||||||
|
print "</td>";
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
|
print '<form method="get" action="clients.php">';
|
||||||
|
print '<tr class="liste_titre">';
|
||||||
|
print '<td valign="right">';
|
||||||
|
print '<input type="text" name="search_nom" value="'.$_GET["search_nom"].'">';
|
||||||
|
print "</td><td> ";
|
||||||
|
print "</td>";
|
||||||
|
print "</tr>\n";
|
||||||
|
|
||||||
$var=True;
|
$var=True;
|
||||||
|
|
||||||
while ($i < min($num,$conf->liste_limit))
|
while ($i < min($num,$conf->liste_limit))
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user