@extends('index') @section('content')
@include('layouts.flashmessages')

Dashboard

Total Teachers

{{ $teachers }}

Total Classes

{{ $classes }}

Total Divisions

{{ $divisions }}

All Notifications

{{ $totalnotifications }}

{{--

Upgrade you plan for
Great experience

Upgarde Now
Balance

122.5692.00 BTC

11.1% Outstanding balance boost

--}} {{--

Total Teachers

{{ $teachers }}

Total Classes

{{ $classes }}

Total Divisions

{{ $divisions }}

All Notifications

{{ $totalnotifications }}

--}}

Today's Bus Attendance Summary

{{ \Carbon\Carbon::today()->format('d M Y') }} — Route-wise stop & student status

@if(count($todayBusAttendanceSummary))
@foreach($todayBusAttendanceSummary as $index => $routeGroup) @php $morningPct = $routeGroup['total_students'] > 0 ? round(($routeGroup['morning_marked'] / $routeGroup['total_students']) * 100) : 0; $eveningPct = $routeGroup['total_students'] > 0 ? round(($routeGroup['evening_marked'] / $routeGroup['total_students']) * 100) : 0; $busBadgeClass = ($morningPct == 100 && $eveningPct == 100) ? 'bg-success-subtle text-success' : (($morningPct == 0 && $eveningPct == 0) ? 'bg-danger-subtle text-danger' : 'bg-warning-subtle text-warning'); @endphp

@foreach($routeGroup['stops'] as $stop)
Stop {{ $stop['stop_number'] ?? '-' }}{{ $stop['stop_name'] ? ' — ' . $stop['stop_name'] : '' }} ({{ count($stop['students']) }} students)
@foreach($stop['students'] as $student) @endforeach
Roll No Name Class Morning Evening
{{ $student['rollno'] }} {{ $student['name'] }} {{ $student['class'] }} - {{ $student['section'] }} @if($student['morning_status'] === 'P') Present @elseif($student['morning_status'] === 'A') Absent @else Not Marked @endif @if($student['evening_status'] === 'P') Present @elseif($student['evening_status'] === 'A') Absent @else Not Marked @endif
@endforeach
@endforeach
@else
No bus routes with assigned students found
@endif

Notification Status

@forelse($latestNotifications as $notification)
@if(isset($notification->TTID)) @else @endif
{{ $notification->Title ?? $notification->title ?? '' }}

{{ Str::limit($notification->Message, 40) }}

{{ isset($notification->TTID) ? 'Teacher' : 'Student' }} {{ \Carbon\Carbon::parse($notification->Notfct_date ?? $notification->Notftn_date)->format('d M Y') }}
@empty

No recent notifications

@endforelse

Teacher

{{ $staffCount }}

Student

{{ $studentCount }}

Today's Attendance Summary

{{ \Carbon\Carbon::today()->format('d M Y') }} — Period-wise marking status by class & section

@if(count($todayAttendanceSummary))
@foreach($todayAttendanceSummary as $index => $classGroup) @php $classMarked = collect($classGroup['sections'])->where('total_marked', 9)->count(); $classTotal = count($classGroup['sections']); $badgeClass = $classMarked == $classTotal ? 'bg-success-subtle text-success' : ($classMarked == 0 ? 'bg-danger-subtle text-danger' : 'bg-warning-subtle text-warning'); @endphp

@for ($i = 1; $i <= 9; $i++) @endfor @foreach($classGroup['sections'] as $row) @foreach($row['periods'] as $periodKey => $periodStatus) @endforeach @endforeach
SectionP{{ $i }}Marked
{{ $row['section'] }} @if($periodStatus) @else @endif {{ $row['total_marked'] }}/{{ $row['total_periods'] }}
@endforeach
@else
No classes/sections found
@endif
@endsection @section('contentjs') @endsection