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

    function informasi_karyawan_disable_form(form, disabled = true) {
        if (form == "tanggungan") {
            $("#" + form + " select").attr("disabled", disabled);
        } else if (form == "npwp") {
            $("#" + form + " input").attr("disabled", disabled);
        }
    }

    function informasi_karyawan_get_value_form(form) {
        if (form == "tanggungan") {
            return $("#" + form + " select").val();
        } else if (form == "npwp") {
            return $("#" + form + " input").val();
        }
    }
</script>
<div>
    <h5 class="text-primary mt-1">Informasi Karyawan</h5>
    <hr>
    <div class="row">
        <div class="col-md-6">
            <div class="form-group">
                <label>Nomor Induk Karyawan</label>
                <p class="font-weight-bold"><?= $data->nik ?: '-' ?></p>
            </div>
        </div>
        <div class="col-md-6">
            <div class="form-group">
                <label>Nama Lengkap</label>
                <p class="font-weight-bold"><?= $data->nama_lengkap ?: '-' ?></p>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-6">
            <div class="form-group">
                <label for="tanggungan">Tanggungan</label>
                <div class="form-inline" id="tanggungan">
                    <span class="font-weight-bold"><?= $data->tanggungan ?: '-' ?></span>
                    <button class="btn btn-link btn-edit" onclick="informasi_karyawan_form_update(this)"><i class="fa fa-edit"></i></button>
                </div>
            </div>
        </div>
    </div>
    <div class="row">
        <div class="col-md-6">
            <div class="form-group">
                <label for="npwp">NPWP</label>
                <div class="form-inline" id="npwp">
                    <span class="font-weight-bold"><?= $data->npwp ?: '-' ?></span>
                    <button class="btn btn-link btn-edit" onclick="informasi_karyawan_form_update(this)"><i class="fa fa-edit"></i></button>
                </div>
            </div>
        </div>
    </div>
</div>
