From 9212e6a8920785e4a217fd60c76429e940de484a Mon Sep 17 00:00:00 2001 From: "manuel.montes" Date: Wed, 9 Jan 2019 16:06:08 +0100 Subject: [PATCH] Visual change in the data of general type reports Former-commit-id: fda11ae1c7233653728da7855fd010983a35d4fe --- .../include/functions_reporting_html.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 182977207d..2e4b2b521a 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -2570,6 +2570,15 @@ function reporting_html_general(&$table, $item) { /* End - Order by agent */ foreach ($item['data'] as $row) { + $module_type = db_get_value("id_tipo_modulo", "tagente_modulo","nombre", $row['module']); + if($module_type == 6 || $module_type == 9 || $module_type == 18 || $module_type == 2){ + $row['formated_value'] = round($row['formated_value'], 0, PHP_ROUND_HALF_DOWN); + } + if(($module_type == 6 || $module_type == 9 || $module_type == 18 || $module_type == 2) && $row['formated_value'] == 1){ + $row['formated_value'] = "Up"; + }elseif(($module_type == 6 || $module_type == 9 || $module_type == 18 || $module_type == 2) && $row['formated_value'] == 0){ + $row['formated_value'] = "Down"; + } if ($item['date']['period'] != 0) { $table1->data[] = array( $row['agent'], @@ -2640,8 +2649,18 @@ function reporting_html_general(&$table, $item) { $row['agent'] = $agent; $table1->style['agent'] = 'text-align: center;'; foreach ($list_modules as $name) { + $module_type = db_get_value("id_tipo_modulo", "tagente_modulo","nombre", $name); + if($module_type == 6 || $module_type == 9 || $module_type == 18 || $module_type == 2){ + $modules[$name] = round($modules[$name], 0, PHP_ROUND_HALF_DOWN); + } $table1->style[$name] = 'text-align: center;'; if (isset($modules[$name])) { + if(($module_type == 6 || $module_type == 9 || $module_type == 18 || $module_type == 2) && $modules[$name] == 1){ + $modules[$name] = "Up"; + }elseif(($module_type == 6 || $module_type == 9 || $module_type == 18 || $module_type == 2) && $modules[$name] == 0){ + hd( $modules[$name], true); + $modules[$name] = "Down"; + } $row[$name] = $modules[$name]; } else {