$id) { $id = (int)$id; if ($id <= 0 || !isset($selected_set[$id])) continue; $name = trim($names[$i] ?? ''); if ($name === '') continue; update_record($db_link, "queue_list", "id = ?", [ 'queue_name' => $name, 'download' => (int)($downs[$i] ?? 0), 'upload' => (int)($ups[$i] ?? 0) ], [$id]); } } header("Location: " . $_SERVER["REQUEST_URI"]); exit; } // Удаление отмеченных if (getPOST("remove") !== null) { $f_id = getPOST("f_id", null, []); if (!empty($f_id) && is_array($f_id)) { foreach ($f_id as $id) { $id = (int)$id; if ($id > 0) { delete_record($db_link, "queue_list", "id = ?", [$id]); } } } header("Location: " . $_SERVER["REQUEST_URI"]); exit; } // Создание новой очереди if (getPOST("create") !== null) { $queue_name = trim(getPOST("new_queue", null, '')); if ($queue_name !== '') { insert_record($db_link, "queue_list", ['queue_name' => $queue_name]); } header("Location: " . $_SERVER["REQUEST_URI"]); exit; } unset($_POST); require_once ($_SERVER['DOCUMENT_ROOT']."/inc/header.php"); ?>