Latihan Input Output Gaji

Download as doc, pdf, or txt
Download as doc, pdf, or txt
You are on page 1of 2

Input Gaji <!doctype html public "-//W3C//DTD HTML 4.0 //EN"> <html> <head> <title>Title here!

</title> </head> <body> <form action="output_gaji.php" methode="post"> <h3 align=center> <table border=1 align=center width=100=100%> Gaji Pegawai <tr> <td>Nama Pegawai</td> <td>:</td> <td><input type="text" name=nama size=30></td> </tr> <tr> <td>Alamat Pegawai</td> <td>:</td> <td><input type="text" name=alamat size=30></td> </tr> <tr> <td>Golongan</td> <td>:</td> <td><Select size=1 name=gol> <option value=1> 1 <option value=2> 2 <option value=3> 3 </td> </tr> <tr> <td>Jumlah Anak</td> <td>:</td> <td><input type="text" name=jml size=30></td> </tr> <tr> <td colspan=3 align=right><input type="submit" value=Kirim> <input type="reset" value=Batal></td> </tr> </form> </body> </html>

Output Gaji 1 Achmad Isnaini NIM : 18090807

Kelompok D Lab. A Sore 12.5C. 24

<!doctype html public "-//W3C//DTD HTML 4.0 //EN"> <html> <head> <title>Title here!</title> </head> <body> </body> </html> <? echo"<h3 align=Left>Slip Gaji<br>"; $Nama_pegawai=$_POST['nama']; $Alamat=$_POST['alamat']; $Golongan=$$_POST['gol']; $Jum_anak=$_POST['jml']; switch($Golongan) {case 1: $jabatan="Direktur"; $gaji=5000000; break; case 2: $jabatan="Personalia"; $gaji=3000000; break; default: $jabatan="Staff"; $gaji=1000000; } if($jml>=2) $tunjangan=0.05*$gaji; else if($jml>=1) $tunjangan=0.02*$gaji; else $tunjangan=0; $Tot_gaji=($gaji+$tunjangan); echo"<Pre>"; echo"Nama Pegawai :$nama<br>"; echo"Alamat :$alamat<br>"; echo"Jabatan :$jabatan<br>"; echo"Tunjangan :$tunjangan<br>"; echo"Total Gaji :$Tot_gaji<br>"; ?> <a href="input_gaji.php"> Input Lagi </a> </body> </html>

2 Achmad Isnaini NIM : 18090807

Kelompok D Lab. A Sore 12.5C. 24

You might also like