<?php $pageTitle = 'Assignments'; ?>
<div class="d-flex justify-content-between align-items-center mb-4">
    <p class="text-secondary mb-0">Manage assignments</p>
    <a href="<?= base_url('admin/assignment-create') ?>" class="btn-cix btn-cix-accent btn-cix-sm"><i class="fas fa-plus"></i> New Assignment</a>
</div>
<div class="card-cix">
    <div class="table-responsive">
        <table class="table-cix"><thead><tr><th>Assignment</th><th>Course</th><th>Module</th><th>Max Score</th><th>Due Date</th><th>Status</th></tr></thead>
        <tbody><?php if (empty($assignments)): ?><tr><td colspan="6" class="text-center text-secondary p-4">No assignments</td></tr>
        <?php else: foreach ($assignments as $a): ?>
        <tr><td><strong><?= e($a['title']) ?></strong></td><td class="text-secondary"><?= e($a['course_title'] ?? '') ?></td><td class="text-secondary"><?= e($a['module_title'] ?? '-') ?></td>
        <td><?= (int)$a['max_score'] ?></td><td class="text-secondary small"><?= $a['due_date'] ? e($a['due_date']) : '-' ?></td>
        <td><span class="badge-cix <?= $a['is_published'] ? 'badge-active' : 'badge-pending' ?>"><?= $a['is_published'] ? 'Published' : 'Draft' ?></span></td></tr>
        <?php endforeach; endif; ?></tbody></table>
    </div>
</div>
