Jumat, 02 September 2022

OPERATOR STRING

 OPERATOR STRING


Source Code :

<?php
$mata = "Rp    ";
$harga = 5500;
$harga2 = 6500;
?>

<html>
<head>
    <title>PROMO SUSU</title>
    <style>
        body{
            background-image:  url(./bekgren.jpg) ;
            background-size: cover;
            background-repeat: no-repeat;
            background-position: center;
            background-attachment: fixed ;
            font-size: 1.5em;
            color: #FFFF;
            margin-top: 30px;
        }
        h1{
         text-align:center;
         font-family: "forte";
         -webkit-text-stroke: 1px #495c60;
        }
        .table{
         margin-left: 400px;
         margin-top: 10px;
         font-family: "arial";
         border-color: #FFD700;
        }
        .barang{
         border-color: #495c60;
        }

    </style>
    <body>
   <h1>PROMO HEMAT!</h1>
    <table class="barang" border=4 witdh=100% align="center">
            <tr style="background-color: #684536;">
                <td align="center"><font size=5> Jenis Barang </font></td>
                <td align="center"><font size=5> Harga Satuan </font></td>
            </tr>
            <tr>
            <td rowspan="6" align="center"><img src="ultraa.jpg" width="250px" height="250px"></td>
            </tr>
            <tr style="background-color: #7b7167;">
            <td align="center">Full Cream : <?php echo $mata. " ".$harga; ?></td>
            </tr>
            <tr style="background-color: #7b7167;" >
               <td align="center">Cokelat : <?php echo $mata. " ".$harga; ?></td>
            </tr>
            <tr style="background-color: #7b7167;">
               <td align="center">Stroberi : <?php echo $mata. " ".$harga; ?></td>
            </tr>
            <tr style="background-color: #7b7167;">
               <td align="center">Cokelat (putih) : <?php echo $mata. " ".$harga2; ?></td>
            </tr>
            <tr style="background-color: #7b7167;">
               <td align="center">Full Cream (putih) : <?php echo $mata. " ".$harga2; ?></td>
            </tr>

    </table>
    <?php
    $nama = "Susu Ultra Full Cream";
    $harga = 5500;
    $jumlah = 4;

       $total = $harga*$jumlah;
        $discount=(($total*10)/100);
        $total_bayar=($total-$discount);
   
   
    ?>

    <table class="table">
      <tr>
         <td>Nama Barang</td>
         <td> : </td>
         <td> <?php echo $nama; ?> </td>
      </tr>
      <tr>
         <td>Harga Barang</td>
         <td> : </td>
         <td> <?php echo $mata. " ".$harga; ?> </td>
      </tr>
      <tr>
         <td>Jumlah Barang</td>
         <td> : </td>
         <td> <?php echo $jumlah; ?> </td>
      </tr>
      <tr>
         <td>Total Barang</td>
         <td> : </td>
         <td> <?php echo $mata. " ".$total; ?> </td>
      </tr>
      <tr>
         <td>
         </td>
      </tr>
      <tr>
         <td>Mendapat Diskon</td>
         <td> : </td>
         <td> 10% </td>
      </tr>
      <tr>
         <td>Total Bayar</td>
         <td> : </td>
         <td> <?php echo $mata. " ".$total_bayar; ?> </td>
      </tr>
   </table>
    </body>
</head>
</html>

Output :



Tidak ada komentar:

Posting Komentar

Menambahkan Edit dan Delete pada PHP

 PRAKTIK 1 source code file "koneksi1.php" <?php  $host = mysqli_connect("localhost","root","",...