From 2197faf27421f3df01d7ae6618ddf12873dca3bb Mon Sep 17 00:00:00 2001 From: lonkaars Date: Thu, 1 Jun 2023 18:20:05 +0200 Subject: admin-promo done --- public/admin-promo.php | 98 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 public/admin-promo.php (limited to 'public/admin-promo.php') diff --git a/public/admin-promo.php b/public/admin-promo.php new file mode 100644 index 0000000..83103e3 --- /dev/null +++ b/public/admin-promo.php @@ -0,0 +1,98 @@ + + + + +prepare("delete from promotion where id = ?"); + $statement->bind_param("i", $_POST['id']); + $statement->execute(); + break; + } + case "add": { + $statement = $cursor->prepare("insert into webs.promotion (`product`, `price_buff`, `count_buff`) values (?, ?, ?)"); + $statement->bind_param("idi", $_POST['product_id'], $_POST['price_buff'], $_POST['count_buff']); + $statement->execute(); + break; + } + } + + $promo_id = $_POST['id']; + $new_status = $_POST['status']; + if (!$promo_id) break; + if (!$new_status) break; + + $statement = $cursor->prepare("update `promo` set status = ? where id = ?"); + $statement->bind_param("ii", $new_status, $promo_id); + $statement->execute(); +} while (false); ?> +price_buff, $promo->count_buff); + echo <<<"EOF" +
+ + + + $promo->product_id + $promo->name + $promo->count_buff + $promo->price_buff + $promo_str + + + + +
+ EOF; +} +?> + + + + + aanbiedingen + + + + +
+

aanbieding toevoegen

+
+ + + + + + + + +
+

huidige aanbiedingen

+ + + + + + + + + + query("select promotion.id, product.id as product_id, product.name, count_buff, price_buff from promotion join product on product.id = promotion.product"); + while ($promo = $res->fetch_object()) promo_template($promo); + ?> +
product idproduct naamper aantalver­menig­vuldigings­factorzichtbaar alsverwijderen
+
+ + + -- cgit v1.2.3