@extends('layouts.app') @section('title','Attendance') @section('content')<div class="flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between"><div><p class="text-sm font-semibold text-blue-600">SECURE ATTENDANCE</p><h1 class="text-3xl font-black">Attendance</h1><p class="mt-1 text-sm text-slate-500">The server validates your current public IP against the assigned office whitelist.</p></div><div class="flex gap-2"><form method="POST" action="{{ route('attendance.punch') }}">@csrf<input type="hidden" name="action" value="check_in"><button class="btn btn-primary">Check in</button></form><form method="POST" action="{{ route('attendance.punch') }}">@csrf<input type="hidden" name="action" value="check_out"><button class="btn btn-soft">Check out</button></form></div></div><div class="mt-6 card overflow-x-auto"><table class="w-full text-sm"><thead class="bg-slate-50 text-left text-slate-500"><tr><th class="p-4">Date</th><th class="p-4">In</th><th class="p-4">Out</th><th class="p-4">Status</th><th class="p-4">Minutes</th></tr></thead><tbody>@foreach($records as $r)<tr class="border-t"><td class="p-4">{{ $r->work_date->format('d M Y') }}</td><td class="p-4">{{ optional($r->check_in_at)->format('h:i A') }}</td><td class="p-4">{{ optional($r->check_out_at)->format('h:i A') }}</td><td class="p-4"><span class="badge">{{ $r->status }}</span></td><td class="p-4">{{ $r->worked_minutes }}</td></tr>@endforeach</tbody></table></div><div class="mt-4">{{ $records->links() }}</div>@endsection
