
­­­­­­­­­­­­­­­­­­
<!DOCTYPE html>
<html>
<?php $view='reports/index.php'; ?>
<div class="d-flex justify-content-between align-items-center mb-2">
  <h4 class="mb-0"><?= e(t('menu.reports')) ?></h4>
  <form class="d-flex gap-2" method="get" action="<?= e(base_url($config, '/index.php')) ?>">
    <input type="hidden" name="r" value="reports/index">
    <input class="form-control" type="date" name="from" value="<?= e($from) ?>">
    <input class="form-control" type="date" name="to" value="<?= e($to) ?>">
    <button class="btn btn-outline-primary"><?= e(t('global.search')) ?></button>
  </form>
</div>

<div class="card shadow-sm">
  <div class="table-responsive">
    <table class="table table-striped mb-0 align-middle">
      <thead>
        <tr>
          <th>#</th>
          <th>Entity</th>
          <th>Action</th>
          <th>Actor</th>
          <th>Time</th>
        </tr>
      </thead>
      <tbody>
      <?php foreach ($rows as $r): ?>
        <tr>
          <td><?= (int)$r['id'] ?></td>
          <td><?= e($r['entity_type']) ?> #<?= (int)$r['entity_id'] ?></td>
          <td><span class="badge text-bg-secondary"><?= e($r['action']) ?></span></td>
          <td><?= e($r['actor_name'] ?? '-') ?></td>
          <td class="text-muted small"><?= e($r['created_at']) ?></td>
        </tr>
      <?php endforeach; ?>
      </tbody>
    </table>
  </div>
</div>
