-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
28 lines (28 loc) · 742 Bytes
/
Copy pathindex.php
File metadata and controls
28 lines (28 loc) · 742 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php
require_once 'sessionStart.php';
if(isset($_GET['logout'])){
session_unset();
}
?>
<?php
include 'Geeksforsaletop.php';
?>
<div id="content">
<t0>Products on sale </t0></br>
<?php
$sql = "SELECT * from products where rabatt <>0 AND forSale=1";
$sth = $db->prepare($sql);
$sth->execute();
$sth->setFetchMode(PDO::FETCH_ASSOC);
while($row = $sth->fetch()){
echo "<div id=frontpage>";
echo "<t1><a href=\"productdetails.php?id=".$row['id']."\">".$row['name']."</a></t1></br>";
echo "Discount: ".$row['rabatt']."%<br>";
echo "Old price: ".$row['price']."</br>";
echo "Price: ".(intval($row['price'])*(1-(intval($row['rabatt'])/100)))."<br>";
echo "</div>";
}
?>
</div>
</BODY>
</HTML>