<?php
include('db.php');
?>

<!DOCTYPE html>
<html lang="en">

<!--Navbar-->
<nav class="navbar navbar-toggleable-md navbar-dark bg-primary fixed-top">
    <div class="container">
        <button class="navbar-toggler navbar-toggler-right" type="button" data-toggle="collapse" data-target="#collapseEx2" aria-controls="collapseEx2" aria-expanded="false" aria-label="Toggle navigation">
            <span class="navbar-toggler-icon"></span>
        </button>
        <!--Navbar Brand-->
        <a class="navbar-brand" href="teletark.tele2.ee">
            <img src="tele2_logo_whiteblue.png" width="55" class="d-inline-block align-top z-depth-0" alt="Tele2 Eesti">
        </a>

        <div class="collapse navbar-collapse" id="collapseEx2">
            <!--Links-->
            <ul class="navbar-nav mr-auto">
                <li class="nav-item">
                    <a class="nav-link" href="index.php">Minu<span class="sr-only">(current)</span></a>
                </li>
                <li class="nav-item btn-group">
                    <a class="nav-link dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Osakond</a>
                    <div class="dropdown-menu" aria-labelledby="dropdownMenu1">
                        <a class="dropdown-item" href="files.php?department=Billing ja IT">Billing ja IT</a>
                        <a class="dropdown-item" href="files.php?department=Erilahendused">Erilahendused</a>
                        <a class="dropdown-item" href="files.php?department=Finants">Finants</a>
                        <a class="dropdown-item" href="files.php?department=Jaemüük">Jaemüük</a>
                        <a class="dropdown-item" href="files.php?department=Juhtkond">Juhtkond</a>
                        <a class="dropdown-item" href="files.php?department=Klienditeenindus">Klienditeenindus</a>
                        <a class="dropdown-item" href="files.php?department=Müük ja turundus">Müük ja turundus</a>
                        <a class="dropdown-item" href="files.php?department=Personal">Personal</a>
                        <a class="dropdown-item" href="files.php?department=Tehnika">Tehnika</a>
                        <a class="dropdown-item" href="files.php?department=Tootearendus">Tootearendus</a>
                        <a class="dropdown-item" href="files.php?department=Võrguhooldus">Võrguhooldus</a>
                        <a class="dropdown-item" href="files.php?department=Äriklientuur">Äriklientuur</a>
                        <div class="dropdown-divider"></div>
                        <a class="dropdown-item" href="files.php?department=Avalik">Avalik</a>
                    </div>
                </li>
                <li class="nav-item">
                    <a class="nav-link" href="upload.php" >Loo uus</a>
                </li>
            </ul>

            <div>
                <?php
                if($right == 2){?>
                    <ul class="navbar-nav mr-auto">
                        <li class="nav-item btn-group">
                            <a class="nav-link dropdown-toggle" id="dropdownMenu1" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">Haldus
                                <?php
                                if ($newDocs > 0){?>
                                    <i class="fa fa-bell"></i>
                                    <?php
                                }
                                ?>
                            </a>
                            <div class="dropdown-menu" aria-labelledby="dropdownMenu1">
                                <a class="dropdown-item" href="files.php?check=new">Uued
                                    <?php
                                    if ($newDocs > 0){
                                        echo '(' . $newDocs . ')';
                                    }
                                    ?>
                                </a>
                                <a class="dropdown-item" href="files.php?check=old">Arhiiv</a>
                            </div>
                        </li>
                    </ul>
                    <?php
                }
                ?>

            </div>
            <form class="form-inline waves-effect" action="files.php" method="get">
                <input class="form-control" name="search" type="text" placeholder="Otsi">
            </form>
        </div>
    </div>
</nav>
<!--/.Navbar-->

<style>
    .dropdown-menu {
        line-height: 15px;
    }
</style>
</html>