| Calculate NET SALARY of employees 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
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950<html><body><form name="frm1"method="GET"action="">// <span id="IL_AD9" class="IL_AD">Basic Html</span> FormBASIC 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 textboxif($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");}elseif($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");}elseif($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)
Read More On Extra Tutorials
No comments:
Post a Comment