@extends('layouts.master') @section('title', 'Monthly Attendance – VIP Dashboard') @section('content')
Attendance
{{-- Month Filter --}}
@foreach ($departmentsWithEmployees as $departmentName => $employees)
{{ $departmentName }}
{{ \Carbon\Carbon::parse($monthYear)->format('F Y') }}
@if ($employees->isEmpty())

No employees in this department.

@else
@foreach ($employees as $employee) @php $present = $employee->attendances->where('status', 'present')->count(); $absent = $employee->attendances->where('status', 'absent')->count(); $late = $employee->attendances->where('status', 'late')->count(); $halfday = $employee->attendances->where('status', 'half-day')->count(); $recentAttendances = $employee->attendances->sortByDesc('date')->take(10); $total = max($present + $absent + $late + $halfday, 1); @endphp
{{-- Employee Header --}}
Profile
{{ $employee->first_name }} {{ $employee->last_name }}
{{ $employee->employee_no }} | {{ $employee->designation->title ?? 'N/A' }}
{{ $departmentName }}
{{-- Mini Stats Badges --}}
Present: {{ $present }}
Absent: {{ $absent }}
Late: {{ $late }}
Half-day: {{ $halfday }}
{{-- Donut Chart --}}
{{-- Recent Attendance List --}}
Recent Attendance
@foreach ($recentAttendances as $att)
{{ \Carbon\Carbon::parse($att->date)->format('d M, Y') }}
IN: {{ $att->check_in?->format('h:i A') ?? '—' }} | OUT: {{ $att->check_out?->format('h:i A') ?? '—' }}
{{ ucfirst($att->status ?? '-') }}
@endforeach
View All
@endforeach
@endif
@endforeach {{-- Modal --}} @endsection @push('styles') @endpush @push('scripts') @endpush