again! I've already made an
echo "<input type='number' name='total' value='$employee->totalSalary($raise,$pay)' readonly='readonly'>";.
But it says:
Notice: Undefined property: Employee::$totalSalary in C:\xampp\htdocs\salary.php on line
Though, I have this property:
$id1 = $_POST["id"];
$fname = $_POST["fname"];
$lname = $_POST["lname"];
$pay = $_POST["salary"];
$raise = $_POST["raise"];
$employee = new Employee($id1,$fname,$lname,$pay);
I have this function to get my total annual salary:
function totalSalary($raise,$salary){
$raisePerc = $raise / 100;
$annual = $salary * 12;
$annualTotal = ($annual * $raisePerc) + $annual;
return $annualTotal;
}
I want to display the total annual salary on the number/text field. Thank you for answering. :)