$id)); 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) { $result = db_process_sql_delete ('tnetflow_report', array ('id_report' => $id)); 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')); } $own_info = get_user_info ($config['id_user']); // Get group list that user has access $groups_user = users_get_groups ($config['id_user'], "IW", $own_info['is_admin'], true); $groups_id = array(); foreach($groups_user as $key => $groups){ $groups_id[] = $groups['id_grupo']; } $sql = "SELECT * FROM tnetflow_report WHERE id_group IN (".implode(',',$groups_id).")"; $reports = db_get_all_rows_sql($sql); if ($reports === false) $reports = array(); $table->width = '98%'; $table->head = array (); $table->head[0] = __('Report name'); $table->head[1] = __('Description'); $table->head[2] = __('Group'); $table->head[3] = __('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->align[3] = 'center'; $table->size = array (); $table->size[0] = '40%'; $table->size[1] = '30%'; $table->size[2] = '20%'; $table->size[3] = '50px'; $table->data = array (); $total_reports = db_get_all_rows_filter ('tnetflow_report', false, 'COUNT(*) AS total'); $total_reports = $total_reports[0]['total']; //ui_pagination ($total_reports, $url); foreach ($reports as $report) { $data = array (); $data[0] = ''.$report['id_name'].''; $data[1] = $report['description']; $group = db_get_value('nombre','tgrupo', 'id_grupo', $report['id_group']); if ($group == '') $group = 'All'; $data[2] = $group; $data[3] = "" . html_print_image('images/cross.png', true, array('title' => __('Delete'))) . "" . html_print_checkbox_extended ('delete_multiple[]', $report['id_report'], false, false, '', 'class="check_delete"', true); array_push ($table->data, $data); } if (isset($data)) { echo "
"; } else { echo "