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

<div class="row justify-content-center">
    <div class="col-md-8">

        <div class="card shadow-sm">
            <div class="card-header bg-primary text-white">
                <i class="fas fa-school mr-2"></i>
                <b>Tambah Kelas</b>
            </div>

            <form action="<?= site_url('master/kelas/store') ?>" method="post">
                <?= csrf_field() ?>

                <div class="card-body">

                    <div class="form-row">
                        <div class="form-group col-md-6">
                            <label>Kode Kelas</label>
                            <input type="text" name="kode_kelas"
                                   class="form-control"
                                   placeholder="SD1-A" required>
                        </div>

                        <div class="form-group col-md-6">
                            <label>Nama Kelas</label>
                            <input type="text" name="nama_kelas"
                                   class="form-control"
                                   placeholder="Kelas 1A" required>
                        </div>
                    </div>

                    <div class="form-row">
                        <div class="form-group col-md-4">
                            <label>Jenjang</label>
                            <select name="jenjang" class="form-control" required>
                                <option value="">-- Pilih --</option>
                                <option>SD</option>
                                <option>SMP</option>
                                <option>SMA</option>
                            </select>
                        </div>

                        <div class="form-group col-md-4">
                            <label>Tingkat</label>
                            <select name="tingkat" class="form-control" required>
                                <?php for ($i=1;$i<=12;$i++): ?>
                                    <option value="<?= $i ?>"><?= $i ?></option>
                                <?php endfor ?>
                            </select>
                        </div>

                        <div class="form-group col-md-4">
                            <label>Kapasitas</label>
                            <input type="number" name="kapasitas"
                                   class="form-control" value="30">
                        </div>
                    </div>

                    <div class="form-group">
                        <label>Program</label>
                        <select name="program" class="form-control">
                            <option>Nasional</option>
                            <option>Cambridge</option>
                            <option>IB</option>
                            <option>Tahfidz</option>
                        </select>
                    </div>

                    <div class="form-group">
                        <label>Tahun Ajaran</label>
                        <input type="text" name="tahun_ajaran"
                               class="form-control"
                               value="2024/2025" readonly>
                    </div>

                </div>

                <div class="card-footer text-right">
                    <a href="<?= site_url('master/kelas') ?>"
                       class="btn btn-secondary">
                        Kembali
                    </a>
                    <button class="btn btn-primary">
                        <i class="fas fa-save"></i> Simpan
                    </button>
                </div>

            </form>
        </div>

    </div>
</div>

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