blob: e9c7cdf5d44850af81a99f41eaa250c99451c63c (
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
|
<!DOCTYPE html>
<?php require "db.php"; ?>
<?php
function product_template($product) {
echo <<<"EOF"
<a href="/product.php?id=$product->id" class="product nolinkstyle">
<img src="$product->img" 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_path as img, price, name from webs.product");
while ($product = $res->fetch_object()) product_template($product);
?>
</div>
</div>
<?php include 'footer.php' ?>
</body>
</html>
|