46 |
|
|
47 |
$search_nom=isset($_GET["search_nom"])?$_GET["search_nom"]:$_POST["search_nom"]; |
$search_nom=isset($_GET["search_nom"])?$_GET["search_nom"]:$_POST["search_nom"]; |
48 |
$search_contract=isset($_GET["search_contract"])?$_GET["search_contract"]:$_POST["search_contract"]; |
$search_contract=isset($_GET["search_contract"])?$_GET["search_contract"]:$_POST["search_contract"]; |
49 |
|
$sall=isset($_GET["sall"])?$_GET["sall"]:$_POST["sall"]; |
50 |
$statut=isset($_GET["statut"])?$_GET["statut"]:1; |
$statut=isset($_GET["statut"])?$_GET["statut"]:1; |
51 |
$socid=$_GET["socid"]; |
$socid=$_GET["socid"]; |
52 |
|
|
73 |
$sql.= " WHERE c.fk_soc = s.idp "; |
$sql.= " WHERE c.fk_soc = s.idp "; |
74 |
if ($search_nom) $sql.= " AND s.nom like '%".$search_nom."%'"; |
if ($search_nom) $sql.= " AND s.nom like '%".$search_nom."%'"; |
75 |
if ($search_contract) $sql.= " AND c.rowid = '".$search_contract."'"; |
if ($search_contract) $sql.= " AND c.rowid = '".$search_contract."'"; |
76 |
|
if ($sall) $sql.= " AND (s.nom like '%".$sall."%' OR cd.label like '%".$sall."%' OR cd.description like '%".$sall."%')"; |
77 |
if ($socid > 0) $sql.= " AND s.idp = $socid"; |
if ($socid > 0) $sql.= " AND s.idp = $socid"; |
78 |
$sql.= " GROUP BY c.rowid, c.datec, c.statut, s.nom, s.idp"; |
$sql.= " GROUP BY c.rowid, c.datec, c.statut, s.nom, s.idp"; |
79 |
$sql.= " ORDER BY $sortfield $sortorder"; |
$sql.= " ORDER BY $sortfield $sortorder"; |