Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $plafon = 40000000;
- $bunga = 11.76;
- $bulan = 36;
- $effectiverate = 20.8104 / 100;
- $effectiverate2 = $effectiverate / 12;
- $y1 = $plafon * ($effectiverate / 12);
- $x0 = ($bunga / 100) / 12;
- $x1 = $plafon / $bulan;
- $x2 = $plafon * $x0;
- $totalangsuran = ($x1 + $x2);
- echo '<br>Angsuran Pokok : ' . number_format(ceil($totalangsuran - $y1));
- echo '<br>Angsuran Bunga : ' . number_format($y1, 0);
- echo '<br>Total Angsuran : ' . number_format(ceil($x1 + $x2), 0);
- echo "<table border='1'><Tr>
- <td>Angsuran Ke</td>
- <td>Angsuran POkok</td>
- <td>Angsuran bunga</td>
- <td>Total Angsuran</td>
- <td>Sisa Pinjaman pokokx</td>
- </tr>
- <tr><td colspan=4></td><td>40000000</td></tr>";
- for ($i = 1; $i <= 36; $i++) {
- if ($i == 1) {
- $angsuranbungad1 = $y1;
- $angsuranpokokd1 = ceil(($x1 + $x2) - $angsuranbungad1);
- $sisapinjamand1 = ceil(40000000 - $angsuranpokokd1);
- } else {
- $ib = $i - 1;
- ${"angsuranbungad$i"} = ${"sisapinjamand$ib"} * ($effectiverate / 12);
- ${"angsuranpokokd$i"} = ceil(($x1 + $x2)-${"angsuranbungad$i"});
- ${"sisapinjamand$i"} = ceil(${"sisapinjamand$ib"}-${"angsuranpokokd$i"});
- }
- echo "<Tr>";
- if ($i == 1) {
- echo "<td>1</td>
- <td>" . number_format($angsuranpokokd1, 0) . "</td>
- <td>" . number_format($angsuranbungad1, 0) . "</td>
- <td>" . number_format(ceil($x1 + $x2), 0) . "</td>
- <td>" . number_format($sisapinjamand1, 0) . "</td>
- </tr>";
- } else {
- echo "<td>$i</td>
- <td>" . number_format(${"angsuranpokokd$i"}, 0) . "</td>
- <td>" . number_format(${"angsuranbungad$i"}, 0) . "</td>
- <td>" . number_format(ceil($x1 + $x2), 0) . "</td>
- <td>" . number_format(${"sisapinjamand$i"}, 0) . "</td>
- </tr>";
- }
- }
- echo "</table>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement