@php $form_name = $survey_data->form_name; $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; @endphp @php $certification_status=\DB::table('form_status')->where('form_id',$survey_form_id)->where('update_by','HRU')->select('certification')->first(); @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