@extends('layouts.app') @section('content')
View and manage daily attendance records
| Employee | Department | Shift | Punch In | Punch Out | Break Details | Total Hours | Behavior | Status | Actions |
|---|---|---|---|---|---|---|---|---|---|
|
{{ $attendance->user->full_name ?? 'Unknown User' }}
{{ $attendance->user->email ?? 'No Email' }}
|
@if($attendance->user->departments->count() > 0) {{ $attendance->user->departments->first()->name }} @else No Department @endif | @if($attendance->workingShift) {{ $attendance->workingShift->name }} @else No Shift @endif |
@php
$punchIns = $attendance->all_punch_in_times;
@endphp
@if($punchIns->count() > 0)
@foreach($punchIns as $index => $punchIn)
@else
--
@endif
In {{ $index + 1 }}: {{ \Carbon\Carbon::parse($punchIn->punch_time)->format('H:i:s') }}
@if($punchIn->latitude)
{{ $punchIn->latitude }}, {{ $punchIn->longitude }}
@endif
@if($punchIn->notes)
{{ $punchIn->notes }}
@endif
|
@php
$punchOuts = $attendance->all_punch_out_times;
@endphp
@if($punchOuts->count() > 0)
@foreach($punchOuts as $index => $punchOut)
@else
--
@endif
Out {{ $index + 1 }}: {{ \Carbon\Carbon::parse($punchOut->punch_time)->format('H:i:s') }}
@if($punchOut->latitude)
{{ $punchOut->latitude }}, {{ $punchOut->longitude }}
@endif
@if($punchOut->notes)
{{ $punchOut->notes }}
@endif
|
@php
$breakStarts = $attendance->details()->where('type', 'break_start')->orderBy('punch_time')->get();
$breakEnds = $attendance->details()->where('type', 'break_end')->orderBy('punch_time')->get();
@endphp
@if($breakStarts->isNotEmpty() || $breakEnds->isNotEmpty())
@foreach($breakStarts as $index => $breakStart)
@else
--
@endif
Break {{ $index + 1 }}: {{ \Carbon\Carbon::parse($breakStart->punch_time)->format('H:i:s') }}
@php
$correspondingEnd = $breakEnds->firstWhere('punch_time', '>', $breakStart->punch_time);
@endphp
@if($correspondingEnd)
Resume: {{ \Carbon\Carbon::parse($correspondingEnd->punch_time)->format('H:i:s') }}
Duration: {{ \Carbon\Carbon::parse($breakStart->punch_time)->diffInMinutes(\Carbon\Carbon::parse($correspondingEnd->punch_time)) }} min
@else
Still on break
@endif
Resume without start: {{ \Carbon\Carbon::parse($end->punch_time)->format('H:i:s') }}
|
{{ $attendance->total_hours ? number_format($attendance->total_hours, 2) : '--' }}
|
@php $behaviorColors = [ 'regular' => 'bg-gray-100 text-gray-800', 'early' => 'bg-blue-100 text-blue-800', 'late' => 'bg-blue-100 text-blue-800' ]; $behaviorClass = $behaviorColors[$attendance->behavior] ?? 'bg-gray-100 text-gray-800'; @endphp {{ ucfirst($attendance->behavior) }} | @if($attendance->status) {{ ucfirst($attendance->status->name) }} @else No Status @endif | |
No attendance records foundNo attendance records found for the selected criteria. Try adjusting your filters or check a different date. |
|||||||||