<script>
    function informasi_lembur_form_update(element) {
        const column = $(element).closest('div').attr('id');
        $("#" + column).load("<?= route('master.karyawan.payroll.informasi_lembur.form', ['column' => '" + column + "', 'id_karyawan' => $id_karyawan]) ?>");
    }

    function informasi_lembur_disable_form(form, disabled = true) {
        $("#" + form + " select").attr("disabled", disabled);
    }

    function informasi_lembur_get_value_form(form) {
        return $("#" + form + " select").val();
    }
</script>
<div>
    <h5 class="text-primary mt-1">Informasi Lembur</h5>
    <hr>
    <div class="row">
        <div class="col-md-3">
            <div class="form-group">
                <label for="lembur_hari_kerja">Hari Kerja</label>
                <div id="lembur_hari_kerja" class="form-inline">
                    <span class="font-weight-bold"><?= ($aturan_lembur['lembur_hari_kerja']['kode'] ?: '-') ?></span>
                    <button class="btn btn-link" onclick="informasi_lembur_form_update(this)"><i class="fa fa-edit"></i></button>
                </div>
            </div>
        </div>
        <div class="col-md-3">
            <div class="form-group">
                <label for="lembur_libur_off">Libur</label>
                <div id="lembur_libur_off" class="form-inline">
                    <span class="font-weight-bold"><?= ($aturan_lembur['lembur_libur_off']['kode'] ?: '-') ?></span>
                    <button class="btn btn-link" onclick="informasi_lembur_form_update(this)"><i class="fa fa-edit"></i></button>
                </div>
            </div>
        </div>
        <div class="col-md-3">
            <div class="form-group">
                <label for="lembur_libur_nasional">Libur Nasional</label>
                <div id="lembur_libur_nasional" class="form-inline">
                    <span class="font-weight-bold"><?= ($aturan_lembur['lembur_libur_nasional']['kode'] ?: '-') ?></span>
                    <button class="btn btn-link" onclick="informasi_lembur_form_update(this)"><i class="fa fa-edit"></i></button>
                </div>
            </div>
        </div>
        <div class="col-md-3">
            <div class="form-group">
                <label for="lembur_libur_khusus">Libur Khusus</label>
                <div id="lembur_libur_khusus" class="form-inline">
                    <span class="font-weight-bold"><?= ($aturan_lembur['lembur_libur_khusus']['kode'] ?: '-') ?></span>
                    <button class="btn btn-link" onclick="informasi_lembur_form_update(this)"><i class="fa fa-edit"></i></button>
                </div>
            </div>
        </div>
    </div>
</div>
