diff --git a/pandora_console/ChangeLog b/pandora_console/ChangeLog index 0051bfe834..c68d0aff4e 100644 --- a/pandora_console/ChangeLog +++ b/pandora_console/ChangeLog @@ -1,3 +1,8 @@ +2011-12-30 Vanessa Gil + * godmode/netflow/nf_report_item.php + godmode/netflow/nf_item_list.php + operation/netflow/nf_view: Changed the report date and interval. + 2011-12-30 Vanessa Gil * godmode/netflow/nf_edit.php godmode/netflow/nf_item_list.php: Cascade delete filters. diff --git a/pandora_console/godmode/netflow/nf_item_list.php b/pandora_console/godmode/netflow/nf_item_list.php index 13c0619891..2b96693661 100644 --- a/pandora_console/godmode/netflow/nf_item_list.php +++ b/pandora_console/godmode/netflow/nf_item_list.php @@ -138,13 +138,11 @@ $total_reports_item = $total_reports_item[0]['total']; $data[1] = $item['id_filter']; - $data[2] = $item['period']; + $data[2] = $item['max']; - $data[3] = $item['max']; + $data[3] = $item['show_graph']; - $data[4] = $item['show_graph']; - - $data[5] = "" . html_print_image('images/cross.png', true, array('title' => __('Delete'))) . "" . html_print_checkbox_extended ('delete_multiple[]', $item['id_rc'], false, false, '', 'class="check_delete"', true); diff --git a/pandora_console/godmode/netflow/nf_report_item.php b/pandora_console/godmode/netflow/nf_report_item.php index c9bd38c38e..223916a3b9 100644 --- a/pandora_console/godmode/netflow/nf_report_item.php +++ b/pandora_console/godmode/netflow/nf_report_item.php @@ -49,37 +49,24 @@ ui_print_page_header (__('Netflow Report'), "images/networkmap/so_cisco_new.png" if ($id_rc) { $item = netflow_reports_get_content ($id_rc); - $date = $item['date']; - $period = $item['period']; $name_filter = $item['id_filter']; $max_val = $item['max']; $show_graph = $item['show_graph']; } else { - $date = ''; - $period =''; $name_filter = ''; $max_val = ''; $show_graph = ''; } if ($update) { - $date = get_parameter_post ('date'); - $time = get_parameter_post ('time'); - $period = get_parameter ('period'); $name_filter = get_parameter('id_filter'); $max_val = get_parameter('max','2'); $show_graph = get_parameter('show_graph',''); - - $date = str_replace('-','/',$date); - $timedate = $date .".".$time; - $date_time = strtotime ($date." ".$time); $result = db_process_sql_update ('tnetflow_report_content', array ( 'id_report' => $id, 'id_filter' => $name_filter, - 'date' => $date_time, - 'period' => $period, 'max' => $max_val, 'show_graph' => $show_graph ), @@ -91,22 +78,13 @@ if ($update) { } if ($create){ - $date = get_parameter_post ('date'); - $time = get_parameter_post ('time'); - $period = get_parameter ('period'); $name_filter = get_parameter('id_filter'); $max_val = get_parameter('max','2'); $show_graph = get_parameter('show_graph',''); - $date = str_replace('-','/',$date); - $timedate = $date .".".$time; - $date_time = strtotime ($date." ".$time); - $values = array ( 'id_report' => $id, 'id_filter' => $name_filter, - 'date' => $date_time, - 'period' => $period, 'max' => $max_val, 'show_graph' => $show_graph ); @@ -118,7 +96,7 @@ if ($create){ echo '

'.__ ('Item created successfully').'

'; } -$table->width = '80%'; +$table->width = '70%'; $table->border = 0; $table->cellspacing = 3; $table->cellpadding = 5; @@ -127,42 +105,14 @@ $table->style[0] = 'vertical-align: top;'; $table->data = array (); -$table->data[0][0] = ''.__('Date').''; - -$table->data[0][1] = html_print_input_text ('date', date ("Y/m/d", get_system_time () - 86400), false, 10, 10, true); -$table->data[0][1] .= html_print_image ("images/calendar_view_day.png", true, array ("alt" => "calendar", "onclick" => "scwShow(scwID('text-date'),this);")); -$table->data[0][1] .= html_print_input_text ('time', date ("H:i:s", get_system_time () - 86400), false, 10, 5, true); - -$table->data[1][0] = ''.__('Interval').''; - $values_period = array ('600' => __('10 mins'), - '900' => __('15 mins'), - '1800' => __('30 mins'), - '3600' => __('1 hour'), - '7200' => __('2 hours'), - '18000' => __('5 hours'), - '43200' => __('12 hours'), - '86400' => __('1 day'), - '172800' => __('2 days'), - '432000' => __('5 days'), - '1296000' => __('15 days'), - '604800' => __('Last week'), - '2592000' => __('Last month'), - '5184000' => __('2 months'), - '7776000' => __('3 months'), - '15552000' => __('6 months'), - '31104000' => __('Last year'), - '62208000' => __('2 years') - ); -$table->data[1][1] = html_print_select ($values_period, 'period', $period, '', '', 0, true, false, false); - $filters = netflow_get_filters (); if ($filters === false) { $filters = array (); } -$table->data[2][0] = ''.__('Filters').''; -$table->data[2][1] = html_print_select($filters, 'id_filter', $name_filter, '', '', 0, true); +$table->data[0][0] = ''.__('Filters').''; +$table->data[0][1] = html_print_select($filters, 'id_filter', $name_filter, '', '', 0, true); -$table->data[3][0] = ''.__('Max values aggregated').''; +$table->data[1][0] = ''.__('Max values aggregated').''; $max_values = array ('2' => '2', '5' => '5', '10' => '10', @@ -171,9 +121,9 @@ $table->data[3][0] = ''.__('Max values aggregated').''; '25' => '25', '50' => '50' ); -$table->data[3][1] = html_print_select ($max_values, 'max', $max_val, '', '', 0, true); +$table->data[1][1] = html_print_select ($max_values, 'max', $max_val, '', '', 0, true); -$table->data[4][0] = ''.__('Elements').''; +$table->data[2][0] = ''.__('Elements').''; $show_graph_options = Array(); $show_graph_options[0] = __('Area graph'); @@ -181,7 +131,7 @@ $show_graph_options[1] = __('Pie graph'); $show_graph_options[2] = __('Table values'); $show_graph_options[3] = __('Total period'); -$table->data[4][1] = html_print_select ($show_graph_options, 'show_graph', $show_graph,'','',0,true); +$table->data[2][1] = html_print_select ($show_graph_options, 'show_graph', $show_graph,'','',0,true); echo '
'; html_print_table ($table); diff --git a/pandora_console/index.php b/pandora_console/index.php index 671fe7b289..05e50b03cd 100644 --- a/pandora_console/index.php +++ b/pandora_console/index.php @@ -21,7 +21,7 @@ if (function_exists ('mb_internal_encoding')) { // Set to 1 to do not check for installer or config file (for development!). // Activate gives more error information, not useful for production sites -$develop_bypass = 1; +$develop_bypass = 0; if ($develop_bypass != 1) { // If no config file, automatically try to install diff --git a/pandora_console/operation/netflow/nf_view.php b/pandora_console/operation/netflow/nf_view.php index e488de9451..892f349eeb 100644 --- a/pandora_console/operation/netflow/nf_view.php +++ b/pandora_console/operation/netflow/nf_view.php @@ -153,8 +153,9 @@ function exec_command_aggregate ($start_date, $end_date, $command, $show){ $id = get_parameter('id'); -$period = get_parameter('period'); - +$period = get_parameter('period', '86400'); +$date_= get_parameter('date', date ("Y/m/d", get_system_time ())); +$time_= get_parameter('time', date ("H:i:s", get_system_time ())); $report_name = db_get_value('id_name', 'tnetflow_report', 'id_report', $id); $time_format = 'Y/m/d.H:i:s'; @@ -183,9 +184,9 @@ echo 'data[0][1] = html_print_input_text ('date', $date_, false, 10, 10, true); $table->data[0][1] .= html_print_image ("images/calendar_view_day.png", true, array ("alt" => "calendar", "onclick" => "scwShow(scwID('text-date'),this);")); - $table->data[0][1] .= html_print_input_text ('time', date ("H:i:s", get_system_time () - 86400), false, 10, 5, true); + $table->data[0][1] .= html_print_input_text ('time', $time_, false, 10, 5, true); $table->data[1][0] = ''.__('Interval').''; $values_period = array ('600' => __('10 mins'), @@ -208,7 +209,6 @@ echo ''; @@ -231,22 +231,20 @@ if ($id!=''){ $content_report = db_get_row_sql($sql); $name_filter = $content_report['id_filter']; - $interval = $content_report['period']; - $date = $content_report['date']; $max_val= $content_report['max']; $element = $content_report['show_graph']; - $date_time = date($time_format, $date+84600); - + if($update_date){ $date = get_parameter_post ('date'); $time = get_parameter_post ('time'); - $period = get_parameter('period','0'); - $date = strtotime ($date." ".$time); - - if(($period!='None')&&($period!='0')) - $interval = $period; + $interval = get_parameter('period','86400'); + } else { + $date = date ("Y/m/d", get_system_time ()); + $time = date ("H:i:s", get_system_time ()); + $interval ='86400'; } - + $date = strtotime ($date." ".$time); + $date_time = date($time_format, $date); $limit = $date - $interval; $date_limit = date ($time_format, $limit); @@ -401,14 +399,14 @@ if ($id!=''){ } } -if ($show_packets) - $show = 'packets'; -if ($show_bytes) - $show = 'bytes'; -if ($show_bps) - $show = 'bps'; -if ($show_bpp) - $show = 'bpp'; + if ($show_packets) + $show = 'packets'; + if ($show_bytes) + $show = 'bytes'; + if ($show_bps) + $show = 'bps'; + if ($show_bpp) + $show = 'bpp'; //create interval to divide command execution if ($interval<43200) @@ -468,11 +466,8 @@ if ($show_bpp) } $j++; } - - } if($aggregate!='none'){ - switch ($element){ case '0': echo grafico_netflow_aggregate_area($result, $interval, 880, 540, '', '','','',$date);