<?php 

function flag_map($flag) {
    $data = [
        'flag_jht' => ['tunj_jht_perus', 'pot_jht_kry'],
        'flag_jkk' => ['tunj_jkk'],
        'flag_jp' => ['tunj_jp_perus', 'pot_jp_kry'],
        'flag_jkm' => ['tunj_jkm']
    ];
    
    return $data[$flag];
}

function id_map_table($id) {
    $data = [
        'gapok'         => 'payroll_gapok_m',
        'tunjtetap'     => 'payroll_tunj_tetap_m',
        'pottetap'      => 'payroll_pot_tetap_m'
    ];

    return $data[$id];
}

function id_map_title($id) {
    $data = [
        'gapok' => 'Gaji Pokok'
    ];

    return $data[$id];
}

if(!function_exists('cek_empty')) {
    function cek_empty($nominal) {
        if($nominal == '') {
            return 0;
        } else {
            return $nominal;
        }
    }
}