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">
|
2021-01-05 17:53:26 +01:00
|
|
|
<a class="navbar-brand" href="<?=genURL('index');?>"><?= WEBSITE_NAME; ?></a>
|
2020-12-18 20:29:24 +01:00
|
|
|
<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':
|
2020-12-20 04:25:09 +01:00
|
|
|
if(!$_SESSION['USER']->getAccomodationId()){
|
|
|
|
echo navItem('Ajout Hebergement',genURL('accomodation/add'));
|
|
|
|
} else {
|
2021-01-05 17:53:26 +01:00
|
|
|
echo navItem('Gestion des disponibilités', genURL('accomodation/date'));
|
2020-12-20 04:25:09 +01:00
|
|
|
echo navItem('Edition de l\'hebergement', genURL('accomodation/edit'));
|
|
|
|
}
|
2020-12-20 03:56:05 +01:00
|
|
|
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'));
|
|
|
|
}
|
|
|
|
?>
|
2021-01-05 17:53:26 +01:00
|
|
|
|
2020-12-18 20:29:24 +01:00
|
|
|
</ul>
|
2021-01-05 17:53:26 +01:00
|
|
|
<?php
|
|
|
|
if($_SESSION['USER']->isLoggedIn()){
|
|
|
|
?>
|
|
|
|
<ul class="navbar-nav d-flex flex-row">
|
|
|
|
<li class="nav-item me-3 me-lg-0 dropdown">
|
|
|
|
<a
|
|
|
|
class="nav-link dropdown-toggle"
|
|
|
|
href="#"
|
|
|
|
id="navbarDropdown"
|
|
|
|
role="button"
|
|
|
|
data-mdb-toggle="dropdown"
|
|
|
|
aria-expanded="false"
|
|
|
|
>
|
|
|
|
<i class="fas fa-user"></i>
|
|
|
|
</a>
|
|
|
|
<ul class="dropdown-menu dropdown-menu-end" aria-labelledby="navbarDropdown">
|
|
|
|
<li><h6 class="dropdown-header"><?=htmlspecialchars(strtoupper($_SESSION['USER']->getLastName()))?> <?=htmlspecialchars($_SESSION['USER']->getFirstName())?></h6></li>
|
|
|
|
<!-- <li><h6 class="dropdown-header"><?=htmlspecialchars(strtoupper($_SESSION['USER']->getType()))?></h6></li> -->
|
|
|
|
<li><hr class="dropdown-divider" /></li>
|
|
|
|
<li>
|
|
|
|
<a class="dropdown-item" href="<?=genURL('logout')?>">Déconnexion</a>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
</li>
|
|
|
|
</ul>
|
|
|
|
<?php
|
|
|
|
}
|
|
|
|
?>
|
2020-12-18 20:29:24 +01:00
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</nav>
|