From 14609b96935180febfa6e91c4cd09dee838a55ab Mon Sep 17 00:00:00 2001 From: Jun Barroga Date: Wed, 20 Mar 2024 09:36:52 +0800 Subject: [PATCH] Bank Account --- admin/product-edit.php | 5 +- admin/vendor-card.php | 104 ++++---------- functions.php | 4 + user-history.php | 27 +++- vendor-settings.php | 186 +++++++++++++++++++++++++ vendor-uploads-edit-product-action.php | 13 ++ vendor-uploads.php | 162 ++++++++++++++++++--- 7 files changed, 395 insertions(+), 106 deletions(-) diff --git a/admin/product-edit.php b/admin/product-edit.php index 4ec941c..81cfeb2 100644 --- a/admin/product-edit.php +++ b/admin/product-edit.php @@ -1130,10 +1130,10 @@ $vendorId = $_SESSION["vendorId"]; promises.push(promise); } - + // 03-14-2024 Jun Jihad modified this block of code to properly upload images with comma in the filename Promise.all(promises) .then(filenames => { - const updatedImages = existingImages.concat(filenames.map(filename => `https:///images/storage/product_uploads/${filename}`)); + const updatedImages = existingImages.concat(filenames.map(filename => `https:///images/storage/product_uploads/${encodeURIComponent(filename)}`)); if (!Array.isArray(updatedImages)) { console.error('Updated images is not an array:', updatedImages); @@ -1154,6 +1154,7 @@ $vendorId = $_SESSION["vendorId"]; body: JSON.stringify(payload) }); }) + // 03-14-2024 Jun Jihad modified this block of code to properly upload images with comma in the filename .then(response => { if (response.ok) { console.log('Images uploaded successfully'); diff --git a/admin/vendor-card.php b/admin/vendor-card.php index d8ab00d..79fea72 100644 --- a/admin/vendor-card.php +++ b/admin/vendor-card.php @@ -4,7 +4,7 @@ include "../functions.php"; $_SESSION["url"] = $_SERVER['REQUEST_URI']; if ($_SESSION["userId"] <> "") { $_SESSION["isLoggedIn"] = true; - $customer_data = getCustomerbyLoginId($_SESSION["userId"]); + //$customer_data = getCustomerbyLoginId($_SESSION["userId"]); } else { $_SESSION["isLoggedIn"] = false; header("location: login.php"); @@ -14,8 +14,6 @@ if ($_SESSION["user_type"] != "admin") { header("location: login.php?alert=Only admins allowed here!"); } $products = productList(); - -$vendorSearchResult = $_SESSION["vendorSearchResult"]; ?> @@ -66,8 +64,7 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"]; - - + @@ -92,22 +89,17 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"]; - -
-
-
- - -
-
+
+ + +
    - - - + diff --git a/vendor-uploads-edit-product-action.php b/vendor-uploads-edit-product-action.php index 4aca644..6b58249 100644 --- a/vendor-uploads-edit-product-action.php +++ b/vendor-uploads-edit-product-action.php @@ -40,6 +40,18 @@ $material = $_POST['material']; //echo '$material: '.$material.'
    '; $token = $_SESSION["token"]; +$quantities = $_POST['quantity']; +$prices = $_POST['price']; + +// Constructing the price matrix +$priceMatrix = array(); +for ($i = 0; $i < count($quantities); $i++) { + $priceMatrix[] = array( + 'quantity' => $quantities[$i], + 'price' => $prices[$i] + ); +} + $response = editProduct( $productId, @@ -66,6 +78,7 @@ $response = editProduct( $color, $material, $size, + $priceMatrix, $token); $array = json_decode($response,true); $_SESSION['newProdictId'] = $array['_id']; diff --git a/vendor-uploads.php b/vendor-uploads.php index b2639a8..a60d129 100644 --- a/vendor-uploads.php +++ b/vendor-uploads.php @@ -118,14 +118,16 @@ $array = json_decode($result, true);
    -
    - -
    + if (!empty($vendorData['vendor_banner'])) { ?> +
    + +
    - +
    - + @@ -134,7 +136,7 @@ $array = json_decode($result, true); vendor image
    -
    +
    +
    + + + + + + + + + + + $pair) : ?> + + + + + + + + +
    QuantityPrice (PHP)
    + +
    +
    -
    +
    - style="background-color: blue;"> - -
    -
    -
    -
    - style="background-color: blue;"> - + style="background-color: blue;"> +
    - style="background-color: blue;"> - + style="background-color: blue;"> + +
    +
    +
    +
    + style="background-color: blue;"> +
    @@ -473,7 +500,7 @@ $array = json_decode($result, true);