
@php
    $current_locale= App::currentLocale();
    $baseLab = (array) Session::get('base_lab');
    $labName = $baseLab['name_'.$current_locale];
@endphp

<nav class="navbar col-lg-12 col-12 p-0 fixed-top d-flex flex-row">
    <div class="navbar-brand-wrapper d-flex justify-content-center">
        <div class="navbar-brand-inner-wrapper d-flex justify-content-between align-items-center w-100">
            <a class="navbar-brand brand-logo" href="javascript:void(0)"><img style="width: 100% !important;" src="{{ url(env("APP_URL").'storage/assets/images/logo.png') }}" alt="logo"/></a>
            <a class="navbar-brand brand-logo-mini pl-3" href="javascript:void(0)"><img style="width: 65px !important; height: 65px !important;" src="{{url(env("APP_URL").'storage/assets/images/logo-mini.png')}}" alt="logo"/></a>
            <button class="navbar-toggler text-success navbar-toggler align-self-center" type="button" data-toggle="minimize" style="/*position: absolute; left: 14.5rem; color: #fff !important;*/">
                <span class="mdi mdi-backburger text-success position-absolute" style="font-size: 20pt; top: 20px; background: #fff; margin-left: 5px; padding: 3px;"></span>
            </button>
        </div>
    </div>
    <div class="navbar-menu-wrapper d-flex align-items-center justify-content-end">

        <ul class="navbar-nav text-white mr-lg-2 d-none">

            <li class="nav-item nav-profile dropdown">
                <a class="nav-link" href="#" data-toggle="dropdown" id="profileDropdown">
                    <span class="nav-profile-name" style="font-size:20px !important; font-weight: 600; ">{{$labName}}</span>
                </a>
            </li>

        </ul>

        <ul class="navbar-nav text-white navbar-nav-right">

            <li class="nav-item dropdown show pl-0 ml-0 rounded-bottom-left-15 rounded-bottom-right-15">
                <a class="nav-link count-indicator dropdown-toggle d-flex justify-content-center align-items-center rounded-0 shadow-none " id="messageDropdown" href="#" data-toggle="dropdown" aria-expanded="true">
                    <i class="mdi mdi mdi-bell mx-0"></i>
                    <span class="badge rounded-25 badge-danger" style="margin-left: -10px; margin-top: -15px; border: 1px solid #404040;" id="app_notify"></span>
                    <span class="count {{count($sharedMessage)<1 ? 'd-none':''}}" style="top: 6px !important; width: 15px!important; height: 15px!important; font-size: 9px!important;">{{count($sharedMessage)}}</span>
                </a>

                <div class="dropdown-menu dropdown-menu-right navbar-dropdown preview-list" aria-labelledby="messageDropdown" id="notify"></div>
            </li>
            <li class="nav-item dropdown show pl-0 ml-0 rounded-0">
                <a style="padding-left: 9px !important; padding-right: 9px !important;" class="nav-link count-indicator dropdown-toggle d-flex justify-content-center align-items-center rounded-0" id="messageDropdown" href="#" data-toggle="dropdown" aria-expanded="true">
                    <i class="fi fi-{{$current_locale=='en'?'gb':$current_locale}} flag-icon-squared mx-0 rounded-25 "></i>
                </a>
                <div class="dropdown-menu dropdown-menu-right navbar-dropdown preview-list rounded-bottom-left-15 rounded-bottom-right-15" aria-labelledby="messageDropdown">
                    @include('partials/language_switcher')
                </div>
            </li>

            <li class="nav-item dropdown rounded-0 show pl-0 ml-0">
                <a class="nav-link count-indicator dropdown-toggle d-flex justify-content-center align-items-center rounded-0 shadow-none" id="messageDropdown" href="#" data-toggle="dropdown" aria-expanded="true">
                    <i class="mdi mdi-account-circle position-absolute"></i>
                </a>
                <div class="dropdown-menu dropdown-menu-right navbar-dropdown preview-list rounded-bottom-left-15 rounded-bottom-right-15" aria-labelledby="messageDropdown">
                    <a class="dropdown-item preview-item" href="{{url('my-profile')}}">
                        <div class="preview-item-content flex-grow">
                            <p class="font-weight-light small-text text-success mb-0 pr-5"><i class="mdi mdi-account-circle fa"></i> {{ __('general.profile') }}</p>
                        </div>
                    </a>
                    @if(count(Auth::user()->lab_covers)!=1)
                    <a class="dropdown-item preview-item" href="{{route('base.change')}}">
                        <div class="preview-item-content flex-grow">
                            <p class="font-weight-light small-text text-success mb-0 pr-5"><i class="mdi mdi-swap-horizontal fa"></i> {{ __('laboratory.change_base') }}</p>
                        </div>
                    </a>
                    @endif
                    <a class="dropdown-item preview-item" href="{{route('logout')}}">
                        <div class="preview-item-content flex-grow">
                            <p class="font-weight-light small-text text-success mb-0 pr-5"><i class="mdi mdi-logout fa"></i> {{ __('general.logout') }}</p>
                        </div>
                    </a>
                </div>
            </li>



            <li class="nav-item dropdown rounded-0 show pl-0 ml-0">
                <a class="nav-link count-indicator dropdown-toggle d-flex justify-content-center align-items-center rounded-0 shadow-none" id="messageDropdown" href="#" data-toggle="dropdown" aria-expanded="true">
                    <i class="mdi mdi-apps position-absolute"></i>
                </a>
                <div class="dropdown-menu dropdown-menu-right navbar-dropdown preview-list rounded-bottom-right-15 rounded-bottom-left-15" aria-labelledby="messageDropdown">
                    @if(\App\Http\Controllers\Helper\GlobalController::user_can(Auth::user()->role_id, ['update_laboratory_information']))
                    <a class="dropdown-item preview-item" href="{{url('laboratory-profile')}}">
                        <div class="preview-item-content flex-grow">
                            <p class="font-weight-light small-text text-success mb-0 pr-5"><i class="mdi mdi-hospital-building fa"></i> {{__('laboratory.info')}}</p>
                        </div>
                    </a>
                    @endif
                    @if(\App\Http\Controllers\Helper\GlobalController::user_can(Auth::user()->role_id, ['view_user_account','create_user_account','update_user_account', 'delete_user_account']))
                    <a class="dropdown-item preview-item" href="{{ route('user') }}">
                        <div class="preview-item-content flex-grow">
                            <p class="font-weight-light small-text text-success mb-0 pr-5"><i class="mdi mdi-account-group fa"></i> {{ __('general.manage_user_accounts') }}</p>
                        </div>
                    </a>
                    @endif
                    @if(\App\Http\Controllers\Helper\GlobalController::user_can(Auth::user()->role_id, ['view_user_role','create_user_role','update_user_role', 'delete_user_role']))
                    <a class="dropdown-item preview-item" href="{{route('role')}}">
                        <div class="preview-item-content flex-grow">
                            <p class="font-weight-light small-text text-success mb-0 pr-5"><i class="mdi mdi-account-key fa"></i> {{ __('general.manage_user_roles') }}</p>
                        </div>
                    </a>
                    @endif
                    @if(\App\Http\Controllers\Helper\GlobalController::user_can(Auth::user()->role_id, ['system_settings']))
                    <a class="dropdown-item preview-item" href="{{url('laboratory')}}">
                        <div class="preview-item-content flex-grow">
                            <p class="font-weight-light small-text text-success mb-0 pr-5"><i class="fa fa-cog fa"></i> {{ __('general.laboratory_settings') }}</p>
                        </div>
                    </a>
                    @endif
                    @if(\App\Http\Controllers\Helper\GlobalController::user_can(Auth::user()->role_id, ['view_audit_logs']))
                    <a class="dropdown-item preview-item" href="{{url('activity-logs')}}">
                        <div class="preview-item-content flex-grow">
                            <p class="font-weight-light small-text text-success mb-0 pr-5"><i class="mdi mdi-history fa"></i> {{ __('general.activity_logs') }}</p>
                        </div>
                    </a>
                    @endif
                </div>
            </li>


        </ul>
        <button class="navbar-toggler navbar-toggler-right d-lg-none align-self-center" type="button" data-toggle="offcanvas">
            <span class="mdi mdi-backburger text-white"></span>
        </button>
    </div>
</nav>



