File Manager
Server IP: 103.233.102.32
Your IP: 18.117.72.24
Current Path: /
/
home
/
bprcakhr
/
public_html
Back to Parent Directory
Create New Directory:
Upload File:
Run Command:
Name
Action
database/
Delete
|
Rename
db/
Delete
|
Rename
images/
Delete
|
Rename
cakhra2.png
Download
|
Delete
|
Edit
|
Rename
deposito.php
Download
|
Delete
|
Edit
|
Rename
error_log
Download
|
Delete
|
Edit
|
Rename
index.php
Download
|
Delete
|
Edit
|
Rename
kre_investasi.php
Download
|
Delete
|
Edit
|
Rename
kre_konsutif.php
Download
|
Delete
|
Edit
|
Rename
kre_modal_kerja.php
Download
|
Delete
|
Edit
|
Rename
layanan.php
Download
|
Delete
|
Edit
|
Rename
logo1.png
Download
|
Delete
|
Edit
|
Rename
lokasi.php
Download
|
Delete
|
Edit
|
Rename
mahasiswaa.php
Download
|
Delete
|
Edit
|
Rename
post.php
Download
|
Delete
|
Edit
|
Rename
post_publikasi.php
Download
|
Delete
|
Edit
|
Rename
proses-kredit.php
Download
|
Delete
|
Edit
|
Rename
proses_kredit1.php
Download
|
Delete
|
Edit
|
Rename
proses_pengajuan.php
Download
|
Delete
|
Edit
|
Rename
publikasi.php
Download
|
Delete
|
Edit
|
Rename
sim-depo.php
Download
|
Delete
|
Edit
|
Rename
sim-kre.php
Download
|
Delete
|
Edit
|
Rename
sosialisasi.php
Download
|
Delete
|
Edit
|
Rename
tab-berhadiah.php
Download
|
Delete
|
Edit
|
Rename
tab-bisnis.php
Download
|
Delete
|
Edit
|
Rename
tab-inti.php
Download
|
Delete
|
Edit
|
Rename
tab-intiplus.php
Download
|
Delete
|
Edit
|
Rename
tab.php
Download
|
Delete
|
Edit
|
Rename
tabungan.php
Download
|
Delete
|
Edit
|
Rename
uploadstest.png
Download
|
Delete
|
Edit
|
Rename
Edit File: ./sim-kre.php
<?php // Fungsi untuk menghitung cicilan bulanan function hitungKredit($plafon, $suku_bunga, $durasi_tahun) { $jumlah_bulan = $durasi_tahun * 12; $bunga_per_bulan = $suku_bunga / 12 / 100; // Cek apakah bunga per bulan adalah 0 if ($bunga_per_bulan == 0) { $cicilan_per_bulan = $plafon / $jumlah_bulan; } else { // Hitung cicilan per bulan dengan bunga $cicilan_per_bulan = $plafon * ($bunga_per_bulan * pow(1 + $bunga_per_bulan, $jumlah_bulan)) / (pow(1 + $bunga_per_bulan, $jumlah_bulan) - 1); } // Hitung total pembayaran dan total bunga $total_pembayaran = $cicilan_per_bulan * $jumlah_bulan; $total_bunga = $total_pembayaran - $plafon; // Menghitung rincian angsuran $angsuran = []; $sisa_pokok = $plafon; for ($bulan = 1; $bulan <= $jumlah_bulan; $bulan++) { $bunga_bulan_ini = $sisa_pokok * $bunga_per_bulan; $pokok_bulan_ini = $cicilan_per_bulan - $bunga_bulan_ini; $sisa_pokok -= $pokok_bulan_ini; $angsuran[] = [ 'bulan' => $bulan, 'cicilan' => $cicilan_per_bulan, 'bunga' => $bunga_bulan_ini, 'pokok' => $pokok_bulan_ini, 'sisa_pokok' => max($sisa_pokok, 0) // Pastikan sisa pokok tidak negatif ]; } return [ 'cicilan_per_bulan' => $cicilan_per_bulan, 'total_pembayaran' => $total_pembayaran, 'total_bunga' => $total_bunga, 'angsuran' => $angsuran ]; } // Ambil data dari form $plafon = isset($_POST['plafon']) ? floatval($_POST['plafon']) : 0; $suku_bunga = isset($_POST['suku_bunga']) ? floatval($_POST['suku_bunga']) : 0; $durasi_tahun = isset($_POST['durasi_tahun']) ? intval($_POST['durasi_tahun']) : 0; // Pastikan semua data valid if ($plafon <= 0 || $durasi_tahun <= 0) { $hasil = [ 'cicilan_per_bulan' => 0, 'total_pembayaran' => 0, 'total_bunga' => 0, 'angsuran' => [] ]; } else { // Hitung hasil simulasi $hasil = hitungKredit($plafon, $suku_bunga, $durasi_tahun); } ?> <!DOCTYPE html> <html lang="id"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <title>BANK CAKHRA</title> <link rel="icon" type="image/png" href="images/logo1.png"> <style> body { font-family: Arial, sans-serif; margin: 20px; } .container { max-width: 600px; margin: 0 auto; padding: 20px; background: #f9f9f9; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); } .form-group { margin-bottom: 15px; } .form-group label { display: block; margin-bottom: 5px; } .form-group input { width: 100%; padding: 10px; border: 1px solid #ddd; border-radius: 4px; } .form-group button { padding: 10px 20px; border: none; border-radius: 4px; background-color: #007BFF; color: white; font-size: 16px; cursor: pointer; } .form-group button:hover { background-color: #0056b3; } .result { margin-top: 20px; } .result table { width: 100%; border-collapse: collapse; margin-top: 20px; } .result table, .result th, .result td { border: 1px solid #ddd; } .result th, .result td { padding: 10px; text-align: center; } .result th { background-color: #f4f4f4; } .result tbody tr:nth-child(odd) { background-color: #f9f9f9; } .result tbody tr:nth-child(even) { background-color: #e9ecef; } @media (max-width: 600px) { .container { padding: 10px; } .form-group input, .form-group button { font-size: 14px; } .result table, .result th, .result td { font-size: 14px; } } </style> </head> <body> <?php include 'nav.php'; ?> <div class="container"> <h1>Simulasi Kredit</h1> <form method="post"> <div class="form-group"> <label for="plafon">Plafon Kredit (Rp):</label> <input type="number" id="plafon" name="plafon" step="0.01" required> </div> <div class="form-group"> <label for="suku_bunga">Suku Bunga Tahunan (%):</label> <input type="number" id="suku_bunga" name="suku_bunga" step="0.01" required> </div> <div class="form-group"> <label for="durasi_tahun">Durasi (Tahun):</label> <input type="number" id="durasi_tahun" name="durasi_tahun" min="1" required> </div> <div class="form-group"> <button type="submit">Hitung</button> </div> </form> <?php if ($_SERVER['REQUEST_METHOD'] == 'POST'): ?> <div class="result"> <h2>Hasil Simulasi</h2> <table> <thead> <tr> <th>Deskripsi</th> <th>Nilai</th> </tr> </thead> <tbody> <tr> <td>Cicilan Per Bulan</td> <td>Rp <?php echo number_format($hasil['cicilan_per_bulan'], 2, ',', '.'); ?></td> </tr> <tr> <td>Total Pembayaran</td> <td>Rp <?php echo number_format($hasil['total_pembayaran'], 2, ',', '.'); ?></td> </tr> <tr> <td>Total Bunga</td> <td>Rp <?php echo number_format($hasil['total_bunga'], 2, ',', '.'); ?></td> </tr> </tbody> </table> <h2>Rincian Angsuran</h2> <table> <thead> <tr> <th>Bulan</th> <th>Cicilan</th> <th>Bunga</th> <th>Pokok</th> <th>Sisa Pokok</th> </tr> </thead> <tbody> <?php foreach ($hasil['angsuran'] as $angsuran): ?> <tr> <td><?php echo $angsuran['bulan']; ?></td> <td>Rp <?php echo number_format($angsuran['cicilan'], 2, ',', '.'); ?></td> <td>Rp <?php echo number_format($angsuran['bunga'], 2, ',', '.'); ?></td> <td>Rp <?php echo number_format($angsuran['pokok'], 2, ',', '.'); ?></td> <td>Rp <?php echo number_format($angsuran['sisa_pokok'], 2, ',', '.'); ?></td> </tr> <?php endforeach; ?> </tbody> </table> </div> <?php endif; ?> </div> </body> </html>