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

My Dewan Bookings

@if(!$bookings->isEmpty())
Pending: {{ $bookings->where('status', 'pending')->count() }} Need Payment: {{ $bookings->where('status', 'need_payment')->count() }} Booked: {{ $bookings->where('status', 'booked')->count() }} Under Review: {{ $bookings->where('status', 'awaiting_verification')->count() }} Rejected: {{ $bookings->where('status', 'rejected')->count() }}
@endif
@if (session('success'))
{{ session('success') }}
@endif @if ($errors->any())
@endif @if($bookings->isEmpty())

You have not made any Dewan bookings yet.

@else
@foreach($bookings as $booking) @endforeach
Dewan Event Date Time Total (RM) Status Actions
{{ $booking->dewan->name ?? '—' }} {{ $booking->event_name }} {{ \Carbon\Carbon::parse($booking->date)->format('d M Y') }} @if($booking->start_time && $booking->end_time) {{ \Carbon\Carbon::parse($booking->start_time)->format('h:i A') }} – {{ \Carbon\Carbon::parse($booking->end_time)->format('h:i A') }} @else Full Day @endif RM{{ number_format($booking->total_amount, 2) }} @php $statusStyles = [ 'pending' => 'bg-yellow-100 text-yellow-800', 'need_payment' => 'bg-blue-100 text-blue-800', 'awaiting_verification' => 'bg-gray-100 text-gray-800', 'booked' => 'bg-green-100 text-green-800', 'rejected' => 'bg-red-100 text-red-800', 'cancelled' => 'bg-red-100 text-red-800', ]; @endphp {{ ucfirst(str_replace('_', ' ', $booking->status)) }} @php $buttonStyles = [ 'pay' => 'bg-yellow-100 text-yellow-800 hover:bg-yellow-200', 'cancel' => 'bg-red-100 text-red-800 hover:bg-red-200', 'view' => 'bg-indigo-100 text-indigo-800 hover:bg-indigo-200', 'view_gray' => 'bg-gray-100 text-gray-700 hover:bg-gray-200', 'print' => 'bg-gray-100 text-gray-700 hover:bg-gray-200', ]; $pillClass = 'inline-block px-3 py-1 rounded-full text-xs font-semibold transition'; @endphp @if($booking->status === 'pending') @if($booking->deposit_receipt_path) View Deposit @endif @elseif($booking->status === 'need_payment') Pay Now @elseif($booking->status === 'awaiting_verification') View Receipt @elseif($booking->status === 'booked') Print Receipt @elseif($booking->status === 'rejected') Redo Payment @elseif($booking->status === 'cancelled') Cancelled @endif @php $cancellableStatuses = ['pending', 'need_payment', 'awaiting_verification','booked']; @endphp @if(in_array($booking->status, $cancellableStatuses))
@csrf @method('DELETE')
@endif
@endif
@endsection