<div class="app-sidebar colored">
    <div class="sidebar-header">
        <a class="header-brand" href="{{route('dashboard')}}">
            <div class="logo-img">
               <img height="65" src="{{ asset('img/logo_white.png')}}" class="header-brand-img" title="RADMIN"> 
            </div>
        </a>
        <div class="sidebar-action"><i class="ik ik-arrow-left-circle"></i></div>
        <button id="sidebarClose" class="nav-close"><i class="ik ik-x"></i></button>
    </div>

    @php
        $segment1 = request()->segment(1); 
        
        $segment2 = request()->segment(2);
    @endphp
    
    <div class="sidebar-content">
        <div class="nav-container">
            <nav id="main-menu-navigation" class="navigation-main">
                <div class="nav-item {{ ($segment1 == 'dashboard') ? 'active' : '' }}">
                    <a href="{{route('dashboard')}}"><i class="ik ik-bar-chart-2"></i><span>{{ __('Dashboard')}}</span></a>
                </div>
                
                <?php
                use App\User;
                $id = Auth::user()->id;
                $user  = User::with('roles','permissions')->find($id);
                $role_name  = Auth::user()->roles->pluck('name');
                ?>

                @if($role_name[0] == "Super Admin" || $role_name[0] == "Admin")
                <div class="nav-item {{ ($segment1 == 'users' || $segment1 == 'roles'||$segment1 == 'permission' ||$segment1 == 'user') ? 'active open' : '' }} has-sub">
                    <a href="#"><i class="ik ik-user"></i><span>{{ __('Adminstrator')}}</span></a>
                    <div class="submenu-content">
                        <!-- only those have manage_user permission will get access -->
                        @can('manage_user')
                        <a href="{{url('users')}}" class="menu-item {{ ($segment1 == 'users') ? 'active' : '' }}">{{ __('Users')}}</a>
                        <a href="{{url('user/create')}}" class="menu-item {{ ($segment1 == 'user' && $segment2 == 'create') ? 'active' : '' }}">{{ __('Add User')}}</a>
                         @endcan
                         <!-- only those have manage_role permission will get access -->
                        <!--@can('manage_roles')-->
                        <!--<a href="{{url('roles')}}" class="menu-item {{ ($segment1 == 'roles') ? 'active' : '' }}">{{ __('Roles')}}</a>-->
                        <!--@endcan-->
                        <!-- only those have manage_permission permission will get access -->
                        <!--@can('manage_permission')-->
                        <!--<a href="{{url('permission')}}" class="menu-item {{ ($segment1 == 'permission') ? 'active' : '' }}">{{ __('Permission')}}</a>-->
                        <!--@endcan-->
                    </div>
                </div>
                
                <div class="nav-lavel">{{ __('Master Pages View')}} </div>
                <div class="nav-item {{ ($segment1 == 'form-components' || $segment1 == 'form-advance'||$segment1 == 'form-addon') ? 'active open' : '' }} has-sub">
                    <a href="#"><i class="ik ik-edit"></i><span>{{ __('DT/ST/ART Master')}}</span></a>
                    <div class="submenu-content" id="master">
                        <a href="{{url('state-master-data')}}" class="menu-item {{ ($segment1 == 'state-master-data') ? 'active' : '' }}">{{ __('State Master Data')}}</a>
                        <a href="{{url('district-master-data')}}" class="menu-item {{ ($segment1 == 'district-master-data') ? 'active' : '' }}">{{ __('District Master Data')}}</a>
                        <a href="{{url('artcenter-master-data')}}" class="menu-item {{ ($segment1 == 'artcenter-master-data') ? 'active' : '' }}">{{ __('ART Center Master(ACM)')}}</a>
                    </div>
                </div>
                <div class="nav-item {{ ($segment1 == 'form-components' || $segment1 == 'form-advance'||$segment1 == 'form-addon') ? 'active open' : '' }} has-sub">
                    <a href="#"><i class="ik ik-edit"></i><span>{{ __('Outreach Input (ORI)')}}</span></a>
                    <div class="submenu-content">
                        <a href="{{url('lfumis-master-data')}}" class="menu-item {{ ($segment1 == 'lfumis-master-data') ? 'active' : '' }}">{{ __('LFU_MIS')}}</a>
                        <a href="{{url('hd-master-data')}}" class="menu-item {{ ($segment1 == 'hd-master-data') ? 'active' : '' }}">{{ __('Home Delivery')}}</a>
                        <a href="{{url('vl-master-data')}}" class="menu-item {{ ($segment1 == 'vl-master-data') ? 'active' : '' }}">{{ __('VL')}}</a>
                    </div>
                </div>
                <div class="nav-item {{ ($segment1 == 'form-components' || $segment1 == 'form-advance'||$segment1 == 'form-addon') ? 'active open' : '' }} has-sub">
                    <a href="#"><i class="ik ik-edit"></i><span>{{ __('Calling Input (CI)')}}</span></a>
                    <div class="submenu-content">
                        <a href="{{url('lfuci-master-data')}}" class="menu-item {{ ($segment1 == 'lfuci-master-data') ? 'active' : '' }}">{{ __('LFU_MIS')}}</a>
                        <a href="{{url('cd4ci-master-data')}}" class="menu-item {{ ($segment1 == 'cd4ci-master-data') ? 'active' : '' }}">{{ __('CD4_TLD_VLT')}}</a>
                        <a href="{{url('duedate-master-data')}}" class="menu-item {{ ($segment1 == 'duedate-master-data') ? 'active' : '' }}">{{ __('Due Date Call')}}</a>
                        <a href="{{url('tbfollow-master-data')}}" class="menu-item {{ ($segment1 == 'tbfollow-master-data') ? 'active' : '' }}">{{ __('TB Follow up')}}</a>
                    </div>
                </div>
                <div class="nav-item {{ ($segment1 == 'form-components' || $segment1 == 'form-advance'||$segment1 == 'form-addon') ? 'active open' : '' }} has-sub">
                    <a href="#"><i class="ik ik-edit"></i><span>{{ __('EAC Input ( EACI)')}}</span></a>
                    <div class="submenu-content">
                        <a href="{{url('bta-master-data')}}" class="menu-item {{ ($segment1 == 'bta-master-data') ? 'active' : '' }}">{{ __('Barrier to Adherence')}}</a>
                        <a href="{{url('int-master-data')}}" class="menu-item {{ ($segment1 == 'int-master-data') ? 'active' : '' }}">{{ __('Intervention')}}</a>
                        <a href="{{url('adh-master-data')}}" class="menu-item {{ ($segment1 == 'adh-master-data') ? 'active' : '' }}">{{ __('Adherence')}}</a>
                        <a href="{{url('sup-master-data')}}" class="menu-item {{ ($segment1 == 'sup-master-data') ? 'active' : '' }}">{{ __('Support provided by Accelerate')}}</a>
                    </div>
                </div>
                @endif

                <div class="nav-lavel">{{ __('Form Pages') }}</div>
                <div class="nav-item {{ ($segment1 == 'form-components' || $segment1 == 'form-advance'||$segment1 == 'form-addon') ? 'active open' : '' }} has-sub">
                    <a href="#"><i class="ik ik-edit"></i><span>{{ __('Forms')}}</span></a>
                    <div class="submenu-content">
                        @if(\Session::get('loggindata')->client_reg_add =='Yes')
                        <a href="{{url('patient-register')}}" class="menu-item {{ ($segment1 == 'patient-register') ? 'active' : '' }}">{{ __('Client Registration')}}</a>
                        @endif
                        @if(\Session::get('loggindata')->client_map_add == 'Yes')
                        <a href="{{url('patient-mapping')}}" class="menu-item {{ ($segment1 == 'patient-mapping') ? 'active' : '' }}">{{ __('Client Mapping')}}</a>
                        @endif
                        @if(\Session::get('loggindata')->outreach_add == 'Yes')
                        <a href="{{url('outreach-input')}}" class="menu-item {{ ($segment1 == 'outreach-input') ? 'active' : '' }}">{{ __('Outreach Input')}}</a>
                        @endif
                        @if(\Session::get('loggindata')->calling_add == 'Yes')
                        <a href="{{url('calling-input')}}" class="menu-item {{ ($segment1 == 'calling-input') ? 'active' : '' }}">{{ __('Calling Input')}}</a>
                        @endif
                        @if(\Session::get('loggindata')->eac_add == 'Yes')
                        <a href="{{url('eac-input')}}" class="menu-item {{ ($segment1 == 'eac-input') ? 'active' : '' }}">{{ __('EAC Input')}}</a>
                        @endif
                        @if(\Session::get('loggindata')->doe_add == 'Yes')
                        <a href="{{url('deo-input')}}" class="menu-item {{ ($segment1 == 'deo-input') ? 'active' : '' }}">{{ __('Data Entry Operator')}}</a>
                        @endif
                    </div>
                </div>
                
                <div class="nav-lavel">{{ __('Form View') }}</div>
                <div class="nav-item {{ ($segment1 == 'form-components' || $segment1 == 'form-advance'||$segment1 == 'form-addon') ? 'active open' : '' }} has-sub">
                    <a href="#"><i class="ik ik-edit"></i><span>{{ __('Form View')}}</span></a>
                    <div class="submenu-content">
                        @if(\Session::get('loggindata')->client_reg_view == 'Yes')
                        <a href="{{url('patient-register-data')}}" class="menu-item {{ ($segment1 == 'patient-register-data') ? 'active' : '' }}">{{ __('Client Registration Data')}}</a>
                        @endif
                        @if(\Session::get('loggindata')->client_map_view == 'Yes')
                        <a href="{{url('patient-mapping-data')}}" class="menu-item {{ ($segment1 == 'patient-mapping-data') ? 'active' : '' }}">{{ __('Client Mapping Data')}}</a>
                        @endif
                        @if(\Session::get('loggindata')->outreach_view == 'Yes')
                        <a href="{{url('outreach-input-data')}}" class="menu-item {{ ($segment1 == 'outreach-input-data') ? 'active' : '' }}">{{ __('Outreach Input Data')}}</a>
                        @endif
                        @if(\Session::get('loggindata')->calling_view == 'Yes')
                        <a href="{{url('calling-input-data')}}" class="menu-item {{ ($segment1 == 'calling-input-data') ? 'active' : '' }}">{{ __('Calling Input Data')}}</a>
                        @endif
                        @if(\Session::get('loggindata')->eac_view == 'Yes')
                        <a href="{{url('eac-input-data')}}" class="menu-item {{ ($segment1 == 'eac-input-data') ? 'active' : '' }}">{{ __('EAC Input Data')}}</a>
                        @endif
                        @if(\Session::get('loggindata')->doe_view == 'Yes')
                        <a href="{{url('deo-input-data')}}" class="menu-item {{ ($segment1 == 'deo-input-data') ? 'active' : '' }}">{{ __('Data Entry Operator Data')}}</a>
                        @endif
                    </div>
                </div>
                
                @if(\Session::get('loggindata')->report_view =='Yes')
                <div class="nav-lavel">{{ __('Report') }}</div>
                <div class="nav-item {{ ($segment1 == 'form-components' || $segment1 == 'form-advance'||$segment1 == 'form-addon') ? 'active open' : '' }} has-sub">
                    <a href="#"><i class="ik ik-edit"></i><span>{{ __('Report')}}</span></a>
                    <div class="submenu-content">
                        <a href="{{url('outreach-input-report')}}" class="menu-item {{ ($segment1 == 'outreach-input-report') ? 'active' : '' }}">{{ __('Outreach Input')}}</a>
                    </div>
                    <div class="submenu-content">
                        <a href="{{url('calling-input-report')}}" class="menu-item {{ ($segment1 == 'calling-input-report') ? 'active' : '' }}">{{ __('Calling Input')}}</a>
                    </div>
                    <div class="submenu-content">
                        <a href="{{url('eac-input-report')}}" class="menu-item {{ ($segment1 == 'eac-input-report') ? 'active' : '' }}">{{ __('EAC Input')}}</a>
                    </div>
                    <div class="submenu-content">
                        <a href="{{url('linelist-summary-report')}}" class="menu-item {{ ($segment1 == 'linelist-summary-report') ? 'active' : '' }}">{{ __('Linelist Summary')}}</a>
                    </div>
                </div>
                <div class="nav-lavel">{{ __('Report') }}</div>
                <div class="nav-item {{ ($segment1 == 'form-components' || $segment1 == 'form-advance'||$segment1 == 'form-addon') ? 'active open' : '' }} has-sub">
                    <a href="#"><i class="ik ik-edit"></i><span>{{ __('Ageing Report')}}</span></a>
                    <div class="submenu-content">
                        <a href="{{url('outreach-ageing-report')}}" class="menu-item {{ ($segment1 == 'outreach-ageing-report') ? 'active' : '' }}">{{ __('Outreach Input')}}</a>
                    </div>
                    <div class="submenu-content">
                        <a href="{{url('calling-ageing-report')}}" class="menu-item {{ ($segment1 == 'calling-ageing-report') ? 'active' : '' }}">{{ __('Calling Input')}}</a>
                    </div>
                    <div class="submenu-content">
                        <a href="{{url('eac-ageing-report')}}" class="menu-item {{ ($segment1 == 'eac-ageing-report') ? 'active' : '' }}">{{ __('EAC Input')}}</a>
                    </div>
                </div>
                @endif
                @if($role_name[0] == "Super Admin" || $role_name[0] == "Admin")
                <div class="nav-lavel">{{ __('Logs Detail')}} </div>
                <div class="nav-item {{ ($segment1 == 'form-components' || $segment1 == 'form-advance'||$segment1 == 'form-addon') ? 'active open' : '' }}">
                    <a href="{{route('user_logs')}}"><i class="ik ik-edit"></i><span>{{ __('View User Logs')}}</span></a>
                </div>
                @endif
            </nav>
        </div>
    </div>
</div>