@extends('layouts.admin.app') @section('content')
Monitor dan analisis data kehadiran siswa & guru
{{ $statistik[$key] ?? 0 }}
{{ $cfg['label'][$mode] }}
{{ $cfg['desc'] }}
|
Tanggal
|
Nama
|
Kelas
|
Status
|
Keterangan
|
|---|---|---|---|---|
|
{{ \Carbon\Carbon::parse($row->tanggal)->format('d M Y') }} {{ \Carbon\Carbon::parse($row->tanggal)->translatedFormat('l') }} |
{{-- Nama --}}
@if ($row instanceof \App\Models\KehadiranSiswa)
{{ strtoupper(substr($row->siswa->nama_siswa ?? '?', 0, 1)) }}
@else
{{ strtoupper(substr($row->guru->nama_guru ?? '?', 0, 1)) }}
@endif
@if ($row instanceof \App\Models\KehadiranSiswa) {{ $row->siswa->nama_siswa ?? '-' }} @else {{ $row->guru->nama_guru ?? '-' }} @endif @if ($row instanceof \App\Models\KehadiranSiswa) Siswa @else Tenaga Pengajar @endif |
{{-- Kelas --}}
@if ($row instanceof \App\Models\KehadiranSiswa) {{ $row->siswa->kelas->nama_kelas ?? '-' }} @else Guru @endif | {{-- Status --}}@php $rawStatus = trim($row->status); $statusKey = strtolower($rawStatus); $siswaStatus = [ 'hadir' => ['color' => 'bg-gradient-to-r from-green-100 to-emerald-100 text-green-700 border border-green-200', 'icon' => 'check-circle-fill'], 'izin' => ['color' => 'bg-gradient-to-r from-yellow-100 to-amber-100 text-yellow-700 border border-yellow-200', 'icon' => 'exclamation-circle-fill'], 'sakit' => ['color' => 'bg-gradient-to-r from-blue-100 to-sky-100 text-blue-700 border border-blue-200', 'icon' => 'thermometer-half'], 'alpha' => ['color' => 'bg-gradient-to-r from-red-100 to-rose-100 text-red-700 border border-red-200', 'icon' => 'x-circle-fill'], ]; $guruStatus = [ 'hadir' => ['color' => 'bg-gradient-to-r from-green-100 to-emerald-100 text-green-700 border border-green-200', 'icon' => 'check-circle-fill'], 'izin' => ['color' => 'bg-gradient-to-r from-yellow-100 to-amber-100 text-yellow-700 border border-yellow-200', 'icon' => 'exclamation-circle-fill'], 'sakit' => ['color' => 'bg-gradient-to-r from-blue-100 to-sky-100 text-blue-700 border border-blue-200', 'icon' => 'thermometer-half'], 'alpha' => ['color' => 'bg-gradient-to-r from-red-100 to-rose-100 text-red-700 border border-red-200', 'icon' => 'x-circle-fill'], ]; $isGuru = isset($row->id_guru) || isset($row->guru); $configSource = $isGuru ? $guruStatus : $siswaStatus; $config = $configSource[$statusKey] ?? ['color' => 'bg-gray-200 text-gray-600', 'icon' => 'question-circle']; @endphp {{ $row->status }} | {{-- Keterangan --}}
@if($row->keterangan)
{{ $row->keterangan }}
@else
Tidak ada keterangan
@endif
|
|
Tidak ada data kehadiran Pilih filter untuk menampilkan data |
||||