<?php
    $datatable = 'carDataTableID';
    $button = [
        'save' => 'reservationSaveData',
        'close' => 'reservationCloseForm',
    ];
    $form = 'reservationFormID';

    // type
    $typePart = [
        '1' => 'CNI',
        '2' => 'PASSSPORT',
    ];

    // dd($cars);

?>

<?php if (isset($component)) { $__componentOriginal1d82783c246b53da9bd54777b9e76c22 = $component; } ?>
<?php if (isset($attributes)) { $__attributesOriginal1d82783c246b53da9bd54777b9e76c22 = $attributes; } ?>
<?php $component = App\View\Components\Backoffice\BackLayout::resolve([] + (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag ? (array) $attributes->getIterator() : [])); ?>
<?php $component->withName('backoffice.back-layout'); ?>
<?php if ($component->shouldRender()): ?>
<?php $__env->startComponent($component->resolveView(), $component->data()); ?>
<?php if (isset($attributes) && $attributes instanceof Illuminate\View\ComponentAttributeBag && $constructor = (new ReflectionClass(App\View\Components\Backoffice\BackLayout::class))->getConstructor()): ?>
<?php $attributes = $attributes->except(collect($constructor->getParameters())->map->getName()->all()); ?>
<?php endif; ?>
<?php $component->withAttributes(['title' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($title),'breadcrumb' => \Illuminate\View\Compilers\BladeCompiler::sanitizeComponentAttribute($breadcrumb)]); ?>

    <!--begin::Container-->
    <div id="kt_content_container" class="container-xxl">
        <?php if(session('success')): ?>
            <div class="alert alert-success text-center">
                <?php echo e(session('success')); ?>

            </div>
        <?php endif; ?>
        <div class="card">
            
            <!--begin::Card header-->
            <div class="card-header border-0 pt-6">
                <!--begin::Card title-->
                <div class="card-title">
                    <!--begin::Search-->
                    
                    <span>Lise des reservations</span>
                    <!--end::Search-->
                </div>
                <!--begin::Card title-->
            </div>
            <!--end::Card header-->
            <!--begin::Card body-->
            <div class="card-body py-4">
                <form id="<?php echo e($form); ?>" method="post" action="<?php echo e(route('reservation.post')); ?>">
                    <?php echo csrf_field(); ?>
                    <input type="hidden" name="rowID" name="rowID" value="0">


                    <!--begin::-->
                    <div class="fv-row mb-5 row">
                        <div class="col-md-4">
                            <!--begin::Label-->
                            <label class="d-flex align-items-center fs-5 fw-semibold mb-2">
                                <span class="required">Véhicules</span>
                                </span>
                            </label>
                            <!--end::Label-->
                            <!--begin::Input-->
                            <select class="form-select form-select-solid sl2" id="car" data-control="select2"
                                data-placeholder="Choisissez un véhicule" name="car_id">
                                <option></option>
                                <?php $__empty_1 = true; $__currentLoopData = $cars; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $car): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    <?php
                                        // $selected = $car->id === $carID ? ' selected="selected"' : '';
                                    ?>
                                    <option value="<?php echo e($car->id); ?>" carprice=<?php echo e($car->price); ?>>
                                        <?php echo e(mb_strtoupper($car->brand->name) . ' ' . mb_strtoupper($car->modele->name) . ' | ' . $car->immatriculation); ?>

                                    </option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                <?php endif; ?>
                            </select>
                            <!--end::-->
                            <?php if($errors->has('car_id')): ?>
                                <div class="text-danger"><?php echo e($errors->first('car_id')); ?></div>
                            <?php endif; ?>
                        </div>

                        <div class="col-md-4">
                            <!--begin::Label-->
                            <label class="d-flex align-items-center fs-5 fw-semibold mb-2">
                                <span class="required">Date debut</span>
                                </span>
                            </label>
                            <!--end::Label-->
                            <!--begin::Input-->
                            <input class="form-control form-control-solid attr_date"
                                placeholder="Date et heure de debut" id="start" name="start" value="" />
                            <!--end::Input-->
                            <?php if($errors->has('start')): ?>
                                <div class="text-danger"><?php echo e($errors->first('start')); ?></div>
                            <?php endif; ?>
                        </div>

                        <div class="col-md-4">
                            <!--begin::Label-->
                            <label class="d-flex align-items-center fs-5 fw-semibold mb-2">
                                <span class="required">Date fin</span>
                                </span>
                            </label>
                            <!--end::Label-->
                            <!--begin::Input-->
                            <input class="form-control form-control-solid attr_date" placeholder="Date et heure de fin"
                                id="end" name="end" value="" />
                            <!--end::Input-->
                            <?php if($errors->has('end')): ?>
                                        <div class="text-danger"><?php echo e($errors->first('end')); ?></div>
                                    <?php endif; ?>
                        </div>

                    </div>
                    <!--end::-->

                    <!--begin::-->
                    <div class="fv-row mb-5 row">
                        <div class="col-md-3">
                            <!--begin::Label-->
                            <label class="d-flex align-items-center fs-5 fw-semibold mb-2">
                                <span class="required">Prénoms</span>
                                </span>
                            </label>
                            <!--end::Label-->
                            <!--begin::Input-->
                            <input class="form-control form-control-solid" placeholder="" name="first_name"
                                value="" />
                            <!--end::Input-->
                            <?php if($errors->has('first_name')): ?>
                                        <div class="text-danger"><?php echo e($errors->first('first_name')); ?></div>
                                    <?php endif; ?>
                        </div>
                        <div class="col-md-3">
                            <!--begin::Label-->
                            <label class="d-flex align-items-center fs-5 fw-semibold mb-2">
                                <span class="required">Nom</span>
                                </span>
                            </label>
                            <!--end::Label-->
                            <!--begin::Input-->
                            <input class="form-control form-control-solid" placeholder="" name="last_name"
                                value="" />
                            <!--end::Input-->
                            <?php if($errors->has('last_name')): ?>
                                        <div class="text-danger"><?php echo e($errors->first('last_name')); ?></div>
                                    <?php endif; ?>
                        </div>
                        <div class="col-md-3">
                            <!--begin::Label-->
                            <label class="d-flex align-items-center fs-5 fw-semibold mb-2">
                                <span class="required">Téléphone</span>
                                </span>
                            </label>
                            <!--end::Label-->
                            <!--begin::Input-->
                            <input class="form-control form-control-solid" placeholder="" name="phone" type="tel"
                                value="" />
                            <!--end::Input-->
                            <?php if($errors->has('phone')): ?>
                                        <div class="text-danger"><?php echo e($errors->first('phone')); ?></div>
                                    <?php endif; ?>
                        </div>
                        <div class="col-md-3">
                            <label class="d-flex align-items-center fs-5 fw-semibold mb-2">
                                <span class="required">Adresse</span>
                                </span>
                            </label>
                            <!--end::Label-->
                            <!--begin::Input-->
                            <input class="form-control form-control-solid" placeholder="" name="address"
                                value="" />
                            <!--end::Input-->
                            <?php if($errors->has('address')): ?>
                                        <div class="text-danger"><?php echo e($errors->first('address')); ?></div>
                                    <?php endif; ?>
                        </div>
                    </div>
                    <!--end::-->

                    <!--begin::-->
                    <div class="fv-row mb-5 row">
                        <div class="col-md-3">
                            <!--begin::Label-->
                            <label class="d-flex align-items-center fs-5 fw-semibold mb-2">
                                <span class="required">Type de pièce</span>
                                </span>
                            </label>
                            <!--end::Label-->
                            <!--begin::Input-->
                            <select class="form-select cars" data-control="select2"
                                data-placeholder="Choisir le type de pièce" name="type_part">
                                <option></option>
                                <?php $__empty_1 = true; $__currentLoopData = $typePart; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $key => $item): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                                    
                                    <option value="<?php echo e($key); ?>"><?php echo e($item); ?></option>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                                <?php endif; ?>
                            </select>
                            <!--end::Input-->
                            <?php if($errors->has('type_part')): ?>
                                        <div class="text-danger"><?php echo e($errors->first('type_part')); ?></div>
                                    <?php endif; ?>
                        </div>

                        <div class="col-md-3">
                            <label class="d-flex align-items-center fs-5 fw-semibold mb-2">
                                <span class="required">Numéro de pièce</span>
                                </span>
                            </label>
                            <!--end::Label-->
                            <!--begin::Input-->
                            <input class="form-control form-control-solid" placeholder="" name="number_part"
                                value="" />
                            <!--end::Input-->
                            <?php if($errors->has('number_part')): ?>
                                        <div class="text-danger"><?php echo e($errors->first('number_part')); ?></div>
                                    <?php endif; ?>
                        </div>

                        <div class="col-md-3">
                            <label class="d-flex align-items-center fs-5 fw-semibold mb-2">
                                <span class="required">Numéro de permis</span>
                                </span>
                            </label>
                            <!--end::Label-->
                            <!--begin::Input-->
                            <input class="form-control form-control-solid" placeholder="" name="number_permit"
                                value="" />
                            <!--end::Input-->
                        </div>
                        <div class="col-md-3">
                            <label class="d-flex align-items-center fs-5 fw-semibold mb-2">
                                <span class="required">Email</span>
                                </span>
                            </label>
                            <!--end::Label-->
                            <!--begin::Input-->
                            <input type="email" class="form-control form-control-solid" placeholder=""
                                name="email" value="" />
                            <!--end::Input-->
                        </div>
                    </div>
                    <!--end::-->


                    <!--begin::-->
                    <div class="mb-5 row">
                        <div class="col-md-6">
                            <div class="form-check form-switch form-check-custom form-check-solid mb-5">
                                <input class="form-check-input h-20px w-30px" type="checkbox" id="account" />
                                <label class="form-check-label text-primary" for="paid">
                                    Je verse un account
                                </label>
                            </div>
                            <!--begin::Input-->
                            <input class="form-control form-control-solid d-none" id="input_account" placeholder=""
                                name="account" />
                            <!--end::Input-->
                        </div>
                        <div class="col-md-6">
                            <div class="form-check form-switch form-check-custom form-check-solid mb-5">
                                <input class="form-check-input h-20px w-30px" type="checkbox" id="delivery" />
                                <label class="form-check-label text-primary" for="paid">
                                    Me faire livrer le véhicule
                                </label>
                            </div>
                            <!--begin::Input-->
                            <input class="form-control form-control-solid d-none" id="input_delivery" placeholder=""
                                name="delivery" value="" />
                            <!--end::Input-->
                        </div>

                    </div>
                    <!--end::-->


                    <div class="form-check form-switch form-check-custom form-check-solid mb-2">
                        <input class="form-check-input h-20px w-30px" type="checkbox" id="paid" name="is_paid"
                            <?php echo e(!empty($is_paid) ? 'checked' : ''); ?> />
                        <label class="form-check-label text-primary" for="paid">
                            Je paie la totalité
                        </label>
                    </div>

                    <div class="form-check form-switch form-check-custom form-check-solid mb-5">
                        <input class="form-check-input h-20px w-30px" type="checkbox" id="conductor"
                            name="conductor" <?php echo e(!empty($conductor) ? 'checked' : ''); ?> />
                        <label class="form-check-label text-primary" for="paid">
                            Je désire un conducteur
                        </label>
                    </div>

                    


                    <div class="fv-row mt-5 row">
                        <!--begin::Label-->
                        <label class="d-flex align-items-center fs-5 fw-semibold mb-2">
                            <span class="required">Total</span>
                            </span>
                        </label>
                        <!--end::Label-->
                        <!--begin::Input-->
                        <input class="form-control form-control-solid text-end text-primary" id="input_totat"
                            name="total" type="text" placeholder="0.00" />
                        <!--end::Input-->
                    </div>




                    <div class="card-footer text-center">
                        <button type="submit" class="btn btn-primary w-100" id="<?php echo e($button['save']); ?>">Reserver</button>
                    </div>

                </form>
            </div>
            <!--end::Card body-->
        </div>
    </div>
    <!--end::Container-->

 <?php echo $__env->renderComponent(); ?>
<?php endif; ?>
<?php if (isset($__attributesOriginal1d82783c246b53da9bd54777b9e76c22)): ?>
<?php $attributes = $__attributesOriginal1d82783c246b53da9bd54777b9e76c22; ?>
<?php unset($__attributesOriginal1d82783c246b53da9bd54777b9e76c22); ?>
<?php endif; ?>
<?php if (isset($__componentOriginal1d82783c246b53da9bd54777b9e76c22)): ?>
<?php $component = $__componentOriginal1d82783c246b53da9bd54777b9e76c22; ?>
<?php unset($__componentOriginal1d82783c246b53da9bd54777b9e76c22); ?>
<?php endif; ?>
<?php /**PATH /Users/xselservices/Herd/baby-rent/resources/views/backoffice/reservation/index.blade.php ENDPATH**/ ?>