<!DOCTYPE html>
<html>
<head>
<script language="javascript">
function hargaKamar(){
f1.harga.value=f1.jenis.value;
}
function total1(){
f1.tot1.value=(parseInt(f1.harga.value))*(parseInt(f1.hari.value));
}
function hargaKamar1(){
f1.harga1.value=f1.meeting.value;
}
function total2(){
f1.tot2.value=(parseInt(f1.harga1.value))*(parseInt(f1.hari1.value));
}
function hargaKamar2(){
f1.harga2.value=f1.extra.value;
}
function total3(){
f1.tot3.value=(parseInt(f1.harga2.value))*(parseInt(f1.hari2.value));
}
function hargaKamar3(){
f1.harga3.value=f1.air.value;
}
function total4(){
f1.tot4.value=(parseInt(f1.harga3.value))*(parseInt(f1.hari3.value));
}
function Brutto(){
f1.brutto.value=parseInt(f1.tot1.value)+parseInt(f1.tot2.value)+parseInt(f1.tot3.value)+parseInt(f1.tot4.value);
}
function totaldisk(){
if (f1.diskon[0].checked){
f1.totdisk.value=(f1.diskon[0].value)*(f1.brutto.value);
}
else if(f1.diskon[1].checked){
f1.totdisk.value=f1.diskon[1].value*f1.brutto.value;
}
else{
f1.totdisk.value=f1.diskon[2].value*f1.brutto.value;
}
}
function Netto(){
f1.netto.value=parseInt(f1.brutto.value)-parseInt(f1.totdisk.value);
}
function total(){
f1.kembali.value=parseInt(f1.bayar.value)-parseInt(f1.netto.value);
}
</script>
</head>
<body>
<table border="1px">
<form name="f1">
<tr>
<th>Jenis Kamar</th>
<th>Harga</th>
<th>Banyak Hari</th>
<th>Total Biaya kamar</th>
</tr>
<tr>
<th><select name="jenis" onChange="hargaKamar()">
<option value="0">.::PILIHAN::.</option>
<option value="100000">Standar</option>
<option value="200000">VIP</option>
<option value="300000">President Suite</option>
</select>
</th>
<th><input type="text" name="harga" disabled /> </th>
<th><input type="text" name="hari" onChange="total1(),Brutto()"></th>
<th><input type="text" name="tot1" value="0" disabled></th>
</tr>
<tr >
<td colspan="4">Fasilitas Tambahan</td>
</tr>
<tr>
<td><input type="checkbox" name="meeting" value="2000000" onChange="hargaKamar1()"/>Meeting</td>
<th><input type="text" name="harga1" value="0" disabled /> </th>
<th><input type="text" name="hari1" onChange="total2(),Brutto()"></th>
<th><input type="text" name="tot2" value="0" disabled></th>
</tr>
<tr>
<td><input type="checkbox" name="extra" value="100000" onChange="hargaKamar2()"/>Extra Bed</td>
<th><input type="text" name="harga2" value="0" disabled /> </th>
<th><input type="text" name="hari2" onChange="total3(),Brutto()"></th>
<th><input type="text" name="tot3" value="0"disabled></th>
</tr>
<tr>
<td><input type="checkbox" name="air" value="50000" onChange="hargaKamar3()" />Air Panas</td>
<th><input type="text" name="harga3" value="0" disabled /> </th>
<th><input type="text" name="hari3" onChange="total4(),Brutto()"></th>
<th><input type="text" name="tot4" value="0" disabled></th>
</tr>
<tr >
<td colspan="4">PEMBAYARAN</td>
</tr>
<tr >
<td colspan="3">Total Biaya/Brutto</td>
<td><input type="text" name="brutto" value="0" disabled></td>
</tr>
<tr >
<td colspan="3">Diskon <input type ="radio" name="diskon" value="0" onChange="totaldisk(),Netto()">No Diskon
<input type ="radio" name="diskon" value="0.1" onChange="totaldisk(),Netto()">10%
<input type ="radio" name="diskon" value="0.2" onChange="totaldisk(),Netto()">20%</td>
<td><input type="text" name="totdisk" disabled></td>
</tr>
<tr >
<td colspan="3">Netto</td>
<td><input type="text" name="netto" value="0" disabled></td>
</tr>
<tr >
<td colspan="3">Pembayaran</td>
<td><input type="text" name="bayar" value="0" onChange="total()"></td>
</tr>
<tr >
<td colspan="3">Kembali</td>
<td><input type="text" name="kembali" value="0" disabled></td>
</tr>
</form>
</table>
</body>
</html>
No comments:
Post a Comment