{{-- resources/views/Reports/monthly_attendance_details_report.blade.php --}} @extends('layouts.mainlayout') @section('title', 'Monthly Attendance Details') @section('main')
{{-- show server-side validation errors --}} @if(session('reportError'))
{{ session('reportError') }}
@endif {{-- Filter Form --}}
@csrf
{{-- Date range --}}
@php // Prefer controller-provided filters (from reportData flash) over old() $startVal = isset($filters) ? ($filters['start_date'] ?? '') : old('start_date', ''); $endVal = isset($filters) ? ($filters['end_date'] ?? '') : old('end_date', ''); @endphp
📅
—
📅
{{-- Preset --}}
{{-- Team --}}
↻
{{-- Summary / Table --}} @if(!empty($rangeText))
Date Range: {{ $rangeText }} @if(!empty($teamName))   |   Team: {{ $teamName }} @endif @isset($employeeCount)   |   Employees: {{ $employeeCount }} @endisset
P = Present, A = Absent, H = Holiday, L = Leave, T = Total Days
@endif {{-- Report Table --}} @if(!empty($days) && !empty($users))
{{-- LEFT: Search --}} {{-- RIGHT: Show --}}
@foreach(request()->except(['per_page','page']) as $k => $v) @endforeach
@foreach($days as $d) @endforeach @foreach($users as $user) @foreach($days as $d) @php $cell = $attendanceMap[$user->user_id][$d->toDateString()] ?? null; @endphp @endforeach @endforeach
Emp Name Team {{ $d->format('d M') }}
{{ $d->format('D') }}
P A H L T
{{ $user->name }} {{ $user->lastName }} {{ $user->team }}
@if(!empty($cell['all_punches'])) @foreach($cell['all_punches'] as $i => $p)
{{ $p }} {{-- show icon once --}} @if($i === 0 && !empty($cell['has_punch_issue'])) ⓘ {{ $cell['punch_issue_msg'] }}
Click to update attendance
@endif
@endforeach @endif
@if(!empty($cell['work_display'])) Work: {{ $cell['work_display'] }} hrs @endif
@if(!empty($cell['break_display'])) Break: {{ $cell['break_display'] }} hrs @endif
@if(!empty($cell['status']))
{{ $cell['status'] }}
@endif @if(!empty($cell['holiday_name']))
{{ $cell['holiday_name'] }}
@endif
{{ $totals[$user->user_id]['P'] ?? 0 }} {{ $totals[$user->user_id]['A'] ?? 0 }} {{ $totals[$user->user_id]['H'] ?? 0 }} {{ $totals[$user->user_id]['L'] ?? 0 }} {{ $totals[$user->user_id]['T'] ?? count($days) }}
{{-- end table-responsive --}} @if(!empty($totalPages) && $totalPages > 1 && $perPage !== 'all')
{{-- Pagination --}}
@endif @endif
{{-- end container-fluid --}} @endsection @section('js') @endsection