Example #1
0
$no_trail = $_GET['no_trail'];
$_POST['frm']['no_trail'] = $no_trail;
$trailSekarang;
$trailSebelum;
$buf = $db_function->selectOneRows("select * from debitur_trail  where no_rekg_pinjaman='" . $_GET['id'] . "' and no_trail='" . $_GET['no_trail'] . "'");
foreach ($buf as $key => $val) {
    if (!is_int($key)) {
        $trailSekarang[strtolower($key)] = isDateDB($val) ? balikTgl($val) : $val;
    }
}
$usersCreate = $db_function->selectOneRows("select * from pegawai where npp='" . $trailSekarang['userupdate'] . "'");
if ($_GET['no_trail'] > 1) {
    $buf = $db_function->selectOneRows("select * from debitur_trail  where no_rekg_pinjaman='" . $_GET['id'] . "' and no_trail='" . ($_GET['no_trail'] - 1) . "'");
    foreach ($buf as $key => $val) {
        if (!is_int($key)) {
            $trailSebelum[strtolower($key)] = isDateDB($val) ? balikTgl($val) : $val;
        }
    }
}
$cekTrail = new CekTrail($trailSekarang, $trailSebelum);
$buf = $db_function->selectAllRows("select distinct no_trail from debitur_trail  where no_rekg_pinjaman='" . $_GET['id'] . "' order by no_trail asc");
$ListNoTrail = array();
foreach ($buf as $row) {
    $ListNoTrail[$row['no_trail']] = $row['no_trail'];
}
$produk_nm = trim(strtoupper($_POST['frm']["produk"]));
//echo $produk_nm;exit;
if (in_array($produk_nm, array("BNI GRIYA", "BNI OTO", "BNI GRIYA MULTIGUNA", "BNI FLEKSI", "BNI CERDAS", "BNI WIRAUSAHA", "UMG"))) {
    // kalau pilihan nya ada didatabase baru pakek kondisi
    //cuma Griya/Multiguna/BWU yg bisa
    if (in_array($produk_nm, array("BNI GRIYA", "BNI GRIYA MULTIGUNA", "BNI WIRAUSAHA"))) {
$otherLama = "";
$no_polis_ass_kerugianLama = "";
$jenis_kendaraanLama = "";
$merkLama = "";
$asuransi_jiwaLama = "";
$asuransi_kerugianLama = "";
$berkas_asuransi_kerugianLama = "";
$no_polis_ass_jiwaLama = "";
$kendalaLama = "";
$jenis_sertifikatLama = "";
if (empty($_POST)) {
    $buf = $db_function->selectOneRows("select * from debitur where no_rekg_pinjaman='" . $_GET['id'] . "'");
    // print_r($_POST);
    foreach ($buf as $key => $val) {
        if (!is_int($key)) {
            $_POST['frm'][strtolower($key)] = isDateDB($val) ? balikTgl($val) : $val;
        }
    }
    $_POST['frm']['produk'] = strtoupper($_POST['frm']['produk']);
    $produkLama = $_POST['frm']['produk'];
    $programLama = $_POST['frm']['program'];
    $agamaLama = $_POST['frm']['agama'];
    $kelaminLama = $_POST['frm']['kelamin'];
    $skdrLama = $_POST['frm']['skdr'];
    $jaminanLama = $_POST['frm']['jaminan'];
    $proses_agunanLama = $_POST['frm']['proses_agunan'];
    $jenis_surat_tanahLama = $_POST['frm']['jenis_surat_tanah'];
    $no_covernoteLama = $_POST['frm']['no_covernote'];
    $jkw_covernoteLama = $_POST['frm']['jkw_covernote'];
    $status_imbLama = $_POST['frm']['status_imb'];
    $jenis_pengikatanLama = $_POST['frm']['jenis_pengikatan'];