Check-in History Report

{{ $company->name }} | Generated: {{ now()->format('F d, Y - H:i') }}

@if(!empty($filters['date']) || !empty($filters['employee_id']) || !empty($filters['status']))
Applied Filters: @if(!empty($filters['date'])) Date: {{ \Carbon\Carbon::parse($filters['date'])->format('M d, Y') }} @endif @if(!empty($filters['employee_id'])) | Employee ID: {{ $filters['employee_id'] }} @endif @if(!empty($filters['status'])) | Status: {{ ucfirst($filters['status']) }} @endif
@endif @if($checkins->isEmpty())
No check-in records found for the selected filters.
@else @php $groupedCheckins = $checkins->groupBy('employee_id'); @endphp @foreach($groupedCheckins as $employeeId => $employeeCheckins) @php $employee = $employeeCheckins->first()->employee; @endphp
{{ $employee->first_name }} {{ $employee->last_name }} πŸ“ž {{ $employee->phone_number }} {{ $employeeCheckins->count() }} check-in(s)
@foreach($employeeCheckins as $checkin) @endforeach
Date/Time Site/Route Location Method Status Caller Notes
{{ $checkin->created_at->format('M d, Y') }}
{{ $checkin->created_at->format('H:i') }}
@if($checkin->schedule) Static
{{ $checkin->schedule->site->name }}
#{{ $checkin->schedule->duty_number }} @elseif($checkin->patrollerSchedule) Patrol
{{ $checkin->patrollerSchedule->route->name }}
#{{ $checkin->patrollerSchedule->id }} @else Unknown @endif
@if($checkin->location_reported)
πŸ“ {{ $checkin->location_reported }}
@endif @if($checkin->latitude && $checkin->longitude)
GPS: {{ number_format($checkin->latitude, 6) }}, {{ number_format($checkin->longitude, 6) }}
@endif @if($checkin->maps_link)
πŸ—ΊοΈ Map Link
@endif @if(!$checkin->location_reported && !$checkin->latitude && !$checkin->maps_link) No location @endif
{{ ucfirst($checkin->checkin_type) }} @if($checkin->is_verified) Verified @else Unverified @endif {{ $checkin->user?->name ?? 'System' }} {{ $checkin->notes ?: '--' }}
{{-- Photos for this employee --}} @php $employeePhotos = $employeeCheckins->filter(function ($checkin) { return !empty($checkin->images); }); @endphp @if($employeePhotos->isNotEmpty())
πŸ“Έ Evidence Photos
@foreach($employeePhotos as $checkin)
{{ $checkin->created_at->format('M d, H:i') }} @if($checkin->schedule) - {{ $checkin->schedule->site->name }} @elseif($checkin->patrollerSchedule) - {{ $checkin->patrollerSchedule->route->name }} @endif
@foreach($checkin->images as $image) @php $imagePath = public_path('storage/' . $image); @endphp @if(file_exists($imagePath)) Evidence @endif @endforeach
@endforeach
@endif
@endforeach @endif