'index.php?sec=main', 'text' => __('Main')), array('link' => 'index.php?sec=netf&sec2=godmode/netflow/nf_edit', 'text' => __('Netflow filters'))); ui_meta_print_page_header($nav_bar); ui_meta_print_header(__("Netflow filters")); } $delete = (bool) get_parameter ('delete'); $multiple_delete = (bool)get_parameter('multiple_delete', 0); $id = (int) get_parameter ('id'); $name = (string) get_parameter ('name'); if ($delete) { $id_filter = db_get_value('id_name', 'tnetflow_filter', 'id_sg', $id); $result = db_process_sql_delete ('tnetflow_filter', array ('id_sg' => $id)); $result2 = db_process_sql_delete ('tnetflow_report_content', array ('id_filter' => $id_filter)); if ($result !== false) { $result = true; } else { $result = false; } ui_print_result_message ($result, __('Successfully deleted'), __('Not deleted. Error deleting data')); } if ($multiple_delete) { $ids = (array)get_parameter('delete_multiple', array()); foreach ($ids as $id) { $id_filter = db_get_value('id_name', 'tnetflow_filter', 'id_sg', $id); $result = db_process_sql_delete ('tnetflow_filter', array ('id_sg' => $id)); $result2 = db_process_sql_delete ('tnetflow_report_content', array ('id_filter' => $id_filter)); if ($result === false) { break; } } if ($result !== false) $result = true; else $result = false; ui_print_result_message ($result, __('Successfully deleted'), __('Not deleted. Error deleting data')); } $own_info = get_user_info ($config['id_user']); // Get group list that user has access $groups_user = users_get_groups ($config['id_user'], "AW", $own_info['is_admin'], true); $sql = "SELECT * FROM tnetflow_filter WHERE id_group IN (0, ".implode(',', array_keys ($groups_user)).")"; $filters = db_get_all_rows_sql($sql); if ($filters === false) $filters = array (); $table->width = '100%'; $table->class = 'databox data'; $table->head = array (); $table->head[0] = __('Name'); $table->head[1] = __('Group'); $table->head[2] = __('Action') . html_print_checkbox('all_delete', 0, false, true, false, 'check_all_checkboxes();'); $table->style = array (); $table->style[0] = 'font-weight: bold'; $table->align = array (); $table->size = array (); $table->size[0] = '60%'; $table->size[1] = '30%'; $table->size[2] = '80px'; $table->data = array (); $total_filters = db_get_all_rows_filter ('tnetflow_filter', false, 'COUNT(*) AS total'); $total_filters = $total_filters[0]['total']; //ui_pagination ($total_filters, $url); foreach ($filters as $filter) { $data = array (); $data[0] = ''.$filter['id_name'].''; $data[1] = ui_print_group_icon($filter['id_group'], true, "groups_small", '', !defined('METACONSOLE')); $data[2] = "" . html_print_image('images/cross.png', true, array('title' => __('Delete'))) . "" . html_print_checkbox_extended ('delete_multiple[]', $filter['id_sg'], false, false, '', 'class="check_delete"', true); array_push ($table->data, $data); } if (isset($data)) { echo "
"; } else { ui_print_info_message ( array('no_close'=>true, 'message'=> __('There are no defined filters') ) ); } echo '"; enterprise_hook('close_meta_frame'); ?>