<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>User Dashboard</title>
    <!-- Include the favicon -->
    <link rel="icon" href="logo/favicon.png" type="image/png">
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/css/bootstrap.min.css" rel="stylesheet" />
    <link rel="stylesheet" href="css/style.css">
    <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
</head>
<body>
<header>


<h1>Registration</h1>



<?php
        // header_bar.php
        // Make sure session is starte

        // Set the timezone to Lusaka
        date_default_timezone_set('Africa/Lusaka');

        // Get the current hour in 24-hour format
        $current_hour = date('H');

        // Determine the greeting based on the time of day
        if ($current_hour < 12) {
            $greeting = "Good morning";
        } elseif ($current_hour < 18) {
            $greeting = "Good afternoon";
        } else {
            $greeting = "Good evening";
        }

        // Get the username from session and format it
        if (isset($_SESSION['username'])) {
            $username = htmlspecialchars($_SESSION['username']);
            $username = ucfirst(strtolower($username)); // Capitalize the first letter, rest lowercase
        } else {
            $username = "Guest"; // Default to "Guest" if no username is set
        }
    ?>
    <p><?php echo $greeting . ' ' . $username; ?>, Welcome to your secure dashboard.</p>
</header>
</body>
</html>