Operator Aritmatika PHP Part 4
Operator Aritmatika
source code :
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>Penjualan Produk Handphone</title>
</head>
<style type="text/css">
table {
border-radius: 10%;
border: 2px solid;
}
td {
display: table-cell;
}
img{
width: 200px;
height: auto;
}
</style>
<body>
<?php
$Uang = 6000000;
$harga = 4999000;
$diskon = 4999000 * 0.25;
$bayar = $harga - $diskon;
$kembali = $Uang - $bayar;
?>
<center>
<table cellpadding="10">
<tr class="judul">
<th colspan="2"><h1 align="center">Toko HP</h1></th>
</tr>
<tr>
<td align="center" colspan="2"><img src="oppo.png"></td>
</tr>
<tr>
<td>Nama Barang</td>
<td>Oppo Reno 8</td>
</tr>
<tr>
<td>Harga Barang</td>
<td>Rp. <?php echo $harga ?></td>
</tr>
<tr>
<td>Diskon</td>
<td>25 %</td>
</tr>
<tr>
<td>Total Bayar</td>
<td>Rp. <?php echo $bayar ?></td>
</tr>
<tr>
<td>Total Uang yang dibayarkan</td>
<td>Rp. <?php echo $Uang ?></td>
</tr>
<tr>
<td>Total Kembalian</td>
<td>Rp. <?php echo $kembali ?></td>
</tr>
<tr>
<td align="center" colspan="2">Terimakasih Sudah Berbelanja</td>
</tr>
</table>
</center>
</body>
</html>
Hasil :
Komentar
Posting Komentar