

<?php $__env->startSection('content'); ?>
    <!--begin::App Content Header-->
    <div class="app-content-header"> <!--begin::Container-->
        <div class="container-fluid">
            <!--begin::Row-->
            <div class="row">
                <div class="col-sm-6">
                    <h3 class="card-title">Borang Permohonan myGAP 1.1 - <?php echo e($form->title); ?></h3>
                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-end">
                        <li class="breadcrumb-item"><a href="#">Home</a></li>
                        <li class="breadcrumb-item active" aria-current="page">
                            myGAP 1.1 form
                        </li>
                    </ol>
                </div>
            </div>
            <!--end::Row-->
        </div> <!--end::Container-->
    </div>
    <!--end::App Content Header-->

    <div class="row">
        <div class="col-md-12">
            <div class="card">
                <div class="card-header">
                    <div
                        style="display: flex; align-items: center; justify-content: space-between; border-bottom: 2px solid black; padding-bottom: 10px; margin-bottom: 20px;">
                        <!-- Left Logo -->
                        <img src="<?php echo e(asset('assets/img/jabatan-pertanian.jpg')); ?>" alt="Left Logo" style="width:15%">

                        <div style="text-align: center;">
                            <h5 class="mb-0 text-decoration-underline fw-bold">
                                BORANG PERMOHONAN MYGAP 1-1
                            </h5>
                            <h6 class="fw-bold">
                                APPLICATION
                            </h6>
                            <p class="fst-italic">(SILA RUJUK PANDUAN MENGISI BORANG)</p>
                        </div>

                        <img src="<?php echo e(asset('assets/img/mygap.png')); ?>" alt="Right Logo" style="width:15%">
                    </div>
                
                </div>
                <form action="<?php echo e(route('form.submit', ['form' => $form->id])); ?>" method="POST"
                    enctype="multipart/form-data">
                    <?php echo csrf_field(); ?>
                    <input type="hidden" name="id_form" value="<?php echo e($form->id); ?>">
                    <div class="card-body">
                        <?php if($errors->any()): ?>
                            <div class="alert alert-danger">
                                <ul>
                                    <?php $__currentLoopData = $errors->all(); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $error): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <li><?php echo e($error); ?></li>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </ul>
                            </div>
                        <?php endif; ?>

                        <!-- Sections Loop -->
                        <?php $__currentLoopData = $sections; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $section): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div class="form-section mb-4">
                                <div class="card card-warning">
                                    <div class="card-header">
                                        <h5 class="card-title"><?php echo e($section->title); ?></h5>
                                    </div>
                                    <div class="card-body">
                                        <?php $__currentLoopData = $section->form_question; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $question): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <div class="form-group row mb-4">
                                                <label for="question_<?php echo e($question->id); ?>" class="col-sm-6 col-form-label">
                                                    <?php echo $question->tittle_numbering; ?>. <?php echo $question->question; ?>

                                                </label>
                                                <div class="col-sm-6">
                                                    <?php echo $__env->make('partials.question', [
                                                        'question' => $question,
                                                    ], \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
                                                    <?php $__errorArgs = ['answers.' . $question->id];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                                                        <div class="text-danger"><?php echo e($message); ?></div>
                                                    <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                                                </div>
                                            </div>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                    </div>
                                </div>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </div>

                    <div class="card-footer d-flex justify-content-end">
                        <button type="submit" class="btn btn-primary">Submit</button>
                    </div>
                </form>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\laragon\www\FMIS_fypsystem\resources\views/form/form-1.blade.php ENDPATH**/ ?>