From 6d0170decff64add2f1110ba439f85ad8bd47084 Mon Sep 17 00:00:00 2001 From: jouls Date: Tue, 19 Mar 2024 17:15:54 +0800 Subject: [PATCH 1/4] added payout page and route --- vendor-payouts.php | 447 +++++++++++++++++++++++++++++++++++++++++++ vendor-user-tabs.php | 20 +- 2 files changed, 459 insertions(+), 8 deletions(-) create mode 100644 vendor-payouts.php diff --git a/vendor-payouts.php b/vendor-payouts.php new file mode 100644 index 0000000..6f8659e --- /dev/null +++ b/vendor-payouts.php @@ -0,0 +1,447 @@ + "") { + $_SESSION["isLoggedIn"] = true; + // $customer_data = getCustomerbyLoginId($_SESSION["userId"]); + $vendorLoginId = searchVendorbyLoginId($_SESSION["userId"]); + $vendorLoginIdjson = json_decode($vendorLoginId, true); + // var_dump( $vendorLoginIdjson); + if (isset($vendorLoginIdjson['results'][0])) { + $vendorData = $vendorLoginIdjson['results'][0]; + $vendorId = $vendorData['_id']; + $_SESSION["LoggedInVendorId"] = $vendorId; + } + // $vendor= getVendorbyId($vendorLoginIdjson['results'][0]['_id']); + // // var_dump($vendor); + // $array = json_decode($vendor,true); + // var_dump($array); + +} else { + $_SESSION["isLoggedIn"] = false; + header("location: login.php"); +} +?> + + + + + + + + + oBanana B2B - Elevate Your Business + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
+
+ + + + + + + + + + + + + +
+
+
+
+
+
+

Vendor Settings

+
+
+ +
    +
  • Home
  • +
  • Settings
  • +
+ +
+
+
+
+
+
+ + + +
+
+
+ +
+
+ +
+
+ + +
+
+
+
+
+
+
+
+ +
+
+
+
Upcoming Payout
+
+
+ Panel content +
+
+
+
+
+
+
Payout Generation Schedule
+
+
+ Panel content +
+
+
+
+
+
+
Next Payout
+
+
+ Panel content +
+
+
+
+
Payout History
+ + + + + + + + + + + + + + + + + + + + +
AmountBankAccount NumberPayout GenerationStatusAction
PHP 1,165.65 EastWest Bank ****6618 December 08, 2023 Deposited + Details +
+
+
+
+
+
+
+
+
+ + + + + + + + + + + + + + + + +
+ +
+
+ 3 +
+
+ + + +
+ + + + +
+
+
+ whatsapp icon +
+
+
+ +
+ + + +
+
+
+

Features

+
+ + icon + +
+
+

Color Scheme

+
    +
  • +
  • +
  • +
  • +
  • +
+
+
+

Backgrounds

+ +
+
+

Full Screen mode

+
+
+
Mode
+
On
+
Off
+
+
+
+
+

Dark mode

+
+
+
Mode
+
On
+
Off
+
+
+
+
+

RTL mode

+
+
+
Rtl
+
On
+
Off
+
+
+
+
+

Clear local storage

+ Clear Cache & Default +
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/vendor-user-tabs.php b/vendor-user-tabs.php index fc69951..8e77193 100644 --- a/vendor-user-tabs.php +++ b/vendor-user-tabs.php @@ -1,23 +1,27 @@ -
- \ No newline at end of file From 877e2c6a81418eb343701fbd6a1ab9884d95f1c6 Mon Sep 17 00:00:00 2001 From: Stacy Date: Wed, 20 Mar 2024 13:54:50 +0800 Subject: [PATCH 2/4] Added all order tab on customer purchase history --- admin/header.php | 561 ++++++++++++++++++++++++++++++++++ admin/user-card.php | 556 +--------------------------------- admin/vendor-profile.php | 631 +-------------------------------------- product-left-sidebar.php | 2 +- user-history.php | 507 +++++++++++++++++++++++++------ user-profile.php | 4 +- user-refund-history.php | 12 +- 7 files changed, 986 insertions(+), 1287 deletions(-) create mode 100644 admin/header.php diff --git a/admin/header.php b/admin/header.php new file mode 100644 index 0000000..020fd67 --- /dev/null +++ b/admin/header.php @@ -0,0 +1,561 @@ + + + + \ No newline at end of file diff --git a/admin/user-card.php b/admin/user-card.php index 228c3a3..4826885 100644 --- a/admin/user-card.php +++ b/admin/user-card.php @@ -83,560 +83,8 @@ $users = getUsers();
- - + +
diff --git a/admin/vendor-profile.php b/admin/vendor-profile.php index 4ed7951..f923609 100644 --- a/admin/vendor-profile.php +++ b/admin/vendor-profile.php @@ -68,636 +68,7 @@ $array = json_decode($vendor,true);
- +
diff --git a/product-left-sidebar.php b/product-left-sidebar.php index 7316195..512d2a2 100644 --- a/product-left-sidebar.php +++ b/product-left-sidebar.php @@ -505,7 +505,7 @@ if (isset($_GET['id'])) { echo '" id="qty-input" />'; echo '
+
'; // echo '
'; - echo '
'; + echo '
'; echo '
'; diff --git a/user-history.php b/user-history.php index b36a83f..7f6f97f 100644 --- a/user-history.php +++ b/user-history.php @@ -38,6 +38,9 @@ if ($_SESSION["userId"] <> "") { + + + @@ -45,15 +48,58 @@ if ($_SESSION["userId"] <> "") { + + + +
diff --git a/user-profile.php b/user-profile.php index 71eca38..e3ae4f4 100644 --- a/user-profile.php +++ b/user-profile.php @@ -114,7 +114,7 @@ if ($_SESSION["userId"] <> "") { - +
@@ -168,7 +168,7 @@ if ($_SESSION["userId"] <> "") {
-
+ diff --git a/user-refund-history.php b/user-refund-history.php index 95a6416..8bfcbcc 100644 --- a/user-refund-history.php +++ b/user-refund-history.php @@ -49,7 +49,7 @@ if ($_SESSION["userId"] <> "") { --> + + + + + + + oBanana B2B - Admin Dashboard + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + +
+ + + + + + + +
+
+
Vendor Search Results
+
+ +
+
+
+
+ +
+
+ "> + + +
+
+
+
+
Seller Products
+ +

+
+
+
+
+
Seller since
+

+
+
+
+ +
+
+
+ +
+
+
+ + + + +
+
+
+ $productListVendor) { + // echo "$product .":" . $productListVendor"; + // $vendorOfProduct = getVendorbyId($product['vendor_api_id']); + + $products = productListVendor($vendorId); + $totalProducts = count($products); + + + for ($i = 0; $i <= $totalProducts - 1; $i++) { + $product = $products[$i]; + ?> +
+
+
+
+
+ + edit + + edit + +
+
+
+

+

+
+
+
+
+
+
+
+
+
+ +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/catalog-single-vendor-action.php b/catalog-single-vendor-action.php new file mode 100644 index 0000000..d9812af --- /dev/null +++ b/catalog-single-vendor-action.php @@ -0,0 +1,30 @@ + "") { } else { $_SESSION["isLoggedIn"] = false; } +$products = productListVendor($_GET["id"]); + +$filteredProducts = []; + +if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['category'])) { + $filteredProducts = []; + $minPrice = isset($_GET['minPrice']) && $_GET['minPrice'] !== '' ? floatval($_GET['minPrice']) : null; + $maxPrice = isset($_GET['maxPrice']) && $_GET['maxPrice'] !== '' ? floatval($_GET['maxPrice']) : null; + + // echo "Min Price: " . ($minPrice !== null ? $minPrice : "null") . "
"; + // echo "Max Price: " . ($maxPrice !== null ? $maxPrice : "null") . "
"; + + $selectedCategories = isset($_GET['category']) ? $_GET['category'] : []; + + if (!empty($selectedCategories) && (($minPrice == null) && ($maxPrice == null))) { + // var_dump("filtering categories without price"); + foreach ($selectedCategories as $selectedCategory) { + $category = strtolower(trim($selectedCategory)); + foreach ($products as $result) { + $product = $result; + + $productCategory = strtolower(trim($product['product_category'])); + + if ( + $productCategory == $category + ) { + $filteredProducts[] = $result; + } + } + } + } elseif (!empty($selectedCategories) && (!empty($minPrice) || !empty($maxPrice))) { + // var_dump("filtering categories and price"); + if ($minPrice === null) { + $minPrice = 0; + } + if ($maxPrice === null) { + $maxPrice = PHP_FLOAT_MAX; + } + foreach ($selectedCategories as $selectedCategory) { + $category = strtolower(trim($selectedCategory)); + foreach ($products as $result) { + $product = $result; + $productPrice = isset($product['sale_price']) ? $product['sale_price'] : $product['regular_price']; + $productCategory = strtolower(trim($product['product_category'])); + if ( + $productCategory = $category && (($productPrice >= $minPrice) && + ($productPrice <= $maxPrice)) + ) { + $filteredProducts[] = $result; + } + } + } + } + else { + foreach ($products as $result) { + // var_dump("filtering"); + $product = $result; + $productPrice = isset($product['sale_price']) ? $product['sale_price'] : $product['regular_price']; + // var_dump( $minPrice); + // var_dump( $productPrice); + // var_dump( $productPrice >= $minPrice); + + + + if ($minPrice === null) { + $minPrice = 0; + } + + if ($maxPrice === null) { + $maxPrice = PHP_FLOAT_MAX; + } + if (($minPrice === null || $productPrice >= $minPrice) && + ($maxPrice === null || $productPrice <= $maxPrice) + ) { + $filteredProducts[] = $result; + // var_dump("filtering heree"); + + } + } + } +} else { + $filteredProducts = $products; +} ?> @@ -268,7 +351,6 @@ if ($_SESSION["userId"] <> "") {
Seller Products

Products

@@ -334,7 +416,7 @@ if ($_SESSION["userId"] <> "") {
"") { } } else { ?> - edit + edit @@ -489,64 +571,83 @@ if ($_SESSION["userId"] <> "") {
-
-

Category

-
-
- + + +
-
x From b8ac7f827d14b18b58ba4fd0bcea49f170e19adf Mon Sep 17 00:00:00 2001 From: jouls Date: Wed, 20 Mar 2024 14:59:13 +0800 Subject: [PATCH 4/4] added payout table and modal --- vendor-payouts.php | 189 ++++++++++++++++++++++++++++++++++--------- vendor-user-tabs.php | 2 +- 2 files changed, 154 insertions(+), 37 deletions(-) diff --git a/vendor-payouts.php b/vendor-payouts.php index 6f8659e..53bf663 100644 --- a/vendor-payouts.php +++ b/vendor-payouts.php @@ -24,6 +24,17 @@ if ($_SESSION["userId"] <> "") { ?> + @@ -141,61 +152,114 @@ if ($_SESSION["userId"] <> "") {
-
+
-
Upcoming Payout
+
Upcoming Payout
-
- Panel content +
+
+

+
+ + ₱ 0.00 + +
+

+
+ Payout Generation: Tue, Mar 19, 2024 +
+
+ Receive Payout on or before: Wed, Mar 20, 2024 +
+
+ Receipient: Philippine National Bank (PNB) Account ending in 6685 +
+
-
+
-
Payout Generation Schedule
+
Payout Generation Schedule
-
- Panel content +
+
+

+
+ + + Weekly + +
+

+
+
+ Every Tuesday +
+
+
+ Payouts that will fall on holiday will be processed the next banking day +
+
-
+
-
Next Payout
+
Next Payout
-
- Panel content +
+
+

+
+ + ₱ 0.00 + +
+

+
+ Payout Generation: Tue, Mar 25, 2024 +
+
+ Receive Payout on or before: Wed, Mar 26, 2024 +
+
+ Receipient: Philippine National Bank (PNB) Account ending in 6685 +
+
-
-
Payout History
- - - - - - - - - +
+
Payout History
+
+
AmountBankAccount NumberPayout GenerationStatusAction
+ + + + + + + + - - - - - - - - - - -
AmountBankAccount NumberPayout GenerationStatusAction
PHP 1,165.65 EastWest Bank ****6618 December 08, 2023 Deposited - Details -
+ + + + ₱ 1,165.65 + EastWest Bank + ****6618 + December 08, 2023 + Deposited + + Details + + + +
@@ -204,6 +268,59 @@ if ($_SESSION["userId"] <> "") {
+ + + diff --git a/vendor-user-tabs.php b/vendor-user-tabs.php index 8e77193..96944df 100644 --- a/vendor-user-tabs.php +++ b/vendor-user-tabs.php @@ -9,7 +9,7 @@ $current_page = basename($_SERVER['PHP_SELF']);
  • >Uploads
  • >Settings (edit)
  • >Vendor Refund History
  • -
  • >Payouts
  • +
  • >My Payouts