@if($showDate) @endif @foreach ($sessions as $session) @if($showDate) @endif @endforeach
ID Teacher AdminDateTime Attachments Actions
{{ $session->id }} {{ $session->staffScheduled?->staff?->first_name }} {{ $session->staffScheduled?->staff?->last_name }} @php $assignedAdmins = $session->staffScheduled?->admin_assigned_students; $adminNames = collect(); if ($assignedAdmins) { $studentMatches = $assignedAdmins->where('student_id', Auth::user()->student?->id); $assignments = $studentMatches->isNotEmpty() ? $studentMatches : $assignedAdmins; foreach ($assignments as $assignment) { $adminUser = $assignment->admin; if ($adminUser) { $staff = $adminUser->staff; $name = $staff?->full_name ?? 'N/A'; if($name != 'N/A') { $adminNames->push($name); } } } } @endphp {{ $adminNames->unique()->implode('
') ?: 'N/A' }}
{{ \Carbon\Carbon::parse($session->session_date)->format('d-M-Y') }} {{ \Carbon\Carbon::parse($session->start_time)->format('h:i A') }} @if($isUpcoming) - {{ \Carbon\Carbon::parse($session->end_time)->format('h:i A') }} @endif @if (!empty($session->attached)) @endif @if (!empty($session->extra_file)) @endif @if (empty($session->attached) && empty($session->extra_file)) None @endif @php $hasUrgent = DB::table('urgents') ->where('session_id', $session->id) ->where('student_id', Auth::user()->student->id) ->where('message', "Teacher didn't show up") ->exists(); $hasAttendance = DB::table('urgents') ->where('session_id', $session->id) ->where('student_id', Auth::user()->student->id) ->where('message', "I Can't Attend") ->exists(); $addFeedback = DB::table('feedback') ->where('scheduled_session_id', $session->id) ->where('student_id', Auth::user()->student->id) ->exists(); $sessionEnd = \Carbon\Carbon::parse($session->session_date . ' ' . $session->end_time, config('app.timezone')); $canAddFeedback = !$addFeedback && $sessionEnd->isPast(); @endphp @if(isset($isToday) && $isToday)
@csrf
@csrf
@elseif($isUpcoming)
@csrf
@else @endif