Esempio n. 1
0
         $msg = "Proses upload \"{$file_name}\" berhasil";
     } else {
         $err = $_FILES['data_upload']['error'];
         $msg = "Proses upload eror";
     }
     $query = "\n\t\t\tUPDATE CS_JENIS_PAIJB \n\t\t\tSET \n\t\t\tKODE_JENIS = '{$kode_jenis}',\n\t\t\tNAMA_JENIS = '{$nama_jenis}',\n\t\t\tNAMA_FILE  = '{$nama_file}'\n\t\t\tWHERE\n\t\t\tKODE_JENIS = '{$id}'\n\t\t\t";
     ex_false($conn->execute($query), $query);
     $msg = 'Data Jenis PAIJB berhasil diubah.';
 } elseif ($act == 'Hapus') {
     ex_ha('JB04', 'D');
     $act = array();
     $cb_data = $_REQUEST['cb_data'];
     ex_empty($cb_data, 'Pilih data yang akan dihapus.');
     foreach ($cb_data as $id_del) {
         $query = "SELECT JENIS FROM CS_PPJB WHERE JENIS = '{$id_del}'";
         ex_found($conn->Execute($query)->recordcount(), "Kode \"{$id_del}\" telah terdaftar. Tidak bisa dihapus");
         $select = "SELECT * FROM CS_JENIS_PAIJB WHERE KODE_JENIS = '{$id_del}'";
         $obj = $conn->execute($select);
         $kode_jenis = $obj->fields['KODE_JENIS'];
         $nama_jenis = $obj->fields['NAMA_JENIS'];
         $nama_file = $obj->fields['NAMA_FILE'];
         //delete file
         $path = $folder . $nama_file;
         if (@unlink($path)) {
             $msg = "Deleted file ";
         } else {
             $msg = "File can't be deleted";
         }
         $query = "DELETE FROM CS_JENIS_PAIJB WHERE KODE_JENIS = {$id_del}";
         if ($conn->Execute($query)) {
             $act[] = $id_del;
     ex_false($conn->Execute($query), $query);
     $msg = 'Data persediaan awal berhasil ditambah.';
 } elseif ($act == 'Ubah') {
     ex_ha('M28', 'U');
     ex_empty($no_va, 'Nomor VA harus diisi.');
     ex_empty($kode_blok, 'Kode Blok harus diisi.');
     ex_empty($kode_lokasi, 'Tower harus diisi.');
     ex_empty($kode_unit, 'Jenis unit harus diisi.');
     ex_empty($kode_tipe, 'Tipe harus diisi.');
     ex_empty($kode_penjualan, 'Jenis penjualan harus diisi.');
     if ($kode_blok != $id) {
         $query = "SELECT COUNT(KODE_BLOK) AS TOTAL FROM STOK WHERE KODE_BLOK = '{$kode_blok}'";
         ex_found($conn->Execute($query)->fields['TOTAL'], "Kode blok \"{$kode_blok}\" telah terdaftar.");
     }
     $query = "SELECT * FROM STOK WHERE KODE_BLOK = '{$kode_blok}' AND KODE_UNIT = '{$kode_unit}' AND KODE_DESA = '{$kode_desa}' AND KODE_LOKASI = '{$kode_lokasi}' AND \n\t\t\tKODE_SK_TANAH = '{$kode_sk_tanah}' AND KODE_FAKTOR = '{$kode_faktor}' AND KODE_TIPE = '{$kode_tipe}' AND \n\t\t\tKODE_SK = '{$kode_sk}' AND KODE_PENJUALAN = '{$kode_penjualan}' AND LUAS_TANAH = '{$luas_tanah}' AND \n\t\t\tLUAS_BANGUNAN = '{$luas_bangunan}' AND PPN_TANAH = '{$ppn_tanah}' AND PPN_BANGUNAN = '{$ppn_bangunan}' AND \n\t\t\tDISC_TANAH = '{$disc_tanah}' AND DISC_BANGUNAN = '{$disc_bangunan}' AND CLASS = '{$class}' AND PROGRAM = '{$program}' AND \n\t\t\tSTATUS_GAMBAR_SITEPLAN = '{$status_gambar_siteplan}' AND STATUS_GAMBAR_LAPANGAN = '{$status_gambar_lapangan}' AND \n\t\t\tSTATUS_GAMBAR_GS = '{$status_gambar_gs}'AND NO_VA = '{$no_va}'";
     ex_found($conn->Execute($query)->recordcount(), "Tidak ada data yang berubah.");
     $query = "\n\t\t\tUPDATE STOK \n\t\t\tSET NO_VA = '{$no_va}',\n\t\t\tKODE_BLOK = '{$kode_blok}', \n\t\t\tKODE_UNIT = '{$kode_unit}', \n\t\t\tKODE_LOKASI = '{$kode_lokasi}', \n\t\t\tKODE_TIPE = '{$kode_tipe}', \n\t\t\tKODE_SK = '{$kode_sk}', \n\t\t\tKODE_PENJUALAN = '{$kode_penjualan}', \t\t\t\t\n\t\t\tLUAS_BANGUNAN = '{$luas_bangunan}'\n\t\t\tWHERE\t\t\t\n\t\t\tKODE_BLOK = '{$id}'\n\t\t\t";
     ex_false($conn->Execute($query), $query);
     $query = "\n\t\t\tUPDATE HARGA_SK \n\t\t\tSET \n\t\t\t\tHARGA_CASH_KERAS = '{$harga_cash_keras}',\n\t\t\t\tCB36X = '{$CB36X}',\n\t\t\t\tCB48X = '{$CB48X}',\n\t\t\t\tKPA24X = '{$KPA24X}',\n\t\t\t\tKPA36X = '{$KPA36X}'\n\t\t\tWHERE\n\t\t\t\tKODE_SK = '{$kode_sk}' \n\t\t\t\tAND KODE_BLOK = '{$id}'\n\t\t\t";
     ex_false($conn->Execute($query), $query);
     $msg = 'Data persediaan awal  berhasil diubah.';
 } elseif ($act == 'Hapus') {
     ex_ha('M28', 'D');
     $act = array();
     $cb_data = $_REQUEST['cb_data'];
     ex_empty($cb_data, 'Pilih data yang akan dihapus.');
     foreach ($cb_data as $id_del) {
         if ($conn->Execute("DELETE FROM STOK WHERE KODE_BLOK = '{$id_del}'")) {
             $act[] = $id_del;
         } else {
             $error = TRUE;
Esempio n. 3
0
 ex_mod('M18');
 $conn = conn($sess_db);
 ex_conn($conn);
 $conn->begintrans();
 if ($act == 'Spp') {
     ex_ha('M18', 'I');
     ex_empty($nama, 'Nama pembeli harus diisi.');
     ex_empty($alamat_rumah, 'Alamat rumah harus diisi.');
     ex_empty($identitas, 'Identitas harus diisi.');
     ex_empty($no_identitas, 'No identitas harus diisi.');
     ex_empty($tgl_spp, 'Tanggal SPP harus diisi.');
     ex_empty($koordinator, 'Koordinator harus diisi.');
     ex_empty($jumlah_kpr, 'Jumlah KPR harus diisi.');
     ex_empty($tanda_jadi, 'Tanda jadi harus diisi.');
     $query = "SELECT COUNT(KODE_BLOK) AS TOTAL FROM SPP WHERE KODE_BLOK = '{$kode_blok}'";
     ex_found($conn->Execute($query)->fields['TOTAL'], "Kode blok \"{$kode_blok}\" telah terdaftar.");
     $query = "\n\t\t\tINSERT INTO SPP \n\t\t\t(\t\t\t\t NOMOR_SPP,\n\t\t\t\t\t\t\t KODE_BLOK,\n\t\t\t\t\t\t\t NAMA_PEMBELI,\n\t\t\t\t\t\t\t ALAMAT_RUMAH,\n\t\t\t\t\t\t\t ALAMAT_SURAT,\n\t\t\t\t\t\t\t ALAMAT_NPWP,\n\t\t\t\t\t\t\t ALAMAT_EMAIL,\n\t\t\t\t\t\t\t IDENTITAS,\n\t\t\t\t\t\t\t NO_IDENTITAS,\n\t\t\t\t\t\t\t NPWP,\n\t\t\t\t\t\t\t JENIS_NPWP,\n\t\t\t\t\t\t\t TELP_RUMAH,\n\t\t\t\t\t\t\t TELP_KANTOR,\n\t\t\t\t\t\t\t TELP_LAIN,\n\t\t\t\t\t\t\t KODE_BANK,\n\t\t\t\t\t\t\t TANGGAL_SPP,\n\t\t\t\t\t\t\t KODE_AGEN,\n\t\t\t\t\t\t\t KODE_KOORDINATOR,\n\t\t\t\t\t\t\t JUMLAH_KPR,\n\t\t\t\t\t\t\t STATUS_KOMPENSASI,\n\t\t\t\t\t\t\t TANGGAL_AKAD,\n\t\t\t\t\t\t\t TANDA_JADI,\n\t\t\t\t\t\t\t TANGGAL_TANDA_JADI,\n\t\t\t\t\t\t\t STATUS_SPP,\n\t\t\t\t\t\t\t TANGGAL_PROSES,\n\t\t\t\t\t\t\t SPP_REDISTRIBUSI,\n\t\t\t\t\t\t\t SPP_REDISTRIBUSI_TANGGAL\n\t\t\t\t\t\t\t KETERANGAN,\n\t\t\t\t\t\t\t OTORISASI,\n\t\t\t\t\t\t\t TANGGAL_OTORISASI\n\t\t\t)\n\t\t\tVALUES\n\t\t\t(\n\t\t\t\t\t\t\t '{$no_spp}',\n\t\t\t\t\t\t\t '{$nama}',\n\t\t\t\t\t\t\t '{$alamat_rumah}',\n\t\t\t\t\t\t\t '{$alamat_surat}',\n\t\t\t\t\t\t\t '{$alamat_npwp}',\n\t\t\t\t\t\t\t '{$alamat_email}',\n\t\t\t\t\t\t\t '{$identitas}',\n\t\t\t\t\t\t\t '{$no_identitas}',\n\t\t\t\t\t\t\t '{$npwp}',\n\t\t\t\t\t\t\t '{$jenis_npwp}',\n\t\t\t\t\t\t\t '{$tlp_rumah}',\n\t\t\t\t\t\t\t '{$tlp_kantor}',\n\t\t\t\t\t\t\t '{$tlp_lain}',\n\t\t\t\t\t\t\t '{$bank}',\n\t\t\t\t\t\t\t CONVERT(DATETIME,{$tgl_spp},105),\n\t\t\t\t\t\t\t {$jumlah_kpr},\n\t\t\t\t\t\t\t '{$agen}',\n\t\t\t\t\t\t\t '{$koordinator}',\n\t\t\t\t\t\t\t CONVERT(DATETIME,'{$tgl_akad}',105),\n\t\t\t\t\t\t\t '{$status_kompensasi}',\n\t\t\t\t\t\t\t {$tanda_jadi},\n\t\t\t\t\t\t\t CONVERT(DATETIME,'{$tgl_tanda_jadi}',105),\n\t\t\t\t\t\t\t '{$status_spp}',\n\t\t\t\t\t\t\t CONVERT(DATETIME,'{$tgl_proses}',105),\n\t\t\t\t\t\t\t '{$redistribusi}',\n\t\t\t\t\t\t\t CONVERT(DATETIME,'{$tgl_redistribusi}',105),\n\t\t\t\t\t\t\t '{$keterangan}'\n\t\t\t)\t\t\t\t \t\t\t \n\t\t\t";
     ex_false($conn->execute($query), $query);
     //$query = "
     //UPDATE CS_REGISTER_CUSTOMER_SERVICE SET NOMOR_SPP = '$no_spp'";
     //ex_false($conn->execute($query), $query);
     $msg = "Data SPP berhasil ditambahkan.";
 } elseif ($act == 'Ubah') {
     ex_ha('M18', 'U');
     $query = "\n\t\t\tUPDATE SPP\n\t\t\tSET \n\t\t\t\tNAMA_PEMBELI \t\t= '{$nama}',\n\t\t\t\tTANGGAL_SPP\t\t\t= CONVERT(DATETIME,'{$tgl_spp}',105),\n\t\t\t\tALAMAT_RUMAH \t\t= '{$alamat_rumah}',\n\t\t\t\tALAMAT_SURAT \t\t= '{$alamat_surat}',\n\t\t\t\tALAMAT_NPWP  \t\t= '{$alamat_npwp}',\n\t\t\t\tALAMAT_EMAIL\t \t= '{$email}', \n\t\t\t\tTELP_RUMAH\t\t\t= '{$tlp_rumah}',\n\t\t\t\tTELP_KANTOR\t\t\t= '{$tlp_kantor}',\n\t\t\t\tTELP_LAIN\t\t\t= '{$tlp_lain}',\n\t\t\t\tIDENTITAS\t\t\t= '{$identitas}',\n\t\t\t\tNO_IDENTITAS\t\t= '{$no_identitas}',\n\t\t\t\tNPWP\t\t\t\t= '{$npwp}',\n\t\t\t\tJENIS_NPWP\t\t\t= '{$jenis_npwp}',\n\t\t\t\tKODE_BANK\t\t\t= '{$bank}',\n\t\t\t\tJUMLAH_KPR\t\t\t= '{$jumlah_kpr}',\n\t\t\t\tKODE_AGEN\t\t\t= '{$agen}',\n\t\t\t\tKODE_KOORDINATOR\t= '{$koordinator}',\n\t\t\t\tTANGGAL_AKAD\t\t= CONVERT(DATETIME,'{$tgl_akad}',105),\n\t\t\t\tSTATUS_KOMPENSASI\t= '{$status_kompensasi}',\n\t\t\t\tTANDA_JADI\t\t\t= '{$tanda_jadi}',\n\t\t\t\tTANGGAL_TANDA_JADI\t= CONVERT(DATETIME,'{$tgl_tanda_jadi}',105),\n\t\t\t\tSTATUS_SPP\t\t\t= '{$status_spp}',\n\t\t\t\tTANGGAL_PROSES\t\t= CONVERT(DATETIME,'{$tgl_proses}',105),\n\t\t\t\tSPP_REDISTRIBUSI\t= '{$redistribusi}',\n\t\t\t\tSPP_REDISTRIBUSI_TANGGAL = CONVERT(DATETIME,'{$tgl_redistribusi}',105),\n\t\t\t\tKETERANGAN\t\t\t= '{$keterangan}'\n\t\t\t\t\n\t\t\tWHERE\n\t\t\t\tKODE_BLOK = '{$id}'\n\t\t\t";
     ex_false($conn->execute($query), $query);
     $msg = 'Data SPP berhasil diubah.';
 } elseif ($act == 'Hapus') {
     ex_ha('M18', 'D');
     $act = array();
     $cb_data = $_REQUEST['cb_data'];
     ex_found($conn->Execute($query1)->recordcount(), "Tanggal \"{$tanggal_awal}\" telah terdaftar.");
     if ($tanggal_awal <= $tanggal_akhir) {
         $query = "INSERT INTO CS_HARI_LIBUR (TANGGAL_AWAL, TANGGAL_AKHIR, KETERANGAN)\n\t\t\tVALUES(\n\t\t\t\tCONVERT(DATETIME,'{$tanggal_awal}',105),\n\t\t\t\tCONVERT(DATETIME,'{$tanggal_akhir}',105),\n\t\t\t\t'{$keterangan}'\n\t\t\t)";
         ex_false($conn->execute($query), $query);
         $msg = "Data hari libur berhasil disimpan.";
     } else {
         $msg = "Tanggal awal harus lebih besar dari tanggal akhir.";
     }
 } elseif ($act == 'Ubah') {
     ex_ha('C02', 'U');
     ex_empty($tanggal_awal, 'Tanggal harus diisi.');
     ex_empty($tanggal_akhir, 'Tanggal harus diisi.');
     ex_empty($keterangan, 'Keterangan harus diisi.');
     if ($tanggal_awal != $id) {
         $query = "SELECT TANGGAL_AWAL FROM CS_HARI_LIBUR WHERE TANGGAL_AWAL = CONVERT(DATETIME,'{$tanggal_awal}',105)";
         ex_found($conn->Execute($query)->recordcount(), "Kode \"{$tanggal_awal}\" telah terdaftar.");
     }
     $query = "\n\t\t\tUPDATE CS_HARI_LIBUR \n\t\t\tSET \n\t\t\t\tTANGGAL_AWAL = CONVERT(DATETIME,'{$tanggal_awal}',105),\n\t\t\t\tTANGGAL_AKHIR = CONVERT(DATETIME,'{$tanggal_akhir}',105),\n\t\t\t\tKETERANGAN = '{$keterangan}'\n\t\t\tWHERE\n\t\t\t\tTANGGAL_AWAL = CONVERT(DATETIME,'{$id}',105)\n\t\t\t";
     ex_false($conn->execute($query), $query);
     $msg = 'Data hari libur berhasil diubah.';
 } elseif ($act == 'Hapus') {
     ex_ha('C02', 'D');
     $act = array();
     $cb_data = $_REQUEST['cb_data'];
     ex_empty($cb_data, 'Pilih data yang akan dihapus.');
     foreach ($cb_data as $id_del) {
         $query = "DELETE FROM CS_HARI_LIBUR WHERE TANGGAL_AWAL = CONVERT(DATETIME,'{$id_del}',105)";
         if ($conn->Execute($query)) {
             $act[] = $id_del;
         } else {
             $error = TRUE;
     ex_empty($no_va, 'nomor_va harus diisi.');
     ex_empty($tanggal, 'tanggal harus diisi.');
     ex_empty($nilai, 'nilai harus diisi.');
     $query = "SELECT NOMOR_VA FROM PEMBAYARAN WHERE NOMOR_VA = '{$no_va}'";
     ex_found($conn->Execute($query)->recordcount(), "Nomor_VA \"{$no_va}\" telah terdaftar.");
     $query = "INSERT INTO PEMBAYARAN (NOMOR_VA, TANGGAL, NILAI, STATUS)\n\t\t\tVALUES(\n\t\t\t\t'{$no_va}',\n\t\t\t\tCONVERT(DATETIME,'{$tanggal}',105),\n\t\t\t\t'{$nilai}','0'\n\t\t\t)";
     ex_false($conn->execute($query), $query);
     $msg = "Data virtual account berhasil disimpan.";
 } elseif ($act == 'Ubah') {
     //ex_ha('COF02', 'U');
     ex_empty($no_va, 'nomor_va harus diisi.');
     ex_empty($tanggal, 'tanggal harus diisi.');
     ex_empty($nilai, 'nilai harus diisi.');
     if ($no_va != $id) {
         $query = "SELECT NOMOR_VA FROM PEMBAYARAN WHERE NOMOR_VA = '{$no_va}'";
         ex_found($conn->Execute($query)->recordcount(), "nomor va \"{$no_va}\" telah terdaftar.");
     }
     $query = "\n\t\t\tUPDATE PEMBAYARAN\n\t\t\tSET \n\t\t\t\tNOMOR_VA = '{$no_va}',\n\t\t\t\tTANGGAL = CONVERT(DATETIME,'{$tanggal}',105),\n\t\t\t\tNILAI = '{$nilai}'\n\t\t\tWHERE\n\t\t\t\tNOMOR_VA = {$no_va}\n\t\t\t";
     ex_false($conn->execute($query), $query);
     $msg = 'Data virtual account berhasil diubah.';
 } elseif ($act == 'Hapus') {
     //ex_ha('COF02', 'D');
     $act = array();
     $cb_data = $_REQUEST['cb_data'];
     ex_empty($cb_data, 'Pilih data yang akan dihapus.');
     foreach ($cb_data as $id_del) {
         $query = "DELETE FROM PEMBAYARAN WHERE NOMOR_VA = '{$id_del}'";
         if ($conn->Execute($query)) {
             $act[] = $id_del;
         } else {
             $error = TRUE;
Esempio n. 6
0
             ex_found($conn->Execute($query)->fields['TOTAL'], "Nomor ID \"{$id}\" telah terdaftar.");
         }
         if ($nama != $nm) {
             $query = "SELECT COUNT(NAMA) AS TOTAL FROM CLUB_PERSONAL WHERE NAMA = '{$nama}' AND NOMOR_ID != '{$nomor_id}'";
             ex_found($conn->Execute($query)->fields['TOTAL'], "Nama \"{$nama}\" telah terdaftar.");
         }
         $query = "\n\t\t\tUPDATE CLUB_PERSONAL\n\t\t\tSET NOMOR_ID \t\t\t= '{$nomor_id}',\n\t\t\t\tNAMA\t \t\t\t= '{$nama}',\n\t\t\t\tNOMOR_TELEPON\t \t= '{$no_telp}',\n\t\t\t\tEMAIL\t \t\t\t= '{$email}',\n\t\t\t\tNPWP\t \t\t\t= '{$npwp}',\n\t\t\t\tNOMOR_KARTU_IDENTITAS\t \t= '{$nomor_kartu_identitas}',\n\t\t\t\tALAMAT\t\t\t\t= '{$alamat}',\t\n\t\t\t\tJABATAN_KLUB\t\t= '{$jabatan}'\n\t\t\tWHERE\n\t\t\t\tNOMOR_ID = '{$id}'\n\t\t\t";
         ex_false($conn->Execute($query), $query);
         $msg = 'Data Club personal berhasil diubah.';
     } elseif ($act == 'Hapus') {
         $act = array();
         $cb_data = $_REQUEST['cb_data'];
         ex_empty($cb_data, 'Pilih data yang akan dihapus.');
         foreach ($cb_data as $id_del) {
             $querySrc = "SELECT COUNT(KODE_AGEN) AS TOTAL FROM SPP WHERE KODE_AGEN ='{$id_del}'";
             ex_found($conn->Execute($querySrc)->fields['TOTAL'], "Kode Agen \\'{$id_del}\\' telah terdaftar.");
             echo "querySrc";
             $query = "DELETE FROM CLUB_PERSONAL WHERE NOMOR_ID = {$id_del}";
             if ($conn->Execute($query)) {
                 $act[] = $id_del;
             } else {
                 $error = TRUE;
             }
         }
         $msg = $error ? 'Sebagian data gagal dihapus.' : 'Data agen berhasil dihapus.';
     }
     $conn->committrans();
 } catch (Exception $e) {
     $msg = $e->getmessage();
     $error = TRUE;
     if ($conn) {
Esempio n. 7
0
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    try {
        ex_login();
        ex_app('A01');
        ex_mod('PU05');
        $conn = conn($sess_db);
        ex_conn($conn);
        $conn->begintrans();
        if ($act == 'Edit') {
            ex_ha('PU05', 'U');
            ex_empty($app_id, 'Pilih app.');
            ex_empty($modul_name, 'Modul harus diisi.');
            $ols_modul_name = $conn->Execute("SELECT MODUL_NAME FROM APPLICATION_MODULS WHERE MODUL_ID = '{$id}'")->fields['MODUL_NAME'];
            if ($modul_name != $ols_modul_name) {
                $query = "SELECT COUNT(MODUL_NAME) AS TOTAL FROM APPLICATION_MODULS WHERE MODUL_NAME = '{$modul_name}'";
                ex_found($conn->Execute($query)->fields['TOTAL'], "login id \"{$modul_name}\" telah terdaftar.");
            }
            $query = "\n\t\t\tUPDATE APPLICATION_MODULS \n\t\t\tSET APP_ID = '{$app_id}',\n\t\t\t\tMODUL_NAME = '{$modul_name}'\n\t\t\tWHERE\n\t\t\t\tMODUL_ID = '{$id}'\n\t\t\t";
            ex_false($conn->Execute($query), $query);
            $msg = 'Data modul berhasil diubah.';
        }
        $conn->committrans();
    } catch (Exception $e) {
        $msg = $e->getmessage();
        $error = TRUE;
        if ($conn) {
            $conn->rollbacktrans();
        }
    }
    close($conn);
    $json = array('act' => $act, 'error' => $error, 'msg' => $msg);
 $no_va_ph = trim($no_va_kiri . $nomor_va_kanan);
 ex_empty($tanggal, 'Tanggal harus diisi.');
 ex_empty($harga_hak, 'Harga harus diisi.');
 ex_empty($biaya, 'Biaya harus diisi.');
 ex_empty($masa_bangun, 'Masa bangun harus diisi.');
 ex_empty($pihak_kedua, 'Nama Pembeli Pihak Kedua harus diisi.');
 ex_empty($no_id_hak, 'No. Identitas Pihak Kedua harus diisi.');
 ex_empty($alamat_hak, 'Alamat Pihak Kedua harus diisi.');
 ex_empty($tlp1_hak, 'No. Telp. Pihak Kedua harus diisi.');
 ex_empty($tlp3_hak, 'No. HP Pihak Kedua harus diisi.');
 ex_empty($email_hak, 'Email Pihak Kedua harus diisi.');
 ex_empty($suami_istri_hak, 'Nama Suami/Istri Pihak Kedua harus diisi.');
 ex_empty($no_fax_hak, 'No. Fax Pihak Kedua harus diisi.');
 //cek no ppjb sudah ada atau tidak
 $query = "SELECT * FROM CS_PENGALIHAN_HAK WHERE NO_PPJB_PH = '{$no_ppjb_hak}'";
 ex_found($conn->Execute($query)->recordcount(), "No. PPJB Pengalihan Hak tidak boleh sama.");
 //masukan data ke tabel cs pengalihan hak
 $query = "\n\t\t\t\tINSERT INTO CS_PENGALIHAN_HAK (KODE_BLOK, NO_VA_PH, NO_PPJB_PH, TANGGAL, \n\t\t\t\tPIHAK_PERTAMA, ALAMAT_PIHAK_PERTAMA, NO_ID_PIHAK_PERTAMA, NO_TELP_PIHAK_PERTAMA, NO_HP_PIHAK_PERTAMA, NO_FAX_PIHAK_PERTAMA, EMAIL_PIHAK_PERTAMA, SUAMI_ISTRI,\n\t\t\t\tPIHAK_KEDUA,NPWP, ALAMAT_PIHAK_KEDUA, NO_ID_PIHAK_KEDUA, NO_TELP_PIHAK_KEDUA, NO_HP_PIHAK_KEDUA, NO_FAX_PIHAK_KEDUA, EMAIL_PIHAK_KEDUA, NAMA_SUAMI_ISTRI, \n\t\t\t\tHARGA_AWAL, NO_PPJB_AWAL, TANGGAL_PPJB_AWAL, TANGGAL_PERMOHONAN, TANGGAL_PERSETUJUAN, BIAYA_PENGALIHAN_HAK, MASA_BANGUN, HARGA_PENGALIHAN_HAK, KETERANGAN)\n\t\t\t\tVALUES ('{$kode}','{$no_va_ph}', 'XXX', CONVERT(DATETIME,'{$tanggal}',105), \n\t\t\t\t'{$pihak_pertama}', '{$alamat}', '{$no_id}', '{$tlp1}', '{$tlp3}', '{$no_fax}', '{$email}', '{$suami_istri}',\n\t\t\t\t'{$pihak_kedua}','{$npwp}', '{$alamat_hak}', '{$no_id_hak}', '{$tlp1_hak}', '{$tlp3_hak}', '{$no_fax_hak}', '{$email_hak}', '{$suami_istri_hak}', \n\t\t\t\t{$harga_awal}, '{$no_ppjb_awal}', CONVERT(DATETIME,'{$tanggal_awal}',105), CONVERT(DATETIME,'{$tanggal_permohonan}',105), CONVERT(DATETIME,'{$tanggal_persetujuan}',105), {$biaya}, '{$masa_bangun}', {$harga_hak}, '{$keterangan}')\n\t\t\t\t";
 ex_false($conn->execute($query), $query);
 //ambil no ppjb berdasarkan kode
 $query = "SELECT NO_PPJB_PH FROM CS_PENGALIHAN_HAK WHERE KODE_BLOK = '{$kode}'";
 $obj = $conn->execute($query);
 $no_ppjb_hak = $obj->fields['NO_PPJB_PH'];
 // simpan ke dalam tabel histori
 $query = "\n\t\t\t\tINSERT INTO CS_HISTORY_PENGALIHAN_HAK\n\t\t\t\t([KODE_BLOK]\n\t\t\t\t,[NO_VA_PH]\n\t\t\t\t,[NO_PPJB_PH]\n\t\t\t\t,[TANGGAL]\n\t\t\t\t,[PIHAK_PERTAMA]\n\t\t\t\t,[ALAMAT_PIHAK_PERTAMA]\n\t\t\t\t,[NO_ID_PIHAK_PERTAMA]\n\t\t\t\t,[NO_TELP_PIHAK_PERTAMA]\n\t\t\t\t,[NO_HP_PIHAK_PERTAMA]\n\t\t\t\t,[NO_FAX_PIHAK_PERTAMA]\n\t\t\t\t,[EMAIL_PIHAK_PERTAMA]\n\t\t\t\t,[SUAMI_ISTRI])\n\t\t\t\tVALUES ('{$kode}','{$no_va_ph}', '{$no_ppjb_hak}', CONVERT(DATETIME,'{$tanggal_sekarang}',105), \n\t\t\t\t'{$pihak_pertama}', '{$alamat}', '{$no_id}', '{$tlp1}', '{$tlp3}', '{$no_fax}', '{$email}', '{$suami_istri}')\n\t\t\t\t";
 ex_false($conn->execute($query), $query);
 //update spp dengan data yang baru
 $query = "\n\t\t\t\tUPDATE SPP SET \n\t\t\t\tNOMOR_CUSTOMER = '{$no_va_ph}',\n\t\t\t\tNAMA_PEMBELI = '{$pihak_kedua}',\n\t\t\t\tALAMAT_RUMAH = '{$alamat_hak}',\n\t\t\t\tALAMAT_SURAT = '{$alamat_hak}',\n\t\t\t\tNO_IDENTITAS = '{$no_id_hak}',\n\t\t\t\tNPWP = '{$npwp}',\n\t\t\t\tTELP_RUMAH = '{$tlp1_hak}',\n\t\t\t\tTELP_KANTOR = '',\n\t\t\t\tTELP_LAIN = '{$tlp3_hak}',\n\t\t\t\tALAMAT_EMAIL = '{$email_hak}',\n\t\t\t\tNAMA_SUAMI_ISTRI = '{$suami_istri_hak}',\n\t\t\t\tNO_FAX = '{$no_fax_hak}'\n\t\t\t\tWHERE KODE_BLOK = '{$kode}'\n\t\t\t\t";
 ex_false($conn->execute($query), $query);
 //update STOK dengan data yang baru
 $query = "\n\t\t\t\tUPDATE STOK SET \n\t\t\t\tNO_VA = '{$no_va_ph}'\n\t\t\t\tWHERE KODE_BLOK = '{$kode}'\n\t\t\t\t";
         $harga_bangunan = isset($_REQUEST['harga_bangunan_' . $pola_bayar]) ? to_number($_REQUEST['harga_bangunan_' . $pola_bayar]) : 0;
         if ($harga_bangunan == 0 && $harga_tanah == 0) {
             $data->movenext();
             continue;
         }
         $query = "INSERT INTO DETAIL_POLA_BAYAR(KODE_BLOK, KODE_POLA_BAYAR, HARGA_TANAH, HARGA_BANGUNAN) VALUES \n\t\t\t\t(\n\t\t\t\t\t'{$kode_blok}',\n\t\t\t\t\t'{$pola_bayar}',\n\t\t\t\t\t'{$harga_tanah}',\n\t\t\t\t\t'{$harga_bangunan}'\n\t\t\t\t)";
         ex_false($conn->Execute($query), $query);
         $data->movenext();
     }
     $msg = "Detail Pola Bayar berhasil ditambahkan.";
 } elseif ($act == 'Ubah') {
     ex_ha('M09', 'U');
     ex_empty($kode_blok, 'Kode Blok harus diisi');
     if ($sebelumnya != $pola_bayar) {
         $query = "SELECT COUNT(KODE_BLOK) AS TOTAL FROM DETAIL_POLA_BAYAR WHERE KODE_BLOK = '{$kode_blok}' AND KODE_POLA_BAYAR = '{$pola_bayar}'";
         ex_found($conn->Execute($query)->fields['TOTAL'], "Detail Pola Bayar Sudah Terdaftar");
     }
     $query = "UPDATE DETAIL_POLA_BAYAR SET HARGA_TANAH = '{$harga_tanah}', \n\t\t\t\t\t\t\t\tHARGA_BANGUNAN = '{$harga_bangunan}' ,\n\t\t\t\t\t\t\t\tKODE_POLA_BAYAR = '{$pola_bayar}'\n\t\t\t\t\t\t\t\tWHERE KODE_BLOK = '{$kode_blok}' AND KODE_POLA_BAYAR = '{$sebelumnya}'";
     ex_false($conn->Execute($query), $query);
     $msg = 'Detail Pola Bayar berhasil diupdate.';
 } elseif ($act == 'Hapus') {
     $act = array();
     $cb_data = $_REQUEST['cb_data'];
     ex_empty($cb_data, 'Pilih data yang akan dihapus.');
     foreach ($cb_data as $id_del) {
         $id_del = explode(':', $id_del);
         $query = "DELETE FROM DETAIL_POLA_BAYAR WHERE KODE_BLOK = '{$id_del['0']}' AND KODE_POLA_BAYAR ='{$id_del['1']}'  ";
         if ($conn->Execute($query)) {
             $act[] = $id_del;
         } else {
             $error = TRUE;
     ex_mod('M29');
     $conn = conn($sess_db);
     ex_conn($conn);
     $conn->begintrans();
     if ($act == 'Reserve') {
         ex_ha('M29', 'I');
         ex_empty($nama_calon_pembeli, 'Nama calon pembeli harus diisi.');
         //ex_empty($tanggal_reserve, 'Tanggal reserve harus diisi.');
         //ex_empty($berlaku_sampai, 'Tanggal berlaku sampai harus diisi.');
         ex_empty($alamat, 'Alamat harus diisi.');
         ex_empty($telepon, 'No Telepon harus diisi.');
         //ex_empty($agen, 'Agen harus diisi.');
         ex_empty($no_ktp, 'Identitas KTP harus diisi.');
         ex_empty($koordinator, 'Koordinator harus diisi.');
         $query = "SELECT COUNT(KODE_BLOK) AS TOTAL FROM RESERVE WHERE KODE_BLOK = '{$id}'";
         ex_found($conn->Execute($query)->fields['TOTAL'], "Kode blok \\'{$id}\\' telah terdaftar.");
         $query = "\n\t\t\tINSERT INTO RESERVE\n\t\t\t(\n\t\t\t\tKODE_BLOK, NAMA_CALON_PEMBELI, TANGGAL_RESERVE, BERLAKU_SAMPAI, \n\t\t\t\tALAMAT, TELEPON, AGEN, KOORDINATOR, NO_IDENTITAS, NPWP\n\t\t\t)\n\t\t\tVALUES\n\t\t\t(\n\t\t\t\t'{$id}', '{$nama_calon_pembeli}', CONVERT(DATETIME,'{$tanggal_reserve}',105), \n\t\t\t\tCONVERT(DATETIME,'{$berlaku_sampai}',105), '{$alamat}', '{$telepon}', '{$agen}', '{$koordinator}', '{$no_ktp}', '{$no_npwp}'\n\t\t\t)\n\t\t\t";
         ex_false($conn->Execute($query), $query);
         $query = "\n\t\t\tUPDATE STOK SET\n\t\t\t\tTERJUAL = '1' \n\t\t\tWHERE \n\t\t\t\tKODE_BLOK = '{$id}'\n\t\t\t";
         ex_false($conn->Execute($query), $query);
         $msg = "Blok \\'{$id}\\' berhasil direserve.";
     }
     $conn->committrans();
 } catch (Exception $e) {
     $msg = $e->getmessage();
     $error = TRUE;
     if ($conn) {
         $conn->rollbacktrans();
     }
 }
 close($conn);
                 $jumlah = intval($tanda_jadi);
             }
             $keterangan = 'Pembayaran TANDA JADI atas pembelian ' . $bangunan . ' di ' . $lokasi . ' Blok ' . $kode_blok . '(TYPE ' . $tipe . ')' . ' nilai : Rp. ' . to_money($jumlah) . ',-' . ' PPN : Rp. ' . to_money($ppn) . ',-';
             $query = "SELECT COUNT(KODE_BLOK) AS TOTAL FROM KWITANSI_TANDA_TERIMA WHERE KODE_BLOK = '{$kode_blok}' AND STATUS_KWT = '1'";
             $total = $conn->Execute($query)->fields['TOTAL'];
             ex_found($total, "Kwitansi Sudah Ada");
             $query2 = "\n\t\t\t\t\tINSERT INTO KWITANSI (\n\t\t\t\t\t\tKODE_BLOK, NOMOR_KWITANSI, NAMA_PEMBAYAR, TANGGAL, KODE_BAYAR, NILAI, KETERANGAN, NILAI_DIPOSTING, TANGGAL_BAYAR, BAYAR_VIA, CATATAN, PPN, NILAI_NETT, VER_COLLECTION, VER_KEUANGAN, STATUS_KWT, VER_COLLECTION_OFFICER, VER_COLLECTION_TANGGAL, NOMOR_TANDA_TERIMA\n\t\t\t\t\t)\n\t\t\t\t\tVALUES(\n\t\t\t\t\t\t'{$kode_blok}', 'XXX', '{$nama_pembayar}', CONVERT(DATETIME,'{$tanggal}',105), '{$pembayaran}', {$jumlah}, '{$keterangan}', {$jumlah}, CONVERT(DATETIME,'{$tanggal}',105), '{$bank}', '{$catatan}', {$ppn}, {$subtotal}, '1', '0', '0','{$user}', CONVERT(DATETIME,GETDATE(),105), '{$id}'\n\t\t\t\t\t)\n\t\t\t\t";
             ex_false($conn->execute($query2), $query2);
             $query2 = "\n\t\t\t\t\tINSERT INTO FAKTUR_PAJAK (\n\t\t\t\t\t\tKODE_BLOK, NO_KWITANSI, NAMA, ALAMAT_1, NPWP, JENIS, TGL_FAKTUR, KETERANGAN, NILAI, NILAI_DASAR_PENGENAAN, NILAI_PPN\n\t\t\t\t\t)\n\t\t\t\t\tVALUES(\n\t\t\t\t\t\t'{$kode_blok}', 'XXX', '{$nama_pembayar}', '{$alamat_1}', '{$npwp}', '{$jenis}', CONVERT(DATETIME,'{$tanggal}',105), '{$keterangan}', {$jumlah}, {$subtotal}, {$ppn}\n\t\t\t\t\t)\n\t\t\t\t";
             ex_false($conn->execute($query2), $query2);
             $query2 = "\n\t\t\t\t\tUPDATE KWITANSI_TANDA_TERIMA SET STATUS_KWT = '1' WHERE NOMOR_KWITANSI = '{$id}';\n\t\t\t\t";
             ex_false($conn->execute($query2), $query2);
         } else {
             if ($grup == '2') {
                 $total = $conn->Execute("SELECT COUNT(KODE_BLOK) AS TOTAL FROM KWITANSI_LAIN_LAIN WHERE NOMOR_KWITANSI = '{$id}' ")->fields['TOTAL'];
                 ex_found($total, "Kwitansi Sudah Ada");
                 $keterangan = 'Pembayaran ' . $pembayaran . ' atas pembelian ' . $bangunan . ' di ' . $lokasi . ' Blok ' . $kode_blok . ' (TYPE ' . $tipe . ')';
                 $query2 = "\n\t\t\t\tINSERT INTO KWITANSI_LAIN_LAIN (\n\t\t\t\t\tKODE_BLOK, NOMOR_KWITANSI, NAMA_PEMBAYAR, TANGGAL, NILAI, KETERANGAN, KODE_PEMBAYARAN, NILAI_DIPOSTING, TANGGAL_BAYAR, BAYAR_VIA, CATATAN, VER_COLLECTION, VER_KEUANGAN, STATUS_KWT, VER_COLLECTION_OFFICER, VER_COLLECTION_TANGGAL, NOMOR_TANDA_TERIMA\n\t\t\t\t)\n\t\t\t\tVALUES(\n\t\t\t\t\t'{$kode_blok}', 'XXX', '{$nama_pembayar}', CONVERT(DATETIME,'{$tanggal}',105), {$jumlah}, '{$keterangan}', '{$bayar_secara}', {$jumlah}, CONVERT(DATETIME,'{$tanggal}',105), '', '{$catatan}', '1', '0', '0','{$user}', CONVERT(DATETIME,GETDATE(),105), '{$id}'\n\t\t\t\t)\n\t\t\t\t";
                 ex_false($conn->execute($query2), $query2);
                 $query2 = "\n\t\t\t\t\tUPDATE KWITANSI_TANDA_TERIMA SET STATUS_KWT = '1' WHERE NOMOR_KWITANSI = '{$id}';\n\t\t\t\t";
                 ex_false($conn->execute($query2), $query2);
                 $obj->movenext();
             }
         }
         $msg = 'Kwitansi Berhasil dibuat.' . $kata;
     }
     $conn->committrans();
 } catch (Exception $e) {
     $msg = $e->getmessage();
     $error = TRUE;
     if ($conn) {
         if ($faktor_strategis != $nm) {
             $query = "SELECT COUNT(FAKTOR_STRATEGIS) AS TOTAL FROM FAKTOR WHERE FAKTOR_STRATEGIS = '{$faktor_strategis}'";
             ex_found($conn->Execute($query)->fields['TOTAL'], "Nama faktor strategis \"{$faktor_strategis}\" telah terdaftar.");
         }
         $query = "SELECT * FROM FAKTOR WHERE KODE_FAKTOR = '{$kode_faktor}' AND FAKTOR_STRATEGIS = '{$faktor_strategis}' AND\n\t\t\tNILAI_TAMBAH = '{$nilai_tambah}' AND NILAI_KURANG = '{$nilai_kurang}' AND STATUS = '{$status}'";
         ex_found($conn->Execute($query)->recordcount(), "Tidak ada data yang berubah.");
         $query = "\n\t\t\tUPDATE FAKTOR \n\t\t\tSET KODE_FAKTOR = '{$kode_faktor}',\n\t\t\t\tFAKTOR_STRATEGIS = '{$faktor_strategis}',\n\t\t\t\tNILAI_TAMBAH = '{$nilai_tambah}',\n\t\t\t\tNILAI_KURANG = '{$nilai_kurang}',\n\t\t\t\tSTATUS = '{$status}'\n\t\t\tWHERE\n\t\t\t\tKODE_FAKTOR = '{$id}'\n\t\t\t";
         ex_false($conn->Execute($query), $query);
         $msg = 'Data faktor strategis berhasil diubah.';
     } elseif ($act == 'Hapus') {
         $act = array();
         $cb_data = $_REQUEST['cb_data'];
         ex_empty($cb_data, 'Pilih data yang akan dihapus.');
         foreach ($cb_data as $id_del) {
             $querySrc = "SELECT COUNT(KODE_FAKTOR) AS TOTAL FROM stok WHERE KODE_FAKTOR ='{$id_del}'";
             ex_found($conn->Execute($querySrc)->fields['TOTAL'], "Kode Faktor Strategis \\'{$id_del}\\' telah terdaftar.");
             echo "querySrc";
             $query = "DELETE FROM FAKTOR WHERE KODE_FAKTOR = {$id_del}";
             if ($conn->Execute($query)) {
                 $act[] = $id_del;
             } else {
                 $error = TRUE;
             }
         }
         $msg = $error ? 'Sebagian data gagal dihapus.' : 'Data Faktor Strategis berhasil dihapus.';
     }
     $conn->committrans();
 } catch (Exception $e) {
     $msg = $e->getmessage();
     $error = TRUE;
     if ($conn) {
Esempio n. 13
0
 if ($act == 'Tambah') {
     ex_ha('JB01', 'I');
     ex_empty($kode_kelurahan, 'Kode harus diisi.');
     ex_empty($nama_kelurahan, 'Nama harus diisi.');
     $query = "SELECT KODE_KELURAHAN FROM KELURAHAN WHERE KODE_KELURAHAN = '{$kode_kelurahan}'";
     ex_found($conn->Execute($query)->recordcount(), "Kode \"{$kode_kelurahan}\" telah terdaftar.");
     $query = "INSERT INTO KELURAHAN (KODE_KELURAHAN, NAMA_KELURAHAN)\n\t\t\tVALUES(\n\t\t\t\t'{$kode_kelurahan}',\n\t\t\t\t'{$nama_kelurahan}'\n\t\t\t)";
     ex_false($conn->execute($query), $query);
     $msg = "Data Kelurahan \"{$nama_kelurahan}\" berhasil disimpan.";
 } elseif ($act == 'Ubah') {
     ex_ha('JB01', 'U');
     ex_empty($kode_kelurahan, 'Kode harus diisi.');
     ex_empty($nama_kelurahan, 'Nama harus diisi.');
     if ($kode_kelurahan != $id) {
         $query = "SELECT KODE_KELURAHAN FROM KELURAHAN WHERE KODE_KELURAHAN = '{$kode_kelurahan}'";
         ex_found($conn->Execute($query)->recordcount(), "Kode \"{$kode_kelurahan}\" telah terdaftar.");
     }
     $query = "\n\t\t\tUPDATE KELURAHAN \n\t\t\tSET \n\t\t\t\tKODE_KELURAHAN = '{$kode_kelurahan}',\n\t\t\t\tNAMA_KELURAHAN = '{$nama_kelurahan}'\n\t\t\tWHERE\n\t\t\t\tKODE_KELURAHAN = '{$id}'\n\t\t\t";
     ex_false($conn->execute($query), $query);
     $msg = 'Data Kelurahan berhasil diubah.';
 } elseif ($act == 'Hapus') {
     ex_ha('JB01', 'D');
     $act = array();
     $cb_data = $_REQUEST['cb_data'];
     ex_empty($cb_data, 'Pilih data yang akan dihapus.');
     foreach ($cb_data as $id_del) {
         $query = "DELETE FROM KELURAHAN WHERE KODE_KELURAHAN = {$id_del}";
         if ($conn->Execute($query)) {
             $act[] = $id_del;
         } else {
             $error = TRUE;
Esempio n. 14
0
             $query = "SELECT COUNT(KODE_SK) AS TOTAL FROM HARGA_TANAH WHERE KODE_SK = '{$kode_sk}'";
             ex_found($conn->Execute($query)->fields['TOTAL'], "Kode sk \"{$kode_sk}\" telah terdaftar.");
         }
         //
         $query = "SELECT * FROM HARGA_TANAH WHERE KODE_SK = '{$kode_sk}' AND KODE_LOKASI = '{$kode_lokasi}' AND HARGA_TANAH = '{$harga_tanah}' AND TANGGAL = CONVERT(DATETIME,'{$tanggal}',105) AND STATUS = '{$status}'";
         ex_found($conn->Execute($query)->recordcount(), "Tidak ada data yang berubah.");
         $query = "\n\t\t\tUPDATE HARGA_TANAH \n\t\t\tSET KODE_SK = '{$kode_sk}',\n\t\t\t\tKODE_LOKASI = '{$kode_lokasi}',\n\t\t\t\tHARGA_TANAH = '{$harga_tanah}',\n\t\t\t\tTANGGAL = CONVERT(DATETIME,'{$tanggal}',105),\n\t\t\t\tSTATUS = '{$status}'\n\t\t\tWHERE\n\t\t\t\tKODE_SK = '{$id}'\n\t\t\t";
         ex_false($conn->Execute($query), $query);
         $msg = 'Data harga tanah berhasil diubah.';
     } elseif ($act == 'Hapus') {
         $act = array();
         $cb_data = $_REQUEST['cb_data'];
         ex_empty($cb_data, 'Pilih data yang akan dihapus.');
         foreach ($cb_data as $id_del) {
             $querySrc = "SELECT COUNT(KODE_SK_TANAH) AS TOTAL FROM stok WHERE KODE_SK_TANAH ='{$id_del}'";
             ex_found($conn->Execute($querySrc)->fields['TOTAL'], "Harga Tanah \\'{$id_del}\\' telah terdaftar.");
             echo "querySrc";
             $query = "DELETE FROM HARGA_TANAH WHERE KODE_SK = {$id_del}";
             if ($conn->Execute($query)) {
                 $act[] = $id_del;
             } else {
                 $error = TRUE;
             }
         }
         $msg = $error ? 'Sebagian data gagal dihapus.' : 'Data Harga Tanah berhasil dihapus.';
     }
     $conn->committrans();
 } catch (Exception $e) {
     $msg = $e->getmessage();
     $error = TRUE;
     if ($conn) {
         }
         $query = "SELECT * FROM HARGA_SK WHERE KODE_SK = '{$kode_sk}' AND kode_blok = '{$kode_blok}' AND HARGA_CASH_KERAS = '{$cash_keras}' AND CB48X = '{$cb48x}' AND CB36X = '{$cb36x}' AND KPA36X = '{$kpa36x}' AND KPA24X = '{$kpa24x}' AND TANGGAL = CONVERT(DATETIME,'{$tanggal}',105) AND STATUS = '{$status}'";
         ex_found($conn->Execute($query)->recordcount(), "Tidak ada data yang berubah.");
         $query = "\n\t\t\tUPDATE HARGA_SK \n\t\t\tSET \n\t\t\t\tHARGA_CASH_KERAS = '{$cash_keras}',\n\t\t\t\tCB12X = '{$cb12x}',\n\t\t\t\tCB24X = '{$cb24x}',\n\t\t\t\tCB36X = '{$cb36x}',\n\t\t\t\tCB48X = '{$cb48x}',\n\t\t\t\tKPA24X = '{$kpa24x}',\n\t\t\t\tKPA36X = '{$kpa36x}',\n\t\t\t\tTANGGAL = CONVERT(DATETIME,'{$tanggal}',105),\n\t\t\t\tSTATUS = '{$status}'\n\t\t\tWHERE\n\t\t\t\tKODE_SK = '{$id}' \n\t\t\t\tAND KODE_BLOK = '{$kode_blok}'\n\t\t\t";
         ex_false($conn->Execute($query), $query);
         $msg = 'Data harga sk berhasil diubah.';
     } elseif ($act == 'Hapus') {
         $act = array();
         // $cb_data = $_REQUEST['cb_data'];
         // ex_empty($cb_data, 'Pilih data yang akan dihapus.');
         foreach ($cb_data as $id_del) {
             list($x, $y) = explode("X", $id_del);
             $kode_sk = $x;
             $kode_blok = $y;
             $querySrc = "SELECT COUNT(KODE_SK) AS TOTAL FROM stok WHERE KODE_SK ='{$kode_sk}' AND KODE_BLOK='{$kode_blok}'";
             ex_found($conn->Execute($querySrc)->fields['TOTAL'], "Kode SK \\'{$kode_sk}\\' dengan blok \\'{$kode_blok}\\' telah terdaftar di stok.");
             echo "querySrc";
             $query = "DELETE FROM HARGA_SK WHERE KODE_SK = '{$kode_sk}' AND KODE_BLOK='{$kode_blok}'";
             if ($conn->Execute($query)) {
                 $act[] = $kode_sk;
             } else {
                 $error = TRUE;
             }
         }
         $msg = $error ? 'Sebagian data gagal dihapus.' : 'Data harga sk berhasil dihapus.';
     }
     $conn->committrans();
 } catch (Exception $e) {
     $msg = $e->getmessage();
     $error = TRUE;
     if ($conn) {