<?php $__env->startSection('title', 'Starter Page'); ?>

<?php $__env->startSection('css'); ?>
    

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

<?php $__env->startSection('content'); ?>
    <div class="row">
        <div class="col-12">
            <div class="card">
                <div class="card-header bg-info p-4">
                    <h4 class="mb-0 text-white">Veuillez sélectionner les données s'il vous plait.</h4>
                </div>
                <div class="card-body">
                    <form method="POST" class="form-horizontal" id="submit" action="<?php echo e(route('dossier')); ?>" target="_blank">
                        <?php echo csrf_field(); ?>
                        <div class="mb-3 pb-3 row border-bottom align-items-center">
                            <label for="" class="control-label text-md-end col-md-3">Filière</label>
                            <div class="col-md-6">
                                <select class="select2 p-2" style="width: 100%" id="filiere" name="idFiliere">
                                    <option value="">Selectionner la filière</option>
                                    <?php $__currentLoopData = $data['filieres']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $filiere): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($filiere->idFiliere); ?>">
                                            <?php echo e($filiere->intituleFilieres); ?>(<?php echo e($filiere->sigleFilieres); ?>)</option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                                <div class="invalid-feedback">
                                    La filière est requise
                                </div>
                            </div>
                        </div>
                        <div class="mb-3 pb-3 row border-bottom align-items-center">
                            <label for="" class="control-label text-md-end col-md-3">Année Académique</label>
                            <div class="col-md-6">
                                <select class="form-select mr-sm-2 p-2" id="acadYear" name="acadYear">
                                    <?php $__currentLoopData = $data['academique']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $acad): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($acad->annee_acad); ?>"><?php echo e($acad->periode); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        </div>
                        <div class="mb-3 pb-3 row border-bottom align-items-center">
                            <label for="" class="control-label text-md-end col-md-3">Niveau formation</label>
                            <div class="col-md-6">

                                <select class="form-select mr-sm-2 p-2" id="formation" name="formation">
                                    <option value="">Selectionner la niveau de formation</option>
                                    <?php $__currentLoopData = $data['formations']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $formation): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($formation->id); ?>"><?php echo e($formation->niveauFormation); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                            </div>
                        </div>

                        <div class="mb-3 pb-3 row border-bottom align-items-center">
                            <label for="" class="control-label text-md-end col-md-3">Année d'Etude</label>
                            <div class="col-md-6">
                                <select class="form-select mr-sm-2 p-2" id="etudeYear" name="etudeYear">
                                    <option>Sélectionner l'année d'étude</option>
                                    <?php $__currentLoopData = $data['etudes']; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $etude): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                        <option value="<?php echo e($etude->id); ?>"><?php echo e($etude->annee_etude); ?></option>
                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                </select>
                                <div class="invalid-feedback">
                                    L'année d'étude est requise
                                </div>
                            </div>
                        </div>

                        <div class="form-actions">
                            <div class="row">
                                <div class="col-md-12">
                                    <div class="row justify-content-center">
                                        <button type="submit" class="col-3 col-md-1 col-sm-2 me-3 btn btn-success"> <i
                                                class="fa fa-check"></i> Submit</button>
                                        <button type="reset" class="col-4 col-md-2 col-sm-3 col-lg-1 me-3 btn "
                                            style="background-color: #e4e7ea">Cancel</button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('script'); ?>
    
    <script src="<?php echo e(asset('assets/libs/select2/dist/js/select2.full.min.js')); ?>"></script>
    <script src="<?php echo e(asset('assets/libs/select2/dist/js/select2.min.js')); ?>"></script>
    <script src="<?php echo e(asset('dist/js/pages/forms/select2/select2.init.js')); ?>"></script>

    <script>
        let checkValidation = (id) => {
            $(id).addClass('is-valid');
            return true;
        }

        $('#filiere')?.change(() => {
            checkValidation('#filiere');
        });


        $('#etudeYear')?.change(() => {
            checkValidation('#etudeYear');
        });


        $('#formation')?.change(() => {
            checkValidation('#formation');
        });

        $('#acadYear')?.change(() => {
            checkValidation('#acadYear');
        });

        $('#submit').submit((e) => {
            if (![
                    checkValidation('#filiere'),
                    checkValidation('#acadYear'),
                    checkValidation('#formation'),
                    checkValidation('#etudeYear'),
                ].every(value => value === true)) {
                e.preventDefault();
            }
        });
        <?php if(Session::get('error')): ?>
            Swal.fire({
                icon: 'error',
                title: "Erreur",
                html: "<p><?php echo Session::get('message'); ?></p>"
            });
        <?php endif; ?>
    </script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.base', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/africawebstudent/public_html/aws/numerisation/resources/views/dossier/f_dossier.blade.php ENDPATH**/ ?>