<!-- Ajouter cours========================================================= -->
<div class="modal animate__animated animate__fadeInLeft" id="modal_cours">
    <div onclick="closeForm('modal_cours')" class="modal-background"></div>
    <div class="modal-card">
        <header class="modal-card-head">
            <p class="modal-card-title">Remplir le cahier de texte</p>
            <button type="button" onclick="closeForm('modal_cours')" class="delete" aria-label="close"></button>
        </header>
        <section class="modal-card-body">
            <div class="content">
                <form id="form_cours">
                    <?php echo csrf_field(); ?>
                    <div class="field">
                        <label class="label title is-6" for="description_id">Description du cours</label>
                        <p class="control">
                            <textarea id="description_id" class="textarea is-info is-rounded
                                <?php $__errorArgs = ['description'];
$__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); ?>"
                                placeholder="Donnez les détails du cours" name="description" required></textarea>
                        </p>
                        <?php $__errorArgs = ['description'];
$__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="prof_id">Professeur</label>
                        <?php if(auth()->user()->role == 'administration' || auth()->user()->role == 'surveillant'): ?>
                            <div class="control">
                                <div class="select is-info is-rounded">
                                    <select id="prof_id" name="prof" class="<?php $__errorArgs = ['prof'];
$__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 $__currentLoopData = $professeurs->sortBy('nom'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $professeur): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php if($professeur->niveau == 'Primaire'): ?>
                                                    <option value="<?php echo e($professeur->id); ?>"><?php echo e($professeur->prenom); ?>

                                                        <?php echo e($professeur->nom); ?></option>
                                                <?php endif; ?>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        <?php else: ?>
                                            <?php $__currentLoopData = $professeurs->sortBy('nom'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $professeur): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                                <?php if($professeur->niveau == 'Secondaire'): ?>
                                                    <option value="<?php echo e($professeur->id); ?>"><?php echo e($professeur->prenom); ?>

                                                        <?php echo e($professeur->nom); ?></option>
                                                <?php endif; ?>
                                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        <?php endif; ?>
                                    </select>
                                </div>
                            </div>
                        <?php else: ?>
                            <?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): ?>
                                    <div class="control">
                                        <div class="select is-info is-rounded">
                                            <select id="prof_id" name="prof" class="<?php $__errorArgs = ['prof'];
$__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="<?php echo e($professeur->id); ?>" selected>
                                                    <?php echo e($professeur->prenom); ?> <?php echo e($professeur->nom); ?></option>
                                            </select>
                                        </div>
                                    </div>
                                <?php endif; ?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php endif; ?>
                        <?php $__errorArgs = ['prof'];
$__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="matiere_id">Matière</label>
                        <div class="control">
                            <div class="select is-info is-rounded">
                                <select id="matiere_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 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">
                        <label class="label title is-6" for="debut_id">Heure de début</label>
                        <p class="control">
                            <input id="debut_id"
                                class="input is-info is-rounded
                                <?php $__errorArgs = ['debut'];
$__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); ?>"
                                type="time" name="debut" required />
                        </p>
                        <?php $__errorArgs = ['debut'];
$__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="fin_id">Heure de fin</label>
                        <p class="control">
                            <input id="fin_id"
                                class="input is-info is-rounded
                                <?php $__errorArgs = ['fin'];
$__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); ?>"
                                type="time" name="fin" required />
                        </p>
                        <?php $__errorArgs = ['fin'];
$__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>
                    <header class="modal-card-head">
                        <p class="modal-card-title">Marquez les absents</p>
                    </header>
                    <section class="modal-card-body">
                        <div class="content">
                            <?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 type="checkbox" class="checkbox_absence" value="<?php echo e($eleve->id); ?>"
                                            title="Cochez pour marquer absent">
                                    </div>
                                </div>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </div>
                    </section>
                    <button id="submit_form_cours" hidden></button>
                    <button type="reset" class="btn_reset" hidden></button>
                </form>
            </div>
        </section>
        <footer class="modal-card-foot">
            <button type="button" onclick="closeForm('modal_cours')"
                class="button is-light is-danger is-rounded">Annuler</button>
            <button
                onclick="get_id(<?php echo e($classe->id); ?>); get_classe_slug('<?php echo e($classe->slug); ?>'); $('#submit_form_cours').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/modalCours.blade.php ENDPATH**/ ?>