@extends('layouts.app') @section('content')
(SILA RUJUK PANDUAN MENGISI BORANG)
{{ $submittedForm->created_by }}
{{ $submittedForm->id_form }}
{{ $submittedForm->form_status->title ?? 'N/A' }}
{{ $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 answer provided
@endif @break @case('file') @if ($answers->first()) @php $fileData = json_decode($answers->first()->value, true); $originalFilePath = $fileData['original'] ?? null; @endphp @if ($originalFilePath) @elseNo original file uploaded
@endif @elseNo file uploaded
@endif @break @case('custom_ui')| Commodity | Crop Type | Planted Area (ha) |
|---|---|---|
| {{ $crop }} | {{ $submittedForm->form_answer->where('id_form_question', $questionId)->pluck('value')->first() ?? 'No answer provided' }} | {{ $submittedForm->form_answer->where('id_form_question', $questionId)->pluck('value')->skip(1)->first() ?? 'No answer provided' }} |
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 @defaultUnknown question type
@endswitch