本文整理汇总了PHP中ex_ha函数的典型用法代码示例。如果您正苦于以下问题:PHP ex_ha函数的具体用法?PHP ex_ha怎么用?PHP ex_ha使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了ex_ha函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: ex_false
$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();
}
示例2: ex_found
}
$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 ";
示例3: isset
$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;
示例4: ex_empty
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();
}
示例5: elseif
$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) {
示例6: isset
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();
示例7: ex_login
$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';
示例8: isset
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) {
示例9: ex_ha
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.';
}
}
}
示例10: while
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.");
示例11: ex_mod
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) {
示例12: while
$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']}' ";
示例13: ex_login
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;
}
示例14: isset
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);
示例15: isset
$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);