@if(Auth::check())
<div class="sidebar" data-background-color="white" data-active-color="danger">
    <div class="sidebar-wrapper">

            @if(Auth::user()->role == 'tatausaha')
            <div class="logo">
                <a href="{{route('tatausaha')}}" class="simple-text">
                    <i class="glyphicon glyphicon-home"></i>
                    Selamat Datang {{Auth::user()->username}}
                </a>
            </div>

            <ul class="nav">
            <li class="{{Request::segment(2) == '' ? 'active' : ''}}">
                <a href="{{route('tatausaha')}}">
                    <i class="glyphicon glyphicon-th-list"></i>
                    <p>Dashboard</p>
                </a>
            </li>

            <li class="{{Request::segment(2) == 'upload' ? 'active' : ''}}">
                <a href="{{route('upload.index')}}">
                    <i class="glyphicon glyphicon-list-alt"></i>
                    <p>Pengumuman</p>
                </a>
            </li>
            <li class="{{Request::segment(2) == 'Daftar' ? 'active' : ''}}">
                <a href="{{route('Daftar.index')}}">
                    <i class="glyphicon glyphicon-user"></i>
                    <p>Pendaftar</p>

                </a>
            </li>
            <li class="{{Request::segment(2) == 'tahunajaran' ? 'active' : ''}}">
                <a href="{{route('tahunajaran.index')}}">
                    <i class="glyphicon glyphicon-book"></i>
                    <p>Tahun Ajaran</p>

                </a>
            </li>
            

            @elseif(Auth::user()->role == 'calonsiswa')
            <div class="logo">
                <a href="http://www.creative-tim.com" class="simple-text">
                    <i class="glyphicon glyphicon-home"></i>
                    Selamat Datang {{Auth::user()->username}}
                </a>
            </div>
            <ul class="nav">
            <li class="{{Request::segment(2) == '' ? 'active' : ''}}">
                <a href="{{route('calonsiswa')}}">
                    <i class="glyphicon glyphicon-th-list"></i>
                    <p>Dashboard</p>
                </a>
            </li>
            
            <li class="{{Request::segment(1) == ''?'active' : ''}}">
                <a href="url(/Dashboard)" class="dropdown-toggle" data-toggle="dropdown">
                    <i class="glyphicon glyphicon-pencil"></i>
                        <p>Daftar Online</p>
                            </a>
                             <ul class="dropdown-menu">
                                <li class="{{Request::segment(2) == 'pendaftar' ? 'active' : ''}}"><a href="{{route('pendaftar.create')}}">Pribadi</a></li>
                                <li class="{{Request::segment(2) == 'periodik' ? 'active' : ''}}"><a href="{{route('periodik.create')}}">Periodik</a></li>
                                <li class="{{Request::segment(2) == 'prestasi' ? 'active' : ''}}"><a href="{{route('prestasi.create')}}">Prestasi</a></li>
                                <li class="{{Request::segment(2) == 'asalsekolah' ? 'active' : ''}}"><a href="{{route('asalsekolah.create')}}">Asalsekolah</a></li>
                                <li class="{{Request::segment(2) == 'orangtua' ? 'active' : ''}}"><a href="{{route('orangtua.index')}}">Orang Tua</a>

                                </li>
                            </ul>
                </a>
            </li>
            <li class="{{Request::segment(2) == 'downloadpeng' ? 'active' : ''}}">
                <a href="{{route('downloadpeng.index')}}">
                    <i class="glyphicon glyphicon-list-alt"></i>
                    <p>Pengumuman</p>
                </a>
            </li>
            <li class="{{Request::segment(2) == 'downloadsoal' ? 'active' : ''}}">
                <a href="{{route('downloadsoal.index')}}">
                    <i class="glyphicon glyphicon-download-alt"></i>
                    <p>Download Contoh Soal</p>
                </a>
            </li>

            <li class="{{Request::segment(2) == 'download' ? 'active' : ''}}">
                <a href="">
                    <i class="glyphicon glyphicon-credit-card"></i>
                    <p>Kartu Ujian</p>
                </a>
            </li>
            <li class="{{Request::segment(2) == 'hasilujian' ? 'active' : ''}}">
                <a href="{{route('hasilujian.index')}}">
                    <i class="glyphicon glyphicon-book"></i>
                    <p>Hasil Ujian</p>
                </a>
            </li>
            
            @else
            <div class="logo">
                <a href="http://www.creative-tim.com" class="simple-text">
                    Selamat Datang {{Auth::user()->username}}
                </a>
            </div>

            <ul class="nav">
            <li class="{{Request::segment(2) == '' ? 'active' : ''}}">
                <a href="{{route('headmaster')}}">
                    <i class="ti-panel"></i>
                    <p>Dashboard</p>
                </a>
            </li>
            
            @endif
        </ul>
    </div>
</div>
@endif