<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">
                <div class="col-12">
                    <div class="card card-primary">
                        <div class="card-header">
                            <h3 class="card-title" id="blk4">BLOK IV - PENDAPATAN KELUARGA</h3>
                        </div>
                        <form method="post" action="<?= base_url() ?>tambah_ruta/blok4/<?= $blok1[0]->id ?>">
                            <div class="card-body">
                                <div class="row">
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label for="pekerjaan">Pekerjaan yang Menghasilkan Pendapatan Terbesar</label>
                                            <?php if (isset($blok1)) : ?>
                                                <input type="hidden" id="id2" name="id2" class="form-control col-md-7 col-xs-12" value="<?= $blok1[0]->id ?>">

                                                <input type="text" class="form-control" name="pekerjaan" id="pekerjaan" placeholder="Kode Lapangan Usaha" maxlength="2" onkeypress="return event.charCode >= 48 && event.charCode <=58" value="<?= $blok1[0]->pekerjaan ?>">
                                            <?php else : ?>
                                                <input disabled type="text" class="form-control" name="pekerjaan" id="pekerjaan" placeholder="Kode Lapangan Usaha" maxlength="2" onkeypress="return event.charCode >= 48 && event.charCode <=58">
                                            <?php endif; ?>
                                            <?= form_error('pekerjaan', '<small class ="text-danger pl-3">', '</small>'); ?>
                                        </div>
                                    </div>
                                    <div class="col-md-6">
                                        <div class="form-group">
                                            <label for="pendapatan">Pendapatan Seluruh Anggota Keluarga Per Bulan</label>
                                            <?php if (isset($blok1)) : ?>
                                                <input type="text" class="form-control" name="pendapatan" id="pendapatan" placeholder="Pendapatan Keseluruhan anggota" maxlength="13" onkeypress="return event.charCode >= 48 && event.charCode <=58" value="<?= $blok1[0]->pendapatan ?>">
                                            <?php else : ?>
                                                <input disabled type="text" class="form-control" name="pendapatan" id="pendapatan" placeholder="Pendapatan Keseluruhan anggota" maxlength="13" onkeypress="return event.charCode >= 48 && event.charCode <=58">
                                            <?php endif; ?>
                                            <?= form_error('pendapatan', '<small class ="text-danger pl-3">', '</small>'); ?>
                                        </div>

                                    </div>

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

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


            </div>
            <div class="row">
                <div class="col-12 mb-2">
                    <a href="<?= base_url() ?>tambah_ruta/blok3_halaman/<?= $blok1[0]->id ?>"" class=" btn bg-navy">Kembali</a>
                    <?php if ($blok1[0]->pendapatan  == null) : ?>
                        <!-- <a href="<?= base_url() ?>tambah_ruta/blok7/<?= $blok1[0]->id ?>" class="btn btn-success next float-right">Selanjutnya</a> -->
                    <?php else : ?>
                        <a href="<?= base_url() ?>tambah_ruta/blok5_halaman/<?= $blok1[0]->id ?>" class="btn btn-success next float-right">Selanjutnya</a>
                    <?php endif; ?>
                </div>
            </div>
        </div><!-- /.container-fluid -->
    </section>
    <?php
    if (isset($_SESSION['informasi'])) {
        echo $_SESSION['informasi'];
        unset($_SESSION['informasi']);
    }
    ?>
    <?php
    if (isset($_SESSION['error'])) {
        echo $_SESSION['error'];
        unset($_SESSION['error']);
    }
    ?>
    <!-- /.content -->
</div>