Rabu, 25 April 2012

Contoh Kasus Kedua

Perhitungan gaji pegawai
    Menghitung berapa gaji kotor yang diterima, berapa pph dari penghasilan dan gaji bersih yang diterima oleh seorang pegawai yang berkerja pada sebuah instansi pemerintah daerah. Gaji kotor diperoleh dari penjumlahan gaji pokok,tunjangan suami/ istri, tunjangan anak,tunjangan fungsional dan tunjangan beras. Sedangkan potongan diperoleh dari penjumlahan tunjangan perumahan dan pph. Sehingga akan diperoleh gaji bersih selisih antara gaji kotor dan potongan- potongan yang ada.
      Berikut script programnya simpan dengan gaji pegawai.php

<?php
$gpok= 2357100;
$tsuamis= 235710;
$tanak= 101484;
$tfungsi= 400000;
$tbrs= 223200;
$perum= 7000;
$pph= 78046;
$gkotor =($gpok+$suamis+$stanak+$tfungsi+$tbrs);
$potongan =($perum+$pph);
$gbrsih = ($gkotor - $potongan);
?>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
.style2 {
color: #FFFFFF;
font-style: italic;
}
-->
</style>
<table width="623" height="333" border="2" align="center" cellpadding="3" cellspacing="0"
bordercolor="#000066">
  <tr>
<th height="59" colspan="3" bgcolor="#000066" scope="row"><div align="center"
class="style1">DAFTAR GAJI PEGAWAI </div></th>
  </tr>
  <tr>
<th width="455" bordercolor="#CCCCFF" bgcolor="#CCCCFF" scope="row"><div
align="justify">Gaji Pokok </div></th>
<td width="26" bordercolor="#CCCCFF" bgcolor="#CCCCFF">Rp.</td>
<td width="114" bordercolor="#CCCCFF" bgcolor="#CCCCFF"><div align="right"> <?php echo
$gpok ?> </div></td>
</tr>
 <tr>
 <th bordercolor="#CCCCFF" bgcolor="#CCCCFF" scope="row"><div align="justify">Tunjangan
Suami/istri</div></th>
 <td bordercolor="#CCCCFF" bgcolor="#CCCCFF">Rp.</td>
 <td bordercolor="#CCCCFF" bgcolor="#CCCCFF"><div align="right"><?php echo $tsuamis  
</div></td>
 </tr>
 <tr>
 <th bordercolor="#CCCCFF" bgcolor="#CCCCFF" scope="row"><div align="justify">Tunjangan
Anak </div></th>
<td bordercolor="#CCCCFF" bgcolor="#CCCCFF">Rp.</td>
<td bordercolor="#CCCCFF" bgcolor="#CCCCFF"><div align="right"><?php echo $tanak ?> </div
</td>
</tr>
<tr>
<th bordercolor="#CCCCFF" bgcolor="#CCCCFF" scope="row"><div align="justify">Tunjangan
Fungsional </div></th>
<td bordercolor="#CCCCFF" bgcolor="#CCCCFF">Rp.</td>
 <td bordercolor="#CCCCFF" bgcolor="#CCCCFF"><div align="right"><?php echo $tfungsi ?
</div></td>
</tr>
 <tr>
 <th bordercolor="#CCCCFF" bgcolor="#CCCCFF" scope="row"><div align="justify">Tunjangan
Beras </div></th>
<td bordercolor="#CCCCFF" bgcolor="#CCCCFF">Rp.</td>
<td bordercolor="#CCCCFF" bgcolor="#CCCCFF"><div align="right"><?php echo $tbrs ?> </div
</td>
 </tr>
 <tr>
 <th bordercolor="#CCCCFF" bgcolor="#CCCCFF" scope="row"><div align="justify">Tunjangan
Perumahan </div></th>
<td bordercolor="#CCCCFF" bgcolor="#CCCCFF">Rp.</td>
 <td bordercolor="#CCCCFF" bgcolor="#CCCCFF"><div align="right"><?php echo $perum ?
</div></td>
 </tr>
 <tr>
 <th bordercolor="#CCCCFF" bgcolor="#CCCCFF" scope="row"><div align="justify">PPH</div
</th>
<td bordercolor="#CCCCFF" bgcolor="#CCCCFF">Rp.</td>
<td bordercolor="#CCCCFF" bgcolor="#CCCCFF"><div align="right"><?php echo $pph ?> </div
</td>
 </tr>
 <tr>
 <th bordercolor="#000066" bgcolor="#000066" scope="row"><div align="left" class="style2">Gaji
Kotor </div></th>
    <td bordercolor="#000066" bgcolor="#000066"><span class="style1">Rp.</span></td>
    <td bordercolor="#000066" bgcolor="#000066"><div align="right" class="style1"><?php echo $gkotor ?> </div></td>
  </tr>
  <tr>
    <th bordercolor="#000066" bgcolor="#000066" scope="row"><div align="left" class="style1"><em>Potongan</em></div></th>
    <td bordercolor="#000066" bgcolor="#000066"><span class="style1">Rp.</span></td>
    <td bordercolor="#000066" bgcolor="#000066"><div align="right" class="style1"><?php echo $potongan ?> </div></td>
  </tr>
  <tr>
    <th bordercolor="#000066" bgcolor="#000066" scope="row"><div align="left" class="style1"><em>Gaji Bersih </em></div></th>
    <td bordercolor="#000066" bgcolor="#000066"><span class="style1">Rp.</span></td>
    <td bordercolor="#000066" bgcolor="#000066"><div align="right" class="style1"><?php echo $gbrsih ?> </div></td>
  </tr>
</table>

hasil program :








Tidak ada komentar:

Posting Komentar