diff options
author | lonkaars <loek@pipeframe.xyz> | 2023-05-21 16:37:29 +0200 |
---|---|---|
committer | lonkaars <loek@pipeframe.xyz> | 2023-05-21 16:37:29 +0200 |
commit | 690516d932e6894938622472222cdfcb06740a83 (patch) | |
tree | 13c9488bde811d84748ffa0dfcd72297ad7819dd /public/order-complete.php | |
parent | 1bb67296c43b662cf00882971fcb3df655d7302b (diff) |
place order
Diffstat (limited to 'public/order-complete.php')
-rw-r--r-- | public/order-complete.php | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/public/order-complete.php b/public/order-complete.php new file mode 100644 index 0000000..a455048 --- /dev/null +++ b/public/order-complete.php @@ -0,0 +1,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> |