From d0e49d0ea42f5ad5ef81a1cf2f121aa073a786d3 Mon Sep 17 00:00:00 2001 From: jouls Date: Wed, 8 May 2024 14:20:14 +0800 Subject: [PATCH 1/5] added strtoupper to control possible errors on payment status --- admin/vendor-profile.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/admin/vendor-profile.php b/admin/vendor-profile.php index af0c162..83936de 100644 --- a/admin/vendor-profile.php +++ b/admin/vendor-profile.php @@ -360,7 +360,7 @@ function renewToken() { $orderArray = json_encode($order, true); $orderItems = json_decode($orderArray, true); - if ($orderItems['payment']['status'] === 'PAID') { + if (strtoupper($orderItems['payment']['status']) === 'PAID') { foreach ($orderItems['items'] as $item) { $displayDate = date('m-d-Y, g:i A', strtotime($orderItems['updatedAt'])); $isPayoutCompleted = !empty($orderItems['payout_status']); From eed7c3d7b1254f618ce8c753cad9759a74f099a0 Mon Sep 17 00:00:00 2001 From: jouls Date: Wed, 8 May 2024 14:20:48 +0800 Subject: [PATCH 2/5] added edit and delete functionality on vendors bank information --- vendor-settings.php | 223 +++++++++++++++++++++++++++++++++++++++----- 1 file changed, 199 insertions(+), 24 deletions(-) diff --git a/vendor-settings.php b/vendor-settings.php index 1f3a2b3..82c986c 100644 --- a/vendor-settings.php +++ b/vendor-settings.php @@ -295,13 +295,13 @@ if ($_SESSION["isCustomer"] == true) { - -
-
Bank Information
- -
+ +
+
Bank Information
+ +
-
+
@@ -544,7 +544,6 @@ if ($_SESSION["isCustomer"] == true) { - + + + + + + + - + + + + + + + From b254e6241d390e4d36135c6ebb32310700932282 Mon Sep 17 00:00:00 2001 From: jouls Date: Wed, 8 May 2024 15:39:59 +0800 Subject: [PATCH 3/5] added reload on delete selected products --- vendor-all-product-list.php | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/vendor-all-product-list.php b/vendor-all-product-list.php index 397758f..43825fa 100644 --- a/vendor-all-product-list.php +++ b/vendor-all-product-list.php @@ -420,6 +420,7 @@ $products = productList(); } else { console.error("Product row with ID " + productId + " not found in the DOM."); } + location.reload(); } else { throw new Error("Error deleting product with ID " + productId + ": " + response.statusText); } @@ -429,10 +430,7 @@ $products = productList(); }); }); } - } - - - + } From ac7fcc6942d5e07f395a95bb2af51bde6100b991 Mon Sep 17 00:00:00 2001 From: jouls Date: Wed, 8 May 2024 17:49:16 +0800 Subject: [PATCH 4/5] added required prop on certain input fields --- vendor-uploads.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/vendor-uploads.php b/vendor-uploads.php index 826b0b6..36c1391 100644 --- a/vendor-uploads.php +++ b/vendor-uploads.php @@ -278,11 +278,11 @@ if ($_SESSION["isCustomer"] == true) {
- +
- @@ -467,7 +467,7 @@ if ($_SESSION["isCustomer"] == true) {
-->
- @@ -486,7 +486,7 @@ if ($_SESSION["isCustomer"] == true) {
- From 4fe563d212cc3ccb5acd39e163640938bcdbbb3a Mon Sep 17 00:00:00 2001 From: jouls Date: Wed, 8 May 2024 17:49:41 +0800 Subject: [PATCH 5/5] added dynamic information of vendor in admin vendor profile --- admin/vendor-profile.php | 226 +++++++++++++++++++-------------------- 1 file changed, 109 insertions(+), 117 deletions(-) diff --git a/admin/vendor-profile.php b/admin/vendor-profile.php index 83936de..b112fa0 100644 --- a/admin/vendor-profile.php +++ b/admin/vendor-profile.php @@ -29,17 +29,17 @@ if($_SESSION["user_type"]!="admin"){ } $vendor = getVendorbyId($_SESSION["vendorId"]); -$array = json_decode($vendor,true); +$vendorData = json_decode($vendor,true); $selectedBankAccount = null; -foreach ($array['bank_acount_details'] as $bankAccount) { +foreach ($vendorData['bank_acount_details'] as $bankAccount) { if ($bankAccount['bank_payout']) { $selectedBankAccount = $bankAccount; break; } } -if ($selectedBankAccount === null && !empty($array['bank_acount_details'])) { - $selectedBankAccount = $array['bank_acount_details'][0]; +if ($selectedBankAccount === null && !empty($vendorData['bank_acount_details'])) { + $selectedBankAccount = $vendorData['bank_acount_details'][0]; } $selectedBankAccountJSON = json_encode($selectedBankAccount); @@ -114,22 +114,6 @@ date_default_timezone_set('Asia/Manila'); -