diff --git a/pandora_console/include/functions_reporting_html.php b/pandora_console/include/functions_reporting_html.php index 91c5ecfac6..54f81e32bc 100644 --- a/pandora_console/include/functions_reporting_html.php +++ b/pandora_console/include/functions_reporting_html.php @@ -2812,166 +2812,6 @@ function get_agent_first_time($agent_name) } -function reporting_html_general(&$table, $item) -{ - if (!empty($item['data'])) { - $data_in_same_row = $item['show_in_same_row']; - switch ($item['subtype']) { - case REPORT_GENERAL_NOT_GROUP_BY_AGENT: - if (!$data_in_same_row) { - $table1 = new stdClass(); - $table1->width = '99%'; - $table1->data = []; - $table1->head = []; - $table1->head[0] = __('Agent'); - $table1->head[1] = __('Module'); - if ($item['date']['period'] != 0) { - $table1->head[2] = __('Operation'); - } - - $table1->head[3] = __('Value'); - $table1->style[0] = 'text-align: left'; - $table1->style[1] = 'text-align: left'; - $table1->style[2] = 'text-align: left'; - $table1->style[3] = 'text-align: left'; - - // Begin - Order by agent - foreach ($item['data'] as $key => $row) { - $aux[$key] = $row['agent']; - } - - array_multisort($aux, SORT_ASC, $item['data']); - - // End - Order by agent - foreach ($item['data'] as $row) { - if ($item['date']['period'] != 0) { - $table1->data[] = [ - $row['agent'], - $row['module'], - $row['operator'], - $row['formated_value'], - ]; - } else { - $table1->data[] = [ - $row['agent'], - $row['module'], - $row['formated_value'], - ]; - } - } - } else { - $order_data = []; - foreach ($item['data'] as $row) { - $order_data[$row['id_agent']][$row['id_agent_module']][$row['operator']] = $row['formated_value']; - } - - $table1 = new stdClass(); - $table1->width = '99%'; - $table1->data = []; - $table1->head = []; - $table1->head[0] = __('Agent'); - $table1->head[1] = __('Module'); - $table1->head[2] = __('Avg'); - $table1->head[3] = __('Max'); - $table1->head[4] = __('Min'); - $table1->head[5] = __('Sum'); - $table1->style[0] = 'text-align: center'; - $table1->style[1] = 'text-align: center'; - $table1->style[2] = 'text-align: center'; - $table1->style[3] = 'text-align: center'; - $table1->style[4] = 'text-align: center'; - $table1->style[4] = 'text-align: center'; - - foreach ($order_data as $id_agent => $row) { - foreach ($row as $id_module => $row2) { - $table1->data[] = [ - agents_get_alias($id_agent), - modules_get_agentmodule_name($id_module), - $row2['Rate'], - $row2['Maximum'], - $row2['Minimum'], - $row2['Summatory'], - ]; - } - } - } - break; - - case REPORT_GENERAL_GROUP_BY_AGENT: - $list_modules = []; - foreach ($item['data'] as $modules) { - foreach ($modules as $name => $value) { - $list_modules[$name] = null; - } - } - - $list_modules = array_keys($list_modules); - - $table1->width = '99%'; - $table1->data = []; - $table1->head = array_merge([__('Agent')], $list_modules); - foreach ($item['data'] as $agent => $modules) { - $row = []; - - $row['agent'] = $agent; - $table1->style['agent'] = 'text-align: center;'; - foreach ($list_modules as $name) { - $table1->style[$name] = 'text-align: center;'; - if (isset($modules[$name])) { - $row[$name] = $modules[$name]; - } else { - $row[$name] = '--'; - } - } - - $table1->data[] = $row; - } - break; - } - - $table->colspan['data']['cell'] = 3; - $table->cellstyle['data']['cell'] = 'text-align: center;'; - $table->data['data']['cell'] = html_print_table($table1, true); - } else { - $table->colspan['error']['cell'] = 3; - $table->data['error']['cell'] = __('There are no Agent/Modules defined'); - } - - if ($item['resume'] && !empty($item['data'])) { - $table_summary = new stdClass(); - $table_summary->width = '99%'; - - $table_summary->data = []; - $table_summary->head = []; - $table_summary->head_colspan = []; - $table_summary->align = []; - - $table_summary->align[0] = 'left'; - $table_summary->align[1] = 'right'; - $table_summary->align[2] = 'right'; - $table_summary->align[3] = 'left'; - $table_summary->align[4] = 'right'; - - $table_summary->head_colspan[0] = 2; - $table_summary->head[0] = __('Min Value'); - $table_summary->head[1] = __('Average Value'); - $table_summary->head_colspan[2] = 2; - $table_summary->head[2] = __('Max Value'); - - $table_summary->data[0][0] = $item['min']['agent'].' - '.$item['min']['module']; - $table_summary->data[0][1] = $item['min']['formated_value']; - $table_summary->data[0][2] = format_for_graph($item['avg_value'], 2); - $table_summary->data[0][3] = $item['max']['agent'].' - '.$item['max']['module']; - $table_summary->data[0][4] = $item['max']['formated_value']; - - $table->colspan['summary_title']['cell'] = 3; - $table->data['summary_title']['cell'] = ''.__('Summary').''; - $table->colspan['summary_table']['cell'] = 3; - $table->data['summary_table']['cell'] = html_print_table($table_summary, true); - } -} - - function reporting_html_sql(&$table, $item) { if (!$item['correct']) {