Added search by multiple ips agents. Ticket #3949.

(cherry picked from commit b8306bbf00)
This commit is contained in:
Daniel Maya 2016-08-31 15:34:05 +02:00
parent 5d52aa152c
commit b277a0d542
1 changed files with 21 additions and 2 deletions

View File

@ -247,8 +247,27 @@ switch ($sortField) {
$search_sql = '';
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 . "
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)