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

Service Booking Details

Booking Details {{ $booking->booking_id }}

Contact Information

Full Name {{ $booking->first_name }} {{ $booking->last_name }}
Email {{ $booking->email }}

Service Information

Service Name {{ $booking->service->title ?? 'N/A' }}
Service Price {{ $booking->service->price_from ?? 'N/A' }} AED
Service Description {!! $booking->service->description ?? 'N/A' !!}

Billing Information

@if (!empty($booking->confirmfile_names)) @php $fileNames = explode(',', $booking->confirmfile_names); // Assuming comma-separated file names @endphp @foreach ($fileNames as $index => $fileName) @php $fileUrl = asset('storage/booking_services/' . $fileName); @endphp @endforeach @endif
Customer Name {{ $booking->first_name }} {{ $booking->last_name }}
Company {{ $booking->company_name }}
Country {{ $booking->country }}
Street Address {{ $booking->street_address }}
Town/city {{ $booking->city }}
State {{ $booking->state }}
Email {{ $booking->email }}
Phone {{ $booking->phone }}
Order Notes {{ $booking->order_notes ?? 'N/A' }}
Document {{ $index + 1 }} {{ basename($fileName) }} Download

Booking Form Fields

@foreach($booking->fields as $field) @php $attribute = \App\Models\ServiceAtributes::where('name', 'LIKE', '%' . $field->field_label . '%')->where('service_id', $booking->service_id)->first(); $fieldLabel = $field->field_label; if ($attribute ) { // If label matches, fetch the value from ServiceAtributesValue $attributeValue = \App\Models\ServiceAtributesValue::where('attribute_id', $attribute->id) ->where('id',$field->value) ->where('service_id', $booking->service_id) // Assuming the service_id is available from the booking ->first(); // If we have an attribute value, use that if ($attributeValue) { $fieldValue = $attributeValue->name; if ($attributeValue->price > 0) { $fieldValue .= " (Price : AED " . number_format($attributeValue->price, 2) . ")"; } } else { $fieldValue = $field->value; // Fallback to field value if no matching attribute value is found } } else { // No match, just use the field value as it is $fieldValue = $field->value; } @endphp @endforeach
{{ $fieldLabel }} @php $filePath = 'storage/' . $fieldValue; $fileExtension = pathinfo($fieldValue, PATHINFO_EXTENSION); @endphp @if(Str::endsWith($fieldValue, ['.jpg', '.jpeg', '.png', '.gif', '.webp'])) Uploaded Image @elseif(in_array($fileExtension, ['pdf', 'doc', 'docx'])) View File @else {{ $fieldValue }} @endif

Order Summary

@php $totalWithVat = $booking->total ; @endphp
Sub Total {{ $booking->total ? 'AED ' . number_format($booking->total, 2) : 'N/A' }}
TotalAED {{ number_format($totalWithVat, 2) }}
Booking date {{ $booking->created_at->format('d-m-Y') }}
@endsection @section('script') @endsection