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

<div class="card shadow border-0">

    <!-- HEADER -->
    <div class="card-header bg-gradient-success text-white d-flex align-items-center">
        <i class="fas fa-layer-group mr-2"></i>
        <b>Tambah Jurusan</b>
    </div>

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

        <div class="card-body">

            <div class="row">

                <!-- KODE -->
                <div class="col-md-4">
                    <div class="form-group">
                        <label>
                            Kode Jurusan
                            <small class="text-muted">(unik)</small>
                        </label>
                        <input type="text"
                               name="code"
                               class="form-control text-uppercase"
                               placeholder="IPA / RPL / AKL"
                               required>
                        <small class="text-muted">
                            Digunakan sebagai identitas jurusan
                        </small>
                    </div>
                </div>

                <!-- NAMA -->
                <div class="col-md-8">
                    <div class="form-group">
                        <label>Nama Jurusan</label>
                        <input type="text"
                               name="name"
                               class="form-control"
                               placeholder="Rekayasa Perangkat Lunak"
                               required>
                    </div>
                </div>

                <!-- LEVEL -->
                <div class="col-md-4">
                    <div class="form-group">
                        <label>Level Sekolah</label>
                        <select name="level" class="form-control" required>
                            <option value="">-- Pilih Level --</option>
                            <option value="SMA">SMA</option>
                            <option value="SMK">SMK</option>
                            <option value="MA">MA</option>
                        </select>
                        <small class="text-muted">
                            Digunakan untuk filter PPDB
                        </small>
                    </div>
                </div>

                <!-- KUOTA -->
                <div class="col-md-4">
                    <div class="form-group">
                        <label>Kuota Siswa</label>
                        <input type="number"
                               name="quota"
                               class="form-control"
                               value="0"
                               min="0">
                        <small class="text-muted">
                            0 = belum ditentukan
                        </small>
                    </div>
                </div>

                <!-- STATUS -->
                <div class="col-md-4">
                    <div class="form-group">
                        <label>Status</label>
                        <select class="form-control" disabled>
                            <option>Aktif (default)</option>
                        </select>
                        <small class="text-muted">
                            Bisa dinonaktifkan setelah tersimpan
                        </small>
                    </div>
                </div>

                <!-- DESKRIPSI -->
                <div class="col-md-12">
                    <div class="form-group">
                        <label>Deskripsi</label>
                        <textarea name="description"
                                  rows="3"
                                  class="form-control"
                                  placeholder="Penjelasan singkat jurusan..."></textarea>
                        <small class="text-muted">
                            Opsional
                        </small>
                    </div>
                </div>

            </div>
        </div>

        <!-- FOOTER -->
        <div class="card-footer text-right bg-light">
            <a href="<?= site_url('master/major') ?>"
               class="btn btn-secondary">
                <i class="fas fa-arrow-left mr-1"></i> Kembali
            </a>

            <button class="btn btn-success">
                <i class="fas fa-save mr-1"></i> Simpan Jurusan
            </button>
        </div>

    </form>
</div>

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