@extends('layouts.app')
@section('title', 'Rekap Kehadiran Saya')
@section('content')
Rekap Kehadiran Saya
Riwayat kehadiran harian Anda sebagai guru
{{-- Filter Bulan --}}
{{-- Summary Bulan --}}
@foreach([['label'=>'Hadir','key'=>'present','color'=>'green'],['label'=>'Terlambat','key'=>'late','color'=>'yellow'],['label'=>'Absen','key'=>'absent','color'=>'red'],['label'=>'Izin','key'=>'permission','color'=>'blue'],['label'=>'Sakit','key'=>'sick','color'=>'purple']]
as $stat)
{{ $summary[$stat['key']] ?? 0 }}
{{ $stat['label'] }}
@endforeach
{{-- Progress Kehadiran --}}
@php $pct = $summary['total'] > 0 ? round(($summary['present'] + $summary['late']) / $summary['total'] * 100) : 0;
@endphp
Persentase Kehadiran Bulan Ini
{{
$pct }}%
{{-- Tabel Detail --}}
| Tanggal |
Hari |
Check In |
Check Out |
Status |
Metode |
Catatan |
@forelse($attendances ?? [] as $att)
@php
$statusColors = ['present' => 'green', 'late' => 'yellow', 'absent' => 'red', 'permission' => 'blue',
'sick' => 'purple', 'out_of_office' => 'gray'];
$statusValue = $att->status?->value ?? (string) $att->status;
$statusLabel = $att->status?->label() ?? ucfirst(str_replace('_', ' ', $statusValue));
@endphp
| {{ $att->date->format('d M Y') }}
|
{{ $att->date->translatedFormat('l') }} |
{{ $att->check_in_time ?
\Illuminate\Support\Carbon::parse((string) $att->check_in_time)->format('H:i') : '–' }} |
{{ $att->check_out_time ?
\Illuminate\Support\Carbon::parse((string) $att->check_out_time)->format('H:i') : '–' }} |
{{ $statusLabel }}
|
{{ $att->is_auto ? 'Auto' : 'Manual' }} |
{{ $att->notes ?? '–' }} |
@empty
| Tidak ada data kehadiran untuk periode
ini |
@endforelse
@if(isset($attendances) && method_exists($attendances, 'hasPages') && $attendances->hasPages())
{{ $attendances->withQueryString()->links() }}
@endif
@endsection