<?php
require_once 'includes/header.php';

echo "<div class='container'>";
echo "<h2>Role Testing Page</h2>";

if (isLoggedIn()) {
    echo "<p>Logged in as: " . htmlspecialchars($_SESSION['username']) . "</p>";
    echo "<p>User ID: " . $_SESSION['user_id'] . "</p>";
    echo "<p>Role: " . (isset($_SESSION['role']) ? $_SESSION['role'] : 'Not set') . "</p>";
    
    if (isAdmin()) {
        echo "<p style='color: green; font-weight: bold;'>You have admin privileges!</p>";
        echo "<p><a href='" . SITE_URL . "/admin/index.php'>Go to Admin Dashboard</a></p>";
    } else {
        echo "<p style='color: orange; font-weight: bold;'>You are a regular user.</p>";
        echo "<p><a href='" . SITE_URL . "/index.php'>Go to Homepage</a></p>";
    }
} else {
    echo "<p>You are not logged in.</p>";
    echo "<p><a href='" . SITE_URL . "/auth/login.php'>Login</a> | <a href='" . SITE_URL . "/auth/register.php'>Register</a></p>";
}

echo "</div>";

require_once 'includes/footer.php';
?>