@extends('layouts.dash') @section('content')
{{-- Supervisor: Select a student --}} @if(auth()->user()->role == 'supervisor')
🎯 Select a Student
@endif {{-- Only show attendance history and form if a student is selected or if user is student --}} @if(auth()->user()->role == 'student' || request('student_id')) {{-- Attendance History --}}
📜 Attendance History
@if($attendances->isEmpty())
No attendance records yet.
@else
@foreach($attendances as $attendance) @endforeach
Date Lesson Learned Diagram
{{ \Carbon\Carbon::parse($attendance->date)->format('M d, Y') }} {{ Str::limit($attendance->lesson_learned, 50) }} @if($attendance->diagram_path) @else No Diagram @endif
@endif
{{-- Form for marking attendance --}}
📅 Mark Attendance
@if(session('success'))
{{ session('success') }}
@endif
@csrf {{-- Only supervisors need to include student_id --}} @if(auth()->user()->role == 'supervisor') @endif
@error('date')
{{ $message }}
@enderror
@error('lesson_learned')
{{ $message }}
@enderror
@error('diagram')
{{ $message }}
@enderror
@else {{-- If no student selected yet --}} @if(auth()->user()->role == 'supervisor')
Please select a student to begin marking attendance.
@endif @endif
@endsection