@extends('backend.app') @push('style') @endpush @section('title', 'Booking Details #' . $booking->id) @section('content')

Booking Details

ID: #BOOK-{{ str_pad($booking->id, 5, '0', STR_PAD_LEFT) }}

{{ ucfirst($booking->status) }}
@if($booking->is_flagged)

This Booking is Flagged

{{ $booking->flag_reason ?? 'No reason provided' }}

@endif
{{ $booking->booking_date ? $booking->booking_date->format('M d') : 'N/A' }}
Booking Date
{{ Carbon\Carbon::parse($booking->booking_time)->format('h:i A') ?? 'N/A' }}
Booking Time
{{ number_format((float)($booking->total_amount ?? 0), 2) }}
Amount
{{ $booking->is_visit ? 'Yes' : 'No' }}
Is Visit
Customer Information
Phone {{ $booking->user ? $booking->user->phone : 'N/A' }}
User ID #{{ str_pad($booking->user_id ?? 0, 4, '0', STR_PAD_LEFT) }}
Joined {{ $booking->user && $booking->user->created_at ? $booking->user->created_at->format('M Y') : 'N/A' }}
Booking Details
Date {{ $booking->booking_date ? $booking->booking_date->format('l, F j, Y') : 'N/A' }}
Time {{ $booking->booking_time ?? 'N/A' }}
Amount ${{ number_format((float)($booking->total_amount ?? 0), 2) }}
Status {{ ucfirst($booking->status) }}
Is Visit @if($booking->is_visit) Yes @else No @endif
Created {{ $booking->created_at ? $booking->created_at->diffForHumans() : 'N/A' }}
Business & Professional
Company {{ $booking->company ? $booking->company->name : 'N/A' }}
Professional {{ $booking->employee && $booking->employee->user ? $booking->employee->user->name : 'N/A' }}
Job Title {{ $booking->employee ? $booking->employee->job_title : 'N/A' }}
Service {{ $booking->service ? $booking->service->name : 'N/A' }}
Employee ID #{{ str_pad($booking->employee_id ?? 0, 4, '0', STR_PAD_LEFT) }}
Admin Actions & Notes
@csrf @method('PUT')
@if(!$booking->is_flagged) @else @endif
Activity Timeline
@if($booking->activities && $booking->activities->count() > 0)
@foreach($booking->activities->sortByDesc('created_at')->take(10) as $activity) @php $badgeTypes = [ 'created' => 'success', 'updated' => 'info', 'confirmed' => 'info', 'cancelled' => 'danger', 'completed' => 'success', 'flagged' => 'warning', 'investigated' => 'info', ]; $type = $badgeTypes[$activity->action] ?? 'info'; @endphp
{{ ucfirst($activity->action) }} {{ $activity->performer ? $activity->performer->name : 'System' }}

{{ $activity->created_at ? $activity->created_at->format('M d, Y - g:i A') : 'N/A' }}

@if($activity->notes)

{{ $activity->notes }}

@endif @if($activity->old_values || $activity->new_values)
@if($activity->old_values)
Old: {{ json_encode($activity->old_values) }}
@endif @if($activity->new_values)
New: {{ json_encode($activity->new_values) }}
@endif
@endif
@endforeach
@else

No activity recorded yet

@endif
@push('script') @endpush @endsection