trim(getPOST("f_group_name", null, $group['group_name'])), 'instance_id' => (int)getPOST("f_instance_id", null, 1), 'description' => trim(getPOST("f_group_description", null, '')) ]; update_record($db_link, "group_list", "id = ?", $new, [$id]); header("Location: " . $_SERVER["REQUEST_URI"]); exit; } // Добавление фильтра в группу if (getPOST("addfilter") !== null) { $filter_id = (int)getPOST("newfilter", null, 0); if ($filter_id > 0) { $max_record = get_record_sql($db_link, "SELECT MAX(G.rule_order) as morder FROM group_filters AS G WHERE G.group_id = ?", [$id]); $forder = (!empty($max_record) && isset($max_record['morder'])) ? ((int)$max_record['morder'] + 1) : 1; $new = [ 'group_id' => $id, 'filter_id' => $filter_id, 'rule_order' => $forder, 'action' => 1 ]; insert_record($db_link, "group_filters", $new); } header("Location: " . $_SERVER["REQUEST_URI"]); exit; } // Удаление фильтров из группы if (getPOST("removefilter") !== null) { $f_group_filter = getPOST("f_group_filter", null, []); if (!empty($f_group_filter) && is_array($f_group_filter)) { foreach ($f_group_filter as $val) { $val = trim($val); if ($val !== '') { delete_record($db_link, "group_filters", "id = ?", [(int)$val]); } } } header("Location: " . $_SERVER["REQUEST_URI"]); exit; } // Обновление порядка и действий фильтров if (getPOST("updateFilters") !== null) { $f_group_filter = getPOST("f_group_filter", null, []); if (!empty($f_group_filter) && is_array($f_group_filter)) { $f_ord = getPOST("f_ord", null, []); $f_action = getPOST("f_action", null, []); LOG_DEBUG($db_link, "Update filters for group id: " . $id); foreach ($f_group_filter as $i => $group_filter_id) { $group_filter_id = (int)$group_filter_id; if ($group_filter_id <= 0) continue; $new = [ 'rule_order' => isset($f_ord[$group_filter_id]) ? (int)$f_ord[$group_filter_id] : $i, 'action' => isset($f_action[$group_filter_id]) ? (int)$f_action[$group_filter_id] : 0 ]; update_record($db_link, "group_filters", "id = ?", $new, [$group_filter_id]); } } header("Location: " . $_SERVER["REQUEST_URI"]); exit; } unset($_POST); print_filters_submenu($page_url); require_once($_SERVER['DOCUMENT_ROOT'] . "/inc/header.php"); ?>


>


\n"; print "\n"; print "\n"; print "\n"; $cl = "data"; if ($row['action']) { $cl = "up"; } else { $cl = "warn"; } print ""; print "\n"; print ""; } ?>
" . $row['name'] . ""; print_action_select('f_action[' . $row['id'] . ']', $row['action']); print "" . $row['description'] . "