<section class="sidemenu">
    <div class="logo">
        <img src="{{asset(settings('website_logo'))}}" alt="">
    </div>

    <ul class="sidemenu-links">
        <li class="{{ $activeMenu[""] ?? '' }}">
            <!--<a href="{{url('/admin')}}"> <i class="fas fa-chart-line"></i> <span>{{ __('dashboard.dashboard') }}</span></a>-->
            <a href="{{url('/admin')}}"> <img src="{{asset('/assets/admin/images/icons/home.png')}}" alt="" class="icon"> <span>{{ __('dashboard.dashboard') }}</span></a>
        </li>

        @foreach ($modules as $module)


            @if (in_array($module['path'], $exceptedModules))

                <li class="{{ $activeMenu[$module['path']] ?? '' }}">
                    <a href="{{ route("{$module['path']}.index") }}">

                        <i class="{{ __($module['path'].'.menuIcon') ?? 'fas fa-edit' }}"></i>
                        <span>{{$moduleName ?? __($module['path'].'.head') }}</span>

                    </a>
                </li>

            @elseif ( $module['path'] == 'products' )

                <li class="linkGroup  {{ $activeMenu[$module['path']] ?? '' }}">
                    <a  class="linkItem-head"> <i class="{{ __($module['path'].'.menuIcon') ?? 'fas fa-edit' }}"></i> <span> {{ $moduleName ??__($module['path'].'.head') }} </span></a>
                    <ul class="linkItem-body">
                        <li>
                            <a href='{{ route("{$module['path']}.index") }}'>{{$moduleName ?? __($module['path'].'.head') }}</a>
                        </li>
                        <li>
                            <a href="{{ route("{$module['path']}.create")  }}">{{ $moduleAddNew ?? __($module['path'].'.new')}}</a>
                        </li>
                        <li>
                            <a href="{{ route("{$module['path']}.index").'?valid=0'  }}">{{ $moduleAddNew ?? __($module['path'].'.head')}} {{__('products.hold')}}</a>
                        </li>
                        <li>
                            <a href="{{ route("{$module['path']}.index").'?valid=2'  }}">{{ $moduleAddNew ?? __($module['path'].'.head')}} {{__('products.reject')}}</a>
                        </li>

                    </ul>
                </li>
            @elseif ( $module['path'] == 'stocks' )

                <li class="linkGroup  {{ $activeMenu[$module['path']] ?? '' }}">
                    <a  class="linkItem-head"> <i class="{{ __($module['path'].'.menuIcon') ?? 'fas fa-edit' }}"></i> <span> {{ $moduleName ??__($module['path'].'.head') }} </span></a>
                    <ul class="linkItem-body">
                        <li>
                            <a href='{{ route("{$module['path']}.index") }}'>{{$moduleName ?? __($module['path'].'.head') }}</a>
                        </li>
                        <li>
                            <a href="{{ route("{$module['path']}.create")  }}">{{ $moduleAddNew ?? __($module['path'].'.new')}}</a>
                        </li>
                        <li>
                            <a href="{{ route("{$module['path']}.report")  }}">{{ $moduleAddNew ?? __($module['path'].'.report')}} </a>
                        </li>


                    </ul>
                </li>
            @elseif (in_array($module['path'], $hiddenModules))
            @else
                <li class="linkGroup  {{ $activeMenu[$module['path']] ?? '' }}">
                    <a  class="linkItem-head"> <i class="{{ __($module['path'].'.menuIcon') ?? 'fas fa-edit' }}"></i> <span> {{ $moduleName ??__($module['path'].'.head') }} </span></a>
                    <ul class="linkItem-body">
                        <li>
                            <a href='{{ route("{$module['path']}.index") }}'>{{$moduleName ?? __($module['path'].'.head') }}</a>
                        </li>
                        <li>
                                <a href="{{ route("{$module['path']}.create")  }}">{{ $moduleAddNew ?? __($module['path'].'.new')}}</a>
                        </li>

                    </ul>
                </li>
            @endif

        @endforeach
        <li>
            <a data-toggle="modal" data-target="#logout" href="{{ route('admin_logout') }}" ><i class="fas fa-sign-out-alt"></i> <span> {{ __('dashboard.logout') }} </span></a>
        </li>
    </ul>
</section>



{{-- Log out Modal --}}

<!-- Modal -->
<div class="modal fade" id="logout" tabindex="-1" role="dialog" aria-labelledby="exampleModalLabel" aria-hidden="true">
    <div class="modal-dialog" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="exampleModalLabel">{{__('dashboard.confirm_logout')}}</h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <h3>{{__('dashboard.sure')}} <i class="fa fa-exclamation-circle text-danger"></i></h3>
                <form id="logout-form-side" action="{{ route('admin_logout') }}" method="POST" style="display: none;">
                    @csrf
                </form>
            </div>
            <div class="modal-footer justify-content-between">
                <button type="button" class="btn btn-secondary" data-dismiss="modal">{{__('dashboard.close')}}</button>
                <button onclick="document.getElementById('logout-form-side').submit()" type="button" class="btn btn-primary">{{__('dashboard.logout')}}</button>
            </div>
        </div>
    </div>
</div>


