@extends('pages.index') @section('admin_content')

Absensi Harian @if(isset($kelas)) - {{ $kelas->name }} @endif

@php $totalHadir = isset($absensi) ? $absensi->where('status','tepat_waktu')->count() : 0; $totalTerlambat = isset($absensi) ? $absensi->where('status','terlambat')->count() : 0; $totalLainnya = isset($absensi) ? $absensi->whereNotIn('status',['tepat_waktu','terlambat'])->count() : 0; $totalSemua = isset($absensi) ? $absensi->count() : 0; @endphp
Total
{{ $totalSemua }}
Tepat Waktu
{{ $totalHadir }}
Terlambat
{{ $totalTerlambat }}
Lainnya
{{ $totalLainnya }}
Absensi Harian @if(isset($kelas)) {{ $kelas->name }} @endif
Tanggal
Bulan
Tahun
@if(isset($absensi) && count($absensi)) @foreach($absensi as $idx => $item) @endforeach @endif
Foto Nama Siswa Kelas Status Waktu
Foto {{ $item->student->name ?? '-' }} NISN: {{ $item->student->nisn ?? '-' }} {{ $item->class->name ?? '-' }} @if($item->status == 'tepat_waktu') Tepat Waktu @elseif($item->status == 'terlambat') Terlambat @elseif($item->status == 'in progress') In Progress @else {{ ucfirst($item->status) }} @endif @if($item->status == 'in progress') @php $bulanIndo = ['Januari','Februari','Maret','April','Mei','Juni','Juli','Agustus','September','Oktober','November','Desember']; $carbon = \Carbon\Carbon::parse($item->created_at); $bulanName = $bulanIndo[$carbon->month - 1]; $formatted = $carbon->format('d') . ' ' . $bulanName . ' ' . $carbon->format('Y'); @endphp {{ $formatted }} @elseif($item->created_at) @php $bulanIndo = ['Januari','Februari','Maret','April','Mei','Juni','Juli','Agustus','September','Oktober','November','Desember']; $carbon = \Carbon\Carbon::parse($item->created_at); $bulanName = $bulanIndo[$carbon->month - 1]; $formatted = $carbon->format('d') . ' ' . $bulanName . ' ' . $carbon->format('Y, H:i'); @endphp {{ $formatted }} @else - @endif
@push('scripts') @endpush @endsection