Sunday, 20 October 2013

Calculate NET SALARY of employees in php

Calculate NET SALARY of employees in php
Calculate NET SALARY of employees using followingcriteria.
  • If basic salary is greater than 10,000 then
  1. Dearness allowance (DA) =5% of basic salary
  2.  House Rent Allowance (HRA)= 5% of basic salary
  3.  Provident Fund (Pf) =2% of basic salary
  • If basic salary is greater than 25,000 then
  1. Dearness allowance (DA) = 10%  of basic salary
  2. House Rent Allowance (HRA) = 10% of  basic salary
  3.  Provident Fund (Pf) = 10% of basic salary
  • If basic salary is greater than 50,000 the
  1. Dearness allowance (DA) = 15%  of basic salary
  2. House Rent Allowance (HRA) = 15% of  basic salary
  3.  Provident Fund (Pf) = 15% of basic salary
Code For Calculate Net Basic Salary
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<html>
 <body>
 <form name="frm1" method="GET" action=""> // <span id="IL_AD9" class="IL_AD">Basic Html</span> 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 <span id="IL_AD12" class="IL_AD">html form</span>
 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");
 }
 
}
 ?>
Output (Screenshot1)
calculate net basic salary in php project
calculatenetbasicsalary(screenshot1)
Read More On Extra Tutorials

No comments:

Post a Comment