-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainMenu.php
67 lines (65 loc) · 2.26 KB
/
MainMenu.php
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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
<?php
include 'connection.php';
include 'Header.html';
$username = $_SESSION["username"];
$recaddedquery = "Select * from products order by datee desc limit 5";
$top5="select name,product_id,id,photo,price,cents, count(purchases.product_id) from purchases,products where purchases.product_id=products.id group by purchases.product_id order by purchases.product_id desc limit 5 ";
$result1 = mysqli_query($con,$recaddedquery);
$result2 = mysqli_query($con,$top5);
if (!$result1) {
}
else {
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
<head>
<meta charset="utf-8">
<title></title>
</head>
<body>
<div class="MenuColor">
<br><center><span class="Welcome" align = "center"><b>Welcome <?=$username?> please fill free to explore our site</b></span><br>
<img src="https://wh1k8zidop.inscname.net/games/images/map_img_1138084_1501023103.jpg" alt=""><br><br>
<span class="Welcome"><b>Top 5 Sellers</b></span><br><br>
</center>
<table id="MainMenuProduct" border="3">
<tr>
<?php while($row2 = mysqli_fetch_assoc($result2)) {
$id2 = $row2["id"];
$price2=$row2["price"];
$name2=$row2["name"];
$photo2=$row2["photo"];
$cents2 = $row2["cents"];
// code...
?>
<td><center> <a href="Purchases.php?id=<?=$id2?>"> <img src="<?=$photo2?>" style="width:50%"></a></center><br>
<span id="decimalfont"><center><?=$name2?></span><br>
<b><span id="decimalfont"><?=$price2?></span>.<?=$cents2?>€</b></center></td>
<?php } ?>
</tr>
</table>
<center>
<span class="Welcome"><b>Just added</b></span><br><br>
</center>
<table id="MainMenuProduct" border="3">
<tr>
<?php while($row = mysqli_fetch_assoc($result1)) {
$id = $row["id"];
$price=$row["price"];
$name=$row["name"];
$photo=$row["photo"];
$cents = $row["cents"];
// code...
?>
<td><center> <a href="Purchases.php?id=<?=$id?>"> <img src="<?=$photo?>" style="width:50%"></a></center><br>
<span id="decimalfont"><center><?=$name?></span><br>
<b><span id="decimalfont"><?=$price?></span>.<?=$cents?>€</b></center></td>
<?php } ?>
</tr>
</table>
<?php }?>
</div>
</body>
</html>
<?php
include 'footer.html'; ?>