diff --git a/app/view/Includes/header.include.html b/app/view/Includes/header.include.html index 2fc4832b5bffd379c3e62ce6405ec94a26681a11..ecf38f00d622c2b5775d9054ec0042b4d5df12f7 100644 --- a/app/view/Includes/header.include.html +++ b/app/view/Includes/header.include.html @@ -1,3 +1,8 @@ +<?php +if(!isset($_SESSION)) { // si + session_start(); +} +?> <!DOCTYPE html> <html lang="fr"> <head> @@ -30,10 +35,23 @@ <div class="col-4 space col-m-1"> </div> + <?php + if(isset($_SESSION['connected']) && $_SESSION['connected'] == true) { + ?> + <div class="connexion col-3 col-m-6"> + <?php echo $_SESSION['user']->prenom.' '.$_SESSION['user']->nom; ?> + </div> + <?php + } + else { + ?> <div class="connexion col-3 col-m-6"> <div class="signin"><a class="connexion-link" href="<?php echo BASE_URL; ?>/inscription">Inscription</a></div> <div class="login"><a class="connexion-link" href="<?php echo BASE_URL; ?>/connexion">Connexion</a></div> </div> + <?php + } + ?> </header>