1
0
Fork 0
This repository has been archived on 2024-02-17. You can view files and clone it, but cannot push or open issues or pull requests.
Accommodation_Management/view/template/navbar.php

41 lines
1.7 KiB
PHP
Raw Normal View History

2020-12-20 03:56:05 +01:00
<?php
?>
2020-12-18 20:29:24 +01:00
<nav class="navbar navbar-expand-lg navbar-light bg-light">
<div class="container-fluid">
<a class="navbar-brand" href="#"><?= WEBSITE_NAME; ?></a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarText"
aria-controls="navbarText" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarText">
<ul class="navbar-nav me-auto mb-2 mb-lg-0">
<?php
2020-12-20 03:56:05 +01:00
if($_SESSION['USER']->isLoggedIn()){
switch($_SESSION['USER']->getType()){
case 'AccomodationOwner':
echo navItem('Ajout Hebergement',genURL('accomodation/add'));
echo navItem('Edition de l\'hebergement',genURL('accomodation/edit'));
break;
case 'Staff':
echo navItem('Gestion des disponibilités',genURL('accomodation/manager'));
break;
}
2020-12-18 20:29:24 +01:00
}else{
echo navItem('Login',genURL('login'));
}
?>
</ul>
<span class="navbar-text">
<?php
2020-12-20 03:56:05 +01:00
if($_SESSION['USER']->isLoggedIn()){
2020-12-18 20:29:24 +01:00
?>
2020-12-20 03:56:05 +01:00
M. <?=htmlspecialchars(strtoupper($_SESSION['USER']->getLastName()))?> <?=htmlspecialchars($_SESSION['USER']->getFirstName())?>
2020-12-18 20:29:24 +01:00
<a href="<?=genURL('logout')?>">Déconnexion</a>
<?php
}
?>
</span>
</div>
</div>
</nav>