<?php require __DIR__ . '/../../layouts/header.php'; $page_title = trans('submissions'); ?>

<h3 class="mb-3"><i class="fa-solid fa-file-lines me-2"></i><?= e(trans('submissions')) ?></h3>

<div class="card shadow-sm border-0">
  <div class="card-body">
    <div class="table-responsive">
      <table class="table table-hover align-middle mb-0">
        <thead>
          <tr>
            <th>#</th><th>Submission</th><th>Title</th><th>Status</th><th>Date</th>
          </tr>
        </thead>
        <tbody>
          <?php foreach (($rows ?? []) as $r): ?>
            <tr>
              <td><?= e((string)$r['id']) ?></td>
              <td><?= e((string)($r['submission_no'] ?? '')) ?></td>
              <td><?= e((string)($r['title'] ?? '')) ?></td>
              <td><span class="badge bg-primary"><?= e((string)($r['status'] ?? '')) ?></span></td>
              <td class="text-muted small"><?= e((string)($r['created_at'] ?? '')) ?></td>
            </tr>
          <?php endforeach; ?>
          <?php if (empty($rows ?? [])): ?>
            <tr><td colspan="5" class="text-center text-muted py-4"><?= e(trans('no_data')) ?></td></tr>
          <?php endif; ?>
        </tbody>
      </table>
    </div>
  </div>
</div>

<?php require __DIR__ . '/../../layouts/footer.php'; ?>
