@extends('layouts.teacher.app') @section('content')
@include('errors')
@include('layouts.messages') {{-- Display error message if $att is null --}} @if(session('error'))
{{ session('error') }}
@endif
@include('layouts.messages')
@csrf

{{ $classsession->code_sub }} - Attendance

School
: {{ $teacher->mrsm_name}}
Teacher
: {{ $teacher->name}}
Subject
: {{ $classsession->subjek}}
Class
: {{ $class }}
{{--

List Student Outing Application

--}} {{-- @if(count($details) > 0) --}} @php $currentMasaMasuk = null; @endphp @forelse($attendance as $att) @if ($currentMasaMasuk !== $att->mula_kelas) @php // Start a new section for a different mula_kelas value $currentMasaMasuk = $att->mula_kelas; $attendanceCountForMasaMasuk = $attendanceCounts[$currentMasaMasuk] ?? 0; // Get the count for the current $currentMasaMasuk @endphp @endif @empty @endforelse
No. Session Student ID Student Name Scanned In Scanned Out
Class Date: {{ \Carbon\Carbon::parse($currentMasaMasuk)->format('d-m-Y') ?? '-' }} ({{ \Carbon\Carbon::parse($currentMasaMasuk)->format('l') ?? '-' }}) | Attendance recorded: {{ $attendanceCountForMasaMasuk }} / {{ $classsession->total_murid}}
{{ $loop->iteration }}. {{ \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') ?? '-' }}
No attendance record found for this class.
@foreach ($attendanceCounts as $date => $count) @forelse ($class_member as $student) @empty @endforelse
Date: {{ $date }}
No. Student ID / Card No. Student Name Attendance Status
{{ $loop->iteration }}. {{ $student->student_id }} / {{ $student->card_no }} {{ $student->student_name }} @if (in_array($student->student_id, $studentsNotInAttendanceByDate[$date]->pluck('student_id')->toArray())) Absent @else Present @endif
No attendance record found for this class.
@endforeach

Attendance List for {{ $classsession->kelas }}

Teacher: {{ $teacher->name }}

@foreach ($attendanceCounts as $date => $count) @endforeach @forelse ($class_member as $student) @foreach ($attendanceCounts as $date => $count) @endforeach @empty @endforelse
No. Student ID / Card No. Student Name Date
{{ \Carbon\Carbon::parse($date)->format('d/m') }}
{{ $loop->iteration }}. {{ $student->student_id }} / {{ $student->card_no }} {{ $student->student_name }} @if (in_array($student->student_id, $studentsNotInAttendanceByDate[$date]->pluck('student_id')->toArray())) ❌ @else ✔ @endif
No attendance record found for this class.
@endsection