@php $pdfLocale = app()->getLocale(); $isRtl = $pdfLocale === 'ar'; @endphp Booking - #{{$booking['id']}} @php // Price formatting helper function $priceFormat = $setting['price_format'] ?? null; function formatPrice($number, $decimals = 2, $priceFormat = null) { $number = (float) $number; $decimals = (int) $decimals; if (empty($priceFormat)) { return number_format($number, $decimals, '.', ','); } switch ($priceFormat) { case 'comma_dot': return number_format($number, $decimals, '.', ','); case 'dot_comma': return number_format($number, $decimals, ',', '.'); case 'space_comma': return number_format($number, $decimals, ',', ' '); default: return number_format($number, $decimals, '.', ','); } } @endphp
@php $logoSrc = null; if (!empty($setting['logo'])) { $logoPath = public_path('images/'.$setting['logo']); if (file_exists($logoPath) && is_readable($logoPath)) { $logoData = @file_get_contents($logoPath); if ($logoData !== false) { $logoB64 = base64_encode($logoData); $logoExt = strtolower(pathinfo($logoPath, PATHINFO_EXTENSION)); $logoMime = $logoExt === 'svg' ? 'image/svg+xml' : (in_array($logoExt, ['png','jpeg','jpg','gif','webp'], true) ? 'image/'.$logoExt : 'image/png'); if ($logoExt === 'jpg') { $logoMime = 'image/jpeg'; } $logoSrc = 'data:'.$logoMime.';base64,'.$logoB64; } } } @endphp @if($logoSrc) Logo @endif
{{ __('pdf.booking') }}
{{$booking['Ref'] ?? '#'.$booking['id']}}
Date: @php $dateFormat = $setting['date_format'] ?? 'YYYY-MM-DD'; $dateTime = \Carbon\Carbon::parse($booking['booking_date']); $phpDateFormat = str_replace(['YYYY', 'MM', 'DD'], ['Y', 'm', 'd'], $dateFormat); $formattedDate = $dateTime->format($phpDateFormat); @endphp {{$formattedDate}}
{{ __('pdf.reference') }}{{ $isRtl ? '' : ':' }} {{$booking['Ref'] ?? '#'.$booking['id']}}
{{ __('pdf.status') }}{{ $isRtl ? '' : ':' }} @php $statusColors = [ 'pending' => ['bg' => '#fef3c7', 'color' => '#92400e'], 'confirmed' => ['bg' => '#d1fae5', 'color' => '#065f46'], 'cancelled' => ['bg' => '#fee2e2', 'color' => '#991b1b'], 'completed' => ['bg' => '#dbeafe', 'color' => '#1e40af'], ]; $statusKey = strtolower($booking['status']); $statusStyle = $statusColors[$statusKey] ?? ['bg' => '#e5e7eb', 'color' => '#374151']; @endphp {{$booking['status']}}
{{ __('pdf.customer') }}
{{$booking['customer_name']}}
@if($booking['customer_phone'] && $booking['customer_phone'] !== '-')
{{ __('pdf.phone') }}{{ $isRtl ? '' : ':' }} {{$booking['customer_phone']}}
@endif @if($booking['customer_email'] && $booking['customer_email'] !== '-')
{{ __('pdf.email') }}{{ $isRtl ? '' : ':' }} {{$booking['customer_email']}}
@endif @if($booking['customer_adr'] && $booking['customer_adr'] !== '-')
{{ __('pdf.address') }}{{ $isRtl ? '' : ':' }} {{$booking['customer_adr']}}
@endif
{{ __('pdf.company_info') }}
{{$setting['CompanyName']}}
{{ __('pdf.phone') }}{{ $isRtl ? '' : ':' }} {{$setting['CompanyPhone']}}
{{ __('pdf.email') }}{{ $isRtl ? '' : ':' }} {{$setting['email']}}
{{ __('pdf.address') }}{{ $isRtl ? '' : ':' }} {{$setting['CompanyAdress']}}
@if($booking['booking_end_time']) @endif
{{ __('pdf.service_details') }} {{ __('pdf.value') }}
{{ __('pdf.service') }} {{$booking['product_name']}}
{{ __('pdf.price') }} @if($booking['price'] && $booking['price'] > 0) {{$symbol}} {{formatPrice((float)$booking['price'], 2, $priceFormat)}} @else - @endif
Booking Date @php $dateFormat = $setting['date_format'] ?? 'YYYY-MM-DD'; $dateTime = \Carbon\Carbon::parse($booking['booking_date']); $phpDateFormat = str_replace(['YYYY', 'MM', 'DD'], ['Y', 'm', 'd'], $dateFormat); $formattedDate = $dateTime->format($phpDateFormat); @endphp {{$formattedDate}}
{{ __('pdf.start_time') }} {{$booking['booking_time']}}
{{ __('pdf.end_time') }} {{$booking['booking_end_time']}}
{{ __('pdf.status') }} @php $statusColors = [ 'pending' => ['bg' => '#fef3c7', 'color' => '#92400e'], 'confirmed' => ['bg' => '#d1fae5', 'color' => '#065f46'], 'cancelled' => ['bg' => '#fee2e2', 'color' => '#991b1b'], 'completed' => ['bg' => '#dbeafe', 'color' => '#1e40af'], ]; $statusKey = strtolower($booking['status']); $statusStyle = $statusColors[$statusKey] ?? ['bg' => '#e5e7eb', 'color' => '#374151']; @endphp {{$booking['status']}}
@if($booking['notes'])
{{ __('pdf.notes') }}
{{$booking['notes']}}
@endif
@if($setting['is_invoice_footer'] && $setting['invoice_footer'] !==null)

{{$setting['invoice_footer']}}

@endif

{{ __('pdf.thank_you_booking') }}