";
}
echo "";
echo "" .
'' . __('Date') . '' .
" | ";
echo "" .
html_print_input_text ('date', $date, false, 10, 10, true) .
html_print_image ("images/calendar_view_day.png", true,
array("alt" => "calendar",
"onclick" => "scwShow(scwID('text-date'),this);")) .
html_print_input_text ('time', $time, false, 10, 5, true) .
" | ";
echo "" . ''.__('Interval').'' . " | ";
echo "" . html_print_select (netflow_get_valid_intervals (), 'period', $period, '', '', 0, true, false, false) . " | ";
echo "" . ''.__('Resolution') . ui_print_help_tip (__("The interval will be divided in chunks the length of the resolution."), true) . '' . " | ";
echo "" . html_print_select (netflow_get_valid_subintervals (), 'interval_length', $interval_length, '', '', 0, true, false, false) ." | ";
echo "
";
echo "";
echo "" . '' . __('Type') . '' . " | ";
echo "" . html_print_select (netflow_get_chart_types (), 'chart_type', $chart_type,'','',0,true) . " | ";
echo "" . '' . __('Max. values') . '' . " | ";
$max_values = array ('2' => '2',
'5' => '5',
'10' => '10',
'15' => '15',
'20' => '20',
'25' => '25',
'50' => '50');
echo "" . html_print_select ($max_values, 'max_aggregates', $max_aggregates, '', '', 0, true) . " | ";
if (defined ('METACONSOLE')) {
$list_servers = array();
$servers = db_get_all_rows_sql ("SELECT *
FROM tmetaconsole_setup");
if ($servers === false)
$servers = array();
foreach ($servers as $server) {
// If connection was good then retrieve all data server
if (metaconsole_load_external_db ($server)) {
$connection = true;
}
else {
$connection = false;
}
$row = db_get_row('tconfig', 'token', 'activate_netflow');
if ($row['value']) {
$list_servers[$server['server_name']] = $server['server_name'];
}
metaconsole_restore_db();
}
echo "" . ''.__('Connection').'' . " | ";
echo "" . html_print_select($list_servers, 'connection_name', $connection_name, '', '', 0, true, false, false) . " | ";
}
echo "
";
// Read filter type
if ($filter['advanced_filter'] != '') {
$filter_type = 1;
}
else {
$filter_type = 0;
}
echo "";
echo "" .
ui_print_error_message ('Define a name for the filter and click on Save as new filter again', '', true) . " | ";
echo "
";
echo "";
echo "" . ''.__('Name').'' . " | ";
echo "" . html_print_input_text ('name', $filter['id_name'], false, 20, 80, true) . " | ";
$own_info = get_user_info ($config['id_user']);
echo "" . ''.__('Group').'' . " | ";
echo "" . html_print_select_groups($config['id_user'], "IW", $own_info['is_admin'], 'assign_group', $filter['id_group'], '', '', -1, true, false, false) . " | ";
echo "
";
echo "";
if ($netflow_disable_custom_lvfilters) {
echo " | ";
echo " | ";
}
else {
echo "" . ''.__('Filter').'' . " | ";
echo "" .
__('Normal') . ' ' . html_print_radio_button_extended ('filter_type', 0, '', $filter_type, false, 'displayNormalFilter();', 'style="margin-right: 40px;"', true) .
__('Advanced') . ' ' . html_print_radio_button_extended ('filter_type', 1, '', $filter_type, false, 'displayAdvancedFilter();', 'style="margin-right: 40px;"', true) .
" | ";
}
echo "" . ''.__('Load filter').'' . " | ";
$user_groups = users_get_groups ($config['id_user'], "AR", $own_info['is_admin'], true);
$user_groups[0] = 0; //Add all groups.
$sql = "SELECT *
FROM tnetflow_filter
WHERE id_group IN (".implode(',', array_keys ($user_groups)).")";
echo "" . html_print_select_from_sql ($sql, 'filter_id', $filter_id, '', __('none'), 0, true) . " | ";
echo "
";
echo "";
if ($netflow_disable_custom_lvfilters) {
echo " | ";
echo " | ";
}
else {
echo "" . __('Dst Ip'). ui_print_help_tip (__("Destination IP. A comma separated list of destination ip. If we leave the field blank, will show all ip. Example filter by ip: 25.46.157.214,160.253.135.249"), true) . " | ";
echo "" . html_print_input_text ('ip_dst', $filter['ip_dst'], false, 30, 80, true) . " | ";
}
if ($netflow_disable_custom_lvfilters) {
echo " | ";
echo " | ";
}
else {
echo "" . __('Src Ip'). ui_print_help_tip (__("Source IP. A comma separated list of source ip. If we leave the field blank, will show all ip. Example filter by ip: 25.46.157.214,160.253.135.249"), true) . " | ";
echo "" . html_print_input_text ('ip_src', $filter['ip_src'], false, 30, 80, true) . " | ";
}
echo "
";
echo "";
if ($netflow_disable_custom_lvfilters) {
echo " | ";
echo " | ";
}
else {
echo "" . __('Dst Port'). ui_print_help_tip (__("Destination port. A comma separated list of destination ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22: 80,22"), true) . " | ";
echo "" . html_print_input_text ('dst_port', $filter['dst_port'], false, 30, 80, true) . " | ";
}
if ($netflow_disable_custom_lvfilters) {
echo " | ";
echo " | ";
}
else {
echo "" . __('Src Port'). ui_print_help_tip (__("Source port. A comma separated list of source ports. If we leave the field blank, will show all ports. Example filter by ports 80 and 22: 80,22"), true) . " | ";
echo "" . html_print_input_text ('src_port', $filter['src_port'], false, 30, 80, true) . " | ";
}
echo "
";
echo "";
echo "" . ui_print_help_icon ('pcap_filter', true, ui_get_full_url(false, false, false, false)) . " | ";
echo "" . html_print_textarea ('advanced_filter', 4, 40, $filter['advanced_filter'], "style='min-height: 0px; width: 90%;'", true) . " | ";
echo "
";
echo "";
echo "" . ''.__('Aggregate by').''. ui_print_help_icon ('aggregate_by', true, ui_get_full_url(false, false, false, false)) . " | ";
$aggregate_list = array();
$aggregate_list = array ('none' => __('None'), 'proto' => __('Protocol'), 'srcip' =>__('Src Ip Address'), 'dstip' =>__('Dst Ip Address'), 'srcport' =>__('Src Port'), 'dstport' =>__('Dst Port') );
echo "" . html_print_select ($aggregate_list, "aggregate", $filter['aggregate'], '', '', 0, true, false, true, '', false) . " | ";
echo "" . ''.__('Output format').'' . " | ";
$show_output = array ('bytes' => __('Bytes'), 'bytespersecond' => __('Bytes per second'), 'kilobytes' => __('Kilobytes'), 'megabytes' => __('Megabytes'), 'kilobytespersecond' => __('Kilobytes per second'), 'megabytespersecond' => __('Megabytes per second'));
echo "" . html_print_select ($show_output, 'output', $filter['output'], '', '', 0, true, false, true, '', false) . " | ";
echo "
";
echo "
";
echo "