﻿@php
    $logo = \App\Models\Utility::get_file('uploads/logo/');
    $company_logo = \App\Models\Utility::GetLogo();
    $users = \Auth::user();
    $profile = \App\Models\Utility::get_file('uploads/avatar/');
    $currantLang = $users->currentLanguage();
    $emailTemplate = App\Models\EmailTemplate::getemailTemplate();
    $lang = Auth::user()->lang ?? 'en';
    $loggedUser = Auth::user();
@endphp

@if (isset($setting['cust_theme_bg']) && $setting['cust_theme_bg'] == 'on')
<nav class="dash-sidebar light-sidebar transprent-bg">
    @else
    <nav class="dash-sidebar light-sidebar">
        @endif

        <div class="navbar-wrapper">
            <div class="m-header main-logo logo-box">
                <a href="{{ route('dashboard') }}" class="b-brand">
                    <img src="{{ asset('assets/images/payraty-logo.png') }}"
                        alt="{{ config('app.name', 'HRMGo') }}" class="logo logo-lg" style="height: 40px;">
                </a>
            </div>
            <div class="navbar-content">
                <ul class="dash-navbar">

                    <!-- dashboard-->
                    @if (\Auth::user()->type != 'company')
                    <li class="dash-item">
                        <a href="{{ route('dashboard') }}" class="dash-link"><span class="dash-micon"><i
                                    class="ti ti-home"></i></span><span class="dash-mtext">{{ __('Dashboard') }}</span></a>
                    </li>
                    @endif
                    @if (\Auth::user()->type == 'company')
                    <li class="dash-item dash-hasmenu  {{ Request::segment(1) == 'null' ? 'active dash-trigger' : '' }}">
                        <a href="#" class="dash-link"><span class="dash-micon"><i class="ti ti-home"></i></span><span
                                class="dash-mtext">{{ __('Dashboard') }}</span><span class="dash-arrow"><i
                                    data-feather="chevron-right"></i></span></a>
                        <ul class="dash-submenu ">
                            <li
                                class="dash-item {{ Request::segment(1) == null || Request::segment(1) == 'report' ? ' active dash-trigger' : '' }}">
                                <a class="dash-link" href="{{ route('dashboard') }}">{{ __('Overview') }}</a>
                            </li>

                            @if (Gate::check('Manage Report'))
                                <li class="dash-item dash-hasmenu">
                                    <a href="#!" class="dash-link"><span class=""><i
                                                class=""></i></span><span
                                            class="dash-mtext">{{ __('Report') }}</span><span class="dash-arrow"><i
                                                data-feather="chevron-right"></i></span></a>
                                    <ul class="dash-submenu">
                                        @can('Manage Report')
                                            <li class="dash-item">
                                                <a class="dash-link"
                                                    href="{{ route('report.monthly.attendance') }}">{{ __('Monthly Attendance') }}</a>
                                            </li>

                                            <li class="dash-item">
                                                <a class="dash-link"
                                                    href="{{ route('report.leave') }}">{{ __('Leave') }}</a>
                                            </li>

                                            <li class="dash-item">
                                                <a class="dash-link"
                                                    href="{{ route('report.timesheet') }}">{{ __('Timesheet') }}</a>
                                            </li>
                                        @endcan
                                    </ul>
                                </li>
                            @endif
                        </ul>
                    </li>
                    @endif
                    <!--dashboard-->

                    <!-- employee-->
                    {{-- @if (Gate::check('Manage Employee')) --}}
                    @if (\Auth::user()->type == 'employee')
                        @php
    $employee = App\Models\Employee::where('user_id', \Auth::user()->id)->first();
                        @endphp
                        <li class="dash-item {{ Request::segment(1) == 'employee' ? 'active' : '' }}">
                            <a href="{{ route('employee.show', \Illuminate\Support\Facades\Crypt::encrypt($employee->id)) }}"
                                class="dash-link"><span class="dash-micon"><i class="ti ti-user"></i></span><span
                                    class="dash-mtext">{{ __('Employee') }}</span></a>
                        </li>
                    @else
                        <li class="dash-item {{ Request::segment(1) == 'employee' ? 'active' : '' }}">
                            <a href="{{ route('employee.index') }}" class="dash-link"><span class="dash-micon"><i
                                        class="ti ti-user"></i></span><span
                                    class="dash-mtext">{{ __('Employee') }}</span></a>
                        </li>
                    @endif
                    {{-- @endif --}}

                    <!--timesheet-->
                    @if (Gate::check('Manage Attendance') || Gate::check('Manage Leave') || Gate::check('Manage TimeSheet'))
                    <li
                        class="dash-item dash-hasmenu {{ Request::segment(1) == 'calender' && Request::segment(2) == 'leave' ? 'dash-trigger active' : '' }}">
                        <a href="#!" class="dash-link"><span class="dash-micon"><i class="ti ti-clock"></i></span><span
                                class="dash-mtext">{{ __('Timesheet') }}</span><span class="dash-arrow"><i
                                    data-feather="chevron-right"></i></span></a>
                        <ul class="dash-submenu">
                            @can('Manage TimeSheet')
                                <li class="dash-item">
                                    <a class="dash-link" href="{{ route('timesheet.index') }}">{{ __('Timesheet') }}</a>
                                </li>
                            @endcan

                            @can('Manage Leave')
                                <li class="dash-item {{ Request::segment(1) == 'calender' ? ' active' : '' }}">
                                    <a class="dash-link" href="{{ route('leave.index') }}">{{ __('Manage Leave') }}</a>
                                </li>
                            @endcan

                            @can('Manage Attendance')
                                <li class="dash-item dash-hasmenu">
                                    <a href="#!" class="dash-link"><span
                                            class="dash-mtext">{{ __('Attendance') }}</span><span class="dash-arrow"><i
                                                data-feather="chevron-right"></i></span></a>
                                    <ul class="dash-submenu">
                                        <li class="dash-item">
                                            <a class="dash-link"
                                                href="{{ route('attendanceemployee.index') }}">{{ __('Marked Attendance') }}</a>
                                        </li>
                                        @can('Create Attendance')
                                            <li class="dash-item">
                                                <a class="dash-link"
                                                    href="{{ route('attendanceemployee.bulkattendance') }}">{{ __('Bulk Attendance') }}</a>
                                            </li>
                                        @endcan
                                    </ul>
                                </li>
                            @endcan
                        </ul>
                    </li>
                    @endif
                    <!--timesheet-->

                    <!--trainning-->
                    @if (Gate::check('Manage Trainer') || Gate::check('Manage Training'))
                        <li
                            class="dash-item dash-hasmenu {{ Request::segment(1) == 'training' ? 'dash-trigger active' : '' }}">
                            <a href="#!" class="dash-link "><span class="dash-micon"><i
                                        class="ti ti-school"></i></span><span
                                    class="dash-mtext">{{ __('Training') }}</span><span class="dash-arrow"><i
                                        data-feather="chevron-right"></i></span></a>
                            <ul class="dash-submenu">
                                @can('Manage Training')
                                    <li class="dash-item {{ Request::segment(1) == 'training' ? ' active' : '' }}">
                                        <a class="dash-link" href="{{ route('training.index') }}">{{ __('Training List') }}</a>
                                    </li>
                                @endcan

                                @can('Manage Trainer')
                                    <li class="dash-item ">
                                        <a class="dash-link" href="{{ route('trainer.index') }}">{{ __('Trainer') }}</a>
                                    </li>
                                @endcan
                            </ul>
                        </li>
                    @endif
                    <!-- tranning-->

                    <!-- performance-->
                    {{-- @if (Gate::check('manage goals')) --}}
                    <li class="dash-item dash-hasmenu">
                        <a href="#!" class="dash-link"><span class="dash-micon"><i
                                    class="ti ti-3d-cube-sphere"></i></span><span
                                class="dash-mtext">{{ __('Performance') }}</span><span class="dash-arrow"><i
                                    data-feather="chevron-right"></i></span></a>
                        <ul class="dash-submenu">
                            <!-- <li class="dash-item">
                                    <a class="dash-link" href="{{ route('indicator.index') }}">{{ __('Indicator') }}</a>
                                </li> -->
                            <li class="dash-item">
                                <a class="dash-link" href="{{ route('simple-goals.index') }}">{{ __('Goals') }}</a>
                            </li>

                            <li class="dash-item">
                                <a class="dash-link"
                                    href="{{ route('appraisal_reviews.index') }}">{{ __('Appraisal') }}</a>
                            </li>
                            @if (\Auth::user()->type == 'company')
                                <li class="dash-item">
                                    <a class="dash-link"
                                        href="{{ route('compensation_outcome.index') }}">{{ __('Compensation Outcomes') }}</a>
                                </li>
                            @endif
                        </ul>
                    </li>
                    {{-- @endif --}}
                    <!--performance-->

                    <!-- recruitment-->
                    @if (
    Gate::check('Manage Job') ||
    Gate::check('Manage Job Application') ||
    Gate::check('Manage Job OnBoard') ||
    Gate::check('Manage Custom Question') ||
    Gate::check('Manage Interview Schedule') ||
    Gate::check('Manage Career')
)
                                                <li
                                                    class="dash-item dash-hasmenu  {{ Request::segment(1) == 'job' || Request::segment(1) == 'job-application' ? 'dash-trigger active' : '' }} ">
                                                    <a href="#!" class="dash-link"><span class="dash-micon"><i
                                                                class="ti ti-license"></i></span><span
                                                            class="dash-mtext">{{ __('Recruitment') }}</span><span class="dash-arrow"><i
                                                                data-feather="chevron-right"></i></span></a>
                                                    <ul class="dash-submenu">
                                                        @can('Manage Job')
                                                            <li
                                                                class="dash-item {{ Request::route()->getName() == 'job.index' ? 'active' : 'dash-hasmenu' }}">
                                                                <a class="dash-link" href="{{ route('job.index') }}">{{ __('Jobs') }}</a>
                                                            </li>
                                                        @endcan
                                                        @can('Manage Job')
                                                            <li
                                                                class="dash-item {{ Request::route()->getName() == 'job.create' ? 'active' : 'dash-hasmenu' }}">
                                                                <a class="dash-link" href="{{ route('job.create') }}">{{ __('Job Create ') }}</a>
                                                            </li>
                                                        @endcan
                                                        @can('Manage Job Application')
                                                            <li class="dash-item {{ request()->is('job-application*') ? 'active' : '' }}">
                                                                <a class="dash-link"
                                                                    href="{{ route('job-application.index') }}">{{ __('Job Application') }}</a>
                                                            </li>
                                                        @endcan
                                                        @can('Manage Job Application')
                                                            <li
                                                                class="dash-item {{ request()->is('candidates-job-applications') ? 'active' : '' }}">
                                                                <a class="dash-link"
                                                                    href="{{ route('job.application.candidate') }}">{{ __('Job Candidate') }}</a>
                                                            </li>
                                                        @endcan
                                                        @can('Manage Job OnBoard')
                                                            <li class="dash-item">
                                                                <a class="dash-link"
                                                                    href="{{ route('job.on.board') }}">{{ __('Job On-Boarding') }}</a>
                                                            </li>
                                                        @endcan
                                                        @can('Manage Custom Question')
                                                            <li class="dash-item">
                                                                <a class="dash-link"
                                                                    href="{{ route('custom-question.index') }}">{{ __('Custom Question') }}</a>
                                                            </li>
                                                        @endcan
                                                        @can('Manage Interview Schedule')
                                                            <li class="dash-item">
                                                                <a class="dash-link"
                                                                    href="{{ route('interview-schedule.index') }}">{{ __('Interview Schedule') }}</a>
                                                            </li>
                                                        @endcan
                                                        @can('Manage Career')
                                                            <li class="dash-item">
                                                                <a class="dash-link"
                                                                    href="{{ route('career', [\Auth::user()->creatorId(), $lang]) }}"
                                                                    target="_blank">{{ __('Career') }}</a>
                                                            </li>
                                                        @endcan
                                                    </ul>
                                                </li>
                    @endif

                    <!-- Event-->
                    @can('Manage Event')
                        <li class="dash-item">
                            <a href="{{ route('event.index') }}" class="dash-link"><span class="dash-micon"><i
                                        class="ti ti-calendar-event"></i></span><span
                                    class="dash-mtext">{{ __('Event') }}</span>
                            </a>
                        </li>
                    @endcan

                    <!--meeting-->
                    @can('Manage Meeting')
                        <li
                            class="dash-item {{ Request::segment(1) == 'meeting' || Request::segment(2) == 'meeting' ? 'active' : '' }}">
                            <a href="{{ route('meeting.index') }}" class="dash-link"><span class="dash-micon"><i
                                        class="ti ti-calendar-time"></i></span><span
                                    class="dash-mtext">{{ __('Meeting') }}</span></a>
                        </li>
                    @endcan

                    <!-- ticket-->
                     @can('Manage Ticket')
                        <li class="dash-item {{ Request::segment(1) == 'ticket' ? 'active' : '' }}">
                            <a href="{{ route('ticket.index') }}" class="dash-link"><span class="dash-micon"><i
                                        class="ti ti-ticket"></i></span><span
                                    class="dash-mtext">{{ __('Ticket') }}</span></a>
                        </li>
                    @endcan

                    <!-- audit-->


                    @if (\Auth::user()->type == 'super admin')
                        @if (Gate::check('Manage Plan'))
                            <li class="dash-item ">
                                <a href="{{ route('plans.index') }}" class="dash-link"><span class="dash-micon"><i
                                            class=" ti ti-trophy"></i></span><span
                                        class="dash-mtext">{{ __('Plan') }}</span></a>
                            </li>
                        @endif
                    @endif
                    @if (\Auth::user()->type == 'super admin')
                        <li class="dash-item ">
                            <a href="{{ route('plan_request.index') }}" class="dash-link"><span
                                    class="dash-micon"><i class="ti ti-arrow-down-right-circle"></i></span><span
                                    class="dash-mtext">{{ __('Plan Request') }}</span></a>
                        </li>
                    @endif

                    @if (\Auth::user()->type == 'super admin')
                        <li class="dash-item dash-hasmenu  {{ Request::segment(1) == '' ? 'active' : '' }}">
                            <a href="{{ route('referral-program.index') }}" class="dash-link">
                                <span class="dash-micon"><i class="ti ti-discount-2"></i></span><span
                                    class="dash-mtext">{{ __('Referral Program') }}</span>
                            </a>
                        </li>
                    @endif

                    @if (Auth::user()->type == 'super admin')
                        @if (Gate::check('manage coupon'))
                            <li
                                class="dash-item dash-hasmenu {{ Request::segment(1) == 'coupons' ? 'active' : '' }}">
                                <a href="{{ route('coupons.index') }}" class="dash-link"><span
                                        class="dash-micon"><i class="ti ti-gift"></i></span><span
                                        class="dash-mtext">{{ __('Coupon') }}</span></a>
                            </li>
                        @endif
                    @endif
                    @if (\Auth::user()->type == 'super admin')
                        @if (Gate::check('Manage Order'))
                            <li class="dash-item ">
                                <a href="{{ route('order.index') }}"
                                    class="dash-link {{ request()->is('orders*') ? 'active' : '' }}"><span
                                        class="dash-micon"><i class="ti ti-shopping-cart"></i></span><span
                                        class="dash-mtext">{{ __('Order') }}</span></a>
                            </li>
                        @endif
                    @endif

                    @if (\Auth::user()->type == 'super admin')
                    <li
                        class="dash-item {{ Request::route()->getName() == 'email_template.index' || Request::segment(1) == 'email_template_lang' || Request::route()->getName() == 'manageemail.lang' ? 'active' : '' }}">
                        <a href="{{ route('email_template.index') }}" class="dash-link"><span
                                class="dash-micon"><i class="ti ti-template"></i></span><span
                                class="dash-mtext">{{ __('Email Templates') }}</span></a>
                    </li>
                    @endif

                    @if (\Auth::user()->type == 'company')
                    <li class="dash-item">
                        <a href="{{ route('audits.index') }}" class="dash-link"><span class="dash-micon"><i
                                    class="ti ti-report"></i></span><span
                                class="dash-mtext">Audit</span></a>
                    </li>
                    @endif
                        @if (\Auth::user()->type == 'company')

                        @if (
        Gate::check('Manage Department') ||
        Gate::check('Manage Designation') ||
        Gate::check('Manage Document Type') ||
        Gate::check('Manage Branch') ||
        Gate::check('Manage Award Type') ||
        Gate::check('Manage Termination Types') ||
        Gate::check('Manage Payslip Type') ||
        Gate::check('Manage Allowance Option') ||
        Gate::check('Manage Loan Options') ||
        Gate::check('Manage Deduction Options') ||
        Gate::check('Manage Expense Type') ||
        Gate::check('Manage Income Type') ||
        Gate::check('Manage Payment Type') ||
        Gate::check('Manage Leave Type') ||
        Gate::check('Manage Training Type') ||
        Gate::check('Manage Job Category') ||
        Gate::check('Manage Job Stage')
    )
                            <li
                                class="dash-item dash-hasmenu {{ Request::route()->getName() == 'branch.index' || Request::route()->getName() == 'department.index' || Request::route()->getName() == 'designation.index' || Request::route()->getName() == 'leavetype.index' || Request::route()->getName() == 'document.index' || Request::route()->getName() == 'paysliptype.index' || Request::route()->getName() == 'allowanceoption.index' || Request::route()->getName() == 'loanoption.index' || Request::route()->getName() == 'deductionoption.index' || Request::route()->getName() == 'goaltype.index' || Request::route()->getName() == 'trainingtype.index' || Request::route()->getName() == 'awardtype.index' || Request::route()->getName() == 'terminationtype.index' || Request::route()->getName() == 'job-category.index' || Request::route()->getName() == 'job-stage.index' || Request::route()->getName() == 'performanceType.index' || Request::route()->getName() == 'competencies.index' || Request::route()->getName() == 'expensetype.index' || Request::route()->getName() == 'incometype.index' || Request::route()->getName() == 'paymenttype.index' || Request::route()->getName() == 'contract_type.index' ? ' active' : '' }}">
                                <a href="{{ route('branch.index') }}" class="dash-link"><span class="dash-micon"><i
                                            class="ti ti-table"></i></span><span
                                        class="dash-mtext">{{ __('HRIS Setup') }}</span></a>
                            </li>
                        @endif
                    @endif

                </ul>
            </div>
        </div>
    </na