Advertisement
noonarhz

jau

Mar 17th, 2019
265
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 2.31 KB | None | 0 0
  1. <html>
  2.     <head>
  3.         <title>Golongan gaji</title>
  4.     </head>
  5.     <body>
  6.         <h1>Menentukan Gaji Sesuai Golongan</h1><br/>
  7.         <form method="get" action="Tugas6modul7.php">
  8.         Jumlah Jam Kerja <input type="text" name="jam" /><br/>
  9.         Golongan <select name="i" /><br/>
  10.         <?php
  11.            for($i=A;$i<=D;$i++)
  12.            echo "<option value=\"$i\">$i</option>";
  13.         ?>
  14.          </select><br/><br/>
  15.          <input type="submit" name="submit" value="submit" />
  16.         <input type="reset" name="reset" value="reset" /><br/>
  17.         <?php
  18.        $jam = $_GET['jam'];
  19.        ?>
  20.         <?php
  21.         $i = $_GET['i']; $upah1 = 4000; $upah2 = 5000; $upah3 = 6000; $upah4 = 7500;
  22.        echo "Jumlah Jam Kerja ".$_GET['jam']. " jam/minggu <br>";
  23.         if ($jam == 0)
  24.          { echo "Belum Memasukkan Jumlah Jam Kerja";}
  25.         else
  26.          {if ($i==A && $jam <=48 )
  27.         {
  28.            $gajiA = $jam*$upah1;
  29.             echo "Gaji = Rp. ".$gajiA;
  30.          }
  31.         else if ($jam > 48)
  32.          {
  33.             $lembur = ($jam - 48) * $upah1;
  34.             $glA = (48 * $upah1) + $lembur;
  35.             echo "Gaji Lembur Golongan : ".$i." Sebesar Rp. ".$glA;
  36.          }
  37.         else if ($i==B && $jam <=48 )
  38.         {
  39.            $gajiB = $jam*$upah2;
  40.             echo "Gaji = Rp. ".$gajiB;
  41.          }
  42.         else if ($jam > 48)
  43.          {
  44.             $lembur = ($jam - 48) * $upah2;
  45.             $glB = (48 * $upah2) + $lembur;
  46.             echo "Gaji Lembur Golongan : ".$i." Sebesar Rp. ".$glB;
  47.          }
  48.         else if ($i==C && $jam <=48 )
  49.         {
  50.            $gajiC = $jam*$upah3;
  51.             echo "Gaji = Rp. ".$gajiC;
  52.         }
  53.         else if ($jam > 48)
  54.         {
  55.             $lembur = ($jam - 48) * $upah3;
  56.             $glC = (48 * $upah3) + $lembur;
  57.             echo "Gaji Lembur Golongan : ".$i." Sebesar Rp. ".$glC;
  58.         }
  59.         else if ($i==D && $jam <=48 )
  60.        {
  61.            $gajiD = $jam*$upah2;
  62.             echo "Gaji = Rp. ".$gajiD;
  63.         }
  64.         else if ($jam > 48)
  65.         {
  66.             $lembur = ($jam - 48) * $upah4;
  67.             $glD = (48 * $upah4) + $lembur;
  68.             echo "Gaji Lembur Golongan : ".$i." Sebesar Rp. ".$glD;
  69.         }    
  70.         }
  71.            
  72.         ?>
  73.     </form>
  74.     </body>
  75. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement