2012-10-08 Ramon Novoa <rnovoa@artica.es>

* include/functions_graph.php,
	  include/functions_html.php,
	  include/graphs/fgraph.php,
	  include/functions_ui.php,
	  include/functions_netflow.php,
	  operation/netflow/nf_live_view.php,
	  operation/netflow/nf_view.php,
	  godmode/netflow/nf_item_list.php,
	  godmode/netflow/nf_report_item.php: Small improvements and fixes.
	  Added support for PDF netflow reports (enterprise only).



git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@7052 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
ramonn 2012-10-08 19:19:58 +00:00
parent ff3515d2a2
commit 57cedf5d55
10 changed files with 132 additions and 85 deletions

View File

@ -1,3 +1,16 @@
2012-10-08 Ramon Novoa <rnovoa@artica.es>
* include/functions_graph.php,
include/functions_html.php,
include/graphs/fgraph.php,
include/functions_ui.php,
include/functions_netflow.php,
operation/netflow/nf_live_view.php,
operation/netflow/nf_view.php,
godmode/netflow/nf_item_list.php,
godmode/netflow/nf_report_item.php: Small improvements and fixes.
Added support for PDF netflow reports (enterprise only).
2012-10-07 Sancho Lerena <slerena@artica.es>
* pandoradb.sql: Deleted index on utimestamp for tevento. This

View File

@ -35,17 +35,17 @@ if (! check_acl ($config["id_user"], 0, "IW")) {
$id = (int)get_parameter('id');
$buttons['report_list']['active'] = false;
$buttons['report_list'] = '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_report">'
$buttons['report_list'] = '<a href="' . $config['homeurl'] . 'index.php?sec=netf&sec2=' . $config['homedir'] . '/godmode/netflow/nf_report">'
. html_print_image ("images/edit.png", true, array ("title" => __('Report list')))
. '</a>';
$buttons['report_items']['active'] = true;
$buttons['report_items']['text'] = '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$id.'">'
$buttons['report_items']['text'] = '<a href="' . $config['homeurl'] . 'index.php?sec=netf&sec2=' . $config['homedir'] . '/godmode/netflow/nf_item_list&id='.$id.'">'
. html_print_image ("images/god6.png", true, array ("title" => __('Report items')))
. '</a>';
$buttons['edit_report']['active'] = false;
$buttons['edit_report']['text'] = '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_report_form&id='.$id.'">'
$buttons['edit_report']['text'] = '<a href="' . $config['homeurl'] . 'index.php?sec=netf&sec2=' . $config['homedir'] . '/godmode/netflow/nf_report_form&id='.$id.'">'
. html_print_image ("images/config.png", true, array ("title" => __('Edit report')))
. '</a>';
@ -187,18 +187,18 @@ foreach ($reports_item as $item) {
}
else if (($item['id_rc'] == $first_item) && ($item['id_rc'] != $last_item)){
$data[0] = '<span style="display: block; float: left; width: 16px;">&nbsp;</span>';
$data[0] .= '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=down&id_rc='.$item['id_rc'].'">' . html_print_image("images/down.png", true, array("title" => __('Move to down'))) . '</a>';
$data[0] .= '<a href="' . $config['homeurl'].'index.php?sec=netf&sec2=' . $config['homedir'].'/godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=down&id_rc='.$item['id_rc'].'">' . html_print_image("images/down.png", true, array("title" => __('Move to down'))) . '</a>';
}
else if (($item['id_rc'] == $last_item) && ($item['id_rc'] != $first_item)){
$data[0] = '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=up&id_rc='.$item['id_rc'].'">' . html_print_image("images/up.png", true, array("title" => __('Move to up'))) . '</a>';
$data[0] = '<a href="' . $config['homeurl'].'index.php?sec=netf&sec2=' . $config['homedir'].'/godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=up&id_rc='.$item['id_rc'].'">' . html_print_image("images/up.png", true, array("title" => __('Move to up'))) . '</a>';
}
else {
$data[0] = '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=up&id_rc='.$item['id_rc'].'">' . html_print_image("images/up.png", true, array("title" => __('Move to up'))) . '</a>';
$data[0] .= '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=down&id_rc='.$item['id_rc'].'">' . html_print_image("images/down.png", true, array("title" => __('Move to down'))) . '</a>';
$data[0] = '<a href="' . $config['homeurl'].'index.php?sec=netf&sec2=' . $config['homedir'].'/godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=up&id_rc='.$item['id_rc'].'">' . html_print_image("images/up.png", true, array("title" => __('Move to up'))) . '</a>';
$data[0] .= '<a href="' . $config['homeurl'].'index.php?sec=netf&sec2=' . $config['homedir'].'/godmode/netflow/nf_item_list&id='.$item['id_report'].'&order=1&dir=down&id_rc='.$item['id_rc'].'">' . html_print_image("images/down.png", true, array("title" => __('Move to down'))) . '</a>';
}
$name_filter = db_get_value('id_name', 'tnetflow_filter', 'id_sg', $item['id_filter']);
$data[1] = '<a href="index.php?sec=netf&sec2=godmode/netflow/nf_report_item&id='.$item['id_report'].'&id_rc='.$item['id_rc'].'">'.$name_filter.'</a>';
$data[1] = '<a href="' . $config['homeurl'] . 'index.php?sec=netf&sec2=' . $config['homedir'] . '/godmode/netflow/nf_report_item&id='.$item['id_report'].'&id_rc='.$item['id_rc'].'">'.$name_filter.'</a>';
$data[2] = $item['max'];
@ -221,7 +221,7 @@ foreach ($reports_item as $item) {
}
$data[4] = "<a onclick='if(confirm(\"" . __('Are you sure?') . "\")) return true; else return false;'
href='index.php?sec=netf&sec2=godmode/netflow/nf_item_list&delete=1&id_rc=".$item['id_rc']."&id=".$id."&offset=0'>" .
href='" . $config['homeurl'] . "index.php?sec=netf&sec2=" . $config['homedir'] . "/godmode/netflow/nf_item_list&delete=1&id_rc=".$item['id_rc']."&id=".$id."&offset=0'>" .
html_print_image('images/cross.png', true, array('title' => __('Delete'))) . "</a>" .
html_print_checkbox_extended ('delete_multiple[]', $item['id_rc'], false, false, '', 'class="check_delete"', true);
@ -229,11 +229,7 @@ foreach ($reports_item as $item) {
}
if (isset($data)) {
if (! defined ('METACONSOLE')) {
echo '<form method="post" action="index.php?sec=netf&sec2=godmode/netflow/nf_item_list&id='.$id.'">';
} else {
echo '<form method="post" action="' . ui_get_full_url(false) . 'enterprise/meta/index.php?sec=netf&sec2=' . $config['homedir'] . '/godmode/netflow/nf_item_list&id='.$id.'">';
}
echo '<form method="post" action="' . $config['homeurl'] . 'index.php?sec=netf&sec2="' . $config['homedir'] . '/godmode/netflow/nf_item_list&id='.$id.'">';
html_print_input_hidden('multiple_delete', 1);
html_print_table ($table);
echo "<div style='padding-bottom: 20px; text-align: right; width:" . $table->width . "'>";

View File

@ -157,7 +157,7 @@ foreach($groups_user as $key => $groups){
$sql = "SELECT * FROM tnetflow_filter WHERE id_group IN (".implode(',',$groups_id).")";
$table->data[0][0] = '<b>'.__('Filter').'</b>';
$table->data[0][1] = html_print_select_from_sql($sql, 'id_filter', $name_filter, '', '', 0, true);
$table->data[0][1] = html_print_select_from_sql($sql, 'id_filter', $id_filter, '', '', 0, true);
$table->data[1][0] = '<b>'.__('Max. values').'</b>';
$max_values = array ('2' => '2',
@ -189,4 +189,4 @@ else {
}
echo '</div>';
echo '</form>';
?>
?>

View File

@ -2661,7 +2661,7 @@ function grafico_modulo_boolean ($agent_module_id, $period, $show_events,
* Print an area graph with netflow aggregated
*/
function graph_netflow_aggregate_area ($data, $period, $width, $height, $only_image) {
function graph_netflow_aggregate_area ($data, $period, $width, $height, $unit = '', $ttl = 1, $only_image = false) {
global $config;
global $graphic_type;
@ -2726,7 +2726,7 @@ function graph_netflow_aggregate_area ($data, $period, $width, $height, $only_im
return area_graph($flash_chart, $chart, $width, $height, $color, $legend,
$long_index, "images/image_problem.opaque.png", "", $unit, $homeurl,
$config['homedir'] . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size'], $unit);
$config['fontpath'], $config['font_size'], $unit, 2);
}
@ -2734,7 +2734,7 @@ function graph_netflow_aggregate_area ($data, $period, $width, $height, $only_im
/**
* Print an area graph with netflow total
*/
function graph_netflow_total_area ($data, $period, $width, $height, $only_image) {
function graph_netflow_total_area ($data, $period, $width, $height, $unit = '', $ttl = 1, $only_image = false) {
global $config;
global $graphic_type;
@ -2783,19 +2783,18 @@ function graph_netflow_total_area ($data, $period, $width, $height, $only_image)
return area_graph($flash_chart, $chart, $width, $height, array (), array (),
array (), ui_get_full_url("images/image_problem.opaque.png"), "", "", $homeurl,
$water_mark,
$config['fontpath'], $config['font_size'], "");
$config['fontpath'], $config['font_size'], $unit, $ttl);
}
/**
* Print a pie graph with netflow aggregated
*/
function graph_netflow_aggregate_pie ($data, $aggregate) {
function graph_netflow_aggregate_pie ($data, $aggregate, $ttl = 1, $only_image = false) {
global $config;
global $graphic_type;
if (empty ($data)) {
echo fs_error_image ();
return;
return fs_error_image ();
}
$i = 0;
@ -2811,10 +2810,15 @@ function graph_netflow_aggregate_pie ($data, $aggregate) {
}
$i++;
}
return pie3d_graph($config['flash_charts'], $values, 320, 200,
$flash_chart = $config['flash_charts'];
if ($only_image) {
$flash_chart = false;
}
return pie3d_graph($flash_chart, $values, 320, 200,
__('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size']);
$config['fontpath'], $config['font_size'], $ttl);
}

View File

@ -999,7 +999,7 @@ function html_print_table (&$table, $return = false) {
$output .= '<table style="' . $styleTable . '" width="'.$table->width.'"'.$table->tablealign;
}
else {
$output .= '<table style="' . $styleTable . '" "'.$table->tablealign;
$output .= '<table style="' . $styleTable . '"'.$table->tablealign;
}
$output .= ' cellpadding="'.$table->cellpadding.'" cellspacing="'.$table->cellspacing.'"';
$output .= ' border="'.$table->border.'" class="'.$table->class.'" id="'.$tableid.'">';

View File

@ -17,6 +17,8 @@
include_once($config['homedir'] . "/include/functions_users.php");
include_once($config['homedir'] . "/include/functions_io.php");
require_once($config['homedir'] . '/enterprise/include/pdf_translator.php');
enterprise_include_once ($config['homedir'] . "/include/functions_io.php");
// Date format for nfdump
$nfdump_date_format = 'Y/m/d.H:i:s';
@ -230,7 +232,7 @@ function netflow_stat_table ($data, $start_date, $end_date, $aggregate, $unit){
$x++;
}
html_print_table($table);
return html_print_table ($table, true);
}
/**
@ -299,7 +301,7 @@ function netflow_data_table ($data, $start_date, $end_date, $aggregate) {
$i++;
}
html_print_table($table);
return html_print_table($table, true);
}
/**
@ -331,7 +333,7 @@ function netflow_summary_table ($data) {
$table->data[5][1] = format_numeric ($data['avgbpp']);
html_print_table($table);
return html_print_table ($table, true);
}
/**
@ -668,11 +670,12 @@ function netflow_get_filter_arguments ($filter) {
* @param array values Array where netflow data will be placed.
* @param string aggregate Aggregate field.
* @param string unit Unit to show.
* @param string interval_length Interval length in seconds (num_intervals * interval_length = start_date - end_date).
*
* @return Timestamp of the last data read.
*
*/
function netflow_parse_file ($start_date, $end_date, $file, &$values, $aggregate = '', $unit = '') {
function netflow_parse_file ($start_date, $end_date, $file, &$values, $aggregate = '', $unit = '', $interval_length = 0) {
global $config;
// Last timestamp read
@ -685,9 +688,14 @@ function netflow_parse_file ($start_date, $end_date, $file, &$values, $aggregate
}
// Calculate the number of intervals
$num_intervals = $config['graph_res'] * 50;
$period = $end_date - $start_date;
$interval_length = (int) ($period / $num_intervals);
if ($interval_length > 0) {
$num_intervals = $config['graph_res'] * 50;
$period = $end_date - $start_date;
$interval_length = (int) ($period / $num_intervals);
} else {
$period = $end_date - $start_date;
$num_intervals = (int) ($period / $interval_length);
}
// Parse the summary and exit
if ($aggregate == '' && $unit == '') {
@ -1002,8 +1010,9 @@ function netflow_get_valid_intervals () {
* @param string unique_id A unique number that is used to generate a cache file.
* @param string output Output format. Only HTML and XML are supported.
*
* @return The netflow report in the appropriate format.
*/
function netflow_draw_item ($start_date, $end_date, $type, $filter, $max_aggregates, $unique_id, $connection_name = '', $output = 'HTML') {
function netflow_draw_item ($start_date, $end_date, $type, $filter, $max_aggregates, $unique_id, $connection_name = '', $output = 'HTML', $only_image = false) {
$aggregate = $filter['aggregate'];
$unit = $filter['output'];
$interval = $end_date - $start_date;
@ -1014,55 +1023,61 @@ function netflow_draw_item ($start_date, $end_date, $type, $filter, $max_aggrega
$data = netflow_get_data ($start_date, $end_date, $filter, $unique_id, $aggregate, $max_aggregates, $unit, $connection_name);
if ($aggregate != 'none') {
if ($output == 'HTML') {
echo graph_netflow_aggregate_area($data, $interval, 660, 320, 0);
return graph_netflow_aggregate_area ($data, $interval, 660, 320, $unit);
} else if ($output == 'PDF') {
return graph_netflow_aggregate_area ($data, $interval, 660, 320, $unit, 2, true);
} else if ($output == 'XML') {
netflow_aggregate_area_xml ($data);
return netflow_aggregate_area_xml ($data);
}
}
else {
if ($output == 'HTML') {
echo graph_netflow_total_area($data, $interval, 660, 320, 0);
return graph_netflow_total_area ($data, $interval, 660, 320, $unit);
} else if ($output == 'PDF') {
return graph_netflow_total_area ($data, $interval, 660, 320, $unit, 2, true);
} else if ($output == 'XML') {
netflow_total_area_xml ($data);
return netflow_total_area_xml ($data);
}
}
break;
case '1':
$data = netflow_get_stats ($start_date, $end_date, $filter, $aggregate, $max_aggregates, $unit, $connection_name);
if ($output == 'HTML') {
echo graph_netflow_aggregate_pie($data, $aggregate);
return graph_netflow_aggregate_pie ($data, $aggregate);
} else if ($output == 'PDF') {
return graph_netflow_aggregate_pie ($data, $aggregate, 2, true);
} else if ($output == 'XML') {
netflow_aggregate_pie_xml ($data);
return netflow_aggregate_pie_xml ($data);
}
break;
case '2':
$data = netflow_get_data ($start_date, $end_date, $filter, $unique_id, $aggregate, $max_aggregates, $unit, $connection_name);
if ($output == 'HTML') {
echo netflow_data_table ($data, $start_date, $end_date, $aggregate);
if ($output == 'HTML' || $output == 'PDF') {
return netflow_data_table ($data, $start_date, $end_date, $aggregate);
} else if ($output == 'XML') {
// Same as netflow_aggregate_area_xml
netflow_aggregate_area_xml ($data);
return netflow_aggregate_area_xml ($data);
}
break;
case '3':
$data = netflow_get_stats ($start_date, $end_date, $filter, $aggregate, $max_aggregates, $unit, $connection_name);
if ($output == 'HTML') {
echo netflow_stat_table ($data, $start_date, $end_date, $aggregate, $unit);
if ($output == 'HTML' || $output == 'PDF') {
return netflow_stat_table ($data, $start_date, $end_date, $aggregate, $unit);
} else if ($output == 'XML') {
netflow_stat_xml ($data);
return netflow_stat_xml ($data);
}
break;
case '4':
$data = netflow_get_summary ($start_date, $end_date, $filter, $unique_id, $connection_name);
if ($output == 'HTML') {
netflow_summary_table ($data);
if ($output == 'HTML' || $output == 'PDF') {
return netflow_summary_table ($data);
} else if ($output == 'XML') {
netflow_summary_xml ($data);
return netflow_summary_xml ($data);
}
break;
default:
if ($output == 'HTML') {
echo fs_error_image();
if ($output == 'HTML' || $output == 'PDF') {
return fs_error_image();
}
break;
}
@ -1128,7 +1143,7 @@ function netflow_xml_report ($id, $start_date, $end_date) {
// Build a unique id for the cache
$unique_id = $report['id_report'] . '_' . $content['id_rc'] . '_' . ($end_date - $start_date);
netflow_draw_item ($start_date, $end_date, $content['show_graph'], $filter, $content['max'], $unique_id, $report['server_name'], 'XML');
echo netflow_draw_item ($start_date, $end_date, $content['show_graph'], $filter, $content['max'], $unique_id, $report['server_name'], 'XML');
echo " </report_item>\n";
}
@ -1176,14 +1191,16 @@ function netflow_aggregate_area_xml ($data) {
function netflow_total_area_xml ($data) {
// Print flow information
echo "<flows>\n";
$xml = "<flows>\n";
foreach ($data as $timestamp => $flow) {
echo "<flow>\n";
echo " <timestamp>" . $timestamp . "</timestamp>\n";
echo " <data>" . $flow['data'] . "</data>\n";
echo "</flow>\n";
$xml .= "<flow>\n";
$xml .= " <timestamp>" . $timestamp . "</timestamp>\n";
$xml .= " <data>" . $flow['data'] . "</data>\n";
$xml .= "</flow>\n";
}
echo "</flows>\n";
$xml .= "</flows>\n";
return $xml;
}
/**
@ -1221,12 +1238,14 @@ function netflow_aggregate_pie_xml ($data) {
function netflow_stat_xml ($data) {
// Print stats
echo "<stats>\n";
$xml .= "<stats>\n";
foreach ($data as $flow) {
echo "<aggregate>" . $flow['agg'] . "</aggregate>\n";
echo "<data>" . $flow['data'] . "</data>\n";
$xml .= "<aggregate>" . $flow['agg'] . "</aggregate>\n";
$xml .= "<data>" . $flow['data'] . "</data>\n";
}
echo "</stats>\n";
$xml .= "</stats>\n";
return $xml;
}
/**
@ -1238,14 +1257,16 @@ function netflow_stat_xml ($data) {
function netflow_summary_xml ($data) {
// Print summary
echo "<summary>\n";
echo " <total_flows>" . $data['totalflows'] . "</total_flows>\n";
echo " <total_bytes>" . $data['totalbytes'] . "</total_bytes>\n";
echo " <total_packets>" . $data['totalbytes'] . "</total_packets>\n";
echo " <average_bps>" . $data['avgbps'] . "</average_bps>\n";
echo " <average_pps>" . $data['avgpps'] . "</average_pps>\n";
echo " <average_bpp>" . $data['avgpps'] . "</average_bpp>\n";
echo "</summary>\n";
$xml = "<summary>\n";
$xml .= " <total_flows>" . $data['totalflows'] . "</total_flows>\n";
$xml .= " <total_bytes>" . $data['totalbytes'] . "</total_bytes>\n";
$xml .= " <total_packets>" . $data['totalbytes'] . "</total_packets>\n";
$xml .= " <average_bps>" . $data['avgbps'] . "</average_bps>\n";
$xml .= " <average_pps>" . $data['avgpps'] . "</average_pps>\n";
$xml .= " <average_bpp>" . $data['avgpps'] . "</average_bpp>\n";
$xml .= "</summary>\n";
return $xml;
}
?>

View File

@ -1845,10 +1845,11 @@ function ui_get_url_refresh ($params = false, $relative = true, $add_post = true
*
* @param mixed $url If provided, it will be added after the index.php, but it is false boolean value, put the homeurl in the url.
* @param boolean $no_proxy To avoid the proxy checks, by default it is false.
* @param boolean $metaconsole_root Set the root to the metaconsole dir if the metaconsole is enabled, true by default.
*
* @return string A full URL in Pandora.
*/
function ui_get_full_url ($url = '', $no_proxy = false, $add_name_php_file = false) {
function ui_get_full_url ($url = '', $no_proxy = false, $add_name_php_file = false, $metaconsole_root = true) {
global $config;
$port = null; // null means 'use the starndard port'
@ -1916,7 +1917,7 @@ function ui_get_full_url ($url = '', $no_proxy = false, $add_name_php_file = fal
$url = $config['homeurl_static'] . '/';
}
if (defined('METACONSOLE')) {
if (defined('METACONSOLE') && $metaconsole_root) {
$url .= 'enterprise/meta/';
}
}
@ -1928,7 +1929,7 @@ function ui_get_full_url ($url = '', $no_proxy = false, $add_name_php_file = fal
$fullurl .= $config['homeurl_static'] . '/';
}
if (defined('METACONSOLE')) {
if (defined('METACONSOLE') && $metaconsole_root) {
$fullurl .= 'enterprise/meta/';
}
}
@ -1943,7 +1944,7 @@ function ui_get_full_url ($url = '', $no_proxy = false, $add_name_php_file = fal
else {
$fullurl .= $config['homeurl_static'] . '/';
if (defined('METACONSOLE')) {
if (defined('METACONSOLE') && $metaconsole_root) {
$fullurl .= 'enterprise/meta/';
}
}

View File

@ -268,8 +268,8 @@ function area_graph($flash_chart, $chart_data, $width, $height, $color, $legend,
$graph['font_size'] = $font_size;
$id_graph = serialize_in_temp($graph, null, $ttl);
return "<img src='".$homeurl."include/graphs/functions_pchart.php?static_graph=1&graph_type=area&ttl=".$ttl."&id_graph=" . $id_graph . "'>";
return "<img src='" . ui_get_full_url (false, false, false, false) . "include/graphs/functions_pchart.php?static_graph=1&graph_type=area&ttl=".$ttl."&id_graph=" . $id_graph . "'>";
}
}
@ -304,7 +304,7 @@ function stacked_area_graph($flash_chart, $chart_data, $width, $height, $color,
$id_graph = serialize_in_temp($graph, null, $ttl);
return "<img src='" . $homeurl . "include/graphs/functions_pchart.php?static_graph=1&graph_type=stacked_area&ttl=".$ttl."&id_graph=" . $id_graph . "' />";
return "<img src='" . ui_get_full_url (false, false, false, false) . "include/graphs/functions_pchart.php?static_graph=1&graph_type=stacked_area&ttl=".$ttl."&id_graph=" . $id_graph . "' />";
}
}

View File

@ -253,7 +253,7 @@ if ($draw != '') {
$unique_id = 'live_view__' . ($end_date - $start_date);
// Draw
netflow_draw_item ($start_date, $end_date, $chart_type, $filter, $max_aggregates, $unique_id, $connection_name);
echo netflow_draw_item ($start_date, $end_date, $chart_type, $filter, $max_aggregates, $unique_id, $connection_name);
}
?>
@ -439,4 +439,4 @@ if ($draw != '') {
}
});
});
</script>
</script>

View File

@ -82,13 +82,20 @@ if (isset ($_GET["xml"])) {
netflow_xml_report ($id, $start_date, $end_date);
return;
}
// Generate a PDF report
else if (isset ($_GET["pdf"])) {
enterprise_include_once ('include/functions_netflow_pdf.php');
header ('Content-type: application/pdf', true);
netflow_pdf_report ($id, $start_date, $end_date);
return;
}
$buttons['report_list'] = '<a href="index.php?sec=netf&sec2=operation/netflow/nf_reporting">'
. html_print_image ("images/edit.png", true, array ("title" => __('Report list')))
. '</a>';
//Header
if (! defined ('METACONSOLE')) {
$buttons['report_list'] = '<a href="index.php?sec=netf&sec2=operation/netflow/nf_reporting">'
. html_print_image ("images/edit.png", true, array ("title" => __('Report list')))
. '</a>';
ui_print_page_header (__('Netflow'), "images/networkmap/so_cisco_new.png", false, "", false, $buttons);
} else {
$nav_bar = array(array('link' => 'index.php?sec=main', 'text' => __('Main')),
@ -123,6 +130,11 @@ echo '<form method="post" action="' . $config['homeurl'] . 'index.php?sec=netf&s
} else {
$table->data[2][1] = '<a title="XML" href="' . $config['homeurl'] . '../../ajax.php?page=' . $config['homedir'] . '/operation/netflow/nf_view&id='.$id."&date=$date&time=$time&period=$period&xml=1\">" . html_print_image("images/database_lightning.png", true) . '</a>';
}
if (defined ('METACONSOLE')) {
$table->data[2][1] .= '&nbsp;&nbsp;<a title="PDF" href="' . $config['homeurl'] . '../../ajax.php?page=' . $config['homedir'] . '/operation/netflow/nf_view&id='.$id."&date=$date&time=$time&period=$period&pdf=1\">" . html_print_image("images/pdf.png", true) . '</a>';
} else if (defined ('PANDORA_ENTERPRISE')) {
$table->data[2][1] .= '&nbsp;&nbsp;<a title="PDF" href="' . $config['homeurl'] . 'ajax.php?page=' . $config['homedir'] . '/operation/netflow/nf_view&id='.$id."&date=$date&time=$time&period=$period&pdf=1\">" . html_print_image("images/pdf.png", true) . '</a>';
}
html_print_table ($table);
@ -168,6 +180,6 @@ foreach ($report_contents as $content_report) {
$unique_id = $report_id . '_' . $content_id . '_' . ($end_date - $start_date);
// Draw
netflow_draw_item ($start_date, $end_date, $type, $filter, $max_aggregates, $unique_id, $connection_name);
echo netflow_draw_item ($start_date, $end_date, $type, $filter, $max_aggregates, $unique_id, $connection_name, 'HTML');
}
?>
?>