Jadwal penyewaan studio music arnetha
Sebuah studio musik membuka layanan sewa
studio bagi sejumlah grup band anak muda yang ingin latihan di studio tersebut.
Grup band yang ingin menyewa harus mendaftar satu hari sebelumnya untuk
kemudian dijadwalkan. Andaikan studio musik tersebut hanya buka mulai dari jam
1 sampai dengan jam 14. Setiap grup band yang hendak menyewa harus menuliskan berapa
jam ia akan latihan (semua jam adalah bilangan bulat).
Berhubung permintaan latihan cukup
banyak , maka manajemen studio musik harus memilih dan menjadwalkan grup band
yang akan menggunakan studionya itu sehingga sebanyak mungkin grup band yang
dapat dilayani. band yang menyewa diatas diatas 2 jam akan mendapat diskon 10%.
Berikut script programnya simpan dengan
nama studio musik.php
<?php
// inisiasi variable
yang digunakan
// nama grup band
$band1 =
"Vierra";
$band2 =
"Lyla";
$band3 =
"D-Masiv";
$band4 =
"Ungu";
// menyewa studio berapa
jam
$jam1 = 2;
$jam2 = 5;
$jam3 = 1;
$jam4 = 3;
<body>
<center>
<table width="663" height="210" border="1" cellpadding="3" cellspacing="0" bordercolor="#666666">
<tr bgcolor="#CCCCCC">
<td height="54" colspan="5" bgcolor="#333333"><div align="center" class="style7">JADWAL SEWA STUDIO MUSIK ARNETHA </div></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="96" height="36" bgcolor="#666666"><div align="center" class="style29"><span class="style30">Nama Band</span></div></td>
<td width="86" bgcolor="#666666"><div align="center" class="style29"><span class="style30">Jam Sewa</span></div></td>
<td width="169" bgcolor="#666666"><div align="center" class="style29"><span class="style30">Harga Sewa/ Jam</span></div></td>
<td width="106" bgcolor="#666666"><div align="center" class="style29"><span class="style30">Discount</span></div></td>
<td width="164" bgcolor="#666666"><div align="center" class="style29"><span class="style30">Total Harga </span></div></td>
</tr>
<tr>
<td align="left" bordercolor="#999999" bgcolor="#FFCCFF"><?php echo $band1; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF"><div align="center"><?php echo $jam1; ?></div></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF">Rp. <?php echo $hrg1; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF"><?php echo $diskon1; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF">Rp. <?php echo $total_harga1; ?></td>
</tr>
<tr>
<td align="left" bordercolor="#999999" bgcolor="#FFCCFF"><?php echo $band2; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF"><div align="center"><?php echo $jam2; ?></div></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF">Rp. <?php echo $hrg2; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF"><?php echo $diskon2; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF">Rp. <?php echo $total_harga2; ?></td>
</tr>
<tr>
<td align="left" bordercolor="#999999" bgcolor="#FFCCFF"><?php echo $band3; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF"><div align="center"><?php echo $jam3; ?></div></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF">Rp. <?php echo $hrg3; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF"><?php echo $diskon3; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF">Rp. <?php echo $total_harga3; ?></td>
</tr>
<tr>
<td align="left" bordercolor="#999999" bgcolor="#FFCCFF"><?php echo $band4; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF"><div align="center"><?php echo $jam4; ?></div></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF">Rp. <?php echo $hrg4; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF"><?php echo $diskon4; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF">Rp. <?php echo $total_harga4; ?></td>
</tr>
</table>
</center>
</body>
</html>
<table width="663" height="210" border="1" cellpadding="3" cellspacing="0" bordercolor="#666666">
<tr bgcolor="#CCCCCC">
<td height="54" colspan="5" bgcolor="#333333"><div align="center" class="style7">JADWAL SEWA STUDIO MUSIK ARNETHA </div></td>
</tr>
<tr bgcolor="#CCCCCC">
<td width="96" height="36" bgcolor="#666666"><div align="center" class="style29"><span class="style30">Nama Band</span></div></td>
<td width="86" bgcolor="#666666"><div align="center" class="style29"><span class="style30">Jam Sewa</span></div></td>
<td width="169" bgcolor="#666666"><div align="center" class="style29"><span class="style30">Harga Sewa/ Jam</span></div></td>
<td width="106" bgcolor="#666666"><div align="center" class="style29"><span class="style30">Discount</span></div></td>
<td width="164" bgcolor="#666666"><div align="center" class="style29"><span class="style30">Total Harga </span></div></td>
</tr>
<tr>
<td align="left" bordercolor="#999999" bgcolor="#FFCCFF"><?php echo $band1; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF"><div align="center"><?php echo $jam1; ?></div></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF">Rp. <?php echo $hrg1; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF"><?php echo $diskon1; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF">Rp. <?php echo $total_harga1; ?></td>
</tr>
<tr>
<td align="left" bordercolor="#999999" bgcolor="#FFCCFF"><?php echo $band2; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF"><div align="center"><?php echo $jam2; ?></div></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF">Rp. <?php echo $hrg2; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF"><?php echo $diskon2; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF">Rp. <?php echo $total_harga2; ?></td>
</tr>
<tr>
<td align="left" bordercolor="#999999" bgcolor="#FFCCFF"><?php echo $band3; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF"><div align="center"><?php echo $jam3; ?></div></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF">Rp. <?php echo $hrg3; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF"><?php echo $diskon3; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF">Rp. <?php echo $total_harga3; ?></td>
</tr>
<tr>
<td align="left" bordercolor="#999999" bgcolor="#FFCCFF"><?php echo $band4; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF"><div align="center"><?php echo $jam4; ?></div></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF">Rp. <?php echo $hrg4; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF"><?php echo $diskon4; ?></td>
<td align="right" bordercolor="#999999" bgcolor="#FFCCFF">Rp. <?php echo $total_harga4; ?></td>
</tr>
</table>
</center>
</body>
</html>
// harga sewa perjam
$hrg=150000;
// total harga yang
dibayar sesuai jam sewa
$hrg1 = $jam1 *
$hrg;
$hrg2 = $jam2 *
$hrg;
$hrg3 = $jam3 *
$hrg;
$hrg4 = $jam4 *
$hrg;
// besar diskon untuk
band yang menyewa diatas 2 jam
$diskon1=(0*$hrg1)/100;
$diskon2=(10*$hrg2)/100;
$diskon3=(0*$hrg3)/100;
$diskon4=(10*$hrg4)/100;
// jumlah yang harus
dibayar
$total_harga1= $hrg1 -
$diskon1;
$total_harga2= $hrg2 -
$diskon2;
$total_harga3= $hrg3 -
$diskon3;
$total_harga4= $hrg4 -
$diskon4;
?>
<html>
<head>
<title>jadwal sewa
studio musik arnetha</title>
<style
type="text/css">
<!--
.style7 {
color: #FF33CC;
font-size: medium;
}
.style29 {color:
#CCCCCC}
.style30 {font-size:
medium; font-style: italic;}
-->
</style>
</head>
hasil program :
Tidak ada komentar:
Posting Komentar