aboutsummaryrefslogtreecommitdiff
path: root/public/index.php
blob: 35406928cdc33f4ff7709fc27158661f5384bc84 (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
35
36
37
38
39
<!DOCTYPE html>
<?php require "../lib/db.php"; ?>
<?php require "../lib/promo.php"; ?>
<html>
<head>
	<?php include 'head.php' ?>
	<title>webshop</title>
	<link rel='stylesheet' type='text/css' media='screen' href='home.css'>
</head>
<body>
	<?php include 'navbar.php' ?>
	<div class="main limwidth">
		<?php do {
			if (($user_privileges & PRIVILEGE_ADMIN) == 0) break;
			echo <<<"EOF"
				<div class="center">
					<form action="/admin-promo.php" method="get" class="d-ib">
						<input type="submit" value="Aanbiedingen beheren" class="button filled">
					</form>
				</div>
			EOF;
		} while (false); ?>
		<div class="s1">
			<h1>hier zijn de aanbiedingen</h1>
			<ul>
				<?php
					$res = $cursor->query("select product.id, product.name as name, promotion.count_buff, promotion.price_buff from promotion join product on product.id = promotion.product");
					while ($product = $res->fetch_object()) {
						echo "<li><a href=\"/product.php?id=$product->id\">$product->name</a>: ";
						echo promobuff2str($product->price_buff, $product->count_buff);
						echo "</li>";
					}
				?>
			</ul>
		</div>
	</div>
	<?php include 'footer.php' ?>
</body>
</html>