diff --git a/app/controllers/Admin/Tips.php b/app/controllers/Admin/Tips.php index 7897dfd..2d45a11 100644 --- a/app/controllers/Admin/Tips.php +++ b/app/controllers/Admin/Tips.php @@ -39,7 +39,10 @@ public function delete(string $a = '', string $b = '', string $c = ''): void // show($b); // show($c); $tips = new TipsModel(); + // show($tips->first(['id' => $a])); + $tips->delete($a, 'id'); + redirect('admin/tips'); } diff --git a/app/controllers/MyOrders.php b/app/controllers/MyOrders.php index 4d3a92a..388c3fa 100644 --- a/app/controllers/MyOrders.php +++ b/app/controllers/MyOrders.php @@ -9,8 +9,15 @@ public function index(string $a = '', string $b = '', string $c = ''):void { AuthorizationMiddleware::authorize(['customer']); + + $tips = new TipsModel(); + $data['tips'] = $tips->findAll(); + + // randomly select 1 tip + $data['tip'] = $data['tips'][array_rand($data['tips'])]; + // show($data['tip']); - $this->view('customer/orders'); + $this->view('customer/orders', $data); } public function list(string $a = '', string $b = '', string $c = ''):void { diff --git a/app/views/admin/tips.view.php b/app/views/admin/tips.view.php index f868360..be93f90 100644 --- a/app/views/admin/tips.view.php +++ b/app/views/admin/tips.view.php @@ -90,7 +90,7 @@ @@ -128,10 +128,20 @@ function openUpdateModal(name, email, id) { document.getElementById("updated-title").value = name; document.getElementById("updated-description").value = email; document.getElementById("tip-id").value = id; - document.getElementById("delete-tip").href = "/admin/tips/delete/" + id; + document.getElementById("delete-tip").setAttribute('key', id); updateModal.style.display = "block"; } + $(document).on('click','#delete-tip',function(e){ +e.preventDefault(); + var id = $(this).attr('key'); + console.log(id); + // goto the delete route + window.location.href = "/admin/tips/delete/" + id; + }); + + + // Event listener for add button click addButton.addEventListener('click', function() { openAddModal(); diff --git a/app/views/customer/orders.view.php b/app/views/customer/orders.view.php index d6ab9de..d97a360 100644 --- a/app/views/customer/orders.view.php +++ b/app/views/customer/orders.view.php @@ -9,7 +9,17 @@
customer-bg-image
-
+
+ + +
+ +
+

title; ?>

+

description; ?>

+
+ +

Orders

diff --git a/app/views/rental/components/complainlist.view.php b/app/views/rental/components/complainlist.view.php index dbfa499..03a1d70 100644 --- a/app/views/rental/components/complainlist.view.php +++ b/app/views/rental/components/complainlist.view.php @@ -90,7 +90,7 @@ status == 'rented') { ?> - + status == 'pending') { ?> @@ -149,8 +149,8 @@

Cancel Complaint

Are you sure you want to cancel this complaint?

- - + +
diff --git a/public/assets/scss/wl/dashboard/_button.scss b/public/assets/scss/wl/dashboard/_button.scss index 05bfc3f..e105a37 100644 --- a/public/assets/scss/wl/dashboard/_button.scss +++ b/public/assets/scss/wl/dashboard/_button.scss @@ -269,7 +269,9 @@ } } - // disabled state + &.center { + align-self: center; + } &:hover{ diff --git a/public/assets/scss/wl/dashboard/common/_colors.scss b/public/assets/scss/wl/dashboard/common/_colors.scss index 23e643a..bd3201c 100644 --- a/public/assets/scss/wl/dashboard/common/_colors.scss +++ b/public/assets/scss/wl/dashboard/common/_colors.scss @@ -4,4 +4,9 @@ .bg-transparent { background-color: transparent !important; +} + +.bg-none { + background-color: none !important; + } \ No newline at end of file diff --git a/public/assets/scss/wl/dashboard/common/_width.scss b/public/assets/scss/wl/dashboard/common/_width.scss index 61bd584..f6de77a 100644 --- a/public/assets/scss/wl/dashboard/common/_width.scss +++ b/public/assets/scss/wl/dashboard/common/_width.scss @@ -80,6 +80,14 @@ // max width +.mw-600px { + max-width:600px !important; +} + +.mw-400px { + max-width: 400px !important; +} + .mw-300px { max-width: 300px !important; }