' . html_print_image ("images/add.png", true, array ("title" => __('Add filter'))) . ''; //Header ui_print_page_header (__('Manage Netflow Filter'), "images/networkmap/so_cisco_new.png", false, "", true, $buttons); $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()); db_process_sql_begin(); 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) { db_process_sql_rollback(); break; } } if ($result !== false) { db_process_sql_commit(); } if ($result !== false) $result = true; else $result = false; ui_print_result_message ($result, __('Successfully deleted'), __('Not deleted. Error deleting data')); } $filter = array (); $filter['offset'] = (int) get_parameter ('offset'); $filter['limit'] = (int) $config['block_size']; $filters = db_get_all_rows_filter ('tnetflow_filter', $filter); if ($filters === false) $filters = array (); $table->width = '70%'; $table->head = array (); $table->head[0] = __('Name'); $table->head[1] = __('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->align[2] = 'center'; $table->size = array (); $table->size[0] = '90%'; $table->size[1] = '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] = "" . 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 "
"; html_print_input_hidden('multiple_delete', 1); html_print_table ($table); echo "
"; html_print_submit_button(__('Delete'), 'delete_btn', false, 'class="sub delete"'); echo "
"; echo "
"; } else { echo "
".__('There are no defined filters')."
"; } ?>