<div class="modal fade" id="ajukanpengajuan" tabindex="-1" role="dialog" aria-labelledby="ajukanpengajuanTitle"
    aria-hidden="true">
    <div class="modal-dialog modal-dialog-scrollable modal-lg" role="document">
        <div class="modal-content">
            <div class="modal-header">
                <h5 class="modal-title" id="ajukanpengajuanTitle">
                    Pengajuan Pinjaman
                </h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body">
                <?php echo form_open_multipart('marketing/beranda/crud'); ?>
                <input type="hidden" name="<?= $this->security->get_csrf_token_name(); ?>"
                    id="<?= $this->security->get_csrf_token_name(); ?>" value="<?= $this->security->get_csrf_hash(); ?>"
                    style="display: none">
                <div class="form-group">
                    <label>Nomor Induk Kependudukan ( NIK )</label>
                    <input type="number" class="form-control" onkeyup="cek_nik_pengajuan_beranda()"
                        id="tambah_nik_anggota" name="tambah_nik_anggota" placeholder="Nomor Induk Kependudukan ( NIK )"
                        required>
                    <input type="text" class="form-control" hidden id="login_id" name="login_id"
                        value="<?= $data_id_login ?>" placeholder="Nomor Induk Kependudukan ( NIK )" required>
                </div>
                <div class="form-group">
                    <label>Nomor Kartu Keluarga</label>
                    <input type="number" class="form-control" id="tambah_nomor_kk" name="tambah_nomor_kk"
                        placeholder="Nomor Kartu Keluarga" required>
                </div>
                <div class="form-group">
                    <label>Nama Panggilan</label>
                    <input type="text" class="form-control" id="tambah_nm_anggota" name="tambah_nm_anggota"
                        placeholder="Nama Lengkap" required>
                </div>
                <div class="form-group">
                    <label>Jenis Kelamin</label>
                    <select class="form-control" id="tambah_jk" name="tambah_jk" required>
                        <option value="ok">Jenis Kelamin</option>
                        <option value="1">LAKI-LAKI</option>
                        <option value="2">PEREMPUAN</option>
                    </select>
                </div>
                <div class="form-group">
                    <label>Alamat Lengkap</label>
                    <textarea class="form-control" name="tambah_alamat_lengkap" id="tambah_alamat_lengkap" cols="30"
                        rows="2" placeholder="Mis. Jalan, Sekolah, Perumahan, Dst" required></textarea>
                </div>
                <div class="form-group">
                    <label for="">Pilih Kabupaten / Kota</label>
                    <select class="form-control" id="tambah_kota_kabupaten" name="tambah_kota_kabupaten" required>
                        <option value="PILIH">Pilih Kabupaten / Kota</option>
                        <?php foreach ($data_kota as $Data_kota) : ?>
                            <option value="<?= $Data_kota->kot_kab ?>"><?= $Data_kota->kot_kab ?></option>
                        <?php endforeach; ?>
                    </select>
                </div>
                <div class="form-row mb-4">
                    <div class="col-6">
                        <label for="">Pilih Kecamatan</label>
                        <select class="form-control" id="tambah_kecamatan_baru" name="tambah_kecamatan_baru" required>
                        </select>
                    </div>
                    <div class="col-6">
                        <label for="">Pilih Desa</label>
                        <select class="form-control" id="tambah_dk_ds" name="tambah_dk_ds" required>
                        </select>
                    </div>
                </div>
                <div class="form-row mb-4">
                    <div class="col">
                        <label for="">
                            RT
                        </label>
                        <select class="form-control" id="tambah_nm_rt" name="tambah_nm_rt" required>
                            <option value="001">001</option>
                            <option value="002">002</option>
                            <option value="003">003</option>
                            <option value="004">004</option>
                            <option value="005">005</option>
                            <option value="006">006</option>
                            <option value="007">007</option>
                            <option value="008">008</option>
                            <option value="009">009</option>
                            <option value="010">010</option>
                            <option value="011">011</option>
                            <option value="012">012</option>
                            <option value="013">013</option>
                            <option value="014">014</option>
                            <option value="015">015</option>
                            <option value="016">016</option>
                            <option value="017">017</option>
                            <option value="018">018</option>
                            <option value="019">019</option>
                            <option value="020">020</option>
                        </select>
                    </div>
                    <div class="col">
                        <label for="">
                            RW
                        </label>
                        <select class="form-control" id="tambah_nm_rw" name="tambah_nm_rw" required>
                            <option value="001">001</option>
                            <option value="002">002</option>
                            <option value="003">003</option>
                            <option value="004">004</option>
                            <option value="005">005</option>
                            <option value="006">006</option>
                            <option value="007">007</option>
                            <option value="008">008</option>
                            <option value="009">009</option>
                            <option value="010">010</option>
                            <option value="011">011</option>
                            <option value="012">012</option>
                            <option value="013">013</option>
                            <option value="014">014</option>
                            <option value="015">015</option>
                            <option value="016">016</option>
                            <option value="017">017</option>
                            <option value="018">018</option>
                            <option value="019">019</option>
                            <option value="020">020</option>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label>Tempat Tanggal Lahir</label>
                    <div class="form-row mb-4">
                        <div class="col">
                            <input type="text" class="form-control" id="tambah_tempat_lahir" name="tambah_tempat_lahir"
                                placeholder="Tempat Lahir" required>
                        </div>
                        <div class="col">
                            <input type="date" max='<?= date("Y-m-d", strtotime("-18 year")); ?>' class="form-control"
                                id="tambah_tgl_lahir" name="tambah_tgl_lahir" placeholder="Tanggal Lahir" required>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label>Nomor HP</label>
                    <input type="number" class="form-control" id="tambah_no_hp" name="tambah_no_hp"
                        placeholder="Nomor HP" required>
                </div>
                <div class="form-group">
                    <label>Pekerjaan</label>
                    <input type="text" class="form-control" id="tambah_pekerjaan" name="tambah_pekerjaan"
                        placeholder="Pekerjaan Anggota Arisan" required>
                </div>
                <div class="form-group">
                    <select class="form-control" id="status_hubungan" onchange="showDiv(this)" name="status_hubungan"
                        required>
                        <option value="0">BELUM MENIKAH</option>
                        <option value="1">MENIKAH</option>
                        <option value="2">DUDA/JANDA</option>
                    </select>
                </div>
                <div class="form-group" id="select_suami_istri" style="display:none">
                    <label>Suami / Istri</label>
                    <input type="text" class="form-control" id="tambah_suami_istri" name="tambah_suami_istri"
                        placeholder="Nama Suami atau Istri">
                </div>
                <div class="form-group">
                    <label>Foto KTP</label>
                    <input type="file" class="form-control" id="foto_ktp" name="foto_ktp" placeholder="Foto KTP"
                        required>
                </div>
                <div class="form-group">
                    <label>Foto Kartu Keluarga</label>
                    <input type="file" class="form-control" id="foto_kk" name="foto_kk" placeholder="Foto KK" required>
                </div>
                <div class="form-group">
                    <label>Produk Pinjaman</label>
                    <select class="form-control" id="produk_id" name="produk_id" required>
                        <?php foreach ($jenis_pinjaman as $Jenis_pinjaman) : ?>
                            <option value="<?= $Jenis_pinjaman->id ?>"><?= $Jenis_pinjaman->nm_produk ?></option>
                        <?php endforeach; ?>
                    </select>
                </div>
                <div class="form-group">
                    <label>Pokok Pinjaman</label>
                    <input type="text" class="form-control" id="pokok_pinjaman" name="pokok_pinjaman"
                        placeholder="Masukkan Jumlah Pinjaman">
                </div>
                <div class="form-group">
                    <label for="">Pakai Jaminan</label>
                    <select class="form-control" id="pakai_jaminan" onchange="showDiv2(this)" name="pakai_jaminan"
                        required>
                        <option value="Y">Ya</option>
                        <option value="N">Tidak</option>
                    </select>
                </div>
                <div class="form-group" id="select_pakai_jaminan">
                    <label>Masukkan Jaminan</label>
                    <input type="text" class="form-control" id="tambah_pakai_jaminan" name="tambah_pakai_jaminan"
                        placeholder="Masukkan Nama Jaminan">
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-outline-primary" data-dismiss="modal">
                    Close
                </button>
                <button type="submit" id="simpanPengajuanPinjaman" name="simpanPengajuanPinjaman"
                    class="btn btn-primary">Tambah</button>
            </div>
            <?php echo form_close(); ?>
        </div>
    </div>
</div>
<?php $this->load->view('marketing/beranda/script'); ?>