Gambar 1.0 Ketik Button Proses Diclick Maka Akan Tampil Seperti Gambar 2.0 |
Gambar 2.0 Ketika Click Input Pembelian Maka Akan Tampil Seperti Gambar 1.0 |
Coding/Listing Gambar 1.0 (Simpan Dengan Nama latihan9.html) :
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Latihan 9</title>
</head>
<body style="background-image:url(http://localhost/Adam/Background%20Blogger/ws_Green_abstract_1920x1200.jpg)">
<form action="cetak.php" method="post">
<font color="yellow">
<center><h1>Restoran Mini</center></h1></font>
<hr />
<pre>
Paket : <select name=paket>
<option>--Pilih Paket--</option>
<option value="Paket 1">Paket 1</option>
<option value="Paket 2">Paket 2</option>
<option value="Paket 3">Paket 3</option>
<option value="Paket 4">Paket 4</option>
</select>
Jumlah Beli : <input type="text" size=3 name=jumbel>
<input type="radio" value="Delivery" name=tambah>Delivery
<input type="radio" value="Makan Di Tempat" name=tambah>Makan Di Tempat
<br>
<input type="submit" value=Proses><input type="reset" value=Cancel>
</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 9</title>
</head>
<body style="background-image:url(http://localhost/Adam/Background%20Blogger/ws_Green_abstract_1920x1200.jpg)">
<?
if($paket=='Paket 1')
{
$makan1="Kentang Goreng";
$makan2="Nasi + Ayam Goreng";
$minum="Pepsi Cola";
$harga=30000;
}
else
if($paket=='Paket 2')
{
$makan1="Burger Beaf";
$makan2="Nasi + Sup";
$minum="Coca Cola";
$harga=35000;
}
else
if($paket=='Paket 3')
{
$makan1="Rollade Daging";
$makan2="Nasi + Sup + Ayam Goreng";
$minum="Coke Float";
$harga=45000;
}
else
if($paket=='Paket 4')
{
$makan1="Kebab Chiken";
$makan2="Nasi + Sup + 2 Ayam Goreng";
$minum="Bubble Float";
$harga=65000;
}
else
{
$makan1="";
$makan2="";
$minum="";
$harga=0;
}
$jumbel=$HTTP_POST_VARS['jumbel'];
if($tambah=='Delivery')
{
$tambah1=12000;
}
else
{
$tambah1=0;
}
$tobay=($harga*$jumbel)+$tambah1;
?>
<font color="yellow">
<center><h1>Restoran Mini</center></h1></font>
<hr />
<pre>
Paket : <?=$paket?><br>
Makan 1 : <?=$makan1?><br>
Makan 2 : <?=$makan2?><br>
Minum : <?=$minum?><br>
Harga : <?=$harga?><br>
Fasilitas : <?=$tambah?><br>
Tambahan : <?=$tambah1?><br>
Jumlah Beli : <?=$jumbel?><br>
Total Bayar : <?=$tobay?></pre>
<br>
<center><h3><a href="latihan9.html">Input Pembelian</center></h3></a>
</body>
</html>
0 komentar:
Posting Komentar