@foreach($row['sub_rows'] as $rowGroup) @php $rowGroup= $rowGroup['0']; $columnCount = count($rowGroup['columns']); // Number of columns in this row group $widthIndex = 0; $group = $rowGroup; @endphp @for($i = 0; $i < $columnCount; $i++) @php $inputs = $group['columns'][$i]['inputs'] ?? []; // Get the grouped inputs for this column $currentWidth = $group['columns'][$i]['width'] ?? 100; // Use normalized width or default to 100 $widthIndex++; @endphp @if(!empty($inputs)) <{{$group['type_row']}} style="width: {{ $currentWidth }}%" class="input-group sub-tabel-style" > @foreach($inputs as $input) @if(!isset($input['input_type'])) @continue; @endif @if($rowGroup['type_row'] == 'th' && count($rowGroup['columns']) == 1 && $input['input_type'] == 'label')
{{ $input['label'] ?? 'No label' }}
@elseif($rowGroup['type_row'] === 'th')
{{ $input['label'] ?? '' }}
@elseif($input['input_type'] === 'label')
{{ $input['label'] ?? 'No label' }}
@elseif($input['input_type'] === 'radio' || $input['input_type'] === 'checkbox') @if($input['show_pdf'] == 1)
{{ $input['label'] ?? '' }}
@endif
@if($input['answer'] !== ' ' && count($input['options'])==1 && $input['answer'] !=='"[]"' && !empty($input['answer'])) @elseif($input['answer'] !== ' ' && count($input['options'])>1)
@else . . @endif
@else @if($input['show_pdf'] == 1) @endif
{{ $input['label'] ?? 'No label' }} @if($input['input_type'] === 'text' || $input['input_type'] === 'date' || $input['input_type'] === 'number' || $input['input_type'] === 'textarea' ) {{ $input['answer'] ?? $input['placeholder'] ?? 'No answer selected' }} @endif @if($input['input_type'] === 'time' ) {{ date('h:i A', strtotime($input['answer'])) }} @endif @if($input['input_type'] === 'datetime' ) {{ date('d-m-Y H:i', strtotime($input['answer'])) }} @endif @if($input['input_type'] === 'file' ) Download File @endif
@endif @endforeach @else   @endif @endfor @endforeach