View
@php $isTeacher = $staff->jobTitle && strtolower($staff->jobTitle->slug) === 'teacher'; $courses = $teacherSummaryCourses ?? collect(); $sessionAttendanceData = $summarySessionAttendanceData ?? []; $teacherSessions = $courses ->flatMap(fn ($course) => collect($course->scheduledSessions) ->filter(fn ($session) => (int) $session->staff_id === (int) $staff->id)); $isSessionWhiteboardDelayed = function ($session) { if (empty($session->session_date) || empty($session->end_time)) { return false; } $sessionEndDateTime = \Carbon\Carbon::parse($session->session_date . ' ' . $session->end_time); return now()->greaterThan($sessionEndDateTime->copy()->addHours(12)) && empty($session->extra_file); }; $hasDelayedWhiteboard = $teacherSessions->contains(fn ($session) => $isSessionWhiteboardDelayed($session)); @endphp {{-- ================= TABLE VIEW ================= --}}
@if ($isTeacher)
Teacher Courses & Sessions
@if ($courses->isEmpty())
No courses available for this teacher.
@else @foreach ($courses as $course) @php $sessions = collect($course->scheduledSessions) ->filter(function ($session) use ($staff) { return (int) $session->staff_id === (int) $staff->id; }); $isPrimaryStaffMismatch = (int) $course->staff_id !== (int) $staff->id; $completedCount = $sessions ->filter(fn ($session) => strtolower((string) $session->status) === 'completed' || $session->session_date < now()->toDateString()) ->count(); $ongoingCount = $sessions->count() - $completedCount; $delayedWhiteboardSessionsCount = $sessions->filter(fn ($session) => $isSessionWhiteboardDelayed($session))->count(); $hasCourseDelayedWhiteboard = $delayedWhiteboardSessionsCount > 0; $attendanceFlag = $course->teacherFeedback?->isNotEmpty() ?? false; $courseCollapseId = 'summary-table-course-' . $course->id; @endphp
{{ $course->course_name_en ?? ($course->track->name_en ?? 'N/A') }} @if ($isPrimaryStaffMismatch) This teacher is not the main teacher @endif @if($hasCourseDelayedWhiteboard) Delayed White Board @endif
{{ $course->category->name_en ?? 'N/A' }} - {{ $course->trackLevel->name_en ?? 'N/A' }} | {{ $course->start_date ? \Carbon\Carbon::parse($course->start_date)->format('Y-m-d') : '-' }} to {{ $course->end_date ? \Carbon\Carbon::parse($course->end_date)->format('Y-m-d') : '-' }}
Sessions: {{ $sessions->count() }} Completed: {{ $completedCount }} Ongoing: {{ $ongoingCount }} @if($hasCourseDelayedWhiteboard) Delayed Sessions: {{ $delayedWhiteboardSessionsCount }} @endif {{-- @if ($attendanceFlag)--}} {{-- Attended--}} {{-- @else--}} {{-- Not Attended--}} {{-- @endif--}}
@forelse ($sessions as $session) @empty @endforelse
Session Date Status Details
#{{ $session->session_number ?? $session->id }} @if($isSessionWhiteboardDelayed($session)) Delayed White Board @endif {{ $session->session_date ?? '-' }} @if ( \Carbon\Carbon::parse( $session->session_date) < now()->toDateString()) Completed @else Ongoing @endif
Details
No sessions in this course.
@endforeach @endif
@endif
Asset
Asset Type Brand Model S/N
test test test test
Benefit
Benefit Type Insurance Number Comprehensive Wage Basic Wage Subscription Fee Job Title
test test test test test test
Benefit Type Relationship Cert Number Cost Cover By
test test test test test
Last Salary Increase
Date Increase Current Salary Action
test test test
Summary Metrics
Test Sessions 55 See All
No. of Referrals 155 See All
No. of Students 155
Overall Rating 4.5/5
Program Category Level No. of Students Overall Rating
Test Test Test Test Test
{{-- ================= CARD VIEW ================= --}}
@if ($isTeacher && $courses->isNotEmpty())

Teacher Courses & Sessions

@foreach ($courses as $course) @php $sessions = collect($course->scheduledSessions) ->filter(function ($session) use ($staff) { return (int) $session->staff_id === (int) $staff->id; }) ->sortBy('session_number'); $isPrimaryStaffMismatch = (int) $course->staff_id !== (int) $staff->id; $completedCount = $sessions ->filter(fn ($session) => strtolower((string) $session->status) === 'completed' || $session->session_date < now()->toDateString()) ->count(); $ongoingCount = $sessions->count() - $completedCount; $delayedWhiteboardSessionsCount = $sessions->filter(fn ($session) => $isSessionWhiteboardDelayed($session))->count(); $hasCourseDelayedWhiteboard = $delayedWhiteboardSessionsCount > 0; $attendanceFlag = $course->teacherFeedback?->isNotEmpty() ?? false; $cardCollapseId = 'summary-card-course-' . $course->id; @endphp
{{ $course->course_name_en ?? ($course->track->name_en ?? 'N/A') }}
@if ($isPrimaryStaffMismatch)
Not Linked In Main Staff Schedule
@endif @if($hasCourseDelayedWhiteboard)
Delayed White Board
@endif
{{ $course->category->name_en ?? 'N/A' }} {{ $course->trackLevel->name_en ?? 'N/A' }}
Start Date {{ $course->start_date ? \Carbon\Carbon::parse($course->start_date)->format('Y-m-d') : 'N/A' }}
End Date {{ $course->end_date ? \Carbon\Carbon::parse($course->end_date)->format('Y-m-d') : 'N/A' }}
Completed {{ $completedCount }}
Ongoing {{ $ongoingCount }}
@forelse ($sessions as $session) @empty @endforelse
Session Date Status Details
#{{ $session->session_number ?? $session->id }} @if($isSessionWhiteboardDelayed($session)) Delayed White Board @endif {{ $session->session_date ?? '-' }} @if ( \Carbon\Carbon::parse( $session->session_date) < now()->toDateString()) Completed @else Ongoing @endif
Details
No sessions.
@endforeach
@endif

Staff Overview

Asset
Hardware & Equipment
Asset Typetest
Brandtest
Modeltest
S/Ntest
Benefit
Insurance & Coverage
Benefit Typetest
Insurance Numbertest
Job Titletest
Comprehensive Wagetest
Basic Wagetest
Subscription Feetest
Last Salary Increase
Compensation History
Datetest
Increasetest
Current Salarytest
Summary Metrics
Performance Overview
55 Test Sessions
155 Referrals
155 Students
4.5/5 Rating
@push('styles') @endpush @push('scripts') @endpush