aboutsummaryrefslogtreecommitdiff
path: root/public/order-complete.php
blob: a455048a83253235589c2b3adf999979bb3f7f8e (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
40
41
42
<!DOCTYPE html>
<?php require "../lib/db.php" ?>
<?php require "../lib/login.php" ?>
<?php if_logged_in(false, "/login.php", true) ?>
<?php do {
	if ($_SERVER['REQUEST_METHOD'] !== 'POST') break;

	$cart_id = 0;

	$statement = $cursor->prepare("select cart(?) as cart_id");
	$statement->bind_param("i", $user_id);
	if (!$statement->execute()) break;
	$res = $statement->get_result();
	if (!mysqli_num_rows($res)) break;
	$cart_id = $res->fetch_object()->cart_id;

	$statement = $cursor->prepare("select id from orderproduct where `order` = ?");
	$statement->bind_param("i", $cart_id);
	if (!$statement->execute()) break;
	$res = $statement->get_result();
	if (!mysqli_num_rows($res)) break;

	$statement = $cursor->prepare("update `order` set status = 2 where id = ?");
	$statement->bind_param("i", $cart_id);
	if (!$statement->execute()) break;
	$cart_count = get_cart_count();
} while (false); ?>
<html>
<head>
	<?php include 'head.php' ?>
	<title>bestelling afgerond</title>
</head>
<body>
	<?php include 'navbar.php' ?>
	<div class="main limwidth">
		<h2>Bestelling succesvol afgerond</h2>
		<p>nu krijg je weer zo'n vervelende e-mail waarin staat wat je net hebt gedaan alsof je het gelijk vergeten bent</p>
		<p>bedankt hè</p>
	</div>
	<?php include 'footer.php' ?>
</body>
</html>