@if($template->type === 'text') @endif @if($template->type === 'longtext') @endif @if($template->type === 'date') @endif @if($template->type === 'options') @php($options = explode(';', $template->options)) @php($options = array_combine($options, $options)) @endif @if($template->type === 'checklist') @php($list = explode(';', $template->options)) @if($template->value->value == 1) @php($template->value->value = '[]') @endif
@foreach($list as $item)
@endforeach
@endif @if($template->type === 'radio') @php($list = explode(';', $template->options)) @foreach($list as $key => $item) @endforeach @endif @if($template->type == 'table') @php($value_data = json_decode($template->value->value ?? '[]', true)) @php($content_data = json_decode($template->options, true)) @if($value_data == []) @php($value_data = $content_data) @endif @php($keys = ($value_data == null) ? [] : array_values(array_keys($value_data))) @foreach($keys as $key) @endforeach @php($key_values = []) @if($value_data !== null) @php($count = head($value_data) == false ? 0 : count(head($value_data))) @for($i = 0; $i < $count; $i++) @if(($value_data[$key][$i] ?? '') != '') @foreach($keys as $key) @endforeach @endif @endfor @endif
{{ $key }}
{{ $value_data[$key][$i] ?? ($key_values[$key][$i] ?? '') }}
@endif