blob: bffaeb038c41ff184ba3aa6e5c1623382d3c9336 (
plain)
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
|
<!DOCTYPE html>
<?php require "db.php"; ?>
<?php
function product_template($product) {
$image_path = $product->img ? "/img/product/$product->id-thumb.jpg" : "/img/placeholder.png";
echo <<<"EOF"
<a href="/product.php?id=$product->id" class="product nolinkstyle">
<img src="$image_path" alt="">
<span class="price">$product->price</span>
<span class="name">$product->name</span>
</a>
EOF;
}
?>
<html>
<head>
<?php include 'head.php' ?>
<title>producten</title>
<link rel='stylesheet' type='text/css' media='screen' href='products.css'>
</head>
<body>
<?php include 'navbar.php' ?>
<div class="main limwidth">
<h2>lijst met producten:</h2>
<div class="products">
<?php
$res = $cursor->query("select ID as id, image as img, price, name from webs.product");
while ($product = $res->fetch_object()) product_template($product);
?>
</div>
</div>
<?php include 'footer.php' ?>
</body>
</html>
|