{{-- @extends('layouts.master') @section('content')
Left Logo

myGAP

Malaysian Good Agricultural Practice

JABATAN PERTANIAN

Department Of Agriculture

BORANG PERMOHONAN

APPLICATION FORM

Bahagian A hingga E untuk diisi oleh Pemohon

Bahagian F untuk diisi oleh Pegawai Pembimbing

Bahagian G untuk diisi oleh Urus Setia Pensijilan

(SILA RUJUK PANDUAN MENGISI BORANG)

Right Logo

{{ $submittedForm->form->title }}

{{ $submittedForm->created_by }}

{{ $submittedForm->id_form }}

{{ $submittedForm->form_status->title ?? 'N/A' }}

Download PDF @foreach ($sections as $section)
{{ $section->title }}
@foreach ($section->form_question as $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())
    @foreach ($answers as $answer)
  • {{ $answer->value }}
  • @endforeach
@else

No answer provided

@endif @break @case('file') @if ($answers->first()) @php // Assuming the 'value' contains a JSON object with 'original' and 'unique' keys. $fileData = json_decode( $answers->first()->value, true, ); // Decoding the JSON to get an array $originalFilePath = $fileData['original'] ?? null; // Access the 'original' file path @endphp @if ($originalFilePath) View File @else

No original file uploaded

@endif @else

No file uploaded

@endif @break @case('custom_ui') @php $crops = [ 'Fruits' => 24, 'Vegetables' => 25, 'Paddy' => 26, 'Others' => 27, ]; @endphp @foreach ($crops as $crop => $questionId) @endforeach
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: {{ $submittedForm->form_answer->firstWhere('id_form_question', $question->id)->value ?? 'Not provided' }} ha

@break @default

Unknown question type

@endswitch
@endforeach
@endforeach
@endsection --}}