<?php $__env->startSection('css'); ?>
    <link href="<?php echo e(asset('assets/web/css/lib/image-uploader.min.css')); ?>" rel="stylesheet" type="text/css">
    <link type="text/css" rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons">

<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
    <section class="inner_header">
        <img src="<?php echo e(asset('assets/web/images/icons/inner.svg')); ?>" alt="" class="inner_shap">
        <div class="container">
            <ul class="links">
                <li>
                    <a href="<?php echo e(LaravelLocalization::getLocalizedURL($lang, route('home'), [], true)); ?>"><?php echo e(__('main.home')); ?></a>
                </li>
                <li>
                    <a href="#"> <?php echo e(__('trainingRequests.training_request')); ?> </a>
                </li>
            </ul>
            <h4><?php echo e(__('trainingRequests.training_request')); ?></h4>
        </div>
    </section>

    <section class="consultation-pg section_padding">
        <div class="container">
            <div class="form-container">
                <form method="post" action="<?php echo e(route('trainings.trainingRequest')); ?>" class="training_request_form">
                    <div class="row mt-5 pt-3">
                        <div class="col-md-6">
                            <select name="purpose_training_id" class="form-control">
                                <option selected value=""><?php echo e(__('trainingRequests.purpose_training_id')); ?></option>
                                <?php if(count($trainingPurposes)): ?>
                                    <?php $__currentLoopData = $trainingPurposes; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $trainingPurpose): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($trainingPurpose->id); ?>"><?php echo e($trainingPurpose->name); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <?php endif; ?>
                            </select>
                        </div>
                        <div class="col-md-6">
                            <div class="form-group">
                                <input name="name" maxlength="50" type="text" class="form-control" placeholder="<?php echo e(__('trainingRequests.name')); ?>"/>
                            </div>
                        </div>
                    </div>
                    <div class="row mt-5">
                        <div class="col-md-6">
                            <div class="form-group">
                                <input name="email" maxlength="50" type="email" class="form-control" placeholder="<?php echo e(__('trainingRequests.email')); ?>"/>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <input name="university" type="text" maxlength="100" class="form-control" placeholder=" <?php echo e(__('trainingRequests.university') . __('trainingRequests.optional')); ?> "/>
                        </div>
                    </div>
                    <div class="row mt-5">
                        <div class="col-md-6">
                            <label class="label mb-4"><b><?php echo e(__('trainingRequests.birth_date')); ?></b></label>
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <input type="date" name="birth_date" class="w-100">
                                    </div>
                                </div>
                            </div>
                        </div>
                        <div class="col-md-6">
                            <label class="label mb-4"><b><?php echo e(__('trainingRequests.graduation_date') . __('trainingRequests.if_found')); ?></b></label>
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="form-group">
                                        <input type="date" name="graduation_date" class="w-100">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                    <div class="col-md-12 mt-5">
                        <input name="phone" type="tel" class="form-control" placeholder="<?php echo e(__('trainingRequests.phone')); ?>"/>
                    </div>
                    <div class="row mt-5 pt-3">
                        <div class="col-md-6">
                            <h5 class="title text-dark mb-4"><b><?php echo e(__('trainingRequests.attache_cv')); ?></b></h5>
                            <div class="input-images cv"></div>
                        </div>
                        <div class="col-md-6">
                            <h5 class="title text-dark mb-4"><b><?php echo e(__('trainingRequests.attache_certifications')); ?> </b></h5>
                            <div class="input-images certifications"></div>
                        </div>
                    </div>

                    <button class="submit-butn butn mt-5 m-auto d-block training_request_button" type="button"><span><b> <?php echo e(__('trainingRequests.send_request')); ?> </b></span></button>

                </form>
            </div>
        </div>
    </section>

    <div class="modal confirmConsult training_request_modal fade" id="confirmConsult" tabindex="-1" aria-labelledby="exampleModalLabel" aria-hidden="true">
        <div class="modal-dialog modal-dialog-centered modal-lg">
            <div class="modal-content">
                <button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
                <div class="modal-body">
                    <img src="<?php echo e(asset('assets/web/images/icons/confirm.png')); ?>" alt="" class="icon"/>
                    <div class="content text-center mt-4">
                        <h3 class="title text-dark mb-2"><b><?php echo e(__('trainingRequests.request_send_successfully')); ?></b></h3>
                        <p class="text">
                            <?php echo e(__('trainingRequests.training_request_hint')); ?>

                        </p>
                    </div>
                </div>
            </div>
        </div>
    </div>

<?php $__env->stopSection(); ?>

<?php $__env->startSection('inner_js'); ?>
    <script src="<?php echo e(asset('assets/web/js/lib/image-uploader.min.js')); ?>"></script>

    <script>
        let uploadAttachments = "<?php echo e(__('trainingRequests.upload_attachments')); ?>";
        $('.training_request_button').click(async function (e) {
            e.preventDefault();
            $(this).attr('disabled', true);
            let form = $('.training_request_form'),
                data = new FormData(form[0]),
                url = form.attr('action'),
                method = form.attr('method');

            const response=await ajax({
                url,
                data,
                dataType: 'json',
                method,
                contentType: false,
                processData: false,
            });

            if (response.errors) {
                $(this).attr('disabled', false);
                toasterError(response.errors);
            }
            if (response.success) {
                let myModal = new bootstrap.Modal(document.querySelector('.training_request_modal'));
                myModal.show();
            }
        });

        $('.training_request_modal').on('hide.bs.modal', function () {
            window.location.reload();
        });

        $('.certifications').imageUploader({
            label: uploadAttachments,
            imagesInputName: 'certifications'
        });

        $('.cv').imageUploader({
            label: uploadAttachments,
            imagesInputName: 'cv'

        });

    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('web.layouts.container', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\wamp64\www\legal\resources\views/web/trainings/training_request.blade.php ENDPATH**/ ?>