prepare($sql); $stmt->bind_param("i", $id); $stmt->execute(); $result = $stmt->get_result(); if ($result->num_rows > 0) { $sql = "UPDATE allowip SET IPAddress = ? WHERE id = ?"; $stmt = $conn->prepare($sql); $stmt->bind_param("si", $IPAddress, $id); $stmt->execute(); } else { $sql = "INSERT INTO allowip (IPAddress) VALUES (?)"; $stmt = $conn->prepare($sql); $stmt->bind_param("s", $IPAddress); $stmt->execute(); } $page = $_GET['Page'] ?? ''; $keys = urlencode($_GET['Keys'] ?? ''); $ord = urlencode($_GET['Ord'] ?? ''); header("Location: ?keys=$keys&Ord=$ord&Page=$page"); exit; } else { $sql = "INSERT INTO allowip (IPAddress) VALUES (?)"; $stmt = $conn->prepare($sql); $stmt->bind_param("s", $IPAddress); $stmt->execute(); header("Location: ?"); exit; } } if ($act == "postchk") { $keys = urlencode($_GET['Keys'] ?? ''); $ord = urlencode($_GET['Ord'] ?? ''); $page = $_GET['Page'] ?? ''; if (isset($_POST['chkbox']) && is_array($_POST['chkbox'])) { $ids = array_map('intval', $_POST['chkbox']); $sql = "DELETE FROM allowip WHERE id IN (" . implode(',', array_fill(0, count($ids), '?')) . ")"; $types = str_repeat('i', count($ids)); $stmt = $conn->prepare($sql); $stmt->bind_param($types, ...$ids); $stmt->execute(); } header("Location: ?Keys=$keys&Ord=$ord&Page=$page"); exit; } ?> 管理区域
prepare($sql); $stmt->bind_param("i", $id); $stmt->execute(); $result = $stmt->get_result(); if ($row = $result->fetch_assoc()) { $IPAddress = textUncode($row['IPAddress']); } else { $isedit = false; } } $page = $_GET['Page'] ?? ''; $keys = urlencode($_GET['Keys'] ?? ''); $ord = urlencode($_GET['Ord'] ?? ''); $hrefstr = "?keys=$keys&Ord=$ord&Page=$page"; ?>
IP
prepare($sql); $search = '%' . $keyscode . '%'; $stmt->bind_param("s", $search); $stmt->execute(); $result = $stmt->get_result(); $row = $result->fetch_assoc(); $total_records = $row['total']; // Pagination settings $records_per_page = 10; $total_pages = ceil($total_records / $records_per_page); if ($page == "") $page = 1; if ($page == "end") $page = $total_pages; if (!is_numeric($page) || $page < 1) $page = 1; $page = (int)$page; if ($page > $total_pages) $page = $total_pages; $start = ($page - 1) * $records_per_page; // Get paginated results $sql = "SELECT * FROM allowip WHERE IPAddress LIKE ? ORDER BY id DESC LIMIT ?, ?"; $stmt = $conn->prepare($sql); $stmt->bind_param("sii", $search, $start, $records_per_page); $stmt->execute(); $results = $stmt->get_result(); $keys = urlencode($keys); $ord = urlencode($ord); $hrefstr = "?keys=$keys"; ?>
num_rows > 0) { $tempNum = ($page - 1) * $records_per_page; while ($row = $results->fetch_assoc()) { $tempNum++; ?>
序号 IP 操作
修改
Sorry,当前暂无信息
Sorry,没有找到""相关的信息,点击返回
1) { $pageName = "?Keys=$keys&Ord=$ord&"; $pagelen = 3; if ($page > 1) { echo "首页"; echo "上一页"; } if ($pagelen * 2 + 1 >= $total_pages) { $startPage = 1; $endPage = $total_pages; } else { if ($page <= $pagelen + 1) { $startPage = 1; $endPage = $pagelen * 2 + 1; } else { $startPage = $page - $pagelen; $endPage = $page + $pagelen; } if ($page + $pagelen > $total_pages) { $startPage = $total_pages - $pagelen * 2; $endPage = $total_pages; } } for ($i = $startPage; $i <= $endPage; $i++) { if ($i == $page) { echo "$i"; } else { echo "$i"; } } if ($page < $total_pages) { if ($total_pages - $page > $pagelen) { echo "...$total_pages"; } echo "下一页"; echo "尾页"; } echo ""; } ?>