|
|
");
print("Mortgage Calculator");
print("");
print("PHP Mortgage Calculator");
print(" \n\n");
$print_footer = TRUE;
} else {
$print_footer = FALSE;
}
// Style Sheet
?>
Sale Price of Home, Length of Motgage and Annual Interest Rate";
}
if (!$error) {
$month_term = $year_term * 1;
$down_payment = $sale_price * ($down_percent / 100);
$annual_interest_rate = $annual_interest_percent / 100;
$monthly_interest_rate = $annual_interest_rate / 12;
$financing_price = $sale_price - $down_payment;
$monthly_factor = get_interest_factor($year_term, $monthly_interest_rate);
$monthly_payment = $financing_price / $monthly_factor;
}
} else {
if (!$sale_price) { $sale_price = $default_sale_price; }
if (!$annual_interest_percent) { $annual_interest_percent = $default_annual_interest_percent; }
if (!$year_term) { $year_term = $default_year_term; }
if (!$down_percent) { $down_percent = $default_down_percent; }
if (!$show_progress) { $show_progress = $default_show_progress; }
}
if ($error) {
print("" . $error . "
\n");
$form_complete = false;
}
?>
Amortization For Monthly Payment: \$" . number_format($monthly_payment, "2", ".", "thousands_sep") . " over " . $year_term . " years \n");
print("\n");
// This LEGEND will get reprinted every 12 months
$legend = "\t\n";
$legend .= "\t\t| Month | \n";
$legend .= "\t\tInterest Paid | \n";
$legend .= "\t\tPrincipal Paid | \n";
$legend .= "\t\tRemaing Balance | \n";
$legend .= "\t \n";
echo $legend;
// Loop through and get the current month's payments for
// the length of the loan
while ($current_month <= $month_term) {
$interest_paid = $principal * $monthly_interest_rate;
$principal_paid = $monthly_payment - $interest_paid;
$remaining_balance = $principal - $principal_paid;
$this_year_interest_paid = $this_year_interest_paid + $interest_paid;
$this_year_principal_paid = $this_year_principal_paid + $principal_paid;
print("\t\n");
print("\t\t| " . $current_month . " | \n");
print("\t\t\$" . number_format($interest_paid, "2", ".", "thousands_sep") . " | \n");
print("\t\t\$" . number_format($principal_paid, "2", ".", "thousands_sep") . " | \n");
print("\t\t\$" . number_format($remaining_balance, "2", ".", "thousands_sep") . " | \n");
print("\t \n");
($current_month % 12) ? $show_legend = FALSE : $show_legend = TRUE;
if ($show_legend) {
print("\t\n");
print("\t\t| Totals for year " . $current_year . " | \n");
print("\t \n");
$total_spent_this_year = $this_year_interest_paid + $this_year_principal_paid;
print("\t\n");
print("\t\t| | \n");
print("\t\t\n");
print("\t\t\tYou will spend \$" . number_format($total_spent_this_year, "2", ".", "thousands_sep") . " on your house in year " . $current_year . " \n");
print("\t\t\t\$" . number_format($this_year_interest_paid, "2", ".", "thousands_sep") . " will go towards INTEREST \n");
print("\t\t\t\$" . number_format($this_year_principal_paid, "2", ".", "thousands_sep") . " will go towards PRINCIPAL \n");
print("\t\t | \n");
print("\t \n");
print("\t\n");
print("\t\t
| \n");
print("\t \n");
$current_year++;
$this_year_interest_paid = 0;
$this_year_principal_paid = 0;
if (($current_month + 6) < $month_term) {
echo $legend;
}
}
$principal = $remaining_balance;
$current_month++;
}
print(" \n");
}
?>
\n");
print("
\n");
}
?>
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials
provided with the distribution.
* Neither the name of David Tufts nor the names of its
contributors may be used to endorse or promote products
derived from this software without specific prior
written permission.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
?>
Loan amount - Total dollar amount of your loan.
Interest rate (APR) - The annual percentage rate for this loan or line of credit.
Term in months - Number of months for this loan or line of credit.
Fixed loan term - Traditional amortization produces a fixed monthly payment. The monthly payment calculated will leave a zero balance at the end of the loan's term.
2%, 1.5% or 1% of balance - Your minimum payment is calculated as a percentage of the outstanding principal balance. Your minimum payment will change each month, and if you only make the minimum payment your balance will not be zero at the end of your loan's term.
100% of interest owed - For lines paying interest owed, your payment is 100% of the interest accrued during the month but no principal. Your payment may not be fixed if your interest rate or principal balance changes.
|
|
Express Lane for Loans under $15,000---Get Cash in 48 Hours!
(click here)
|