From cc1ab47a65cc5815427d327b6727f138782d198b Mon Sep 17 00:00:00 2001 From: Arturo Gonzalez Date: Wed, 12 Apr 2017 15:53:36 +0200 Subject: [PATCH] Added fixes to new report item --- pandora_console/include/functions_reporting.php | 6 +++++- pandora_console/include/functions_reporting_html.php | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/pandora_console/include/functions_reporting.php b/pandora_console/include/functions_reporting.php index 1a649d63ab..2d230792d3 100644 --- a/pandora_console/include/functions_reporting.php +++ b/pandora_console/include/functions_reporting.php @@ -5503,7 +5503,11 @@ function reporting_increment ($report, $content) { $last_data = db_get_value_sql('SELECT datos FROM tagente_datos WHERE id_agente_modulo = ' . $id_agent_module . ' ORDER BY utimestamp DESC'); - if (is_numeric($old_data) && is_numeric($last_data)) { + if ($old_data === false || $last_data === false) { + $return["data"]['message'] = __('The monitor have no data in this range of dates or monitor type is not numeric'); + $return["data"]['error'] = true; + } + else if (is_numeric($old_data) && is_numeric($last_data)) { $return["data"]['old'] = $old_data; $return["data"]['now'] = $last_data; $increment = $old_data - $last_data; diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 1cf64b4342..6522a0b63a 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -2257,8 +2257,8 @@ function reporting_html_increment(&$table, $item) { $table1_row = array(); $table1_row[0] = agents_get_alias($item['id_agent']); $table1_row[1] = modules_get_agentmodule_name($item['id_agent_module']); - $table1_row[2] = date("F j, Y, g:i a", $item['from']); - $table1_row[3] = date("F j, Y, g:i a", $item['to']); + $table1_row[2] = date("F j, Y, G:i", $item['from']); + $table1_row[3] = date("F j, Y, G:i", $item['to']); $table1_row[4] = $item["data"]['old']; $table1_row[5] = $item["data"]['now']; if ($item["data"]['inc'] == 'negative') {