<div class="modal fade" id="tambahTransaksi" tabindex="-1" role="dialog" aria-labelledby="tambahTransaksiTitle"
    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="tambahTransaksiTitle">
                    Salery Karyawan
                </h5>
                <button type="button" class="close" data-dismiss="modal" aria-label="Close">
                    <span aria-hidden="true">&times;</span>
                </button>
            </div>
            <div class="modal-body" id="detail_body">
                <?php echo form_open_multipart('keuangan/salery/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 for="">Pilih Karyawan</label>
                    <select class="form-control" id="login_id" name="login_id" required>
                        <?php foreach ($data_karyawan as $Karyawan_aktif) : ?>
                        <option value="<?= $Karyawan_aktif->karyawan_id ?>"><?= $Karyawan_aktif->nm_panggilan ?> -
                            <?= $Karyawan_aktif->role_level ?></option>
                        <?php
                        endforeach; ?>
                    </select>
                </div>
                <div class="form-row mb-4">
                    <div class="col">
                        <label for="">Bulan</label>
                        <select class="form-control" id="bulan_transaksi" name="bulan_transaksi" required>
                            <option value="PILIH">Bulan Periode</option>
                            <option value="01">Januari</option>
                            <option value="02">Febuari</option>
                            <option value="03">Maret</option>
                            <option value="04">April</option>
                            <option value="05">Mei</option>
                            <option value="06">Juni</option>
                            <option value="07">Juli</option>
                            <option value="08">Agustus</option>
                            <option value="09">September</option>
                            <option value="10">Oktober</option>
                            <option value="11">November</option>
                            <option value="12">Desember</option>
                        </select>
                    </div>
                    <div class="col">
                        <label for="">Tahun</label>
                        <select class="form-control" id="tahun_transaksi" name="tahun_transaksi" required>
                            <?php foreach ($tampil_tahun as $Tampil_tahun) : ?>
                            <option value="<?= $Tampil_tahun->tahun_nota_tersedia ?>">
                                <?= $Tampil_tahun->tahun_nota_tersedia ?></option>
                            <?php endforeach; ?>
                        </select>
                    </div>
                </div>
                <div class="form-group">
                    <label>Total Kerja</label>
                    <input type="text" class="form-control" id="total_kerja" name="total_kerja"
                        placeholder="Pekerjaan Anggota Arisan" required>
                    <small>*Total kerja adalah lama bekerja sebulan dalam hitungan menit</small>
                </div>
                <div class="form-group">
                    <label for="">Status Gaji Pokok</label>
                    <select class="form-control" id="gaji_pokok" onchange="gajiPokok(this)" name="gaji_pokok" required>
                        <option value="1">Gaji Pokok Lama</option>
                        <option value="2">Gaji Pokok Baru</option>
                    </select>
                </div>
                <div class="form-group" id="select_gaji_pokok" style="display:none">
                    <label>Gaji Pokok Baru</label>
                    <input type="text" class="form-control" id="gaji_pokok_baru" name="gaji_pokok_baru"
                        placeholder="Masukkan Gaji Pokok Baru Karyawan">
                </div>
                <div class="form-group">
                    <label for="">Metode Pembayaran</label>
                    <select class="form-control" id="metode_bayar" name="metode_bayar" required>
                        <option value="TRANSFER">Transfer</option>
                        <option value="TUNAI">Tunai</option>
                    </select>
                </div>
            </div>
            <div class="modal-footer">
                <button type="button" class="btn btn-outline-primary" data-dismiss="modal">
                    Close
                </button>
                <button type="submit" id="simpanTransaksiBaru" name="simpanTransaksiBaru"
                    class="btn btn-primary">Simpan</button>
            </div>
            <?php echo form_close(); ?>
        </div>
    </div>
</div>
<script>
function showDiv(select) {
    if (select.value == 'PILIH') {
        $("#select_penggunaan_dana").hide();
    }
    if (select.value == 'KELUAR') {
        $("#select_penggunaan_dana").show();
    }
    if (select.value == 'MASUK') {
        $("#select_penggunaan_dana").hide();
    }
}
</script>
<script>
function gajiPokok(select) {
    if (select.value == 1) {
        $("#select_gaji_pokok").hide();
    }
    if (select.value == 2) {
        $("#select_gaji_pokok").show();
    }
}
</script>