<?php require __DIR__ . '/../../layouts/header.php'; $lang=current_lang(); ?>
<?php $t=fn($ar,$en)=>($lang==='ar'?$ar:$en); $rows=$rows??[]; $statusCol=$statusCol??null; ?>

<div class="container py-3">
  <h4 class="mb-3"><i class="fa-solid fa-diagram-project"></i> <?= e($t('سير عمل الأبحاث','Submissions Workflow')) ?></h4>

  <div class="card border-0 shadow-sm">
    <div class="table-responsive">
      <table class="table table-hover mb-0">
        <thead class="table-light">
          <tr>
            <th>#</th>
            <th><?= e($t('العنوان','Title')) ?></th>
            <th><?= e($t('المؤتمر','Conference')) ?></th>
            <th><?= e($t('الحالة','Status')) ?></th>
          </tr>
        </thead>
        <tbody>
        <?php foreach($rows as $r): ?>
          <tr>
            <td class="text-muted"><?= e((string)$r['id']) ?></td>
            <td><?= e((string)($r['title_ar'] ?? $r['title_en'] ?? '—')) ?></td>
            <td><?= e((string)($r['conf_title_ar'] ?? $r['conf_title_en'] ?? '—')) ?></td>
            <td><span class="badge bg-secondary"><?= e($statusCol ? (string)($r[$statusCol] ?? '') : (string)($r['status'] ?? '')) ?></span></td>
          </tr>
        <?php endforeach; ?>
        <?php if(empty($rows)): ?><tr><td colspan="4" class="text-center text-muted py-4">—</td></tr><?php endif; ?>
        </tbody>
      </table>
    </div>
  </div>
</div>

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