<?php require __DIR__ . '/../../layouts/header.php'; ?>
<div class="d-flex justify-content-between align-items-center mb-4"><h1 class="fw-bold mb-0"><?= e(trans('reviewer_analytics')) ?></h1><a href="<?= e(base_path('admin')) ?>" class="btn ec-btn btn-outline-secondary rounded-3"><?= e(trans('back')) ?></a></div>
<div class="ec-card  "><div class="table-responsive">
<table class="table ec-table align-middle mb-0">
<thead class="table-light"><tr><th>#</th><th><?= e(trans('reviewer')) ?></th><th><?= e(trans('email')) ?></th><th>Total</th><th>Completed</th><th>Pending</th><th>Avg Score</th><th><?= e(trans('actions')) ?></th></tr></thead>
<tbody>
<?php foreach ($rows as $row): ?>
<tr>
<td><?= e((string) $row['id']) ?></td>
<td><?= e(trim((string) $row['first_name'] . ' ' . (string) $row['last_name'])) ?></td>
<td><?= e((string) $row['email']) ?></td>
<td><?= e((string) $row['total_assignments']) ?></td>
<td><?= e((string) $row['completed_assignments']) ?></td>
<td><?= e((string) $row['pending_assignments']) ?></td>
<td><?= e((string) ($row['avg_score_given'] ?? '')) ?></td>
<td><a href="<?= e(base_path('certificate/reviewer?reviewer_id=' . (int) $row['id'])) ?>" class="btn ec-btn btn-sm btn-outline-primary rounded-3"><?= e(trans('generate_certificate')) ?></a></td>
</tr>
<?php endforeach; ?>
</tbody></table>
</div></div>
<?php require __DIR__ . '/../../layouts/footer.php'; ?>
