<!-- Marquez les absents -->
<div class="modal animate__animated animate__fadeInLeft" id="modal_notes">
    <div onclick="closeForm('modal_notes')" class="modal-background"></div>
    <div class="modal-card">
        <header class="modal-card-head">
            <p class="modal-card-title">Enregistrer des notes</p>
            <button type="button" onclick="closeForm('modal_notes')" class="delete" aria-label="close"></button>
        </header>
        <section class="modal-card-body">
            <div class="content">
                <form id="form_notes">
                    <?php echo csrf_field(); ?>
                    <div class="field mb-5">
                        <label class="label title is-6" for="matiere_evaluee_id">Matière</label>
                        <div class="control">
                            <div class="select is-info is-rounded">
                                <select id="matiere_evaluee_id" name="matiere"
                                    class="<?php $__errorArgs = ['matiere'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" required>
                                    <option value="" disabled selected>Sélectionner</option>
                                    <?php if($classe->type == 'Primaire'): ?>
                                        <?php if(auth()->user()->role == 'professeur'): ?>
                                            <?php $__currentLoopData = $professeurs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $professeur): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php if(str_replace(' ', '', $professeur->telephone) == auth()->user()->nom_utilisateur): ?>
                                                    <?php $__currentLoopData = $professeur->matieres; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $matiere): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <?php if($matiere->niveau == 'Primaire'): ?>
                                                            <option value="<?php echo e($matiere->id); ?>">
                                                                <?php echo e($matiere->libelle); ?></option>
                                                        <?php endif; ?>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                <?php endif; ?>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        <?php else: ?>
                                            <?php $__currentLoopData = $matieres; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $matiere): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php if($matiere->niveau == 'Primaire'): ?>
                                                    <option class="<?php echo e($matiere->coefficient); ?>" value="<?php echo e($matiere->id); ?>"><?php echo e($matiere->libelle); ?>

                                                    </option>
                                                <?php endif; ?>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        <?php endif; ?>
                                    <?php else: ?>
                                        <?php if(auth()->user()->role == 'professeur'): ?>
                                            <?php $__currentLoopData = $professeurs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $professeur): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php if(str_replace(' ', '', $professeur->telephone) == auth()->user()->nom_utilisateur): ?>
                                                    <?php $__currentLoopData = $professeur->matieres; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $matiere): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                        <?php if($matiere->niveau == 'Secondaire'): ?>
                                                            <option value="<?php echo e($matiere->id); ?>">
                                                                <?php echo e($matiere->libelle); ?></option>
                                                        <?php endif; ?>
                                                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                                <?php endif; ?>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        <?php else: ?>
                                            <?php $__currentLoopData = $matieres; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $matiere): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php if($matiere->niveau == 'Secondaire'): ?>
                                                    <option value="<?php echo e($matiere->id); ?>"><?php echo e($matiere->libelle); ?>

                                                    </option>
                                                <?php endif; ?>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        <?php endif; ?>
                                    <?php endif; ?>
                                </select>
                            </div>
                        </div>
                        <?php $__errorArgs = ['matiere'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <div class="help is-danger error"><?php echo e($message); ?></div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>
                    <div class="field mb-5">
                        <label class="label title is-6" for="type_evaluation_id">Type de Note</label>
                        <div class="control">
                            <div class="select is-info is-rounded">
                                <select id="type_evaluation_id" name="type" class="<?php $__errorArgs = ['type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                    required>
                                    <option value="" disabled selected>Sélectionner</option>
                                    <?php if($classe->type == 'Primaire'): ?>
                                        <option value="Contrôle">Contrôle</option>
                                        <option value="Composition">Composition</option>
                                    <?php else: ?>
                                        <option value="Devoir">Devoir</option>
                                        <option value="Examen">Examen</option>
                                    <?php endif; ?>
                                </select>
                            </div>
                        </div>
                        <?php $__errorArgs = ['type'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <div class="help is-danger error"><?php echo e($message); ?></div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>
                    <div class="field mb-5">
                        <label class="label title is-6" for="semestre_id">Trimestre/Semestre</label>
                        <div class="control">
                            <div class="select is-info is-rounded">
                                <select id="semestre_id" name="semestre" class="<?php $__errorArgs = ['semestre'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>"
                                    required>
                                    <option value="" disabled selected>Sélectionner</option>
                                    <?php if($classe->type == 'Primaire'): ?>
                                        <option value="1">Trimestre 1</option>
                                        <option value="2">Trimestre 2</option>
                                        <option value="3">Trimestre 3</option>
                                    <?php else: ?>
                                        <option value="1">Semestre 1</option>
                                        <option value="2">Semestre 2</option>
                                        <option value="1">Trimestre 1</option>
                                        <option value="2">Trimestre 2</option>
                                        <option value="3">Trimestre 3</option>
                                    <?php endif; ?>
                                </select>
                            </div>
                        </div>
                        <?php $__errorArgs = ['semestre'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <div class="help is-danger error"><?php echo e($message); ?></div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>
                    <div class="field">
                        <label class="label title is-6" for="date_id">Date d'évaluation</label>
                        <div class="control">
                            <input type="date" id="date_evaluation_id" name="date"
                                class="input is-info is-rounded <?php $__errorArgs = ['date'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?> is-invalid <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>" required>
                        </div>
                        <?php $__errorArgs = ['date'];
$__bag = $errors->getBag($__errorArgs[1] ?? 'default');
if ($__bag->has($__errorArgs[0])) :
if (isset($message)) { $__messageOriginal = $message; }
$message = $__bag->first($__errorArgs[0]); ?>
                            <div class="help is-danger error"><?php echo e($message); ?></div>
                        <?php unset($message);
if (isset($__messageOriginal)) { $message = $__messageOriginal; }
endif;
unset($__errorArgs, $__bag); ?>
                    </div>
                    <?php $__currentLoopData = $classe->eleves->where('promo', env('SCHOOL_YEAR'))->sortBy('nom'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $eleve): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                        <div class="panel-block is-flex is-justify-content-space-between">
                            <div>
                                <span class="panel-icon">
                                    <i class="fas fa-user-graduate" aria-hidden="true"></i>
                                </span>
                                <?php echo e($eleve->prenom); ?> <?php echo e($eleve->nom); ?>

                            </div>
                            <div>
                                <input id="<?php echo e($eleve->id); ?>" min="0"
                                    max="<?php echo e($classe->type == 'Primaire' ? '60' : '20'); ?>" type="number"
                                    class="input is-info is-rounded note_eleve"
                                    title="<?php echo e($classe->type == 'Primaire' ? 'Respectez le barême' : 'Entre 0 et 20'); ?>"
                                    name="note<?php echo e($eleve->id); ?>" placeholder="00" required>
                            </div>
                        </div>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <button id="submit_form_notes" hidden></button>
                    <button type="reset" class="btn_reset" hidden></button>
                </form>
            </div>
        </section>
        <footer class="modal-card-foot">
            <button type="button" onclick="closeForm('modal_notes')"
                class="button is-light is-danger is-rounded">Annuler</button>
            <button
                onclick="recupNotes(); getClasseLibelle('<?php echo e($classe->libelle); ?>'); $('#submit_form_notes').click();"
                class="button is-info is-link is-rounded">Valider</button>
        </footer>
    </div>
</div>
<?php /**PATH /home/dide1435/luqman.upschool-sn.com/resources/views//partials/modalNotes.blade.php ENDPATH**/ ?>