<?php require __DIR__ . '/../layouts/header.php'; ?>
<div class="container py-4">
    <h3>Audit Logs</h3>

    <table class="table table-sm table-bordered">
        <thead>
            <tr>
                <th>ID</th>
                <th>User</th>
                <th>Action</th>
                <th>Entity</th>
                <th>Org</th>
                <th>IP</th>
                <th>Date</th>
            </tr>
        </thead>
        <tbody>
        <?php foreach ($logs as $row): ?>
            <tr>
                <td><?= e($row['id']) ?></td>
                <td><?= e($row['user_id']) ?></td>
                <td><?= e($row['action']) ?></td>
                <td><?= e($row['entity_name']) ?> #<?= e($row['entity_id']) ?></td>
                <td><?= e($row['org_id']) ?></td>
                <td><?= e($row['ip_address']) ?></td>
                <td><?= e($row['created_at']) ?></td>
            </tr>
        <?php endforeach; ?>
        </tbody>
    </table>
</div>
<?php require __DIR__ . '/../layouts/footer.php'; ?>
