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/index.php b/admin/index.php index 63de68d..21284dc 100644 --- a/admin/index.php +++ b/admin/index.php @@ -48,13 +48,11 @@ if($_SESSION["user_type"]!="admin"){ - -
- - - - + + + +
@@ -65,13 +63,21 @@ if($_SESSION["user_type"]!="admin"){
-
+
+
+ + +
+
+
    diff --git a/admin/left-main-sidebar.php b/admin/left-main-sidebar.php index 9f13f0b..ecffa77 100644 --- a/admin/left-main-sidebar.php +++ b/admin/left-main-sidebar.php @@ -103,7 +103,7 @@
  • - + Products 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-delete-action1.php b/admin/vendor-delete-action1.php new file mode 100644 index 0000000..c4ba650 --- /dev/null +++ b/admin/vendor-delete-action1.php @@ -0,0 +1,26 @@ + 'https://api.obanana.shop/api/v1/products/656717579624f6181c49cdda', + CURLOPT_RETURNTRANSFER => true, + CURLOPT_ENCODING => '', + CURLOPT_MAXREDIRS => 10, + CURLOPT_TIMEOUT => 0, + CURLOPT_FOLLOWLOCATION => true, + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1, + CURLOPT_CUSTOMREQUEST => 'DELETE', + CURLOPT_HTTPHEADER => array( + 'X-Api-Key: {{apiKey}}' + ), +)); + +$response = curl_exec($curl); + +curl_close($curl); +header("location: vendor-product-search.php"); +echo $response; +?> diff --git a/admin/vendor-product-grid.php b/admin/vendor-product-grid.php index f8f24c9..42c15a2 100644 --- a/admin/vendor-product-grid.php +++ b/admin/vendor-product-grid.php @@ -39,7 +39,9 @@ if($_SESSION["user_type"]!="admin"){ - + + + @@ -52,560 +54,8 @@ if($_SESSION["user_type"]!="admin"){
    - - + +
    @@ -630,7 +80,12 @@ if($_SESSION["user_type"]!="admin"){
    - +
    + + +
    @@ -655,10 +110,37 @@ if($_SESSION["user_type"]!="admin"){
    -
    + +
    No Product Found.

    '; + // } + + // 03-14-2024 Raymart created Search product end + for ($i = 0; $i <= $totalProducts - 1; $i++) { $product = $products[$i]; ?> @@ -667,13 +149,21 @@ if($_SESSION["user_type"]!="admin"){
    + + edit '; - } else { - echo 'Placeholder Image'; } + } else { ?> + edit +
    @@ -692,6 +182,82 @@ if($_SESSION["user_type"]!="admin"){ } ?>
    + + + + + + + + + + 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/admin/vendor-profile.php b/admin/vendor-profile.php index 0b536b4..eba6656 100644 --- a/admin/vendor-profile.php +++ b/admin/vendor-profile.php @@ -90,636 +90,7 @@ if (is_array($vendorOrderss)) {
    - +
    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 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"] <> "") { \ No newline at end of file