School Attendance Report
Student ID: {{ $student->student_id }}
{{--MARA No.: {{ $student->account_no }}
--}}Student Name: {{ $student->student_name }}
School: {{ $student->nama_pusat }}
Form: {{ $student->tingkatan }}
Attendance Status: @if ($student->attendance_status == 0) Active @elseif ($student->attendance_status == 1) 1/3 @elseif ($student->attendance_status == 2) 2/3 @elseif ($student->attendance_status == 3) 3/3 - WARNING @endif
Daily Attendance Records
@php $currentWeek = null; @endphp @foreach($attendance as $att) @php // Convert the attendance date to a Carbon instance $attendanceDate = \Carbon\Carbon::parse($att->att_date); // Get the week of the year for the current attendance record $weekOfYear = $attendanceDate->weekOfYear; // Calculate Monday and Friday for the current week $monday = $attendanceDate->startOfWeek()->toDateString(); $friday = $attendanceDate->startOfWeek()->addDays(4)->toDateString(); @endphp @if($currentWeek !== $weekOfYear)Week {{ $weekOfYear }}
Date Range: {{ $monday }} - {{ $friday }}
| Day | Date | Student In | Student Out |
|---|---|---|---|
| {{ \Carbon\Carbon::parse($att->att_date)->format('l') }} | {{ \Carbon\Carbon::parse($att->att_date)->format('d-m-Y') }} | {{ $att->att_in ? \Carbon\Carbon::parse($att->att_in)->format('h:i A') : '-' }} | {{ $att->att_out ? \Carbon\Carbon::parse($att->att_out)->format('h:i A') : '-' }} |