Gambar 1.0 Ketika Button Proses Maka Akan Tampil Seperti Gambar 2.0 |
Gambar 2.0 Ketika Click Input Pembelian Maka Akan Tampil Seperti Gambar 1.0 |
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Latihan 3</title>
</head>
<body style="background-image:url(http://localhost/Adam/Background%20Blogger/3d_abstract_white-hd.jpg)">
<form action="cetak.php" method="post">
<center><h1>Form Pembelian Barang</center></h1>
<center><h2>Toko Serba Ada</center></h2>
<pre>
Kode Barang : <select name=kobar>
<option>--Pilih Kode--</option>
<option value="BR001">BR001</option>
<option value="BR002">BR002</option>
<option value="BR003">BR003</option>
</select>
Nama Barang : <input type="text" size=20 name=nabar>
Harga Barang : <input type="text" size=10 name=harga>
Jumlah Beli : <input type="text" size=5 name=jumbel>
<br><br>
<input type="submit" value=Proses><input type="reset" value=Batal>
</form>
</body>
</html>
Coding/Listing Gambar 2.0 (Simpan Dengan Nama cetak.php) :
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Latihan 3</title>
</head>
<body style="background-image:url(http://localhost/Adam/Background%20Blogger/3d_abstract_white-hd.jpg)">
<?php
$napem=$_POST['napem'];
$alamat=$_POST['alamat'];
$kobar=$_POST['kobar'];
$nabar=$_POST['nabar'];
$harga=$_POST['harga'];
$jumbel=$_POST['jumbel'];
$total=$harga*$jumbel;
$tanggal = Date("d F Y");
?>
<h1>Cetak Data Pembelian</h1>
<pre>
Tanggal : <?=$tanggal?><br>
Kode Barang : <?=$kobar?><br>
Nama Barang : <?=$nabar?><br>
Harga : <?=$harga?><br>
Jumlah Beli : <?=$jumbel?><br>
Total Bayar : <?=$total?></pre>
<h3><center><p><font color="black"><a href="latihan3.html">Input Pembelian</a></p></center></h3></font>
</body>
</html>
0 komentar:
Posting Komentar