<div id="content" class="main-content">
    <div class="layout-px-spacing">
        <?= $this->session->flashdata('pesan_berhasil'); ?>
        <?= $this->session->flashdata('pesan_gagal'); ?>
        <div class="row layout-top-spacing">
            <div class="col-lg-12">
                <blockquote class="blockquote media-object">
                    <div class="media">
                        <div class="media-body align-self-center">
                            <p class="d-inline">
                                Identitas <?= $identitas_login['nm_panggilan'] ?> - <?= $jabatan['role_level'] ?>
                            </p>
                        </div>
                    </div>
                    <small class="text-left"><cite title="Source Title"><?= $this->mycustom->hariIndo(date('l', strtotime(date('Y-m-d')))) ?>,
                            <?= date('d', strtotime(date('Y-m-d')))  ?>
                            <?= $this->mycustom->bulanIndo(date('m', strtotime(date('Y-m-d'))))  ?>
                            <?= date('Y', strtotime(date('Y-m-d')))  ?></cite></small>
                </blockquote>
            </div>
        </div>
        <div class="row layout-spacing">
            <div class="col-lg-12">
                <div class="statbox widget box box-shadow">
                    <div class="widget-content widget-content-area">
                        <p class="mb-4">
                            <center>
                                <img src="<?= base_url() ?>assets/foto_ktp/<?= $identitas_diri['foto_ktp'] ?>" style="height: 160px;">
                            </center>
                        </p>
                        <?php echo form_open_multipart('arisan/identitas/anggota_arisan/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>Email Anggota</label>
                            <input type="text" hidden class="form-control" value="<?= $identitas_login['id'] ?>" id="id" name="id" placeholder="Masukkan Email Kerja Kalian" required>
                            <input type="email" class="form-control" value="<?= $identitas_login['email'] ?>" id="email" name="email" placeholder="Masukkan Email Kerja Kalian" required>
                            <input type="email" class="form-control" value="<?= $identitas_login['email'] ?>" id="email_lama" name="email_lama" hidden required>
                        </div>
                        <div class="form-group">
                            <label>Nama Panggilan</label>
                            <input type="text" class="form-control" value="<?= $identitas_login['nm_panggilan'] ?>" id="nm_panggilan" name="nm_panggilan" placeholder="Nama Panggilan Karyawan" required>
                        </div>
                        <div class="form-group">
                            <label>Username</label>
                            <input type="text" class="form-control" value="<?= $identitas_login['username'] ?>" id="username" name="username" placeholder="Username Karyawan" required>
                        </div>
                        <div class="form-group">
                            <label>Nomor Induk Kependudukan</label>
                            <input type="text" class="form-control" value="<?= $identitas_diri['nik'] ?>" id="nik" name="nik" placeholder="Nomor Induk Kependudukan" required>
                        </div>
                        <div class="form-group">
                            <label>Jenis Kelamin</label>
                            <select class="form-control" id="jk" name="jk" required>
                                <option value="<?= $identitas_diri['jk'] ?>">
                                    <?php if ($identitas_diri['jk'] == 1) :
                                        echo 'LAKI-LAKI';
                                    elseif ($identitas_diri['jk'] == 2) :
                                        # code...
                                        echo 'PEREMPUAN';
                                    else :
                                        echo 'BELUM DIISI, SILAHKAN ISI';
                                    endif;
                                    ?>
                                </option>
                                <option value="1">LAKI-LAKI</option>
                                <option value="2">PEREMPUAN</option>
                            </select>
                        </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" value="<?= $identitas_diri['tempat_lahir'] ?>" id="tempat_lahir" name="tempat_lahir" placeholder="Tempat Lahir" required>
                                </div>
                                <div class="col">
                                    <input type="date" value="<?= $identitas_diri['tgl_lahir'] ?>" 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" value="<?= $identitas_login['no_hp'] ?>" id="no_hp" name="no_hp" placeholder="Username Karyawan" required>
                        </div>
                        <div class="form-row mb-4">
                            <div class="col-6">
                                <label for="">Kode Pos</label>
                                <input type="number" value="<?= $alamat['kd_pos'] ?>" class="form-control" placeholder="Kode Pos" id="kode_pos" name="kode_pos" required>
                            </div>
                            <div class="col">
                                <label for="">No RT</label>
                                <select class="form-control" id="nm_rt" name="nm_rt" required>
                                    <option value="<?= $alamat['nm_rt'] ?>">
                                        <?= $alamat['nm_rt'] ?></option>
                                    <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="">No RW</label>
                                <select class="form-control" id="nm_rw" name="nm_rw" required>
                                    <option value="<?= $alamat['nm_rw'] ?>">
                                        <?= $alamat['nm_rw'] ?></option>
                                    <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-row mb-4">
                            <div class="col-4">
                                <input type="text" class="form-control" value="<?= $alamat['nm_desa'] ?>" placeholder="Desa/Kelurahan" id="nm_desa" name="nm_desa" required>
                                <small>*Contoh : Hadipolo, Klaling, Bulung Kulon, Bulung Cangkring, Honggosoco</small>
                            </div>
                            <div class="col-4">
                                <input type="text" class="form-control" value="<?= $alamat['nm_kecamatan'] ?>" placeholder="Kecamatan" id="nm_kecamatan" name="nm_kecamatan" required>
                                <small>*Contoh : Jekulo, Bae, Kudus Kota, Pati Kota, Dst</small>
                            </div>
                            <div class="col-4">
                                <input type="text" class="form-control" value="<?= $alamat['kot_kab'] ?>" placeholder="Kota/Kabupaten" id="kot_kab" name="kot_kab" required>
                                <small>*Contoh : Kabupaten Kudus, Kota Semarang Dst</small>
                            </div>
                        </div>
                        <div class="form-group">
                            <input type="text" class="form-control" value="<?= $alamat['prov'] ?>" id="prov" name="prov" placeholder="Provinsi" required>
                            <small>*Contoh : Jawa Tengah, Bali, Lampung, Nusa Tenggara Timur, Dst</small>
                        </div>
                        <div class="form-group">
                            <label>Jabatan</label>
                            <input type="text" class="form-control" readonly value="<?= $jabatan['role_level'] ?>" id="pekerjaan" name="pekerjaan" placeholder="Potongan Admin Setiap Bulan" required>
                        </div>
                        <div class="form-group">
                            <label>Foto KTP</label>
                            <input type="file" class="form-control" value="<?= set_value("foto_ktp") ?>" id="foto_ktp" name="foto_ktp" placeholder="Foto KTP">
                            <input type="text" class="form-control" value="<?= $identitas_diri['foto_ktp'] ?>" id="foto_ktp_old" name="foto_ktp_old" hidden placeholder="Nama Suami atau Istri">
                        </div>
                        <div class="form-group">
                            <label>Tanggal Gabung</label>
                            <input type="date" class="form-control" value="<?= $identitas_diri['tgl_gabung'] ?>" id="tgl_gabung" name="tgl_gabung" placeholder="Tanggal Gabung Karyawan" required>
                        </div>
                        <div class="modal-footer">
                            <button type="submit" id="updateDataAnggotaKaryawan" name="updateDataAnggotaKaryawan" class="btn btn-primary">Simpan</button>
                        </div>
                        <?php echo form_close(); ?>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>