<header ng-controller="headerCtrl">
    <nav class="navbar navbar-static-top owlchat-navbar" role="navigation">
        <!-- Brand and toggle get grouped for better mobile display -->
        <div class="navbar-header">
            <button type="button" class="owlchat-navbar-toggle navbar-toggle" data-toggle="collapse" data-target="#oc-nav">
                <i class="fa fa-bars"></i>
            </button>
            <a class="logo text-center" ui-sref="home"><?php echo $settings['site_name']; ?></a>
        </div>
        <div class="container">
            <!-- Collect the nav links, forms, and other content for toggling -->
            <div class="collapse navbar-collapse pull-right" id="oc-nav">
                <ul>
                    <?php
                    if(isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true){
                        if($user['mem_level'] == 2){
                            ?><li><a href="admin/" onclick="location.href = 'admin/';"><i class="fa fa-shield fa-fw"></i> Admin</a></li><?php
                        }
                        if($settings['room_creation'] == 1 || $user['mem_level'] == 2 || $user['mem_level'] == 3){
                            ?><li><a ui-sref="create"><i class="fa fa-plus fa-fw"></i> Create</a></li><?php
                        }
                        if($settings['file_uploads'] == 1 || $user['mem_level'] == 2 || $user['mem_level'] == 3){
                            ?><li><a href data-toggle="modal" data-target="#filesModal"><i class="fa fa-archive fa-fw"></i> Files</a></li><?php
                        }
                        if($settings['create_polls'] == 1 || $user['mem_level'] == 2 || $user['mem_level'] == 3){
                            ?><li><a href data-toggle="modal" data-target="#pollCenterModal"><i class="fa fa-tasks fa-fw"></i> Polls</a></li><?php
                        }
                        ?>
                        <li><a ui-sref="editProfile"><i class="fa fa-cog fa-fw"></i> Edit Profile</a></li>
                        <li>
                            <a href data-toggle="modal" data-target="#profileCardModal"
                               ng-click="getProfile('<?php echo $_SESSION['username']; ?>')">
                                <i class="fa fa-user fa-fw"></i> My Profile
                            </a>
                        </li>
                        <li><a href data-toggle="modal" data-target="#friendsModal"><i class="fa fa-users fa-fw"></i> Friends</a></li>
                        <li><a ui-sref="logout"><i class="fa fa-sign-out fa-fw"></i> Logout</a></li>
                    <?php
                    }else{
                        if($settings['registration'] == 1){
                            ?><li><a href data-toggle="modal" data-target="#registerModal"><i class="fa fa-user-plus fa-fw"></i> Register</a></li><?php
                        }
                        ?>
                        <li><a href data-toggle="modal" data-target="#loginModal"><i class="fa fa-sign-in fa-fw"></i> Login</a></li>
                    <?php
                    }
                    ?>

                </ul>
            </div><!-- /.navbar-collapse -->
        </div><!-- /.container-fluid -->
    </nav>
</header>
