$obj = $conn->execute($query);
                         $banyak = $obj->fields['NILAI'];
                         $query = "DELETE FROM KWITANSI_LAIN_LAIN WHERE NOMOR_KWITANSI = '{$id_del}'";
                         if ($conn->Execute($query)) {
                             $act[] = $id_del;
                         } else {
                             $error = TRUE;
                         }
                     }
                 }
                 $query = "update CS_VIRTUAL_ACCOUNT set SISA = SISA + '{$banyak}' where NOMOR_VA = '{$nomor_customer}' AND TANGGAL = '{$max_tgl}'";
                 ex_false($conn->execute($query), $query);
             }
             $msg = $error ? 'Sebagian data gagal dihapus.' : 'Data Kuitansi berhasil dihapus.';
         } elseif ($act == 'Pindah') {
             ex_ha('C03', 'U');
             ex_empty($blok_baru, 'Blok baru harus diisi.');
             $query = "\n\t\t\tUPDATE KWITANSI \n\t\t\tSET\n\t\t\t\tKODE_BLOK = '{$blok_baru}', \n\t\t\t\tSTATUS_PINDAH_BLOK = '1'\n\t\t\tWHERE\n\t\t\t\tKODE_BLOK = '{$id}'\n\t\t\t";
             ex_false($conn->execute($query), $query);
             $query = "\n\t\t\tUPDATE KWITANSI_LAIN_LAIN\n\t\t\tSET\n\t\t\t\tKODE_BLOK = '{$blok_baru}'\n\t\t\tWHERE\n\t\t\t\tKODE_BLOK = '{$id}'\n\t\t\t";
             ex_false($conn->execute($query), $query);
             $msg = 'Blok berhasil dipindahkan.';
         }
     }
     $conn->committrans();
 } catch (Exception $e) {
     $msg = $e->getmessage();
     $error = TRUE;
     if ($conn) {
         $conn->rollbacktrans();
     }
Example #2
0
     }
     $query = "SELECT * FROM CS_JENIS_PAIJB WHERE KODE_JENIS = '{$kode_jenis}' AND NAMA_JENIS = '{$nama_jenis}' AND NAMA_FILE = '{$nama_file}'";
     ex_found($conn->Execute($query)->recordcount(), "Tidak ada data yang berubah.");
     //ubah file
     if (move_uploaded_file($_FILES['data_upload']['tmp_name'], $folder . $file_name)) {
         //catat nama file ke database
         $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 ";
$act = isset($_REQUEST['act']) ? clean($_REQUEST['act']) : '';
$id = isset($_REQUEST['id']) ? clean($_REQUEST['id']) : '';
$kode_faktor = isset($_REQUEST['kode_faktor']) ? to_number($_REQUEST['kode_faktor']) : '';
$faktor_strategis = isset($_REQUEST['faktor_strategis']) ? clean($_REQUEST['faktor_strategis']) : '';
$nilai_tambah = isset($_REQUEST['nilai_tambah']) ? to_decimal($_REQUEST['nilai_tambah']) : '';
$nilai_kurang = isset($_REQUEST['nilai_kurang']) ? to_decimal($_REQUEST['nilai_kurang']) : '';
$status = isset($_REQUEST['status']) ? to_number($_REQUEST['status']) : '0';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    try {
        ex_login();
        ex_app('M');
        ex_mod('M05');
        $conn = conn($sess_db);
        ex_conn($conn);
        $conn->begintrans();
        ex_ha('PM03', '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 FAKTOR WHERE KODE_FAKTOR = '{$id_del}'")) {
                $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;
             ex_empty($cb_data, 'Pilih data yang akan dihapus.');
             foreach ($cb_data as $id_del) {
                 if ($id_del == 9) {
                     $msg = 'Maaf Tagihan denda tidak bisa dihapus';
                 } else {
                     $query = "DELETE FROM TAGIHAN_LAIN_LAIN WHERE TANGGAL >= CONVERT(DATETIME,'01-{$bln}-{$thn}',105)\n\t\t\t\t\tAND TANGGAL < CONVERT(DATETIME,'01-{$next_bln}-{$next_thn}',105)\t\t\t\t\n\t\t\t\t\tAND KODE_BAYAR = {$id_del} AND KODE_BLOK = '{$kode}'";
                     if ($conn->Execute($query)) {
                         $act[] = $id_del;
                     } else {
                         $error = TRUE;
                     }
                     $msg = $error ? 'Sebagian data gagal dihapus.' : 'Data Tagihan berhasil dihapus.';
                 }
             }
         } elseif ($act == 'Pindah') {
             ex_ha('C04', 'U');
             ex_empty($blok_baru, 'Blok baru harus diisi.');
             $query = "\n\t\t\tUPDATE KWITANSI \n\t\t\tSET\n\t\t\t\tKODE_BLOK = '{$blok_baru}', \n\t\t\t\tSTATUS_PINDAH_BLOK = '1'\n\t\t\tWHERE\n\t\t\t\tKODE_BLOK = '{$id}'\n\t\t\t";
             ex_false($conn->execute($query), $query);
             $query = "\n\t\t\tUPDATE KWITANSI_LAIN_LAIN\n\t\t\tSET\n\t\t\t\tKODE_BLOK = '{$blok_baru}'\n\t\t\tWHERE\n\t\t\t\tKODE_BLOK = '{$id}'\n\t\t\t";
             ex_false($conn->execute($query), $query);
             $msg = 'Blok berhasil dipindahkan.';
         }
     }
     $conn->committrans();
 } catch (Exception $e) {
     $msg = $e->getmessage();
     $error = TRUE;
     if ($conn) {
         $conn->rollbacktrans();
     }
             $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;
             }
         }
         $msg = $error ? 'Sebagian data gagal dihapus.' : 'Data hari libur berhasil dihapus.';
     }
     $conn->committrans();
 } catch (Exception $e) {
require_once '../../../../config/config.php';
$msg = '';
$error = FALSE;
$act = isset($_REQUEST['act']) ? clean($_REQUEST['act']) : '';
$id = isset($_REQUEST['id']) ? clean($_REQUEST['id']) : '';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    try {
        ex_login();
        //ex_app('A');
        ex_mod('A06');
        $conn = conn($sess_db);
        ex_conn($conn);
        $conn->begintrans();
        if ($act == 'Pemulihan') {
            ex_ha('A06', 'U');
            $act = array();
            $cb_data = $_REQUEST['cb_data'];
            ex_empty($cb_data, 'Pilih data yang akan dipulihkan.');
            foreach ($cb_data as $id_del) {
                if ($conn->Execute("UPDATE SPP SET TANGGAL_SPP = CONVERT(DATETIME,GETDATE(),105), TANGGAL_PROSES = CONVERT(DATETIME,GETDATE(),105)\n\t\t\t\tWHERE KODE_BLOK = '{$id_del}'")) {
                    $act[] = $id_del;
                } else {
                    $error = TRUE;
                }
            }
            $msg = $error ? 'Sebagian data gagal dipulihkan.' : 'Data berhasil dipulihkan.';
        }
        $conn->committrans();
    } catch (Exception $e) {
        $msg = $e->getmessage();
$next_bln = $bln + 1;
$next_thn = $thn;
if ($bln > 12) {
    $next_bln = 1;
    $next_thn = $thn + 1;
}
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    try {
        ex_login();
        // ex_app('C');
        ex_mod('C03');
        $conn = conn($sess_db);
        ex_conn($conn);
        $conn->begintrans();
        if ($act == 'Tambah') {
            ex_ha('C03', 'I');
            //tanggal sekarang
            $user = $_SESSION['USER_ID'];
            $query = " SELECT *, a.KODE_BLOK as KODE FROM SPP a LEFT JOIN STOK b ON a.KODE_BLOK = b.KODE_BLOK\n\t\t\t\t\t\t\tLEFT JOIN LOKASI c ON b.KODE_LOKASI = c.KODE_LOKASI\n\t\t\t\t\t\t\tLEFT JOIN TIPE d ON b.KODE_TIPE = d.KODE_TIPE\n\t\t\t\t\t\t\tWHERE a.KODE_BLOK = '{$id}' ";
            $obj = $conn->execute($query);
            $nama_pembayar = $obj->fields['NAMA_PEMBELI'];
            $nomor_va = $obj->fields['NOMOR_CUSTOMER'];
            $alamat_1 = $obj->fields['ALAMAT_RUMAH'];
            $npwp = $obj->fields['NPWP'];
            $jenis = $obj->fields['IDENTITAS'];
            $luas_bangunan = $obj->fields['LUAS_BANGUNAN'];
            $lokasi = $obj->fields['LOKASI'];
            $kode_blok = $obj->fields['KODE'];
            $tipe = $obj->fields['TIPE_BANGUNAN'];
            if ($luas_bangunan > 0) {
                $bangunan = 'Tanah dan Bangunan';
require_once '../../../../../config/config.php';
$msg = '';
$error = FALSE;
$act = isset($_REQUEST['act']) ? clean($_REQUEST['act']) : '';
$id = isset($_REQUEST['id']) ? clean($_REQUEST['id']) : '';
$app_name = isset($_REQUEST['app_name']) ? clean($_REQUEST['app_name']) : '';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    try {
        ex_login();
        //ex_app('A');
        ex_mod('A01');
        $conn = conn($sess_db);
        ex_conn($conn);
        $conn->begintrans();
        if ($act == 'Edit') {
            ex_ha('A01', 'U');
            ex_empty($app_name, 'App harus diisi.');
            $ols_app_name = $conn->Execute("SELECT APP_NAME FROM APPLICATIONS WHERE APP_ID = '{$id}'")->fields['APP_NAME'];
            if ($app_name != $ols_app_name) {
                $query = "SELECT COUNT(APP_NAME) AS TOTAL FROM APPLICATIONS WHERE APP_NAME = '{$app_name}'";
                ex_found($conn->Execute($query)->fields['TOTAL'], "login id \"{$app_name}\" telah terdaftar.");
            }
            $query = "\n\t\t\tUPDATE APPLICATIONS \n\t\t\tSET APP_NAME = '{$app_name}'\n\t\t\tWHERE\n\t\t\t\tAPP_ID = '{$id}'\n\t\t\t";
            ex_false($conn->Execute($query), $query);
            $msg = 'Data app berhasil diubah.';
        }
        $conn->committrans();
    } catch (Exception $e) {
        $msg = $e->getmessage();
        $error = TRUE;
        if ($conn) {
         ex_ha('C06', '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_MEMO_PEMBATALAN WHERE KODE_BLOK = '{$id_del}'";
             if ($conn->Execute($query)) {
                 $act[] = $id_del;
             } else {
                 $error = TRUE;
             }
         }
         $msg = $error ? 'Sebagian data gagal dihapus.' : 'Data memo pembatalan berhasil dihapus.';
     } else {
         if ($act == 'HapusMemo') {
             ex_ha('C06', '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_MEMO_PEMBATALAN WHERE NOMOR_MEMO = '{$id_del}'";
                 if ($conn->Execute($query)) {
                     $act[] = $id_del;
                 } else {
                     $error = TRUE;
                 }
             }
             $msg = $error ? 'Sebagian data gagal dihapus.' : 'Data memo pembatalan berhasil dihapus.';
         }
     }
 }
Example #10
0
     while (!$obj->EOF) {
         $id = $obj->fields['KODE_BLOK'];
         $pecah_kode = explode("/", $id);
         $blok_nomor = $pecah_kode[1];
         $pecah_blok = explode("-", $blok_nomor);
         $blok = $pecah_blok[0];
         $nomor = $pecah_blok[1];
         $va = '99' . $blok . $nomor . '0';
         $query2 = "\n\t\t\t\tUPDATE STOK SET\n\t\t\t\t\tNO_VA = '{$va}'\n\t\t\t\tWHERE\n\t\t\t\t\tKODE_BLOK = '{$id}'\n\t\t\t\t";
         ex_false($conn->Execute($query2), $query2);
         $obj->movenext();
         $no++;
     }
     $msg = 'Nomor VA berhasil otomatis generate';
 } elseif ($act == 'Ubah') {
     ex_ha('M03', 'U');
     if ($nomor_va == '') {
         $nomor_va = NULL;
         $query = "SELECT * FROM STOK WHERE KODE_BLOK = '{$id}' AND NO_VA = '{$nomor_va}'";
         ex_found($conn->Execute($query)->recordcount(), "Tidak ada data yang berubah.");
         $query = "\n\t\t\t\tUPDATE STOK SET\n\t\t\t\t\tNO_VA = NULL\n\t\t\t\tWHERE\n\t\t\t\t\tKODE_BLOK = '{$id}'\n\t\t\t\t";
         ex_false($conn->Execute($query), $query);
         $msg = 'Data Virtual Account berhasil diubah.';
     } else {
         $obj = $conn->Execute("SELECT COUNT(KODE_BLOK) AS TOTAL FROM STOK WHERE NO_VA = '{$nomor_va}'");
         $total = $obj->fields['TOTAL'];
         if ($total > 0) {
             $msg = "Nomor VA \"{$nomor_va}\" telah terdaftar.";
         } else {
             $query = "SELECT * FROM STOK WHERE KODE_BLOK = '{$id}' AND NO_VA = '{$nomor_va}'";
             ex_found($conn->Execute($query)->recordcount(), "Tidak ada data yang berubah.");
     ex_mod('PM11');
     $conn = conn($sess_db);
     ex_conn($conn);
     $conn->begintrans();
     if ($act == 'Tambah') {
         ex_ha('PM11', 'I');
         ex_empty($nomor_id, 'No ID harus diisi.');
         ex_empty($nama, 'Nama harus diisi.');
         ex_empty($alamat, 'Alamat harus diisi.');
         $query = "SELECT COUNT(NOMOR_ID) AS TOTAL FROM CLUB_PERSONAL WHERE NOMOR_ID = '{$id}'";
         ex_found($conn->Execute($query)->fields['TOTAL'], "Nomor ID \"{$id}\" telah terdaftar.");
         $query = "INSERT INTO CLUB_PERSONAL (NOMOR_ID, NAMA, ALAMAT)\n\t\t\tVALUES('{$nomor_id}', '{$nama}', '{$alamat}')";
         ex_false($conn->Execute($query), $query);
         $msg = "Data Club Personal telah ditambahkan.";
     } elseif ($act == 'Ubah') {
         ex_ha('PM11', 'U');
         ex_empty($nomor_id, 'Nomor id harus diisi.');
         ex_empty($nama, 'Nama harus diisi.');
         ex_empty($alamat, 'Alamat harus diisi.');
         if ($nomor_id != $id) {
             $query = "SELECT COUNT(NOMOR_ID) AS TOTAL FROM CLUB_PERSONAL WHERE NOMOR_ID = '{$id}'";
             ex_found($conn->Execute($query)->fields['TOTAL'], "Nomor ID \"{$id}\" telah terdaftar.");
         }
         $query = "SELECT * FROM CLUB_PERSONAL WHERE NOMOR_ID = '{$id}' AND NAMA = '{$nama}'";
         ex_found($conn->Execute($query)->recordcount(), "Tidak ada data yang berubah.");
         $query = "\n\t\t\tUPDATE CLUB_PERSONAL\n\t\t\tSET NOMOR_ID \t= '{$id}',\n\t\t\t\tNAMA\t \t= '{$nama}',\n\t\t\t\tALAMAT\t\t= '{$alamat}'\t\t\t\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.';
     }
     $conn->committrans();
 } catch (Exception $e) {
     $data = $conn->Execute("SELECT KODE_POLA_BAYAR AS POLA FROM POLA_BAYAR");
     while (!$data->EOF) {
         $pola_bayar = $data->fields['POLA'];
         $harga_tanah = isset($_REQUEST['harga_tanah_' . $pola_bayar]) ? to_number($_REQUEST['harga_tanah_' . $pola_bayar]) : 0;
         $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']}'  ";
        ex_login();
        // ex_app('P');
        ex_mod('P05');
        $conn = conn($sess_db);
        ex_conn($conn);
        $conn->begintrans();
        if ($act == 'Tambah') {
            ex_ha('JB05', 'I');
            $msg = '';
        } elseif ($act == 'Ubah') {
            ex_ha('JB05', 'U');
            $query = "\n\t\t\tUPDATE TIPE\n\t\t\tSET \n\t\t\t\tDAYA_LISTRIK = '{$daya_listrik}',\n\t\t\t\tMASA_BANGUN  = '{$masa_bangun}'\n\t\t\tWHERE\n\t\t\t\tKODE_TIPE = '{$id}'\n\t\t\t";
            ex_false($conn->execute($query), $query);
            $msg = 'Data Tipe Bangunan berhasil diubah.';
        } elseif ($act == 'Hapus') {
            ex_ha('JBF05', 'D');
            $msg = '';
        }
        $conn->committrans();
    } catch (Exception $e) {
        $msg = $e->getmessage();
        $error = TRUE;
        if ($conn) {
            $conn->rollbacktrans();
        }
    }
    close($conn);
    $json = array('act' => $act, 'error' => $error, 'msg' => $msg);
    echo json_encode($json);
    exit;
}
require_once '../../../../config/config.php';
$msg = '';
$error = FALSE;
$id = isset($_REQUEST['id']) ? clean($_REQUEST['id']) : '';
$kode_unit = isset($_REQUEST['kode_unit']) ? to_number($_REQUEST['kode_unit']) : '';
$jenis_unit = isset($_REQUEST['jenis_unit']) ? clean($_REQUEST['jenis_unit']) : '';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    try {
        ex_login();
        ex_app('M');
        ex_mod('M06');
        $conn = conn($sess_db);
        ex_conn($conn);
        $conn->begintrans();
        ex_ha('M06', 'U');
        ex_empty($kode_unit, 'Kode jenis unit harus diisi.');
        ex_empty($jenis_unit, 'Nama jenis unit harus diisi.');
        $query = "\n\t\t\tDELETE FROM JENIS_UNIT \n\t\t\tWHERE\n\t\t\t\tKODE_UNIT = '{$id}'\n\t\t\t";
        ex_false($conn->Execute($query), $query);
        $msg = 'Data jenis unit berhasil dihapus';
        $conn->committrans();
    } catch (Exception $e) {
        $msg = $e->getmessage();
        $error = TRUE;
        if ($conn) {
            $conn->rollbacktrans();
        }
    }
    close($conn);
    $json = array('error' => $error, 'msg' => $msg);
$error = FALSE;
$id = isset($_REQUEST['id']) ? clean($_REQUEST['id']) : '';
$nm = isset($_REQUEST['nm']) ? clean($_REQUEST['nm']) : '';
$nomor_id = isset($_REQUEST['nomor_id']) ? clean($_REQUEST['nomor_id']) : '';
$nama = isset($_REQUEST['nama']) ? clean($_REQUEST['nama']) : '';
$alamat = isset($_REQUEST['alamat']) ? clean($_REQUEST['alamat']) : '';
$jabatan = isset($_REQUEST['jabatan']) ? to_number($_REQUEST['jabatan']) : '';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    try {
        ex_login();
        ex_app('M');
        ex_mod('M14');
        $conn = conn($sess_db);
        ex_conn($conn);
        $conn->begintrans();
        ex_ha('M14', 'U');
        ex_empty($nomor_id, 'Nomor id harus diisi.');
        $query = "\n\t\t\tDELETE FROM CLUB_PERSONAL\n\t\t\tWHERE\n\t\t\t\tNOMOR_ID = '{$id}' AND JABATAN_KLUB = '4'\n\t\t\t";
        ex_false($conn->Execute($query), $query);
        $msg = 'Data Club personal berhasil dihapus.';
        $conn->committrans();
    } catch (Exception $e) {
        $msg = $e->getmessage();
        $error = TRUE;
        if ($conn) {
            $conn->rollbacktrans();
        }
    }
    close($conn);
    $json = array('error' => $error, 'msg' => $msg);
    echo json_encode($json);
Example #16
0
         ex_empty($passowrd_id, 'Password harus diisi.');
         ex_empty($full_name, 'Nama harus diisi.');
         $ols_login_id = $conn->Execute("SELECT LOGIN_ID FROM USER_APPLICATIONS WHERE USER_ID = '{$id}'")->fields['LOGIN_ID'];
         if ($user_id != $id) {
             $query = "SELECT COUNT(USER_ID) AS TOTAL FROM USER_APPLICATIONS WHERE USER_ID = '{$user_id}'";
             ex_found($conn->Execute($query)->fields['TOTAL'], "User ID \"{$user_id}\" telah terdaftar.");
         }
         if ($login_id != $ols_login_id) {
             $query = "SELECT COUNT(LOGIN_ID) AS TOTAL FROM USER_APPLICATIONS WHERE LOGIN_ID = '{$login_id}'";
             ex_found($conn->Execute($query)->fields['TOTAL'], "login id \"{$login_id}\" telah terdaftar.");
         }
         $query = "\n\t\t\tUPDATE USER_APPLICATIONS \n\t\t\tSET USER_ID = '{$user_id}',\n\t\t\t\tLOGIN_ID = '{$login_id}',\n\t\t\t\tPASSOWRD_ID = '{$passowrd_id}',\n\t\t\t\tFULL_NAME = '{$full_name}'\n\t\t\tWHERE\n\t\t\t\tUSER_ID = '{$id}'\n\t\t\t";
         ex_false($conn->Execute($query), $query);
         $msg = 'Data user berhasil diubah.';
     } elseif ($act == 'Hapus') {
         ex_ha('COL02', '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 USER_APPLICATIONS WHERE USER_ID = '{$id_del}'")) {
                 $act[] = $id_del;
             } else {
                 $error = TRUE;
             }
         }
         $msg = $error ? 'Sebagian data gagal dihapus.' : 'Data user berhasil dihapus.';
     }
     $conn->committrans();
 } catch (Exception $e) {
     $msg = $e->getmessage();
 $conn = conn($sess_db);
 ex_conn($conn);
 $conn->begintrans();
 if ($act == 'Tambah') {
     ex_ha('M11', 'I');
     ex_empty($kode_bayar, 'Kode jenis pembayaran harus diisi.');
     ex_empty($jenis_bayar, 'Nama jenis pembayaran harus diisi.');
     $query = "SELECT COUNT(KODE_BAYAR) AS TOTAL FROM JENIS_PEMBAYARAN WHERE KODE_BAYAR = '{$kode_bayar}'";
     ex_found($conn->Execute($query)->fields['TOTAL'], "Kode jenis pembayaran \"{$kode_bayar}\" telah terdaftar.");
     $query = "SELECT COUNT(JENIS_BAYAR) AS TOTAL FROM JENIS_PEMBAYARAN WHERE JENIS_BAYAR = '{$jenis_bayar}'";
     ex_found($conn->Execute($query)->fields['TOTAL'], "Nama jenis pembayaran \"{$jenis_bayar}\" telah terdaftar.");
     $query = "INSERT INTO JENIS_PEMBAYARAN (KODE_BAYAR, JENIS_BAYAR)\n\t\t\tVALUES('{$kode_bayar}', '{$jenis_bayar}')";
     ex_false($conn->Execute($query), $query);
     $msg = "Data jenis pembayaran berhasil ditambahkan.";
 } elseif ($act == 'Ubah') {
     ex_ha('M11', 'U');
     ex_empty($kode_bayar, 'Kode pembayaran harus diisi.');
     ex_empty($jenis_bayar, 'Nama jenis pembayaran harus diisi.');
     if ($kode_bayar != $id) {
         $query = "SELECT COUNT(kode_bayar) AS TOTAL FROM JENIS_PEMBAYARAN WHERE KODE_BAYAR = '{$kode_bayar}'";
         ex_found($conn->Execute($query)->fields['TOTAL'], "Kode jenis pembayaran \"{$kode_bayar}\" telah terdaftar.");
     }
     if ($jenis_bayar != $nm) {
         $query = "SELECT COUNT(JENIS_BAYAR) AS TOTAL FROM JENIS_PEMBAYARAN WHERE JENIS_BAYAR = '{$jenis_bayar}'";
         ex_found($conn->Execute($query)->fields['TOTAL'], "Nama jenis pembayaran \"{$jenis_bayar}\" telah terdaftar.");
     }
     $query = "SELECT * FROM JENIS_PEMBAYARAN WHERE KODE_BAYAR = '{$kode_bayar}' AND JENIS_BAYAR = '{$jenis_bayar}'";
     ex_found($conn->Execute($query)->recordcount(), "Tidak ada data yang berubah.");
     $query = "\n\t\t\tUPDATE JENIS_PEMBAYARAN \n\t\t\tSET KODE_BAYAR = '{$kode_bayar}',\n\t\t\t\tJENIS_BAYAR = '{$jenis_bayar}'\n\t\t\tWHERE\n\t\t\t\tKODE_BAYAR = '{$id}'\n\t\t\t";
     ex_false($conn->Execute($query), $query);
     $msg = 'Data jenis pembayaran berhasil diubah.';
$msg = '';
$error = FALSE;
$act = isset($_REQUEST['act']) ? clean($_REQUEST['act']) : '';
$id = isset($_REQUEST['id']) ? clean($_REQUEST['id']) : '';
$nm = isset($_REQUEST['nm']) ? clean($_REQUEST['nm']) : '';
$kode_jenis = isset($_REQUEST['kode_jenis']) ? to_number($_REQUEST['kode_jenis']) : '';
$jenis_penjualan = isset($_REQUEST['jenis_penjualan']) ? clean($_REQUEST['jenis_penjualan']) : '';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    try {
        ex_login();
        ex_app('M');
        ex_mod('M07');
        $conn = conn($sess_db);
        ex_conn($conn);
        $conn->begintrans();
        ex_ha('M07', 'U');
        ex_empty($kode_jenis, 'Kode penjualan harus diisi.');
        ex_empty($jenis_penjualan, 'Nama penjualan harus diisi.');
        $query = "\n\t\t\tDELETE FROM JENIS_PENJUALAN \n\t\t\tWHERE\n\t\t\t\tKODE_JENIS = '{$id}'\n\t\t\t";
        ex_false($conn->Execute($query), $query);
        $msg = 'Data jenis penjualan berhasil dihapus.';
        $conn->committrans();
    } catch (Exception $e) {
        $msg = $e->getmessage();
        $error = TRUE;
        if ($conn) {
            $conn->rollbacktrans();
        }
    }
    close($conn);
    $json = array('act' => $act, 'error' => $error, 'msg' => $msg);
Example #19
0
$user_id = isset($_REQUEST['s_user_id']) ? clean($_REQUEST['s_user_id']) : '';
$app_id = isset($_REQUEST['s_app_id']) ? clean($_REQUEST['s_app_id']) : '';
$ar_modul_id = isset($_REQUEST['ar_modul_id']) ? $_REQUEST['ar_modul_id'] : array();
$ar_ronly = isset($_REQUEST['r_ronly']) ? $_REQUEST['r_ronly'] : array();
$ar_edit = isset($_REQUEST['r_edit']) ? $_REQUEST['r_edit'] : array();
$ar_insert = isset($_REQUEST['r_insert']) ? $_REQUEST['r_insert'] : array();
$ar_delete = isset($_REQUEST['r_delete']) ? $_REQUEST['r_delete'] : array();
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    try {
        ex_login();
        //ex_app('A');
        ex_mod('A05');
        $conn = conn($sess_db);
        ex_conn($conn);
        $conn->begintrans();
        ex_ha('A05', 'U');
        ex_empty($user_id, 'Pilih user ID.');
        ex_empty($app_id, 'Pilih App ID.');
        foreach ($ar_modul_id as $i => $modul_id) {
            $conn->Execute("DELETE FROM APPLICATION_RIGHTS WHERE USER_ID = '{$user_id}' AND MODUL_ID = '{$modul_id}'");
            $r_ronly = isset($ar_ronly[$modul_id]) ? $ar_ronly[$modul_id] : 'T';
            $r_edit = isset($ar_edit[$modul_id]) ? $ar_edit[$modul_id] : 'T';
            $r_insert = isset($ar_insert[$modul_id]) ? $ar_insert[$modul_id] : 'T';
            $r_delete = isset($ar_delete[$modul_id]) ? $ar_delete[$modul_id] : 'T';
            $query = "INSERT INTO APPLICATION_RIGHTS (USER_ID, MODUL_ID, R_RONLY, R_EDIT, R_INSERT, R_DELETE) VALUES \n\t\t\t(\n\t\t\t\t'{$user_id}',\n\t\t\t\t'{$modul_id}',\n\t\t\t\t\n\t\t\t\t'{$r_ronly}',\n\t\t\t\t'{$r_edit}',\n\t\t\t\t'{$r_insert}',\n\t\t\t\t'{$r_delete}'\n\t\t\t)";
            ex_false($conn->Execute($query), $query);
        }
        $msg = "Hak akses modul berhasil diubah.";
        $conn->committrans();
    } catch (Exception $e) {
        $msg = $e->getmessage();
         $msg = $error ? 'Sebagian data gagal dihapus.' : 'Data desa berhasil dihapus.';
     } elseif ($act == 'Otorisasi') {
         ex_ha('PT05', 'U');
         $act = array();
         $cb_data = $_REQUEST['cb_data'];
         ex_empty($cb_data, 'Pilih data yang akan diotorisasi.');
         foreach ($cb_data as $id_del) {
             if ($conn->Execute("UPDATE SPP SET OTORISASI = '1' WHERE KODE_BLOK = '{$id_del}'")) {
                 $act[] = $id_del;
             } else {
                 $error = TRUE;
             }
         }
         $msg = $error ? 'Sebagian data gagal diotorisasi.' : 'Data berhasil diotorisasi.';
     } elseif ($act == 'Batal_Otorisasi') {
         ex_ha('PT05', 'U');
         $act = array();
         $cb_data = $_REQUEST['cb_data'];
         ex_empty($cb_data, 'Pilih data yang akan dibatalkan diotorisasi.');
         foreach ($cb_data as $id_del) {
             if ($conn->Execute("UPDATE SPP SET OTORISASI = '0' WHERE KODE_BLOK = '{$id_del}'")) {
                 $act[] = $id_del;
             } else {
                 $error = TRUE;
             }
         }
         $msg = $error ? 'Sebagian data gagal dibatalkan otorisasi.' : 'Data berhasil dibatalkan otorisasi.';
     }
     $conn->committrans();
 } catch (Exception $e) {
     $msg = $e->getmessage();
$act = isset($_REQUEST['act']) ? clean($_REQUEST['act']) : '';
$id = isset($_REQUEST['id']) ? clean($_REQUEST['id']) : '';
$kode_bank = isset($_REQUEST['kode_bank']) ? to_number($_REQUEST['kode_bank']) : '';
$nama_bank = isset($_REQUEST['nama_bank']) ? clean($_REQUEST['nama_bank']) : '';
$alamat_bank = isset($_REQUEST['alamat_bank']) ? clean($_REQUEST['alamat_bank']) : '';
$npwp = isset($_REQUEST['npwp']) ? clean($_REQUEST['npwp']) : '';
$kode_va_unit = isset($_REQUEST['kode_va_unit']) ? clean($_REQUEST['kode_va_unit']) : '';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    try {
        ex_login();
        ex_app('M');
        ex_mod('M08');
        $conn = conn($sess_db);
        ex_conn($conn);
        $conn->begintrans();
        ex_ha('M08', 'U');
        ex_empty($kode_bank, 'Kode bank harus diisi.');
        ex_empty($nama_bank, 'Nama bank harus diisi.');
        $query = "\n\t\t\tDELETE FROM BANK \n\t\t\tWHERE\n\t\t\t\tKODE_BANK = '{$id}'\n\t\t\t";
        ex_false($conn->Execute($query), $query);
        $msg = 'Data lembaga keuangan berhasil dihapus.';
        $conn->committrans();
    } catch (Exception $e) {
        $msg = $e->getmessage();
        $error = TRUE;
        if ($conn) {
            $conn->rollbacktrans();
        }
    }
    close($conn);
    $json = array('error' => $error, 'msg' => $msg);
Example #22
0
<?php

require_once '../../../../config/config.php';
die_login();
$conn = conn($sess_db);
die_conn($conn);
$msg = '';
$error = FALSE;
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    try {
        ex_login();
        ex_app('M');
        ex_mod('M26');
        $conn = conn($sess_db);
        ex_conn($conn);
        ex_ha('M26', 'U');
        $conn->begintrans();
        $batas_distribusi = isset($_REQUEST['batas_distribusi']) ? clean($_REQUEST['batas_distribusi']) : '';
        $tenggang_distribusi = isset($_REQUEST['tenggang_distribusi']) ? clean($_REQUEST['tenggang_distribusi']) : '';
        $batas_reserve = isset($_REQUEST['batas_reserve']) ? clean($_REQUEST['batas_reserve']) : '';
        $query = "SELECT * FROM CS_PARAMETER_MARK WHERE BATAS_DISTRIBUSI= '{$batas_distribusi}' AND TENGGANG_DISTRIBUSI = '{$tenggang_distribusi}' \n\t\t\t\tAND BATAS_RESERVE = '{$batas_reserve}'";
        ex_found($conn->Execute($query)->recordcount(), "Tidak ada data yang berubah.");
        $conn->Execute("DELETE FROM CS_PARAMETER_MARK");
        $query = "\n\t\tINSERT INTO CS_PARAMETER_MARK (\n\t\tBATAS_DISTRIBUSI, TENGGANG_DISTRIBUSI, BATAS_RESERVE\n\t\t)\n\t\tVALUES (\n\t\t'{$batas_distribusi}', '{$tenggang_distribusi}', '{$batas_reserve}'\n\t\t)\n\t\t";
        ex_false($conn->Execute($query), $query);
        $conn->committrans();
        $msg = 'Parameter berhasil diubah.';
    } catch (Exception $e) {
        $msg = $e->getmessage();
        $error = TRUE;
        $conn->rollbacktrans();
Example #23
0
         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_empty($cb_data, 'Pilih data yang akan dihapus.');
         foreach ($cb_data as $id_del) {
             $query = "DELETE FROM SPP WHERE KODE_BLOK = '{$id_del}'";
             if ($conn->Execute($query)) {
                 $act[] = $id_del;
             } else {
                 $error = TRUE;
             }
         }
         $msg = $error ? 'Sebagian data SPP gagal dihapus.' : 'Data SPP berhasil dihapus.';
     }
     $conn->committrans();
 } catch (Exception $e) {
Example #24
0
 $conn = conn($sess_db);
 ex_conn($conn);
 $conn->begintrans();
 if ($act == 'Tambah') {
     ex_ha('M01', 'I');
     ex_empty($kode_lokasi, 'Kode lokasi harus diisi.');
     ex_empty($lokasi, 'Nama lokasi harus diisi.');
     $query = "SELECT COUNT(KODE_LOKASI) AS TOTAL FROM LOKASI WHERE KODE_LOKASI = '{$kode_lokasi}'";
     ex_found($conn->Execute($query)->fields['TOTAL'], "Kode lokasi \"{$kode_lokasi}\" telah terdaftar.");
     $query = "SELECT COUNT(LOKASI) AS TOTAL FROM LOKASI WHERE LOKASI = '{$lokasi}'";
     ex_found($conn->Execute($query)->fields['TOTAL'], "Nama lokasi \"{$lokasi}\" telah terdaftar.");
     $query = "INSERT INTO LOKASI (KODE_LOKASI, LOKASI)\n\t\t\tVALUES('{$kode_lokasi}', '{$lokasi}')";
     ex_false($conn->Execute($query), $query);
     $msg = "Data Lokasi \"{$lokasi}\" berhasil ditambahkan.";
 } elseif ($act == 'Ubah') {
     ex_ha('M01', 'U');
     ex_empty($kode_lokasi, 'Kode lokasi harus diisi.');
     ex_empty($lokasi, 'Nama lokasi harus diisi.');
     if ($kode_lokasi != $id) {
         $query = "SELECT COUNT(KODE_LOKASI) AS TOTAL FROM LOKASI WHERE KODE_LOKASI = '{$kode_lokasi}'";
         ex_found($conn->Execute($query)->fields['TOTAL'], "Kode lokasi \"{$kode_lokasi}\" telah terdaftar.");
     }
     $obj = $conn->Execute("SELECT * FROM LOKASI WHERE KODE_LOKASI = '{$id}'");
     $nm = $obj->fields['LOKASI'];
     if ($lokasi != $nm) {
         $query = "SELECT COUNT(LOKASI) AS TOTAL FROM LOKASI WHERE LOKASI = '{$lokasi}'";
         ex_found($conn->Execute($query)->fields['TOTAL'], "Nama lokasi \"{$lokasi}\" telah terdaftar.");
     }
     $query = "SELECT * FROM LOKASI WHERE KODE_LOKASI = '{$kode_lokasi}' AND LOKASI = '{$lokasi}'";
     ex_found($conn->Execute($query)->recordcount(), "Tidak ada data yang berubah.");
     $query = "\n\t\t\tUPDATE LOKASI \n\t\t\tSET KODE_LOKASI = '{$kode_lokasi}',\n\t\t\t\tLOKASI = '{$lokasi}'\n\t\t\tWHERE\n\t\t\t\tKODE_LOKASI = '{$id}'\n\t\t\t";
$error = FALSE;
$id = isset($_REQUEST['id']) ? clean($_REQUEST['id']) : '';
$nm = isset($_REQUEST['nm']) ? clean($_REQUEST['nm']) : '';
$nomor_id = isset($_REQUEST['nomor_id']) ? clean($_REQUEST['nomor_id']) : '';
$nama = isset($_REQUEST['nama']) ? clean($_REQUEST['nama']) : '';
$alamat = isset($_REQUEST['alamat']) ? clean($_REQUEST['alamat']) : '';
$jabatan = isset($_REQUEST['jabatan']) ? to_number($_REQUEST['jabatan']) : '';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    try {
        ex_login();
        ex_app('M');
        ex_mod('M13');
        $conn = conn($sess_db);
        ex_conn($conn);
        $conn->begintrans();
        ex_ha('M13', 'U');
        ex_empty($nomor_id, 'Nomor id harus diisi.');
        $query = "\n\t\t\tDELETE FROM CLUB_PERSONAL\n\t\t\tWHERE\n\t\t\t\tNOMOR_ID = '{$id}' AND JABATAN_KLUB = '5'\n\t\t\t";
        ex_false($conn->Execute($query), $query);
        $msg = 'Data Club personal berhasil dihapus.';
        $conn->committrans();
    } catch (Exception $e) {
        $msg = $e->getmessage();
        $error = TRUE;
        if ($conn) {
            $conn->rollbacktrans();
        }
    }
    close($conn);
    $json = array('error' => $error, 'msg' => $msg);
    echo json_encode($json);
$alamat = isset($_REQUEST['alamat']) ? clean($_REQUEST['alamat']) : '';
$telepon = isset($_REQUEST['telepon']) ? clean($_REQUEST['telepon']) : '';
$agen = isset($_REQUEST['agen']) ? clean($_REQUEST['agen']) : '';
$no_npwp = isset($_REQUEST['no_npwp']) ? clean($_REQUEST['no_npwp']) : '';
$no_ktp = isset($_REQUEST['no_ktp']) ? clean($_REQUEST['no_ktp']) : '';
$koordinator = isset($_REQUEST['koordinator']) ? clean($_REQUEST['koordinator']) : '';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    try {
        ex_login();
        ex_app('M');
        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.";
$luas_tanah = isset($_REQUEST['luas_tanah']) ? clean($_REQUEST['luas_tanah']) : '';
$luas_bangunan = isset($_REQUEST['luas_bangunan']) ? clean($_REQUEST['luas_bangunan']) : '';
$tipe_bangunan = isset($_REQUEST['tipe_bangunan']) ? clean($_REQUEST['tipe_bangunan']) : '';
$total_tanah = isset($_REQUEST['total_tanah']) ? to_clean($_REQUEST['total_tanah']) : '';
$total_bangunan = isset($_REQUEST['total_bangunan']) ? to_clean($_REQUEST['total_bangunan']) : '';
$nomor_kwitansi = isset($_REQUEST['nomor_kwitansi']) ? clean($_REQUEST['nomor_kwitansi']) : '';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    try {
        ex_login();
        // ex_app('C');
        ex_mod('C01');
        $conn = conn($sess_db);
        ex_conn($conn);
        $conn->begintrans();
        if ($act == 'Ubah') {
            ex_ha('C01', 'U');
            $query = "\n\t\t\tUPDATE SPP\n\t\t\tSET\n\t\t\t\tCATATAN_PENAGIHAN = '{$catatan_penagihan}'\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.';
        }
        $conn->committrans();
    } catch (Exception $e) {
        $msg = $e->getmessage();
        $error = TRUE;
        if ($conn) {
            $conn->rollbacktrans();
        }
    }
    close($conn);
    $json = array('act' => $act, 'error' => $error, 'msg' => $msg);
    echo json_encode($json);
Example #28
0
$msg = '';
$error = FALSE;
$act = isset($_REQUEST['act']) ? clean($_REQUEST['act']) : '';
$id = isset($_REQUEST['id']) ? clean($_REQUEST['id']) : '';
$app_id = isset($_REQUEST['app_id']) ? clean($_REQUEST['app_id']) : '';
$modul_name = isset($_REQUEST['modul_name']) ? clean($_REQUEST['modul_name']) : '';
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;
         $msg = $error ? 'Sebagian data stok gagal dihapus.' : 'Data stok berhasil dihapus.';
     } elseif ($act == 'Otorisasi') {
         ex_ha('M28', 'U');
         $act = array();
         $cb_data = $_REQUEST['cb_data'];
         ex_empty($cb_data, 'Pilih data yang akan diotorisasi.');
         foreach ($cb_data as $id_del) {
             if ($conn->Execute("UPDATE STOK SET STATUS_STOK = '1' WHERE KODE_BLOK = '{$id_del}'")) {
                 $act[] = $id_del;
             } else {
                 $error = TRUE;
             }
         }
         $msg = $error ? 'Sebagian data stok gagal diotorisasi.' : 'Data stok berhasil diotorisasi.';
     } elseif ($act == 'Batal_Otorisasi') {
         ex_ha('M28', 'U');
         $act = array();
         $cb_data = $_REQUEST['cb_data'];
         ex_empty($cb_data, 'Pilih data yang akan dibatalkan diotorisasi.');
         foreach ($cb_data as $id_del) {
             if ($conn->Execute("UPDATE STOK SET STATUS_STOK = '0' WHERE KODE_BLOK = '{$id_del}'")) {
                 $act[] = $id_del;
             } else {
                 $error = TRUE;
             }
         }
         $msg = $error ? 'Sebagian data stok gagal batal otorisasi.' : 'Data stok yang telah diotorisasi berhasil dibatalkan otorisasinya.';
     }
     $conn->committrans();
 } catch (Exception $e) {
     $msg = $e->getmessage();
$harga_tanah = 0;
$base_harga_bangunan = 0;
$fs_harga_bangunan = 0;
$disc_harga_bangunan = 0;
$ppn_harga_bangunan = 0;
$harga_bangunan = 0;
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
    try {
        ex_login();
        ex_app('M');
        ex_mod('M28');
        $conn = conn($sess_db);
        ex_conn($conn);
        $conn->begintrans();
        if ($act == 'Ubah') {
            ex_ha('M28', 'I');
            ex_empty($kode_blok, 'Kode Blok harus diisi.');
            ex_empty($kode_desa, 'Desa harus diisi.');
            ex_empty($kode_lokasi, 'Lokasi harus diisi.');
            ex_empty($kode_unit, 'Jenis unit harus diisi.');
            ex_empty($kode_sk_tanah, 'SK tanah harus diisi.');
            ex_empty($kode_faktor, 'Faktor strategis harus diisi.');
            ex_empty($kode_tipe, 'Tipe harus diisi.');
            ex_empty($kode_sk_bangunan, 'SK bangunan harus diisi.');
            ex_empty($kode_penjualan, 'Jenis penjualan harus diisi.');
            ex_empty($class, 'Pilih class.');
            $query = "\n\t\t\tUPDATE STOK \n\t\t\tSET KODE_BLOK = '{$kode_blok}', \n\t\t\t\tKODE_UNIT = '{$kode_unit}', \n\t\t\t\tKODE_DESA = '{$kode_desa}', \n\t\t\t\tKODE_LOKASI = '{$kode_lokasi}', \n\t\t\t\tKODE_SK_TANAH = '{$kode_sk_tanah}', \n\t\t\t\tKODE_FAKTOR = '{$kode_faktor}', \n\t\t\t\tKODE_TIPE = '{$kode_tipe}', \n\t\t\t\tKODE_SK_BANGUNAN = '{$kode_sk_bangunan}', \n\t\t\t\tKODE_PENJUALAN = '{$kode_penjualan}', \n\t\t\t\t\n\t\t\t\tLUAS_TANAH = '{$luas_tanah}', \n\t\t\t\tLUAS_BANGUNAN = '{$luas_bangunan}', \n\t\t\t\tPPN_TANAH = '{$ppn_tanah}', \n\t\t\t\tPPN_BANGUNAN = '{$ppn_bangunan}', \n\t\t\t\tDISC_TANAH = '{$disc_tanah}', \n\t\t\t\tDISC_BANGUNAN = '{$disc_bangunan}', \n\t\t\t\t\n\t\t\t\tCLASS = '{$class}',\n\t\t\t\tPROGRAM = '{$program}',\n\t\t\t\t\n\t\t\t\tSTATUS_GAMBAR_SITEPLAN = '{$status_gambar_siteplan}', \n\t\t\t\tSTATUS_GAMBAR_LAPANGAN = '{$status_gambar_lapangan}', \n\t\t\t\tSTATUS_GAMBAR_GS = '{$status_gambar_gs}'\n\t\t\tWHERE\n\t\t\t\tKODE_BLOK = '{$id}'\n\t\t\t";
            ex_false($conn->Execute($query), $query);
            $msg = 'Data stok berhasil diubah.';
        }
        $conn->committrans();