A simple program using PHP to solve the salary of an employee in the company.
I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details. If you want to advertise on my website kindly contact me also in my email address also. Thank you.
Program Listing
<!doctype html>
<html>
<head>
<title>Payroll Program in PHP</title>
</head>
<body>
<style>
body {
font-family: arial;
size: 12px;
}
</style>
<form method="POST" action="">
<h2>Payroll Program in PHP</h2>
<?php
$days_work=$rate=$g_sal=$deduct=$n_sal=0;
if(isset($_POST['compute'])){
$days_work=$_POST['days_work'];
$rate=$_POST['interest_rate'];
$g_sal=$days_work*$rate;
$deduct=$g_sal*.1;
$n_sal=$g_sal-$deduct;
}
?>
<p>Number of Days Work: <input type="text" name="days_work" size="8" value="<?=$days_work;?>"/></p>
<p>Rate Per Day: <input type="text" name="interest_rate" size="8" value="<?=$rate;?>"/></p>
<p><input type="submit" name="compute" value="Compute Salary"/></p>
<p>
Gross Salary: <?=number_format($g_sal, 2);?><br/>
Deduction: <?=number_format($deduct, 2);?><br/>
Net Salary: <?=number_format($n_sal, 2);?>
</p>
</form>
</body>
</html>
No comments:
Post a Comment