mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-27 07:44:35 +02:00
Merge branch 'ent-11537-bug-en-cuadros-de-busqueda-con-los-caracteres-2-y-0' into 'develop'
Ent 11537 bug en cuadros de busqueda con los caracteres 2 y 0 See merge request artica/pandorafms!6410
This commit is contained in:
commit
7f75445d75
@ -566,10 +566,10 @@ if ($search != '') {
|
|||||||
if ($id != '') {
|
if ($id != '') {
|
||||||
$aux = $id[0]['id_agent'];
|
$aux = $id[0]['id_agent'];
|
||||||
$search_sql = sprintf(
|
$search_sql = sprintf(
|
||||||
' AND ( nombre LIKE "%%%s%%"
|
' AND ( REPLACE(nombre, " ", " ") LIKE "%%%s%%"
|
||||||
OR alias LIKE "%%%s%%"
|
OR REPLACE(alias, " ", " ") LIKE "%%%s%%"
|
||||||
OR comentarios LIKE "%%%s%%"
|
OR REPLACE(comentarios, " ", " ") LIKE "%%%s%%"
|
||||||
OR EXISTS (SELECT * FROM tagent_custom_data WHERE id_agent = id_agente AND description LIKE "%%%s%%")
|
OR EXISTS (SELECT * FROM tagent_custom_data WHERE id_agent = id_agente AND REPLACE(description, " ", " ") LIKE "%%%s%%")
|
||||||
OR tagente.id_agente = %d',
|
OR tagente.id_agente = %d',
|
||||||
$search,
|
$search,
|
||||||
$search,
|
$search,
|
||||||
@ -591,10 +591,10 @@ if ($search != '') {
|
|||||||
$search_sql .= ')';
|
$search_sql .= ')';
|
||||||
} else {
|
} else {
|
||||||
$search_sql = sprintf(
|
$search_sql = sprintf(
|
||||||
' AND ( nombre
|
' AND ( REPLACE(nombre, " ", " ")
|
||||||
LIKE "%%%s%%" OR alias
|
LIKE "%%%s%%" OR REPLACE(alias, " ", " ")
|
||||||
LIKE "%%%s%%" OR comentarios LIKE "%%%s%%"
|
LIKE "%%%s%%" OR REPLACE(comentarios, " ", " ") LIKE "%%%s%%"
|
||||||
OR EXISTS (SELECT * FROM tagent_custom_data WHERE id_agent = id_agente AND description LIKE "%%%s%%"))',
|
OR EXISTS (SELECT * FROM tagent_custom_data WHERE id_agent = id_agente AND REPLACE(description, " ", " ") LIKE "%%%s%%"))',
|
||||||
$search,
|
$search,
|
||||||
$search,
|
$search,
|
||||||
$search,
|
$search,
|
||||||
|
@ -575,7 +575,7 @@ $where = sprintf('delete_pending = 0 AND id_agente = %s', $id_agente);
|
|||||||
$search_string_entities = io_safe_input($search_string);
|
$search_string_entities = io_safe_input($search_string);
|
||||||
|
|
||||||
$basic_where = sprintf(
|
$basic_where = sprintf(
|
||||||
"(nombre LIKE '%%%s%%' OR nombre LIKE '%%%s%%' OR descripcion LIKE '%%%s%%' OR descripcion LIKE '%%%s%%') AND",
|
"(REPLACE(nombre, ' ', ' ') LIKE '%%%s%%' OR REPLACE(nombre, ' ', ' ') LIKE '%%%s%%' OR REPLACE(descripcion, ' ', ' ') LIKE '%%%s%%' OR REPLACE(descripcion, ' ', ' ') LIKE '%%%s%%') AND",
|
||||||
$search_string,
|
$search_string,
|
||||||
$search_string_entities,
|
$search_string_entities,
|
||||||
$search_string,
|
$search_string,
|
||||||
|
@ -729,7 +729,7 @@ if ($search_id_group) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($search_string != '') {
|
if ($search_string != '') {
|
||||||
$filter[] = '(name LIKE '."'%".$search_string."%'".'OR description LIKE '."'%".$search_string."%'".'OR tcp_send LIKE '."'%".$search_string."%'".'OR tcp_rcv LIKE '."'%".$search_string."%'".')';
|
$filter[] = '(REPLACE(name, " ", " ") LIKE '."'%".$search_string."%'".' OR REPLACE(REPLACE(description, " ", " "), " ", " ")LIKE '."'%".$search_string."%'".' OR REPLACE(tcp_send, " ", " ") LIKE '."'%".$search_string."%'".'OR REPLACE(tcp_rcv, " ", " ") LIKE '."'%".$search_string."%'".')';
|
||||||
}
|
}
|
||||||
|
|
||||||
$total_components = network_components_get_network_components(
|
$total_components = network_components_get_network_components(
|
||||||
|
@ -118,7 +118,7 @@ class ConfigPEN extends HTML
|
|||||||
if (is_array($filter)) {
|
if (is_array($filter)) {
|
||||||
if (!empty($filter['free_search'])) {
|
if (!empty($filter['free_search'])) {
|
||||||
$sql_filters[] = vsprintf(
|
$sql_filters[] = vsprintf(
|
||||||
' AND (lower(`manufacturer`) like lower("%%%s%%")
|
' AND (lower(REPLACE(manufacturer, " ", " ")) like lower("%%%s%%")
|
||||||
OR pen = "%s") ',
|
OR pen = "%s") ',
|
||||||
array_fill(0, 2, $filter['free_search'])
|
array_fill(0, 2, $filter['free_search'])
|
||||||
);
|
);
|
||||||
|
@ -194,11 +194,11 @@ function custom_graphs_get_user($id_user=0, $only_names=false, $returnAllGroup=t
|
|||||||
function custom_graphs_search($id_group, $search)
|
function custom_graphs_search($id_group, $search)
|
||||||
{
|
{
|
||||||
if ($id_group != '' && $search != '') {
|
if ($id_group != '' && $search != '') {
|
||||||
$all_graphs = db_get_all_rows_sql('select * from tgraph where id_group = '.$id_group.' AND (name LIKE "%'.$search.'%" OR description LIKE "'.$search.'")');
|
$all_graphs = db_get_all_rows_sql('select * from tgraph where id_group = '.$id_group.' AND (REPLACE(name, " ", " ") LIKE "%'.$search.'%" OR REPLACE(description, " ", " ") LIKE "'.$search.'")');
|
||||||
} else if ($id_group != '') {
|
} else if ($id_group != '') {
|
||||||
$all_graphs = db_get_all_rows_sql('select * from tgraph where id_group = '.$id_group.'');
|
$all_graphs = db_get_all_rows_sql('select * from tgraph where id_group = '.$id_group.'');
|
||||||
} else {
|
} else {
|
||||||
$all_graphs = db_get_all_rows_sql('select * from tgraph where name LIKE "%'.$search.'%" OR description LIKE "'.$search.'"');
|
$all_graphs = db_get_all_rows_sql('select * from tgraph where REPLACE(name, " ", " ") LIKE "%'.$search.'%" OR REPLACE(description, " ", " ") LIKE "'.$search.'"');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($all_graphs === false) {
|
if ($all_graphs === false) {
|
||||||
|
@ -77,7 +77,7 @@ function inventory_get_data(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($inventory_search_string != '') {
|
if ($inventory_search_string != '') {
|
||||||
array_push($where, "tagent_module_inventory.data LIKE '%".$inventory_search_string."%'");
|
array_push($where, "REPLACE(tagent_module_inventory.data, ' ', ' ') LIKE '%".$inventory_search_string."%'");
|
||||||
}
|
}
|
||||||
|
|
||||||
$offset = (int) get_parameter('offset');
|
$offset = (int) get_parameter('offset');
|
||||||
@ -746,7 +746,7 @@ function inventory_get_datatable(
|
|||||||
}
|
}
|
||||||
|
|
||||||
if ($inventory_search_string != '') {
|
if ($inventory_search_string != '') {
|
||||||
array_push($where, "tagent_module_inventory.data LIKE '%".$inventory_search_string."%'");
|
array_push($where, "REPLACE(tagente_datos_inventory.data, ' ', ' ') LIKE '%".$inventory_search_string."%'");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($utimestamp > 0) {
|
if ($utimestamp > 0) {
|
||||||
@ -786,7 +786,6 @@ function inventory_get_datatable(
|
|||||||
}
|
}
|
||||||
|
|
||||||
$rows = db_get_all_rows_sql($sql);
|
$rows = db_get_all_rows_sql($sql);
|
||||||
|
|
||||||
if ($order_by_agent === false) {
|
if ($order_by_agent === false) {
|
||||||
$modules = [];
|
$modules = [];
|
||||||
foreach ($rows as $row) {
|
foreach ($rows as $row) {
|
||||||
@ -796,7 +795,13 @@ function inventory_get_datatable(
|
|||||||
|
|
||||||
$data_rows = explode(PHP_EOL, $row['data_inventory']);
|
$data_rows = explode(PHP_EOL, $row['data_inventory']);
|
||||||
foreach ($data_rows as $data_key => $data_value) {
|
foreach ($data_rows as $data_key => $data_value) {
|
||||||
if (empty($data_value) === false) {
|
if (empty($inventory_search_string) !== true) {
|
||||||
|
$search_check = strpos(str_replace(' ', ' ', $data_value), $inventory_search_string);
|
||||||
|
} else {
|
||||||
|
$search_check = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (empty($data_value) === false && $search_check !== false) {
|
||||||
$row['data'] = $data_value;
|
$row['data'] = $data_value;
|
||||||
$modules[$row['name']][$row['name_agent'].'-'.$data_key.'-'.$data_value] = $row;
|
$modules[$row['name']][$row['name_agent'].'-'.$data_key.'-'.$data_value] = $row;
|
||||||
}
|
}
|
||||||
@ -889,7 +894,7 @@ function get_data_basic_info_sql($params, $count=false)
|
|||||||
|
|
||||||
if ($params['search'] > 0) {
|
if ($params['search'] > 0) {
|
||||||
$where .= sprintf(
|
$where .= sprintf(
|
||||||
' AND ( alias LIKE "%%%s%%" )',
|
' AND ( REPLACE(alias, " ", " ") LIKE "%%%s%%" )',
|
||||||
$params['search']
|
$params['search']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -1289,6 +1289,10 @@ if ($inventory_module !== 'basic') {
|
|||||||
$style = 'width: 100%';
|
$style = 'width: 100%';
|
||||||
$ordering = true;
|
$ordering = true;
|
||||||
$searching = false;
|
$searching = false;
|
||||||
|
$search = [];
|
||||||
|
if (strlen($inventory_search_string) > 0) {
|
||||||
|
$search['value'] = $inventory_search_string;
|
||||||
|
}
|
||||||
|
|
||||||
$columns = [
|
$columns = [
|
||||||
'alias',
|
'alias',
|
||||||
@ -1338,6 +1342,7 @@ if ($inventory_module !== 'basic') {
|
|||||||
'get_data_basic_info' => 1,
|
'get_data_basic_info' => 1,
|
||||||
'id_agent' => $id_agente,
|
'id_agent' => $id_agente,
|
||||||
'id_group' => $inventory_id_group,
|
'id_group' => $inventory_id_group,
|
||||||
|
'search' => $search,
|
||||||
],
|
],
|
||||||
'zeroRecords' => __('Agent info not found'),
|
'zeroRecords' => __('Agent info not found'),
|
||||||
'emptyTable' => __('Agent info not found'),
|
'emptyTable' => __('Agent info not found'),
|
||||||
|
@ -76,15 +76,15 @@ if ($searchAgents) {
|
|||||||
$sql = "SELECT DISTINCT taddress_agent.id_agent FROM taddress
|
$sql = "SELECT DISTINCT taddress_agent.id_agent FROM taddress
|
||||||
INNER JOIN taddress_agent ON
|
INNER JOIN taddress_agent ON
|
||||||
taddress.id_a = taddress_agent.id_a
|
taddress.id_a = taddress_agent.id_a
|
||||||
WHERE taddress.ip LIKE '$stringSearchSQL'";
|
WHERE LOWER(REPLACE(taddress.ip, ' ', ' ')) LIKE LOWER('$stringSearchSQL')";
|
||||||
|
|
||||||
$id = db_get_all_rows_sql($sql);
|
$id = db_get_all_rows_sql($sql);
|
||||||
if ($id != '') {
|
if ($id != '') {
|
||||||
$aux = $id[0]['id_agent'];
|
$aux = $id[0]['id_agent'];
|
||||||
$search_sql = " t1.nombre LIKE '".$stringSearchSQL."' OR
|
$search_sql = " LOWER(REPLACE(t1.nombre, ' ', ' ')) LIKE LOWER('".$stringSearchSQL."') OR
|
||||||
t2.nombre LIKE '".$stringSearchSQL."' OR
|
LOWER(REPLACE(t2.nombre, ' ', ' ')) LIKE LOWER('".$stringSearchSQL."') OR
|
||||||
t1.alias LIKE '".$stringSearchSQL."' OR
|
LOWER(REPLACE(t1.alias, ' ', ' ')) LIKE LOWER('".$stringSearchSQL."') OR
|
||||||
t1.comentarios LIKE '".$stringSearchSQL."' OR
|
LOWER(REPLACE(t1.comentarios, ' ', ' ')) LIKE LOWER('".$stringSearchSQL."') OR
|
||||||
t1.id_agente =".$aux;
|
t1.id_agente =".$aux;
|
||||||
|
|
||||||
$idCount = count($id);
|
$idCount = count($id);
|
||||||
@ -96,16 +96,16 @@ if ($searchAgents) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$search_sql = " t1.nombre LIKE '".$stringSearchSQL."' OR
|
$search_sql = " LOWER(REPLACE(t1.nombre, ' ', ' ')) LIKE LOWER('".$stringSearchSQL."') OR
|
||||||
t2.nombre LIKE '".$stringSearchSQL."' OR
|
LOWER(REPLACE(t2.nombre, ' ', ' ')) LIKE LOWER('".$stringSearchSQL."') OR
|
||||||
t1.direccion LIKE '".$stringSearchSQL."' OR
|
LOWER(REPLACE(t1.direccion, ' ', ' ')) LIKE LOWER('".$stringSearchSQL."') OR
|
||||||
t1.comentarios LIKE '".$stringSearchSQL."' OR
|
LOWER(REPLACE(t1.comentarios, ' ', ' ')) LIKE LOWER('".$stringSearchSQL."') OR
|
||||||
t1.alias LIKE '".$stringSearchSQL."'";
|
LOWER(REPLACE(t1.alias, ' ', ' ')) LIKE LOWER('".$stringSearchSQL."')";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($has_secondary === true) {
|
if ($has_secondary === true) {
|
||||||
$search_sql .= " OR (tasg.id_group IS NOT NULL AND
|
$search_sql .= " OR (tasg.id_group IS NOT NULL AND
|
||||||
tasg.id_group IN (SELECT id_grupo FROM tgrupo WHERE nombre LIKE '".$stringSearchSQL."'))";
|
tasg.id_group IN (SELECT id_grupo FROM tgrupo WHERE LOWER(REPLACE(nombre, ' ', ' ')) LIKE LOWER('".$stringSearchSQL."')))";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "
|
$sql = "
|
||||||
|
@ -139,64 +139,64 @@ if ($searchAlerts) {
|
|||||||
switch ($config['dbtype']) {
|
switch ($config['dbtype']) {
|
||||||
case 'mysql':
|
case 'mysql':
|
||||||
$whereAlerts = 'AND (
|
$whereAlerts = 'AND (
|
||||||
id_alert_template IN (SELECT id FROM talert_templates WHERE name LIKE "%'.$stringSearchSQL.'%") OR
|
id_alert_template IN (SELECT id FROM talert_templates WHERE REPLACE(name, " ", " ") LIKE "%'.$stringSearchSQL.'%") OR
|
||||||
id_alert_template IN (
|
id_alert_template IN (
|
||||||
SELECT id
|
SELECT id
|
||||||
FROM talert_templates
|
FROM talert_templates
|
||||||
WHERE id_alert_action IN (
|
WHERE id_alert_action IN (
|
||||||
SELECT id
|
SELECT id
|
||||||
FROM talert_actions
|
FROM talert_actions
|
||||||
WHERE name LIKE "%'.$stringSearchSQL.'%")) OR
|
WHERE REPLACE(name, " ", " ") LIKE "%'.$stringSearchSQL.'%")) OR
|
||||||
talert_template_modules.id IN (
|
talert_template_modules.id IN (
|
||||||
SELECT id_alert_template_module
|
SELECT id_alert_template_module
|
||||||
FROM talert_template_module_actions
|
FROM talert_template_module_actions
|
||||||
WHERE id_alert_action IN (
|
WHERE id_alert_action IN (
|
||||||
SELECT id
|
SELECT id
|
||||||
FROM talert_actions
|
FROM talert_actions
|
||||||
WHERE name LIKE "%'.$stringSearchSQL.'%")) OR
|
WHERE REPLACE(name, " ", " ") LIKE "%'.$stringSearchSQL.'%")) OR
|
||||||
id_agent_module IN (
|
id_agent_module IN (
|
||||||
SELECT id_agente_modulo
|
SELECT id_agente_modulo
|
||||||
FROM tagente_modulo
|
FROM tagente_modulo
|
||||||
WHERE nombre LIKE "%'.$stringSearchSQL.'%") OR
|
WHERE REPLACE(nombre, " ", " ") LIKE "%'.$stringSearchSQL.'%") OR
|
||||||
id_agent_module IN (
|
id_agent_module IN (
|
||||||
SELECT id_agente_modulo
|
SELECT id_agente_modulo
|
||||||
FROM tagente_modulo
|
FROM tagente_modulo
|
||||||
WHERE id_agente IN (
|
WHERE id_agente IN (
|
||||||
SELECT id_agente
|
SELECT id_agente
|
||||||
FROM tagente
|
FROM tagente
|
||||||
WHERE nombre LIKE "%'.$stringSearchSQL.'%" '.$extra_sql.'))
|
WHERE REPLACE(nombre, " ", " ") LIKE "%'.$stringSearchSQL.'%" '.$extra_sql.'))
|
||||||
)';
|
)';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'postgresql':
|
case 'postgresql':
|
||||||
case 'oracle':
|
case 'oracle':
|
||||||
$whereAlerts = 'AND (
|
$whereAlerts = 'AND (
|
||||||
id_alert_template IN (SELECT id FROM talert_templates WHERE upper(name) LIKE \'%'.strtolower($stringSearchSQL).'%\') OR
|
id_alert_template IN (SELECT id FROM talert_templates WHERE upper(REPLACE(name, " ", " ")) LIKE \'%'.strtolower($stringSearchSQL).'%\') OR
|
||||||
id_alert_template IN (
|
id_alert_template IN (
|
||||||
SELECT id
|
SELECT id
|
||||||
FROM talert_templates
|
FROM talert_templates
|
||||||
WHERE id_alert_action IN (
|
WHERE id_alert_action IN (
|
||||||
SELECT id
|
SELECT id
|
||||||
FROM talert_actions
|
FROM talert_actions
|
||||||
WHERE upper(name) LIKE \'%'.strtolower($stringSearchSQL).'%\')) OR
|
WHERE upper(REPLACE(name, " ", " ")) LIKE \'%'.strtolower($stringSearchSQL).'%\')) OR
|
||||||
talert_template_modules.id IN (
|
talert_template_modules.id IN (
|
||||||
SELECT id_alert_template_module
|
SELECT id_alert_template_module
|
||||||
FROM talert_template_module_actions
|
FROM talert_template_module_actions
|
||||||
WHERE id_alert_action IN (
|
WHERE id_alert_action IN (
|
||||||
SELECT id
|
SELECT id
|
||||||
FROM talert_actions
|
FROM talert_actions
|
||||||
WHERE upper(name) LIKE \'%'.strtolower($stringSearchSQL).'%\')) OR
|
WHERE upper(REPLACE(name, " ", " ")) LIKE \'%'.strtolower($stringSearchSQL).'%\')) OR
|
||||||
id_agent_module IN (
|
id_agent_module IN (
|
||||||
SELECT id_agente_modulo
|
SELECT id_agente_modulo
|
||||||
FROM tagente_modulo
|
FROM tagente_modulo
|
||||||
WHERE upper(nombre) LIKE \'%'.strtolower($stringSearchSQL).'%\') OR
|
WHERE upper(REPLACE(nombre, " ", " ")) LIKE \'%'.strtolower($stringSearchSQL).'%\') OR
|
||||||
id_agent_module IN (
|
id_agent_module IN (
|
||||||
SELECT id_agente_modulo
|
SELECT id_agente_modulo
|
||||||
FROM tagente_modulo
|
FROM tagente_modulo
|
||||||
WHERE id_agente IN (
|
WHERE id_agente IN (
|
||||||
SELECT id_agente
|
SELECT id_agente
|
||||||
FROM tagente
|
FROM tagente
|
||||||
WHERE upper(nombre) LIKE \'%'.strtolower($stringSearchSQL).'%\' '.$extra_sql.'))
|
WHERE upper(REPLACE(nombre, " ", " ")) LIKE \'%'.strtolower($stringSearchSQL).'%\' '.$extra_sql.'))
|
||||||
)';
|
)';
|
||||||
$agents = false;
|
$agents = false;
|
||||||
break;
|
break;
|
||||||
|
@ -31,7 +31,7 @@ if ($searchGraphs) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$filter = [];
|
$filter = [];
|
||||||
$filter[] = "(upper(name) LIKE '%".strtolower($stringSearchSQL)."%' OR upper(description) LIKE '%$".strtolower($stringSearchSQL)."%')";
|
$filter[] = "(upper(REPLACE(name, ' ', ' ')) LIKE '%".strtolower($stringSearchSQL)."%' OR upper(REPLACE(description, ' ', ' ')) LIKE '%$".strtolower($stringSearchSQL)."%')";
|
||||||
$filter['id_graph'] = $usergraphs_id;
|
$filter['id_graph'] = $usergraphs_id;
|
||||||
|
|
||||||
$columns = [
|
$columns = [
|
||||||
|
@ -62,10 +62,10 @@ $sql = "SELECT DISTINCT taddress_agent.id_agent FROM taddress
|
|||||||
$id = db_get_all_rows_sql($sql);
|
$id = db_get_all_rows_sql($sql);
|
||||||
if ($id != '') {
|
if ($id != '') {
|
||||||
$aux = $id[0]['id_agent'];
|
$aux = $id[0]['id_agent'];
|
||||||
$search_sql = " t1.nombre LIKE '".$stringSearchSQL."' OR
|
$search_sql = " REPLACE(t1.nombre, ' ', ' ') LIKE '".$stringSearchSQL."' OR
|
||||||
t2.nombre LIKE '".$stringSearchSQL."' OR
|
REPLACE(t2.nombre, ' ', ' ') LIKE '".$stringSearchSQL."' OR
|
||||||
t1.alias LIKE '".$stringSearchSQL."' OR
|
REPLACE(t1.alias, ' ', ' ') LIKE '".$stringSearchSQL."' OR
|
||||||
t1.comentarios LIKE '".$stringSearchSQL."' OR
|
REPLACE(t1.comentarios, ' ', ' ') LIKE '".$stringSearchSQL."' OR
|
||||||
t1.id_agente =".$aux;
|
t1.id_agente =".$aux;
|
||||||
|
|
||||||
$idCount = count($id);
|
$idCount = count($id);
|
||||||
@ -77,16 +77,16 @@ if ($id != '') {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$search_sql = " t1.nombre LIKE '".$stringSearchSQL."' OR
|
$search_sql = " REPLACE(t1.nombre, ' ', ' ') LIKE '".$stringSearchSQL."' OR
|
||||||
t2.nombre LIKE '".$stringSearchSQL."' OR
|
REPLACE(t2.nombre, ' ', ' ') LIKE '".$stringSearchSQL."' OR
|
||||||
t1.direccion LIKE '".$stringSearchSQL."' OR
|
REPLACE(t1.direccion, ' ', ' ') LIKE '".$stringSearchSQL."' OR
|
||||||
t1.comentarios LIKE '".$stringSearchSQL."' OR
|
REPLACE(t1.comentarios, ' ', ' ') LIKE '".$stringSearchSQL."' OR
|
||||||
t1.alias LIKE '".$stringSearchSQL."'";
|
REPLACE(t1.alias, ' ', ' ') LIKE '".$stringSearchSQL."'";
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($has_secondary === true) {
|
if ($has_secondary === true) {
|
||||||
$search_sql .= " OR (tasg.id_group IS NOT NULL AND
|
$search_sql .= " OR (tasg.id_group IS NOT NULL AND
|
||||||
tasg.id_group IN (SELECT id_grupo FROM tgrupo WHERE nombre LIKE '".$stringSearchSQL."'))";
|
tasg.id_group IN (SELECT id_grupo FROM tgrupo WHERE REPLACE(nombre, ' ', ' ') LIKE '".$stringSearchSQL."'))";
|
||||||
}
|
}
|
||||||
|
|
||||||
$sql = "
|
$sql = "
|
||||||
|
@ -32,7 +32,7 @@ if ((bool) $searchMaps === true) {
|
|||||||
FROM tlayout tl
|
FROM tlayout tl
|
||||||
LEFT JOIN tlayout_data tld
|
LEFT JOIN tlayout_data tld
|
||||||
ON tl.id = tld.id_layout
|
ON tl.id = tld.id_layout
|
||||||
WHERE tl.name LIKE "%%%s%%"
|
WHERE REPLACE(tl.name, " ", " ") LIKE "%%%s%%"
|
||||||
AND tl.id_group IN (%s)
|
AND tl.id_group IN (%s)
|
||||||
GROUP BY tl.id, tl.name, tl.id_group',
|
GROUP BY tl.id, tl.name, tl.id_group',
|
||||||
$stringSearchSQL,
|
$stringSearchSQL,
|
||||||
|
@ -142,8 +142,8 @@ if ($searchModules) {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
AND
|
AND
|
||||||
(t1.nombre LIKE "%'.$stringSearchSQL.'%" OR
|
(REPLACE(t1.nombre, " ", " ") LIKE "%'.$stringSearchSQL.'%" OR
|
||||||
t3.nombre LIKE "%'.$stringSearchSQL.'%")
|
REPLACE(t3.nombre, " ", " ") LIKE "%'.$stringSearchSQL.'%")
|
||||||
AND t1.disabled = 0';
|
AND t1.disabled = 0';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -172,8 +172,8 @@ if ($searchModules) {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
) AND
|
) AND
|
||||||
(t1.nombre LIKE \'%'.$stringSearchSQL.'%\' OR
|
(REPLACE(t1.nombre, " ", " ") LIKE \'%'.$stringSearchSQL.'%\' OR
|
||||||
t3.nombre LIKE \'%'.$stringSearchSQL.'%\')';
|
REPLACE(t3.nombre, " ", " ") LIKE \'%'.$stringSearchSQL.'%\')';
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'oracle':
|
case 'oracle':
|
||||||
@ -201,8 +201,8 @@ if ($searchModules) {
|
|||||||
)
|
)
|
||||||
)
|
)
|
||||||
) AND
|
) AND
|
||||||
(LOWER(t1.nombre) LIKE \'%'.strtolower($stringSearchSQL).'%\' OR
|
(LOWER(REPLACE(t1.nombre, " ", " ")) LIKE \'%'.strtolower($stringSearchSQL).'%\' OR
|
||||||
LOWER(t3.nombre) LIKE \'%'.strtolower($stringSearchSQL).'%\')';
|
LOWER(REPLACE(t3.nombre, " ", " ")) LIKE \'%'.strtolower($stringSearchSQL).'%\')';
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -207,7 +207,7 @@ if ($searchpolicies === true) {
|
|||||||
|
|
||||||
$sql = "SELECT id, name, description, id_group, status
|
$sql = "SELECT id, name, description, id_group, status
|
||||||
FROM tpolicies
|
FROM tpolicies
|
||||||
WHERE name LIKE '$stringSearchSQL'
|
WHERE REPLACE(name, ' ', ' ') LIKE '$stringSearchSQL'
|
||||||
AND id_group IN ($id_user_groups_str)
|
AND id_group IN ($id_user_groups_str)
|
||||||
";
|
";
|
||||||
}
|
}
|
||||||
|
@ -46,13 +46,13 @@ if ($searchReports) {
|
|||||||
case 'postgresql':
|
case 'postgresql':
|
||||||
$sql = "SELECT id_report, name, description
|
$sql = "SELECT id_report, name, description
|
||||||
FROM treport
|
FROM treport
|
||||||
WHERE (name LIKE '%".$stringSearchSQL."%' OR description LIKE '%".$stringSearchSQL."%')".$reports_condition;
|
WHERE (REPLACE(name, ' ', ' ') LIKE '%".$stringSearchSQL."%' OR REPLACE(description, ' ', ' ') LIKE '%".$stringSearchSQL."%')".$reports_condition;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'oracle':
|
case 'oracle':
|
||||||
$sql = "SELECT id_report, name, description
|
$sql = "SELECT id_report, name, description
|
||||||
FROM treport
|
FROM treport
|
||||||
WHERE (upper(name) LIKE '%".strtolower($stringSearchSQL)."%' OR description LIKE '%".strtolower($stringSearchSQL)."%')".$reports_condition;
|
WHERE (upper(REPLACE(name, ' ', ' ') ) LIKE '%".strtolower($stringSearchSQL)."%' OR REPLACE(description, ' ', ' ') LIKE '%".strtolower($stringSearchSQL)."%')".$reports_condition;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,13 +77,13 @@ if ($searchReports) {
|
|||||||
case 'postgresql':
|
case 'postgresql':
|
||||||
$sql_count = "SELECT COUNT(id_report) AS count
|
$sql_count = "SELECT COUNT(id_report) AS count
|
||||||
FROM treport
|
FROM treport
|
||||||
WHERE (name LIKE '%".$stringSearchSQL."%' OR description LIKE '%".$stringSearchSQL."%')".$reports_condition;
|
WHERE (REPLACE(name, ' ', ' ') LIKE '%".$stringSearchSQL."%' OR REPLACE(description, ' ', ' ') LIKE '%".$stringSearchSQL."%')".$reports_condition;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'oracle':
|
case 'oracle':
|
||||||
$sql_count = "SELECT COUNT(id_report) AS count
|
$sql_count = "SELECT COUNT(id_report) AS count
|
||||||
FROM treport
|
FROM treport
|
||||||
WHERE (upper(name) LIKE '%".strtolower($stringSearchSQL)."%' OR upper(description) LIKE '%".strtolower($stringSearchSQL)."%')".$reports_condition;
|
WHERE (upper(REPLACE(name, ' ', ' ') ) LIKE '%".strtolower($stringSearchSQL)."%' OR upper(REPLACE(description, ' ', ' ') ) LIKE '%".strtolower($stringSearchSQL)."%')".$reports_condition;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -179,23 +179,23 @@ if ($searchUsers) {
|
|||||||
case 'mysql':
|
case 'mysql':
|
||||||
case 'postgresql':
|
case 'postgresql':
|
||||||
$sql = "SELECT id_user, fullname, firstname, lastname, middlename, email, last_connect, is_admin, comments FROM tusuario
|
$sql = "SELECT id_user, fullname, firstname, lastname, middlename, email, last_connect, is_admin, comments FROM tusuario
|
||||||
WHERE fullname LIKE '%".$stringSearchSQL."%' OR
|
WHERE REPLACE(fullname, ' ', ' ') LIKE '%".$stringSearchSQL."%' OR
|
||||||
id_user LIKE '%".$stringSearchSQL."%' OR
|
REPLACE(id_user, ' ', ' ') LIKE '%".$stringSearchSQL."%' OR
|
||||||
firstname LIKE '%".$stringSearchSQL."%' OR
|
REPLACE(firstname, ' ', ' ') LIKE '%".$stringSearchSQL."%' OR
|
||||||
lastname LIKE '%".$stringSearchSQL."%' OR
|
REPLACE(lastname, ' ', ' ') LIKE '%".$stringSearchSQL."%' OR
|
||||||
middlename LIKE '%".$stringSearchSQL."%' OR
|
REPLACE(middlename, ' ', ' ') LIKE '%".$stringSearchSQL."%' OR
|
||||||
email LIKE '%".$stringSearchSQL."%'
|
REPLACE(email, ' ', ' ') LIKE '%".$stringSearchSQL."%'
|
||||||
ORDER BY ".$order['field'].' '.$order['order'];
|
ORDER BY ".$order['field'].' '.$order['order'];
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'oracle':
|
case 'oracle':
|
||||||
$sql = "SELECT id_user, fullname, firstname, lastname, middlename, email, last_connect, is_admin, comments FROM tusuario
|
$sql = "SELECT id_user, fullname, firstname, lastname, middlename, email, last_connect, is_admin, comments FROM tusuario
|
||||||
WHERE upper(fullname) LIKE '%".strtolower($stringSearchSQL)."%' OR
|
WHERE upper(REPLACE(fullname, ' ', ' ') ) LIKE '%".strtolower($stringSearchSQL)."%' OR
|
||||||
upper(id_user) LIKE '%".strtolower($stringSearchSQL)."%' OR
|
upper(REPLACE(id_user, ' ', ' ') ) LIKE '%".strtolower($stringSearchSQL)."%' OR
|
||||||
upper(firstname) LIKE '%".strtolower($stringSearchSQL)."%' OR
|
upper(REPLACE(firstname, ' ', ' ') ) LIKE '%".strtolower($stringSearchSQL)."%' OR
|
||||||
upper(lastname) LIKE '%".strtolower($stringSearchSQL)."%' OR
|
upper(REPLACE(lastname, ' ', ' ') ) LIKE '%".strtolower($stringSearchSQL)."%' OR
|
||||||
upper(middlename) LIKE '%".strtolower($stringSearchSQL)."%' OR
|
upper(REPLACE(middlename, ' ', ' ') ) LIKE '%".strtolower($stringSearchSQL)."%' OR
|
||||||
upper(email) LIKE '%".strtolower($stringSearchSQL)."%'
|
upper(REPLACE(email, ' ', ' ') ) LIKE '%".strtolower($stringSearchSQL)."%'
|
||||||
ORDER BY ".$order['field'].' '.$order['order'];
|
ORDER BY ".$order['field'].' '.$order['order'];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user