|
BORANG PERMOHONAN MYGAP 1-1APPLICATION(SILA RUJUK PANDUAN MENGISI BORANG) |
|
| {{ $section->title }} | |||||||
|---|---|---|---|---|---|---|---|
| {!! $question->tittle_numbering !!}. {!! $question->question !!} |
@php
$answers = $submittedForm->form_answer->where('id_form_question', $question->id);
@endphp
@switch($question->answer_type)
@case('text')
@case('textarea')
@case('number')
@case('date')
{{ $answers->first()->value ?? 'No answer provided' }}
@break
@case('select')
@case('radio')
@case('dropdown')
{{ $answers->first()->value ?? 'No answer provided' }}
@break
@case('checkbox')
@if ($answers->isNotEmpty())
No original file uploaded @endif @elseNo file uploaded @endif @break @case('custom_ui')
Total Planted Area: @php // Sum the values for the area $areaAnswers = $submittedForm->form_answer->where('id_form_question', 28); $totalArea = $areaAnswers->sum(function ($answer) { return (float) $answer->value; }); @endphp {{ $totalArea > 0 ? $totalArea : 'Not provided' }} ha @break @default Unknown question type @endswitch |
||||||