From 3e8e62a13143d8852cdfc63eae22d10e211ac9a5 Mon Sep 17 00:00:00 2001 From: Jun Barroga Date: Tue, 27 Feb 2024 08:56:59 +0800 Subject: [PATCH] Vendor Page Modifications --- admin/config.php | 2 +- admin/login.php | 2 +- admin/vendor-card.php | 340 ++++++++++++---------- assets/css/style.css | 2 +- checkouttest.php | 4 +- functions.php | 10 +- vendor-dashboard-orders-edit-action.php | 6 + vendor-dashboard-orders-edit.php | 4 + vendor-settings.php | 367 +++++++++++++++--------- 9 files changed, 444 insertions(+), 293 deletions(-) diff --git a/admin/config.php b/admin/config.php index 57d9763..7f523ab 100644 --- a/admin/config.php +++ b/admin/config.php @@ -1,6 +1,6 @@ -
+
diff --git a/admin/vendor-card.php b/admin/vendor-card.php index 111c49c..a08d6b5 100644 --- a/admin/vendor-card.php +++ b/admin/vendor-card.php @@ -852,168 +852,212 @@ $products = productList();
diff --git a/functions.php b/functions.php index cffbd8a..ae5ff93 100644 --- a/functions.php +++ b/functions.php @@ -1382,17 +1382,23 @@ function getOrderbyVendorId($id) return $response; } -function editOrderStatus($orderId, $status, $currentStatus, $trackingNumber, $courierName, $token) +function editOrderStatus($orderId, $status, $currentStatus, $trackingNumber, $courierName, $paymentStatus, $paymentReference, $token) { $curl = curl_init(); $data = array( 'status' => $status ); - if ($currentStatus == "TO SHIP" || $currentStatus == "T Ship") { + if ($currentStatus == "TO SHIP" || $currentStatus == "To Ship") { // $data['tracking_number'] = $trackingNumber; $data['tracking_number'] = $trackingNumber; $data['courier_name'] = $courierName; } + if ($currentStatus == "TO RECEIVE" || $currentStatus == "To Receive") { + // $data['tracking_number'] = $trackingNumber; + $data['payment']['status'] = $paymentStatus; + $data['payment']['reference_number'] = $paymentReference; + + } $params3 = json_encode($data); curl_setopt_array($curl, array( CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/orders/" . $orderId, diff --git a/vendor-dashboard-orders-edit-action.php b/vendor-dashboard-orders-edit-action.php index f86541a..b47079e 100644 --- a/vendor-dashboard-orders-edit-action.php +++ b/vendor-dashboard-orders-edit-action.php @@ -5,15 +5,19 @@ $orderId = $_SESSION['vendorOrderId']; $currentStatus = $_POST['order_status']; $trackingNumber = $_POST['tracking_number']; $courirerName = $_POST['courier_name']; +$paymentReference = $_POST['payment_reference']; $token = $_SESSION['token']; // $status = "TO SHIP"; if ($currentStatus === 'TO PAY' || $currentStatus === 'To Pay') { $status = 'TO SHIP'; + $paymentStatus = 'UNPAID'; } elseif ($currentStatus === 'TO SHIP' || $currentStatus === 'To Ship') { $status = 'TO RECEIVE'; + $paymentStatus = 'UNPAID'; } elseif ($currentStatus === 'TO RECEIVE' || $currentStatus === 'To Receive') { $status = 'COMPLETED'; + $paymentStatus = 'PAID'; } $response = editOrderStatus( @@ -22,6 +26,8 @@ $response = editOrderStatus( $currentStatus, $trackingNumber, $courirerName, + $paymentStatus, + $paymentReference, $token ); $array = json_decode($response,true); diff --git a/vendor-dashboard-orders-edit.php b/vendor-dashboard-orders-edit.php index 9d3a41a..06b7ac9 100644 --- a/vendor-dashboard-orders-edit.php +++ b/vendor-dashboard-orders-edit.php @@ -199,6 +199,10 @@ $array = json_decode($result, true); +
diff --git a/vendor-settings.php b/vendor-settings.php index 3758f5f..8e1f553 100644 --- a/vendor-settings.php +++ b/vendor-settings.php @@ -137,26 +137,42 @@ if ($_SESSION["userId"] <> "") {
+
-
+ +
- alt="vendor image"> + + alt="vendor image">
+ +
About Us
-

+ +

+ +

No description available.

+
+
Account Information
@@ -164,7 +180,7 @@ if ($_SESSION["userId"] <> "") {
E-mail address
    -
  • +
@@ -172,7 +188,7 @@ if ($_SESSION["userId"] <> "") {
Contact nubmer
    -
  • +
@@ -335,6 +351,7 @@ if ($_SESSION["userId"] <> "") { const firstName = document.getElementById('cfirstname-').value; const lastName = document.getElementById('clastname-').value; const phone = document.getElementById('cphone-').value; + const description = document.getElementById('cdescription-').value; // If no file selected, only update the email fetch(`https:///api/v1/vendors/${vendorid}`, { @@ -347,6 +364,7 @@ if ($_SESSION["userId"] <> "") { first_name: firstName, last_name: lastName, phone: phone, + vendor_description:description }) }) .then(response => { @@ -369,24 +387,22 @@ if ($_SESSION["userId"] <> "") {
@@ -854,6 +939,12 @@ if ($_SESSION["userId"] <> "") {
+ +
+ + +
+