| ID | @if(($courseStudentMap ?? []) && count($courseStudentMap) > 0)Student | @endifTeacher | Admin | @if($showDate)Date | @endifTime | Attachments | Session Link | @can('student')Actions | @endcan
|---|---|---|---|---|---|---|---|---|
| {{ $session->id }} | @if(($courseStudentMap ?? []) && count($courseStudentMap) > 0)@if($studentDisplayName) {{ $studentDisplayName }} @else - @endif | @endif{{ $sessionTeacherName ?: '-' }} |
@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' }} |
@if($showDate)
{{ \Carbon\Carbon::parse($session->session_date)->format('d-M-Y') }} | @endif{{ \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 | @if (!empty($meetingUrl)) Join @else - @endif | @can('student')
@php
$currentStudentId = Auth::user()->student?->id ?? null;
$hasUrgent = $currentStudentId && DB::table('urgents')
->where('session_id', $session->id)
->where('student_id', $currentStudentId)
->where('message', "Teacher didn't show up")
->exists();
$hasAttendance = $currentStudentId && DB::table('urgents')
->where('session_id', $session->id)
->where('student_id', $currentStudentId)
->where('message', "I Can't Attend")
->exists();
$addFeedback = $currentStudentId && DB::table('feedback')
->where('scheduled_session_id', $session->id)
->where('student_id', $currentStudentId)
->exists();
$sessionEnd = \Carbon\Carbon::parse($session->session_date . ' ' . $session->end_time, config('app.timezone'));
$canAddFeedback = !$addFeedback && $sessionEnd->isPast();
@endphp
@if(isset($isToday) && $isToday)
@if (!empty($meetingUrl))
Start
@else
@endif
@elseif($isUpcoming)
@else
@endif
|
@endcan