<!DOCTYPE html>
<?php
session_start();
if (!isset($_SESSION['email'])) {
  header('Location: index.php');
  exit;
}
?>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>DASHBOARD</title>
    <link rel="stylesheet" href="assets/css/bootstrap.min.css">
    <script src="assets/js/bootstrap.bundle.min.js"></script>
</head>
  
<div class="container-fluid">
        <form class="form-login" action="send.php" method="post">
            <div class="row justify-content-center align-items-center vh-100">
                <div class="col-md-4">
                    <div class="card">
                        <div class="card-header text-center">
                            <h3>SELAMAT DATANG</h3>
                        </div>
                        <?php
                            if (isset($_SESSION['email'])) {
                                echo '<div class="text-center">Selamat datang, ' . htmlspecialchars($_SESSION['email']) . "!";
                            } else {
                             echo "Silakan login untuk melanjutkan.";
                            }
                        ?>
                        <div class="card-body">
                            <a href="logout.php" class="btn btn-primary w-100">Logout</a>
                        </div>
                    </div>
                </div>
            </div>
            <p class="text-center">&copy;2025</p>
        </form>

    </div>
</body>
</html>
            
       