File manager - Edit - /home/custbahd/public_html/webs/monitor/clients/pilaucity/discount.php
Back
<?php include_once("db/config.php"); //getting id from url //selecting data associated with this particular id $result = mysqli_query($mysqli, "SELECT * FROM shop "); while($res = mysqli_fetch_array($result)) { $name = $res['name']; $code = $res['code']; $type = $res['type']; $price = $res['price']; $description = $res['description']; $image = $res['image']; } ?> <HTML> <BODY> <H1><CENTER>Calculating Discount</CENTER></H1> <?php $price = $res['price']; $qty = 10; echo "<H4>Original price is $price</H4>"; if ($qty =10) { $discount=10; }elseif ($qty <=20) { $discount=15; }elseif (qty <=30) { $discount=20; }elseif($qty <=40){ $discount=25; } echo "<H4>Discount is $discount percent</H4>"; echo "<H4>Price after discount is ", (($price * (100 - $discount)/ 100)), "</H4>"; ?> </BODY> </HTML>
| ver. 1.4 |
Github
|
.
| PHP 8.1.33 | Generation time: 1.53 |
proxy
|
phpinfo
|
Settings