Advertisement
noonarhz

rrj

Mar 23rd, 2019
434
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 0.76 KB | None | 0 0
  1. <html>
  2.     <head>
  3.     <title>Tugas 3 Modul 6</title>
  4.     </head>
  5. <body>
  6. <h1>Menghitung Gaji Pegawai Honorer</h1>
  7. <form method="get"action=" ">
  8.     Jumlah Jam Kerja <input type="text" name="jam" /><br/>
  9.     <input type="submit" name="submit" value="submit" />
  10.     <input type="reset" name="reset" value="reset" /><br/>
  11. <?php
  12. $jam = $_GET['jam'];
  13. $upah1 = 2000;
  14. $upah2 = 3000;
  15. $gaji1 = $jam * $upah1;
  16. $lembur = ($jam - 48) * $upah2;
  17. $gaji2 = (48 * $upah1) + $lembur;
  18. echo "Jumlah Jam Kerja ".$_GET['jam']. " jam/minggu <br>";
  19. switch($jam)
  20. {
  21.     case $jam <= 48 : echo "Gaji = Rp. ".$gaji1."</br>";
  22.     break;
  23.     case $jam > 48 : echo "Gaji = Rp. ".$gaji2."</br>";
  24.     break;
  25.     default : "Belum Memasukan Jumlah Jam Kerja";
  26. }
  27. ?>
  28. </form>
  29. </body>
  30. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement