-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome.php
More file actions
28 lines (23 loc) · 959 Bytes
/
home.php
File metadata and controls
28 lines (23 loc) · 959 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
//retrieving the 4 most recently added products from the merch_inventory database
$stmt = $pdo->prepare('SELECT * FROM merch ORDER BY date_added DESC LIMIT 3');
$stmt->execute();
$recently_added_products = $stmt->fetchALL(PDO::FETCH_ASSOC);
?>
<?=template_header('Home')?>
<div id="title"> Alliance Gaming Merch </div>
<div class="recentlyadded content-wrapper">
<div class="label">featured products</div>
<div class="products">
<?php foreach ($recently_added_products as $product): ?>
<a href="index.php?page=product&id=<?=$product['itemID']?>" class="product">
<img src="imgs/<?=$product['itemImg']?>" width="300" height="300" alt="<?=$product['itemName']?>">
<span class="name"><?=$product['itemName']?></span>
<span class="price">
$<?=$product['itemPrice']?>
</span>
</a>
<?php endforeach; ?>
</div>
</div>
<?=template_footer()?>