<?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();
?>

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

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

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

                            <?php 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"><?php echo e(__('Report')); ?></span><span class="dash-arrow"><i
                                                data-feather="chevron-right"></i></span></a>
                                    <ul class="dash-submenu">
                                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Manage Report')): ?>
                                            <li class="dash-item">
                                                <a class="dash-link"
                                                    href="<?php echo e(route('report.monthly.attendance')); ?>"><?php echo e(__('Monthly Attendance')); ?></a>
                                            </li>

                                            <li class="dash-item">
                                                <a class="dash-link"
                                                    href="<?php echo e(route('report.leave')); ?>"><?php echo e(__('Leave')); ?></a>
                                            </li>

                                            <li class="dash-item">
                                                <a class="dash-link"
                                                    href="<?php echo e(route('report.timesheet')); ?>"><?php echo e(__('Timesheet')); ?></a>
                                            </li>
                                        <?php endif; ?>
                                    </ul>
                                </li>
                            <?php endif; ?>
                        </ul>
                    </li>
                    <?php endif; ?>
                    <!--dashboard-->

                    <!-- employee-->
                    
                    <?php if(\Auth::user()->type == 'employee'): ?>
                        <?php
    $employee = App\Models\Employee::where('user_id', \Auth::user()->id)->first();
                        ?>
                        <li class="dash-item <?php echo e(Request::segment(1) == 'employee' ? 'active' : ''); ?>">
                            <a href="<?php echo e(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"><?php echo e(__('Employee')); ?></span></a>
                        </li>
                    <?php else: ?>
                        <li class="dash-item <?php echo e(Request::segment(1) == 'employee' ? 'active' : ''); ?>">
                            <a href="<?php echo e(route('employee.index')); ?>" class="dash-link"><span class="dash-micon"><i
                                        class="ti ti-user"></i></span><span
                                    class="dash-mtext"><?php echo e(__('Employee')); ?></span></a>
                        </li>
                    <?php endif; ?>
                    

                    <!--timesheet-->
                    <?php if(Gate::check('Manage Attendance') || Gate::check('Manage Leave') || Gate::check('Manage TimeSheet')): ?>
                    <li
                        class="dash-item dash-hasmenu <?php echo e(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"><?php echo e(__('Timesheet')); ?></span><span class="dash-arrow"><i
                                    data-feather="chevron-right"></i></span></a>
                        <ul class="dash-submenu">
                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Manage TimeSheet')): ?>
                                <li class="dash-item">
                                    <a class="dash-link" href="<?php echo e(route('timesheet.index')); ?>"><?php echo e(__('Timesheet')); ?></a>
                                </li>
                            <?php endif; ?>

                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Manage Leave')): ?>
                                <li class="dash-item <?php echo e(Request::segment(1) == 'calender' ? ' active' : ''); ?>">
                                    <a class="dash-link" href="<?php echo e(route('leave.index')); ?>"><?php echo e(__('Manage Leave')); ?></a>
                                </li>
                            <?php endif; ?>

                            <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Manage Attendance')): ?>
                                <li class="dash-item dash-hasmenu">
                                    <a href="#!" class="dash-link"><span
                                            class="dash-mtext"><?php echo e(__('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="<?php echo e(route('attendanceemployee.index')); ?>"><?php echo e(__('Marked Attendance')); ?></a>
                                        </li>
                                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Create Attendance')): ?>
                                            <li class="dash-item">
                                                <a class="dash-link"
                                                    href="<?php echo e(route('attendanceemployee.bulkattendance')); ?>"><?php echo e(__('Bulk Attendance')); ?></a>
                                            </li>
                                        <?php endif; ?>
                                    </ul>
                                </li>
                            <?php endif; ?>
                        </ul>
                    </li>
                    <?php endif; ?>
                    <!--timesheet-->

                    <!--trainning-->
                    <?php if(Gate::check('Manage Trainer') || Gate::check('Manage Training')): ?>
                        <li
                            class="dash-item dash-hasmenu <?php echo e(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"><?php echo e(__('Training')); ?></span><span class="dash-arrow"><i
                                        data-feather="chevron-right"></i></span></a>
                            <ul class="dash-submenu">
                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Manage Training')): ?>
                                    <li class="dash-item <?php echo e(Request::segment(1) == 'training' ? ' active' : ''); ?>">
                                        <a class="dash-link" href="<?php echo e(route('training.index')); ?>"><?php echo e(__('Training List')); ?></a>
                                    </li>
                                <?php endif; ?>

                                <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Manage Trainer')): ?>
                                    <li class="dash-item ">
                                        <a class="dash-link" href="<?php echo e(route('trainer.index')); ?>"><?php echo e(__('Trainer')); ?></a>
                                    </li>
                                <?php endif; ?>
                            </ul>
                        </li>
                    <?php endif; ?>
                    <!-- tranning-->

                    <!-- performance-->
                    
                    <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"><?php echo e(__('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="<?php echo e(route('indicator.index')); ?>"><?php echo e(__('Indicator')); ?></a>
                                </li> -->
                            <li class="dash-item">
                                <a class="dash-link" href="<?php echo e(route('simple-goals.index')); ?>"><?php echo e(__('Goals')); ?></a>
                            </li>

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

                    <!-- recruitment-->
                    <?php 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  <?php echo e(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"><?php echo e(__('Recruitment')); ?></span><span class="dash-arrow"><i
                                                                data-feather="chevron-right"></i></span></a>
                                                    <ul class="dash-submenu">
                                                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Manage Job')): ?>
                                                            <li
                                                                class="dash-item <?php echo e(Request::route()->getName() == 'job.index' ? 'active' : 'dash-hasmenu'); ?>">
                                                                <a class="dash-link" href="<?php echo e(route('job.index')); ?>"><?php echo e(__('Jobs')); ?></a>
                                                            </li>
                                                        <?php endif; ?>
                                                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Manage Job')): ?>
                                                            <li
                                                                class="dash-item <?php echo e(Request::route()->getName() == 'job.create' ? 'active' : 'dash-hasmenu'); ?>">
                                                                <a class="dash-link" href="<?php echo e(route('job.create')); ?>"><?php echo e(__('Job Create ')); ?></a>
                                                            </li>
                                                        <?php endif; ?>
                                                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Manage Job Application')): ?>
                                                            <li class="dash-item <?php echo e(request()->is('job-application*') ? 'active' : ''); ?>">
                                                                <a class="dash-link"
                                                                    href="<?php echo e(route('job-application.index')); ?>"><?php echo e(__('Job Application')); ?></a>
                                                            </li>
                                                        <?php endif; ?>
                                                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Manage Job Application')): ?>
                                                            <li
                                                                class="dash-item <?php echo e(request()->is('candidates-job-applications') ? 'active' : ''); ?>">
                                                                <a class="dash-link"
                                                                    href="<?php echo e(route('job.application.candidate')); ?>"><?php echo e(__('Job Candidate')); ?></a>
                                                            </li>
                                                        <?php endif; ?>
                                                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Manage Job OnBoard')): ?>
                                                            <li class="dash-item">
                                                                <a class="dash-link"
                                                                    href="<?php echo e(route('job.on.board')); ?>"><?php echo e(__('Job On-Boarding')); ?></a>
                                                            </li>
                                                        <?php endif; ?>
                                                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Manage Custom Question')): ?>
                                                            <li class="dash-item">
                                                                <a class="dash-link"
                                                                    href="<?php echo e(route('custom-question.index')); ?>"><?php echo e(__('Custom Question')); ?></a>
                                                            </li>
                                                        <?php endif; ?>
                                                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Manage Interview Schedule')): ?>
                                                            <li class="dash-item">
                                                                <a class="dash-link"
                                                                    href="<?php echo e(route('interview-schedule.index')); ?>"><?php echo e(__('Interview Schedule')); ?></a>
                                                            </li>
                                                        <?php endif; ?>
                                                        <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Manage Career')): ?>
                                                            <li class="dash-item">
                                                                <a class="dash-link"
                                                                    href="<?php echo e(route('career', [\Auth::user()->creatorId(), $lang])); ?>"
                                                                    target="_blank"><?php echo e(__('Career')); ?></a>
                                                            </li>
                                                        <?php endif; ?>
                                                    </ul>
                                                </li>
                    <?php endif; ?>

                    <!-- Event-->
                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Manage Event')): ?>
                        <li class="dash-item">
                            <a href="<?php echo e(route('event.index')); ?>" class="dash-link"><span class="dash-micon"><i
                                        class="ti ti-calendar-event"></i></span><span
                                    class="dash-mtext"><?php echo e(__('Event')); ?></span>
                            </a>
                        </li>
                    <?php endif; ?>

                    <!--meeting-->
                    <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Manage Meeting')): ?>
                        <li
                            class="dash-item <?php echo e(Request::segment(1) == 'meeting' || Request::segment(2) == 'meeting' ? 'active' : ''); ?>">
                            <a href="<?php echo e(route('meeting.index')); ?>" class="dash-link"><span class="dash-micon"><i
                                        class="ti ti-calendar-time"></i></span><span
                                    class="dash-mtext"><?php echo e(__('Meeting')); ?></span></a>
                        </li>
                    <?php endif; ?>

                    <!-- ticket-->
                     <?php if (app(\Illuminate\Contracts\Auth\Access\Gate::class)->check('Manage Ticket')): ?>
                        <li class="dash-item <?php echo e(Request::segment(1) == 'ticket' ? 'active' : ''); ?>">
                            <a href="<?php echo e(route('ticket.index')); ?>" class="dash-link"><span class="dash-micon"><i
                                        class="ti ti-ticket"></i></span><span
                                    class="dash-mtext"><?php echo e(__('Ticket')); ?></span></a>
                        </li>
                    <?php endif; ?>

                    <!-- audit-->


                    <?php if(\Auth::user()->type == 'super admin'): ?>
                        <?php if(Gate::check('Manage Plan')): ?>
                            <li class="dash-item ">
                                <a href="<?php echo e(route('plans.index')); ?>" class="dash-link"><span class="dash-micon"><i
                                            class=" ti ti-trophy"></i></span><span
                                        class="dash-mtext"><?php echo e(__('Plan')); ?></span></a>
                            </li>
                        <?php endif; ?>
                    <?php endif; ?>
                    <?php if(\Auth::user()->type == 'super admin'): ?>
                        <li class="dash-item ">
                            <a href="<?php echo e(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"><?php echo e(__('Plan Request')); ?></span></a>
                        </li>
                    <?php endif; ?>

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

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

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

                    <?php if(\Auth::user()->type == 'company'): ?>
                    <li class="dash-item">
                        <a href="<?php echo e(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>
                    <?php endif; ?>
                        <?php if(\Auth::user()->type == 'company'): ?>

                        <?php 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 <?php echo e(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="<?php echo e(route('branch.index')); ?>" class="dash-link"><span class="dash-micon"><i
                                            class="ti ti-table"></i></span><span
                                        class="dash-mtext"><?php echo e(__('HRIS Setup')); ?></span></a>
                            </li>
                        <?php endif; ?>
                    <?php endif; ?>

                </ul>
            </div>
        </div>
    </nav>
<?php /**PATH /var/www/payraty/hris/resources/views/partial/Admin/menu.blade.php ENDPATH**/ ?>