本文整理汇总了PHP中get_auto_increment函数的典型用法代码示例。如果您正苦于以下问题:PHP get_auto_increment函数的具体用法?PHP get_auto_increment怎么用?PHP get_auto_increment使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了get_auto_increment函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: store_penetapan_penggunaan
public function store_penetapan_penggunaan($data, $debug = false)
{
$UserNm = $_SESSION['ses_uoperatorid'];
// usernm akan diganti jika session di implementasikan
$nmaset = $data['penggu_nama_aset'];
$nmasetsatker = $data['penggu_satker_aset'];
$penggunaan_id = get_auto_increment("penggunaan");
$ses_uid = $_SESSION['ses_uid'];
$penggu_penet_eks_ket = $data['penggu_penet_eks_ket'];
$penggu_penet_eks_nopenet = $data['penggu_penet_eks_nopenet'];
$penggu_penet_eks_tglpenet = $data['penggu_penet_eks_tglpenet'];
// $olah_tgl= format_tanggal_db2($penggu_penet_eks_tglpenet);
$olah_tgl = $penggu_penet_eks_tglpenet;
$panjang = count($nmaset);
// $query="insert into Penggunaan (Penggunaan_ID, NoSKKDH , TglSKKDH,
// Keterangan, NotUse, TglUpdate, UserNm, FixPenggunaan, GUID)
// values (null,'$penggu_penet_eks_nopenet','$olah_tgl', '$penggu_penet_eks_ket','','$olah_tgl','$UserNm','1','$ses_uid')";
$sql = array('table' => 'Penggunaan', 'field' => 'NoSKKDH , TglSKKDH, Keterangan, NotUse, TglUpdate, UserNm, FixPenggunaan, GUID', 'value' => "'{$penggu_penet_eks_nopenet}','{$olah_tgl}', '{$penggu_penet_eks_ket}','0','{$olah_tgl}','{$UserNm}','0','{$ses_uid}'");
$res = $this->db->lazyQuery($sql, $debug, 1);
for ($i = 0; $i < $panjang; $i++) {
$tmp = $nmaset[$i];
$tmp_olah = explode("<br>", $tmp);
$asset_id[$i] = $tmp_olah[0];
$no_reg[$i] = $tmp_olah[1];
$nm_barang[$i] = $tmp_olah[2];
// $query1="insert into PenggunaanAset(Penggunaan_ID,Aset_ID) values('$penggunaan_id','$asset_id[$i]') ";
$sql1 = array('table' => 'Penggunaanaset', 'field' => "Penggunaan_ID,Aset_ID, kodeSatker", 'value' => "'{$penggunaan_id}','{$nmaset[$i]}', '{$nmasetsatker[$i]}'");
$res = $this->db->lazyQuery($sql1, $debug, 1);
// $query2="UPDATE Aset SET NotUse=1, LastPenggunaan_ID='$penggunaan_id' WHERE Aset_ID='$asset_id[$i]'";
$sql2 = array('table' => 'Aset', 'field' => "NotUse=1", 'condition' => "Aset_ID='{$asset_id[$i]}'", 'limit' => '1');
$res = $this->db->lazyQuery($sql2, $debug, 2);
}
$removeAsetList = $this->removeAsetList('PNGGU');
if ($res) {
return $res;
}
return false;
}
示例2: usulan
function usulan($guid, $kontrak, $debug = false)
{
$getAset = $this->getAset($guid, $kontrak);
$noKontrak = array_keys($getAset['fullData']);
// pr($getAset);
// exit;
$UserNm = $_SESSION['ses_uoperatorid'];
// usernm akan diganti jika session di implementasikan
$nmaset = explode(',', $getAset['asetid']);
$nmasetsatker = $guid;
$penggunaan_id = get_auto_increment("penggunaan");
$ses_uid = $_SESSION['ses_uid'];
$penggu_penet_eks_ket = "migrasi penggunaan";
$penggu_penet_eks_nopenet = $noKontrak[0];
$penggu_penet_eks_tglpenet = $data['penggu_penet_eks_tglpenet'];
$olah_tgl = date('Y-m-d H:i:s');
$TglSKKDH = "2014-12-31";
$panjang = count($nmaset);
$sql = array('table' => 'Penggunaan', 'field' => 'NoSKKDH , TglSKKDH, Keterangan, NotUse, TglUpdate, UserNm, FixPenggunaan, GUID', 'value' => "'{$penggu_penet_eks_nopenet}','{$TglSKKDH}', '{$penggu_penet_eks_ket}','0','{$olah_tgl}','{$UserNm}','0','{$ses_uid}'");
$res = $this->db->lazyQuery($sql, $debug, 1);
$insertid = $this->db->insert_id();
$sleep = 1;
for ($i = 0; $i < $panjang; $i++) {
$sql1 = array('table' => 'Penggunaanaset', 'field' => "Penggunaan_ID,Aset_ID, kodeSatker", 'value' => "'{$penggunaan_id}','{$nmaset[$i]}', '{$nmasetsatker}'");
$res = $this->db->lazyQuery($sql1, $debug, 1);
$sql2 = array('table' => 'Aset', 'field' => "NotUse=1", 'condition' => "Aset_ID='{$nmaset[$i]}'", 'limit' => '1');
$res = $this->db->lazyQuery($sql2, $debug, 2);
$sleep++;
if ($sleep == 200) {
sleep(1);
$sleep = 1;
}
}
if ($res) {
return $insertid;
}
return false;
}
示例3: Save_account_audit
public function Save_account_audit()
{
$error = '';
// VALIDATE
$error = $this->Get_trans_date_range($trans_id, $min_date, $max_trans_id, $max_date);
if ($error != '') {
return $error;
}
$min_time = strtotime($min_date);
$max_time = NULL;
if ($max_date != NULL) {
$max_time = strtotime($max_date);
}
// Make sure we're the last transaction on this date
$date = date(DISPLAY_DATE, $min_time);
if ($min_date == $max_date && $trans_id < $max_trans_id) {
$error = "Transaction {$trans_id} is not the last transaction " . "for this account on {$date}; unable to audit.";
} elseif ($min_time > $this->m_audit_time) {
// Make sure the audit date is >= accounting date of the transaction
$error = "The audit date must be no less than the transaction " . "accounting date, {$date}.";
} elseif ($max_time != NULL && $max_time <= $this->m_audit_time) {
$date = date(DISPLAY_DATE, $max_time);
$error = "The audit date must be less than the next transaction " . "date for this account, ID {$max_trans_id} on {$date}.";
}
if ($error != '') {
return $error;
}
// TODO: make sure the date doesn't exceed map to another transaction
// for this account
$pdo = db_connect_pdo();
$pdo->beginTransaction();
$ps = NULL;
if ($this->m_audit_id > -1) {
// Update an existing record (date & comment)
$sql = "UPDATE AccountAudits \n" . "SET audit_date = :audit_date, " . " audit_comment = :audit_comment \n" . "WHERE audit_id = :audit_id ";
$ps = $pdo->prepare($sql);
$auditDate = $this->get_audit_date_sql();
$ps->bindParam(':audit_date', $auditDate);
$ps->bindParam(':audit_comment', $this->m_audit_comment);
$ps->bindParam(':audit_id', $this->m_audit_id);
} else {
$sql = "INSERT INTO AccountAudits \n" . "( ledger_id, audit_date, account_balance, audit_comment ) \n" . "VALUES( :ledger_id, :audit_date, :account_balance, " . ":audit_comment ) ";
$ps = $pdo->prepare($sql);
$ps->bindParam(':ledger_id', $this->m_ledger_id);
$auditDate = $this->get_audit_date_sql();
$ps->bindParam(':audit_date', $auditDate);
$accBalance = $this->get_account_balance(true);
$ps->bindParam(':account_balance', $accBalance);
$ps->bindParam(':audit_comment', $this->m_audit_comment);
}
if ($ps == FALSE) {
// sql problem
return get_pdo_error($ps);
}
$success = $ps->execute();
if (!$success) {
return get_pdo_error($ps);
}
if ($this->m_audit_id < 0) {
// Update the primary key
$this->m_audit_id = get_auto_increment($pdo);
}
$pdo->commit();
$pdo = null;
// Reload from DB (will get updated_time)
$error = $this->Load_account_audit($this->m_audit_id);
return $error;
}
示例4: alert
<?php
include "../../config/config.php";
$menu_id = 42;
($SessionUser['ses_uid']!='') ? $Session = $SessionUser : $Session = $SESSION->get_session(array('title'=>'GuestMenu', 'ses_name'=>'menu_without_login'));
$SessionUser = $SESSION->get_session_user();
$USERAUTH->FrontEnd_check_akses_menu($menu_id, $SessionUser);
$UserNm=$_SESSION['ses_uname'];// usernm akan diganti jika session di implementasikan
$nmaset=$_POST['pemindahtanganan_usul_nama_aset'];
$usulan_id=get_auto_increment("Usulan");
$date=date('Y-m-d');
$ses_uid=$_SESSION['ses_uid'];
$dataArr = $STORE->store_usulan_pemindahtanganan(
$UserNm,
$nmaset,
$usulan_id,
$date,
$ses_uid
);
echo "<script>
alert('Data Sudah Diusulkan.. !!!');
document.location='$url_rewrite/module/pemindahtanganan/usulan_pemindahtanganan_aset.php?usulan_id=$usulan_id';
</script>";
?>
示例5: format_tanggal_db2
$tgl=$_POST['mutasi_trans_eks_tglproses'];
$olah_tgl= format_tanggal_db2($tgl);
$alasan=$_POST['mutasi_trans_eks_alasan'];
$pemakai=$_POST['mutasi_trans_eks_pemakai'];
$UserNm=$_SESSION['ses_uname'];// usernm akan diganti jika session di implementasikan
$nmaset=$_POST['mutasi_nama_aset'];
$asset_id=Array();
$no_reg=Array();
$nm_barang=Array();
$panjang=count($nmaset);
$mutasi_id=get_auto_increment("Mutasi");
//Insert ke Mutasi
$query="INSERT INTO Mutasi (Mutasi_ID, NoSKKDH , TglSKKDH,
Keterangan, SatkerTujuan, NotUse, TglUpdate,
UserNm, FixMutasi, Pemakai)
values ('','$nodok','$olah_tgl',
'$alasan','$satker','','$olah_tgl','$UserNm','1','$pemakai')";
$result= mysql_query($query) or die(mysql_error());
//dapetin kode satker dan kode unit
$query_satker_id="SELECT * FROM Satker WHERE Satker_ID='$satker'";
$exec_query_satker_id=mysql_query($query_satker_id) or die(mysql_error());
$hsl_query_satker_id=mysql_fetch_array($exec_query_satker_id);
示例6: format_tanggal_db2
$tgl_selesai=$_POST['peman_penet_eks_tglselesai'];
$olah_tgl_selesai= format_tanggal_db2($tgl_selesai);
$jangka_waktu=$_POST['peman_penet_eks_jangkawaktu'];
// pr($_POST);
$data = $PEMANFAATAN->pemanfaatan_penetapan_tambah_proses($_POST);
if ($data){
echo "<script>alert('Data Berhasil Disimpan'); document.location='$url_rewrite/module/pemanfaatan/pemanfaatan_penetapan_daftar.php?pid=1';</script>";
}
exit;
$pemanfaatan_id=get_auto_increment("Pemanfaatan");
$query="insert into Pemanfaatan (Pemanfaatan_ID, NoSKKDH, TipePemanfaatan, AlamatPartner,
Keterangan, TglSKKDH, NamaPartner, UserNm, TglUpdate,
TglMulai, TglSelesai, JangkaWaktu, FixPemanfaatan, Aset_ID,Status)
values (null,'$no','$tipe','$alamat_partner',
'$ket','$olah_tgl','$nama_partner','$UserNm','$olah_tgl',
'$olah_tgl_mulai','$olah_tgl_selesai','$jangka_waktu','0','$aseid','0')";
$result= mysql_query($query) or die(mysql_error());
for($i=0;$i<$panjang;$i++){
$tmp=$nmaset[$i];
$tmp_olah=explode("<br/>",$tmp);
开发者ID:TrinataBhayanaka,项目名称:simbada-tangsel,代码行数:31,代码来源:pemanfaatan_penetapan_eksekusi_data_proses.php
示例7: usulan
function usulan($dataAset, $nodok, $debug = false)
{
// pr($dataAset);
$jenisaset = $data['jenisaset'];
$olah_tgl = date('Y-m-d H:i:s');
$alasan = "Mutasi [importing]";
$pemakai = "Sekolah";
$kodeKelompok = $data['kodeKelompok'];
$TglSKKDH = "2014-12-31";
$UserNm = $_SESSION['ses_uoperatorid'];
// usernm akan diganti jika session di implementasikan
// $nmaset=$getPenggunaan;
$asset_id = array();
$no_reg = array();
$nm_barang = array();
// $asetKapitalisasi = array_keys($_POST['asetKapitalisasi']);
// $asetKapitalisasiOri = $_POST['asetKapitalisasi'];
$mutasi_id = get_auto_increment("Mutasi");
logFile('Start transaksi mutasi');
// pr($jenisaset);
$listTable = array('B' => 'mesin', 'E' => 'asetlain', 'H' => 'aset');
// pr($getKodeSatker);
$no = 1;
foreach ($dataAset['aset'] as $tipe => $value) {
foreach ($value as $satkerTujuan => $val) {
$sql = array('table' => "Mutasi", 'field' => "NoSKKDH , TglSKKDH, Keterangan, SatkerTujuan, NotUse, TglUpdate, UserNm, FixMutasi, Pemakai", 'value' => "'{$nodok}','{$TglSKKDH}', '{$alasan}','{$satkerTujuan}',0,'{$olah_tgl}','1','1','{$pemakai}'");
$res = $this->db->lazyQuery($sql, $debug, 1);
$mutasiIDReturn = $this->db->insert_id();
foreach ($val as $key => $v) {
$gabung_nomor_reg_tujuan = 0;
// $nmaset = $key;
// $panjang=count($nmaset);
// $sleep = 1;
usleep(100);
$this->db->logIt($tabel = array($listTable[$tipe]), $Aset_ID = $key, $kd_riwayat = 3, $noDokumen = $nodok, $tglProses = $olah_tgl, $text = "Sukses Mutasi");
// exit;
// $getJenisAset = $this->getJenisAset($nmaset);
// $getKIB = $this->getTableKibAlias($getJenisAset[$i]);
$asset_id = $key;
// $getLokasiTujuan = $this->get_satker_tujuan($data['Mutasi_ID'], $data['aset_id'][$key]);
$satkerAwal = $v['kodeSatker'];
$kelompokAwal = $v['kodeKelompok'];
$lokasiAwal = $v['kodeLokasi'];
$registerAwal = $v['noRegister'];
$namaSatkerAwal = "DINAS PENDIDIKAN, PEMUDA DAN OLAHRAGA";
$lokasiBaru = ubahLokasi($lokasiAwal, $satkerTujuan);
// pr($lokasiBaru);
// exit;
$sqlSelect = array('table' => "Aset", 'field' => "MAX( CAST( noRegister AS SIGNED ) ) AS noRegister", 'condition' => "kodeKelompok = '{$kelompokAwal}' AND kodeLokasi = '{$lokasiBaru}'");
$result = $this->db->lazyQuery($sqlSelect, $debug);
$gabung_nomor_reg_tujuan = intval($result[0]['noRegister'] + 1);
// if (!in_array($asset_id, $asetKapitalisasi)){
$sql1 = array('table' => "MutasiAset", 'field' => "Mutasi_ID,Aset_ID,NamaSatkerAwal, NomorRegAwal,NomorRegBaru,SatkerAwal,SatkerTujuan, Status", 'value' => "'{$mutasi_id}','{$asset_id}','{$namaSatkerAwal}','{$registerAwal}','{$gabung_nomor_reg_tujuan}','{$satkerAwal}','{$satkerTujuan}', 1");
$res1 = $this->db->lazyQuery($sql1, $debug, 1);
$sql2 = array('table' => "Aset", 'field' => "TglPembukuan = '{$TglSKKDH}', StatusValidasi = 1, Status_Validasi_Barang = 1, noRegister = '{$gabung_nomor_reg_tujuan}', kodeSatker = '{$satkerTujuan}', kodeLokasi = '{$lokasiBaru}',NotUse = 0, fixPenggunaan = 0, statusPemanfaatan = 0", 'condition' => "Aset_ID='{$asset_id}'");
$res2 = $this->db->lazyQuery($sql2, $debug, 2);
$ignoreTable = array('F', 'H');
if (!in_array($tipe, $ignoreTable)) {
$sqlKib = array('table' => "{$listTable[$tipe]}", 'field' => "TglPembukuan = '{$TglSKKDH}', StatusValidasi = 1, Status_Validasi_Barang = 1, StatusTampil = 1, noRegister = '{$gabung_nomor_reg_tujuan}', kodeSatker = '{$satkerTujuan}', kodeLokasi = '{$lokasiBaru}'", 'condition' => "Aset_ID='{$asset_id}'");
$resKib = $this->db->lazyQuery($sqlKib, $debug, 2);
}
$sql3 = array('table' => "PenggunaanAset", 'field' => "StatusMutasi=1, Mutasi_ID='{$mutasi_id}'", 'condition' => "Aset_ID='{$asset_id}'");
$res3 = $this->db->lazyQuery($sql3, $debug, 2);
echo 'Data ke : ' . $no . "\n";
$no++;
}
}
}
return true;
}
示例8: store_penetapan_penghapusan
public function store_penetapan_penghapusan($data, $debug = false)
{
// pr($data);
$no = $data['bup_pp_noskpenghapusan'];
$tgl = $data['bup_pp_tanggal'];
$olah_tgl = format_tanggal_db2($tgl);
$keterangan = $data['bup_pp_get_keterangan'];
$UserNm = $_SESSION['ses_uoperatorid'];
// usernm akan diganti jika session di implementasikan
$nmaset = $data['penghapusan_nama_aset'];
$ses_uid = $_SESSION[ses_uid];
$penghapusan_id = get_auto_increment("penghapusan");
$jenis_hapus = $_SESSION['jenis_hapus'];
$asset_id = array();
$no_reg = array();
$nm_barang = array();
$panjang = count($nmaset);
$sql = array('table' => 'penghapusan', 'field' => 'Penghapusan_ID, NoSKHapus, TglHapus, AlasanHapus, Jenis_Hapus, Status, UserNm, FixPenghapusan', 'value' => "'','{$no}', '{$olah_tgl}', '{$keterangan}','{$jenis_hapus}', '0','{$UserNm}', '1'");
$res = $this->db->lazyQuery($sql, $debug, 1);
/*
$query="INSERT INTO penghapusan (Penghapusan_ID, NoSKHapus, TglHapus, AlasanHapus, Status, UserNm, FixPenghapusan)
values ('','$no', '$olah_tgl', '$keterangan', '0','$UserNm', '1')";
$result= $this->query($query) or die($this->error());
*/
for ($i = 0; $i < $panjang; $i++) {
$tmp = $nmaset[$i];
$tmp_olah = explode("<br>", $tmp);
$asset_id[$i] = $tmp_olah[0];
$no_reg[$i] = $tmp_olah[1];
$nm_barang[$i] = $tmp_olah[2];
/*echo "No= $i <br/>
Asset ID =$asset_id[$i] <br/>
No register=$no_reg[$i] <br/>
Nama barang =$nm_barang[$i] <br/>";
*
*/
$sql1 = array('table' => 'penghapusanaset', 'field' => 'Penghapusan_ID,Aset_ID,Status,Jenis_Hapus', 'value' => "'{$penghapusan_id}','{$asset_id[$i]}','0','{$jenis_hapus}'");
$res1 = $this->db->lazyQuery($sql1, $debug, 1);
/*
$query1="insert into penghapusanaset(Penghapusan_ID,Aset_ID,Status) values('$penghapusan_id','$asset_id[$i]','0')";
$result1= $this->query($query1) or die($this->error());
*/
$sql2 = array('table' => 'usulanaset', 'field' => "StatusPenetapan=1, Penetapan_ID='{$penghapusan_id}'", 'condition' => "Aset_ID='{$asset_id[$i]}' AND Jenis_Usulan='{$jenis_hapus}'");
$res2 = $this->db->lazyQuery($sql2, $debug, 2);
/*
$query2="UPDATE usulanaset SET StatusPenetapan=1, Penetapan_ID='$penghapusan_id' WHERE Aset_ID='$asset_id[$i]' AND Jenis_Usulan='HPS'";
$result2=$this->query($query2) or die($this->error());
*/
$sql3 = array('table' => 'aset', 'field' => "Dihapus='1'", 'condition' => "Aset_ID='{$asset_id[$i]}'");
$res3 = $this->db->lazyQuery($sql3, $debug, 2);
/*
$query3="UPDATE aset SET Dihapus='1' WHERE Aset_ID='$asset_id[$i]'";
$result3=$this->query($query3) or die($this->error());*/
}
// $query_hapus_apl="DELETE FROM apl_userasetlist WHERE aset_action='penetapanpenghapusan[]' AND UserSes='$ses_uid'";
// $exec_hapus= $this->query($query_hapus_apl) or die($this->error());
// if($result)
// {
// return true;
// }
// elseif($result1)
// {
// return true;
// }
// else
// {
// return false;
// }
}
示例9: Save_transaction
private function Save_transaction($checkAudits)
{
$error = '';
// Formatting for save
$trans_comment = $this->m_trans_comment;
$check_number = $this->m_check_number;
$gas_miles = $this->m_gas_miles;
$gas_gallons = $this->m_gas_gallons;
// no longer need special null handling ?
/*
if (is_null ($trans_comment))
$trans_comment = 'NULL';
else
$trans_comment = "'$trans_comment'"; //enclose in quotes for non null
if (is_null ($check_number))
$check_number = 'NULL';
if (is_null ($gas_miles))
$gas_miles = 'NULL';
if (is_null ($gas_gallons))
$gas_gallons = 'NULL';
*/
// Query the audit table to check for conflicts
if ($checkAudits) {
$error = $this->Check_audits();
if ($error != '') {
return $error;
}
}
$pdo = db_connect_pdo();
$pdo->beginTransaction();
if (is_string($pdo)) {
return $pdo;
}
$ps = null;
if ($this->m_trans_id == -1) {
// Either this hasn't been inserted, or we are doing repeat
// insertions.
// INSERT
$sql = "INSERT INTO Transactions \n" . "(login_id, trans_descr, trans_date, accounting_date, " . " trans_vendor, trans_comment, check_number, gas_miles, " . " gas_gallons, trans_status, budget_date, exclude_from_budget) \n" . "VALUES( :login_id, :descr, :trans_date, " . " :accounting_date, :vendor, :comment, :check_num, " . " :gas_miles, :gas_gallons, :status, :budget_date, :exclude_budget ) ";
$ps = $pdo->prepare($sql);
} else {
// UPDATE
$sql = "UPDATE Transactions \n" . "SET login_id = :login_id, " . " trans_descr = :descr, " . " trans_date = :trans_date, " . " accounting_date = :accounting_date, " . " trans_vendor = :vendor, " . " trans_comment = :comment, " . " check_number = :check_num, " . " gas_miles = :gas_miles, " . " gas_gallons = :gas_gallons, " . " trans_status = :status, " . " budget_date = :budget_date, " . " exclude_from_budget = :exclude_budget \n " . "WHERE trans_id = :trans_id ";
$ps = $pdo->prepare($sql);
// the only additional param is the trans id
$ps->bindParam(':trans_id', $this->m_trans_id, PDO::PARAM_INT);
}
// set all generic params
$ps->bindParam(':login_id', $this->m_login_id, PDO::PARAM_INT);
$ps->bindParam(':descr', $this->m_trans_descr);
$transDate = $this->get_trans_date_sql();
$ps->bindParam(':trans_date', $transDate);
$accDate = $this->get_accounting_date_sql();
$ps->bindParam(':accounting_date', $accDate);
$ps->bindParam(':vendor', $this->m_trans_vendor);
$ps->bindParam(':comment', $trans_comment);
$ps->bindParam(':check_num', $check_number);
$ps->bindParam(':gas_miles', $gas_miles);
$ps->bindParam(':gas_gallons', $gas_gallons);
$ps->bindParam(':status', $this->m_trans_status, PDO::PARAM_INT);
$budgetDate = $this->get_budget_date_sql();
$ps->bindParam(':budget_date', $budgetDate);
$ps->bindParam(':exclude_budget', $this->m_exclude_budget);
$success = $ps->execute();
$error = get_pdo_error($ps);
if ($error != '') {
return $error . $ps->debugDumpParams();
}
$ledger_inserts = 0;
if ($this->m_trans_id == -1) {
// get id from the insert
$this->m_trans_id = get_auto_increment($pdo, 'transactions_trans_id_seq');
if ($this->m_trans_id < 1) {
return 'Invalid auto_increment val: ' . $this->m_trans_id;
}
}
// prepare all queries
$psInsert = $pdo->prepare("INSERT INTO Ledger_Entries \n" . "(trans_id, account_id, ledger_amount) \n" . "VALUES(:trans_id, :account_id, :ledger_amount)");
$psDelete = $pdo->prepare("DELETE from Ledger_Entries \n" . "WHERE ledger_id = :ledger_id");
$psUpdate = $pdo->prepare("UPDATE Ledger_Entries \n" . "SET account_id= :account_id, " . " ledger_amount= :ledger_amount \n" . "WHERE ledger_id= :ledger_id ");
$ps = NULL;
// insert the individual ledger entries
// Combine the LHS & RHS lists
$ledger_list = array_merge($this->m_ledgerL_list, $this->m_ledgerR_list);
foreach ($ledger_list as $ledger) {
if ($ledger->ledgerId == -1) {
// no ledger_id; new record.
$psInsert->bindParam(':trans_id', $this->m_trans_id, PDO::PARAM_INT);
$psInsert->bindParam(':account_id', $ledger->accountId, PDO::PARAM_INT);
$psInsert->bindParam(':ledger_amount', $ledger->amount);
$ps = $psInsert;
} else {
if (trim($ledger->amount == '')) {
// An existing ledger entry is being deleted
$psDelete->bindparam(':ledger_id', $ledger->ledgerId, PDO::PARAM_INT);
$ps = $psDelete;
} else {
// UPDATE an existing ledger entry
$psUpdate->bindParam(':account_id', $ledger->accountId, PDO::PARAM_INT);
$psUpdate->bindParam(':ledger_amount', $ledger->amount);
//.........这里部分代码省略.........
示例10: format_tanggal_db2
$no=$_POST['peman_pengem_eks_nobast'];
$tgl=$_POST['peman_pengem_eks_tglbast'];
$olah_tgl= format_tanggal_db2($tgl);
$lokasi=$_POST['peman_pengem_eks_lokasi_serah_terima'];
$nama1=$_POST['peman_pengem_eks_nm1'];
$nama2=$_POST['peman_pengem_eks_nm2'];
$jabatan1=$_POST['peman_pengem_eks_jabatan1'];
$jabatan2=$_POST['peman_pengem_eks_jabatan2'];
$nip1=$_POST['peman_pengem_eks_nip1'];
$nip2=$_POST['peman_pengem_eks_nip2'];
$lokasi1=$_POST['peman_pengem_eks_lokasi1'];
$lokasi2=$_POST['peman_pengem_eks_lokasi2'];
// pr($_POST);
// exit;
$pengembalian_id=get_auto_increment("bast_pengembalian");
$query="insert into bast_pengembalian (BAST_Pengembalian_ID, NoBAST, TglBAST, NamaPihak1,
JabatanPihak1, NIPPihak1, NamaPihak2, JabatanPihak2, NIPPihak2, UserNm,
TglUpdate, LokasiPihak1, LokasiPihak2, LokasiBAST, GUID, FixPengembalian)
values ('','$no','$olah_tgl','$nama1','$jabatan1','$nip1',
'$nama2','$jabatan2','$nip2','$UserNm','$olah_tgl',
'$lokasi1','$lokasi2','$lokasi','','1')";
// pr($query);
$result= mysql_query($query) or die(mysql_error());
for($i=0;$i<$panjang;$i++){
$tmp=$nmaset[$i];
// pr($tmp);
$tmp_olah=explode("<br/>",$tmp);
// pr($tmp_olah);
开发者ID:TrinataBhayanaka,项目名称:simbada-tangsel,代码行数:31,代码来源:pemanfaatan_pengembalian_eksekusi_data_proses.php
示例11: get_auto_increment
<?php
include "../../config/config.php";
$menu_id = 43;
$SessionUser['ses_uid'] != '' ? $Session = $SessionUser : ($Session = $SESSION->get_session(array('title' => 'GuestMenu', 'ses_name' => 'menu_without_login')));
$SessionUser = $SESSION->get_session_user();
$USERAUTH->FrontEnd_check_akses_menu($menu_id, $SessionUser);
$pemindahtanganan_id = get_auto_increment("BASP");
$UserNm = $_SESSION['ses_uname'];
// usernm akan diganti jika session di implementasikan
$guid = $_SESSION['ses_uid'];
$nmaset = $_POST['pemindahtanganan_penet_nama_aset'];
$no_penetapan = $_POST['NoBASP'];
$tgl_penetapan = $_POST['TglBAST'];
$no_bast = $_POST['bupt_bast_nobast'];
$tgl_bast = $_POST['bupt_bast_tglbast'];
$olah_tgl_penetapan = format_tanggal_db2($tgl_penetapan);
$olah_tgl_bast = format_tanggal_db2($tgl_bast);
$lokasi_basp = $_POST['LokasiBASP'];
$tipe_pemindahtanganan = $_POST['bupt_bast_tipepemindahtanganan'];
$peruntukan = $_POST['bupt_bast_peruntukan'];
$alamat_pihak_kedua = $_POST['bupt_bast_alamat'];
$nama1 = $_POST['bupt_bast_nama_1'];
$jabatan1 = $_POST['bupt_bast_jabatan_1'];
$nip1 = $_POST['bupt_bast_nip_1'];
$lokasi1 = $_POST['bupt_bast_lokasi_1'];
$nama2 = $_POST['bupt_bast_nama_2'];
$jabatan2 = $_POST['bupt_bast_jabatan_2'];
$nip2 = $_POST['bupt_bast_nip_2'];
$lokasi2 = $_POST['bupt_bast_lokasi_2'];
$submit = $_POST['btn_action'];
开发者ID:TrinataBhayanaka,项目名称:simbada-tangsel,代码行数:31,代码来源:tambah_penetapan_pemindahtanganan_proses.php
示例12:
<?php
include "../../config/config.php";
$menu_id = 30;
($SessionUser['ses_uid']!='') ? $Session = $SessionUser : $Session = $SESSION->get_session(array('title'=>'GuestMenu', 'ses_name'=>'menu_without_login'));
$SessionUser = $SESSION->get_session_user();
$USERAUTH->FrontEnd_check_akses_menu($menu_id, $SessionUser);
$submit=$_POST['penggunaan_eks'];
$UserNm=$_SESSION['ses_uname'];// usernm akan diganti jika session di implementasikan
$nmaset=$_POST['penggu_nama_aset'];
$penggunaan_id=get_auto_increment("Penggunaan");
$ses_uid=$_SESSION['ses_uid'];
$penggu_penet_eks_ket=$_POST['penggu_penet_eks_ket'];
$penggu_penet_eks_nopenet=$_POST['penggu_penet_eks_nopenet'];
$penggu_penet_eks_tglpenet=$_POST['penggu_penet_eks_tglpenet'];
$olah_tgl= format_tanggal_db2($penggu_penet_eks_tglpenet);
$data=$STORE->store_penetapan_penggunaan
(
$submit,
$UserNm,
$nmaset,
$penggunaan_id,
$ses_uid,
$penggu_penet_eks_ket,
$penggu_penet_eks_nopenet,
$penggu_penet_eks_tglpenet,
开发者ID:TrinataBhayanaka,项目名称:simbada-tangsel,代码行数:31,代码来源:penggunaan_penetapan_eksekusi_data_proses.php
示例13: explode
$p_pmusnah_keterangan=$_POST['p_pmusnah_keterangan'];
$p_pmusnah_noskpenetapan=$_POST['p_pmusnah_noskpenetapan'];
$p_pmusnah_tglskpenetapa = $_POST['p_pmusnah_tglskpenetapan']; ///bulan/tanggal/tahun
$datet= explode('/', $p_pmusnah_tglskpenetapa); ///
$p_pmusnah_tglskpenetapan= $datet[2].$datet[1].$datet[0];
$p_pmusnah_noskhapus=$_POST['p_pmusnah_noskhapus'];
$p_pmusnah_tglskhapu= $_POST['p_pmusnah_tglskhapus']; ///bulan/tanggal/tahun
$dateu = explode('/', $p_pmusnah_tglskhapu); ///
$p_pmusnah_tglskhapus = $dateu[2].$dateu[1].$dateu[0];
if (Pemusnahan_ID !='')
{
//delete
$Get_Pemusnahan_ID= get_auto_increment("Pemusnahan");
$querypemusnahan= "INSERT INTO Pemusnahan(Pemusnahan_ID, KetPemusnahan,Aset_ID,NoSKPenetapan,TglSKPenetapan,NoSKPenghapusan,TglSKPenghapusan)
VALUES($Get_Pemusnahan_ID, '$p_pmusnah_keterangan','$Aset_ID','$p_pmusnah_noskpenetapan','$p_pmusnah_tglskpenetapan',
'$p_pmusnah_noskhapus','$p_pmusnah_tglskhapus')";
$resultpemusnahan = mysql_query($querypemusnahan) or die ('eror pemusnahan insert');
($resultpemusnahan) ? $Pemusnahan_ID = $Get_Pemusnahan_ID : $Pemusnahan_ID = $Pemusnahan_ID;
$queryaset=" UPDATE Aset SET
BAPemusnahan_ID = '$Pemusnahan_ID'
WHERE Aset_ID = $Aset_ID";
// print_r($queryaset);
$resultaset= mysql_query($queryaset)or die ('eror update bap');
示例14: store_penetapan_penghapusan_pmOLDs
public function store_penetapan_penghapusan_pmOLDs($data, $debug = false)
{
////////////////////////////////////////pr($data);
// ////////////////////////////////////////pr($data['UsulanID']);
// $sql2 = array(
// 'table'=>'usulanaset',
// 'field'=>"StatusKonfirmasi=2",
// 'condition' => "Aset_ID='$data[asetid]'",
// );
// $res2 = $this->db->lazyQuery($sql2,$debug,2);
$UsulID = array();
foreach ($data['UsulanID'] as $keyUslID => $valueUslID) {
// ////////////////////////////////////////pr($valueUslID);
if (!in_array($valueUslID, $UsulID)) {
$UsulID[] = $valueUslID;
}
// ////////////////////////////////////////pr($UsulID);
}
////////////////////////////////////////pr($UsulID);
// exit;
$UsulanID = implode(",", $UsulID);
// ////////////////////////////////////////pr($UsulanID);
// exit;
$no = $data['bup_pp_noskpenghapusan'];
$tgl = $data['bup_pp_tanggal'];
$olah_tgl = format_tanggal_db2($tgl);
$keterangan = $data['bup_pp_get_keterangan'];
$UserNm = $_SESSION['ses_uoperatorid'];
// usernm akan diganti jika session di implementasikan
$nmaset = $data['penghapusan_nama_aset'];
$ses_uid = $_SESSION[ses_uid];
$penghapusan_id = get_auto_increment("penghapusan");
$jenis_hapus = "PMS";
$asset_id = array();
$no_reg = array();
$nm_barang = array();
$panjang = count($nmaset);
$sql = array('table' => 'penghapusan', 'field' => 'Penghapusan_ID,Usulan_ID, NoSKHapus, TglHapus, AlasanHapus, Jenis_Hapus, Status, UserNm, FixPenghapusan', 'value' => "'0','{$UsulanID}','{$no}', '{$olah_tgl}', '{$keterangan}','{$jenis_hapus}', '0','{$UserNm}', '1'");
// ////////////////////////////////////////pr($sql);
$res = $this->db->lazyQuery($sql, $debug, 1);
// exit;
for ($i = 0; $i < $panjang; $i++) {
$tmp = $nmaset[$i];
$tmp_olah = explode("<br>", $tmp);
$asset_id[$i] = $tmp_olah[0];
$no_reg[$i] = $tmp_olah[1];
$nm_barang[$i] = $tmp_olah[2];
$sql1 = array('table' => 'penghapusanaset', 'field' => 'Penghapusan_ID,Aset_ID,Status,Jenis_Hapus', 'value' => "'{$penghapusan_id}','{$asset_id[$i]}','0','{$jenis_hapus}'");
// ////////////////////////////////////////pr($sql1);
$res1 = $this->db->lazyQuery($sql1, $debug, 1);
/*
$query1="insert into penghapusanaset(Penghapusan_ID,Aset_ID,Status) values('$penghapusan_id','$asset_id[$i]','0')";
$result1= $this->query($query1) or die($this->error());
*/
$sql2 = array('table' => 'usulanaset', 'field' => "StatusPenetapan=1, Penetapan_ID='{$penghapusan_id}'", 'condition' => "Aset_ID='{$asset_id[$i]}' AND Jenis_Usulan='{$jenis_hapus}'");
// ////////////////////////////////////////pr($sql2);
$res2 = $this->db->lazyQuery($sql2, $debug, 2);
$sqlusul = array('table' => 'usulan', 'field' => "StatusPenetapan=1, Penetapan_ID='{$penghapusan_id}'", 'condition' => "Usulan_ID IN ({$UsulanID}) AND Jenis_Usulan='{$jenis_hapus}'");
// ////////////////////////////////////////pr($sqlusul);
$resusul = $this->db->lazyQuery($sqlusul, $debug, 2);
/*
$query2="UPDATE usulanaset SET StatusPenetapan=1, Penetapan_ID='$penghapusan_id' WHERE Aset_ID='$asset_id[$i]' AND Jenis_Usulan='HPS'";
$result2=$this->query($query2) or die($this->error());
*/
$sql3 = array('table' => 'aset', 'field' => "Dihapus='1'", 'condition' => "Aset_ID='{$asset_id[$i]}'");
// ////////////////////////////////////////pr($sql3);
$res3 = $this->db->lazyQuery($sql3, $debug, 2);
/*
$query3="UPDATE aset SET Dihapus='1' WHERE Aset_ID='$asset_id[$i]'";
$result3=$this->query($query3) or die($this->error());*/
}
foreach ($UsulID as $keyUsulID => $valueUsulID) {
////////////////////////////////////////pr($valueUsulID);
$sqlusulID = array('table' => 'usulan', 'field' => "Aset_ID,Usulan_ID", 'condition' => "Usulan_ID IN ({$UsulanID}) ORDER BY Usulan_ID desc");
// ////////////////////////////////////////pr($sqlusul);
$resusulID = $this->db->lazyQuery($sqlusulID, $debug);
////////////////////////////////////////pr($resusulID);
// echo "====";
foreach ($resusulID as $keyuslID => $valueuslanID) {
////////////////////////////////////////pr($valueuslanID['Usulan_ID']);
$IDasetUsl = explode(",", $valueuslanID['Aset_ID']);
////////////////////////////////////////pr($IDasetUsl);
$IDUsulanAset = $valueuslanID['Usulan_ID'];
// foreach ($IDasetUsl as $keyIDasetUsl => $valueIDasetUsl) {
// $IDasetUsul[]=$valueIDasetUsl;
// }
foreach ($IDasetUsl as $keyIDaset => $valueIDaset) {
////////////////////////////////////////pr($valueIDaset);
if (in_array($valueIDaset, $nmaset)) {
echo $valueIDaset . "diterima<br/>";
$sqlUpd = array('table' => 'usulanaset', 'field' => "StatusKonfirmasi=1", 'condition' => "Aset_ID='{$valueIDaset}' AND Usulan_ID='{$IDUsulanAset}'");
////////////////////////////////////////pr($sqlUpd);
$resUpd = $this->db->lazyQuery($sqlUpd, $debug, 2);
} else {
echo $valueIDaset . "ditolak<br/>";
$sqlUpd = array('table' => 'usulanaset', 'field' => "StatusKonfirmasi=2", 'condition' => "Aset_ID='{$valueIDaset}' AND Usulan_ID='{$IDUsulanAset}'");
////////////////////////////////////////pr($sqlUpd);
$resUpd = $this->db->lazyQuery($sqlUpd, $debug, 2);
}
}
//.........这里部分代码省略.........
示例15: usulan
function usulan($getAset, $kontrak, $debug = false)
{
// $getAset = $this->getAset($guid, $kontrak);
// pr($getAset);
// exit;
$UserNm = $_SESSION['ses_uoperatorid'];
// usernm akan diganti jika session di implementasikan
$nmaset = explode(',', $getAset['asetid']);
$nmasetsatker = $guid;
$penggunaan_id = get_auto_increment("penggunaan");
$ses_uid = $_SESSION['ses_uid'];
$penggu_penet_eks_ket = "migrasi penggunaan";
$penggu_penet_eks_nopenet = $kontrak;
$penggu_penet_eks_tglpenet = $data['penggu_penet_eks_tglpenet'];
$olah_tgl = date('Y-m-d H:i:s');
$TglSKKDH = "2014-12-31";
$sql = array('table' => 'Penggunaan', 'field' => 'NoSKKDH , TglSKKDH, Keterangan, NotUse, TglUpdate, UserNm, Status, FixPenggunaan, GUID', 'value' => "'{$penggu_penet_eks_nopenet}','{$TglSKKDH}', '{$penggu_penet_eks_ket}','0','{$olah_tgl}','{$UserNm}', 1, '1','{$ses_uid}'");
$res = $this->db->lazyQuery($sql, $debug, 1);
$insertid = $this->db->insert_id();
$sleep = 1;
$count = 1;
if ($getAset['asetlain']) {
foreach ($getAset['asetlain'] as $key => $val) {
foreach ($val as $value => $value1) {
echo "data aset lain :" . $count . "\n\n";
$nmasetsatker = $key;
$sql1 = array('table' => 'Penggunaanaset', 'field' => "Penggunaan_ID,Aset_ID, kodeSatker, Status", 'value' => "'{$insertid}','{$value}', '{$nmasetsatker}',1");
$res = $this->db->lazyQuery($sql1, $debug, 1);
$sql2 = array('table' => 'Aset', 'field' => "NotUse=1, fixPenggunaan = 1", 'condition' => "Aset_ID='{$value}'", 'limit' => '1');
$res = $this->db->lazyQuery($sql2, $debug, 2);
// $sleep++;
// if ($sleep == 200){
// sleep(1);
// $sleep = 1;
// }
$count++;
}
}
}
if ($getAset['persediaan']) {
foreach ($getAset['persediaan'] as $key => $val) {
foreach ($val as $value => $value1) {
echo "data aset persediaan :" . $count . "\n\n";
$nmasetsatker = $key;
$sql1 = array('table' => 'Penggunaanaset', 'field' => "Penggunaan_ID,Aset_ID, kodeSatker, Status", 'value' => "'{$insertid}','{$value}', '{$nmasetsatker}', 1");
$res = $this->db->lazyQuery($sql1, $debug, 1);
$sql2 = array('table' => 'Aset', 'field' => "NotUse=1, fixPenggunaan = 1", 'condition' => "Aset_ID='{$value}'", 'limit' => '1');
$res = $this->db->lazyQuery($sql2, $debug, 2);
// $sleep++;
// if ($sleep == 200){
// sleep(1);
// $sleep = 1;
// }
$count++;
}
}
}
if ($res) {
return true;
}
return false;
}