-
Notifications
You must be signed in to change notification settings - Fork 0
/
nintendo.php
79 lines (69 loc) · 2.13 KB
/
nintendo.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
68
69
70
71
72
73
74
75
76
77
78
79
<?php include 'includes/dbconn.php';?>
<?php include 'includes/links.php'; ?>
<body>
<!--header/navbar/compulsory things-->
<?php include 'includes/header.php'; ?>
<?php include 'includes/productsnavbar.php'; ?>
<!--header/navbar/compulsory things-->
<!--nintendo detail/images -->
<div class="top-rated-games">
<!--FETCH AND SHOW IMG FROM DB-->
<?php
$records = mysqli_query($conn, "select * from nintendo order by `id` DESC");
if (mysqli_num_rows($records) > 0) {
while ($data = mysqli_fetch_array($records)) {
$imgPath = "includes/" . $data['images'];
?>
<!--/FETCHING-->
<div class="product">
<form method="post" action="nintendo.php?action=add&id=<?php echo $data["id"]; ?>">
<div class="tester">
<!--image container-->
<div class="image-card">
<img src="<?php echo $imgPath?>" loading="lazy">
</div>
<!--/image container-->
<div class="wrapper">
<!--game details-->
<div class="details">
<!--name of game-->
<p class="game-name">
<?php echo $data['filename']; ?>
<input type="hidden" name="name" value="<?php echo $data['filename']; ?> " />
</p>
<!--console type-->
<p class="console">
<?php echo $data['console']; ?>
</p>
<!--price of the game-->
<p class="price">$ <span id="price">
<?php echo $data['price']; ?>
<input type="hidden" name="price" value="<?php echo $data['price']; ?> " />
</span>
</p>
</div>
<!--add to cart-->
<div class="cart-button">
<img src="icons/cart.png" width="25px">
<input type="submit" name="add_to_cart" value=" Add to Cart" class="tocart" />
</div>
</div>
</div>
<!--end of product-->
</form>
</div>
<!--end of product-->
<?php }
}
?>
<!--end of PHP WHILE LOOP-->
</div>
<!--END of PRODUCTS WRAPPER-->
<!--FLOATING SHOPPING CART -->
<?php include 'includes/basket.php'; ?>
<!--/FLOATING SHOPPING CART -->
<!--FOOTER-->
<?php include 'includes/footer.php'; ?>
<!--FOOTER-->
</body>
</html>