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

<?= $this->section('content') ?>
<div class="container-fluid">
    <div class="d-flex justify-content-between align-items-center mb-4">
        <div>
            <h1 class="h3 mb-1 text-gray-800 fw-bold">Tambah OPD</h1>
            <p class="mb-0 text-muted">Form penambahan Organisasi Perangkat Daerah</p>
        </div>
        <a href="<?= base_url('opd') ?>" class="btn btn-secondary shadow-sm">
            <i class="fas fa-arrow-left fa-sm text-white-50 me-1"></i> Kembali
        </a>
    </div>

    <div class="card shadow-sm border-0 mb-4 rounded-3">
        <div class="card-header bg-white py-3 border-0">
            <h6 class="m-0 font-weight-bold text-primary"><i class="fas fa-building me-2"></i>Form OPD</h6>
        </div>
        <div class="card-body">
            <form action="<?= base_url('opd/store') ?>" method="post">
                <div class="mb-3">
                    <label for="nama_opd" class="form-label fw-bold text-secondary">Nama OPD <span class="text-danger">*</span></label>
                    <input type="text" class="form-control" id="nama_opd" name="nama_opd" placeholder="Contoh: Dinas Kesehatan" required>
                </div>
                <div class="mb-3">
                    <label for="bidang_id" class="form-label fw-bold text-secondary">Bidang Pengampu <span class="text-danger">*</span></label>
                    <select class="form-select" id="bidang_id" name="bidang_id" required>
                        <option value="">-- Pilih Bidang Pengampu --</option>
                        <?php foreach($bidang as $b): ?>
                            <option value="<?= $b['id'] ?>"><?= $b['nama_bidang'] ?></option>
                        <?php endforeach; ?>
                    </select>
                    <div class="form-text">Pilih bidang Bappeda yang mengampu OPD ini.</div>
                </div>
                
                <hr>
                <div class="d-flex justify-content-end">
                    <button type="submit" class="btn btn-primary px-4"><i class="fas fa-save me-1"></i> Simpan Data</button>
                </div>
            </form>
        </div>
    </div>
</div>
<?= $this->endSection() ?>
