Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <?php
- $harga_emas_gr = request()->gold_price ?? 900000;
- $input_kebutuhan = request()->amount_ask ?? 5;
- $jangka_waktu = request()->termin ?? 12;
- $total_harga = $harga_emas_gr * $input_kebutuhan;
- $uang_muka = 0.2 * $harga_emas_gr * $input_kebutuhan;
- $rekomendasi_pencairan = ($harga_emas_gr * $input_kebutuhan) - $uang_muka;
- $rate_margin = 0.17; # 17%
- $angsuran = $rekomendasi_pencairan * ($rate_margin / 12)*(((1+($rate_margin / 12)) ** $jangka_waktu )/(((1+($rate_margin / 12)) ** $jangka_waktu )-1));
- $pokok = $rekomendasi_pencairan;
- $margin_ujroh = ($angsuran * $jangka_waktu) - $rekomendasi_pencairan;
- $total_kewajiban = $pokok + $margin_ujroh;
- if ( request()->amount_ask ) : ?>
- Harga Emas per Gram = <?php echo number_format( $harga_emas_gr ) ?> / gram<br>
- Input Kebutuhan = <?php echo number_format( $input_kebutuhan ) ?> gram<br>
- Jangka Waktu = <?php echo number_format( $jangka_waktu ) ?> bulan<br>
- Total Harga = <?php echo number_format( $total_harga ) ?> <br>
- Uang Muka = <?php echo number_format( $uang_muka ) ?> <br>
- Rekomendasi Pencairan = <?php echo number_format( $rekomendasi_pencairan ) ?> <br>
- Angsuran = <?php echo number_format( $angsuran ) ?> <br>
- Pokok = <?php echo number_format( $pokok ) ?> <br>
- Margin Ujroh = <?php echo number_format( $margin_ujroh ) ?> <br>
- Total Kewajiban = <?php echo number_format( $total_kewajiban ) ?> <br>
- <?php endif; ?>
- <table class="table">
- <thead>
- <tr>
- <th>angs. ke.</th>
- <th>sisa pokok</th>
- <th>angs. pokok</th>
- <th>angs. margin</th>
- <th>angs. total</th>
- <th>rate</th>
- </tr>
- </thead>
- <tbody>
- <?php
- $s_pokok = $rekomendasi_pencairan;
- ?>
- <?php for($s = 1; $s <= $jangka_waktu; $s++): ?>
- <tr>
- <?php
- $angs_margin = $s_pokok * $rate_margin / 12;
- $angs_pokok = $angsuran - $angs_margin;
- $s_pokok = $s_pokok - $angs_pokok;
- ?>
- <td><?php echo $s ?></td>
- <td><?php echo number_format($s_pokok) ?></td>
- <td><?php echo number_format($angs_pokok) ?></td>
- <td><?php echo number_format($angs_margin) ?></td>
- <td><?php echo number_format($angsuran) ?></td>
- <td>17%</td>
- </tr>
- <?php endfor; ?>
- </tbody>
- </table>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement