TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Dwi Hyuga
NA
116
21.9k
some php code not executed..
Mar 18 2016 10:50 PM
I got some problem when i run my php app, the upper script are executed but the lower script aren't executed. how to make it execute a whole of script..
<?php
/*
* Create by Ahmad
* 11/03/2016
* Simpan data
*/
session_start();
require
"../../fungsi.php"
;
$admin
=
new
adminPage();
open_connect();
//tangkap data
$ki
=
$_POST
[
'ki'
];
$NoLPB
=
$_POST
[
'NoLPB'
];
$NoDtlLPB
=
$_POST
[
'strNoDtlLPB'
];
$noid
=
$_POST
[
'noid'
];
$tgl
=
$_POST
[
'tgl'
];
$kb
=
$_POST
[
'kb'
];
$desc
=
$_POST
[
'desc'
];
$harsat
=
$_POST
[
'harsat'
];
$nosj
=
$_POST
[
'nosj'
];
$qtyr
=
$_POST
[
'qtyr'
];
$ket
=
$_POST
[
'ket'
];
$sup
=
$_POST
[
'sup'
];
$strIdKs
= getData(
"select `prmIdKS` FROM tbl_prm"
,
"prmIdKS"
);
//lpbdtl
$admin
->beginTransaction();
$admin
->query(
"select `KodeBatch`, `NoLPB`, harsat, `Qty`, satuan, `Description` FROM tbl_lpbdtl WHERE `KodeItem`='$ki' && noid='$noid'"
);
$admin
->execute();
$lpbdtl
=
$admin
->fetch();
$admin
->endTransaction();
$qty
=
$lpbdtl
->Qty;
$satuan
=
$lpbdtl
->satuan;
//lpb
$admin
->beginTransaction();
$admin
->query(
"select `tglLPB`, `noLPB` FROM tbl_lpb WHERE `noLPB`='$NoLPB' && `stsDel`='F'"
);
$admin
->execute();
$lpb
=
$admin
->fetch();
$admin
->endTransaction();
$tglLPB
=
$lpb
->tglLPB;
$strblnKS
=
substr
(
$tglLPB
,5,2);
$strthnKS
=
substr
(
$tglLPB
,0,4);
//prmKartuStock
$admin
->beginTransaction();
$admin
->query(
"select `prmKartustock` FROM tbl_kartustock WHERE `KodeItem`='$ki' && `KodeBatch`='$kb' && tglbukti<='$tglLPB' ORDER BY `prmKartustock` desc Limit 0,1"
);
$admin
->execute();
$ks
=
$admin
->fetch();
$admin
->endTransaction();
$prmKartustock
=
$ks
->prmKartustock;
//ambil data
$admin
->beginTransaction();
$admin
->query(
"select * FROM tbl_daftar_item WHERE `KodeItem`='$ki'"
);
$admin
->execute();
$tdi
=
$admin
->fetch();
$admin
->endTransaction();
$warna
=
$tdi
->warna;
$dt
=
date
(
'Y-m-d'
);
$acc
=
$_SESSION
[
'username2'
].
"-R-"
.
$dt
;
$prmnodtlsjretur
= getData(
"SELECT prmnodtlsjretur FROM tbl_suratjlnretur WHERE nosjretur ='$nosj' && stsDel='F'"
,
"prmnodtlsjretur"
);
$jns
= getData(
"select jenis FROM tbl_suratjlnreturdtl WHERE nosjretur='$nosj'"
,
"jenis"
);
$admin
->beginTransaction();
$admin
->query(
"SELECT sisa, saldo, prmKartustock, IdKS FROM tbl_kartustock WHERE KodeItem = '$ki' && KodeBatch='$kb' && nobukti = '$NoLPB' && nodtlbukti = '$NoDtlLPB'"
);
$admin
->execute();
$cek
=
$admin
->rowCount();
$admin
->endTransaction();
if
(
$cek
>0){
$p
=
$cek
+ 1;
}
else
{
$p
= 1;
}
?>
<!DOCTYPE html>
<html lang=
"en"
>
<head>
<title>save data...</title>
<meta http-equiv=
"content-type"
content=
"text/html; charset=utf-8"
/>
<meta http-equiv=
"Refresh"
content=
"0; url=/project1_5/gudang/form/rejectacc.php"
/>
</head>
<body>
<?php
$admin
->beginTransaction();
$admin
->query(
"update tbl_lpbdtl SET rejacc='$acc' WHERE noid='$noid'"
);
$admin
->execute();
$admin
->query(
"UPDATE tbl_kartustock SET prmKartustock=prmKartustock+'1' WHERE KodeItem='$ki' && KodeBatch='$kb' && prmKartustock > '$prmKartustock'"
);
$admin
->execute();
$admin
->endTransaction();
$admin
->beginTransaction();
$admin
->query(
"SELECT * FROM tbl_kartustock WHERE KodeItem='$ki' && KodeBatch='$kb' && `prmKartustock`='$prmKartustock'"
);
$admin
->execute();
$stock
=
$admin
->fetch();
$admin
->endTransaction();
$sisa
=
$stock
->sisa;
$saldo
=
$stock
->saldo;
$qtytotal
=
$sisa
+
$qty
;
$saldototal
=
$saldo
+ (
$harsat
*
$qty
);
$admin
->beginTransaction();
$admin
->query(
"INSERT INTO tbl_kartustock (bln, thn, KodeItem, KodeBatch, Description, satuan, prmKartustock, jnsTransaksi, nobukti, nodtlbukti, tglbukti, sisa,saldo, symbol) VALUES ('$strblnKS', '$strthnKS', '$ki', '$kb', '$desc', 'KG', '"
.(
$prmKartustock
+1).
"', 'LPB', '$NoLPB', '$strNoDtlLPB', '$tglLpb', '"
.(
$sisa
+
$qty
).
"', '"
.(
$saldo
+(
$qty
*
$harsat
)).
"', '+')"
);
$admin
->execute();
$admmin
->endTransaction();
$admin
->beginTransaction();
$admin
->query(
"UPDATE tbl_kartustock SET sisa='$qtytotal', saldo='$saldototal' WHERE KodeItem='$ki' && KodeBatch='$kb' && prmKartustock='"
.(
$prmKartustock
+1).
"'"
);
$admin
->execute();
$admin
->endTransaction();
//****start not executed****
$harsatr
= getData(
"SELECT harsat FROM tbl_suratjlnreturdtl WHERE KodeItem='$ki' && KodeBatch='$kb' && nosjretur='$$nosj' && nodtlsjretur='$NoDtlLPB' && stsDel='F'"
,
"harsat"
);
$sisar
= getData(
"select sisa FROM tbl_kartustock WHERE KodeItem='$ki' && KodeBatch='$kb' && `prmKartustock`='$prmKartustock'"
,
"sisa"
);
$saldor
= getData(
"select saldo FROM tbl_kartustock WHERE `KodeItem`='$ki' && `KodeBatch`='$kb' && `prmKartustock`='$prmKartustock'"
,
"saldo"
);
$qtot
=
$sisar
-
$qtyr
;
$saltot
=
$saldor
- (
$harsatr
*
$qtyr
);
$admin
->beginTransaction();
$admin
->query(
"insert INTO tbl_suratjlnreturdtl (nosjretur, nodtlsjretur, `KodeItem`, `KodeBatch`, `Description`, warna, jenis, qty, counterqty, satuan, harsat, ket, `NoLPB`, nodtllpb) VALUES ('$nosj', '', '$ki', '$kb', '$desc', '$warna, '', '$qtyr', '', '$satuan', '$harsat', '$ket', '$NoLPB', '$NoDtlLPB')"
);
$admin
->execute();
$admin
->endTransaction();
$admin
->beginTransaction();
$admin
->query(
"update tbl_kartustock SET `prmKartustock`=`prmKartustock`+'1' WHERE `KodeItem`='$ki' && `KodeBatch`='$kb' && `prmKartustock`>='$p'"
);
$admin
->execute();
$admin
->query(
"insert INTO tbl_kartustock (`IdKS`, `KodeItem`, `prmKartustock`, `jnsTransaksi`, nobukti, nodtlbukti, tglbukti, sisa, saldo, symbol, `KodeBatch`, `Description`, bln, thn) VALUES ('$strIdKs', '$ki', '$p', 'RSP', '$NoLPB', '$NoDtlLPB', '$tglLPB', '$sisa', '$saldo', '-', '$kb', '$desc', '$strblnKS', '$strthnKS')"
);
$admin
->execute();
$admin
->endTransaction();
$admin
->beginTransaction();
$admin
->query(
"update tbl_kartustock SET sisa='$qtot', saldo='$saltot' WHERE `KodeItem`='$ki' && `KodeBatch`='$kb' && `prmKartustock`='"
.(
$prmKartustock
+1).
"'"
);
$admin
->execute();
$admin
->endTransaction();
?>
</body>
</html>
Reply
Answers (
1
)
user profile page in php...
[ask] about jquery validation,