本文整理汇总了PHP中updateQuery函数的典型用法代码示例。如果您正苦于以下问题:PHP updateQuery函数的具体用法?PHP updateQuery怎么用?PHP updateQuery使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了updateQuery函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: doJournal
/**
* doJournal
* Lakukan Jurnal berdasarkan data yang diberikan
*/
public function doJournal($pt, $kodeJurnal, $dataRes, $counter, $ketKelompok = "", $updateCounter = true)
{
global $dbname;
#Cek Nojurnal sudah terdaftar, Jika sudah terdaftar exit
$sCek = "select nojurnal from " . $dbname . ".keu_jurnaldt where nojurnal='" . $dataRes['header']['nojurnal'] . "'";
$qCek = mysql_query($sCek) or die(mysql_error($conn));
$rCek = mysql_num_rows($qCek);
if ($rCek != 0) {
exit("warning: Nojurnal :" . $dataRes['header']['nojurnal'] . " sudah ada");
}
$qHeader = insertQuery($dbname, 'keu_jurnalht', $dataRes['header']);
$qDetail = insertQuery($dbname, 'keu_jurnaldt', $dataRes['detail']);
$dataIns = array($pt, $kodeJurnal, $ketKelompok, $counter);
$insCounter = insertQuery($dbname, 'keu_5kelompokjurnal', $dataIns);
$updCounter = updateQuery($dbname, 'keu_5kelompokjurnal', array('nokounter' => $counter), "kodeorg='" . $pt . "' and kodekelompok='" . $kodeJurnal . "'");
if (!mysql_query($qHeader)) {
echo "Header DB Error: " . mysql_error() . "\n";
$this->rbJournal($dataRes['header']['nojurnal']);
exit;
} else {
if (!mysql_query($qDetail)) {
echo "Detail DB Error: " . mysql_error() . "\n";
$this->rbJournal($dataRes['header']['nojurnal']);
exit;
} else {
if ($updateCounter) {
if (!mysql_query($insCounter)) {
// Insert Kelompok Jurnal jika belum ada
if (!mysql_query($updCounter)) {
// Update jika sudah ada
echo "DB Error: " . mysql_error() . "\n";
$this->rbJournal($dataRes['header']['nojurnal']);
exit;
}
}
}
}
}
}
开发者ID:halimc17,项目名称:magsys,代码行数:43,代码来源:zJournal.php
示例2: unset
// {
// exit("[ Error ]: Akun ".$data['noakun']." harus dilengkapi dengan NIK/nama Karyawan.");
// }
//=====end tambahan dz
unset($data['nojurnal']);
unset($data['kodejurnal']);
unset($data['nourut']);
$data['tanggal'] = tanggalsystem($data['tanggal']);
$data['jumlah'] = str_replace(',', '', $data['jumlah']);
foreach ($data as $key => $cont) {
if (substr($key, 0, 5) == 'cond_') {
unset($data[$key]);
}
}
$where = "nojurnal='" . $param['nojurnal'] . "' and nourut='" . $param['nourut'] . "'";
$query = updateQuery($dbname, 'keu_jurnaldt', $data, $where);
if (!mysql_query($query)) {
echo "DB Error : " . mysql_error();
exit;
}
echo json_encode($param);
break;
case 'delete':
$where = "nojurnal='" . $param['nojurnal'] . "' and nourut='" . $param['nourut'] . "'";
$query = "delete from `" . $dbname . "`.`keu_jurnaldt` where " . $where;
if (!mysql_query($query)) {
echo "DB Error : " . mysql_error();
exit;
}
break;
default:
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:keu_slave_jurnal_manage_detail.php
示例3: explode
$primVal = explode('##', $_POST['primVal']);
unset($primary['namabarang']);
unset($primary['satuan']);
unset($data['namabarang']);
unset($data['satuan']);
# Create Condition
$where = "";
for ($i = 1; $i < count($primary); $i++) {
if ($i == 1) {
$where .= "`" . $primary[$i] . "`='" . $primVal[$i] . "'";
} else {
$where .= " AND `" . $primary[$i] . "`='" . $primVal[$i] . "'";
}
}
# Create Query
$query = updateQuery($dbname, 'setup_kegiatannorma', $data, $where);
# Update Data
if (!mysql_query($query)) {
echo "DB Error : " . mysql_error($conn);
}
break;
case 'delete':
$data = $_POST;
unset($data['proses']);
unset($data['primary']);
unset($data['primVal']);
$primary = explode('##', $_POST['primary']);
$primVal = explode('##', $_POST['primVal']);
unset($primary['namabarang']);
unset($primary['satuan']);
unset($data['namabarang']);
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:setup_slave_kegiatan_norma.php
示例4: foreach
$res = "";
foreach ($data as $cont) {
$res .= "##" . $cont;
}
$result = "{res:\"" . $res . "\",theme:\"" . $_SESSION['theme'] . "\"}";
echo $result;
break;
case 'edit':
$data = $param;
foreach ($data as $key => $cont) {
if (substr($key, 0, 5) == 'cond_') {
unset($data[$key]);
}
}
$where = "kodeorg='" . $param['kodeorg'] . "' and shift=" . $param['shift'] . " and nik='" . $param['cond_nik'] . "'";
$query = updateQuery($dbname, 'pabrik_5shiftanggota', $data, $where);
if (!mysql_query($query)) {
echo "DB Error : " . mysql_error();
exit;
}
echo json_encode($param);
break;
case 'delete':
$where = "kodeorg='" . $param['kodeorg'] . "' and shift=" . $param['shift'] . " and nik='" . $param['nik'] . "'";
$query = "delete from `" . $dbname . "`.`pabrik_5shiftanggota` where " . $where;
if (!mysql_query($query)) {
echo "DB Error : " . mysql_error();
exit;
}
break;
default:
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:pabrik_slave_5shift.php
示例5: str_replace
$data['rupiahpersatuan'] = str_replace(',', '', $data['rupiahpersatuan']);
foreach ($data as $key => $cont) {
if (substr($key, 0, 5) == 'cond_') {
unset($data[$key]);
}
}
cekRealisasi($param);
$where = "notransaksi='" . $param['notransaksi'] . "'and kodekegiatan='" . $param['cond_kodekegiatan'] . "' and kodeblok='" . $param['cond_kodeblok'] . "'";
$query = updateQuery($dbname, 'log_spkdt', $data, $where);
if (!mysql_query($query)) {
echo "DB Error : " . mysql_error();
exit;
} else {
$whereBA = "notransaksi='" . $param['notransaksi'] . "'and kodekegiatan='" . $param['cond_kodekegiatan'] . "' and blokspkdt='" . $param['cond_kodeblok'] . "'";
$dataBA = array('kodekegiatan' => $param['kodekegiatan'], 'blokspkdt' => $param['kodeblok']);
$queryBA = updateQuery($dbname, 'log_baspk', $dataBA, $whereBA);
if (!mysql_query($queryBA)) {
echo "DB Error : " . mysql_error();
exit;
}
}
echo json_encode($param);
break;
/** Delete existing data detail */
/** Delete existing data detail */
case 'delete':
//================periksa realisasi
$m = 0;
$strx = "select sum(jumlahrealisasi) from " . $dbname . ".log_baspk \n where notransaksi='" . $param['notransaksi'] . "'";
$resx = mysql_query($strx);
while ($barx = mysql_fetch_array($resx)) {
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:log_slave_spk_detail.php
示例6: mysql_error
$errorDB .= "Rollback 2 Error :" . mysql_error() . "\n" . $queryRB2;
}
if (!mysql_query($queryRBKonter)) {
$errorDB .= "Rollback Counter Error :" . mysql_error() . "\n" . $queryRBKonter;
}
echo "DB Error :\n" . $errorDB;
exit;
}
}
}
// else if namabarang
if (empty($errorDB)) {
// Update Setup Blok, jika kegiatan sisip, completering, tanam baru
$where = "nilai = '" . $kodekegiatan . "' and kodeaplikasi = 'TN'";
// kalo kodeparameter SISIP
$query = selectQuery($dbname, 'setup_parameterappl', '*', $where);
$resSisip = fetchData($query);
if (!empty($resSisip)) {
// Ambil Blok Lama
$qBlok = selectQuery($dbname, 'setup_blok', 'jumlahpokok', "kodeorg='" . $kodeblok . "'");
$resBlok = fetchData($qBlok);
// Update Blok Baru
$dataUpd = array('jumlahpokok' => $resBlok[0]['jumlahpokok'] + $hasilkerja);
$updBlok = updateQuery($dbname, 'setup_blok', $dataUpd, "kodeorg='" . $kodeblok . "'");
if (!mysql_query($updBlok)) {
exit("Update Blok Error: " . mysql_error());
}
}
}
}
// else 256
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:kebun_slave_operasional_posting.php
示例7: getLatestContents
function getLatestContents($nbcontents, $sort_type = 0, $catselect = "no", $rootid = null)
{
switch ($sort_type) {
/* Popular */
case 2:
$order_sql = "ORDER BY a.views DESC,a.date_created DESC ,a.id DESC ";
break;
/* Random */
/* Random */
case 1:
$order_sql = "ORDER BY RAND() ";
break;
/* Latest */
/* Latest */
case 0:
default:
$order_sql = "ORDER BY a.date_created DESC ,a.id DESC ";
break;
}
if (version_compare(JVERSION, '1.6', 'ge')) {
$listCategories = TPermissions::getAuthorisedCategories('read');
//If the variable is an array and if it's not empty, we add a filter to the request
//If not we're not return any category
if (is_array($listCategories) && !empty($listCategories)) {
$categories = implode(',', $listCategories);
$listCategories = " AND c.id IN (" . $categories . ") ";
} else {
$listCategories = " AND 0 ";
}
} else {
$listCategories = "";
}
$cat_query = "";
switch ($catselect) {
case "no":
break;
case "-1":
$catid = JRequest::getInt('catid', 0);
if ($catid != 0 && $catid != -1) {
$this->_db->setQuery("SELECT c.id, c.name,c.parent " . " FROM #__adsmanager_categories as c " . " WHERE c.published = 1 {$listCategories} ORDER BY c.parent,c.ordering");
$listcats = $this->_db->loadObjectList();
//List
$list = array();
$list[] = $catid;
$this->_recurseSearch($listcats, $list, $catid);
$listids = implode(',', $list);
$cat_query = "adcat.catid IN ({$listids}) AND ";
}
break;
default:
$this->_db->setQuery("SELECT c.id, c.name,c.parent " . " FROM #__adsmanager_categories as c " . " WHERE c.published = 1 {$listCategories} ORDER BY c.parent,c.ordering");
$listcats = $this->_db->loadObjectList();
$catsid = explode(',', $catselect);
//List
$list = array();
foreach ($catsid as $catid) {
$list[] = $catid;
$this->_recurseSearch($listcats, $list, $catid);
}
$listids = implode(',', $list);
$cat_query = " adcat.catid IN ({$listids}) AND ";
break;
}
if (ADSMANAGER_SPECIAL == 'newspaper') {
$cat_query .= " (a.ad_publishtype = 'both' OR a.ad_publishtype = 'online') AND ";
}
$currentSession = JSession::getInstance('none', array());
$sql = $currentSession->get("sqlglobalfilter", "");
$globalfilter = "";
if ($sql != "") {
$globalfilter = " AND {$sql} ";
}
$sql = " SELECT a.*,p.id as parentid,p.name as parent,c.id as catid, c.name as cat,u.username as user " . " FROM #__adsmanager_ads as a " . " INNER JOIN #__adsmanager_adcat as adcat ON adcat.adid = a.id " . " LEFT JOIN #__users as u ON a.userid = u.id " . " INNER JOIN #__adsmanager_categories as c ON adcat.catid = c.id " . " LEFT JOIN #__adsmanager_categories as p ON c.parent = p.id " . " WHERE 1 {$globalfilter} AND {$cat_query} c.published = 1 and a.published = 1 GROUP BY a.id {$order_sql} LIMIT 0, {$nbcontents}";
if (function_exists("updateQuery")) {
updateQuery($sql);
}
$this->_db->setQuery($sql);
$contents = $this->_db->loadObjectList();
if ($contents == null) {
$contents = array();
}
foreach ($contents as &$content) {
$content->images = @json_decode($content->images);
$content->cat = JText::_($content->cat);
if ($content->parent != "") {
$content->parent = JText::_($content->parent);
}
if (!is_array($content->images)) {
$content->images = array();
}
}
return $contents;
}
开发者ID:networksoft,项目名称:seekerplus2.com,代码行数:93,代码来源:content.php
示例8: mysql_error
if (!mysql_query($queryToJ)) {
$errorDB .= "Posting Mark Error :" . mysql_error() . "\n";
}
$queryKonter = updateQuery($dbname, 'keu_5kelompokjurnal', array('nokounter' => $tmpKonter[0]['nokounter'] + 1), "kodeorg='" . $_SESSION['org']['kodeorganisasi'] . "' and kodekelompok='" . $kodeJurnal . "'");
if (!mysql_query($queryKonter)) {
$errorDB .= "Update Counter Error :" . mysql_error() . "\n" . $errorDB . "___" . $queryKonter;
}
}
}
}
if ($errorDB != "") {
// Rollback
$where = "nojurnal='" . $nojurnal . "'";
$queryRB = "delete from `" . $dbname . "`.`keu_jurnalht` where " . $where;
$queryRB2 = updateQuery($dbname, 'kebun_aktifitas', array('jurnal' => 0), "notransaksi='" . $dataH[0]['notransaksi'] . "'");
$queryRBKonter = updateQuery($dbname, 'keu_5kelompokjurnal', array('nokounter' => $tmpKonter[0]['nokounter']), "kodeorg='" . $_SESSION['org']['kodeorganisasi'] . "' and kodekelompok='" . $kodeJurnal . "'");
if (!mysql_query($queryRB)) {
$errorDB .= "Rollback 1 Error :" . mysql_error() . "\n";
}
if (!mysql_query($queryRB2)) {
$errorDB .= "Rollback 2 Error :" . mysql_error() . "\n";
}
if (!mysql_query($queryRBKonter)) {
$errorDB .= "Rollback Counter Error :" . mysql_error() . "\n";
}
echo "DB Error :\n" . $errorDB . "___" . $queryRB2;
//echo "DB Error :\n".$errorDB."___".$queryRB2;
exit;
} else {
// Posting Success
}
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:kebun_slave_panen_posting.php
示例9: foreach
if ($headErr == '') {
$detailErr = '';
foreach ($dataRes['detail'] as $row) {
$insDet = insertQuery($dbname, 'keu_jurnaldt', $row);
if (!mysql_query($insDet)) {
$detailErr .= "Insert Detail Error : " . addslashes(mysql_error($conn)) . "\n";
break;
}
}
if ($detailErr == '') {
# Header and Detail inserted
#>>> Update Kode Jurnal
// $updJurnal = updateQuery($dbname,'keu_5kelompokjurnal',array('nokounter'=>$konter),
// "kodeorg='".$_SESSION['org']['kodeorganisasi'].
// "' and kodekelompok='".$kodeJurnal."'");
$updJurnal = updateQuery($dbname, 'keu_5kelompokjurnal', array('nokounter' => $konter), "kodeorg='" . $ptpengguna . "' and kodekelompok='" . $kodeJurnal . "'");
if (!mysql_query($updJurnal)) {
echo "Update Kode Jurnal Error : " . addslashes(mysql_error($conn)) . "\n";
# Rollback if Update Failed
$RBDet = deleteQuery($dbname, 'keu_jurnalht', "nojurnal='" . $nojurnal . "'");
if (!mysql_query($RBDet)) {
echo "Rollback Delete Header Error : " . addslashes(mysql_error($conn)) . "\n";
exit;
}
exit;
} else {
#berhasil di jurnal
// echo "warning: \nheader1pemilik_".$header1pemilik."\nnojurnal_".$nojurnal."\n".$insHead;
// exit;
#proses gudang
$errGudang = '';
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:log_slave_savePosting_10092015.php
示例10: prosesGajiKebun
function prosesGajiKebun()
{
global $conn;
global $tanggal;
global $param;
global $dbname;
global $defSegment;
#karyawan kebun
#output pada jurnal kolom noreferensi ALK_GAJI
if ($param['komponen'] == 1 or $param['komponen'] == 14) {
$group = 'KBNB0';
} elseif ($param['komponen'] == 16 or $param['komponen'] == 32 or $param['komponen'] == 33) {
$group = 'KBNB1';
} elseif ($param['komponen'] == 28) {
$group = 'KBNB3';
} elseif ($param['komponen'] == 26) {
$group = 'KBNB4';
} elseif ($param['komponen'] == 21) {
$group = 'KBNB5';
} else {
$group = 'KBNB2';
}
//defaultnya tunjangan
$str = "select noakundebet,noakunkredit from " . $dbname . ".keu_5parameterjurnal\r\n where jurnalid='" . $group . "' limit 1";
$res = mysql_query($str);
if (mysql_num_rows($res) < 1) {
exit("Error: No.Akun pada parameterjurnal belum ada untuk " . $param['namakomponen']);
} else {
$akundebet = '';
$akunkredit = '';
$bar = mysql_fetch_object($res);
$akundebet = $bar->noakundebet;
$akunkredit = $bar->noakunkredit;
}
#proses data
$kodeJurnal = $group;
#======================== Nomor Jurnal =============================
# Get Journal Counter
$queryJ = selectQuery($dbname, 'keu_5kelompokjurnal', 'nokounter', "kodeorg='" . $_SESSION['org']['kodeorganisasi'] . "' and kodekelompok='" . $kodeJurnal . "' ");
$tmpKonter = fetchData($queryJ);
$konter = addZero($tmpKonter[0]['nokounter'] + 1, 3);
# Transform No Jurnal dari No Transaksi
$nojurnal = str_replace("-", "", $tanggal) . "/" . $_SESSION['empl']['lokasitugas'] . "/" . $kodeJurnal . "/" . $konter;
#======================== /Nomor Jurnal ============================
# Prep Header
$dataRes['header'] = array('nojurnal' => $nojurnal, 'kodejurnal' => $kodeJurnal, 'tanggal' => $tanggal, 'tanggalentry' => date('Ymd'), 'posting' => 1, 'totaldebet' => $param['jumlah'], 'totalkredit' => -1 * $param['jumlah'], 'amountkoreksi' => '0', 'noreferensi' => 'ALK_GAJI', 'autojurnal' => '1', 'matauang' => 'IDR', 'kurs' => '1', 'revisi' => '0');
# Data Detail
$noUrut = 1;
# Debet
$dataRes['detail'][] = array('nojurnal' => $nojurnal, 'tanggal' => $tanggal, 'nourut' => $noUrut, 'noakun' => $akundebet, 'keterangan' => $param['namakomponen'] . ' ' . $param['namakaryawan'], 'jumlah' => $param['jumlah'], 'matauang' => 'IDR', 'kurs' => '1', 'kodeorg' => $_SESSION['empl']['lokasitugas'], 'kodekegiatan' => '', 'kodeasset' => '', 'kodebarang' => '', 'nik' => $param['karyawanid'], 'kodecustomer' => '', 'kodesupplier' => '', 'noreferensi' => 'ALK_GAJI', 'noaruskas' => '', 'kodevhc' => '', 'nodok' => '', 'kodeblok' => $param['subbagian'], 'revisi' => '0', 'kodesegment' => $defSegment);
$noUrut++;
# Kredit
$dataRes['detail'][] = array('nojurnal' => $nojurnal, 'tanggal' => $tanggal, 'nourut' => $noUrut, 'noakun' => $akunkredit, 'keterangan' => $param['namakomponen'] . ' ' . $param['namakaryawan'], 'jumlah' => -1 * $param['jumlah'], 'matauang' => 'IDR', 'kurs' => '1', 'kodeorg' => $_SESSION['empl']['lokasitugas'], 'kodekegiatan' => '', 'kodeasset' => '', 'kodebarang' => '', 'nik' => $param['karyawanid'], 'kodecustomer' => '', 'kodesupplier' => '', 'noreferensi' => 'ALK_GAJI', 'noaruskas' => '', 'kodevhc' => '', 'nodok' => '', 'kodeblok' => $param['subbagian'], 'revisi' => '0', 'kodesegment' => $defSegment);
$noUrut++;
/*
#periksa apakah sudah pernah diproses dengan karyawan yang sama
$str="select * from ".$dbname.".keu_jurnaldt where nojurnal
like '".str_replace("-","",$tanggal)."/".$_SESSION['empl']['lokasitugas']."/".$kodeJurnal."/%'
and noakun='".$akundebet."' and nik='".$param['karyawanid']."'";
if(mysql_num_rows(mysql_query($str))>0)
exit("Error: Data sudah pernah di proses");
*
*/
$insHead = insertQuery($dbname, 'keu_jurnalht', $dataRes['header']);
if (!mysql_query($insHead)) {
$headErr .= 'Insert Header BTL Error : ' . mysql_error() . "\n";
}
if (empty($headErr)) {
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Insert Detail
$detailErr = '';
foreach ($dataRes['detail'] as $row) {
$insDet = insertQuery($dbname, 'keu_jurnaldt', $row);
echo $insDet;
if (!mysql_query($insDet)) {
$detailErr .= "Insert Detail Error 2 : " . mysql_error() . "\n";
break;
}
}
if ($detailErr == '') {
# Header and Detail inserted
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Update Kode Jurnal
$updJurnal = updateQuery($dbname, 'keu_5kelompokjurnal', array('nokounter' => $konter), "kodeorg='" . $_SESSION['org']['kodeorganisasi'] . "' and kodekelompok='" . $kodeJurnal . "'");
if (!mysql_query($updJurnal)) {
echo "Update Kode Jurnal Error : " . mysql_error() . "\n";
# Rollback if Update Failed
$RBDet = deleteQuery($dbname, 'keu_jurnalht', "nojurnal='" . $nojurnal . "'");
if (!mysql_query($RBDet)) {
echo "Rollback Delete Header BTL Error : " . mysql_error() . "\n";
exit;
}
exit;
} else {
}
} else {
echo $detailErr;
# Rollback, Delete Header
$RBDet = deleteQuery($dbname, 'keu_jurnalht', "nojurnal='" . $nojurnal . "'");
if (!mysql_query($RBDet)) {
echo "Rollback Delete Header Error : " . mysql_error();
exit;
//.........这里部分代码省略.........
开发者ID:halimc17,项目名称:magsys,代码行数:101,代码来源:keu_slave_prosesAlokasiGajiAkhirbulan.php
示例11: unset
case 'edit':
$data = $_POST;
unset($data['nojurnal']);
$data['tanggal'] = tanggalsystem($data['tanggal']);
//echo "warning: <pre>";
//print_r($data);
//echo "<pre>";
$query = updateQuery($dbname, 'keu_jurnalht', $data, "nojurnal='" . $_POST['nojurnal'] . "'");
if (!mysql_query($query)) {
echo "DB Error : " . mysql_error();
} else {
$data['tanggal'] = tanggalnormal($data['tanggal']);
echo json_encode($data);
}
$dataz['revisi'] = $_POST['revisi'];
$query = updateQuery($dbname, 'keu_jurnaldt', $dataz, "nojurnal='" . $_POST['nojurnal'] . "'");
if (!mysql_query($query)) {
echo "DB Error : " . mysql_error();
}
// else {
// $dataz['revisi'] = $_POST['revisi'];
// echo json_encode($dataz);
// }
break;
case 'delete':
$query = selectQuery($dbname, 'keu_jurnaldt', 'nojurnal', "nojurnal='" . $data['nojurnal'] . "'");
$res = fetchData($query);
if (empty($res)) {
$qDel = "delete from `" . $dbname . "`.`keu_jurnalht` where nojurnal='" . $data['nojurnal'] . "'";
echo $qDel;
if (!mysql_query($qDel)) {
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:keu_slave_jurnal_audit_header.php
示例12: checkPostGet
require_once 'master_validation.php';
require_once 'config/connection.php';
require_once 'lib/nangkoelib.php';
require_once 'lib/zLib.php';
require_once 'lib/fpdf.php';
require_once 'lib/terbilang.php';
$proses = $_GET['proses'];
$kodevhc = checkPostGet('kodevhc', '');
$kmhmakhir = checkPostGet('kmhmakhir', '');
switch ($proses) {
case 'getKm':
$qKm = selectQuery($dbname, 'vhc_kmhm_track', 'kmhmakhir', "kodevhc='" . $kodevhc . "'");
$resKm = fetchData($qKm);
if (empty($resKm)) {
echo 0;
} else {
echo $resKm[0]['kmhmakhir'];
}
break;
case 'reset':
$dataIns = array($kodevhc, $kmhmakhir);
$qIns = insertQuery($dbname, 'vhc_kmhm_track', $dataIns);
if (!mysql_query($qIns)) {
$dataUpd = array('kmhmakhir' => $kmhmakhir);
$qUpd = updateQuery($dbname, 'vhc_kmhm_track', $dataUpd, "kodevhc='" . $kodevhc . "'");
if (!mysql_query($qUpd)) {
exit("Update KM/HM Error: " . mysql_error());
}
}
break;
}
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:tool_slave_reset.php
示例13: mysql_query
$ada = false;
$yCek = mysql_query($xCek) or die(mysql_error());
while ($zCek = mysql_fetch_assoc($yCek)) {
$ada = true;
}
if ($ada == true) {
echo "warning : data already exist ";
exit;
}
// Input Budget BJR
$optThnTnm = makeOption($dbname, 'setup_blok', 'kodeorg,tahuntanam', "kodeorg='" . $kdblok . "'");
$dataIns = array('tahunbudget' => $thnbudget, 'kodeorg' => $kdblok, 'thntanam' => $optThnTnm[$kdblok], 'bjr' => $bjr, 'updateby' => $_SESSION['standard']['userid'], 'lastupdate' => date('Y-m-d H:i:s'), 'close' => 0);
$dataUpd = array('bjr' => $bjr, 'updateby' => $_SESSION['standard']['userid'], 'lastupdate' => date('Y-m-d H:i:s'));
$whereUpd = "tahunbudget='" . $thnbudget . "' and kodeorg='" . $kdblok . "' and thntanam='" . $optThnTnm[$kdblok] . "'";
$insBjr = insertQuery($dbname, 'bgt_bjr', $dataIns);
$updBjr = updateQuery($dbname, 'bgt_bjr', $dataUpd, $whereUpd);
if (!mysql_query($insBjr)) {
if (!mysql_query($updBjr)) {
exit("DB Error: " . mysql_error());
}
}
##UNTUK VALIDASI TAHUN DI BJR
// $iCek="select tahunbudget from ".$dbname.".bgt_bjr where tahunbudget='".$thnbudget."' ";
// exit("Error:$xCek");
// $ada=false;
// $nCek=mysql_query($iCek)or die(mysql_error());
// while($dCek=mysql_fetch_assoc($nCek))
// {
// $ada=true;
// }
// if ($ada==false)
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:bgt_slave_prosuksi_kebun.php
示例14: mysql_error
if (!mysql_query($query)) {
echo "DB Error : " . mysql_error();
}
break;
case 'delete':
$where = "nokonosemen='" . $param['nokonosemen'] . "'";
$query = "delete from `" . $dbname . "`.`log_konosemenht` where " . $where;
if (!mysql_query($query)) {
echo "DB Error : " . mysql_error();
exit;
}
break;
case 'posting':
$data = array('postingkirim' => 1);
$where = "nokonosemen='" . $param['nokonosemen'] . "'";
$query = updateQuery($dbname, 'log_konosemenht', $data, $where);
if (!mysql_query($query)) {
echo "DB Error : " . mysql_error();
}
default:
break;
}
function formHeader($mode, $data)
{
global $dbname;
# Default Value
if (empty($data)) {
$data['nokonosemen'] = 'KS' . date('Ymdhi');
$data['nokonosemenexp'] = '';
$data['kodept'] = '';
$data['kodeorg'] = $_SESSION['empl']['lokasitugas'];
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:log_slave_konosemen.php
示例15: foreach
# Header
foreach ($data['header'] as $key => $dataDet) {
$queryH = insertQuery($dbname, 'keu_jurnalht', $dataDet);
if (!mysql_query($queryH)) {
$errorDB .= "Header :" . mysql_error() . "\n";
}
}
# Detail
if ($errorDB == '') {
foreach ($dataRes['detail'] as $key => $dataDet) {
$queryD = insertQuery($dbname, 'keu_jurnaldt', $dataDet);
if (!mysql_query($queryD)) {
$errorDB .= "Detail " . $key . " :" . mysql_error() . "\n";
}
}
#update jurnal counter
$queryKonter = updateQuery($dbname, 'keu_5kelompokjurnal', array('nokounter' => $konter + 1), "kodeorg='" . $param['pt'] . "' and kodekelompok='" . $kodejurnal . "'");
if (!mysql_query($queryKonter)) {
$errorDB .= "Update Counter Error :" . mysql_error() . "\n" . $errorDB . "___" . $queryKonter;
}
}
if ($errorDB != "") {
# Rollback
foreach ($arrNoJurnal as $key => $nojur) {
$queryRB = "delete from `" . $dbname . "`.`keu_jurnalht` where nojurnal='" . $nojur . "'";
if (!mysql_query($queryRB)) {
$errorDB .= "Rollback 1 Error :" . mysql_error() . "\n";
}
}
echo "Error " . $errorDB;
}
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:keu_slave_3alokasiByRo.php
示例16: updateSettings
function updateSettings($name, $value)
{
$data = array('value' => $value);
if (!updateQuery(TBL_SETTINGS, $data, "name='" . $name . "'")) {
return false;
} else {
return true;
}
}
开发者ID:Dwetech,项目名称:Windowfreak1985,代码行数:9,代码来源:function.php
示例17: unset
if ($data['hutangunit'] == '') {
$data['hutangunit'] = 0;
}
$where = "notransaksi='" . $data['notransaksi'] . "' and kodeorg='" . $data['kodeorg'] . "' and noakun='" . $data['oldNoakun'] . "' and tipetransaksi='" . $data['tipetransaksi'] . "'";
$wheredt = "notransaksi='" . $data['notransaksi'] . "' and kodeorg='" . $data['kodeorg'] . "'";
$datadt['noakun2a'] = $param['noakun'];
$datadt['matauang'] = $param['matauang'];
$datadt['kurs'] = $param['kurs'];
unset($data['notransaksi']);
unset($data['kodeorg']);
unset($data['oldNoakun']);
unset($data['tipetransaksi']);
$data['tanggal'] = tanggalsystem($data['tanggal']);
$data['jumlah'] = str_replace(',', '', $data['jumlah']);
$query = updateQuery($dbname, 'keu_kasbankht', $data, $where);
$querydt = updateQuery($dbname, 'keu_kasbankdt', $datadt, $wheredt);
if (!mysql_query($query)) {
echo "DB Error ht : " . mysql_error();
} else {
if (!mysql_query($querydt)) {
echo "DB Error dt : " . mysql_error();
} else {
echo 'Done.';
}
}
// tadinya ga pake else echo Done, tapi kalo ga pake update-annya ga kesimpen. koq bisa ya?
// tambahan querydt untuk ngupdate noakun2a kasbankdt
break;
case 'delete':
$where = "notransaksi='" . $param['notransaksi'] . "' and kodeorg='" . $param['kodeorg'] . "' and noakun='" . $param['noakun'] . "' and tipetransaksi='" . $param['tipetransaksi'] . "'";
$query = "delete from `" . $dbname . "`.`keu_kasbankht` where " . $where;
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:keu_slave_kasbank.php
示例18: mysql_error
$errCounter = "";
if (!mysql_query($queryJ)) {
$errCounter .= "Update Counter Parameter Jurnal Error :" . mysql_error() . "\n";
}
if ($errCounter != "") {
$queryJRB = updateQuery($dbname, 'keu_5kelompokjurnal', array('nokounter' => $tmpKonter[0]['nokounter']), "kodeorg='" . $_SESSION['org']['kodeorganisasi'] . "' and kodekelompok='" . $dataD[0]['kode'] . "'");
$errCounter = "";
if (!mysql_query($queryJRB)) {
$errorJRB .= "Rollback Parameter Jurnal Error :" . mysql_error() . "\n";
}
echo "DB Error :\n" . $errorJRB;
exit;
}
#=== Add Counter Jurnal Otomatis === =======================================
if ($dataH[0]['hutangunit'] == 1) {
$queryJ = updateQuery($dbname, 'keu_5kelompokjurnal', array('nokounter' => $konteroto), "kodeorg='" . $indukpemilikhutang . "' and kodekelompok='" . $kodejurnal . "'");
$errCounter = "";
if (!mysql_query($queryJ)) {
$errCounter .= "Update Counter Parameter Jurnal Error :" . mysql_error() . "\n";
}
if ($errCounter != "") {
$queryJRB = updateQuery($dbname, 'keu_5kelompokjurnal', array($noKon[0]['nokounter']), "kodeorg='" . $indukpemilikhutang . "' and kodekelompok='" . $kodejurnal . "'");
$errCounter = "";
if (!mysql_query($queryJRB)) {
$errorJRB .= "Rollback Parameter Jurnal Error :" . mysql_error() . "\n";
}
echo "DB Error :\n" . $errorJRB;
exit;
}
}
}
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:keu_slave_kasbank_posting.php
示例19: insertQuery
$query = insertQuery($dbname, 'setup_matauang', $data);
# Insert Data
if (!mysql_query($query)) {
echo "DB Error : " . mysql_error($conn);
}
} elseif ($_POST['proses'] == 'main_edit') {
# Check Valid Data
if ($data['kode'] == '' || $data['matauang'] == '' || $data['simbol'] == '' || $data['kodeiso'] == '') {
echo "Error : Data tidak boleh ada yang kosong";
exit;
}
# Extract Primary Key
unset($data['primField']);
unset($data['primVal']);
$prim = array('field' => $_POST['primField'], 'value' => $_POST['primVal']);
# Create Condition
$where = "`" . $prim['field'] . "`='" . $prim['value'] . "'";
# Make Query
$query = updateQuery($dbname, 'setup_matauang', $data, $where);
# Update Data
if (!mysql_query($query)) {
echo "DB Error : " . mysql_error($conn);
}
} elseif ($_POST['proses'] == 'main_delete') {
# Create Query
$query = "delete from `" . $dbname . "`.`setup_matauang` where `kode`='" . $_POST['primVal'] . "'";
# Delete
if (!mysql_query($query)) {
echo "DB Error : " . mysql_error($conn);
}
}
开发者ID:halimc17,项目名称:magsys,代码行数:31,代码来源:setup_slave_matauang.php
示例20: updateKmHm
function updateKmHm($kodevhc)
{
global $dbname;
// Get KM/HM Akhir
$qKm = selectQuery($dbname, 'vhc_kmhmakhir_vw', '*', "kodevhc='" . $kodevhc . "'");
$resKm = fetchData($qKm);
$kmhmAkhir = empty($resKm) ? 0 : $resKm[0]['kmhmakhir'];
$dataIns = array($kodevhc, $kmhmAkhir);
$qIns = insertQuery($dbname, 'vhc_kmhm_track', $dataIns);
if (!mysql_query($qIns)) {
$dataUpd = array('kmhmakhir' => $kmhmAkhir);
$qUpd = updateQuery($dbname, 'vhc_kmhm_track', $dataUpd, "kodevhc='" . $kodevhc . "'");
if (!mysql_query($qUpd)) {
exit("Update KM/HM Error: " . mysql_error());
}
}
}
开发者ID:halimc17,项目名称:magsys,代码行数:17,代码来源:vhc_slave_service.php
注:本文中的updateQuery函数示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论