{{-- HERO BANNER --}}
{{-- ATTENDANCE REAL-TIME NOTIFICATIONS & SMART ALERTS --}}
@if(isset($attendanceAlerts) && $attendanceAlerts->isNotEmpty())
{{-- FIRST PERIOD ATTENDANCE --}}
@if($firstPeriodAttendance->isNotEmpty())
@foreach($firstPeriodAttendance as $firstPeriodItem)
@endforeach
@endif
{{-- MAIN SECTION: ROUTINE & TEACHER ATTENDANCE DASHBOARD --}}
Welcome to your teacher dashboard
{{ $teacher->name }}
{{ $todayName }} ยท {{ \Carbon\Carbon::parse($todayDate)->format('d M, Y') }}
Current time: {{ $now->format('h:i A') }}
Assigned periods today: {{ $routines->count() }}
@foreach($attendanceAlerts as $alert)
@php
$styleConfig = match($alert['type']) {
'danger' => [
'bg' => '#fef2f2',
'border' => '#fecaca',
'left_border' => '#ef4444',
'icon_color' => '#dc2626',
'title_color' => '#7f1d1d',
'text_color' => '#991b1b',
],
'warning' => [
'bg' => '#fffbeb',
'border' => '#fde68a',
'left_border' => '#f59e0b',
'icon_color' => '#d97706',
'title_color' => '#78350f',
'text_color' => '#92400e',
],
'success' => [
'bg' => '#f0fdf4',
'border' => '#bbf7d0',
'left_border' => '#10b981',
'icon_color' => '#16a34a',
'title_color' => '#14532d',
'text_color' => '#166534',
],
default => [
'bg' => '#eff6ff',
'border' => '#bfdbfe',
'left_border' => '#3b82f6',
'icon_color' => '#2563eb',
'title_color' => '#1e3a8a',
'text_color' => '#1e40af',
],
};
@endphp
@endforeach
@endif
{{-- ROUTINE METRICS ROW --}}
{{ $alert['title'] }}
{{ $alert['message'] }}
Today's classes
{{ $routines->count() }}
All assigned routine rows for today.
Completed
{{ $completedRoutines->count() }}
Classes already finished.
Ongoing
{{ $ongoingRoutines->count() }}
Classes happening right now.
Remaining
{{ $remainingRoutines->count() }}
Classes still to come.
Diary given
{{ $diaryDoneRoutines->count() }}
Periods with a lesson plan entry.
Diary pending
{{ $diaryPendingRoutines->count() }}
Periods without a diary entry.
First period attendance
First period classes are checked against student attendance records.
{{ $firstPeriodItem['shift_name'] }}
{{ $firstPeriodItem['status_label'] }}
Class: {{ $firstPeriodItem['class_name'] }}
Section: {{ $firstPeriodItem['section_name'] }}
Shift: {{ $firstPeriodItem['shift_name'] }}
Subject: {{ $firstPeriodItem['subject_name'] }}
Time: {{ $firstPeriodItem['time_range'] }}
{{-- LEFT COLUMN: ROUTINE TABLE --}}
{{ $todayName }} Routine
{{-- QUICK SNAPSHOT CARD --}}
{{-- RIGHT COLUMN: TEACHER ATTENDANCE & SHIFT STATUS --}}
Today's Routine
| Period | Time | Class | Section | Shift | Subject | Status | Diary |
|---|---|---|---|---|---|---|---|
|
{{ $routine['period_name'] }}
|
{{ $routine['time_range'] }} |
{{ $routine['class_name'] }}
|
{{ $routine['section_name'] }} | {{ $routine['shift_name'] }} | {{ $routine['subject_name'] }} | {{ $routine['status_label'] }} |
{{ $routine['diary_status_label'] }}
@if($routine['diary_topic'])
{{ $routine['diary_topic'] }}
@endif
|
| No routine is assigned for today. | |||||||
Today's Class Snapshot
Completed periods
{{ $completedRoutines->count() }}
Remaining periods
{{ $remainingRoutines->count() }}
Diary given
{{ $diaryDoneRoutines->count() }}
Diary pending
{{ $diaryPendingRoutines->count() }}
{{-- TODAY'S LIVE SHIFT STATUS CARD --}}
@php
$dailyStatus = strtolower($todayTeacherAttendance->attendance_status ?? 'no_punch');
$dailyBadge = match($dailyStatus) {
'present', 'p' => 'bg-success',
'partial' => 'bg-warning text-dark',
'absent' => 'bg-danger',
'leave' => 'bg-info',
'off_day', 'weeklyoff' => 'bg-secondary',
default => 'bg-light text-dark border',
};
@endphp
{{ ucfirst(str_replace('_', ' ', $todayTeacherAttendance->attendance_status ?? 'Not Marked')) }}
My Attendance Today
{{ \Carbon\Carbon::parse($todayDate)->format('d M, Y') }} ({{ $todayName }})
{{-- TODAY'S ASSIGNED SHIFTS --}}
@if(isset($todayShiftsData) && $todayShiftsData->isNotEmpty())
@if($sData['late_minutes'] > 0 || $sData['worked_minutes'] > 0)
@endforeach
@else
{{-- LAST 7 DAYS HISTORY TABLE --}}
Shift Punch Details:
@foreach($todayShiftsData as $sData) @php $isMorning = str_contains(strtolower($sData['shift']->name ?? ''), 'morning'); $cardClass = 'shift-punch-card'; if ($sData['in_time'] && $sData['out_time']) { $cardClass .= ' is-punched'; } elseif ($sData['late_minutes'] > 0) { $cardClass .= ' is-late'; } elseif (!$sData['in_time'] && !$sData['is_off']) { $cardClass .= ' is-missing'; } @endphp
{{ $sData['shift']->name }}
@if($sData['is_off'])
Weekly Off
@elseif($sData['in_time'] && $sData['out_time'])
Complete
@elseif($sData['in_time'])
Missing Out
@else
Not Punched
@endif
Schedule
{{ $sData['start_time'] }}
Punch In
{{ $sData['in_time'] ?? '-' }}
Punch Out
{{ $sData['out_time'] ?? '-' }}
@if($sData['late_minutes'] > 0)
Late: {{ $sData['late_minutes'] }} mins
@else
On time
@endif
@if($sData['worked_minutes'] > 0)
Worked: {{ $sData['worked_formatted'] }}
@endif
@endif
No specific shift work rules assigned yet.
@endif
{{-- MONTHLY SNAPSHOT SUMMARY --}}
Monthly Attendance Summary ({{ now()->format('F Y') }}):
Present
{{ $monthStats['present_days'] }}
Late
{{ $monthStats['late_days'] }}
Absent
{{ $monthStats['absent_days'] }}
Rate
{{ $monthStats['attendance_rate'] }}%
Last 7 Recorded Days:
| Date | Morning | Day | Hours | Status |
|---|---|---|---|---|
|
{{ $record['date'] }}
{{ $record['day'] }}
|
@if($record['morning_in'] !== '-') {{ $record['morning_in'] }} @else - @endif | @if($record['day_in'] !== '-') {{ $record['day_in'] }} @else - @endif | {{ $record['worked_formatted'] }} | {{ $record['status_label'] }} |
| No attendance history found. | ||||