<?php $pageTitle = 'Support'; ?>
<div class="mb-4"><p class="text-secondary">Support tickets from your students</p></div>
<?php if (empty($tickets)): ?>
    <div class="empty-state"><i class="fas fa-headset"></i><h5>No Tickets</h5><p>No support tickets to address.</p></div>
<?php else: ?>
<div class="card-cix">
    <div class="table-responsive">
        <table class="table-cix">
            <thead><tr><th>Subject</th><th>Student</th><th>Status</th><th>Date</th></tr></thead>
            <tbody>
            <?php foreach ($tickets as $t): ?>
            <tr>
                <td><strong><?= e($t['subject']) ?></strong></td>
                <td class="text-secondary"><?= e(($t['first_name'] ?? '') . ' ' . ($t['last_name'] ?? '')) ?></td>
                <td><span class="badge-cix badge-<?= $t['status'] ?>"><?= ucfirst($t['status']) ?></span></td>
                <td class="text-secondary small"><?= time_elapsed($t['created_at']) ?></td>
            </tr>
            <?php endforeach; ?>
            </tbody>
        </table>
    </div>
</div>
<?php endif; ?>
