<?php require __DIR__ . '/../layouts/header.php'; $lang=current_lang(); ?>
<div class="container">
  <h4 class="mb-3"><i class="fa-solid fa-user-check me-2"></i><?= e($lang==='ar'?'بوابة المحكم':'Review Portal') ?></h4>

  <div class="card shadow-sm border-0">
    <div class="card-body">
      <div class="table-responsive">
        <table class="table align-middle">
          <thead>
            <tr>
              <th>#</th>
              <th><?= e($lang==='ar'?'البحث':'Paper') ?></th>
              <th><?= e($lang==='ar'?'المؤتمر':'Conference') ?></th>
              <th><?= e($lang==='ar'?'الجولة':'Round') ?></th>
              <th><?= e($lang==='ar'?'الحالة':'Status') ?></th>
              <th><?= e($lang==='ar'?'موعد التسليم':'Due') ?></th>
            </tr>
          </thead>
          <tbody>
          <?php foreach (($rows ?? []) as $r): ?>
            <tr>
              <td><?= e((string)$r['assignment_id']) ?></td>
              <td class="fw-bold"><?= e((string)($lang==='ar' ? ($r['title_ar']??$r['title_en']??'') : ($r['title_en']??$r['title_ar']??''))) ?></td>
              <td><?= e((string)($lang==='ar' ? ($r['conf_title_ar']??'') : ($r['conf_title_en']??''))) ?></td>
              <td><?= e((string)($r['round_no'] ?? 1)) ?></td>
              <td><span class="badge bg-info text-dark"><?= e((string)($r['status'] ?? '')) ?></span></td>
              <td class="text-muted"><?= e((string)($r['due_date'] ?? '')) ?></td>
            </tr>
          <?php endforeach; ?>
          <?php if (empty($rows)): ?>
            <tr><td colspan="6" class="text-center text-muted py-4"><?= e($lang==='ar'?'لا توجد مهام تحكيم حاليا.':'No review assignments.') ?></td></tr>
          <?php endif; ?>
          </tbody>
        </table>
      </div>
    </div>
  </div>
</div>
<?php require __DIR__ . '/../layouts/footer.php'; ?>
