Gambar 1.0 Ketika Button Proses Diclick Maka Tampil Seperti Gambar 2.0 |
Gambar 2.0 Ketika Click "Input Lagi" Maka Tampil Seperti Gambar 1.0 |
Coding/Listing Gambar 1.0 (Simpan Dengan Nama latihan15.html) :
<!doctype html public "-//W3C//DTD HTML 4.0 //EN">
<html>
<head>
<title>Latihan 15</title>
</head>
<body bgcolor="gray">
<form action="cetak.php" method="post">
<center><h1><font face="Papyrus" color="white">Pendaftaran Kursus Sejaterah</center></h1></font>
<hr width=100% size=4 color="black" />
<br>
<table width=500 border="1" align="center" bgcolor="#DCDCDC">
<tr>
<td colspan="2" align="center"><font face="papyrus"><b>Input Pendaftaran</b></font></td>
</tr>
<tr>
<td width="200">Nama Siswa</td>
<td><input type="text" size=40 name="nama"></td>
</tr>
<tr>
<td valign="top">Alamat</td>
<td><textarea rows="4" cols="25" name="alamat"></textarea></td>
</tr>
<tr>
<td>Jenis Kelamin</td>
<td><input type="radio" value="Pria" name="jk">Pria<br>
<input type="radio" value="Wanita" name="jk">Wanita
</tr>
<tr>
<td>Kelas Ruangan</td>
<td><select name="kelas">
<option>--Click Here--</option>
<option value="AC">AC</option>
<option value="Tidak AC">Tidak AC</option>
</select></td>
</tr>
<tr>
<td valign="top">Jenis Kursus</td>
<td><input type="checkbox" name="jenis1" value="Biologi">Biologi<br>
<input type="checkbox" name="jenis2" value="Kimia">Kimia<br>
<input type="checkbox" name="jenis3" value="Matematika">Matematika<br>
<input type="checkbox" name="jenis4" value="Bahasa Inggris">Bahasa Inggris
</td>
<tr>
<td border="0" align="center" colspan="2">
<input type="submit" value="Proses"><input type="reset" value="Cancel">
</tr></td>
</table>
<br><br><br><br><br><br><br><br><br><br>
<hr width=100% size=4 color="black" />
<center><h5><font face="Papyrus" color="white">Copright © 2012 | Powered By Adam Khamarullah</center></h5></font>
</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 15</title>
</head>
<body bgcolor="gray">
<?
$nama=$_POST['nama'];
$alamat=$_POST['alamat'];
$jk=$_POST['jk'];
if($kelas=='AC')
{
$harga=1200000;
}
else
{
$harga=600000;
}
if($jenis1=='Biologi')
{
$ket1="Biologi";
$bio=40000;
}
else
{
$ket1="Biologi";
$bio=0;
}
if($jenis2=='Kimia')
{
$ket2="Kimia";
$kim=50000;
}
else
{
$ket2="Kimia";
$kim=0;
}
if($jenis3=='Matematika')
{
$ket3="Matematika";
$mat=60000;
}
else
{
$ket3="Matematika";
$mat=0;
}
if($jenis4=='Bahasa Inggris')
{
$ket4="Bahasa Inggris";
$bing=70000;
}
else
{
$ket4="Bahasa Inggris";
$bing=0;
}
$total=$harga+$bio+$kim+$mat+$bing;
?>
<center><h1><font face="Papyrus" color="white">Pendaftaran Kursus Sejaterah</center></h1></font>
<hr width=100% size=4 color="black" />
<br>
<table border=1 bgcolor="gray" align="center">
<tr><td colspan="2" align="center">Jenis Kursus</tr></td>
<tr><td><?=$ket1?></td><td>Rp.<?=$bio?></td></tr>
<tr><td><?=$ket2?></td><td>Rp.<?=$kim?></td></tr>
<tr><td><?=$ket3?></td><td>Rp.<?=$mat?></td></tr>
<tr><td><?=$ket4?></td><td>Rp.<?=$bing?></td></tr>
</table>
<pre>
Nama Siswa : <?=$nama?><br>
Alamat : <?=$alamat?><br>
Jenis Kelamin : <?=$jk?><br>
Kelas Ruangan : <?=$kelas?><br>
Biaya : Rp. <?=$harga?><br>
------------------------------------------------------------
Total Rp. <?=$total?></pre>
<br>
<center><h3><a href="latihan15.html">Input Lagi</center></h3></a>
<br><br><br><br><br><br>
<hr width=100% size=4 color="black" />
<center><h5><font face="Papyrus" color="white">Terima Kasih</center></h5></font>
</body>
</html>
0 komentar:
Posting Komentar