Advertisement
Guest User

Untitled

a guest
Aug 18th, 2017
52
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. <?php
  2. $plafon = 40000000;
  3. $bunga = 11.76;
  4. $bulan = 36;
  5.  
  6. $effectiverate = 20.8104 / 100;
  7. $effectiverate2 = $effectiverate / 12;
  8.  
  9. $y1 = $plafon * ($effectiverate / 12);
  10.  
  11. $x0 = ($bunga / 100) / 12;
  12. $x1 = $plafon / $bulan;
  13. $x2 = $plafon * $x0;
  14. $totalangsuran = ($x1 + $x2);
  15.  
  16. echo '<br>Angsuran Pokok : ' . number_format(ceil($totalangsuran - $y1));
  17. echo '<br>Angsuran Bunga : ' . number_format($y1, 0);
  18. echo '<br>Total Angsuran : ' . number_format(ceil($x1 + $x2), 0);
  19.  
  20. echo "<table border='1'><Tr>
  21. <td>Angsuran Ke</td>
  22. <td>Angsuran POkok</td>
  23. <td>Angsuran bunga</td>
  24. <td>Total Angsuran</td>
  25. <td>Sisa Pinjaman pokokx</td>
  26. </tr>
  27. <tr><td colspan=4></td><td>40000000</td></tr>";
  28. for ($i = 1; $i <= 36; $i++) {
  29. if ($i == 1) {
  30. $angsuranbungad1 = $y1;
  31. $angsuranpokokd1 = ceil(($x1 + $x2) - $angsuranbungad1);
  32. $sisapinjamand1 = ceil(40000000 - $angsuranpokokd1);
  33. } else {
  34. $ib = $i - 1;
  35. ${"angsuranbungad$i"} = ${"sisapinjamand$ib"} * ($effectiverate / 12);
  36. ${"angsuranpokokd$i"} = ceil(($x1 + $x2)-${"angsuranbungad$i"});
  37. ${"sisapinjamand$i"} = ceil(${"sisapinjamand$ib"}-${"angsuranpokokd$i"});
  38. }
  39. echo "<Tr>";
  40. if ($i == 1) {
  41. echo "<td>1</td>
  42. <td>" . number_format($angsuranpokokd1, 0) . "</td>
  43. <td>" . number_format($angsuranbungad1, 0) . "</td>
  44. <td>" . number_format(ceil($x1 + $x2), 0) . "</td>
  45. <td>" . number_format($sisapinjamand1, 0) . "</td>
  46. </tr>";
  47. } else {
  48. echo "<td>$i</td>
  49. <td>" . number_format(${"angsuranpokokd$i"}, 0) . "</td>
  50. <td>" . number_format(${"angsuranbungad$i"}, 0) . "</td>
  51. <td>" . number_format(ceil($x1 + $x2), 0) . "</td>
  52. <td>" . number_format(${"sisapinjamand$i"}, 0) . "</td>
  53. </tr>";
  54. }
  55. }
  56. echo "</table>";
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement