@extends('layouts.app') @php use Carbon\Carbon; @endphp @section('title', 'Attendance Details') @section('content')

Attendance Details

View and analyze attendance records over time

@if(auth()->user()->can('export_attendance')) @endif @if(auth()->user()->can('import_attendance')) Import @endif

Attendance Filters

@if(request('attendance_id')) @endif
@if(request('attendance_id'))

Showing full month for the employee of the selected attendance record. Clear filters

@endif

Total Days

{{ $attendances->count() }}

Present Days

{{ $attendances->where('status.name', 'present')->count() }}

Late Days

{{ $attendances->where('status.name', 'late')->count() }}

Absent Days

{{ $attendances->where('status.name', 'absent')->count() }}

@forelse($attendances ?? [] as $attendance) @empty @endforelse
Date Employee Punch In Punch Out Total Hours Behavior Status Actions
{{ $attendance->in_date->format('M d, Y') }}
{{ $attendance->user?->full_name ?? 'Employee' }}
{{ $attendance->user?->full_name ?? ($attendance->user?->first_name . ' ' . $attendance->user?->last_name) ?? 'Unknown User' }}
{{ $attendance->user?->profile?->employee_id ?? '' }}
@php $punchIns = $attendance->all_punch_in_times; @endphp @if($punchIns->count() > 0)
@foreach($punchIns as $index => $punchIn)
{{ \Carbon\Carbon::parse($punchIn->punch_time)->format('h:i A') }} @if($punchIns->count() > 1) ({{ $index + 1 }}) @endif
@endforeach
@else - @endif
@php $punchOuts = $attendance->all_punch_out_times; @endphp @if($punchOuts->count() > 0)
@foreach($punchOuts as $index => $punchOut)
{{ \Carbon\Carbon::parse($punchOut->punch_time)->format('h:i A') }} @if($punchOuts->count() > 1) ({{ $index + 1 }}) @endif
@endforeach
@else - @endif
{{ $attendance->total_hours ?? '-' }} @if($attendance->behavior === 'early') Early @elseif($attendance->behavior === 'late') Late @else Regular @endif {{ $attendance->status->name }}
No attendance records found for the selected period.
{{ $attendances->links() }}
@endsection @push('scripts') @endpush