<?php $__env->startSection('title','ERROR LOG'); ?>
<?php $__env->startSection('content'); ?>
<h3 align="center"> ERROR LOG</h3>
<div class="text-center">
    <a href="<?php echo e(asset('sql_log')); ?>" class="btn btn-success">ERROR LOG</a>
</div>
<section class="content">
    <div class="container-fluid">
      <div class="row">
        <div class="col-12">
          <div class="card">
            <div class="card-header">
              <h3 class="card-title">Pistes audits ERROR LOG</h3>
            </div>
            <div class="card-body">
                <table id="example1" class="table table-bordered table-striped">
                    <thead>
                        <tr>
                            <th>#</th>
                            <th>ID</th>
                            <th>Error Message</th>
                            <th>File</th>
                            <th>Line</th>
                            <th>Date</th>
                            <th>Actions</th>
                        </tr>
                    </thead>
                    </thead>
                    <tbody>
                        <?php $__currentLoopData = $errorLogs; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $errorLog): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); ?>
                            <tr>
                                <td><input type="checkbox"></td>
                                <td><?php echo e($errorLog->id); ?></td>
                                <td><?php echo e(Str::limit($errorLog->error_message, 50)); ?></td>
                                <td><?php echo e($errorLog->file); ?></td>
                                <td><?php echo e($errorLog->line); ?></td>
                                <td><?php echo e($errorLog->created_at->format('d/m/Y H:i')); ?></td>
                                <td>
                                    <!-- View details button -->
                                    <a href="#" data-toggle="modal" data-target="#errorModal<?php echo e($errorLog->id); ?>" class="btn btn-primary btn-sm">View Details</a>
                                </td>
                            </tr>

                            <!-- Modal for detailed error view -->
                            <div class="modal fade" id="errorModal<?php echo e($errorLog->id); ?>" tabindex="-1" role="dialog" aria-labelledby="errorModalLabel<?php echo e($errorLog->id); ?>" aria-hidden="true">
                                <div class="modal-dialog modal-lg" role="document">
                                    <div class="modal-content">
                                        <div class="modal-header">
                                            <h5 class="modal-title" id="errorModalLabel<?php echo e($errorLog->id); ?>">Error Details (ID: <?php echo e($errorLog->id); ?>)</h5>
                                            <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                                                <span aria-hidden="true">&times;</span>
                                            </button>
                                        </div>
                                        <div class="modal-body">
                                            <p><strong>Error Message:</strong> <?php echo e($errorLog->error_message); ?></p>
                                            <p><strong>File:</strong> <?php echo e($errorLog->file); ?></p>
                                            <p><strong>Line:</strong> <?php echo e($errorLog->line); ?></p>
                                            <p><strong>Stack Trace:</strong></p>
                                            <pre><?php echo e($errorLog->stack_trace); ?></pre>
                                        </div>
                                    </div>
                                </div>
                            </div>
                        <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); ?>
                    </tbody>
                    <tfoot>
                    <tr>
                        <th>#</th>
                        <th>ID</th>
                        <th>Error Message</th>
                        <th>File</th>
                        <th>Line</th>
                        <th>Date</th>
                        <th>Actions</th>
                    </tr>
                    </tfoot>
                  </table>
    </div>
</div>
        </div>
      </div>
    </div>
</section>
<!-- Add jQuery and Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.5.1.slim.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/@popperjs/core@2.5.2/dist/umd/popper.min.js"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('admin.layout', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\laragon\www\api_web_orange_caece\resources\views/logs/error_logs.blade.php ENDPATH**/ ?>