Added fixes to new report item

This commit is contained in:
Arturo Gonzalez 2017-04-12 15:53:36 +02:00
parent b912834ce7
commit cc1ab47a65
2 changed files with 7 additions and 3 deletions

View File

@ -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;

View File

@ -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') {