From 05d4f801fa8a519e257993cfa5bf1d72cdb7646f Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 21 May 2023 17:23:54 +0200 Subject: admin order editing page added --- public/admin-order.php | 76 ++++++++++++++++++++++++++++++++++++++++++++++++++ public/admin.css | 17 +++++++++++ public/cart.php | 10 +++++++ 3 files changed, 103 insertions(+) create mode 100644 public/admin-order.php diff --git a/public/admin-order.php b/public/admin-order.php new file mode 100644 index 0000000..debde66 --- /dev/null +++ b/public/admin-order.php @@ -0,0 +1,76 @@ + + + +prepare("update `order` set status = ? where id = ?"); + $statement->bind_param("ii", $new_status, $order_id); + $statement->execute(); +} while (false); ?> + + + + $order->id + $order->user_name + $order->product_count + + + + + + + + + EOF; +} +?> + + + + + orders + + + + +
+

bestellingen

+

hier kun je bestellingen zien en de status aanpassen. wijzigingen kunnen doorgevoegd worden door op de 'bijwerken'-knop te drukken na het aanpassen van de status. maar één bestellingen kan aangepast worden per update!!

+ + + + + + + + + query("select `order`.id as id, sum(orderproduct.count) as product_count, user.name as user_name, `order`.status from orderproduct join `order` on `order`.id = orderproduct.`order` join user on user.id = `order`.user where status > 1 group by orderproduct.`order` order by status asc"); + while ($order = $res->fetch_object()) order_template($order); + ?> +
IDbestelleraantal productenstatusupdate
+
+ + + diff --git a/public/admin.css b/public/admin.css index 0892cf1..991bb2d 100644 --- a/public/admin.css +++ b/public/admin.css @@ -22,3 +22,20 @@ form textarea { font-family: sans-serif; resize: vertical; } + +table { + width: 100%; + border-collapse: collapse; +} + +table th, +table td { + padding: 4px; + border: 2px solid var(--bg-alt); +} + +table td:nth-child(1) { text-align: center; } +table td:nth-child(3) { text-align: right; } +table td select, +table td input { width: 100%; } + diff --git a/public/cart.php b/public/cart.php index f3b9b5e..60f4c63 100644 --- a/public/cart.php +++ b/public/cart.php @@ -53,6 +53,16 @@ EOF;
+ +
+ +
+
+ EOF; + } while (false); ?>

dingen in de mand van