From 690516d932e6894938622472222cdfcb06740a83 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 21 May 2023 16:37:29 +0200 Subject: place order --- public/cart.php | 2 ++ public/order-complete.php | 42 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 public/order-complete.php diff --git a/public/cart.php b/public/cart.php index d4dfcc6..f3b9b5e 100644 --- a/public/cart.php +++ b/public/cart.php @@ -12,6 +12,7 @@ $statement = $cursor->prepare("delete from orderproduct where product = ? and `order` = cart(?)"); $statement->bind_param("ii", $_POST['product_id'], $user_id); $statement->execute(); + $cart_count = get_cart_count(); break; } case "add": { @@ -23,6 +24,7 @@ $statement->bind_param("ii", $_POST['product_id'], $user_id); $statement->execute(); $statement->get_result()/*->fetch_object()*/; + $cart_count = get_cart_count(); break; } } 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 @@ + + + + +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); ?> + + + + bestelling afgerond + + + +
+

Bestelling succesvol afgerond

+

nu krijg je weer zo'n vervelende e-mail waarin staat wat je net hebt gedaan alsof je het gelijk vergeten bent

+

bedankt hè

+
+ + + -- cgit v1.2.3