require_once('../Include/system.inc'); $strTitle = "Affordability Calculator"; $aMeta[desc] = "Mortgate Calculator"; $strArticleHeading = $strTitle; ?> include( '../Include/header.inc'); ?> ob_start(); ?>
$form = ob_get_clean(); if($_REQUEST[action]) { ob_start(); if(!is_numeric($_POST[income]) || !is_numeric($_POST[years]) || !is_numeric($_POST[interestRate])) $error[] = "Please fill-up the required fields with appropriate values."; elseif($_POST[interestRate]>30 || $_POST[interestRate]<1) $error[] = "Please make sure that the Interest rate is between 0 to 30."; elseif((intval($_POST[years]) > 30) || (intval($_POST[years]) < 0)) $error[] = "Please make sure that the Amortization length is between 0 to 30."; elseif($_POST[frontEnd]>36 || $_POST[frontEnd]< 28) $error[] = "Please make sure that the Front-end ratio is between 28 to 36."; elseif($_POST[backEnd]> 45 || $_POST[backEnd]< 36) $error[] = "Please make sure that the Front-end ratio is between 36 to 45"; if(count($error)) { echo 'You may qualify for around $=number_format($homeValue,2)?>.
Front-End Ratio | |
---|---|
Monthly gross income | =number_format($income,2);?> |
Front-end ratio | =$_POST[frontEnd]?>% |
Calculated payment for front-end ratio | =number_format($frontEndRatio,2);?> |
Back-End Ratio | |
Debts and obligations | =number_format($debt,2);?> |
Percent of gross income | =$debt_p;?>% |
Maximum percentage available for mortgage payment | =$mortgage_p;?>% |
Calculated payment for back-end ratio | =number_format($backEndRatio,2);?> |
Payment Calculation | |
Minimum of the two ratio options | =number_format($option,2);?> |
Less: taxes and insurance | =number_format(($propertyInsurance + $propertyTax),2);?> |
Equals: maximum allowable payment | =number_format($monthlyPayment_allow,2);?> |
Calculated mortgage amount | =number_format($mortgage,2);?> |
Down payment | =number_format($downPayment,2);?> |
Amount you can afford | =number_format($homeValue,2);?> |