@extends('layouts.app') @section('title', 'Dashboard') @section('content') @php $summary = $dashboard['summary']; $secondary = $dashboard['secondary']; @endphp
{{-- ============================================================ Page Header ============================================================ --}}

Dashboard

Overview of today's attendance and school activity.

{{ $dashboard['date']->format('D, d M Y') }}
@can('students.view') Students @endcan @can('attendance-devices.view') Devices @endcan
{{-- ============================================================ Primary Statistics ============================================================ --}}
{{-- Total Students --}}

Total Students

{{ number_format($summary['total_students']) }}

Enrolled students +{{ number_format($summary['new_students_this_month']) }} this month
{{-- Present --}}

Present Today

{{ number_format($summary['present']) }}

Student attendance {{ number_format($summary['present_percentage'], 1) }}%
{{-- Absent --}}

Absent Today

{{ number_format($summary['absent']) }}

Missing attendance {{ number_format($summary['absent_percentage'], 1) }}%
{{-- Late --}}

Late Arrivals

{{ number_format($summary['late']) }}

Arrived after schedule {{ number_format($summary['late_percentage'], 1) }}%
{{-- ============================================================ Secondary Statistics ============================================================ --}}

{{ number_format($secondary['teachers_present']) }}

Teachers Present

{{ number_format($secondary['devices_online']) }} / {{ number_format($secondary['devices_total']) }}

Devices Online

{{ number_format($secondary['sms_sent']) }}

SMS Notifications

{{ number_format($secondary['emails_sent']) }}

Emails Sent

{{-- ============================================================ Attendance Trend + Rate ============================================================ --}}

Attendance Trend

Present, absent and late attendance over the recent school days.

Today's Attendance

Overall student attendance rate.

{{ number_format($summary['present']) }}

Present

{{ number_format($summary['absent']) }}

Absent

{{ number_format($summary['late']) }}

Late

{{-- ============================================================ Class Attendance + Weekly Overview ============================================================ --}}

Attendance by Class

Today's attendance percentage across classes.

Weekly Overview

Daily present and absent attendance.

{{-- ============================================================ Attendance Distribution + Devices ============================================================ --}}

Attendance Distribution

Distribution of today's attendance statuses.

Attendance Devices

Current biometric device connectivity.

@can('attendance-devices.view') View all @endcan
@forelse($dashboard['devices'] as $device)

{{ $device['name'] }}

{{ $device['last_sync'] }}

{{ $device['online'] ? 'Online' : 'Offline' }}
@empty

No attendance devices

No biometric devices are currently configured.

@endforelse
{{-- ============================================================ Live Attendance + Notifications ============================================================ --}}

Recent Attendance

Today

Latest attendance records received today.

@forelse($dashboard['recent_attendance'] as $attendance) @empty @endforelse
Student Class Time Status
{{ $attendance['initials'] }}

{{ $attendance['student_name'] }}

{{ $attendance['student_code'] }}

{{ $attendance['class'] }} {{ $attendance['time'] }} @switch($attendance['status']) @case('present') Present @break @case('late') Late @break @case('absent') Absent @break @default {{ ucfirst($attendance['status']) }} @endswitch

No attendance recorded today

Attendance records will appear here when received.

{{-- Notifications --}}

Recent Notifications

Latest attendance communication and system activity.

@forelse($dashboard['notifications'] as $notification)

{{ $notification['title'] }}

{{ $notification['time'] }}

{{ $notification['message'] }}

@empty

No recent notifications

@endforelse
{{-- ============================================================ Attendance Attention Lists ============================================================ --}}
{{-- Frequent Late --}}

Frequent Late Arrivals

Students with repeated late attendance this month.

@forelse($dashboard['frequent_late'] as $student)
{{ $student['initials'] }}

{{ $student['name'] }}

{{ $student['class'] }}

{{ $student['count'] }} late
@empty

No frequent late arrivals

No students currently require late-arrival follow-up.

@endforelse
{{-- Frequent Absence --}}

Frequent Absences

Students requiring attendance follow-up this month.

@forelse($dashboard['frequent_absent'] as $student)
{{ $student['initials'] }}

{{ $student['name'] }}

{{ $student['class'] }}

{{ $student['count'] }} absent
@empty

No frequent absences

No students currently require absence follow-up.

@endforelse
{{-- ============================================================ Heatmap ============================================================ --}}

Attendance Heatmap

Class attendance percentage during recent school days.

{{-- ============================================================ Quick Actions ============================================================ --}}

Quick Actions

Frequently used administrative actions.

@can('students.create')

Add Student

New admission

@endcan @can('teachers.create')

Add Teacher

Register staff

@endcan @can('school-classes.view')

Classes

Manage classes

@endcan @can('holidays.create')

Add Holiday

School calendar

@endcan @can('attendance-devices.view')

Devices

Device status

@endcan @can('school-settings.view')

Settings

Configuration

@endcan
@endsection @php $chartData = [ 'attendanceRate' => $dashboard['attendance_rate'] ?? 0, 'trend' => $dashboard['attendance_trend'] ?? [ 'categories' => [], 'present' => [], 'absent' => [], 'late' => [], ], 'classAttendance' => $dashboard['class_attendance'] ?? [ 'classes' => [], 'percentages' => [], ], 'weekly' => $dashboard['weekly_attendance'] ?? [ 'categories' => [], 'present' => [], 'absent' => [], ], 'distribution' => $dashboard['attendance_distribution'] ?? [ 'present' => 0, 'absent' => 0, 'late' => 0, ], 'heatmap' => $dashboard['heatmap'] ?? [], ]; @endphp @push('scripts') @endpush