<script type="text/javascript">
    function resetCheckbox(e) {
        const name = e.name;
        if (e.checked == true) {
            if (name == 'tambahSaldo') {
                $('#kurangSaldo').prop('checked', false);
            } else {
                $('#tambahSaldo').prop('checked', false);
            }
        } else {
            if (name == 'tambahSaldo') {
                $('#tambahSaldo').prop('checked', true);
            } else {
                $('#kurangSaldo').prop('checked', true);
            }
        }
    }
</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 id="form_tambah" class="card-body" disabled>
    <div class="form-group">
        <div class="row">
            <div class="col-md-6">
                <input type="checkbox" name="tambahSaldo" id="tambahSaldo" onclick="resetCheckbox(this)" checked=true>
                <label for="tambahSaldo" class="mr-4"><?= $this->lang->line('button_tambah_saldo_cuti') ?></label>
            </div>
            <div class="col-md-6">
                <input type="checkbox" name="kurangSaldo" id="kurangSaldo" onclick="resetCheckbox(this)">
                <label for="kurangSaldo"><?= $this->lang->line('button_kurang_saldo_cuti') ?></label><br>
            </div>
        </div>
        <label for="saldo"><?= $this->lang->line('jml_saldo') ?> <span class="text-danger">*</span></label>
        <input type="number" id="saldo" class="form-control" oninput="validity.valid||(value='')" step="1">
    </div>

    <div class="form-group">
        <label for="keterangan"><?= $this->lang->line('keterangan') ?> <span class="text-danger">*</span></label>
        <input type="text" name="keterangan" id="keterangan" class="form-control">
    </div>
</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"><?= $this->lang->line('button_form_tambah_baru') ?></button>
            <button class="btn_save ladda-button" data-style="expand-left"></button>
        </div>
    </div><!-- ./row -->
</div>
