From 85d8f31847465c1606b539e1138579bdef484aa3 Mon Sep 17 00:00:00 2001 From: gelonspr Date: Tue, 26 Mar 2024 14:08:25 +0800 Subject: [PATCH 1/3] fixed payment details modal and fixed data queries for dynamic data display --- vendor-payments.php | 400 ++++++++++++++++++++++++++++++++------------ 1 file changed, 293 insertions(+), 107 deletions(-) diff --git a/vendor-payments.php b/vendor-payments.php index be9c8ae..3bc1518 100644 --- a/vendor-payments.php +++ b/vendor-payments.php @@ -10,18 +10,22 @@ if ($_SESSION["userId"] <> "") { $vendorData = $vendorLoginIdjson['results'][0]; $vendorId = $vendorData['_id']; $_SESSION["LoggedInVendorId"] = $vendorId; - } + + } + $authtoken = $_SESSION['token']; + } else { $_SESSION["isLoggedIn"] = false; header("location: login.php"); } -$products = productList(); -$shopOrders = getOrderbyVendorId($vendorId); -$vendorOrderss = json_decode($shopOrders); -if (is_array($vendorOrderss)) { - $vendorOrders = json_decode($shopOrders); -} elseif (is_object($vendorOrderss) && property_exists($vendorOrderss, 'message')) { +$response = getOrderbyVendorId($vendorId); +$vendorDecode = json_decode($response); + +// var_dump($vendorDecode); +if (is_array($vendorDecode)) { + $vendorOrders = json_decode($response); +} elseif (is_object($vendorDecode) && property_exists($vendorDecode, 'message')) { $vendorOrders = []; } else { echo "Unknown type or no 'message' property found."; @@ -39,7 +43,7 @@ if (is_array($vendorOrderss)) { - + @@ -71,7 +75,23 @@ if (is_array($vendorOrderss)) { /* Set your desired text color for the active tab */ } + #pagination { + display: flex; + list-style: none; + padding: 0; + margin: 0; + justify-content: center; + } + + #pagination a { + color: #333; + text-decoration: none; + padding: 5px 10px; + border: 1px solid #ccc; + border-radius: 4px; + } + @@ -466,20 +664,6 @@ if (is_array($vendorOrderss)) { - - - - - -
@@ -680,6 +864,8 @@ if (is_array($vendorOrderss)) { + + From 64c5c756c001dd1c8d1361a1b9a434425478b494 Mon Sep 17 00:00:00 2001 From: gelonspr Date: Tue, 26 Mar 2024 14:57:36 +0800 Subject: [PATCH 2/3] minor changes on vendor-payments --- vendor-payments.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/vendor-payments.php b/vendor-payments.php index 3bc1518..ec00c1f 100644 --- a/vendor-payments.php +++ b/vendor-payments.php @@ -464,6 +464,7 @@ if (is_array($vendorDecode)) { $(document).ready(function() { $('.showSinglePaymentBtn').click(function() { var orderId = $(this).data('order-id'); + var token = ""; @@ -583,9 +584,7 @@ if (is_array($vendorDecode)) {
₱ ${net_amount}
-
Fees
+
Fees
- ₱ ${fee}
From 011ae8496e4315bb8d70b462851f50e81b3c4ee7 Mon Sep 17 00:00:00 2001 From: gelonspr Date: Tue, 26 Mar 2024 16:44:13 +0800 Subject: [PATCH 3/3] fixed vendor payment details modal and dynamic data display --- vendor-payments.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vendor-payments.php b/vendor-payments.php index ec00c1f..c749025 100644 --- a/vendor-payments.php +++ b/vendor-payments.php @@ -217,7 +217,7 @@ if (is_array($vendorDecode)) { foreach ($vendorOrders as $order) { $orderArray = json_encode($order, true); $orderItems = json_decode($orderArray, true); - if($orderItems['payment']['status'] == 'paid'){ + if(strtolower($orderItems['payment']['status']) == 'paid'){ $rawDate = $orderItems['payment']['details'][0]['attributes']['data']['attributes']['payments'][0]['createdAt']; if ($rawDate) {