@php $fields = isset($offer) ? json_decode($offer->template_fields, true) : []; // print_r($fields);exit; @endphp
@php $table_option = $fields['table_option'] ?? ''; @endphp
@php $tableOption1Data = $fields['table_option1'] ?? []; $tableOption2Data = $fields['table_option2'] ?? []; $grandTotalOption1 = 0; $grandTotalOption2 = 0; @endphp

Option 1: Rate Per Night

@if (!empty($tableOption1Data)) @foreach ($tableOption1Data as $row) @php $rowTotalRate = floatval($row['total_rate'] ?? 0); $grandTotalOption1 += $rowTotalRate; @endphp @endforeach @endif
Room Category * Rate *
(per night)
Total Rate*
(per room)

Grand Total: {{ number_format($grandTotalOption1, 2) }}

Option 2: Rooms & Prices

@if (!empty($tableOption2Data)) @foreach ($tableOption2Data as $row) @php $rowTotalPrice = floatval($row['total_price'] ?? 0); $grandTotalOption2 += $rowTotalPrice; @endphp @endforeach @endif
Room Category * No. of Rooms * Price *
(per room, per night)
Price
(per room, total stay)
Total Price

Grand Total: {{ number_format($grandTotalOption2, 2) }}

@php $sections = $fields['sections'] ?? []; // print_r($sections);exit; @endphp
@foreach ($sections as $index => $section)
@if ($index > 0)
@endif
@endforeach @if (empty($sections)) {{-- Default empty block if no section exists --}}
@endif