<?php $__env->startSection('menu'); ?>
    <?php echo $__env->make('admin.menu', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>

<section class="demandes-details bg-light py-5">
    <div class="container">
        <!-- Header -->
        <div class="header d-flex justify-content-between align-items-center mb-4">
            <h1 class="text-primary">Liste des inscriptions</h1>
        </div>   
        <!-- Filtres et Barre de Recherche sur la même ligne -->
        <form method="GET" action="<?php echo e(route('show-Inscriptions')); ?>" class="mb-4" id="filter-search-form">
            <div class="row align-items-center">
                <!-- Filtre par statut -->
                <div class="col-md-4">
                    <select name="status" class="form-control" onchange="document.getElementById('filter-search-form').submit();">
                        <option value="">Tous les statuts</option>
                        <option value="en attente" <?php echo e(request('status') === 'en attente' ? 'selected' : ''); ?>>En attente</option>
                        <option value="accepter" <?php echo e(request('status') === 'accepter' ? 'selected' : ''); ?>>Accepter</option>
                        <option value="rejeter" <?php echo e(request('status') === 'rejeter' ? 'selected' : ''); ?>>Rejeter</option>
                    </select>
                </div>
                
                <!-- Barre de recherche -->
                <div class="col-md-6">
                    <input 
                        type="text" 
                        name="query" 
                        class="form-control" 
                        placeholder="Rechercher par nom, prénoms ou email " 
                        value="<?php echo e(request('query')); ?>" 
                    />
                </div>
                
                <!-- Bouton de soumission -->
                <div class="col-md-2">
                    <button type="submit" class="btn btn-primary w-100">Rechercher</button>
                </div>
            </div>
        </form>

        <!-- Liste des demandes d'inscription -->
        <div class="card shadow-sm">
            <div class="card-body">
                <hr>

                <!-- Table des utilisateurs -->
                <table class="table table-bordered">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>Nom et prenoms de l'utilisateur</th>
                            <th>Date de l'inscription</th>
                            <th>Email</th>
                            <th>Statut</th>
                            <th>Actions</th>
                        </tr>
                    </thead>
                    <tbody>
                        <?php $__empty_1 = true; $__currentLoopData = $users; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $user): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
                            <tr>
                                <td><?php echo e($loop->iteration + (($users->currentPage() - 1) * $users->perPage())); ?></td>
                                <td><?php echo e($user->name); ?> <?php echo e($user->surname); ?></td>
                                <td><?php echo e((new \DateTime($user->created_at))->format('d/m/Y')); ?></td>
                                <td><?php echo e($user->email); ?></td>
                                <td>
                                    <span class="badge badge-<?php echo e($user->status === 'en attente' ? 'warning' : ($user->status === 'accepter' ? 'success' : 'danger')); ?>">
                                        <?php echo e(ucfirst($user->status)); ?>

                                    </span>
                                </td>
                                <td>
                                        <a href="<?php echo e(route('show-Details-Inscriptions', $user->id)); ?>" class="btn btn-info btn-sm">
                                            Voir Détails
                                        </a>
                                </td>
                            </tr>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
                            <tr>
                                <td colspan="5" class="text-center">Aucun utilisateur trouvé.</td>
                            </tr>
                        <?php endif; ?>
                    </tbody>
                </table>

                <!-- Pagination -->
                <div class="d-flex justify-content-center">
                    <?php echo e($users->appends(request()->input())->links()); ?>

                </div>
            </div>
        </div>
    </div>
</section>
<?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/alumnis/resources/views/admin/registrationForm.blade.php ENDPATH**/ ?>