

<?php $__env->startSection('content'); ?>
    <!-- Page content area start -->
    <div data-aos="fade-up" data-aos-duration="1000" class="p-sm-30 p-15">
        <h4 class="fs-24 fw-500 lh-34 text-title-black pb-16"><?php echo e(__('Create Dynamic Fields For Ticket Create')); ?></h4>
        <div class="bd-one bd-c-stroke bd-ra-8 bg-white p-sm-25 p-15">
            <form class="ajax reset" action="<?php echo e(route('admin.dynamic-fields-store')); ?>" method="post"
                  data-handler="dynamicFieldResponse">
                <?php echo csrf_field(); ?>
                <div class="table-responsive">
                    <table class="table zTable zTable-last-item-right" id="myTable">
                        <thead>
                        <tr>
                            <th>
                                <div><?php echo e(__("Type")); ?></div>
                            </th>
                            <th>
                                <div><?php echo e(__("Level")); ?></div>
                            </th>
                            <th>
                                <div><?php echo e(__("Placeholder")); ?></div>
                            </th>
                            <th>
                                <div><?php echo e(__("Required")); ?></div>
                            </th>
                            <th>
                                <div class="text-nowrap"><?php echo e(__("Field Width (%)")); ?></div>
                            </th>
                            <th>
                                <div><?php echo e(__("Order")); ?></div>
                            </th>
                            <th>
                                <div>
                                    <button class="w-100 border-0 bd-ra-4 bg-main-color text-white" type="button"
                                            id="addRowBtn"><i class="fa fa-plus"></i></button>
                                </div>
                            </th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td>
                                <select class="form-control" name="type[]" disabled>
                                    <option><?php echo e(__("Type")); ?></option>
                                    <option value="<?php echo e(TEXT_FIELD_ID); ?>" selected><?php echo e(__("Text")); ?></option>
                                    <option value="<?php echo e(TEXTAREA_FIELD_ID); ?>"><?php echo e(__("Textarea")); ?></option>
                                </select>
                            </td>
                            <td>
                                <input type="text" name="level[]" value="<?php echo e(__('Subject')); ?>" class="zForm-control"
                                       disabled>
                            </td>
                            <td>
                                <input type="text" name="placeholder[]" value="<?php echo e(__('Subject')); ?>" class="zForm-control"
                                       disabled>
                            </td>
                            <td>
                                <select class="form-control" name="required[]" disabled>
                                    <option><?php echo e(__("Required")); ?></option>
                                    <option value="<?php echo e(REQUIRED_NO); ?>">No</option>
                                    <option value="<?php echo e(REQUIRED_YES); ?>" selected>Yes</option>
                                </select>
                            </td>
                            <td>
                                <input type="number" name="width[]" value="65" class="zForm-control" disabled>
                            </td>
                            <td>
                                <input type="number" name="order[]" value="1" class="zForm-control" disabled>
                            </td>
                            <td>
                                <div class="d-flex justify-content-end">
                                    <div
                                        class="w-30 h-30 bd-one bd-c-stroke rounded-circle d-flex align-items-center justify-content-center">
                                        <i class="fa fa-trash df-delete-btn-disable"></i></div>
                                </div>
                            </td>
                        </tr>

                        <tr>
                            <td>
                                <select class="form-control" name="type[]" disabled>
                                    <option><?php echo e(__("Type")); ?></option>
                                    <option value="" selected><?php echo e(__("Option")); ?></option>
                                </select>
                            </td>
                            <td>
                                <input type="text" name="level[]" value="<?php echo e(__('Category')); ?>" class="zForm-control"
                                       disabled>
                            </td>
                            <td>
                                <input type="text" name="placeholder[]" value="<?php echo e(__('Category')); ?>" class="zForm-control"
                                       disabled>
                            </td>
                            <td>
                                <select class="form-control" name="required[]" disabled>
                                    <option><?php echo e(__("Required")); ?></option>
                                    <option value="<?php echo e(REQUIRED_NO); ?>">No</option>
                                    <option value="<?php echo e(REQUIRED_YES); ?>" selected>Yes</option>
                                </select>
                            </td>
                            <td>
                                <input type="number" name="order[]" value="35" class="zForm-control" disabled>
                            </td>
                            <td>
                                <input type="number" name="order[]" value="2" class="zForm-control" disabled>
                            </td>
                            <td>
                                <div class="d-flex justify-content-end">
                                    <div
                                        class="w-30 h-30 bd-one bd-c-stroke rounded-circle d-flex align-items-center justify-content-center">
                                        <i class="fa fa-trash df-delete-btn-disable"></i></div>
                                </div>
                            </td>
                        </tr>

                        <?php $__currentLoopData = $filedList; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td>
                                    <select class="form-control" name="type[]">
                                        <option
                                            value="<?php echo e(TEXT_FIELD_ID); ?>" <?php echo e($item->type == TEXT_FIELD_ID?'selected':''); ?>>
                                            Text
                                        </option>
                                        <option
                                            value="<?php echo e(TEXTAREA_FIELD_ID); ?>" <?php echo e($item->type == TEXTAREA_FIELD_ID?'selected':''); ?>>
                                            Textarea
                                        </option>
                                    </select>
                                </td>
                                <td>
                                    <input type="text" name="level[]" value="<?php echo e($item->level); ?>" class="zForm-control">
                                </td>
                                <td>
                                    <input type="text" name="placeholder[]" value="<?php echo e($item->placeholder); ?>"
                                           class="zForm-control">
                                </td>
                                <td>
                                    <select class="form-control" name="required[]">
                                        <option></option>
                                        <option
                                            value="<?php echo e(REQUIRED_NO); ?>" <?php echo e($item->required == REQUIRED_NO?'selected':''); ?>>No
                                        </option>
                                        <option
                                            value="<?php echo e(REQUIRED_YES); ?>" <?php echo e($item->required == REQUIRED_YES?'selected':''); ?>>
                                            Yes
                                        </option>
                                    </select>
                                </td>
                                <td>
                                    <input type="number" name="width[]" value="<?php echo e($item->width); ?>" class="zForm-control">
                                </td>
                                <td>
                                    <input type="number" name="order[]" value="<?php echo e($item->order); ?>" class="zForm-control">
                                </td>
                                <td>
                                    <div class="d-flex justify-content-end">
                                        <div
                                            class="w-30 h-30 bd-one bd-c-stroke rounded-circle d-flex align-items-center justify-content-center">
                                            <i class="fa fa-trash df-delete-btn-disable"></i></div>
                                    </div>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>

                        </tbody>
                    </table>
                </div>

                <button
                    class="py-10 px-26 bg-main-color bd-one bd-c-main-color bd-ra-8 fs-15 fw-600 lh-25 text-white mt-25"
                    type="submit"><?php echo e(__('Update')); ?></button>

            </form>
        </div>
    </div>
    <!-- Page content area end -->
    <input type="hidden" id="TEXT_FIELD_ID" value="<?php echo e(TEXT_FIELD_ID); ?>">
    <input type="hidden" id="TEXTAREA_FIELD_ID" value="<?php echo e(TEXTAREA_FIELD_ID); ?>">
    <input type="hidden" id="REQUIRED_NO" value="<?php echo e(REQUIRED_NO); ?>">
    <input type="hidden" id="REQUIRED_YES" value="<?php echo e(REQUIRED_YES); ?>">
    <input type="hidden" id="fieldCount" value="<?php echo e(count($filedList)); ?>">
<?php $__env->stopSection(); ?>
<?php $__env->startPush('script'); ?>
    <script src="<?php echo e(asset('admin/libs/datatable/datatables.min.js')); ?>"></script>
    <script src="<?php echo e(asset('admin/js/custom/dynamic_field.js')); ?>"></script>
<?php $__env->stopPush(); ?>

<?php echo $__env->make('admin.layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home6/metawebd/metagrievance.metawebdevelopment.cloud/resources/views/admin/dynamic_fields/index.blade.php ENDPATH**/ ?>