fixed minor error in report #10

This commit is contained in:
daniel 2016-08-11 10:04:10 +02:00
parent 9f0bdc5315
commit 93b64ba43c
1 changed files with 30 additions and 22 deletions

View File

@ -4065,6 +4065,7 @@ function reporting_general($report, $content) {
$mod_name = modules_get_agentmodule_name ($row['id_agent_module']); $mod_name = modules_get_agentmodule_name ($row['id_agent_module']);
$ag_name = modules_get_agentmodule_agent_name ($row['id_agent_module']); $ag_name = modules_get_agentmodule_agent_name ($row['id_agent_module']);
$type_mod = modules_get_last_value($row['id_agent_module']);
$unit = db_get_value('unit', 'tagente_modulo', $unit = db_get_value('unit', 'tagente_modulo',
'id_agente_modulo', 'id_agente_modulo',
$row['id_agent_module']); $row['id_agent_module']);
@ -4074,28 +4075,32 @@ function reporting_general($report, $content) {
modules_get_last_value($row['id_agent_module']); modules_get_last_value($row['id_agent_module']);
} }
else { else {
switch ($row['operation']) { if(is_numeric($type_mod)){
case 'sum': switch ($row['operation']) {
$data_res[$key] = case 'sum':
reporting_get_agentmodule_data_sum( $data_res[$key] =
$row['id_agent_module'], $content['period'], $report["datetime"]); reporting_get_agentmodule_data_sum(
break; $row['id_agent_module'], $content['period'], $report["datetime"]);
case 'max': break;
$data_res[$key] = case 'max':
reporting_get_agentmodule_data_max( $data_res[$key] =
$row['id_agent_module'], $content['period']); reporting_get_agentmodule_data_max(
break; $row['id_agent_module'], $content['period']);
case 'min': break;
$data_res[$key] = case 'min':
reporting_get_agentmodule_data_min( $data_res[$key] =
$row['id_agent_module'], $content['period']); reporting_get_agentmodule_data_min(
break; $row['id_agent_module'], $content['period']);
case 'avg': break;
default: case 'avg':
$data_res[$key] = default:
reporting_get_agentmodule_data_average( $data_res[$key] =
$row['id_agent_module'], $content['period']); reporting_get_agentmodule_data_average(
break; $row['id_agent_module'], $content['period']);
break;
}
} else {
$data_res[$key] = $type_mod;
} }
} }
@ -4250,8 +4255,11 @@ function reporting_general($report, $content) {
if (!is_numeric($d)) { if (!is_numeric($d)) {
$data['value'] = $d; $data['value'] = $d;
// to see the chains on the table
$data['formated_value'] = $d;
} }
else { else {
$data['value'] = $d; $data['value'] = $d;
$data['formated_value'] = format_for_graph($d, 2) . " " . $data['formated_value'] = format_for_graph($d, 2) . " " .
$units[$i]; $units[$i];