Пример #1
0
<!-- Optional theme -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.5/css/bootstrap-theme.min.css">

<link rel="stylesheet" type="text/css" href="../CSS/style.css"/>
<nav class="navbar navbar-default navbar-fixed-top">
    <div class="container-fluid">
        <div class="navbar-header">
            Web
        </div>

        <ul class="nav navbar-nav navbar-right">
            <li><a href="home.php"><span class="glyphicon glyphicon-home"></span> Home</a></li>
            <?php 
if (isset($_SESSION['email'])) {
    $controleur = new Controleur();
    if ($controleur->getUserEmail($_SESSION['email'])) {
        if (isset($_SESSION['admin'])) {
            echo "<li><a href='addUser.php'><span class='glyphicon glyphicon-plus'></span> Add user</a></li>";
            echo "<li><a href='users.php'><span class='glyphicon glyphicon-user'> Users</a></li>";
        }
        echo "<li><a href='lastnews.php'><span class='glyphicon glyphicon-star'></span> New</a></li>";
        echo "<li><a href='news.php'><span class='glyphicon glyphicon-star-empty'></span> News</a></li>";
        echo "<li><a href='profil.php'><span class='glyphicon glyphicon-user'> Profil</a></li>";
        echo "<li><a href='deconnect.php'><span class='glyphicon glyphicon-off'></span> Deconnect</a></li>";
    } else {
        //l'user n'existe plus mais sa session oui
        header('Location:deconnect.php');
    }
} else {
    echo "<li><a href='connect.php'>Login/sign</a></li>";
}