<?= $this->extend('layout/default') ?>

<?= $this->section('content') ?>
<div class="container pt-100 pb-100">
    <div class="row justify-content-center">
        <div class="col-lg-8">
            <div class="card shadow border-0">
                <div class="card-header bg-primary text-white">
                    <h5 class="mb-0 fw-bold text-white"><i class="fa fa-edit me-2"></i> Edit Data Siswa</h5>
                </div>
                <div class="card-body p-4">
                    <form action="<?= base_url('admin/kelulusan/update_siswa') ?>" method="post">
                        <?= csrf_field() ?>
                        <input type="hidden" name="id_lulus" value="<?= $s['id_lulus'] ?>">

                        <div class="row">
                            <div class="col-md-6 mb-3">
                                <label class="fw-bold">NISN</label>
                                <input type="text" name="nisn" class="form-control" value="<?= $s['nisn'] ?>" required maxlength="10">
                            </div>
                            <div class="col-md-6 mb-3">
                                <label class="fw-bold">Status Kelulusan</label>
                                <select name="status" class="form-control" required>
                                    <option value="LULUS" <?= $s['status'] == 'LULUS' ? 'selected' : '' ?>>LULUS</option>
                                    <option value="TIDAK LULUS" <?= $s['status'] == 'TIDAK LULUS' ? 'selected' : '' ?>>TIDAK LULUS</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group mb-3">
                            <label class="fw-bold">Nama Siswa</label>
                            <input type="text" name="nama_siswa" class="form-control" value="<?= $s['nama_siswa'] ?>" required>
                        </div>

                        <div class="form-group mb-3">
                            <label class="fw-bold">Jurusan</label>
                            <input type="text" name="jurusan" class="form-control" value="<?= $s['jurusan'] ?>" required placeholder="Contoh: Desain Komunikasi Visual">
                        </div>

                        <div class="form-group mb-4">
                            <label class="fw-bold">Keterangan Tambahan</label>
                            <textarea name="keterangan" class="form-control" rows="3"><?= $s['keterangan'] ?></textarea>
                            <small class="text-muted fst-italic">*Muncul di bawah status kelulusan siswa.</small>
                        </div>

                        <div class="d-flex justify-content-between">
                            <a href="<?= base_url('admin/kelulusan') ?>" class="btn btn-secondary px-4">Batal</a>
                            <button type="submit" class="btn btn-primary px-5">Simpan Perubahan</button>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<?= $this->endSection() ?>