= 10 && $payRate <= 200)==FALSE) { $displayForm=TRUE; $errorMessages = "

Please enter a pay rate that is between 10 and 200.

\n"; } if (($hours >= 0 && $hours <= 79 && !empty($hours))==FALSE) { $displayForm=TRUE; $errorMessages .= "

Please enter Number of Hours between 0 and 79

\n"; } if (empty($errorMessages)) { $displayForm = FALSE; if ($hours < 40) { $regPay = $payRate * $hours; $otPay = 0; } else { $regPay = $payRate * 40; $otPay = $payRate * 1.5 * ($hours - 40); } $totalPay = $regPay + $otPay; } } $regPay = 0; $otPay = 0; $totalPay = 0; $hours = 0; $payRate = 0; if (count($_POST) > 0) { $hours = (double)$_POST["hours"]; $payRate = (double)$_POST["payRate"]; calcPay($hours, $payRate, $regPay, $otPay, $totalPay); } if ($displayForm) { echo $errorMessages; ?>

Enter your pay rate:  

Enter the hours worked:  

0) { echo "Hours: " . $hours . "
"; echo "Pay Rate: $" . money_format("%i" , $payRate) . "
\n"; echo "Regular Pay: $" . money_format("%i", $regPay) . "
\n"; echo "Overtime Pay: $" . money_format("%i", $otPay) . "
\n"; echo "Total Pay: $" . money_format("%i", $totalPay) . "
\n"; ?>