<!-- Main Header -->
<header class="main-header">
    <?php
        //var_dump(CRUDBooster::myMultiPriv());
    ?>

    <!-- Logo -->
    <a href="{{url(config('crudbooster.ADMIN_PATH'))}}" title='{{Session::get('appname')}}' class="logo">{{CRUDBooster::getSetting('appname')}}</a>

    <!-- Header Navbar -->
    <nav class="navbar navbar-static-top" role="navigation">
        <!-- Sidebar toggle button-->
         @if(CRUDBooster::myPrivilegeId()!=10)
        <a href="#" class="sidebar-toggle" data-toggle="offcanvas" role="button" class="toggled">
            <span class="sr-only">Toggle navigation</span>
        </a>
        @endif
        <!-- Navbar Right Menu -->
        <div class="navbar-custom-menu">
            <ul class="nav navbar-nav">
                @if(CRUDBooster::myPrivilegeId()!=10)
                <li class="dropdown notifications-menu">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" title='Notifications' aria-expanded="false">
                        <i id='icon_notification' class="fa fa-bell-o"></i>
                        <span id='notification_count' class="label label-danger" style="display:none">0</span>
                    </a>
                    <ul id='list_notifications' class="dropdown-menu">
                        <li class="header">{{trans("crudbooster.text_no_notification")}}</li>
                        <li>
                            <!-- inner menu: contains the actual data -->
                            <div class="slimScrollDiv" style="position: relative; overflow: hidden; width: auto; height: 200px;">
                                <ul class="menu" style="overflow: hidden; width: 100%; height: 200px;">
                                    <li>
                                        <a href="#">
                                            <em>{{trans("crudbooster.text_no_notification")}}</em>
                                        </a>
                                    </li>

                                </ul>
                                <div class="slimScrollBar"
                                     style="width: 3px; position: absolute; top: 0px; opacity: 0.4; display: none; border-radius: 7px; z-index: 99; right: 1px; height: 195.122px; background: rgb(0, 0, 0);"></div>
                                <div class="slimScrollRail"
                                     style="width: 3px; height: 100%; position: absolute; top: 0px; display: none; border-radius: 7px; opacity: 0.2; z-index: 90; right: 1px; background: rgb(51, 51, 51);"></div>
                            </div>
                        </li>
                        <li class="footer"><a href="{{route('NotificationsControllerGetIndex')}}">{{trans("crudbooster.text_view_all_notification")}}</a></li>
                    </ul>
                </li>

                <li class="dropdown privs-menu">
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown" title='Roles' aria-expanded="false">
                        <i id='icon_notification' class="fa fa-user"></i>
                        <span id='notification_count' class="label label-danger" style="display:none">0</span>
                    </a>
                    
                    <div class="list-group dropdown-menu">
                        
                            @foreach(CRUDBooster::myMultiPriv() as $mv)
                                @if(Session::get('admin_privileges') == $mv->cms_privileges_id)
                                    <a href="#" class="list-group-item list-group-item-action active">
                                        {{ $mv->name }}
                                    </a>
                                @else
                                    <form method='post' action='{{CRUDBooster::adminpath("berubah")}}' class="list-group-item list-group-item-action">
                                        <input type="hidden" name="_token" value="{{ csrf_token() }}"/>
                                        <input type="hidden" name="priv_id" value="{{ $mv->cms_privileges_id }}"/>
                                        <input type="hidden" name="nik" value="{{ CRUDBooster::me()->nik }}"/>
                                		<input type="submit" class='btn' value="{{ $mv->name }}"/>
    	                            </form>
                                    <!--<a href="{{ CRUDBooster::adminpath('berubah') }}" class="list-group-item list-group-item-action">{{ $mv->name }}</a>-->
                                @endif
                            @endforeach
                            @if(Session::get('admin_privileges')==CRUDBooster::myMainPrivilege()->id_cms_privileges)
                                <a href="#" class="list-group-item list-group-item-action active">{{ CRUDBooster::myMainPrivilege()->name }}</a>
                            @else
                                 <form method='post' action='{{CRUDBooster::adminpath("berubah")}}' class="list-group-item list-group-item-action">
                                    <input type="hidden" name="_token" value="{{ csrf_token() }}"/>
                                    <input type="hidden" name="priv_id" value="{{ CRUDBooster::myMainPrivilege()->id_cms_privileges }}"/>
                                    <input type="hidden" name="nik" value="{{ CRUDBooster::me()->nik }}"/>
                            		<input type="submit" class='btn' value="{{ CRUDBooster::myMainPrivilege()->name }}"/>
                                </form>
                                <!--<a href="{{ CRUDBooster::adminpath('berubah') }}" class="list-group-item list-group-item-action">{{ CRUDBooster::myMainPrivilege()->name }}</a>-->
                            @endif
                        
                    </div>
                </li>
                @endif

                <!-- User Account Menu -->
                <li class="dropdown user user-menu">
                    <!-- Menu Toggle Button -->
                    <a href="#" class="dropdown-toggle" data-toggle="dropdown">
                        <!-- The user image in the navbar-->
                        <img src="{{ CRUDBooster::myPhoto() }}" class="user-image" alt="User Image"/>
                        <!-- hidden-xs hides the username on small devices so only the image appears. -->
                        <span class="hidden-xs">{{ CRUDBooster::myName() }}</span>
                    </a>
                    <ul class="dropdown-menu">
                        <!-- The user image in the menu -->
                        <li class="user-header">
                            <img src="{{ CRUDBooster::myPhoto() }}" class="img-circle" alt="User Image"/>
                            <p>
                                {{ CRUDBooster::myName() }}
                                <small>{{ CRUDBooster::myPrivilegeName() }} 
                                @if(CRUDBooster::myPrivilegeId()==2)
                                    RT.{{ CRUDBooster::myKtp()->rt }}/RW.{{ CRUDBooster::myKtp()->rw }}
                                    Kel.{{ CRUDBooster::myKtp()->kelurahan }}
                                    Kec.{{ CRUDBooster::myKtp()->kecamatan }}
                                @endif
                                @if(CRUDBooster::myPrivilegeId()==3)
                                    .{{ CRUDBooster::me()->rt }}/RW.{{ CRUDBooster::me()->rw }}
                                    Kel.{{ CRUDBooster::me()->kelurahan }}
                                    Kec.{{ CRUDBooster::me()->kecamatan }}
                                @endif
                                @if(CRUDBooster::myPrivilegeId()>4)
                                    {{ CRUDBooster::me()->dinas }}
                                @endif
                                </small>
                                <!--<small><em><?php echo date('d F Y')?></em></small>-->
                            </p>
                        </li>

                        <!-- Menu Footer-->
                        <li class="user-footer">
                            @if(CRUDBooster::myPrivilegeId()!=10)
                            <div class="pull-{{ trans('crudbooster.left') }}">
                                <a href="{{ route('AdminCmsUsersControllerGetProfile') }}?return_url={{ CRUDBooster::adminPath() }}" class="btn btn-default btn-flat"><i
                                            class='fa fa-user'></i> {{trans("crudbooster.label_button_profile")}}</a>
                            </div>
                            @endif
                            <div class="pull-{{ trans('crudbooster.right') }}">
                                @if(CRUDBooster::myPrivilegeId()!=10)
                                <a title='Lock Screen' href="{{ route('getLockScreen') }}" class='btn btn-default btn-flat'><i class='fa fa-key' ></i></a>
                                @endif
                                <a href="javascript:void(0)" onclick="swal({
                                        title: '{{trans('crudbooster.alert_want_to_logout')}}',
                                        type:'info',
                                        showCancelButton:true,
                                        allowOutsideClick:true,
                                        confirmButtonColor: '#DD6B55',
                                        confirmButtonText: '{{trans('crudbooster.button_logout')}}',
                                        cancelButtonText: '{{trans('crudbooster.button_cancel')}}',
                                        closeOnConfirm: false
                                        }, function(){
                                        location.href = '{{ route("getLogout") }}';

                                        });" title="{{trans('crudbooster.button_logout')}}" class="btn btn-danger btn-flat"><i class='fa fa-power-off' style='color:red;'></i></a>
                            </div>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
    </nav>
</header>
