<?= $this->session->flashdata('pesan'); ?>
<div class="card">
    <div class="card-header d-flex justify-content-between align-items-center w-100">
        <h3 class="card-title mb-1" style="margin-top: 5px;">Halaman Tambah Wali Santri</h3>
    </div>
    <div class="col-lg-6 mt-2 ml-2 mb-4">
        <form action="<?= base_url('walisantri/tambah_aksi') ?>" method="POST">
            <!-- Tambahkan input hidden untuk id_santri -->
            <input type="hidden" name="id_santri" value="<?= isset($santri) ? $santri->id_santri : '' ?>">
            <div class="form-group">
                <label>Email</label>
                <input type="text" name="email" class="form-control" value="<?= set_value('email'); ?>" placeholder="Input Email">
                <?= form_error('email', '<div class="text-small text-danger">', '</div>') ?>
            </div>
            <div class="form-group">
                <label>Password</label>
                <input type="text" name="password" class="form-control" value="<?= set_value('NIS', isset($santri) ? $santri->NIS : '') ?>">
                <?= form_error('password', '<div class="text-small text-danger">', '</div>') ?>
            </div>
            <div class="form-group">
                <label>Nama Wali Santri</label>
                <input type="text" name="nama_wali_santri" class="form-control" value="<?= set_value('nama_wali_santri'); ?>" placeholder="Input Nama Wali Santri">
                <?= form_error('nama_wali_santri', '<div class="text-small text-danger">', '</div>') ?>
            </div>
            <div class="form-group">
                <label>Nama Santri</label>
                <input type="text" name="nama_santri" class="form-control"
                    value="<?= set_value('nama_santri', isset($santri) ? $santri->nama_santri : '') ?>" readonly>
                <?= form_error('nama_santri', '<div class="text-small text-danger">', '</div>'); ?>
            </div>
            <div class="form-group">
                <label>NIS</label>
                <input type="text" name="NIS" class="form-control"
                    value="<?= set_value('NIS', isset($santri) ? $santri->NIS : '') ?>" readonly>
                <?= form_error('NIS', '<div class="text-small text-danger">', '</div>'); ?>
            </div>
            <!-- <div class="form-group">
                <label>No KTP</label>
                <input type="text" name="no_ktp" class="form-control" value="<?= set_value('no_ktp'); ?>" placeholder="Input No KTP">
                <?= form_error('no_ktp', '<div class="text-small text-danger">', '</div>') ?>
            </div>
            <div class="form-group">
                <label>Tempat Lahir</label>
                <input type="text" name="tempat_lahir" class="form-control" value="<?= set_value('tempat_lahir'); ?>" placeholder="Input Tempat Lahir">
                <?= form_error('tempat_lahir', '<div class="text-small text-danger">', '</div>') ?>
            </div>
            <div class="form-group">
                <label>Tanggal Lahir</label>
                <input type="date" name="tanggal_lahir" class="form-control" value="<?= set_value('tanggal_lahir'); ?>" placeholder="Pilih Tanggal">
                <?= form_error('tanggal_lahir', '<div class="text-small text-danger">', '</div>') ?>
            </div> -->
            <div class="form-group">
                <label>Alamat</label>
                <textarea name="alamat" class="form-control" placeholder="Input Alamat"><?= set_value('alamat'); ?></textarea>
                <?= form_error('alamat', '<div class="text-small text-danger">', '</div>') ?>
            </div>
            <div class="form-group">
                <label>No Telepon</label>
                <input type="text" name="no_telepon" class="form-control" value="<?= set_value('no_telepon'); ?>" placeholder="Input No Telepon">
                <?= form_error('no_telepon', '<div class="text-small text-danger">', '</div>') ?>
            </div>
            <div class="form-group">
                <label>Pekerjaan</label>
                <input type="text" name="pekerjaan" class="form-control" value="<?= set_value('tempat_lahir'); ?>" placeholder="Input Pekerjaan">
                <?= form_error('pekerjaan', '<div class="text-small text-danger">', '</div>') ?>
            </div>
            <a href="<?= base_url('santri') ?>" class="btn btn-danger btn-sm">
                <i class="fas fa-solid fa-angle-left"></i> Kembali
            </a>
            <button type="submit" class="btn btn-primary btn-sm"><i class="fas fa-save"></i> Simpan </button>
        </form>
    </div>
</div>