<?php
$mac = strtoupper(trim($_GET['mac'] ?? ''));
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
    $mac = strtoupper(trim($_POST['mac'] ?? ''));
    header('Location: dashboard.php?mac=' . rawurlencode($mac));
    exit;
}
?>
<!doctype html>
<html lang="ar" dir="rtl">
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <title>تسجيل الدخول | IPTV Player</title>
    <link rel="stylesheet" href="style.css">
</head>
<body>
    <main class="auth-page">
        <form class="panel" method="post">
            <h1>تسجيل الدخول</h1>
            <label>عنوان MAC</label>
            <input name="mac" value="<?= htmlspecialchars($mac, ENT_QUOTES, 'UTF-8') ?>" placeholder="00:11:22:33:44:55" required>
            <button type="submit">تسجيل الدخول عبر MAC</button>
        </form>
    </main>
</body>
</html>
