<?php
if (session_status() === PHP_SESSION_NONE) {
    session_start();
}
?>
  <div class="navbar">
        <div class="navbar-links" id="mobileMenu">
            <a href="index.php">🏠 Home</a>
            <?php if ($_SESSION['user']['hasRole']): ?>
                <a href="registration.php">✍️ Eintragung</a>
                <div class="dropdown">
                    <a href="#">📂 Verwaltung ▼</a>
                    <div class="dropdown-content">
                        <a href="statistik.php">📊 Statistik</a>
                        <a href="lager.php">🔧 Lager</a>
                        <a href="personal.php">📝 Personalakten</a>
                    </div>
                </div>
            <?php endif; ?>
        </div>
        <div class="user-info">
            <img src="https://cdn.discordapp.com/avatars/<?php echo $_SESSION['user']['discord_id']; ?>/<?php echo $_SESSION['user']['avatar']; ?>.png" alt="Avatar">
            <span><?php echo htmlspecialchars($_SESSION['user']['nickname']); ?></span>
            <a href="logout.php"><button class="logout-btn">Logout</button></a>
            <span class="burger" onclick="toggleMenu()">☰</span>
        </div>
    </div>