A-53
32. Hapus_registercustomer.php
?php requirekoneksidatabase.php;
deleteid=_GET[id]; mysql_queryDELETE FROM registercustomer WHERE id =deleteid;
headerlocation: adminregistercustomer_hapus.php; ?
33. Form_masterbarang.php
DOCTYPE html
PUBLIC -W3CDTD
XHTML 1.0
TransitionalEN http:www.w3.orgTRxhtml1DTDxhtml1-transitional.dtd
html xmlns=http:www.w3.org1999xhtml head
meta http-equiv=Content-Type content=texthtml; charset=utf-8 titleAutoZonetitle
style type=textcss --
body {
background-color: F00; }
apDiv1 { position:absolute;
width:143px; height:34px;
z-index:1; }
apDiv2 { position:absolute;
width:423px; height:115px;
z-index:1; left: 61px;
top: 21px; }
-- stylehead
body form
name =
Master Barang
method =
POST action
= proses_master_barang.php
Master Barang p Kode Barang : nbsp;nbsp;nbsp;nbsp;nbsp;input type = text name =
kodebarang p p Nama Barang : nbsp;nbsp;nbsp;nbsp;input type = text name =
namabarang p p Harga Satuan : nbsp;nbsp;nbsp;nbsp;nbsp;input type = text name =
hargasatuan p p Jumlah Barang : nbsp;nbsp;nbsp;input type = text name = jumlahbarang
p p
Harga Jual
: nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;nbsp;input type = text
name = hargajual p input type = submit name = simpan value = simpan
form
A-54
body html
34. Proses_master_barang.php
html head
titleAutozonetitle head
body form name = form masterbarang method = POST action=form_masterbarang.php
onsubmit=return cekdata ?php
include koneksidatabase.php; kodebarang = _POST[kodebarang];
namabarang = _POST[namabarang]; hargasatuan = _POST[hargasatuan];
jumlahbarang= _POST[jumlahbarang]; hargajual = _POST[hargajual];
ifemptykodebarang||emptynamabarang||emptyhargasatuan||emptyjum lahbarang||emptyhargajual{
headerlocation:form_masterbarang.php?pesan=Tidak boleh kosong; }
q = mysql_querySELECT FROM `masterbarang` WHERE `kodebarang`=kodebarang;
ifmysql_num_rowsq==0 { sql = INSERT INTO masterbarang . kodebarang, namabarang,
hargasatuan, jumlahbarang, hargajual . VALUESkodebarang, namabarang,hargasatuan, jumlahbarang, hargajual;
hasil = mysql_querysql; if emptyhasil
printgagal menyimpan data kodebarang=kodebarang; else
printData kodebarang=kodebarang telah disimpan; }
? ?php
? br
input type=submit value=OK form
form name = lihat barang method = POST action=tampil_master_barang.php onsubmit=isi dengan username berbeda
input type=submit value=Lihat Barang form
body html
A-55
35. Tampil_master_barang.php