<?php $__env->startSection('contenu'); ?>
    <?php echo $__env->make('/partials/modalModifierCours', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
    <?php echo $__env->make('/partials/modalConfirmSuppCours', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

    <section
        style="background-image: url('/img/bgclasse.png'); background-attachment: fixed; background-repeat: no-repeat; background-size: cover; min-height: 93.2vh"
        class="section mt-0 columns mx-0 mb-0 is-centered">
        <section class="section container column is-two-thirds">
            <section class="section is-link is-light p-0">
                <h1 class="title is-1 is-size-3-touch has-text-centered has-text-white"><?php echo e($classe->libelle); ?></h1>
                <h1 class="subtitle is-6 has-text-centered has-text-white"><?php echo e($classe->type); ?></h1>
            </section>
            <nav class="panel is-info has-background-light mt-2">
                <p class="panel-heading mb-3">
                    L'historique des cours déroulés dans cette classe
                </p>
                <?php if(count($cours) == 0): ?>
                    <p class="title is-6 has-text-centered pb-4">Il n'y pas encore de cours dans cette classe</p>
                <?php else: ?>
                    <?php if(auth()->user()->role == 'administration' || auth()->user()->role == 'surveillant'): ?>
                        <?php $__currentLoopData = $cours->sortByDesc('id'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $unCours): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <div class="content box">
                                <div class="has-text-weight-bold has-text-success"><span
                                        class="has-text-weight-bold">Date:</span>
                                    <?php echo e(date('d/m/Y', strtotime($unCours->created_at))); ?></div>
                                <div><span class="has-text-weight-bold">Détails:</span> <?php echo nl2br($unCours->description); ?></div>
                                <?php $__currentLoopData = $professeurs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $professeur): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($professeur->id == $unCours->professeur_id): ?>
                                        <div><span class="has-text-weight-bold">Professeur:</span>
                                            <?php echo e($professeur->prenom); ?>

                                            <?php echo e($professeur->nom); ?></div>
                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <?php $__currentLoopData = $matieres; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $matiere): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                    <?php if($matiere->id == $unCours->matiere_id): ?>
                                        <div><span class="has-text-weight-bold">Matière:</span> <?php echo e($matiere->libelle); ?>

                                        </div>
                                    <?php endif; ?>
                                <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                <div><span class="has-text-weight-bold">Heure de début:</span>
                                    <?php echo e(date('H:i', strtotime($unCours->debut))); ?></div>
                                <div><span class="has-text-weight-bold">Heure de fin:</span>
                                    <?php echo e(date('H:i', strtotime($unCours->fin))); ?></div>
                                <?php if(auth()->user()->administrateur == 1): ?>
                                    <div class="buttons">
                                        <a type="button" class="button is-info is-light"
                                            onclick="getCoursId(<?php echo e($unCours->id); ?>); getClasseLib('<?php echo e($classe->libelle); ?>'); get_classe_slug('<?php echo e($classe->slug); ?>'); openForm('modalSuppCours')">Supprimer</a>
                                        <a type="button" class="button is-info is-light"
                                            onclick="getCoursId(<?php echo e($unCours->id); ?>); getClasseLib('<?php echo e($classe->libelle); ?>'); get_classe_slug('<?php echo e($classe->slug); ?>'); openForm('modal_modifier_cours'); getOldDescrip('<?php echo str_replace(["\r\n", "\n"], '\n', addslashes($unCours->description)); ?>'); getOldProf(<?php echo e($unCours->professeur_id); ?>); getOldMatiere(<?php echo e($unCours->matiere_id); ?>); getOldDebut('<?php echo e(date('H:i', strtotime($unCours->debut))); ?>'); getOldFin('<?php echo e(date('H:i', strtotime($unCours->fin))); ?>');">Modifier</a>
                                    </div>
                                <?php endif; ?>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php else: ?>
                        <?php $__currentLoopData = $cours->sortByDesc('id'); $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $unCours): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <?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 && $unCours->professeur_id == $professeur->id): ?>
                                    <div class="content box">
                                        <div class="has-text-weight-bold has-text-success"><span
                                                class="has-text-weight-bold">Date:</span>
                                            <?php echo e(date('d/m/Y', strtotime($unCours->created_at))); ?></div>
                                        <div><span class="has-text-weight-bold">Détails:</span> <?php echo nl2br($unCours->description); ?>

                                        </div>
                                        <?php if($professeur->id == $unCours->professeur_id): ?>
                                            <div><span class="has-text-weight-bold">Professeur:</span>
                                                <?php echo e($professeur->prenom); ?>

                                                <?php echo e($professeur->nom); ?></div>
                                        <?php endif; ?>
                                        <?php $__currentLoopData = $matieres; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $matiere): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                            <?php if($matiere->id == $unCours->matiere_id): ?>
                                                <div><span class="has-text-weight-bold">Matière:</span>
                                                    <?php echo e($matiere->libelle); ?>

                                                </div>
                                            <?php endif; ?>
                                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                                        <div><span class="has-text-weight-bold">Heure de début:</span>
                                            <?php echo e(date('H:i', strtotime($unCours->debut))); ?></div>
                                        <div><span class="has-text-weight-bold">Heure de fin:</span>
                                            <?php echo e(date('H:i', strtotime($unCours->fin))); ?></div>
                                        <?php if(auth()->user()->administrateur == 1): ?>
                                            <div class="buttons">
                                                <a type="button" class="button is-info is-light"
                                                    onclick="getCoursId(<?php echo e($unCours->id); ?>); getClasseLib('<?php echo e($classe->libelle); ?>'); get_classe_slug('<?php echo e($classe->slug); ?>'); openForm('modalSuppCours')">Supprimer</a>
                                                <a type="button" class="button is-info is-light"
                                                    onclick="getCoursId(<?php echo e($unCours->id); ?>); getClasseLib('<?php echo e($classe->libelle); ?>'); get_classe_slug('<?php echo e($classe->slug); ?>'); openForm('modal_modifier_cours'); getOldDescrip('<?php echo str_replace(["\r\n", "\n"], '\n', addslashes($unCours->description)); ?>'); getOldProf(<?php echo e($unCours->professeur_id); ?>); getOldMatiere(<?php echo e($unCours->matiere_id); ?>); getOldDebut('<?php echo e(date('H:i', strtotime($unCours->debut))); ?>'); getOldFin('<?php echo e(date('H:i', strtotime($unCours->fin))); ?>');">Modifier</a>
                                            </div>
                                        <?php endif; ?>
                                    </div>
                                <?php endif; ?>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    <?php endif; ?>

                <?php endif; ?>
            </nav>
        </section>
    </section>
    <?php echo $__env->make('/partials/coursJs', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

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

<?php echo $__env->make('layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/dide1435/luqman.upschool-sn.com/resources/views/coursHistory.blade.php ENDPATH**/ ?>