@extends('layouts.admin') @section('content')

Manage Bookings

@if (session('success'))
{{ session('success') }}
@elseif (session('error'))
{{ session('error') }}
@endif
@forelse ($bookings as $booking) {{-- ✅ Receipt column --}} {{-- ✅ Action buttons --}} @empty @endforelse
# User Facility Date Time Total (RM) Status Receipt Action
{{ $booking->id }} {{ $booking->user->name }} {{ $booking->facility->name }} {{ \Carbon\Carbon::parse($booking->date)->format('d M Y') }} {{ $booking->time_start }}–{{ $booking->time_end }} {{ number_format($booking->total_amount, 2) }} @php $colors = [ 'pending' => 'bg-yellow-100 text-yellow-800', 'awaiting_verification' => 'bg-blue-100 text-blue-800', 'approved' => 'bg-green-100 text-green-800', 'rejected' => 'bg-red-100 text-red-800', 'cancelled' => 'bg-gray-200 text-gray-700', ]; @endphp {{ ucfirst(str_replace('_', ' ', $booking->status)) }} @if ($booking->payment && $booking->payment->receipt_path) @else No receipt @endif @php $buttonStyles = [ 'approve' => 'bg-green-100 hover:bg-green-200 text-green-800', 'reject' => 'bg-red-100 hover:bg-red-200 text-red-800', 'view' => 'bg-yellow-400 hover:bg-yellow-500 text-white', 'print' => 'bg-gray-300 hover:bg-gray-400 text-gray-800', 'cancel' => 'bg-red-100 text-red-800 hover:bg-red-200', ]; @endphp {{-- 🔹 If booking is awaiting verification --}} @if($booking->status === 'awaiting_verification') {{-- 🔹 If booking already approved --}} @elseif($booking->status === 'approved') Print Receipt
@csrf
{{-- 🔹 If booking rejected --}} @elseif($booking->status === 'rejected') Rejected {{-- 🔹 If booking cancelled --}} @elseif($booking->status === 'cancelled') Cancelled {{-- 🔹 Default fallback --}} @else No actions @endif
No bookings found.
@endsection