From 377838a8142e828b8825cee6135cb636deed6cb5 Mon Sep 17 00:00:00 2001 From: zarzuelo Date: Tue, 31 Aug 2010 10:48:11 +0000 Subject: [PATCH] 2010-08-31 Sergio Martin * include/functions_db.php: Added support to '<>' comparation in the format_array_to_where_clause_sql function git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@3204 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f --- pandora_console/ChangeLog | 6 ++++++ pandora_console/include/functions_db.php | 12 +++++++++--- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 17535a90ea..2e5774828c 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,9 @@ +2010-08-31 Sergio Martin + + * include/functions_db.php: Added support to '<>' + comparation in the format_array_to_where_clause_sql + function + 2010-08-31 Sergio Martin * operation/agentes/networkmap.php: Fixed the groups diff --git a/pandora_console/include/functions_db.php b/pandora_console/include/functions_db.php index e8ba2d44ce..91d4d3bf14 100644 --- a/pandora_console/include/functions_db.php +++ b/pandora_console/include/functions_db.php @@ -2562,7 +2562,7 @@ function format_array_to_where_clause_sql ($values, $join = 'AND', $prefix = fal $offset = sprintf (' OFFSET %d', $values['offset']); unset ($values['offset']); } - + if (isset ($values['order'])) { if (is_array($values['order'])) { if (!isset($values['order']['order'])) { @@ -2619,8 +2619,14 @@ function format_array_to_where_clause_sql ($values, $join = 'AND', $prefix = fal $query .= sprintf ("%s > '%s'", $field, $value); } else if ($value[0] == "<"){ - $value = substr($value,1,strlen($value)-1); - $query .= sprintf ("%s < '%s'", $field, $value); + if ($value[1] == ">"){ + $value = substr($value,2,strlen($value)-2); + $query .= sprintf ("%s <> '%s'", $field, $value); + } + else { + $value = substr($value,1,strlen($value)-1); + $query .= sprintf ("%s < '%s'", $field, $value); + } } else { $query .= sprintf ("%s = '%s'", $field, $value);