<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>

                <!-- <?php if (isset($blok1) && ($blok1[0]->hasil == 1)) : ?> -->
                <div class="col-md-12 hslcacah">
                    <!-- general form elements -->
                    <div class="card card-primary">
                        <div class="card-header">
                            <h3 class="card-title">BLOK III - KETERANGAN PERUMAHAN</h3>
                        </div>

                        <form method="post" action="<?= base_url() ?>tambah_ruta/blok3/<?= $blok1[0]->id ?>">
                            <div class="card-body">
                                <div class="form-group status3">
                                    <label for="status">301a. Status kepemilikan bangunan tempat tinggal
                                        yang ditempati</label>
                                    <?php if (isset($blok1)) : ?>
                                        <input type="hidden" id="id3" name="id3" class="form-control col-md-7 col-xs-12" value="<?= $blok1[0]->id ?>">
                                        <input type="hidden" id="buah" name="buah" class="form-control col-md-7 col-xs-12" value="<?= $blok1[0]->buah ?>">
                                        <input type="text" maxlength="1" class="form-control" name="status" placeholder="Status Penguasaan Bangunan" id="status3" onkeypress="return event.charCode >= 49 && event.charCode <=53" value="<?= $blok1[0]->status1 ?>">
                                    <?php else : ?>
                                        <input disabled type=" text" maxlength="1" class="form-control" name="status" placeholder="Status Penguasaan Bangunan" id="status3" onkeypress="return event.charCode >= 49 && event.charCode <=53">
                                    <?php endif; ?>
                                    <?= form_error('status', '<small class ="text-danger pl-3">', '</small>'); ?>
                                </div>
                                <div class="form-group status2">
                                    <label for="status">301.b Status kepemilikan tanah tempat tinggal
                                        yang ditempati</label>
                                    <?php if (isset($blok1)) : ?>
                                        <input type="text" class="form-control" id="status2" name="status2" placeholder="Status Lahan" maxlength="1" onkeypress="return event.charCode >= 48 && event.charCode <=52" value="<?= $blok1[0]->status2 ?>">
                                    <?php else : ?>
                                        <input disabled type="text" class="form-control" id="status2" name="status2" placeholder="Status Lahan" maxlength="1" onkeypress="return event.charCode >= 48 && event.charCode <=52">
                                    <?php endif; ?>
                                    <?= form_error('status2', '<small class ="text-danger pl-3">', '</small>'); ?>
                                </div>
                                <div class="form-group r301c">
                                    <label for="status">301.c Apa jenis bukti
                                        kepemilikan tanah bangunan tempat tinggal
                                        ini</label>
                                    <?php if (isset($blok1)) : ?>
                                        <input type="text" class="form-control" id="r301c" name="r301c" placeholder="Jenis bukti kepemilikan tanah bangunan tempat tinggal " maxlength="1" onkeypress="return event.charCode >= 48 && event.charCode <=52" value="<?= $blok1[0]->r301c ?>">
                                    <?php else : ?>
                                        <input disabled type=" text" class="form-control" id="r301c" name="r301c" placeholder="Jenis bukti
                                        kepemilikan tanah bangunan tempat tinggal " maxlength=" 1" onkeypress="return event.charCode >= 48 && event.charCode <=52">
                                    <?php endif; ?>

                                </div>
                                <div class="form-group">
                                    <label for="luastnh">302.a.Luas tanah</label>
                                    <?php if (isset($blok1)) : ?>
                                        <input type="text" class="form-control" id="luastnh" name="luastnh" maxlength="3" placeholder="Luas Tanah" onkeypress="return event.charCode >= 48 && event.charCode <=58" value="<?= $blok1[0]->luastnh ?>">
                                    <?php else : ?>
                                        <input disabled type="text" class="form-control" id="luastnh" name="luastnh" maxlength="3" placeholder="Luas Tanah" onkeypress="return event.charCode >= 48 && event.charCode <=52">
                                    <?php endif; ?>

                                </div>
                                <div class="form-group">
                                    <label for="luas">302.b.Luas Lantai</label>
                                    <?php if (isset($blok1)) : ?>
                                        <input type="text" class="form-control" id="luas" name="luas" maxlength="3" placeholder="Luas Lantai" onkeypress="return event.charCode >= 48 && event.charCode <=58" value="<?= $blok1[0]->luas ?>">
                                    <?php else : ?>
                                        <input disabled type="text" class="form-control" id="luas" name="luas" maxlength="3" placeholder="Luas Lantai" onkeypress="return event.charCode >= 48 && event.charCode <=52">
                                    <?php endif; ?>
                                    <?= form_error('luas', '<small class ="text-danger pl-3">', '</small>'); ?>
                                </div>
                                <div class="form-group">
                                    <label for="jenis">303.Jenis Lantai Terluas</label>
                                    <?php if (isset($blok1)) : ?>
                                        <input type="text" class="form-control" name="jenis" id="jenis" placeholder="Jenis Lantai Terluas" maxlength="2" onkeypress="return event.charCode >= 48 && event.charCode <=58" value="<?= $blok1[0]->jenis ?>">
                                    <?php else : ?>
                                        <input disabled type="text" class="form-control" name="jenis" id="jenis" placeholder="Jenis Lantai Terluas" maxlength="2" onkeypress="return event.charCode >= 48 && event.charCode <=58 ">
                                    <?php endif; ?>
                                    <?= form_error('jenis', '<small class ="text-danger pl-3">', '</small>'); ?>
                                </div>

                                <div class="form-group">
                                    <label for="jenisdinding">304. Jenis Dinding Terluas</label>
                                    <?php if (isset($blok1)) : ?>
                                        <input type="text" class="form-control" name="jenisdinding" id="jenisdinding" placeholder="Jenis Dinding Terluas" maxlength="1" onkeypress="return event.charCode >= 49 && event.charCode <=54" value="<?= $blok1[0]->jenisdinding ?>">
                                    <?php else : ?>
                                        <input disabled type="text" class="form-control" name="jenisdinding" id="jenisdinding" placeholder="Jenis Dinding Terluas" maxlength="1" onkeypress="return event.charCode >= 49 && event.charCode <=54">
                                    <?php endif; ?>
                                </div>

                                <div class="form-group">
                                    <label for="jenisatap">305. Jenis Atap Terluas</label>
                                    <?php if (isset($blok1)) : ?>
                                        <input type="text" class="form-control" name="jenisatap" id="jenisatap" placeholder="Jenis Atap Terluas" maxlength="2" onkeypress="return event.charCode >= 48 && event.charCode <=58 && event" value="<?= $blok1[0]->jenisatap ?>">
                                    <?php else : ?>
                                        <input disabled type="text" class="form-control" name="jenisatap" id="jenisatap" placeholder="Jenis Atap Terluas" maxlength="2" onkeypress="return event.charCode >= 48 && event.charCode <=58 && event">
                                    <?php endif; ?>
                                    <?= form_error('jenisatap', '<small class ="text-danger pl-3">', '</small>'); ?>
                                </div>

                                <div class="form-group">
                                    <label for="sumberair">306. Sumber Air Minum</label>
                                    <?php if (isset($blok1)) : ?>
                                        <input type="text" class="form-control" name="sumberair" id="sumberair" placeholder="Sumber Air Minum" maxlength="2" onkeypress="return event.charCode >= 48 && event.charCode <=58" value="<?= $blok1[0]->sumberair ?>">
                                    <?php else : ?>
                                        <input disabled type="text" class="form-control" name="sumberair" id="sumberair" placeholder="Sumber Air Minum" maxlength="2" onkeypress="return event.charCode >= 48 && event.charCode <=58 && event">
                                    <?php endif; ?>
                                    <?= form_error('sumberair', '<small class ="text-danger pl-3">', '</small>'); ?>
                                </div>

                                <div class="form-group">
                                    <label for="sumberpen">307a. Sumber Penerangan Utama</label>
                                    <?php if (isset($blok1)) : ?>
                                        <input type="text" class="form-control" name="sumberpen" id="sumberpen" placeholder="Sumber Penerangan Utama" maxlength="1" onkeypress="return event.charCode >= 49 && event.charCode <=51" value="<?= $blok1[0]->sumberpen ?>">
                                    <?php else : ?>
                                        <input disabled type="text" class="form-control" name="sumberpen" id="sumberpen" placeholder="Sumber Penerangan Utama" maxlength="1" onkeypress="return event.charCode >= 49 && event.charCode <=51">
                                    <?php endif; ?>
                                    <?= form_error('sumberpen', '<small class ="text-danger pl-3">', '</small>'); ?>
                                </div>
                                <div class="form-group dya">
                                    <label for="jummeteran">307.b. Jumlah Meteran </label>
                                    <?php if (isset($blok1)) : ?>
                                        <input type="text" class="form-control" name="jummeteran" id="jummeteran" placeholder="Jumlah Meteran" maxlength="1" onkeypress="return event.charCode >= 49 && event.charCode <=51" value="<?= $blok1[0]->jummeteran ?>">
                                    <?php else : ?>
                                        <input disabled type="text" class="form-control" name="jummeteran" id="jummeteran" placeholder="Sumber Penerangan Utama" maxlength="1" onkeypress="return event.charCode >= 49 && event.charCode <=51">
                                    <?php endif; ?>
                                </div>
                                <div class="form-group dya">
                                    <label for="daya">307.c.Daya terbesar yang terpasang</label>
                                    <?php if (isset($blok1)) : ?>
                                        <input type="text" class="form-control" name="daya" id="daya" placeholder="Daya Terpasang" maxlength="1" onkeypress="return event.charCode >= 49 && event.charCode <=54" value="<?= $blok1[0]->daya ?>">
                                    <?php else : ?>
                                        <input disabled type="text" class="form-control" name="daya" id="daya" placeholder="Daya Terpasang" maxlength="1" onkeypress="return event.charCode >= 49 && event.charCode <=54">
                                    <?php endif; ?>
                                    <?= form_error('daya', '<small class ="text-danger pl-3">', '</small>'); ?>
                                </div>
                                <div class="form-group">
                                    <label for="nokk">308. Bahan bakar utama untuk memasak</label>
                                    <?php if (isset($blok1)) : ?>
                                        <input type="text" class="form-control" name="bahan" id="bahan" placeholder=" Bahan bakar/energi utama untuk memasak" maxlength="1" onkeypress="return event.charCode >= 49 && event.charCode <=57" value="<?= $blok1[0]->bahan ?>">
                                    <?php else : ?>
                                        <input disabled type="text" class="form-control" name="bahan" id="bahan" placeholder=" Bahan bakar/energi utama untuk memasak" maxlength="1" onkeypress="return event.charCode >= 49 && event.charCode <=57">
                                    <?php endif; ?>
                                    <?= form_error('bahan', '<small class ="text-danger pl-3">', '</small>'); ?>
                                </div>
                                <div class="form-group">
                                    <label for="pengguna">309a.Kepemilikan dan Penggunaan fasilitas tempat buang air besar</label>
                                    <?php if (isset($blok1)) : ?>
                                        <input type="text" class="form-control" name="pengguna" id="pengguna" placeholder="Kepemilikan Fasiulitas BAB Terpasang" maxlength="1" onkeypress="return event.charCode >= 49 && event.charCode <=52" value="<?= $blok1[0]->pengguna ?>">
                                    <?php else : ?>
                                        <input disabled type="text" class="form-control" name="pengguna" id="pengguna" pplaceholder="Kepemilikan Fasiulitas BAB Terpasang" maxlength="1" onkeypress="return event.charCode >= 49 && event.charCode <=52">
                                    <?php endif; ?>
                                    <?= form_error('pengguna', '<small class ="text-danger pl-3">', '</small>'); ?>
                                </div>
                                <div class="form-group jnsklst">
                                    <label for="jeniskloset">309.b. Jenis Kloset</label>
                                    <?php if (isset($blok1)) : ?>
                                        <input type="text" class="form-control" name="jeniskloset" id="jeniskloset" placeholder="Jenis Kloset" maxlength="1" onkeypress="return event.charCode >= 49 && event.charCode <=52" value="<?= $blok1[0]->jeniskloset ?>">
                                    <?php else : ?>
                                        <input disabled type="text" class="form-control" name="jeniskloset" id="jeniskloset" placeholder="Jenis Kloset" maxlength="1" onkeypress="return event.charCode >= 49 && event.charCode <=52">
                                    <?php endif; ?>
                                    <?= form_error('jeniskloset', '<small class ="text-danger pl-3">', '</small>'); ?>
                                </div>
                                <div class="form-group">
                                    <label for="tempatpembuangan">310. Tempat Pembuangan Akhir Tinja</label>
                                    <?php if (isset($blok1)) : ?>
                                        <input type="text" class="form-control" name="tempatpembuangan" id="tempatpembuangan" placeholder="Tempat Pembuangan Akhir Tinja" maxlength="1" onkeypress="return event.charCode >= 49 && event.charCode <=54" value="<?= $blok1[0]->tempatpembuangan ?>">
                                    <?php else : ?>
                                        <input disabled type="text" class="form-control" name="tempatpembuangan" id="tempatpembuangan" placeholder="Tempat Pembuangan Akhir Tinja" maxlength="1" onkeypress="return event.charCode >= 49 && event.charCode <=54">
                                    <?php endif; ?>
                                    <?= form_error('tempatpembuangan', '<small class ="text-danger pl-3">', '</small>'); ?>
                                </div>

                            </div>
                            <!-- /.card-body -->

                            <div class="card-footer">
                                <?php if (isset($blok1)) : ?>
                                    <button type="submit" class="btn te11 btn-primary">Simpan</button>
                                <?php else : ?>
                                    <button style="display: none;" type="submit" class="btn te11 btn-primary">Submit</button>
                                <?php endif; ?>
                            </div>
                        </form>
                    </div>
                </div>
                <!-- <?php endif; ?> -->

            </div>




            <!-- <?= var_dump(($blok1)) ?> -->
            <div class="row">
                <div class="col-12 mb-2">
                    <a href="<?= base_url() ?>tambah_ruta/blok2_halaman/<?= $blok1[0]->id ?>" class="btn btn-secondary">Kembali</a>
                    <?php if (($blok1[0]->luas >= 1)
                        && ($blok1[0]->jenis >= 1)
                        && ($blok1[0]->jenisdinding >= 1)
                        && ($blok1[0]->kondisidinding >= 1)
                        && ($blok1[0]->jenisatap >= 1)
                        && ($blok1[0]->kondisiatap >= 1)
                        && ($blok1[0]->jumkamar >= 1)
                        && ($blok1[0]->sumberair >= 1)
                        && ($blok1[0]->sumberpen >= 1)
                        && ($blok1[0]->daya >= 1)
                        && ($blok1[0]->bahan >= 1)
                        && ($blok1[0]->pengguna >= 1)
                        && ($blok1[0]->jeniskloset >= 1)
                        && ($blok1[0]->tempatpembuangan >= 1)

                    ) : ?>
                        <a href="<?= base_url() ?>tambah_ruta/blok45/<?= $blok1[0]->id ?>" class="btn btn-success next float-right">Selanjutnya</a>
                    <?php endif; ?>
                </div>
            </div>
        </div><!-- /.container-fluid -->
    </section>

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