<?= $this->extend('layout/admin') ?>
<?= $this->section('content') ?>

<div class="row">
<?php foreach ($tasks as $task): ?>
    <div class="col-md-4 mb-4">
        <div class="card shadow-sm h-100">
            <div class="card-header d-flex justify-content-between">
                <b><?= esc($task['judul']) ?></b>
                <span class="badge bg-<?= esc($task['badge']) ?>">
                    <?= esc($task['status']) ?>
                </span>
            </div>

            <div class="card-body">
                <p><b>Mapel:</b> <?= esc($task['mapel']) ?></p>
                <p><b>Kelas:</b> <?= esc($task['kelas']) ?></p>
                <p class="text-danger">
                    <?= date('d M Y H:i', strtotime($task['deadline'])) ?>
                </p>

                <a href="<?= site_url('elearning/task/view/'.$task['id']) ?>"
                   class="btn btn-primary btn-sm w-100">
                    Lihat Tugas
                </a>
            </div>
        </div>
    </div>
<?php endforeach ?>
</div>

<?= $this->endSection() ?>
