<?php

    if(ENVIRONNEMENT != "PROD"){
        $navInfos = [
            "color" => "bg-dark",
            "title" => '<small class="border rounded-2" style="padding:5px 5px 2px 5px; color:orange; margin-right:5px;">' . ENVIRONNEMENT . '</small> CSE Invent : CMS'
        ];
    } else {
        $navInfos = [
            "color" => "bg-dark",
            "title" => "CSE Invent : CMS"
        ];
    }
    
?>
<header class="navbar sticky-top <?php echo $navInfos["color"] ?> navbar-expand-sm navbar-dark flex-md-nowrap p-0 shadow">
    <div class="container-fluid">
        <a href="/" style="box-shadow: none;" class="navbar-brand <?php echo $navInfos["color"] ?>"><?php echo $navInfos["title"] ?></a><?php debug::printBadges(); ?>
        <div id="navbarCollapse" class="collapse navbar-collapse p-0">
            <ul class="nav navbar-nav ms-auto">
                <li class="nav-item dropdown">
                    <a href="#" class="nav-link dropdown-toggle" data-bs-toggle="dropdown"><?php echo session::getName(); document::badge(); ?></a>
                    <div class="dropdown-menu dropdown-menu-end">
                        <a href="/user.html" class="dropdown-item">Mon profil</a>
                        <?php document::menu() ?>
                        <div class="dropdown-divider"></div>
                        <a href="/submit.php?from=logout" class="dropdown-item">Se déconnecter</a>
                    </div>
                </li>
            </ul>
        </div>
    </div>
</header>    
