person

Create my custom payoff plan

One plan for one debt/credit card


My plan name


The amount I owe now


Interest rate

% (For credit cards enter the highest rate from your last statement)

My next payment is due

Year Month Day

Show payment due dates on payoff plan

I want to try

a payment amount of

making monthly payments

making monthly payments for years


'; echo '
'; echo '
'; echo '

'; echo '
'; echo '
'; echo ''; echo 'Correct the displayed errors'; echo ''; echo '
'; echo '
'; } elseif (!empty($calcErr)) { // Calculation error echo '

'; echo '
'; echo '
'; echo '

'; echo '
'; echo '
'; echo ''; echo 'The calculation failed with the entered values'; echo ''; echo '
'; echo '
'; } else { // Display calculation results $resultLine = ""; if ($use == $txtAmount) { // // Number of payments // if ($remAmt < 0) { $nbrPmts -= 1; $remAmt = $paymentAmt + $remAmt; } $formattedPaymt = number_format(floatval($paymentAmt), 2); $formattedRemAmt = number_format(floatval($remAmt), 2); if (!$printVersion == $txtChecked) { echo '

'; } echo '
'; echo '
'; echo '
'; echo '

'; if ($printVersion == $txtChecked) { $resultLine = "Results in"; } else { $resultLine = "My current choice results in"; } echo $resultLine; echo '

'; echo '
'; echo '
'; echo $nbrPmts; echo ' monthly payments of '; echo $formattedPaymt; if ($nbrPmts > 12) { $resultLine = $resultLine . $nbrPmts . " monthly payments of " . $formattedPaymt; $nbrMonths = $nbrPmts % 12; $nper = $nbrPmts/12; $nbrYears = intval($nper); echo ' ('; $resultLine = $resultLine . " (" . $nbrYears . " years"; echo $nbrYears; echo ' years'; if ($nbrMonths > 0) { $resultLine = $resultLine . " and " . $nbrMonths . " months"; echo ' and '; echo $nbrMonths; echo ' months)'; } else { echo ')'; } $resultLine = $resultLine . ")"; } if ($remAmt <> 0) { echo '
'; echo 'plus a final payment of '; echo $formattedRemAmt; $resultLine = $resultLine . " plus a final payment of " . $formattedRemAmt; } echo '
'; echo '
'; echo '
'; genSchedule($planName, $balance, $rate, $nextYear, $nextMonth, $nextDay, $showDates, $nbrPmts, $paymentAmt, $remAmt, $txtChecked, $printVersion); } else { // // Payment amount // $formattedPaymt = number_format(floatval($paymentAmt), 2); if (!$printVersion == $txtChecked) { echo '

'; } echo '
'; echo '
'; echo '
'; echo '

'; if ($printVersion == $txtChecked) { echo 'which resulted in a plan of'; $resultLine = $resultLine . "which resulted in a plan of"; } else { echo 'My current choice results in'; $resultLine = $resultLine . "My current choice results in"; } echo '

'; echo '
'; echo '
'; echo 'payments of '; echo $formattedPaymt; echo ' per month for '; echo $nbrPayments; echo ' months'; $resultLine = $resultLine . "payments of " . $formattedPaymt . " per month for " . $nbrPayments . " months"; if ($nbrPayments > 12) { $nbrMonths = $nbrPayments % 12; $nper = $nbrPayments/12; $nbrYears = intval($nper); echo ' ('; echo $nbrYears; echo ' years'; $resultLine = $resultLine . " (" . $nbrYears . " years"; if ($nbrMonths > 0) { echo ' and '; echo $nbrMonths; echo ' months)'; $resultLine = $resultLine . " and " . $nbrMonths . " months)"; } else { echo ')'; $resultLine = $resultLine . ")"; } } echo '
'; echo '
'; echo '
'; genSchedule($planName, $balance, $rate, $nextYear, $nextMonth, $nextDay, $showDates, $nbrPayments, $paymentAmt, 0, $txtChecked, $printVersion); } } } function genSchedule($name, $bal, $rate, $year, $month, $day, $showDates, $nper, $pmt, $lastPmt, $chked, $printVersion) { $formattedPaymt = number_format(floatval($pmt), 2); $dueDate = strtotime($month . "/" . $day . "/" . $year); if ($printVersion == $chked) { echo '
'; } else { echo '

'; } if ($printVersion == $chked) { // For printing, left justify the payment table echo '
'; } else { // When display results align with input area above echo '
'; echo '
'; echo '

'; echo '
'; echo '
'; } echo '
'; if ($printVersion == $chked) { echo ''; echo ''; } else { echo '
'; echo ''; } echo ''; if ($showDates == $chked) { echo ''; } echo ''; echo ''; echo ''; echo ''; echo ''; $newBal = $bal; $monthlyRate = $rate / 1200; $intPayment = 0; $principlePayment = 0; $totalInt = 0; $rowDueDate = ""; $_SESSION['tabledata'] = array(); for ($x = 1; $x <= $nper; $x++) { $intPayment = $monthlyRate * $newBal; $totalInt += $intPayment; $principlePayment = $pmt - $intPayment; $newBal = $newBal - $principlePayment; if ($newBal < 0) { $newBal = 0; } $formattedInt = number_format(floatval($intPayment), 2); $formattedPrinciple = number_format(floatval($principlePayment), 2); $formattedNewBal = number_format(floatval($newBal), 2); echo ''; echo ''; if ($showDates == $chked) { echo ''; $rowDueDate = date("Y-m-d", $dueDate); } else { $rowDueDate = ""; } echo ''; echo ''; echo ''; echo ''; echo ''; if ($showDates == $chked) { array_push($_SESSION['tabledata'], array("Number" => $x, "Due Date" => $rowDueDate, "Payment" => $formattedPaymt, "Interest" => $formattedInt, "Principle" => $formattedPrinciple, "Balance" => $formattedNewBal)); } else { array_push($_SESSION['tabledata'], array("Number" => $x, "Payment" => $formattedPaymt, "Interest" => $formattedInt, "Principle" => $formattedPrinciple, "Balance" => $formattedNewBal)); } $dueDate = strtotime("+1 month", $dueDate); } if ($lastPmt <> 0) { $intPayment = $monthlyRate * $newBal; $totalInt += $intPayment; $principlePayment = $lastPmt - $intPayment; $newBal = 0; $formattedPaymt = number_format(floatval($lastPmt), 2); $formattedInt = number_format(floatval($intPayment), 2); $formattedPrinciple = number_format(floatval($principlePayment), 2); $formattedNewBal = number_format(floatval($newBal), 2); echo ''; echo ''; if ($showDates == $chked) { echo ''; $rowDueDate = date("Y-m-d", $dueDate); } else { $rowDueDate = ""; } echo ''; echo ''; echo ''; echo ''; echo ''; if ($showDates == $chked) { array_push($_SESSION['tabledata'], array("Number" => $x, "Due Date" => $rowDueDate, "Payment" => $formattedPaymt, "Interest" => $formattedInt, "Principle" => $formattedPrinciple, "Balance" => $formattedNewBal)); } else { array_push($_SESSION['tabledata'], array("Number" => $x, "Payment" => $formattedPaymt, "Interest" => $formattedInt, "Principle" => $formattedPrinciple, "Balance" => $formattedNewBal)); } } // Add total interest $formattedInt = number_format(floatval($totalInt), 2); echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo ''; echo '
NumberDue DatePaymentInterestPrincipleBalance
'; echo '

' . $x . '

'; echo '
'; echo '

' . date("Y-m-d", $dueDate) . '

'; echo '
'; echo '

' . $formattedPaymt . '

'; echo '
'; echo '

' . $formattedInt . '

'; echo '
'; echo '

' . $formattedPrinciple . '

'; echo '
'; echo '

' . $formattedNewBal . '

'; echo '
'; echo '

' . $x++ . '

'; echo '
'; echo '

' . date("Y-m-d", $dueDate) . '

'; echo '
'; echo '

' . $formattedPaymt . '

'; echo '
'; echo '

' . $formattedInt . '

'; echo '
'; echo '

' . $formattedPrinciple . '

'; echo '
'; echo '

' . $formattedNewBal . '

'; echo '
'; echo '

Total

'; echo '
'; echo '

interest

'; echo '
'; echo '

'; echo '
'; echo '

' . $formattedInt . '

'; echo '
'; echo '

'; echo '
'; echo '

'; echo '
'; array_push($_SESSION['tabledata'], array("Number" => "Total", "Due Date" => "interest", "Payment" => " ", "Interest" => $formattedInt, "Principle" => " ", "Balance" => " ")); if (!$printVersion == $chked) { echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; echo '
'; } } ?>