35 lines
556 B
PHP
35 lines
556 B
PHP
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<title>Calculate Salary</title>
|
||
|
</head>
|
||
|
<body>
|
||
|
<?php
|
||
|
$name = $_POST["name"];
|
||
|
$sirname = $_POST["sirname"];
|
||
|
$salary = $_POST["salary"];
|
||
|
$age = $_POST["age"];
|
||
|
|
||
|
if($salary > 1000 && $salary <= 2000) {
|
||
|
if($age > 45)
|
||
|
$salary *= 1.03;
|
||
|
else
|
||
|
$salary *= 1.1;
|
||
|
} else if($salary <= 1000){
|
||
|
if($age < 30)
|
||
|
$salary = 1100;
|
||
|
else if($age <= 45)
|
||
|
$salary *= 1.03;
|
||
|
else
|
||
|
$salary *= 1.15;
|
||
|
}
|
||
|
?>
|
||
|
|
||
|
Name: <?= $name ?><br />
|
||
|
Sirname: <?= $sirname ?><br />
|
||
|
Salary: <?= $salary ?>€<br />
|
||
|
Age: <?= $age ?><br />
|
||
|
|
||
|
</body>
|
||
|
</html>
|