<?php
    // Variable for the form
    $form = 'destinationFormID';
    $button = [
        'save' => 'destinationSaveData',
        'close' => 'destinationCloseForm',
    ];

    // Get data
    $id = !empty($data) && !empty($data['id']) ? (int) $data['id'] : 0;
    $name = !empty($data) && !empty($data['name']) ? ucfirst($data['name']) : '';
    $destinationtypeID = !empty($data) && !empty($data['destinationtype_id']) ? (int) $data['destinationtype_id'] : '';

    // Form title
    $title = !empty($id) ? $name : 'Ajouter une destination';

?>

<form id="<?php echo e($form); ?>">
    <?php echo csrf_field(); ?>
    <input type="hidden" name="rowID" value="<?php echo e($id); ?>">
    <div class="modal-header bg-primary">
        <h3 class="modal-title fw-light text-uppercase text-white fs-5"><?php echo e($title); ?></h3>
        <!--begin::Close-->
        <div class="btn btn-icon btn-sm  ms-2" data-bs-dismiss="modal" aria-label="Close">
            <i class="ki-duotone ki-cross fs-1 text-white"><span class="path1"></span><span class="path2"></span></i>
        </div>
        <!--end::Close-->
    </div>

    <div class="modal-body">
        <!--begin::Input-->
        <div class="fv-row mb-5 row">
            <div class="col-md-6">
                <!--begin::Label-->
                <label class="d-flex align-items-center fs-5 fw-semibold mb-2">
                    <span class="required">Type de destination</span>
                    </span>
                </label>
                <!--end::Label-->
                <select class="form-select form-select-solid" id="destinationtype_id" data-control="select2"
                    data-placeholder="Choix..." data-dropdown-parent="#destinationModalID" name="destinationtype_id">
                    <option></option>
                    <?php $__empty_1 = true; $__currentLoopData = $destinationTypeRecords; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $destinationTypeRecord): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                        <?php
                            $selected = $destinationTypeRecord->id === $destinationtypeID ? ' selected="selected"' : '';
                        ?>
                        <option value="<?php echo e($destinationTypeRecord->id); ?>" <?php echo e($selected); ?>><?php echo e(ucfirst($destinationTypeRecord->name)); ?>

                        </option>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                    <?php endif; ?>
                </select>
            </div>
            <div class="col-md-6">
                <!--begin::Label-->
                <label class="d-flex align-items-center fs-5 fw-semibold mb-2">
                    <span class="required">Destination</span>
                    </span>
                </label>
                <!--end::Label-->
                <!--begin::Input-->
                <input type="text" class="form-control form-control-lg form-control-solid" name="name"
                    value="<?php echo e($name); ?>">
                <!--end::Input-->
            </div>
        </div>
        <!--end::Input-->



    </div>
    <div class="modal-footer justify-content-center">
        <a href="javascript:;" class="btn btn-danger" data-bs-dismiss="modal" aria-label="Close"
            id="<?php echo e($button['close']); ?>">Fermer</a>
        <button type="submit" class="btn btn-primary" id="<?php echo e($button['save']); ?>">Ajouter</button>
    </div>
</form>
<?php /**PATH C:\laragon\www\car-rend\resources\views/backoffice/settings/destination/form.blade.php ENDPATH**/ ?>