Tuesday 8 April 2014

Calculate NET SALARY of employees in php


Calculate NET SALARY of employees using following criteria In Php.

If basic salary is greater than 10,000 then

  • Dearness allowance (DA) =5% of basic salary
  • House Rent Allowance (HRA)= 5% of basic salary
  • Provident Fund (Pf) =2% of basic salary
If basic salary is greater than 25,000 then
  • Dearness allowance (DA) = 10%  of basic salary
  • House Rent Allowance (HRA) = 10% of  basic salary
  •  Provident Fund (Pf) = 10% of basic salary
If basic salary is greater than 50,000 the
  • Dearness allowance (DA) = 15%  of basic salary
  • House Rent Allowance (HRA) = 15% of  basic salary
  •  Provident Fund (Pf) = 15% of basic salary

Code For Calculate Net Basic Salary


<html>

 <body>

 <form name="frm1" method="GET" action=""> // Basic Html Form

 BASIC SALARY:<input type="text" name="bs"> // Input Textbox for take value to calculate

 <br>

 <input type="submit" name="submit" value="submit"> // Submit value for calculate

 </form>

 <?php

 $page=$_GET['frm1']; //to get a value from the html form

 if($page="frm1")

 {

 $bsal=$_GET['bs']; // to get value of textbox



if($bsal>=10000) // If basic salary is greater than 10,000 then



{

 $da=0.05*$bsal;

 $hra=0.05*$bsal;

 $pf=0.02*$bsal;

 $ns=$bsal+$da+$hra-$pf;

 echo("net salary is $ns");

 }

 else if ($bsal>=25000) // If basic salary is greater than 25,000 then

 {

 $da=0.1*$bsal;

 $hra=0.1*$bsal;

 $pf=0.1*$bsal;

 $ns=$bsal+$da+$hra-$pf;

 echo("net salary is $ns");

 }

 else if($bsal>=50000) //If basic salary is greater than 50,000 then



{

 $da=0.15*$bsal;

 $hra=0.15*$bsal;

 $pf=0.15*$bsal;

 $ns=$bsal+$da+$hra-$pf;

 echo("net salary is $ns");

 }

 else

 {

 $da=0;

 $hra=0;

 $pf=0;

 $ns=$bsal+$da+$hra-$pf;

 echo("net salary is $ns");

 }



}

 ?>



No comments:

Post a Comment

Thanks For Comment Will get you Soon..

About Me

Welcome to Extra Tutorials! My name is Mohammed and I am the 22 year writer, website developer, and photographer behind the blog. Thanks for visiting! Tutorials Jackpot… In addition to Developer, I love to develop websites and I love to write. Starting a php Blog was inevitable for me. What began as a simple way to share all of my Tutorials with friends and family has developed into my Part time job.

Mohammed Padela

WHAT IS PHP PROGRAMMING

WHAT IS PHP PROGRAMMING
WHAT IS PHP PROGRAMMING

Follow Us

Popular Posts

Designed ByBlogger Templates