@extends('admin.admin_dashboard') @section('customcss') @endsection @section('admin')
{{-- Header & Breadcrumb --}} {{-- Filter Section --}}
Staff Attendance Details Report
{{-- Report Cards per Employee --}} @if(isset($reportData) && $reportData->isNotEmpty()) @foreach($reportData as $data) @php $emp = $data['employee']; $primaryId = (!empty($emp->primary_id) && $emp->primary_id !== '0' && $emp->primary_id !== 0) ? $emp->primary_id : '-'; $secondaryId = (!empty($emp->e_id) && $emp->e_id !== '0' && $emp->e_id !== 0) ? $emp->e_id : '-'; $post = $emp->postDetails->name ?? ($emp->post ?? '-'); @endphp
{{-- School Header for Print --}} {{-- Employee Header Info for Web View --}}
{{ $emp->name }}
Primary ID: {{ $primaryId }} | Secondary ID: {{ $secondaryId }} | Post: {{ $post }}
Period: {{ $fromDate->format('d M, Y') }} - {{ $toDate->format('d M, Y') }}
{{-- Employee Information Table (Black text for print & web) --}}
Employee Name: {{ $emp->name }} Primary ID: {{ $primaryId }} Secondary ID: {{ $secondaryId }} Designation: {{ $post }}
{{-- Summary Statistics Table --}}
Present Days Absent Days Leave Days Off / Holiday Total Worked Total Late
{{ $data['present_days'] }} {{ $data['absent_days'] }} {{ $data['leave_days'] }} {{ $data['off_days'] + $data['holiday_days'] }} {{ $data['total_worked_hours'] }} {{ $data['total_late_minutes'] }}m
{{-- Daily Records Table --}}
@foreach($data['daily_records'] as $record) @php $st = strtolower($record['status']); $badgeClass = match ($st) { 'present', 'partial', 'p' => 'success', 'leave' => 'info', 'off_day', 'weeklyoff' => 'secondary', 'holiday' => 'dark', default => 'danger', }; @endphp {{-- MORNING --}} {{-- DAY --}} @endforeach
Date Day Morning Shift Day Shift Total Hours Status
In Out Late In Out Late
{{ \Carbon\Carbon::parse($record['date'])->format('d-m-Y') }} {{ $record['day_name'] }}{{ $record['morning_in'] ? \Carbon\Carbon::parse($record['morning_in'])->format('h:i A') : '-' }} {{ $record['morning_out'] ? \Carbon\Carbon::parse($record['morning_out'])->format('h:i A') : '-' }} @if(!empty($record['morning_late'])) {{ $record['morning_late'] }} @else - @endif {{ $record['day_in'] ? \Carbon\Carbon::parse($record['day_in'])->format('h:i A') : '-' }} {{ $record['day_out'] ? \Carbon\Carbon::parse($record['day_out'])->format('h:i A') : '-' }} @if(!empty($record['day_late'])) {{ $record['day_late'] }} @else - @endif {{ $record['worked_hours'] }} {{ strtoupper($record['status']) }}
@endforeach @elseif(request()->has('from_date'))
No attendance data found for the selected period.
@endif
@endsection