";
$single_table .= "
";
$single_table .= "";
$single_table .= __('Time container lapse');
// $single_table .= ui_print_help_tip(__('This is the range, or period of time over which the report renders the information for this report type. For example, a week means data from a week ago from now. '),true);
$single_table .= " | ";
$single_table .= "";
$single_table .= html_print_extended_select_for_time('period_container_'.$hash, $period,
'', '', '0', 10, true,'font-size: 9pt;width: 130px;',true,'',false,$periods,'vertical-align: middle;');
$single_table .= " | ";
$single_table .= "
";
$single_table .= "";
$table .= $single_table;
$contador = $config['max_graph_container'];
foreach ($result_items as $key => $value) {
$table .= "";
if($period > 1){
$value['time_lapse'] = $period;
}
switch ($value['type']) {
case 'simple_graph':
if ($contador > 0) {
$sql_modulo = db_get_all_rows_sql("SELECT nombre, id_agente FROM
tagente_modulo WHERE id_agente_modulo = ". $value['id_agent_module']);
$sql_alias = db_get_all_rows_sql("SELECT alias from tagente
WHERE id_agente = ". $sql_modulo[0]['id_agente']);
$table .= "AGENT " .$sql_alias[0]['alias']." MODULE ".$sql_modulo[0]['nombre']."
";
$table .= grafico_modulo_sparse(
$value['id_agent_module'],
$value['time_lapse'],
0,
800,
300,
'',
'',
false,
$value['only_average'],
false,
0,
'',
0,
0,
1,
false,
ui_get_full_url(false, false, false, false),
1,
false,
0,
false,
false,
1,
'white',
null,
false,
false,
'area');
$contador --;
}
// $table .= "";
break;
case 'custom_graph':
if ($contador > 0) {
$graph = db_get_all_rows_field_filter('tgraph', 'id_graph',$value['id_graph']);
$sources = db_get_all_rows_field_filter('tgraph_source', 'id_graph',$value['id_graph']);
$modules = array ();
$weights = array ();
$labels = array ();
foreach ($sources as $source) {
array_push ($modules, $source['id_agent_module']);
array_push ($weights, $source['weight']);
if ($source['label'] != ''){
$item['type'] = 'custom_graph';
$item['id_agent'] = agents_get_module_id($source['id_agent_module']);
$item['id_agent_module'] = $source['id_agent_module'];
$labels[$source['id_agent_module']] = reporting_label_macro($item, $source['label']);
}
}
$homeurl = ui_get_full_url(false, false, false, false);
$graph_conf = db_get_row('tgraph', 'id_graph', $value['id_graph']);
if($graph_conf['stacked'] == 4 || $graph_conf['stacked'] == 9){
$height = 50;
} else if ($graph_conf['stacked'] == 5){
$height = 200;
} else {
$height = 300;
}
$table .= "CUSTOM GRAPH ".$graph[0]['name']."
";
$table .= graphic_combined_module($modules,
$weights,
$value['time_lapse'],
800,
$height,
'',
'',
0,
0,
0,
$graph_conf['stacked'],
0,
false,
$homeurl,
1,
false,
false,
'white',
array(),
array(),
1,
1,
1,
1,
$labels,
false,
false,
null,
false);
$contador --;
}
break;
case 'dynamic_graph':
$alias = " AND alias like '%".io_safe_output($value['agent'])."%'";
if($value['id_group'] === '0'){
$id_group = "";
} else {
$id_group = " AND id_grupo = ".$value['id_group'];
}
if($value['id_module_group'] === '0'){
$id_module_group = "";
} else {
$id_module_group = " AND id_module_group = ".$value['id_module_group'];
}
if($value['id_tag'] === '0'){
$tag = "";
$id_tag = "";
} else {
$tag = " INNER JOIN ttag_module ON ttag_module.id_agente_modulo = tagente_modulo.id_agente_modulo ";
$id_tag = " AND ttag_module.id_tag = ".$value['id_tag'];
}
$module_name = " AND nombre like '%".io_safe_output($value['module'])."%'";
$id_agent_module = db_get_all_rows_sql("SELECT tagente_modulo.id_agente_modulo FROM tagente_modulo
". $tag . "WHERE 1=1" . $id_module_group . $module_name .
" AND id_agente IN (SELECT id_agente FROM tagente WHERE 1=1" .$alias.$id_group.")"
. $id_tag);
foreach ($id_agent_module as $key2 => $value2) {
if ($contador > 0) {
$sql_modulo2 = db_get_all_rows_sql("SELECT nombre, id_agente FROM
tagente_modulo WHERE id_agente_modulo = ". $value2['id_agente_modulo']);
$sql_alias2 = db_get_all_rows_sql("SELECT alias from tagente
WHERE id_agente = ". $sql_modulo2[0]['id_agente']);
$table .= "AGENT " .$sql_alias2[0]['alias']." MODULE ".$sql_modulo2[0]['nombre']."
";
$table .= grafico_modulo_sparse(
$value2['id_agente_modulo'],
$value['time_lapse'],
0,
800,
300,
'',
'',
false,
$value['only_average'],
false,
0,
'',
0,
0,
1,
false,
ui_get_full_url(false, false, false, false),
1,
false,
0,
false,
false,
1,
'white',
null,
false,
false,
'area');
$contador --;
}
}
break;
}
}
$table .= "";
echo $table;
return;
}
}
?>