index.php cho wifi marketing Ruckus

<?php
function h($s) {
    return htmlspecialchars((string)$s, ENT_QUOTES, 'UTF-8');
}

function getCleanParams(): array {
    $query = parse_url($_SERVER['REQUEST_URI'] ?? '', PHP_URL_QUERY) ?? '';
    $query = html_entity_decode($query, ENT_QUOTES | ENT_HTML5, 'UTF-8');

    $params = [];
    parse_str($query, $params);

    $clean = [];
    foreach ($params as $key => $value) {
        $key = preg_replace('/^amp;/', '', (string)$key);
        $clean[$key] = $value;
    }

    return $clean;
}

$params = getCleanParams();
?>
<!doctype html>
<html lang="vi">
<head>
    <meta charset="utf-8">
    <title>Guest Wi-Fi</title>
    <meta name="viewport" content="width=device-width, initial-scale=1">

    <style>
        * {
            box-sizing: border-box;
        }

        body {
            margin: 0;
            height: 100vh;
            font-family: Arial, sans-serif;
            background: #111827;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        .box {
            width: 90%;
            max-width: 420px;
            background: #ffffff;
            padding: 0;
            border-radius: 16px;
            text-align: center;
            box-shadow: 0 20px 50px rgba(0, 0, 0, .35);
            overflow: hidden;
        }

        .slider {
            position: relative;
            width: 100%;
            aspect-ratio: 9 / 16;
            overflow: hidden;
            background: #e5e7eb;
        }

        .slide {
            position: absolute;
            inset: 0;
            width: 100%;
            height: 100%;
            object-fit: contain;
            opacity: 0;
            transition: opacity 600ms ease-in-out;
        }

        .slide.active {
            opacity: 1;
        }

        .dots {
            position: absolute;
            left: 0;
            right: 0;
            bottom: 10px;
            display: flex;
            justify-content: center;
            gap: 6px;
        }

        .dot {
            width: 8px;
            height: 8px;
            border-radius: 50%;
            background: rgba(255, 255, 255, .55);
        }

        .dot.active {
            background: #ffffff;
        }

        .content {
            padding: 24px;
            background: #111111;
        }

        button {
            width: 100%;
            padding: 14px;
            border: 0;
            border-radius: 10px;
            background: #2563eb;
            color: #ffffff;
            font-size: 17px;
            font-weight: bold;
            cursor: pointer;
        }

        button:hover {
            background: #1d4ed8;
        }

        button:disabled {
            background: #9ca3af;
            cursor: not-allowed;
        }
    </style>
</head>
<body>
    <div class="box">
        <div class="slider">
            <img class="slide active" src="images/1.jpg" alt="Slide 1">
            <img class="slide" src="images/2.jpg" alt="Slide 2">

            <div class="dots">
                <span class="dot active"></span>
                <span class="dot"></span>
            </div>
        </div>

        <div class="content">
            <form method="post" action="login.php" id="connectForm">
                <?php foreach ($params as $key => $value): ?>
                    <input type="hidden" name="<?= h($key) ?>" value="<?= h($value) ?>">
                <?php endforeach; ?>

                <button type="submit" id="connectBtn">Kết nối Internet</button>
            </form>
        </div>
    </div>

    <script>
        const slides = document.querySelectorAll('.slide');
        const dots = document.querySelectorAll('.dot');
        let currentSlide = 0;

        function showSlide(index) {
            slides.forEach(function (slide, i) {
                slide.classList.toggle('active', i === index);
            });
            dots.forEach(function (dot, i) {
                dot.classList.toggle('active', i === index);
            });
        }

        if (slides.length > 1) {
            setInterval(function () {
                currentSlide = (currentSlide + 1) % slides.length;
                showSlide(currentSlide);
            }, 2000);
        }

        document.getElementById('connectForm').addEventListener('submit', function () {
            const btn = document.getElementById('connectBtn');
            btn.innerText = 'Đang kết nối...';
            btn.disabled = true;
        });
    </script>
</body>
</html>

No comments:

Post a Comment

login.php cho wifi marketing Ruckus

 <?php function h($s) {     return htmlspecialchars((string)$s, ENT_QUOTES, 'UTF-8'); } function cleanParams(array $input): array...