@php $defaultAvatar = asset('storage/uploads/user-icon.png'); $statusLabel = fn (?string $code) => match ($code) { 'P' => __('Present'), 'D' => __('Delay'), default => __('Ext Delay'), }; $statusClass = fn (?string $code) => match ($code) { 'P' => 'present', 'D' => 'delay', default => 'late', }; @endphp @extends('admin.layouts.app') @section('title', get_setting('site_name').' | Daily Attendance') @section('content')

Daily Attendance

View and update staff sign-in / sign-out records by date range.

@if (session()->has('message'))
{{ session('message') }}
@endif @if (session()->has('error'))
{{ session('error') }}
@endif
Filters Clear Filters

Select a date range, or pick an employee (defaults to current month if dates are empty).

@if($show === null)
No filters applied

Choose a date range or employee, then click Filter to load attendance.

@elseif($singleStaff) @php $avatar = $singleStaff->user?->image ? asset('storage/'.$singleStaff->user->image) : $defaultAvatar; @endphp
{{ $singleStaff->user?->name ?? '—' }}
ID: {{ $singleStaff->user_id ?? '—' }} · {{ $singleStaff->designation?->name ?? 'No Designation' }} · {{ $singleStaff->warehouse?->name ?? 'No Branch' }}
{{ \Carbon\Carbon::parse($startDate)->format('M d, Y') }} — {{ \Carbon\Carbon::parse($endDate)->format('M d, Y') }}
{{ (int) ($statusStats['P'] ?? 0) }}
Present
{{ (int) ($statusStats['D'] ?? 0) }}
Delay
@php $otherCount = max(0, (int) $statusStats->sum() - (int) ($statusStats['P'] ?? 0) - (int) ($statusStats['D'] ?? 0)); @endphp
{{ $otherCount }}
Late / Other
{{ $records->total() }}
Total Records
@forelse($records as $row) @empty @endforelse
Date Sign In Sign Out Status Action
{{ date('d M Y, D', strtotime($row->date)) }} {{ $row->signIn ? date('h:i A', strtotime($row->signIn)) : '—' }} {{ $row->signOut ? date('h:i A', strtotime($row->signOut)) : '—' }} {{ $statusLabel($row->status) }}
No attendance records in this range.
@if($records->hasPages())
{{ $records->links() }}
@endif @elseif($staffGroups && $staffGroups->count() > 0)

Showing {{ $staffGroups->firstItem() }}–{{ $staffGroups->lastItem() }} of {{ $staffGroups->total() }} employees · {{ \Carbon\Carbon::parse($startDate)->format('M d, Y') }} — {{ \Carbon\Carbon::parse($endDate)->format('M d, Y') }}

@foreach($staffGroups as $index => $staff) @php $rows = $attendance->get($staff->id, collect()); $avatar = $staff->user?->image ? asset('storage/'.$staff->user->image) : $defaultAvatar; $collapseId = 'att-collapse-'.$staff->id; @endphp
@forelse($rows as $row) @empty @endforelse
Date Sign In Sign Out Status Action
{{ date('d M Y, D', strtotime($row->date)) }} {{ $row->signIn ? date('h:i A', strtotime($row->signIn)) : '—' }} {{ $row->signOut ? date('h:i A', strtotime($row->signOut)) : '—' }} {{ $statusLabel($row->status) }}
No records.
@endforeach
@if($staffGroups->hasPages())
{{ $staffGroups->appends(request()->except('staff_page'))->links() }}
@endif @else
No records found

Try a different date range or employee filter.

@endif
@endsection @section('modal') @endsection @section('script') @endsection