@php $employeeOptions = $employees->pluck('name', 'id')->toArray(); $hasActiveFilters = filled($filterEmployee) || filled($filterStatus) || filled($filterType) || filled($filterFrom) || filled($filterTo); @endphp
@if($status != 'need_action')

{{ __('Absences') }}

@can('absences create') @endcan
@endif {{-- Filters --}}
@if($showEmployeeList)
@endif
@if($showEmployeeList)
@endif
{{-- Table --}}
@php $cols = [ ['key'=>'id', 'label'=>'#'], ['key'=>'employee', 'label'=>__('Employee')], ['key'=>'date', 'label'=>__('Date')], ['key'=>'type', 'label'=>__('Type')], ['key'=>'hours', 'label'=>__('Hours')], ['key'=>'reason', 'label'=>__('Reason')], ['key'=>'status', 'label'=>__('Status')], ['key'=>null, 'label'=>__('File')], ['key'=>null, 'label'=>__('Actions')], ]; @endphp @foreach($cols as $c) @endforeach @forelse($absences as $a) @empty @endforelse
{{-- @if($c['key'])--}} {{-- --}} {{-- @else--}} {{-- {{ $c['label'] }}--}} {{-- @endif--}} {{ $c['label'] }}
{{ $loop->iteration + ($absences->currentPage() - 1) * $absences->perPage() }} {{ $a->employee->name ?? '—' }} {{ optional($a->date)->format('Y-m-d') }} {{ __(ucfirst(str_replace('_',' ',$a->type))) }} {{ $a->hours ?? '—' }} {{ $a->reason ?? '—' }} {{ __(ucfirst($a->status)) }} @if($a->file_url) {{ __('View') }} @else @endif
@can('absences edit') @if($a->status === 'pending') @endif @endcan @can('absences delete') @endcan @can('absences approve') @if($a->status === 'pending') @endif @endcan {{__("View")}}
{{ __('No records found.') }}
{{ $absences->links() }}
{{-- Modal --}}

{{ $isEditMode ? __('Edit Absence') : __('Add Absence') }}

@if ($errors->any())
    @foreach ($errors->all() as $e)
  • {{ $e }}
  • @endforeach
@endif
@if($showEmployeeList)
@error('employee_id') {{ $message }} @enderror
@endif
@if($showEmployeeList)
@endif
@if($existingFile) {{ __('View Existing File') }} @endif