mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-14 17:34:59 +02:00
Added search by multiple ips agents. Ticket #3949.
This commit is contained in:
parent
a0753238f7
commit
b8306bbf00
@ -247,8 +247,27 @@ switch ($sortField) {
|
|||||||
|
|
||||||
$search_sql = '';
|
$search_sql = '';
|
||||||
if ($search != "") {
|
if ($search != "") {
|
||||||
|
$sql = "SELECT DISTINCT taddress_agent.id_agent FROM taddress
|
||||||
|
INNER JOIN taddress_agent ON
|
||||||
|
taddress.id_a = taddress_agent.id_a
|
||||||
|
WHERE taddress.ip LIKE '%$search%'";
|
||||||
|
|
||||||
|
$id = db_get_all_rows_sql($sql);
|
||||||
|
if($id != ''){
|
||||||
|
$aux = $id[0]['id_agent'];
|
||||||
$search_sql = " AND ( nombre " . $order_collation . "
|
$search_sql = " AND ( nombre " . $order_collation . "
|
||||||
LIKE '%$search%' OR direccion LIKE '%$search%') ";
|
LIKE '%$search%' OR tagente.id_agente = $aux";
|
||||||
|
if(count($id)>=2){
|
||||||
|
for ($i = 1; $i < count($id); $i++){
|
||||||
|
$aux = $id[$i]['id_agent'];
|
||||||
|
$search_sql .= " OR tagente.id_agente = $aux";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$search_sql .= ")";
|
||||||
|
}else{
|
||||||
|
$search_sql = " AND ( nombre " . $order_collation . "
|
||||||
|
LIKE '%$search%') ";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($disabled == 1)
|
if ($disabled == 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user