pwd:txtpwd.val }, function data, status{
if data=={ document.location.href=index.php;
} else{
.alert{content:data}; }
};
}; };
script
4. koneksi.php
?php if file_existsconfig.php{
include config.php; }
elseif file_exists..config.php{ include ..config.php;
} elseif file_exists....config.php{
include ....config.php; }
elseif file_exists......config.php{ include ......config.php;
Universitas Sumatera Utara
}
db=new databaselocalhost, root, , dbwo; db-konekdb;
?
5. order.php
?php kodeorder=db-tampilrecordtblpesan,
st=0 and
idmember=idmember, kodeorder; e=_GET[e];
if e{ echo
div class=alert
alert-danger alert-dismissible
role=alert button
type=button class=close
data-dismiss=alert aria-label=Closespan aria-hidden=truetimes;span
button strongOh snapstrong Terjadi kesalahan, periksa kembali
data anda div;
} echo kodeorder. .idmember;
? div class=col-md-12
div class=panel panel-info div class=panel-headingData Orderdiv
div class=panel-body
Universitas Sumatera Utara
p a href= class=btn btn-info btn-sm id=cmdselesaiAkhiri
Transaksia a href=index.php?page=riwayatorder class=btn btn-default btn-
smTransaksia input
type=hidden name=txtkodeorder
id=txtkodeorder value=?php echo kodeorder; ?
p table width=100 border=0 cellspacing=0 cellpadding=0
class=table table-striped table-hover tbody
tr td width=11strongKode Paketstrongtd
td width=23strongPaketstrongtd td width=44strongKeteranganstrongtd
td width=14 align=rightstrongHargastrongtd td width=8 align=rightnbsp;td
tr ?php
tot=0; qry=mysql_queryselect
from tblpesan
where kodeorder=kodeorder and idmember=idmember;
while data=mysql_fetch_arrayqry{ tot=tot+data[harga];
produk=db-tampilrecordtblpaketjenis, kodeproduk=data[kodeproduk], produk;
?
Universitas Sumatera Utara
tr td?php echo data[kodeproduk]; ?td
td?php echo produk; ?td tdnbsp;td
td align=right?php
echo number_formatdata[harga],0; ?td
td align=righta href= class=btn btn-danger btn-sm cmdhapus id=?php echo data[idpesan]; ?Hapusatd
tr ?php } ?
tr td colspan=3strongTOTALstrongtd
td align=right?php
echo number_formattot,
0; ?td
td align=rightnbsp;td tr
tbody table
div div
div
script document.readyfunctione {
.cmdhapus.clickfunctione { var nilai=this.attrid;
Universitas Sumatera Utara
.confirm{ title:Konfirmasi,
content:Apakah anda yakin ingin menghapus data ini?,
confirm:function{ .postorderhapus.php, {
id:nilai }, function data, status{
if data=={
document.location.href=index.php?page=order; }
else{ .alert{content:data};
} };
} };
};
cmdselesai.clickfunctione { var nilai=txtkodeorder.val;
.confirm{ title:Konfirmasi,
content:Apakah anda
yakin ingin
mengakhiri order?,
confirm:function{
Universitas Sumatera Utara
.postselesai.php, { id:nilai
}, function data, status{ if data=={
document.location.href=index.php?page=order; }
else{ .alert{content:data};
} };
} };
.postselesai.php, { id:nilai
}, function data, status{ if data=={
document.location.href=index.php?page=order; }
else{ .alert{content:data};
} };
}; };
Universitas Sumatera Utara
script
6. orderhapus.php