ceu-notes/2/IAW/assignments/ejercicios-php-naortega/calc-sal.php

35 lines
556 B
PHP
Raw Normal View History

2022-11-11 16:46:42 +00:00
<!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>