@php $form_name = $survey_data->form_name; $survey_id=$survey_data->survey_form_id; $beneficiary_details=json_decode($survey_data->beneficiary_details); $survey_data = json_decode($survey_data->survey_form_data); $sub_section = $survey_data->sub_sections; $array_sectiion = (array) $survey_data->sections; $allow_to_update_form=allow_to_update_form(); $certification_status=certification($survey_form_id,'HRU'); $change_status=false; $hold=false; if(Auth::user()->role==30 || $allow_to_update_form->allow_to_update_form=='field_supervisor'){ $change_status=true; $updated_by='field supervisor'; } if(Auth::user()->role==34 || $allow_to_update_form->allow_to_update_form=='IP'){ $change_status=true; $updated_by='IP'; } if(Auth::user()->role==26 || $allow_to_update_form->allow_to_update_form=='HRU'){ $change_status=true; $updated_by='HRU'; } if(Auth::user()->role==37 || $allow_to_update_form->allow_to_update_form=='PSIA'){ $change_status=true; $updated_by='PSIA'; } if(Auth::user()->role==38 || $allow_to_update_form->allow_to_update_form=='HRU_Main'){ $change_status=true; $updated_by='HRU_Main'; $hold=true; } if(Auth::user()->role==39 || $allow_to_update_form->allow_to_update_form=='COO'){ $change_status=true; $updated_by='COO'; $hold=true; } if(Auth::user()->role==40 || $allow_to_update_form->allow_to_update_form=='CEO'){ $change_status=true; $updated_by='CEO'; $hold=true; } @endphp @if($certification_status && $certification_status->certification==1)
@endif

{{ $form_name }}

@foreach($array_sectiion as $key => $section) @php $questions = $section->questions; @endphp
{{ $key }}
@foreach($questions as $ques) @php $question_name = $ques->question->name ?? null; $answer = $ques->question->answer ?? null; @endphp

Question: {{ $question_name }}

@if($ques->question->type == 'checkbox') @php $options = $ques->options ?? null; @endphp @if($options != null)
    @foreach($options as $option) @if($option->answer == 'selected')
  • {{ $option->name }}
  • @endif @endforeach
@endif @php @endphp @elseif($ques->question->type == 'map') @php $options = $ques->options ?? null; @endphp @if($options != null)
    @foreach($options as $option)
  • {{ $option->name }} : {{ $option->answer }}
  • @endforeach
@endif @elseif($ques->question->type == 'image') @php if(isset($ques->question->answer)){ $image_data=json_decode($ques->question->answer); $base64Image = $image_data->image->base64; if(isset($image_data->image->type)){ $imageType = $image_data->image->type; } if(isset($image_data->image->mime)){ $imageType = $image_data->image->mime; } $dataUri = 'data:' . $imageType . ';base64,' . $base64Image; }else{ $dataUri=null; $image_data=null; } @endphp @if(isset($dataUri))

Coordinates:-

Longitude: {{$image_data ? ($image_data->fetchLocation->longitude ?? 'not available') : 'not available'}}

Accuracy {{$image_data ? ($image_data->fetchLocation->accuracy ?? 'not available') : 'not available'}}

Latitude {{$image_data ? ($image_data->fetchLocation->latitude ?? 'not available') : 'not available' }}

Altitude {{$image_data ? ($image_data->fetchLocation->altitude ?? 'not available' ) : 'not available'}}

@else

Not available

@endif @else

Answer: {{ $answer ?? 'not available' }}

@if($ques->options != null) @php $options_id = []; foreach($ques->options as $option_id) { $options_id[] = $option_id->option_id; } @endphp @endif @endif @endforeach
@endforeach
@if($change_status) @if(Auth::user()->role==37 || $allow_to_update_form->allow_to_update_form=='PSIA') @if($certification_status->certification==1) @endif @else @endif @if($hold) @endif @endif
@if(session('error')) @endif @if(session('success')) @endif