@include('errors')
Student Attendance List
School :
{{ $mrsm->nama_mrsm }}
@php
$currentWeek = null;
@endphp
@foreach($attendance as $att)
@php
// Convert the attendance date to a Carbon instance
$attendanceDate = \Carbon\Carbon::parse($att->mula_kelas);
// 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)
@php
$currentWeek = $weekOfYear;
@endphp
@endif
@endforeach
{{ $attendance->links() }}
Week {{ $weekOfYear }}
Date Range: {{ $monday }} - {{ $friday }}
| No. | Subject | Class Period | Student ID | Student Name | Student In | Student Out |
|---|
| {{ $loop->iteration }}. | {{ $att->subjek }} |
{{ \Carbon\Carbon::parse($att->mula_kelas)->format('l') }}
{{ \Carbon\Carbon::parse($att->mula_kelas)->format('d-m-Y') }}, {{ \Carbon\Carbon::parse($att->mula_kelas)->format('h:i A') }} - {{ \Carbon\Carbon::parse($att->tamat_kelas)->format('h:i A') }} |
{{ $att->user_id }} | {{ $att->user_name }} | {{ \Carbon\Carbon::parse($att->masa_masuk)->format('h:i A') ?? '-' }} | {{ \Carbon\Carbon::parse($att->masa_keluar)->format('h:i A') ?? '-' }} |