<div class="content-wrapper">
    <!-- Content Header (Page header) -->
    <section class="content-header">
        <div class="container-fluid">
            <div class="row mb-2">
                <div class="col-sm-6">
                    <h1>FORM TAMBAH DATA RUMAH TANGGA</h1>
                </div>
                <div class="col-sm-6">
                    <ol class="breadcrumb float-sm-right">
                        <li class="breadcrumb-item"><a href="#">Home</a></li>
                        <li class="breadcrumb-item active">FORM TAMBAH DATA RUMAH TANGGA</li>
                    </ol>
                </div>
            </div>
        </div><!-- /.container-fluid -->
    </section>

    <!-- Main content -->
    <section class="content centered">
        <div class="container-fluid ">
            <div class="row">
                <!-- left column -->
                <div class="col-md-12">
                    <!-- general form elements -->
                    <div class=" card card-primary">
                        <div class="card-header">
                            <h3 class="card-title">BLOK I - PENGENALAN TEMPAT</h3>
                        </div>
                        <?php if (isset($blok1)) : ?>
                            <form method="post" action="<?= base_url() ?>tambah_ruta/ubahblok1/<?= $blok1[0]->id  ?>">
                            <?php else : ?>
                                <form method="post" action="<?= base_url() ?>blok1">
                                <?php endif; ?>
                                <div class="card-body">
                                    <div class="form-group">
                                        <?php if (isset($blok1)) : ?>
                                            <input type="hidden" id="id" name="id" class="form-control col-md-7 col-xs-12" value="<?= $blok1[0]->id ?>">
                                        <?php endif; ?>
                                        <label for=" provinsi">Provinsi</label>
                                        <?php if (isset($blok1)) : ?>
                                            <input readonly type="text" class="form-control" name="provinsi" id="provinsi" placeholder="Provinsi" value="<?= $blok1[0]->provinsi ?>">
                                        <?php else : ?>
                                            <input readonly type="text" value="Sulawesi Selatan" class="form-control" name="provinsi" id="provinsi" placeholder="Provinsi">
                                        <?php endif; ?>
                                        <?= form_error('provinsi', '<small class ="text-danger pl-3">', '</small>'); ?>
                                    </div>
                                    <div class=" form-group">
                                        <label for="kabupaten">Kabupaten</label>
                                        <?php if (isset($blok1)) : ?>
                                            <input readonly type="text" class="form-control" name="kabupaten" id="kabupaten" placeholder="Kabupaten" value="<?= $blok1[0]->kabupaten ?>">
                                        <?php else : ?>
                                            <input readonly type="text" value="Wajo" class="form-control" name="kabupaten" id="kabupaten" placeholder="Kabupaten">
                                        <?php endif; ?>

                                        <?= form_error('kabupaten', '<small class ="text-danger pl-3">', '</small>'); ?>
                                    </div>
                                    <div class="form-group">
                                        <label for="kecamatan">Kecamatan</label>
                                        <?php if (isset($blok1)) : ?>
                                            <input readonly type="text" class="form-control" name="kecamatan" id="kecamatan" placeholder="Kecamatan" value="<?= $blok1[0]->kecamatan ?>">
                                        <?php else : ?>
                                            <input readonly type="text" value="Tempe" class="form-control" name="kecamatan" id="kecamatan" placeholder="Kecamatan">
                                        <?php endif; ?>

                                        <?= form_error('kecamatan', '<small class ="text-danger pl-3">', '</small>'); ?>
                                    </div>
                                    <div class="form-group">
                                        <label for="Desa">Desa</label>
                                        <?php if (isset($blok1)) : ?>
                                            <input readonly type="text" class="form-control" name="desa" id="desa" placeholder="Desa" value="<?= $blok1[0]->desa ?>">
                                        <?php else : ?>
                                            <input readonly value="Tempe" type="text" class="form-control" name="desa" id="desa" placeholder="Desa">
                                        <?php endif; ?>
                                        <?= form_error('desa', '<small class ="text-danger pl-3">', '</small>'); ?>

                                    </div>
                                    <div class="form-group">
                                        <label for="alamat">Alamat</label>
                                        <?php if (isset($blok1)) : ?>
                                            <input type="text" class="form-control" name="alamat" id="alamat" placeholder="Alamat" value="<?= $blok1[0]->alamat ?>">
                                        <?php else : ?>
                                            <input type="text" class="form-control" name="alamat" id="alamat" placeholder="Alamat" value="<?= set_value('alamat') ?>">
                                        <?php endif; ?>

                                        <?= form_error('alamat', '<small class ="text-danger pl-3">', '</small>'); ?>
                                    </div>
                                    <div class="form-group">
                                        <label for="nokk">Nomor Kartu Keluarga</label>
                                        <?php if (isset($blok1)) : ?>
                                            <input type="text" maxlength="16" minlength="16" class="form-control" name="nokk" id="nokk" placeholder="Nomor Kartu Keluarga" maxlength="9" onkeypress="return event.charCode >= 48 && event.charCode <=58" value="<?= $blok1[0]->nokk ?>">
                                        <?php else : ?>
                                            <input type="text" maxlength="16" minlength="16" class="form-control" name="nokk" id="nokk" placeholder="Nomor Kartu Keluarga" maxlength="9" onkeypress="return event.charCode >= 48 && event.charCode <=58" value="<?= set_value('nokk') ?>">
                                        <?php endif; ?>

                                        <?= form_error('nokk', '<small class ="text-danger pl-3">', '</small>'); ?>

                                    </div>
                                    <div class="form-group">
                                        <label for="namaKK">Nama Kepala Keluarga</label>
                                        <?php if (isset($blok1)) : ?>
                                            <input type="text" class="form-control" name="namaKK" id="namaKK" class="namaKK" placeholder="Nama Kepala Keluarga" value="<?= $blok1[0]->nm_kpl_kg ?>">
                                        <?php else : ?>
                                            <input type="text" class="form-control" name="namaKK" id="namaKK" class="namaKK" placeholder="Nama Kepala Keluarga" value="<?= set_value('namaKK') ?>">
                                        <?php endif; ?>

                                        <?= form_error('namaKK', '<small class ="text-danger pl-3">', '</small>'); ?>
                                    </div>
                                    <div class="form-group">
                                        <label for="jlmanggota">Jumlah Anggota Keluarga</label>
                                        <?php if (isset($blok1)) : ?>
                                            <input type="number" minlength="1" class="form-control" name="jmlagt" id="jmlagt" placeholder="Jumlah Anggota Keluarga" value="<?= $blok1[0]->jml_agt ?>">
                                        <?php else : ?>
                                            <input type="number" minlength="1" class="form-control" name="jmlagt" id="jmlagt" placeholder="Jumlah Anggota Keluarga" value="<?= set_value('jmlagt') ?>">
                                        <?php endif; ?>

                                        <?= form_error('jmlagt', '<small class ="text-danger pl-3">', '</small>'); ?>
                                    </div>
                                    <div class="form-group">
                                        <label for="norumah">Nomor HP Responden</label>
                                        <?php if (isset($blok1)) : ?>
                                            <input type="number" min="0" minlength="1" class="form-control" name="norumah" id="norumah" placeholder="Nomor Bangunan Rumah" value=<?= $blok1[0]->normh ?>>
                                        <?php else : ?>
                                            <input type="number" min="0" minlength="1" class="form-control" name="norumah" id="norumah" placeholder="Nomor Bangunan Rumah" value="<?= set_value('norumah') ?>">
                                        <?php endif; ?>

                                        <?= form_error('norumah', '<small class ="text-danger pl-3">', '</small>'); ?>
                                    </div>
                                </div>
                                <!-- /.card-body -->

                                <div class="card-footer">
                                    <button type="submit" class="btn btn-primary">Simpan</button>
                                </div>
                                </form>
                    </div>
                </div>


            </div>




            <!-- <?php if ($blok1[0]->jml_agt >= 1) : ?> -->

            <div class="row">
                <div class="col-12 mb-2">
                    <!-- <a href="<?= base_url() ?>" class="btn btn-secondary">Kembali</a> -->
                    <a href="<?= base_url() ?>tambah_ruta/blok2_halaman/<?= $blok1[0]->id ?>" class="btn btn-success next float-right">Selanjutnya</a>
                </div>
            </div>
            <!-- <?php endif; ?> -->
        </div><!-- /.container-fluid -->
    </section>

    <!-- /.content -->
</div>
<?php
$error = $this->session->flashdata('error');
if (!empty($error)) {
    echo $error;
}
?>
<?= $this->session->flashdata("informasi") ?>