<?php $__env->startSection('title', 'Événements'); ?>

<?php $__env->startSection('content'); ?>
<div class="pagetitle">
    <h1>Liste des événements</h1>
</div>

<section class="section">
    <div class="card">
        <div class="card-body">
            <h5 class="card-title">Toutes les sessions et événements</h5>

             <button onclick="exportTableToExcel('evenement-table', 'evenements.xlsx', {includeColumns: [0,1,2,3]})" 
        class="btn btn-success">
            Exporter en Excel
            </button>

            <table class="table datatable table-custom" id="evenement-table">
                <thead>
                    <tr>
                        <th>Utilisateur</th>
                        <th>Niveau</th>
                        <th>Détails</th>
                        <th>Date</th>
                        <th></th>
                    </tr>
                </thead>
                <tbody>
                    <?php $__currentLoopData = $evenements; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $e): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                    <tr>
                        
                        <td>
                            <?php if(Str::startsWith($e->details, 'Échec')): ?>
                                -
                            <?php else: ?>
                                <?php echo e($e->utilisateur->email ?? '-'); ?>

                            <?php endif; ?>
                        </td>

                        
                        <td>
                            <?php switch($e->level):
                                case (1): ?>
                                    <span class="badge bg-info badge-custom">Info</span>
                                    <?php break; ?>
                                <?php case (2): ?>
                                    <span class="badge bg-warning text-dark badge-custom">Avertissement</span>
                                    <?php break; ?>
                                <?php case (3): ?>
                                    <span class="badge bg-danger badge-custom">Danger</span>
                                    <?php break; ?>
                                <?php default: ?>
                                    <span class="badge bg-secondary badge-custom">Inconnu</span>
                            <?php endswitch; ?>
                        </td>

                        
                        <td><?php echo e($e->details); ?></td>

                        
                        <td><?php echo e($e->created_at->format('d/m/Y H:i')); ?></td>

                        <td></td>
                    </tr>
                    <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                </tbody>
            </table>

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

<?php echo $__env->make('layouts.app', array_diff_key(get_defined_vars(), ['__data' => 1, '__path' => 1]))->render(); ?><?php /**PATH /var/www/html/phaso/resources/views/evenements/index.blade.php ENDPATH**/ ?>