本文整理汇总了PHP中addZero函数的典型用法代码示例。如果您正苦于以下问题:PHP addZero函数的具体用法?PHP addZero怎么用?PHP addZero使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了addZero函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: countKode
function countKode()
{
global $dbname;
global $conn;
global $regional;
$optReg = makeOption($dbname, 'bgt_regional', 'regional,kodepenerimaankaryawan');
$sCount = "select substring(kode,2,3) as kodeku from " . $dbname . ".sdm_5uangmukapjd where regional = '" . $regional . "' order by kode desc limit 1";
$qCount = mysql_query($sCount) or die(mysql_error($conn));
$rCount = mysql_fetch_assoc($qCount);
$nextKode = $optReg[$regional] . "" . addZero($rCount['kodeku'] + 1, 3);
return $nextKode;
}
示例2: formatTime
function formatTime($timeStr){
$time = explode(":",$timeStr);
$hr = $time[0];
$min = $time[1];
$sec = substr($time[2], 0, strpos($time[2], " "));
$ampm = substr($time[2], strpos($time[2], " "));
if(strtoupper(trim($ampm)) == "PM"){
$hr += 12;
}
return addZero($hr).":".addZero($min).":".addZero($sec);
}
示例3: monthDay
function monthDay()
{
?>
<select id="addAgeDay">
<option>...</option>
<?php
for ($x = 1; $x <= 31; $x++) {
$id = addZero($x);
?>
<option name= "<?php
echo $id;
?>
" > <?php
echo $id;
?>
</option>
<?php
}
?>
</select>
<?php
}
示例4: addslashes
echo "";
} else {
echo " Gagal," . addslashes(mysql_error($conn));
}
break;
case 'getNodok':
$iList = "select notransaksi,tanggal,statasiun from " . $dbname . ".pabrik_rawatmesinht where statasiun ='" . $station . "' " . "and tanggal='" . $tglOrder . "' order by notransaksi desc limit 1";
$nList = mysql_query($iList) or die(mysql_error($conn));
$dList = mysql_fetch_assoc($nList);
if ($dList['notransaksi'] != '') {
$listDok = explode('/', $dList['notransaksi']);
$noUrut = $listDok[2] + 1;
} else {
$noUrut = 1;
}
$counter = addZero($noUrut, 4);
$noDok = $station . '/' . $tglOrderDok . '/' . $counter;
echo $noDok;
break;
case 'getMesin':
$optMesin .= "<option value=''>" . $_SESSION['lang']['pilihdata'] . "</option>";
$optMesin .= "<option value='Others'>Others</option>";
$iMesin = "select * from " . $dbname . ".organisasi where induk='" . $station . "' ";
$nMesin = mysql_query($iMesin) or die(mysql_error($conn));
while ($dMesin = mysql_fetch_assoc($nMesin)) {
if ($mesin == $dMesin['kodeorganisasi']) {
$select = "selected=selected";
} else {
$select = "";
}
$optMesin .= "<option " . $select . " value=" . $dMesin['kodeorganisasi'] . ">" . $dMesin['namaorganisasi'] . "</option>";
示例5: exit
if ($bar->jurnalid == 'ROTM') {
$penerima['akundebet']['tm'] = $bar->noakundebet;
} else {
$penerima['akundebet']['tbm'] = $bar->noakundebet;
}
}
if ($penerima['akundebet']['tm'] == '' or $penerima['akundebet']['tbm'] == '') {
exit(" Error: No.Akun debet untuk ROTBM atau ROTM belum terisi pada parameterjurnal");
}
#generate jurnal========================================================
$queryJ = selectQuery($dbname, 'keu_5kelompokjurnal', 'nokounter', "kodeorg='" . $param['pt'] . "' and kodekelompok='" . $kodejurnal . "'");
$tmpKonter = fetchData($queryJ);
$konter = addZero($tmpKonter[0]['nokounter'] + 1, 3);
foreach ($penerima['unit'] as $key => $val) {
# Prep No Jurnal
$konter = addZero($konter + 1, 3);
$nojurnal = $tanggal . "/" . $val . "/" . $kodejurnal . "/" . $konter;
$arrNoJurnal[] = $nojurnal;
// echo $konter."<>";
$data['header'][] = array('nojurnal' => $nojurnal, 'kodejurnal' => $kodejurnal, 'tanggal' => $tanggal, 'tanggalentry' => date('Ymd'), 'posting' => '1', 'totaldebet' => $jumlah[$val], 'totalkredit' => -1 * $jumlah[$val], 'amountkoreksi' => '0', 'noreferensi' => 'ALK_' . $param['kodeorg'], 'autojurnal' => '1', 'matauang' => 'IDR', 'kurs' => '1', 'revisi' => '0');
$noUrut = 1;
#kredit
$dataRes['detail'][] = array('nojurnal' => $nojurnal, 'tanggal' => $tanggal, 'nourut' => $noUrut, 'noakun' => $penerima['akunkredit'], 'keterangan' => 'Alokasi Biaya Tidak Langsung RO/HO', 'jumlah' => -1 * $jumlah[$val], 'matauang' => 'IDR', 'kurs' => '1', 'kodeorg' => $val, 'kodekegiatan' => '', 'kodeasset' => '', 'kodebarang' => '', 'nik' => '0', 'kodecustomer' => '', 'kodesupplier' => '', 'noreferensi' => 'ALK_' . $param['kodeorg'], 'noaruskas' => '', 'kodevhc' => '', 'nodok' => '', 'kodeblok' => '', 'revisi' => '0', 'kodesegment' => $defSegment);
$noUrut++;
#debet TM
if ($jatahtm[$val] > 0) {
$dataRes['detail'][] = array('nojurnal' => $nojurnal, 'tanggal' => $tanggal, 'nourut' => $noUrut, 'noakun' => $penerima['akundebet']['tm'], 'keterangan' => 'Alokasi Biaya Tidak Langsung RO/HO', 'jumlah' => $jatahtm[$val], 'matauang' => 'IDR', 'kurs' => '1', 'kodeorg' => $val, 'kodekegiatan' => '', 'kodeasset' => '', 'kodebarang' => '', 'nik' => '0', 'kodecustomer' => '', 'kodesupplier' => '', 'noreferensi' => 'ALK_' . $param['kodeorg'], 'noaruskas' => '', 'kodevhc' => '', 'nodok' => '', 'kodeblok' => '', 'revisi' => '0', 'kodesegment' => $defSegment);
$noUrut++;
}
#debet TBM
if (count($blok[$val]) > 0) {
示例6: mysql_query
$query = mysql_query($sql) or die(mysql_error());
$rdata = mysql_fetch_assoc($query);
$eksplot = explode("/", $rdata['notransaksi']);
$awal = $eksplot[0];
//exit("error:".$awal);
$awal = intval($awal);
$cekbln = isset($eksplot[1]) ? $eksplot[1] : '';
$cekthn = isset($eksplot[4]) ? $eksplot[4] : '';
if ($thn != $cekthn) {
$awal = 1;
} else {
$awal++;
}
$counter = $awal;
if ($awal < 1000) {
$counter = addZero($awal, 3);
}
$notransaksi = $counter . "/" . $notrans;
echo $notransaksi;
break;
case 'insert':
if ($tanggal == '') {
exit("error: " . $_SESSION['lang']['tanggal'] . " is empty!");
}
if ($_POST['kodetraksi'] == '') {
exit("error: " . $_SESSION['lang']['kodetraksi'] . " is empty!");
}
if ($_POST['kd_vhc'] == '') {
exit("error: " . $_SESSION['lang']['kde_vhc'] . " is empty!");
}
$i = "insert into " . $dbname . ".vhc_balaka (notransaksi,kodetraksi,tanggal,kodealat,operator,security,mekanik,managerunit,kaworkshop,kronologis,akibatkejadian,updateby)\r\n values ('" . $_POST['notransaksi'] . "','" . $kodetraksi . "','" . tanggalsystem($tanggal) . "','" . $kde_vhc . "','" . $_POST['operator'] . "','" . $_POST['security'] . "','" . $_POST['karymekanik'] . "'\r\n ,'" . $_POST['managerunit'] . "','" . $_POST['karyworkshop'] . "','" . $_POST['kronologiskejadian'] . "','" . $_POST['akibatkejadian'] . "','" . $_SESSION['standard']['userid'] . "')";
示例7: exit
exit("Warning: Depresiasi " . $kode . " belum terjurnal dengan benar");
}
}
}
#==================== /Prep Jurnal ====================================
createSaldoAwal($param['periode'], $tahunLanjut . '-' . addZero($bulanLanjut, 2), $param['kodeorg']);
#========================== Proses Insert dan Update ==========================
# Header and Detail inserted
# Update Status Tutup Buku
$queryUpd = updateQuery($dbname, 'setup_periodeakuntansi', array('tutupbuku' => 1), "kodeorg='" . $param['kodeorg'] . "' and periode='" . $param['periode'] . "'");
if (!mysql_query($queryUpd)) {
echo 'Error Update : ' . mysql_error();
exit;
} else {
# Insert periode baru
$dataIns = array('kodeorg' => $param['kodeorg'], 'periode' => $tahunLanjut . '-' . addZero($bulanLanjut, 2), 'tanggalmulai' => $tglAwal, 'tanggalsampai' => $tglAkhir, 'tutupbuku' => 0);
$queryIns = insertQuery($dbname, 'setup_periodeakuntansi', $dataIns);
echo '1';
if (!mysql_query($queryIns)) {
# Rollback
echo 'Error Insert : ' . mysql_error();
$queryRB = updateQuery($dbname, 'setup_periodeakuntansi', array('tutupbuku' => 0), "kodeorg='" . $param['kodeorg'] . "' and periode='" . $param['periode'] . "'");
if (!mysql_query($queryRB)) {
echo 'Error Rollback Update : ' . mysql_error();
exit;
}
} else {
//update history tutup buku
$str = "delete from " . $dbname . ".keu_setup_watu_tutup where periode='" . $param['periode'] . "' and kodeorg='" . $param['kodeorg'] . "'";
mysql_query($str);
$str = "insert into " . $dbname . ".keu_setup_watu_tutup(kodeorg,periode,username) values(\n '" . $param['kodeorg'] . "','" . $param['periode'] . "','" . $_SESSION['standard']['username'] . "')";
示例8: 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;
//.........这里部分代码省略.........
示例9: mysql_error
$headErr .= 'Insert Header Error : ' . mysql_error() . "\n" . $insHead;
}
if ($headErr == '') {
#>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> Insert Detail
$detailErr = '';
foreach ($dataRes['detail'] as $row) {
$insDet = insertQuery($dbname, 'keu_jurnaldt', $row);
if (!mysql_query($insDet)) {
$detailErr .= "Insert Detail Error : " . mysql_error() . "\n";
break;
} else {
}
}
if ($detailErr == '') {
#==================== /Prep Jurnal ====================================
createSaldoAwal($param['periode'], $tahunLanjut . '-' . addZero($bulanLanjut, 2), $param['kodeorg']);
#========================== Proses Insert dan Update ==========================
#delete semua periodeakuntansi untuk tahun depan
// $str="delete from ".$dbname.".setup_periodeakuntansi where kodeorg='".$param['kodeorg']."'
// and periode like '".$tahunLanjut ."%'";
// mysql_query($str);
# Header and Detail inserted
# Update Status Tutup Buku
$queryUpd = updateQuery($dbname, 'setup_periodeakuntansi', array('tutupbuku' => 1), "kodeorg='" . $param['kodeorg'] . "' and periode='" . $param['periode'] . "'");
if (!mysql_query($queryUpd)) {
echo 'Error Update : ' . mysql_error();
exit;
} else {
# Insert periode baru
// $dataIns = array(
// 'kodeorg'=>$param['kodeorg'],
示例10: elseif
}
} elseif (substr($kdTimbangan, 0, 1) == '1') {
$sCek = "select kodetimbangan from " . $dbname . ".pmn_4customer where kodetimbangan='" . $kdTimbangan . "'";
// echo"customer__".$sCek;
$qCek = mysql_query($sCek) or die(mysql_error());
$rCek = mysql_num_rows($qCek);
if ($rCek < 1) {
$sNo = "select kodecustomer,klcustomer from " . $dbname . ".pmn_4customer\r\n\t\t\t\twhere kodecustomer like 'C%' and length(kodecustomer)=5\r\n\t\t\t\torder by `kodecustomer` desc limit 1";
//echo $sNo;
$qNo = mysql_query($sNo) or die(mysql_error());
$rNo = mysql_fetch_assoc($qNo);
$no = substr($rNo['kodecustomer'], 1, 4);
$kdCust = intval($no);
//echo $no.":".$kdCust;
$kdCust += 1;
$kdCust = 'C' . addZero($kdCust, 4);
$sIns = "INSERT INTO " . $dbname . ".`pmn_4customer` (`kodecustomer`, `namacustomer`,`klcustomer`,`kodetimbangan`) VALUES ('" . $kdCust . "','" . $nmCust . "','" . $rNo['klcustomer'] . "','" . $kdTimbangan . "')";
// echo $sIns;exit();
if (mysql_query($sIns)) {
@($corn = mysql_connect($ipAdd . ":" . $prt, $usrName, $pswrd)) or die("Error/Gagal :Unable to Connect to database : " . $ipAdd);
$supd = "update " . $dbnm . "." . $nmTable . " set uploadStat=1 where BUYERCODE='" . $kdTimbangan . "'";
if (mysql_query($supd, $corn)) {
$stat = 1;
echo $stat;
exit;
}
} else {
echo "DB Error : " . mysql_error($conn);
$stat = 0;
echo $stat;
}
示例11: makeOption
}
}
echo $optDtSpb;
break;
case 'insert':
$whr = "nospb='" . $param['spbId'] . "'";
$optCust = makeOption($dbname, 'kebun_spbht', 'nospb,penerimatbs', $whr);
$scek = "select max(notransaksi) as notransaksi from " . $dbname . ".pabrik_timbangan where char_length(notransaksi)>7 and kodeorg='" . $_SESSION['empl']['lokasitugas'] . "'";
$qcek = mysql_query($scek) or die(mysql_error($conn));
$rcek = mysql_fetch_assoc($qcek);
if ($rcek['notransaksi'] == '') {
$rcek['notransaksi'] = 0;
} else {
$rcek['notransaksi'] = substr($rcek['notransaksi'], -6, 6);
}
$notrans = $_SESSION['empl']['lokasitugas'] . addZero(intval($rcek['notransaksi']) + 1, 6);
if ($param['tgl'] == '' || $param['kdKend'] == '' || $param['nmSupir'] == '' || $param['jmlhJjg'] == '' || $param['brtMsk'] == '' || $param['brtKlr'] == '' || $param['spbId'] == '') {
exit("error: Seluruh field tidak boleh kosong");
}
$sins = "insert into " . $dbname . ".pabrik_timbangan (notransaksi,tanggal,kodeorg,kodecustomer,jumlahtandan1,kodebarang,jammasuk,beratmasuk,jamkeluar,beratkeluar,nokendaraan,supir,nospb,timbangonoff,intex,millcode,beratbersih,jjgsortasi,kgpotsortasi,username) values ";
$sins .= "('" . $notrans . "','" . tanggalsystem($param['tgl']) . "','" . $_SESSION['empl']['lokasitugas'] . "','" . $optCust[$param['spbId']] . "','" . $param['jmlhJjg'] . "','40000003','" . $param['jamMasuk'] . "','" . $param['brtMsk'] . "','" . $param['jamKeluar'] . "','" . $param['brtKlr'] . "','" . $param['kdKend'] . "','" . $param['nmSupir'] . "','" . $param['spbId'] . "','1','1','EXTM','" . $param['brtBrsh'] . "','" . $param['JjgSortasi'] . "','" . $param['potKg'] . "','" . $_SESSION['standard']['username'] . "')";
if (!mysql_query($sins)) {
exit("error: " . mysql_error($conn) . "__" . $sins);
}
break;
case 'update':
if ($param['tgl'] == '' || $param['kdKend'] == '' || $param['nmSupir'] == '' || $param['jmlhJjg'] == '' || $param['brtMsk'] == '' || $param['brtKlr'] == '' || $param['spbId'] == '') {
exit("error: Seluruh field tidak boleh kosong");
}
$sins = "update " . $dbname . ".pabrik_timbangan set tanggal='" . tanggalsystem($param['tgl']) . "',kodeorg='" . $_SESSION['empl']['lokasitugas'] . "',kodecustomer='" . $optCust[$param['spbId']] . "',jumlahtandan1='" . $param['jmlhJjg'] . "',jammasuk='" . $param['jamMasuk'] . "',beratmasuk='" . $param['brtMsk'] . "',jamkeluar='" . $param['jamKeluar'] . "',beratkeluar='" . $param['brtKlr'] . "',nokendaraan='" . $param['kdKend'] . "',supir='" . $param['nmSupir'] . "',nospb='" . $param['spbId'] . "',beratbersih='" . $param['brtBrsh'] . "',jjgsortasi='" . $param['JjgSortasi'] . "',kgpotsortasi='" . $param['potKg'] . "',username='" . $_SESSION['standard']['username'] . "' where notransaksi='" . $param['notransaksi'] . "'";
if (!mysql_query($sins)) {
示例12: generateNoDO
function generateNoDO()
{
global $dbname;
global $conn;
global $_POST;
global $optPt;
$bulan = substr($_POST['tanggalsurat'], 3, 2);
$arrayRomawi = array("I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII");
$resultRomawi = $arrayRomawi[(int) $bulan - 1];
$ql = "select `nodo` from " . $dbname . ".`pmn_suratperintahpengiriman`";
$ql .= " where nodo like '%" . $optPt[$_POST['nokontrak']] . "_%' and tanggaldo like '" . substr($_POST['tanggalsurat'], 6, 4) . "%'\n\t\torder by nodo desc limit 1";
$qr = mysql_query($ql) or die('error: ' . mysql_error());
$data = mysql_fetch_object($qr);
$countNoDO = substr($data->nodo, 0, 3);
$noInvoice = addZero($countNoDO + 1, 3) . "/" . $optPt[$_POST['nokontrak']] . "_" . $_POST['kodecustomer'] . "/" . $resultRomawi . "/" . substr($_POST['tanggalsurat'], 6, 4);
return $noInvoice;
}
示例13: generateNoInvoice
function generateNoInvoice($nokontrak, $tgl)
{
global $dbname;
global $conn;
#no invoice
$tgldt = explode("-", $tgl);
$bulan = $tgldt[1];
$thn = date('Y');
$sPt = "select distinct kodebarang,kodept from " . $dbname . ".pmn_kontrakjual where nokontrak='" . $nokontrak . "'";
$qPt = mysql_query($sPt) or die(mysql_error($conn));
$rPt = mysql_fetch_assoc($qPt);
$arrayRomawi = array("I", "II", "III", "IV", "V", "VI", "VII", "VIII", "IX", "X", "XI", "XII");
$resultRomawi = $arrayRomawi[(int) $bulan - 1];
if ($rPt['kodept'] == 'API') {
$invPT = 'AMP';
} else {
$invPT = $rPt['kodept'];
}
$ql = "select `noinvoice` from " . $dbname . ".`keu_penagihanht` where kodept = '" . $invPT . "' and left(noinvoice,3) = '" . $invPT . "' and left(tanggal,4) = '" . $tgldt[2] . "'\n\t\torder by noinvoice desc limit 1";
$qr = mysql_query($ql) or die('error: ' . mysql_error());
$data = mysql_fetch_object($qr);
$countNoInvoice = substr($data->noinvoice, 4, 3);
//$countNoInvoice = mysql_num_rows($qr);
$noInvoice = $rPt['kodept'] . "/" . addZero($countNoInvoice + 1, 3) . "/JKT/" . $resultRomawi . "/" . $tgldt[2];
return $noInvoice;
}
示例14: while
while ($bar = mysql_fetch_object($res)) {
$sq = "select * " . $dbname . ".`datakaryawan` where `lokasitugas`='" . $bar->kodeorg . "' or `induk`='" . $induk_org . "'";
//echo $sql;
$qty = mysql_query($sq) or die(mysql_error());
$opt .= "<option value='" . $res2->karyawanid . "'>" . $res2->namakaryawan . "</option>";
$no += 1;
echo "\r\n <tr class=rowcontent style='cursor:pointer;' onclick=\"setDraft( '" . $bar->karyawanid . "','" . $bar->nopp . "')\" title='Click' >\r\n <td class=firsttd colspan=3>" . $no . "</td>\r\n <tr >\r\n <td>No. PP</td>\r\n <td>:</td>\r\n <td><input id=nopp type=text readonly=readonly value=" . $bar->nopp . "></td>\r\n </tr>\r\n <tr>\r\n <td>Nama Karyawan</td>\r\n <td>:</td>\r\n <td>\r\n <select id='kd_krywn'>\r\n <option value=\"\" selected=selected></option>" . $opt . "\r\n </select></td>\r\n </tr>";
}
echo "</tbody>\r\n <tfoot>\r\n </tfoot>\r\n </table>";
} else {
echo " Gagal," . addslashes(mysql_error($conn));
}
}
if (isset($_POST['rkrywn_id'])) {
$rkrywn_id = intval($_POST['rkrywn_id']);
$rkrywn_id = addZero($rkrywn_id, 10);
$no_pp = $_POST['no_pp'];
$tanggl = date("Y-m-d");
$ql = "update " . $dbname . ".log_prapoht set `persetujuan1`='" . $rkrywn_id . "',`close`='1',`tglp1`='" . $tanggl . "' where `nopp`='" . $no_pp . "' ";
// echo $ql; exit();
if ($res = mysql_query($ql)) {
} else {
echo " Gagal," . addslashes(mysql_error($conn));
}
}
if (isset($_POST['hnopp'])) {
$nopp = $_POST['hnopp'];
$krywn = $_POST['karywn_id'];
$str = "select * from " . $dbname . ".`log_prapoht` where `nopp`='" . $nopp . "'";
//echo $str;
if ($res = mysql_query($str)) {
示例15: selectQuery
$fQuery = selectQuery($dbname, 'kebun_aktifitas', 'notransaksi', $fWhere);
$tmpNo = fetchData($fQuery);
# Generate No Transaksi
if (count($tmpNo) == 0) {
$data['notransaksi'] = $data['tanggal'] . "/" . $data['kodeorg'] . "/" . $data['tipetransaksi'] . "/001";
} else {
# Get Max No Urut
$maxNo = 1;
foreach ($tmpNo as $row) {
$tmpRow = explode('/', $row['notransaksi']);
$noUrut = (int) $tmpRow[3];
if ($noUrut > $maxNo) {
$maxNo = $noUrut;
}
}
$currNo = addZero($maxNo + 1, 3);
$data['notransaksi'] = $data['tanggal'] . "/" . $data['kodeorg'] . "/" . $data['tipetransaksi'] . "/" . $currNo;
}
$data['updateby'] = $_SESSION['standard']['userid'];
$cols = array('notransaksi', 'kodeorg', 'tanggal', 'nikmandor', 'nikmandor1', 'nikasisten', 'keranimuat', 'tipetransaksi', 'updateby');
$query = insertQuery($dbname, 'kebun_aktifitas', $data, $cols);
if (!mysql_query($query)) {
echo "DB Error : " . mysql_error();
} else {
echo $data['notransaksi'];
}
break;
# Proses Edit Header
# Proses Edit Header
case 'edit':
$data = $_POST;