@extends('admin.layouts.app') @push('libraries_top') @endpush @section('content') {{ $pageTitle }} {{trans('admin/main.dashboard')}} {{ trans('update.forms') }} id}/submissions/{$submission->id}/update") }}" method="post" class="mt-30"> {{ csrf_field() }} @foreach($form->fields as $field) @php $item = $submission->items->where('form_field_id', $field->id)->first(); $value = null; if (!empty($item)) { $value = $item->value; } @endphp @if($field->type == "input") {{ $field->title }}: @error($field->id) {{ $message }} @enderror @elseif($field->type == "number") {{ $field->title }}: @error($field->id) {{ $message }} @enderror @elseif($field->type == "textarea") {{ $field->title }}: {{ $value }} @error($field->id) {{ $message }} @enderror @elseif($field->type == "upload") {{ $field->title }} @error($field->id) {{ $message }} @enderror @elseif($field->type == "date_picker") {{ $field->title }} @error($field->id) {{ $message }} @enderror @elseif($field->type == "toggle") {{ $field->title }} @error($field->id) {{ $message }} @enderror @elseif($field->type == "dropdown") @if(!empty($field->options) and count($field->options)) {{ $field->title }}: {{ trans('update.select_a_option') }} @foreach($field->options as $option) id) ? 'selected' : '' }}>{{ $option->title }} @endforeach @error($field->id) {{ $message }} @enderror @endif @elseif($field->type == "checkbox") @php if (!empty($value)) { $value = json_decode($value, true); } @endphp @if(!empty($field->options) and count($field->options)) {{ $field->title }}: @foreach($field->options as $option) id, $value)) ? 'checked' : '' }} > {{ $option->title }} @endforeach @error($field->id) {{ $message }} @enderror @endif @elseif($field->type == "radio") @if(!empty($field->options) and count($field->options)) {{ $field->title }}: @foreach($field->options as $option) id) ? 'checked' : '' }} > {{ $option->title }} @endforeach @error($field->id) {{ $message }} @enderror @endif @endif @endforeach {{ trans('update.clear_form') }} {{ trans('update.submit_form') }} @endsection @push('scripts_bottom') @endpush