dengang listing seperti dibawah ini :
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<form id="form1" name="form1" method="POST" action="2.php">
<table width="488" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<td colspan="3"><div align="center"><strong>Angsuran Kredit Mobil PT. Selalu Sukses Makmur </strong></div></td>
</tr>
<tr>
<td width="151"> </td>
<td width="19"> </td>
<td width="312"> </td>
</tr>
<tr>
<td valign="top">Nama</td>
<td valign="top"><div align="left">:</div></td>
<td valign="top"><label>
<input name="nama" type="text" id="nama" size="30" maxlength="30" />
</label></td>
</tr>
<tr>
<td valign="top">No.KTP</td>
<td valign="top"><div align="left">:</div></td>
<td valign="top"><label>
<input name="noktp" type="text" id="noktp" size="20" maxlength="20" />
</label></td>
</tr>
<tr>
<td valign="top">Alamat</td>
<td valign="top"><div align="left">:</div></td>
<td valign="top"><label>
<input name="alamat" type="text" id="alamat" size="50" maxlength="50" />
</label></td>
</tr>
<tr>
<td valign="top">No.Telpon</td>
<td valign="top"><div align="left">:</div></td>
<td valign="top"><label>
<input name="notel" type="text" id="notel" size="12" maxlength="12" />
</label></td>
</tr>
<tr>
<td valign="top">Merk Mobil </td>
<td valign="top"><div align="left">:</div></td>
<td valign="top"><label>
<select name="merk" id="merk">
<option selected>AVANZA</option>
<option>KARIMUN</option>
<option>KIJANG</option>
<option>INNOVA</option>
<option>XENIA</option>
</select>
</label></td>
</tr>
<tr>
<td>Pilihan Bayar </td>
<td>:</td>
<td><label>
<select name="bayar" id="bayar">
<option>KREDIT</option>
<option>CASH</option>
</select>
</label></td>
</tr>
<tr>
<td>Uang Muka </td>
<td>:</td>
<td><label>
<input name="uangmuka" type="text" id="uangmuka" />
</label></td>
</tr>
<tr>
<td>Jangka Waktu </td>
<td>:</td>
<td><label>
<select name="waktu" id="waktu">
<option>1</option>
<option>2</option>
<option>3</option>
<option>4</option>
<option>5</option>
<option>6</option>
<option>7</option>
<option>8</option>
<option>9</option>
<option>>10</option>
</select>
Tahun </label></td>
</tr>
<tr>
<td>Bunga</td>
<td>:</td>
<td><label>
<input name="bunga" type="text" id="bunga" size="3" maxlength="5" />
%</label></td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><label>
<input name="proses" type="submit" id="proses" value="PROSES" />
<input type="reset" name="Reset" value="RESET">
</label></td>
</tr>
</table>
</form>
</body>
</html>
dengan listing seperti dibawah ini :
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Untitled Document</title>
</head>
<body>
<?php
$nama=$_POST['nama'];
$noktp=$_POST['noktp'];
$alamat=$_POST['alamat'];
$notel=$_POST['notel'];
$uangmuka = $_POST['uangmuka'];
$waktu=$_POST['waktu'];
$bunga=$_POST['bunga'];
$bayar=$_POST['bayar'];
$merk=$_POST['merk'];
if ($merk=="AVANZA")
{
$harga=175000000;
}
elseif ($merk=="KARIMUN")
{
$harga=130000000;
}
elseif ($merk=="KIJANG")
{
$harga=100000000;
}
elseif ($merk=="INNOVA")
{
$harga=180000000;
}
elseif ($merk=="XENIA")
{
$harga=200000000;
}
else
{
$harga=0;
}
$bunga2=$bunga/100;
$bulan=$waktu*12;
$bayar2=$harga-$uangmuka;
$sisabayar1=$bayar2/$bulan;
$sisabayar2= $bayar2*$bunga2;
$sisabayar3=$sisabayar1+$sisabayar2;
?>
<form id="form1" name="form1" method="post" action="">
<table width="488" border="0" align="center" cellpadding="1" cellspacing="0">
<tr>
<td colspan="3"><div align="center"><strong>Angsuran Kredit Mobil PT. Selalu Sukses Makmur </strong>
<hr>
</div></td>
</tr>
<tr>
<td width="212"> </td>
<td width="20"> </td>
<td width="250"> </td>
</tr>
<tr>
<td valign="top"><div align="right">Nama</div></td>
<td valign="top"><div align="left">:</div></td>
<td valign="top"><label><?php echo $nama; ?></label></td>
</tr>
<tr>
<td valign="top"><div align="right">No.KTP</div></td>
<td valign="top"><div align="left">:</div></td>
<td valign="top"><label><?php echo $noktp; ?></label></td>
</tr>
<tr>
<td valign="top"><div align="right">Alamat</div></td>
<td valign="top"><div align="left">:</div></td>
<td valign="top"><label><?php echo $alamat; ?></label></td>
</tr>
<tr>
<td valign="top"><div align="right">No.Telpon</div></td>
<td valign="top"><div align="left">:</div></td>
<td valign="top"><label><?php echo $notel; ?></label></td>
</tr>
<tr>
<td valign="top"><div align="right">Merk Mobil </div></td>
<td valign="top">:</td>
<td valign="top"><?php echo $merk; ?></td>
</tr>
<tr>
<td valign="top"><div align="right">Harga</div></td>
<td valign="top"><div align="left">:</div></td>
<td valign="top"><label>Rp. <?php echo $harga; ?></label></td>
</tr>
<tr>
<td><div align="right">Pilihan Bayar </div></td>
<td>:</td>
<td><label><?php echo $bayar; ?></label></td>
</tr>
<tr>
<td><div align="right">Uang Muka </div></td>
<td>:</td>
<td><label>Rp. <?php echo $uangmuka; ?></label></td>
</tr>
<tr>
<td><div align="right">Sisa Bayar </div></td>
<td>:</td>
<td>Rp. <?php echo $bayar2;?></td>
</tr>
<tr>
<td><div align="right">Jangka Waktu </div></td>
<td>:</td>
<td><label>
<?php echo $waktu; ?> Tahun </label></td>
</tr>
<tr>
<td><div align="right">Bunga</div></td>
<td>:</td>
<td><label>
<?php echo $bunga; ?> %</label></td>
</tr>
<tr>
<td><div align="right">Harga Bayar Cicilan </div></td>
<td>:</td>
<td>Rp. <?php echo $sisabayar3; ?>/ Bulan </td>
</tr>
<tr>
<td> </td>
<td> </td>
<td><label></label></td>
</tr>
</table>
</form>
</body>
</html>
3 komentar:
apkah code di atas memerlukan db?
thankyou membantu sekali
thanks ane lagi ada job jadi sangat membantu nih. rumusnya miriplah sip
Posting Komentar
Silahkan Beri Komentar... ^^