<aside>
    <h2>Menu</h2>
    <ul>
        <?php 
        if (session_status() == PHP_SESSION_NONE) {
            session_start();
        }
        // Vérifier si l'utilisateur est connecté
        if (isset($_SESSION["user"])) {
            ?>
            <li><a href="index.php?url=dashboard">Espace personnel </a></li>
            <li class="has-submenu">
                <a href="#" class="submenu-link">Se cultiver 🔽↓</a>
                <ul class="sub-menu-hidden" style="display: none;">
                    <li><a href="index.php?url=partage/mecanique&categorie=culture " class="item">Mecanique</a></li>
                    <li><a href="index.php?url=partage/bricolage&categorie=culture" class="item">Bricolage</a></li>
                    <li><a href="index.php?url=partage/sport&categorie=culture" class="item">Sport</a></li>
                    <li><a href="index.php?url=partage/cuisine&categorie=culture" class="item">Cuisine</a></li>
                    <li><a href="index.php?url=partage/social&categorie=culture" class="item">Social</a></li>
                    <li><a href="index.php?url=partage/relation&categorie=culture" class="item">Relation</a></li>
                    <li><a href="index.php?url=partage/decouverteLieu&categorie=culture" class="item">Decouverte de Lieux</a></li>
                    <li><a href="index.php?url=partage/biodiversite&categorie=culture" class="item">Biodiversité</a></li>
                </ul>
            </li>
            <li class="has-submenu">
                <a href="#" class="submenu-link">Les Astuces 🔽↓</a>
                <ul class="sub-menu-hidden" style="display: none;">
                    <li><a href="index.php?url=partage/mecanique&categorie=astuce" class="item">Mecanique</a></li>
                    <li><a href="index.php?url=partage/bricolage&categorie=astuce" class="item">Bricolage</a></li>
                    <li><a href="index.php?url=partage/sport&categorie=astuce" class="item">Sport</a></li>
                    <li><a href="index.php?url=partage/cuisine&categorie=astuce" class="item">Cuisine</a></li>
                    <li><a href="index.php?url=partage/social&categorie=astuce" class="item">Social</a></li>
                    <li><a href="index.php?url=partage/relation&categorie=astuce" class="item">Relation</a></li>
                    <li><a href="index.php?url=partage/decouverteLieu&categorie=astuce" class="item">Decouverte de Lieux</a></li>
                    <li><a href="index.php?url=partage/biodiversite&categorie=astuce" class="item">Biodiversité</a></li>
                </ul>
            <li class="has-submenu">
                <a href="#" class="submenu-link">Les bonnes idée 🔽↓</a>
                <ul class="sub-menu-hidden" style="display: none;">
                    <li><a href="index.php?url=partage/mecanique&categorie=idee" class="item">Mécanique</a></li>
                    <li><a href="index.php?url=partage/bricolage&categorie=idee" class="item">Bricolage</a></li>
                    <li><a href="index.php?url=partage/sport&categorie=idee" class="item">Sport</a></li>
                    <li><a href="index.php?url=partage/cuisine&categorie=idee" class="item">Cuisine</a></li>
                    <li><a href="index.php?url=partage/social&categorie=idee" class="item">Social</a></li>
                    <li><a href="index.php?url=partage/relation&categorie=idee" class="item">Relation</a></li>
                    <li><a href="index.php?url=partage/decouverteLieu&categorie=idee" class="item">Découverte de Lieux</a></li>
                    <li><a href="index.php?url=partage/biodiversite&categorie=idee" class="item">Biodiversité</a></li>
                </ul>
            </li>
            
            <li><a href="./controleurs/c_deconnexion.php">Déconnexion</a></li>
        <?php 
        } else {
            // Si l'utilisateur n'est pas connecté, redirigez-le vers la page de connexion
            header("Location: index.php");
            exit;
        } ?>
    </ul>
    <script src="./js/sidebar.js"></script>
</aside>
