<?php $__env->startSection('search-bar'); ?>
    <div class="row g-3 mb-4 align-items-center justify-content-between">
        <div class="col-auto">
            <h1 class="app-page-title mb-0" style="color: #404242">HISTORIQUE</h1>
        </div>
        <div class="col-auto">
            <div class="page-utilities">
                <div class="row g-2 justify-content-start justify-content-md-end align-items-center">
                    <div class="col-auto">
                        <form action="<?php echo e(route('historique')); ?>" method="GET" class="table-search-form row gx-1 align-items-center">
                            <div class="col-auto">
                                <input type="text" name="search" class="form-control search-orders" placeholder="Recherche ..." value="<?php echo e(request('search')); ?>">

                            </div>
                        </form>

                    </div><!--//col-->
                </div><!--//row-->
            </div><!--//table-utilities-->
        </div><!--//col-auto-->
    </div><!--//row-->


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

<?php $__env->startSection('parties-prenantes'); ?>

    <nav id="orders-table-tab" class="orders-table-tab app-nav-tabs nav shadow-sm flex-column flex-sm-row mb-4">
        <?php if(auth()->user()->role == 'super-admin'): ?>
        <a href="/historique" class="flex-sm-fill text-sm-center nav-link active">Historique</a>
        <a href="/journaux" class="flex-sm-fill text-sm-center nav-link">Journaux</a>
    <?php elseif(auth()->user()->role == 'admin'): ?>
        <a href="/historique" class="flex-sm-fill text-sm-center nav-link active">Historique</a>
    <?php endif; ?>
        
    </nav>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('content'); ?>
<div class="tab-content" id="orders-table-tab-content">
    <div class="tab-pane fade show active" id="orders-all" role="tabpanel"
        aria-labelledby="orders-all-tab">
        <div class="app-card app-card-orders-table shadow-sm mb-5">
            <div class="app-card-body">
                <div class="table-responsive">
                    <table class="table app-table-hover mb-0 text-center">
                        <thead>
                            <tr>
                                <th class="cell">Nom</th>
                                <th class="cell">Role</th>
                                <th class="cell">Historique de Connexion</th>
                            </tr>
                        </thead>
                        <tbody>
                            <?php $__currentLoopData = $historiques; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $historique): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                                <tr>
                                    <td class="cell"><?php echo e($historique->user->name); ?></td>
                                    <td class="cell"><?php echo e($historique->user->role); ?></td>
                                    <td class="cell"><?php echo e(\Carbon\Carbon::parse($historique->login_at)->timezone('Africa/Casablanca')->format('d/m/Y H:i')); ?></td>
                                </tr>
                            <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                        </tbody>
                    </table>
                </div>

            </div>
        </div>
        <div>
            <?php echo e($historiques->appends(request()->query())->links('vendor.pagination.bootstrap-4')); ?>


        </div>
<?php $__env->stopSection(); ?>
<?php $__env->startSection('script'); ?>
<script>
    document.addEventListener("DOMContentLoaded", function () {
        let searchInput = document.querySelector("input[name='search']");
        let searchForm = document.querySelector(".table-search-form");

        searchInput.addEventListener("input", function () {
            if (searchInput.value.trim() === "") {
                window.location.href = "<?php echo e(route('historique')); ?>"; // Refresh the page
            }
        });
    });
</script>

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

<?php echo $__env->make('myApp.admin.adminLayout.adminPage', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH /home/nettoyagecasabla/fournisseurs.materiel-levage-maroc.com/resources/views/myApp/admin/links/historiques.blade.php ENDPATH**/ ?>