@extends('layouts.app') @section('title', 'Dashboard ' . auth()->user()->school->roleLabel('kepsek')) @section('content')

Dashboard {{ auth()->user()->school->roleLabel('kepsek') }}

Selamat datang, {{ auth()->user()->name }}.

Total Siswa
{{ $stats['siswa'] }}
Total Guru
{{ $stats['guru'] }}
Total Kelas
{{ $stats['kelas'] }}
Menunggu Approval
{{ $stats['pending'] }}
Approval KALDIK Lihat Kelas Lihat Siswa
@if ($recentNotifications->count() > 0)

Notifikasi Terbaru

@if ($stats['unread_notif'] > 0)
@csrf
@endif
@foreach ($recentNotifications as $notif)
@if ($notif->type === 'kaldik_approval') @elseif ($notif->type === 'kaldik_approved') @else @endif
@if ($notif->type === 'kaldik_approval')

{{ $notif->data['submitted_by'] ?? '-' }} mengajukan kalender "{{ $notif->data['calendar_name'] ?? '-' }}" untuk approval.

@elseif ($notif->type === 'kaldik_approved')

Kalender "{{ $notif->data['calendar_name'] ?? '-' }}" telah di-approve oleh {{ $notif->data['approved_by'] ?? '-' }}.

@else

Kalender "{{ $notif->data['calendar_name'] ?? '-' }}" ditolak oleh {{ $notif->data['rejected_by'] ?? '-' }}.

@if (!empty($notif->data['reason']))

Alasan: {{ $notif->data['reason'] }}

@endif @endif

{{ $notif->created_at->diffForHumans() }}

@if ($notif->type === 'kaldik_approval' && !$notif->isRead()) Review @endif @if (!$notif->isRead())
@csrf
@endif
@endforeach
@endif @endsection