@extends('layouts.app') @section('page-title')

{{ __($pageTitle) }} {{ count($pendingLeaves)}} @lang('modules.leaves.pendingLeaves')

@lang('app.all') @lang('app.menu.leaves') @lang('modules.leaves.calendarView') @lang('modules.leaves.assignLeave')
@endsection @section('content')
@forelse($pendingLeaves as $key=>$pendingLeave)
{{ $pendingLeave->type->type_name }} @lang('modules.leaves.leaveRequest')
@php try{ $allowedLeaves = $pendingLeave->user->leaveTypes->sum('no_of_leaves'); $leavesRemaining = ($allowedLeaves-$pendingLeave->leaves_taken_count); $percentLeavesRemaining = ($leavesRemaining/$allowedLeaves) * 100; } catch (Exception $e){ $percentLeavesRemaining = 0; } @endphp
{{ $pendingLeave->leave_date->format($global->date_format) }} ({{ $pendingLeave->leave_date->format('l') }})
{{ $percentLeavesRemaining }}% Complete
{{ ($leavesRemaining) }} @lang('modules.leaves.remainingLeaves')
@lang('app.reason')
{{ $pendingLeave->reason }}
@empty @lang('messages.noPendingLeaves') @endforelse
{{--Ajax Modal--}} {{--Ajax Modal Ends--}} @endsection @push('footer-script') @endpush