@extends('layouts.master') @section('css') @endsection @section('breadcrumb')

Attendance

@endsection @section('content') @include('includes.flash')
@php // Filter presensi untuk tidak menampilkan status Izin dan Sakit $filteredPresensi = $presensis->filter(function($item) { return !in_array($item->status, ['Izin', 'Sakit']); }); $groupedPresensi = $filteredPresensi->groupBy(function($item) { return $item->user_id . '_' . $item->created_at->format('Y-m-d'); }); @endphp @if($groupedPresensi->count() > 0) @foreach ($groupedPresensi as $key => $group) @php $clockIn = $group->where('clock_type', 'in')->first(); $clockOut = $group->where('clock_type', 'out')->first(); $user = $clockIn ? $clockIn->user : ($clockOut ? $clockOut->user : null); @endphp @endforeach @else @endif
Nama Status Clock In Clock Out Keterangan Foto Actions
{{ $user->name ?? 'N/A' }} @if ($clockIn) @if ($clockIn->status == 'Hadir') {{ $clockIn->status }} @elseif ($clockIn->status == 'Terlambat') {{ $clockIn->status }} @endif @endif @if ($clockIn) {{ $clockIn->created_at->format('H:i:s') }} @else - @endif @if ($clockOut) {{ $clockOut->created_at->format('H:i:s') }} @else - @endif @if ($clockIn) {{ $clockIn->keterangan }} @elseif ($clockOut) {{ $clockOut->keterangan }} @else - @endif @if ($clockIn && $clockIn->foto) @endif @if ($clockOut && $clockOut->foto) @endif @if ($clockIn)
@csrf @method('DELETE')
@endif @if ($clockOut)
@csrf @method('DELETE')
@endif
Tidak ada data absensi untuk ditampilkan
@endsection @section('script') @endsection