2011-12-21 Vanessa Gil <vanessa.gil@artica.es>

* operation/netflow/nf_view.php
	  godmode/netflow/nf_report_item.php
	  godmode/netflow/nf_report.php: Allow repeat filters
	  in reports.


git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5293 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
vgilc 2011-12-21 17:14:41 +00:00
parent ddf147ddbd
commit d15dfd4b82
7 changed files with 34 additions and 38 deletions

View File

@ -1,3 +1,9 @@
2011-12-21 Vanessa Gil <vanessa.gil@artica.es>
* operation/netflow/nf_view.php
godmode/netflow/nf_report_item.php
godmode/netflow/nf_report.php: Allow repeat filters
in reports.
2011-12-21 Vanessa Gil <vanessa.gil@artica.es>
* godmode/netflow/nf_edit.php
godmode/netflow/nf_edit_form.php

View File

@ -98,7 +98,7 @@ $reports_item = db_get_all_rows_sql('
WHERE id_report = ' . $id);
if ($reports_item === false)
$filter = array ();
$reports_item = array ();
$table->width = '90%';
$table->head = array ();

View File

@ -86,7 +86,7 @@ $filter['limit'] = (int) $config['block_size'];
$reports = db_get_all_rows_filter ('tnetflow_report', $filter);
if ($reports === false)
$filter = array ();
$reports = array();
$table->width = '80%';
$table->head = array ();
@ -148,10 +148,6 @@ echo '<form method="post" action="index.php?sec=netf&sec2=godmode/netflow/nf_rep
<script type="text/javascript">
$(document).ready (function () {
$("textarea").TextAreaResizer ();
});
function check_all_checkboxes() {
if ($("input[name=all_delete]").attr('checked')) {
$(".check_delete").attr('checked', true);

View File

@ -102,33 +102,22 @@ if ($create){
$timedate = $date .".".$time;
$date_time = strtotime ($date." ".$time);
$sql1 = "select id_filter from tnetflow_report_content where id_report='".$id."'";
$filters_aux = db_get_all_rows_sql($sql1);
$exist = false;
foreach($filters_aux as $filter_aux){
if ($name_filter == $filter_aux['id_filter']){
$exist = true;
echo '<h3 class="error">'.__ ('Error creating item. Filter already exists.').'</h3>';
break;
}
}
if (!$exist){
$values = array (
'id_report' => $id,
'id_filter' => $name_filter,
'date' => $date_time,
'period' => $period,
'max' => $max_val,
'show_graph' => $show_graph
$values = array (
'id_report' => $id,
'id_filter' => $name_filter,
'date' => $date_time,
'period' => $period,
'max' => $max_val,
'show_graph' => $show_graph
);
$result = db_process_sql_insert('tnetflow_report_content', $values);
$result = db_process_sql_insert('tnetflow_report_content', $values);
if ($result === false)
echo '<h3 class="error">'.__ ('Error creating item').'</h3>';
else
echo '<h3 class="suc">'.__ ('Item created successfully').'</h3>';
echo '<h3 class="error">'.__ ('Error creating item').'</h3>';
else
echo '<h3 class="suc">'.__ ('Item created successfully').'</h3>';
}
}
$table->width = '80%';
$table->border = 0;
$table->cellspacing = 3;

View File

@ -2027,7 +2027,7 @@ echo"<h4>Gráfica de área</h4>";
$aggs[$data[$i]['agg']] = $data[$i]['agg'];
}
// Read data that falls in the current interval
while (isset ($data[$j])) {
while(isset ($data[$j])) {
$ag = $data[$j]['agg'];
$date = $data[$j]['date'];
@ -2056,7 +2056,9 @@ echo"<h4>Gráfica de área</h4>";
// Average
if ($count > 0) {
$chart[$timestamp_short][$ag] = $chart[$timestamp_short][$ag]/$count;
if (isset($chart[$timestamp_short][$ag])){
$chart[$timestamp_short][$ag] = $chart[$timestamp_short][$ag]/$count;
}
} else {
$chart[$timestamp_short][$ag] = 0;
}
@ -2235,7 +2237,6 @@ function grafico_netflow_aggregate_pie ($data) {
}
$i++;
}
html_debug_print($values);
return pie3d_graph($config['flash_charts'], $values, 320, 200,
__('Other'), '', $config['homedir'] . "/images/logo_vertical_water.png",
$config['fontpath'], $config['font_size']);

View File

@ -39,6 +39,9 @@ $filter['offset'] = (int) get_parameter ('offset');
$filter['limit'] = (int) $config['block_size'];
$reports = db_get_all_rows_filter ('tnetflow_report', $filter);
if ($reports == false){
$reports = array();
}
$table->width = '98%';
$table->head = array ();

View File

@ -220,13 +220,14 @@ echo'</form>';
if ($id!=''){
echo"<h3>$report_name</h3>";
$sql1 = "select id_filter from tnetflow_report_content where id_report='".$id."'";
$all_filters = db_get_all_rows_sql($sql1);
$sql1 = "select id_rc from tnetflow_report_content where id_report='".$id."'";
$all_rcs = db_get_all_rows_sql($sql1);
$x = 0;
while(isset($all_filters[$x]['id_filter'])) {
$filter = $all_filters[$x]['id_filter'];
$sql = "SELECT * FROM tnetflow_report_content WHERE id_report='".$id."' and id_filter='".$filter."'";
while(isset($all_rcs[$x]['id_rc'])) {
$rc = $all_rcs[$x]['id_rc'];
$sql = "SELECT * FROM tnetflow_report_content WHERE id_rc='".$rc."'";
$content_report = db_get_row_sql($sql);
$name_filter = $content_report['id_filter'];