input.php
<html>
<head>
<title>Input</title>
<table>
<form id="form1" name="form1" method="post" action="output.php">
<h1>TOKO CAT GUNA BANGUN JAYA</h1>
</head>
<HR WIDTH=60% ALIGN="left" SIZE=10 /><br><br>
<tr>
<td> Nama Customer</td>
<td>:</td>
<td><input name="nama" type="text" id="nama"></td>
</tr>
<tr>
<td> Alamat</td>
<td>:</td>
<td><input name="alamat" type="text" id="alamat"></td>
</tr>
<tr>
<td> Jenis Cat</td>
<td>:</td>
<td><Select name="jeniscat" id="jeniscat">
<option>Dulax</option>
<option>Mowlex</option>
<option>Dana Paint</option>
<option>Catylac</option>
<option>Nippon Paint</option>
</select>
</td>
<tr/>
<tr>
<td> Warna Cat</td>
<td>:</td>
<td><input name="Warnacat" type="radio" value="Merah Muda"/>Merah Muda
<input name="Warnacat" type="radio" value="Bening"/>Bening
<input name="Warnacat" type="radio" value="Butek"/>Butek
<input name="Warnacat" type="radio" value="Hijau Telor Asin"/>Hijau Telor Asin
<input name="Warnacat" type="radio" value="Ungu"/>Ungu
<input name="Warnacat" type="radio" value="Putih"/>Putih
</td>
</tr>
<tr>
<td> Jumlah Beli</td>
<td>:</td>
<td><input name="Jumlahbeli" type="text" id="Jumlahbeli"<td/>
</td>
</tr>
<tr>
<td><input type="submit" name="Submit" value="Hitung" />
<input type="reset" name="Submit2" value="Batal" /></td>
</tr>
</form>
</table>
</html>
------------------------------------------------------------------------------------------------------------------
output.php
<html>
<head>
<title>Output</title>
<h1>TOKO CAT GUNA BANGUN JAYA</h1>
</head>
<HR WIDTH=60% ALIGN="left" SIZE=10 /><br><br>
<body>
<form id="form1" name="form1" method="post" action="">
<?php
$nama=$_POST['nama'];
$alamat=$_POST['alamat'];
$jeniscat=$_POST['jeniscat'];
$Jumlahbeli=$_POST['Jumlahbeli'];
$Warnacat=$_POST['Warnacat'];
if($jeniscat=="Catylac")
{$a=55000;}
else if ($jeniscat=="Dulax")
{$a=55000;}
else if ($jeniscat=="Dana Paint")
{$a=35000;}
else if ($jeniscat=="Mowlex")
{$a=25000;}
if($jeniscat=="Nippon Paint")
{$a=60000;}
$total=$a*$Jumlahbeli;
if ($Jumlahbeli>=5)
{$b=$total* 5/100;}
else if ($Jumlahbeli>=10)
{$b=$total* 10/100;}
else {$b=0;}
$totbay=$total-$b;
?>
<table>
<tr>
<td colspan="20">---------------------------------------------------------------</td>
</tr>
<tr>
<td> Nama Costumer</td>
<td>:</td>
<td> <?php echo $nama ?></td>
</tr>
<tr>
<td>Alamat</td>
<td>:</td>
<td><?php echo $alamat ?></td>
</tr>
<tr>
<td>Jenis Cat </td>
<td>:</td>
<td><?php echo $jeniscat ?></td>
</tr>
<tr>
<td>Warna Cat</td>
<td>:</td>
<td><?php echo $Warnacat ?></td>
</tr>
<tr>
<td>Harga</td>
<td>:</td>
<td>Rp.<?php echo $a ?></td>
</tr>
<tr>
<td>Jumlah Beli </td>
<td>:</td>
<td><?php echo $Jumlahbeli ?></td>
</tr>
<tr>
<td colspan="4">----------------------------------------------------------------(*)</td>
</tr>
<tr>
<td>Total Harga </td>
<td>:</td>
<td>Rp.<?php echo $total ?> </td>
</tr>
<tr>
<td>Diskon</td>
<td>:</td>
<td>Rp.<?php echo $b ?> </td>
</tr>
<tr>
<td colspan="4">----------------------------------------------------------------(-)</td>
</tr>
<tr>
<td>Total Bayar </td>
<td>:</td>
<td>Rp.<?php echo $totbay ?></td>
</tr>
<tr>
<td colspan="4">------------------------------------------------------------------------------</td>
</tr>
<tr>
<td colspan="4"><a href="input.php">Kembali</a></td>
</tr>
</table>
</form>
</body>
</html>
Hasil :
Toko Cat
Langganan:
Posting Komentar (Atom)
Tidak ada komentar:
Posting Komentar