$fname, 'filter_type' => $ftype ]); if ($new_id) { header("Location: editfilter.php?id=$new_id"); exit; } } header("Location: " . $_SERVER["REQUEST_URI"]); exit; } // Удаление фильтров if (getPOST("remove") !== null) { $fid = getPOST("fid", null, []); if (!empty($fid) && is_array($fid)) { foreach ($fid as $val) { $val = trim($val); if ($val === '') continue; // Удаляем из связей delete_records($db_link, "group_filters", "filter_id = ?", [(int)$val]); // Удаляем сам фильтр delete_record($db_link, "filter_list", "id = ?", [(int)$val]); } } header("Location: " . $_SERVER["REQUEST_URI"]); exit; } unset($_POST); require_once($_SERVER['DOCUMENT_ROOT'] . "/inc/header.php"); print_filters_submenu($page_url); ?>
\n"; print "\n"; print "\n"; print "\n"; // Инициализация пустых полей $row['description'] = $row['description'] ?? ''; $row['proto'] = $row['proto'] ?? ''; $row['dst'] = $row['dst'] ?? ''; $row['dstport'] = $row['dstport'] ?? ''; $row['srcport'] = $row['srcport'] ?? ''; if ($row['filter_type'] == 0) { // === Формирование отображения dst / ipset === $dst_display = ''; if (!empty($row['ipset_id']) && !empty($row['ipset_name'])) { // Режим IPSet: показываем имя с ссылкой на редактирование $dst_display = '' . '' . '📦 ' . htmlspecialchars($row['ipset_name']) . ''; } elseif (!empty($row['dst'])) { // Режим прямого IP: показываем dst $dst_display = htmlspecialchars($row['dst']); } else { // Пустое значение $dst_display = '0/0'; } print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; } else { // Name фильтр (упрощённый режим) $dst_display = ''; if (!empty($row['ipset_id']) && !empty($row['ipset_name'])) { $dst_display = '' . '' . '📦 ' . htmlspecialchars($row['ipset_name']) . ''; } elseif (!empty($row['dst'])) { $dst_display = htmlspecialchars($row['dst']); } else { $dst_display = ''; } print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; print "\n"; } print ""; } ?>
id
" . $row['id'] . "" . htmlspecialchars($row['name']) . "IP фильтр" . htmlspecialchars($row['proto']) . "" . $dst_display . "" . htmlspecialchars($row['dstport']) . "" . htmlspecialchars($row['srcport']) . "" . htmlspecialchars($row['description']) . "Name фильтр" . $dst_display . "" . htmlspecialchars($row['description']) . "