<script src="<?=base_url('assets/js')?>/autoNumeric.js"></script>
<div class="card-header">
    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
    <h3 class="title modal-title"></h3>
</div>
<div class="card-body">
    <form id="form_input">
        <input type="hidden" id="id" name="id" value="<?= $id ?>">
        <input type="hidden" id="bpjs_kes_tunj_perus" name="bpjs_kes_tunj_perus" value="<?= $data_bpjs_kes->tunj_perus ?>">
        <input type="hidden" id="bpjs_kes_pot_kry" name="bpjs_kes_pot_kry" value="<?= $data_bpjs_kes->pot_kry ?>">
        <input type="hidden" id="bpjs_kes_flag" name="bpjs_kes_flag" value="<?= $data_bpjs_kes->flag ?>">
        <input type="hidden" id="bpjs_tk_tunj_jht_perus" name="bpjs_tk_tunj_jht_perus" value="<?= $data_bpjs_tk->tunj_jht_perus ?>">
        <input type="hidden" id="bpjs_tk_pot_jht_kry" name="bpjs_tk_pot_jht_kry" value="<?= $data_bpjs_tk->pot_jht_kry ?>">
        <input type="hidden" id="bpjs_tk_flag_jht" name="bpjs_tk_flag_jht" value="<?= $data_bpjs_tk->flag_jht ?>">
        <input type="hidden" id="bpjs_tk_tunj_jkk" name="bpjs_tk_tunj_jkk" value="<?= $data_bpjs_tk->tunj_jkk ?>">
        <input type="hidden" id="bpjs_tk_flag_jkk" name="bpjs_tk_flag_jkk" value="<?= $data_bpjs_tk->flag_jkk ?>">
        <input type="hidden" id="bpjs_tk_tunj_jkm" name="bpjs_tk_tunj_jkm" value="<?= $data_bpjs_tk->tunj_jkm ?>">
        <input type="hidden" id="bpjs_tk_flag_jkm" name="bpjs_tk_flag_jkm" value="<?= $data_bpjs_tk->flag_jkm ?>">
        <input type="hidden" id="bpjs_tk_tunj_jp_perus" name="bpjs_tk_tunj_jp_perus" value="<?= $data_bpjs_tk->tunj_jp_perus ?>">
        <input type="hidden" id="bpjs_tk_pot_jp_kry" name="bpjs_tk_pot_jp_kry" value="<?= $data_bpjs_tk->pot_jp_kry ?>">
        <input type="hidden" id="bpjs_tk_flag_jp" name="bpjs_tk_flag_jp" value="<?= $data_bpjs_tk->flag_jp ?>">

        <!-- gapok -->
        <input class="d-none nominal_normal" id="gapok" name="gapok" value="<?= isset($data_gapok) ? $data_gapok : 0 ?>"> 
        <input class="d-none nominal_normal" id="tunj_daftar" name="tunj_daftar" value="<?= isset($data_tunj_tetap) ? $data_tunj_tetap : 0 ?>"> 
        <!-- bpjs kesehatan -->
        <input class="d-none nominal" id="bpjs_kes_tunj_perus_rp" name="bpjs_kes_tunj_perus_rp" value="<?= isset($data_bpjs_kes_m) ? $data_bpjs_kes_m->tunj_perus_rp : 0 ?>" <?= $data_bpjs_kes->flag == '0' ? 'disabled' : '' ?>>
        <input class="d-none nominal" id="bpjs_kes_pot_kry_rp" name="bpjs_kes_pot_kry_rp" value="<?= isset($data_bpjs_kes_m) ? $data_bpjs_kes_m->pot_kry_rp : 0 ?>" <?= $data_bpjs_kes->flag == '0' ? 'disabled' : '' ?>>
        <!-- bpjs ketenagakerjaan -->
        <input class="d-none nominal" id="bpjs_tk_tunj_jht_perus_rp" name="bpjs_tk_tunj_jht_perus_rp" value="<?= isset($data_bpjs_tk_m) ? $data_bpjs_tk_m->tunj_jht_perus_rp : 0 ?>" <?= $data_bpjs_tk->flag_jht == '0' ? 'disabled' : '' ?>>
        <input class="d-none nominal" id="bpjs_tk_pot_jht_kry_rp" name="bpjs_tk_pot_jht_kry_rp" value="<?= isset($data_bpjs_tk_m) ? $data_bpjs_tk_m->pot_jht_kry_rp : 0 ?>" <?= $data_bpjs_tk->flag_jht == '0' ? 'disabled' : '' ?>>
        <input class="d-none nominal" id="bpjs_tk_tunj_jkk_rp" name="bpjs_tk_tunj_jkk_rp" value="<?= isset($data_bpjs_tk_m) ? $data_bpjs_tk_m->tunj_jkk_rp : 0 ?>" <?= $data_bpjs_tk->flag_jkk == '0' ? 'disabled' : '' ?>>
        <input class="d-none nominal" id="bpjs_tk_tunj_jkm_rp" name="bpjs_tk_tunj_jkm_rp" value="<?= isset($data_bpjs_tk_m) ? $data_bpjs_tk_m->tunj_jkm_rp : 0 ?>" <?= $data_bpjs_tk->flag_jkm == '0' ? 'disabled' : '' ?>>
        <input class="d-none nominal" id="bpjs_tk_tunj_jp_perus_rp" name="bpjs_tk_tunj_jp_perus_rp" value="<?= isset($data_bpjs_tk_m) ? $data_bpjs_tk_m->tunj_jp_perus_rp : 0 ?>" <?= $data_bpjs_tk->flag_jp == '0' ? 'disabled' : '' ?>>
        <input class="d-none nominal" id="bpjs_tk_pot_jp_kry_rp" name="bpjs_tk_pot_jp_kry_rp" value="<?= isset($data_bpjs_tk_m) ? $data_bpjs_tk_m->pot_jp_kry_rp : 0 ?>" <?= $data_bpjs_tk->flag_jp == '0' ? 'disabled' : '' ?>>
        <!-- total -->
        <input class="d-none nominal" id="ttl_pot_kry" name="ttl_pot_kry" value="<?= isset($data_bpjs_tk_m) ? $data_bpjs_tk_m->ttl_pot_karyawan : 0 ?>"> 
        <input class="d-none nominal" id="ttl_tunj_dibiayai_perus" name="ttl_tunj_dibiayai_perus" value="<?= isset($data_bpjs_tk_m) ? $data_bpjs_tk_m->ttl_tunj_dibiayai_perus : 0 ?>"> 


        <div class="form-group row">
            <label for="karyawan" class="col-sm-3 col-form-label">NAMA KARYAWAN</label>
            <div class="col-sm-3">
                <p class="mt-1"><?= $data_diri->nik.' - '.$data_diri->nama_lengkap ?></p>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-3">GAJI POKOK</div>
            <div class="col-sm-3">
                <p class="nominal_normal_rp" id="gapok_text"><?= isset($data_gapok) ? $data_gapok : 0 ?></p>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-3">TUNJ. YANG DIDAFTARKAN</div>
            <div class="col-sm-3">
                <p class="nominal_normal_rp" id="tunj_daftar_text"><?= isset($data_tunj_tetap) ? $data_tunj_tetap : 0 ?></p>
            </div>
        </div>
        <div class="form-group row">
            <label for="gaji_daftar" class="col-sm-3 col-form-label">GAJI YANG DIDAFTARKAN <i class="text-danger">*</i></label>
            <div class="col-sm-3">
                <input class="form-control nominal_normal" id="gaji_daftar" name="gaji_daftar" value="<?= isset($data_bpjs_tk_m) ? $data_bpjs_tk_m->ttl_gaji_terdaftar : 0 ?>"> 
            </div>
        </div><hr>
        <div class="row">
            <div class="col-md-6">
                <div class="row">
                    <div class="col-md-12">
                        <h4>BPJS KESEHATAN</h4><hr>
                    </div>
                </div>
                <div class="row <?= $data_bpjs_kes->flag == '0' ? 'd-none' : '' ?>">
                    <div class="col-sm-6">
                        NOMOR BPJS KES
                    </div>
                    <div class="col-sm-6">
                        <p id="no_bpjs_kes"></p>
                    </div>
                </div>
                <div class="form-group row <?= $data_bpjs_kes->flag == '0' ? 'd-none' : '' ?>">
                    <label for="jml_anak" class="col-sm-6 col-form-label">JUMLAH ANAK</label>
                    <div class="col-sm-6">
                        <input type="number" class="form-control" id="jml_anak" name="jml_anak" min="0" value="<?= isset($data_bpjs_kes_m) ? $data_bpjs_kes_m->jml_anak : 0 ?>" <?= $data_bpjs_kes->flag == '0' ? 'disabled' : '' ?>>
                    </div>
                </div>
                <div class="row <?= $data_bpjs_kes->flag == '0' ? 'd-none' : '' ?>">
                    <div class="col-sm-6">
                        TUNJ. PERUSAHAAN (<?= $data_bpjs_kes->tunj_perus ?> %)
                    </div>
                    <div class="col-sm-6">
                        <p id="bpjs_kes_tunj_perus_rp_text" class="nominal_text"><?= isset($data_bpjs_kes_m) ? $data_bpjs_kes_m->tunj_perus_rp : 0 ?></p>
                    </div>
                </div>
                <div class="row <?= $data_bpjs_kes->flag == '0' ? 'd-none' : '' ?>">
                    <div class="col-sm-6">
                        POT. KARYAWAN (<?= $data_bpjs_kes->pot_kry ?> %)
                    </div>
                    <div class="col-sm-6">
                        <p id="bpjs_kes_pot_kry_rp_text" class="nominal_text"><?= isset($data_bpjs_kes_m) ? $data_bpjs_kes_m->pot_kry_rp : 0 ?></p>
                    </div>
                </div>
            </div>
            <div class="col-md-6">
                <div class="row">
                    <div class="col-md-12">
                        <h4>BPJS KETENAGAKERJAAN</h4><hr>
                    </div>
                </div>
                <div class="row <?= $data_bpjs_tk->flag_jht == '0' and $data_bpjs_tk->flag_jkk == '0' and $data_bpjs_tk->flag_jkm == '0' and $data_bpjs_tk->flag_jp == '0' ? 'd-none' : '' ?>">
                    <div class="col-sm-6">
                        NOMOR BPJS TK
                    </div>
                    <div class="col-sm-6">
                        <p id="no_bpjs_tk"></p>
                    </div>
                </div>
                <div class="row mt-1 <?= $data_bpjs_tk->flag_jht == '0' ? 'd-none' : '' ?>">
                    <div class="col-sm-6">
                        TUNJ. JHT PERUSAHAAN (<?= $data_bpjs_tk->tunj_jht_perus ?> %)
                    </div>
                    <div class="col-sm-6">
                        <p id="bpjs_tk_tunj_jht_perus_rp_text" class="nominal_text"><?= isset($data_bpjs_tk_m) ? $data_bpjs_tk_m->tunj_jht_perus_rp : 0 ?></p>
                    </div>
                </div>
                <div class="row <?= $data_bpjs_tk->flag_jht == '0' ? 'd-none' : '' ?>">
                    <div class="col-sm-6">
                        POT. JHT KARYAWAN (<?= $data_bpjs_tk->pot_jht_kry ?> %)
                    </div>
                    <div class="col-sm-6">
                        <p id="bpjs_tk_pot_jht_kry_rp_text" class="nominal_text"><?= isset($data_bpjs_tk_m) ? $data_bpjs_tk_m->pot_jht_kry_rp : 0 ?></p>
                    </div>
                </div>
                <div class="row <?= $data_bpjs_tk->flag_jkk == '0' ? 'd-none' : '' ?>">
                    <div class="col-sm-6">
                        TUNJ. JKK (<?= $data_bpjs_tk->tunj_jkk ?> %)
                    </div>
                    <div class="col-sm-6">
                        <p id="bpjs_tk_tunj_jkk_rp_text" class="nominal_text"><?= isset($data_bpjs_tk_m) ? $data_bpjs_tk_m->tunj_jkk_rp : 0 ?></p>
                    </div>
                </div>
                <div class="row <?= $data_bpjs_tk->flag_jkm == '0' ? 'd-none' : '' ?>">
                    <div class="col-sm-6">
                        TUNJ. JKK (<?= $data_bpjs_tk->tunj_jkm ?> %)
                    </div>
                    <div class="col-sm-6">
                        <p id="bpjs_tk_tunj_jkm_rp_text" class="nominal_text"><?= isset($data_bpjs_tk_m) ? $data_bpjs_tk_m->tunj_jkm_rp : 0 ?></p>
                    </div>
                </div>
                <div class="row <?= $data_bpjs_tk->flag_jp == '0' ? 'd-none' : '' ?>">
                    <div class="col-sm-6">
                        TUNJ. JP PERUSAHAAN (<?= $data_bpjs_tk->tunj_jp_perus ?> %)
                    </div>
                    <div class="col-sm-6">
                        <p id="bpjs_tk_tunj_jp_perus_rp_text" class="nominal_text"><?= isset($data_bpjs_tk_m) ? $data_bpjs_tk_m->tunj_jp_perus_rp : 0 ?></p>
                    </div>
                </div>
                <div class="row <?= $data_bpjs_tk->flag_jp == '0' ? 'd-none' : '' ?>">
                    <div class="col-sm-6">
                        POT. JP KARYAWAN (<?= $data_bpjs_tk->pot_jp_kry ?> %)
                    </div>
                    <div class="col-sm-6">
                        <p id="bpjs_tk_pot_jp_kry_rp_text" class="nominal_text"><?= isset($data_bpjs_tk_m) ? $data_bpjs_tk_m->pot_jp_kry_rp : 0 ?></p>
                    </div>
                </div>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                TOTAL POTONGAN KARYAWAN
            </div>
            <div class="col-sm-6">
                <p id="ttl_pot_kry_text" class="nominal_text"><?= isset($data_bpjs_tk_m) ? $data_bpjs_tk_m->ttl_pot_karyawan : 0 ?></p>
            </div>
        </div>
        <div class="row">
            <div class="col-sm-6">
                TOTAL TUNJ. DIBIAYAI PERUSAHAAN
            </div>
            <div class="col-sm-6">
                <p id="ttl_tunj_dibiayai_perus_text" class="nominal_text"><?= isset($data_bpjs_tk_m) ? $data_bpjs_tk_m->ttl_tunj_dibiayai_perus : 0 ?></p>
            </div>
        </div>
    </form>
</div>
<div class="card-footer">
    <div class="row">
        <div class="col-md-7 text-left">
            <div id="message"></div>
        </div>
        <div class="col-md-5 text-right">
            <button id="btn_new_input" class="btn" style="display:none">TAMBAH BARU</button>
            <button class="btn_save ladda-button" data-style="expand-left"></button>
        </div>
    </div><!-- ./row -->
</div>