Advertisement
Guest User

FIle_2_karTetap.php

a guest
Oct 25th, 2014
132
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.99 KB | None | 0 0
  1. <?php
  2. include('Karyawan.php');
  3. class karTetap extends Karyawan
  4. {
  5. public $golongan;
  6. public $tunjangan;
  7. public $totalgaji;
  8.  
  9. public function construct()
  10. {
  11.     parent::__construct(); //panggil induk
  12.     $this->golongan;
  13.     $this->tunjangan;
  14.     $this->totalgaji;
  15. }
  16.  
  17.   public function setGol($gol)
  18.   {
  19.     if($gol=="IA")
  20.      {$gapok=3000000;}
  21.     if($gol=="IIA")
  22.      {$gapok=2500000;}
  23.     if($gol=="IIB")
  24.      {$gapok=2000000;}
  25.     if($gol=="")
  26.      {$gapok=0;}  
  27.     $this->golongan=$gol;
  28.     $this->gapok=$gapok;
  29.   }
  30.     public function getGol()
  31.     {
  32.         return $this->golongan;
  33.     }
  34.   public function setTunjangan($tunj)
  35.   {
  36.     if($tunj=="")
  37.      {$tunj=0;}
  38.     $this->tunjangan=$tunj;  
  39.   }
  40.     public function getTunjangan()
  41.     {
  42.         return $this->tunjangan;
  43.     }
  44.   public function setGapok($gapok)
  45.   {
  46.     $this->gapok=$gapok;
  47.   }
  48.     public function getGapok()
  49.     {
  50.         return $this->gapok;
  51.     }  
  52.   public function hitungGaji()
  53.   {
  54.     $this->totalgaji = $this->gapok + $this->tunjangan;
  55.     return $this->totalgaji;
  56.   }
  57. }
  58. ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement