-
Notifications
You must be signed in to change notification settings - Fork 0
/
store.php
46 lines (44 loc) · 1.37 KB
/
store.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
<?php
require_once 'config.php';
$query = $conn->query("SELECT products.*, images.data, images.type
FROM products
LEFT JOIN images
ON products.image_id = images.id");
?>
<!DOCTYPE html>
<html>
<head>
<title> Store | UTEP Alumni Store </title>
<?php require_once '_stylesheets.php'; ?>
</head>
<body>
<?php require_once '_navbar.php'; ?>
<div class="container content">
<div class="twelve columns">
<h1> Alumni Store </h1>
<hr/>
<div class="products">
<?php while($product = $query->fetch_assoc()): ?>
<div class="product">
<div class="product-image">
<?php if(isset($product["data"])): ?>
<?= base64_image($product["data"], $product["type"]); ?>
<?php else: ?>
<image src="http://placehold.it/200x200"/>
<?php endif; ?>
</div>
<div class="product-name">
<a href="product.php?id=<?= $product["id"] ?>">
<?= $product["name"] ?>
</a>
</div>
<div class="product-price">
$<?= $product["price"] ?>
</div>
</div>
<?php endwhile; ?>
</div>
</div>
</div>
</body>
</html>