<div class="modal fade" id="tambahAnggota" tabindex="-1" role="dialog" aria-labelledby="tambahAnggotaTitle"
    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="tambahAnggotaTitle">
                    Tambah Anggota Koperasi
                </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('owner/anggota/koperasi/crud'); ?>
                <input type="hidden" name="<?= $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" id="nik_anggota" name="nik_anggota"
                        placeholder="Nomor Induk Kependudukan ( NIK )" required>
                </div>
                <div class="form-group">
                    <label>Nomor Kartu Keluarga</label>
                    <input type="number" class="form-control" id="nomor_kk" name="nomor_kk" placeholder="Nomor KK">
                </div>
                <div class="form-group">
                    <label>Nama Panggilan</label>
                    <input type="text" class="form-control" id="nm_anggota" name="nm_anggota"
                        placeholder="Nama Anggota Kelompok Arisan" required>
                </div>
                <div class="form-group">
                    <label>Jenis Kelamin</label>
                    <select class="form-control" id="jk" name="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="alamat_lengkap" id="alamat_lengkap" cols="30" rows="2"
                        placeholder="Mis. Jalan, Sekolah, Perumahan, Dst" required></textarea>
                </div>
                <div class="form-group">
                    <label>Provinsi</label>
                    <select class="form-control" id="province_id" name="province_id" required>
                        <?php foreach ($provinsi as $Provinsi) : ?>
                            <option value="<?= $Provinsi['id'] ?>"><?= $Provinsi['name'] ?></option>
                        <?php endforeach; ?>
                    </select>
                </div>
                <div class="form-row mb-4">
                    <div class="col-6">
                        <label>Kabupaten / Kota</label>
                        <select class="form-control" id="kot_kab" name="kot_kab" required>
                        </select>
                    </div>
                    <div class="col-6">
                        <label>Kecamatan</label>
                        <select class="form-control" id="nm_kec" name="nm_kec" required>
                        </select>
                    </div>
                </div>
                <div class="form-row mb-4">
                    <div class="col-6">
                        <label>Desa / Kelurahan</label>
                        <select class="form-control" id="nm_desa" name="nm_desa" required>
                        </select>
                    </div>
                    <div class="col">
                        <label>RT</label>
                        <select class="form-control" id="nm_rt" name="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>RW</label>
                        <select class="form-control" id="nm_rw" name="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="tempat_lahir" name="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="tgl_lahir" name="tgl_lahir" placeholder="Tanggal Lahir" required>
                        </div>
                    </div>
                </div>
                <div class="form-group">
                    <label>Nomor HP</label>
                    <input type="number" class="form-control" id="no_hp" name="no_hp" placeholder="Nomor HP" required>
                </div>
                <div class="form-group">
                    <label>Pekerjaan</label>
                    <input type="text" class="form-control" id="pekerjaan" name="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="suami_istri" name="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">
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-outline-primary" data-dismiss="modal">
                    Close
                </button>
                <button type="submit" id="simpanAnggoKoperasi" name="simpanAnggoKoperasi"
                    class="btn btn-primary">Tambah</button>
            </div>
            <?php echo form_close(); ?>
        </div>
    </div>
</div>
<?php $this->load->view('owner/anggota/koperasi/script'); ?>