{{--@dd($requested_information)--}} {{--@dd($case->link_case_with_form->form->stages)--}} @extends('layouts.head_office_app') @section('title', 'Case '.$case->id) @section('sub-header') @include('head_office.case_manager.notes.sub-header') @endsection @section('content')
@include('user.modal_single_statement') @include('layouts.error')
@csrf
Update Request Information
Why are you requesting information?
@foreach ($default_texts as $text) @include('head_office.case_manager.edit_request_new_information',['defualt_request_information' => $text]) @endforeach
Add New
{{--
 
--}}
Questions you'd like to ask
Save*
@foreach($requested_question as $question)
::
{{--
--}} {{-- @foreach ($default_texts as $text)--}} {{-- --}} {{-- @endforeach--}}
::
@endforeach
 
is_available_to_person == true ? 'checked' : ''}}> is_available_to_person == false ? 'checked' : ''}}>
{{-- --}}
{{--
--}} {{-- Note :  --}} {{-- --}} {{--
--}}
@php $record = $case->link_case_with_form; $updated_records = $record->all_linked_records()->last(); if (isset($updated_records->raw_form)) { $questionsJson = json_decode($updated_records->raw_form, true); } else { $questionsJson = json_decode($record->raw_form, true); } $data_objects = []; @endphp @if (!empty($gdprs))
@foreach ($gdprs as $gdpr) @endforeach
@endif @if (!empty($case->link_case_with_form->raw_form)) @if ($questionsJson['pages'] && count($questionsJson['pages']) > 0) @foreach ($questionsJson['pages'] as $page) @php $validItems = array_filter($page['items'], function($item) { if ($item['input']['type'] == 'dmd') { $dmdValue = $item['input']['value'] ?? []; return !empty($dmdValue['vmp']['vp_string']) || !empty($dmdValue['vtm']['vtm_string']) || !empty($dmdValue['other']); } return isset($item['input']['value']) && !empty($item['input']['value']); }); @endphp @if (count($validItems) > 0)

{{ $page['name'] }}

{{-- @dd($requested_information->question_ids); --}}
@foreach ($page['items'] as $item) @if (isset($item['label'], $item['input'], $item['input']['type']) && !empty($item['input']['value']))
question_ids) && in_array($item['id'], json_decode($requested_information->question_ids, true) ?? [])) checked @endif class="child-page" name="question_ids[]" value="{{ $item['id'] }}" data-page-id="{{ $page['id'] }}" data-check-gdpr-id="{{ isset($item['gdpr']) ? $item['gdpr'] : '' }}">

{{ $item['label'] }}

@php $value = isset($item['input']['value']) ? $item['input']['value'] : ''; @endphp @switch($item['input']['type']) @case('text') @case('email') @case('textarea')

Response:

{{ $value }}

@break @case('number')

Response:

{{ $value }}

@break @case('date')

Response:

{{ \Carbon\Carbon::parse($value)->format('Y-m-d') }}

@break @case('time')

Response:

{{ \Carbon\Carbon::parse($value)->format('H:i') }}

@break @case('radio') @if (is_array($value))

Response:

{{ $value['val'] ?? $value['text'] ?? ' ' }}

@else

Response:

{{ $value }}

@endif @break @case('checkbox')

Response:

{{ implode(', ', (array) $value) }}

@break @case('select') @if (isset($item['input']['value']) && is_array($item['input']['value'])) @php $values = []; foreach ($item['input']['value'] as $select_value) { $values[] = is_array($select_value) ? ($select_value['val'] ?? $select_value['text'] ?? '') : $select_value; } @endphp

Response:

{{ implode(', ', $values) }}

@else

Response:

{{ $value }}

@endif @break @case('dmd') @php $records = $item['input']['records'] ?? []; $dmd_values = []; foreach ($records as $record2) { $vtm = $record2['vtm']['vtm_string'] ?? ''; $vmp = $record2['vmp']['vp_string'] ?? ''; $other = $record2['other'] ?? ''; $dmd_values[] = implode(', ', array_filter([$vtm, $vmp, $other])); } @endphp @if (!empty($dmd_values))

Response:

{{ implode('; ', $dmd_values) }}

@endif @break @default

Response:

{{ is_array($value) ? implode(',', $value) : $value }}

@endswitch
@endif @endforeach
@endif @endforeach @endif @endif
@php $val = []; foreach ($default_texts as $key => $value) { $val[] = $value->value; } $val = json_encode($val); @endphp @include('head_office.case_manager.edit_request_new_information',['defualt_request_information' => null]) @endsection @section('styles') @endsection @section('scripts') {{----}} @endsection