Compare commits

..

29 Commits

Author SHA1 Message Date
Jun Barroga 2f599791df Fix Bugs on Checkout 2024-04-22 09:50:50 +08:00
MarkHipe b978919ccb Merge pull request 'added error handling for user level page access' (#60) from gelo_branch into main
Reviewed-on: #60
2024-04-16 16:08:00 +08:00
gelonspr d02aa49f3c added error handling for user level page access 2024-04-16 16:07:26 +08:00
MarkHipe 868fe51be8 Merge pull request 'louie_branch' (#59) from louie_branch into main
Reviewed-on: #59
2024-04-16 16:04:40 +08:00
jouls 82801fed8a Added Error Handling for My Account Redirections on Vendor Pages 2024-04-16 15:46:49 +08:00
jouls d24c4f98d2 Error handling for user-profile and vendor-settings 2024-04-16 13:47:04 +08:00
MarkHipe d27f546bba Merge pull request 'fixed pagination styling for vendor-payments.php' (#58) from gelo_branch into main
Reviewed-on: #58
2024-04-16 11:05:06 +08:00
gelonspr 97c1fa7562 fixed pagination styling for vendor-payments.php 2024-04-16 11:03:50 +08:00
MarkHipe 533f64d4fe Merge pull request 'Added remaining dynamic content on payout modal box' (#51) from louie_branch into main
Reviewed-on: #51
2024-04-16 11:00:34 +08:00
jouls c62160014f Merge branch 'main' of https://code.obanana.io/Obanana.Corporation/obanana_b2b_test into louie_branch 2024-04-16 10:55:57 +08:00
MarkHipe 142418da3c Merge pull request 'stacy_branch' (#57) from stacy_branch into main
Reviewed-on: #57
2024-04-16 10:53:14 +08:00
Stacy 47a7083a31 FAQ page and Contact us page cleanup 2024-04-16 10:48:59 +08:00
Stacy a475ceecba Minor Changes 2024-04-16 10:47:29 +08:00
Stacy 181b602087 Placeholder for Empty List 2024-04-16 10:44:22 +08:00
MarkHipe 5448ee0c5e Merge pull request 'Check out Page, Mobile View - bottom navigation bar links issues' (#56) from raymart_branch into main
Reviewed-on: #56
2024-04-16 10:14:48 +08:00
raymart e3a95b604e Check out Page, Mobile View - bottom navigation bar links issues 2024-04-16 10:12:45 +08:00
MarkHipe 669c13d97b Merge pull request 'jun-branch' (#55) from jun-branch into main
Reviewed-on: #55
2024-04-16 10:07:53 +08:00
jouls 3609c5eee6 Merge branch 'louie_branch' of https://code.obanana.io/Obanana.Corporation/obanana_b2b_test into louie_branch 2024-04-12 16:05:32 +08:00
jouls 9a39b1e116 Merge branch 'louie_branch' of https://code.obanana.io/Obanana.Corporation/obanana_b2b_test into louie_branch 2024-04-12 16:05:06 +08:00
jouls 0adfc24884 Merge branch 'louie_branch' of https://code.obanana.io/Obanana.Corporation/obanana_b2b_test into louie_branch 2024-04-12 16:03:25 +08:00
jouls 82d8191c53 added token refresh on vendor payouts 2024-04-12 16:03:14 +08:00
jouls 7751fecf0c added token refresh on vendor payouts 2024-04-12 15:58:43 +08:00
jouls cf866edd41 Merge branch 'main' of https://code.obanana.io/Obanana.Corporation/obanana_b2b_test into louie_branch 2024-04-12 08:33:06 +08:00
jouls 6feb68fde8 removed unneccesary comments 2024-04-05 12:59:25 +08:00
jouls c94863aa99 Merge branch 'main' into louie_branch 2024-04-04 18:22:54 +08:00
jouls c92635ca1c Merge branch 'main' into louie_branch 2024-04-04 18:10:57 +08:00
jouls f121a053ee removed unused codes 2024-04-02 10:37:35 +08:00
jouls d8f5ed576c Merge branch 'main' into louie_branch 2024-04-02 08:40:58 +08:00
jouls 55affaa372 Added remaining dynamic content on payout modal box 2024-03-26 18:15:52 +08:00
21 changed files with 1020 additions and 654 deletions

View File

@ -1,4 +1,14 @@
<div class="ec-left-sidebar ec-bg-sidebar">
<style>
.sidenav-item.active {
background-color: #f0f0f0; /* Change background color */
}
.sidenav-item.active .nav-text {
color: #333; /* Change text color */
}
</style>
<div class="ec-left-sidebar ec-bg-sidebar">
<div id="sidebar" class="sidebar ec-sidebar-footer">
<div class="ec-brand">
@ -22,7 +32,7 @@
</li>
<!-- Vendors -->
<li class="has-sub">
<li>
<a class="sidenav-item-link" href="vendor-card.php">
<i class="mdi mdi-account-group-outline"></i>
<span class="nav-text">Vendors</span>
@ -50,7 +60,7 @@
</li>
<!-- Users -->
<li class="has-sub">
<li >
<a class="sidenav-item-link" href="user-card.php">
<i class="mdi mdi-account-group"></i>
<span class="nav-text">Users</span>
@ -76,11 +86,10 @@
</li>
</ul>
</div> -->
<hr>
</li>
<!-- Category -->
<li class="has-sub">
<!-- <li class="has-sub">
<a class="sidenav-item-link" href="javascript:void(0)">
<i class="mdi mdi-dns-outline"></i>
<span class="nav-text">Categories</span> <b class="caret"></b>
@ -99,10 +108,10 @@
</li>
</ul>
</div>
</li>
</li> -->
<!-- Products -->
<li class="has-sub">
<!-- <li class="has-sub">
<a class="sidenav-item-link" href="product-grid.php">
<i class="mdi mdi-palette-advanced"></i>
<span class="nav-text">Products</span> <b class="caret"></b>
@ -131,15 +140,15 @@
</li>
</ul>
</div>
</li>
</li> -->
<!-- Orders -->
<li class="has-sub">
<a class="sidenav-item-link" href="javascript:void(0)">
<li >
<a class="sidenav-item-link" href="order-history.php">
<i class="mdi mdi-cart"></i>
<span class="nav-text">Orders</span> <b class="caret"></b>
<span class="nav-text">Orders</span>
</a>
<div class="collapse">
<!-- <div class="collapse">
<ul class="sub-menu" id="orders" data-parent="#sidebar-menu">
<li class="">
<a class="sidenav-item-link" href="new-order.html">
@ -162,28 +171,28 @@
</a>
</li>
</ul>
</div>
</div> -->
</li>
<!-- Reviews -->
<li>
<!-- <li>
<a class="sidenav-item-link" href="review-list.html">
<i class="mdi mdi-star-half"></i>
<span class="nav-text">Reviews</span>
</a>
</li>
</li> -->
<!-- Brands -->
<li>
<!-- <li>
<a class="sidenav-item-link" href="brand-list.html">
<i class="mdi mdi-tag-faces"></i>
<span class="nav-text">Brands</span>
</a>
<hr>
</li>
</li> -->
<!-- Authentication -->
<li class="has-sub">
<!-- <li class="has-sub">
<a class="sidenav-item-link" href="javascript:void(0)">
<i class="mdi mdi-login"></i>
<span class="nav-text">Authentication</span> <b class="caret"></b>
@ -202,10 +211,10 @@
</li>
</ul>
</div>
</li>
</li> -->
<!-- Icons -->
<li class="has-sub">
<!-- <li class="has-sub">
<a class="sidenav-item-link" href="javascript:void(0)">
<i class="mdi mdi-diamond-stone"></i>
<span class="nav-text">Icons</span> <b class="caret"></b>
@ -229,10 +238,10 @@
</li>
</ul>
</div>
</li>
</li> -->
<!-- Other Pages -->
<li class="has-sub">
<!-- <li class="has-sub">
<a class="sidenav-item-link" href="javascript:void(0)">
<i class="mdi mdi-image-filter-none"></i>
<span class="nav-text">Other Pages</span> <b class="caret"></b>
@ -244,7 +253,7 @@
</li>
</ul>
</div>
</li>
</li> -->
</ul>
</div>
</div>

View File

@ -226,9 +226,13 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
<div class="sName">
<h5>Name:
<span id="selectedFName"><?php echo strtoupper($customer['address'][0]['first_name']); ?></span>
<span id="selectedLName"><?php echo strtoupper($customer['address'][0]['last_name']); ?></span>
</h5>
<!-- <h5>Name:
<span id="selectedFName"><?php echo $customer['address'][0]['first_name']; ?></span>
<span id="selectedLName"> <?php echo $customer['address'][0]['last_name']; ?></span>
</h5>
</h5> -->
</div>
<div class="sContact">
<h5>Contact #:
@ -269,7 +273,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
<div class="form-check" id="form-check-<?php echo $address_index ?>">
<input type="radio" class="form-check-input" name="selectedAddress" id="address_<?php echo $customer_index; ?>_<?php echo $address_index; ?>" value="<?php echo $customer_index; ?>_<?php echo $address_index; ?>">
<label class="form-check-label" style="max-width: 80%; word-wrap: break-word;" for="address_<?php echo $customer_index; ?>_<?php echo $address_index; ?>">
<?php echo $address['first_name']; ?> <?php echo $address['last_name']; ?><br>
<?php echo strtoupper($address['first_name']); ?> <?php echo strtoupper($address['last_name']); ?><br>
<?php echo $address['address_1']; ?> <?php echo $address['address_2']; ?>
<?php echo $address['barangay']; ?>, <?php echo $address['city']; ?>,
<?php echo $address['province']; ?> <?php echo $address['country']; ?><br>
@ -1245,6 +1249,29 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
let itemNames = [];
submitButton.addEventListener('click', async function() {
if (pay1RadioButton.checked) {
const selectedFName = document.getElementById('selectedFName').innerText;
const selectedLName = document.getElementById('selectedLName').innerText;
const selectedContact = document.getElementById('selectedContact').innerText;
const sBuilding = document.getElementById('sBuilding').innerText;
const sStreet = document.getElementById('sStreet').innerText;
const sCity = document.getElementById('sCity').innerText;
const sBarangay = document.getElementById('sBarangay').innerText;
const sProvince = document.getElementById('sProvince').innerText;
const sCountry = document.getElementById('sCountry').innerText;
if (
selectedFName.trim() === "" ||
selectedLName.trim() === "" ||
selectedContact.trim() === "" ||
sBuilding.trim() === "" ||
sStreet.trim() === "" ||
sCity.trim() === "" ||
sBarangay.trim() === "" ||
sProvince.trim() === "" ||
sCountry.trim() === ""
) {
alert("Please select address.");
return;
}
try {
<?php foreach ($cartItems as $checkout) { ?>
<?php foreach ($checkout['items'] as $item) { ?>
@ -1344,15 +1371,24 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
const newArray = Object.values(ordersToUpdate)
console.log(newArray)
const refchar = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
let uniqueRef = '';
for (let i = 0; i < 8; i++) {
const randomIndex = Math.floor(Math.random() * refchar.length);
uniqueRef += refchar.charAt(randomIndex);
}
// let uniqueRef = '';
// for (let i = 0; i < 8; i++) {
// const randomIndex = Math.floor(Math.random() * refchar.length);
// uniqueRef += refchar.charAt(randomIndex);
// }
newArray.forEach(async (orderId) => {
console.log(orderId)
const token = '<?php echo $_SESSION["token"] ?>';
const shippingfee = parseFloat(orderId.shipping_fee)
const orderPay3ProductId = orderId.items[0].product.product_id;
const productPay3Response = await fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/products/${orderProductId}`);
const productPay3Data = await productPay3Response.json();
let freeShippingObPay = false;
if (productPay3Data.promo && productPay3Data.promo.length > 0 && productPay3Data.promo[0]['free-shipping'] === 'Yes') {
freeShippingObPay = true;
}
const shippingFeesPay3 = freeShippingObPay ? 0 : shippingfee;
const patchResponse = await fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId._id}`, {
method: "PATCH",
body: JSON.stringify({
@ -1382,7 +1418,8 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
status: "UNPAID",
reference_number: result.attributes.reference_number,
},
total_amount: parseFloat(orderId.total_amount) + shippingfee,
shipping_fee: shippingFeesPay3,
total_amount: parseFloat(orderId.total_amount) + shippingFeesPay3,
order_date: iso8601String,
payment_method: "Obananapay",
}),
@ -1488,6 +1525,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
},
total_amount: parseFloat(orderId.total_amount) + shippingFees,
status: "TO PAY",
shipping_fee: shippingFees,
order_date: iso8601String,
payment_method: "Cash On Delivery",
}),
@ -2167,4 +2205,4 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
</body>
</html>
</html>

View File

@ -291,7 +291,7 @@
<!-- Footer navigation panel for responsive display end -->
<!-- Recent Purchase Popup -->
<div class="recent-purchase">
<!-- <div class="recent-purchase">
<img src="assets/images/product-image/1.jpg" alt="payment image">
<div class="detail">
<p>Someone in new just bought</p>
@ -299,7 +299,7 @@
<p>10 Minutes ago</p>
</div>
<a href="javascript:void(0)" class="icon-btn recent-close">×</a>
</div>
</div> -->
<!-- Recent Purchase Popup end -->
<!-- Cart Floating Button -->

32
faq.php
View File

@ -1,4 +1,4 @@
<!DOCTYPE html>
<!DOCTYPE html>
<html lang="en">
<head>
@ -168,23 +168,23 @@
<div class="col-md-12 ec-cms-block ec-abcms-block text-center">
<div class="ec-cms-block-inner">
<h3 class="ec-cms-block-title">What is Obanana Corporation's B2B eCommerce platform?</h3>
<p>Obanana Corporation's B2B eCommerce platform is an online marketplace designed to connect businesses worldwide, facilitating trade between buyers and sellers.</p>
<p>Obanana Corporation's B2B eCommerce platform is an online marketplace designed to connect businesses worldwide, facilitating trade between buyers and sellers.</p><br>
<h3 class="ec-cms-block-title">What kind of products can be found on the Obanana Corporation platform?</h3>
<p>Our platform offers a diverse range of products across various industries, including but not limited to electronics, clothing, machinery, raw materials, and more, catering to the needs of businesses across different sectors.</p>
<p>Our platform offers a diverse range of products across various industries, including but not limited to electronics, clothing, machinery, raw materials, and more, catering to the needs of businesses across different sectors.</p><br>
<h3 class="ec-cms-block-title">How does the platform ensure the quality of products listed?</h3>
<p>To ensure quality standards, we implement rigorous verification processes for both sellers and products. We encourage buyers to provide feedback and ratings based on their experience, fostering transparency and trust within our marketplace.</p>
<p>To ensure quality standards, we implement rigorous verification processes for both sellers and products. We encourage buyers to provide feedback and ratings based on their experience, fostering transparency and trust within our marketplace.</p><br>
<h3 class="ec-cms-block-title">What are the payment options available on the Obanana Corporation platform?</h3>
<p>We offer a variety of secure payment options to accommodate the needs of our users, including bank transfers, credit/debit cards, and third-party payment gateways, ensuring smooth and secure transactions.</p>
<p>We offer a variety of secure payment options to accommodate the needs of our users, including bank transfers, credit/debit cards, and third-party payment gateways, ensuring smooth and secure transactions.</p><br>
<h3 class="ec-cms-block-title">Can buyers and sellers communicate directly on the platform?</h3>
<p>Yes, our platform facilitates direct communication between buyers and sellers through messaging features and inquiry forms, allowing for seamless negotiation and collaboration.</p>
<p>Yes, our platform facilitates direct communication between buyers and sellers through messaging features and inquiry forms, allowing for seamless negotiation and collaboration.</p><br>
<h3 class="ec-cms-block-title">How does shipping and logistics work on the Obanana Corporation platform?</h3>
<p>We provide comprehensive shipping and logistics solutions, including freight forwarding services and shipping partners, to ensure efficient and timely delivery of goods to buyers worldwide.</p>
<p>We provide comprehensive shipping and logistics solutions, including freight forwarding services and shipping partners, to ensure efficient and timely delivery of goods to buyers worldwide.</p><br>
<h3 class="ec-cms-block-title">Are there any minimum order requirements for purchasing on the platform?</h3>
<p>Minimum order requirements may vary depending on the seller and product category. Buyers can find detailed information regarding minimum order quantities on product listings.</p>
<p>Minimum order requirements may vary depending on the seller and product category. Buyers can find detailed information regarding minimum order quantities on product listings.</p><br>
<h3 class="ec-cms-block-title">Does Obanana Corporation offer any trade assurance or buyer protection services?</h3>
<p>Yes, we provide trade assurance services to protect buyers' interests, offering refunds or replacements for orders that do not meet agreed-upon quality standards or fail to arrive within specified delivery times.</p>
<p>Yes, we provide trade assurance services to protect buyers' interests, offering refunds or replacements for orders that do not meet agreed-upon quality standards or fail to arrive within specified delivery times.</p><br>
<h3 class="ec-cms-block-title">How does Obanana Corporation handle disputes between buyers and sellers?</h3>
<p>In the event of disputes, our dedicated support team mediates and facilitates resolution through our dispute resolution process, ensuring fair outcomes for all parties involved.</p>
<p>In the event of disputes, our dedicated support team mediates and facilitates resolution through our dispute resolution process, ensuring fair outcomes for all parties involved.</p><br>
<h3 class="ec-cms-block-title">How can businesses join the Obanana Corporation platform as sellers?</h3>
<p>Businesses interested in becoming sellers on our platform can apply for membership through our website, where they will undergo a verification process to ensure compliance with our standards and policies.</p>
</div>
@ -196,7 +196,7 @@
</section>
<!-- ec testmonial Start -->
<section class="section ec-test-section section-space-ptb-100 section-space-m" id="reviews">
<!-- <section class="section ec-test-section section-space-ptb-100 section-space-m" id="reviews">
<div class="container">
<div class="row">
<div class="col-md-12 text-center">
@ -283,11 +283,11 @@
</div>
</div>
</div>
</section>
</section> -->
<!-- ec testmonial end -->
<!-- services Section Start -->
<section class="section ec-services-section section-space-p" id="services">
<!-- <section class="section ec-services-section section-space-p" id="services">
<h2 class="d-none">Services</h2>
<div class="container">
<div class="row">
@ -337,7 +337,7 @@
</div>
</div>
</div>
</section>
</section> -->
<!--services Section End -->
<!-- Ec Instagram Start -->
@ -450,7 +450,7 @@
<!-- Footer navigation panel for responsive display end -->
<!-- Recent Purchase Popup -->
<div class="recent-purchase">
<!-- <div class="recent-purchase">
<img src="assets/images/product-image/1.jpg" alt="payment image">
<div class="detail">
<p>Someone in new just bought</p>
@ -458,7 +458,7 @@
<p>10 Minutes ago</p>
</div>
<a href="javascript:void(0)" class="icon-btn recent-close">×</a>
</div>
</div> -->
<!-- Recent Purchase Popup end -->
<!-- Cart Floating Button -->

View File

@ -274,6 +274,35 @@ function productListVendor($vendorId)
return $json; // Add this line to return the decoded JSON data
}
function allProductListVendor($vendorId)
{
$curl = curl_init();
$url = "https://" . $_SESSION["data_endpoint"] . "/api/v1/products/vendor/" . $vendorId;
curl_setopt($curl, CURLOPT_URL, $url);
curl_setopt_array($curl, array(
//CURLOPT_URL => 'https://".$_SESSION["data_endpoint"]."/api/v1/products/vendor/6527b593f79b5deac5ad6cb8',
CURLOPT_RETURNTRANSFER => true,
CURLOPT_ENCODING => '',
CURLOPT_MAXREDIRS => 10,
CURLOPT_TIMEOUT => 0,
CURLOPT_FOLLOWLOCATION => true,
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
CURLOPT_CUSTOMREQUEST => 'GET',
CURLOPT_HTTPHEADER => array(
'X-Api-Key: {{apiKey}}'
),
));
$response = curl_exec($curl);
curl_close($curl);
$json = json_decode($response, true);
$products = array_filter($json, function ($var) {
return ($var['product_type'] == '' || $var['product_type'] == 'simple' || $var['product_type'] == 'variable' || $var['product_type'] == 'variation');
});
$products = array_values($products);
return $products;
return $json; // Add this line to return the decoded JSON data
}
function getProductVariations($parent_id)
{
$curl = curl_init();

View File

@ -288,7 +288,7 @@ if ($_SESSION["userId"] <> "") {
</a>
<!-- Header Cart End -->
<!-- Header Cart Start -->
<a href="#ec-side-cart" class="ec-header-btn ec-side-toggle">
<a href="cart.php" class="ec-header-btn ec-header-wishlist">
<div class="header-icon"><i class="fi-rr-shopping-bag"></i></div>
<span class="ec-header-count cart-count-lable">0</span>
</a>
@ -297,9 +297,9 @@ if ($_SESSION["userId"] <> "") {
<i class="fi fi-rr-apps"></i>
</a>
<!-- Header menu Start -->
<a href="#ec-mobile-menu" class="ec-header-btn ec-side-toggle d-lg-none">
<!-- <a href="#ec-mobile-menu" class="ec-header-btn ec-side-toggle d-lg-none">
<i class="fi fi-rr-menu-burger"></i>
</a>
</a> -->
<!-- Header menu End -->
</div>
</div>
@ -345,7 +345,7 @@ if ($_SESSION["userId"] <> "") {
?><?php
if ($_SESSION["isVendor"]) {
?>
<li><a class="dropdown-item" href="vendor-settings.php">My Account</a></li>
<li><a class="dropdown-item" href="vendor-dashboard.php">My Account</a></li>
<?php
} else {
?>

View File

@ -19,7 +19,7 @@
if ($result > 0) {
$_SESSION["isVendor"] = true;
}
header("location: index.php");
header("location: $url");
} else {
// $_SESSION["loginError"] = "Invalid email or password. Please try again.";
header("location: login.php?error=1");

View File

@ -213,8 +213,11 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
<div class="ec-pro-list-top d-flex">
<div class="col-md-6 ec-grid-list">
<div class="ec-gl-btn">
<button class="btn btn-grid"><i class="fi-rr-apps"></i></button>
<button class="btn btn-list active"><i class="fi-rr-list"></i></button>
<button class="btn btn-grid active"><i class="fi fi-rr-apps"></i></button>
<button class="btn btn-list"><i class="fi fi-rr-list"></i></button>
<!-- <button class="btn btn-grid active"><i class="fi-rr-apps"></i></button>
<button class="btn btn-list"><i class="fi-rr-list"></i></button> -->
</div>
</div>
<div class="col-md-6 ec-sort-select">
@ -321,7 +324,7 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
?>
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-6 mb-6 pro-gl-content width-100">
<div class="ec-product-inner">
<div class="ec-pro-image-outer" style="width: 290px; height: 200px;">
<div class="ec-pro-image-outer" style="max-width: 290px; height: 350px;">
<div class="ec-pro-image">
<a href="product-left-sidebar.php?id=<?php echo $product["_id"]; ?>">
<?php
@ -330,12 +333,12 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img style="width: 290px; height: 200px; object-fit: cover;" class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" />
<img style="border: 1px solid #eeeeee; height: 330px; object-fit: cover;" class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" />
<?php
}
} else {
?>
<img style="width: 290px; height: 200px; object-fit: cover;" class="hover-image" src="https://api.obanana.com/images/storage/web_images/1709002636671-viber_image_2024-02-22_15-54-42-498.png" alt="edit" />
<img style="border: 1px solid #eeeeee; height: 330px; object-fit: cover;" class="hover-image" src="https://api.obanana.com/images/storage/web_images/1709002636671-viber_image_2024-02-22_15-54-42-498.png" alt="edit" />
<?php
}
?>
@ -445,224 +448,227 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
</div>
<!-- Sidebar Area Start -->
<div class="ec-shop-leftside col-lg-3 order-lg-first col-md-12 order-md-last">
<div id="shop_sidebar">
<div class="ec-sidebar-heading">
<h1>Filter Products By</h1>
</div>
<div class="ec-sidebar-wrap">
<!-- Sidebar Category Block -->
<div class="ec-sidebar-block">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Category</h3>
</div>
<div class="ec-sb-block-content">
<form method="POST" action="shop-list-left-sidebar-action.php">
<div class="ec-sidebar-wrap ec-border-box">
<ul>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Electronics" <?php echo (isset($_POST['category']) && in_array('Electronics', $_POST['category'])) || (isset($_GET['category']) && in_array('Electronics', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Electronics</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Solar" <?php echo (isset($_POST['category']) && in_array('Solar', $_POST['category'])) || (isset($_GET['category']) && in_array('Solar', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Solar</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="E-bike" <?php echo (isset($_POST['category']) && in_array('E-bike', $_POST['category'])) || (isset($_GET['category']) && in_array('E-bike', $_GET['category'])) ? 'checked' : ''; ?> /> <a>E-bike</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="E-vehicle" <?php echo (isset($_POST['category']) && in_array('E-vehicle', $_POST['category'])) || (isset($_GET['category']) && in_array('E-vehicle', $_GET['category'])) ? 'checked' : ''; ?> /> <a>E-vehicle</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Appliance" <?php echo (isset($_POST['category']) && in_array('Appliance', $_POST['category'])) || (isset($_GET['category']) && in_array('Appliance', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Appliance</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Smart Home" <?php echo (isset($_POST['category']) && in_array('Smart Home', $_POST['category'])) || (isset($_GET['category']) && in_array('Smart Home', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Smart Home</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Home" <?php echo (isset($_POST['category']) && in_array('Home', $_POST['category'])) || (isset($_GET['category']) && in_array('Home', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Home</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Apparel" <?php echo (isset($_POST['category']) && in_array('Apparel', $_POST['category'])) || (isset($_GET['category']) && in_array('Apparel', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Apparel</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Heavy Equipment" <?php echo (isset($_POST['category']) && in_array('Heavy Equipment', $_POST['category'])) || (isset($_GET['category']) && in_array('Heavy Equipment', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Heavy Equipment</a><span class="checked"></span>
</div>
</li>
<li>
<div style="padding-top:10px;">
<label for="minPrice" style="margin-bottom:-5px;">Min Price:</label>
<input style="height:40px" type="number" name="minPrice" id="minPrice" value="<?php echo isset($_POST['minPrice']) ? $_POST['minPrice'] : (isset($_GET['minPrice']) ? $_GET['minPrice'] : ''); ?>" />
</div>
</li>
<li>
<div>
<label for="maxPrice" style="margin-bottom:-5px;">Max Price:</label>
<input style="height:40px" type="number" name="maxPrice" id="maxPrice" value="<?php echo isset($_POST['maxPrice']) ? $_POST['maxPrice'] : (isset($_GET['maxPrice']) ? $_GET['maxPrice'] : ''); ?>" />
</div>
</li>
<li>
<div style="padding-top:10px;">
<button style="font-size:12px; height:30px; width:60px;" class="btn-primary" type="submit">Apply</button>
</div>
</li>
</ul>
<!-- <button type="submit">Apply</button> -->
</form>
<!-- <form method="POST" action="<?php echo $_SERVER['PHP_SELF'] . '?' . http_build_query(array_merge($_GET, $_POST)); ?>">
<ul>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Electronics" <?php echo (isset($_POST['category']) && in_array('Electronics', $_POST['category'])) ? 'checked' : ''; ?> /> <a>Electronics</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Solar" <?php echo (isset($_POST['category']) && in_array('Solar', $_POST['category'])) ? 'checked' : ''; ?> /> <a>Solar</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="E-bike" <?php echo (isset($_POST['category']) && in_array('E-bike', $_POST['category'])) ? 'checked' : ''; ?> /> <a>E-bike</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="E-vehicle" <?php echo (isset($_POST['category']) && in_array('E-vehicle', $_POST['category'])) ? 'checked' : ''; ?> /> <a>E-vehicle</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Appliance" <?php echo (isset($_POST['category']) && in_array('Appliance', $_POST['category'])) ? 'checked' : ''; ?> /> <a>Appliance</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Smart Home" <?php echo (isset($_POST['category']) && in_array('Smart Home', $_POST['category'])) ? 'checked' : ''; ?> /> <a>Smart Home</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Home" <?php echo (isset($_POST['category']) && in_array('Home', $_POST['category'])) ? 'checked' : ''; ?> /> <a>Home</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Heavy Equipment" <?php echo (isset($_POST['category']) && in_array('Heavy Equipment', $_POST['category'])) ? 'checked' : ''; ?> /> <a>Heavy Equipment</a><span class="checked"></span>
</div>
</li>
<li>
<div>
<label for="minPrice">Min Price:</label>
<input type="number" name="minPrice" id="minPrice" value="<?php echo isset($_POST['minPrice']) ? $_POST['minPrice'] : (isset($_GET['minPrice']) ? $_GET['minPrice'] : ''); ?>" />
</div>
</li>
<li>
<div>
<label for="maxPrice">Max Price:</label>
<input type="number" name="maxPrice" id="maxPrice" value="<?php echo isset($_POST['maxPrice']) ? $_POST['maxPrice'] : (isset($_GET['maxPrice']) ? $_GET['maxPrice'] : ''); ?>" />
</div>
</li>
</ul>
<button type="submit">Apply</button>
</form> -->
</div>
<div id="shop_sidebar">
<div class="ec-sidebar-heading">
<h1>Filter Products By</h1>
</div>
<!-- 02-19-2024 Jun Jihad Search Filter -->
<!-- Sidebar Size Block -->
<!-- <div class="ec-sidebar-block">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Size</h3>
<div class="ec-sidebar-wrap">
<!-- Sidebar Category Block -->
<div class="ec-sidebar-block">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Category</h3>
</div>
<div class="ec-sb-block-content">
<form method="POST" action="shop-list-left-sidebar-action.php">
<ul>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Electronics" <?php echo (isset($_POST['category']) && in_array('Electronics', $_POST['category'])) || (isset($_GET['category']) && in_array('Electronics', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Electronics</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Solar" <?php echo (isset($_POST['category']) && in_array('Solar', $_POST['category'])) || (isset($_GET['category']) && in_array('Solar', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Solar</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="E-bike" <?php echo (isset($_POST['category']) && in_array('E-bike', $_POST['category'])) || (isset($_GET['category']) && in_array('E-bike', $_GET['category'])) ? 'checked' : ''; ?> /> <a>E-bike</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="E-vehicle" <?php echo (isset($_POST['category']) && in_array('E-vehicle', $_POST['category'])) || (isset($_GET['category']) && in_array('E-vehicle', $_GET['category'])) ? 'checked' : ''; ?> /> <a>E-vehicle</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Appliance" <?php echo (isset($_POST['category']) && in_array('Appliance', $_POST['category'])) || (isset($_GET['category']) && in_array('Appliance', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Appliance</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Smart Home" <?php echo (isset($_POST['category']) && in_array('Smart Home', $_POST['category'])) || (isset($_GET['category']) && in_array('Smart Home', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Smart Home</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Home" <?php echo (isset($_POST['category']) && in_array('Home', $_POST['category'])) || (isset($_GET['category']) && in_array('Home', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Home</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Apparel" <?php echo (isset($_POST['category']) && in_array('Apparel', $_POST['category'])) || (isset($_GET['category']) && in_array('Apparel', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Apparel</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Heavy Equipment" <?php echo (isset($_POST['category']) && in_array('Heavy Equipment', $_POST['category'])) || (isset($_GET['category']) && in_array('Heavy Equipment', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Heavy Equipment</a><span class="checked"></span>
</div>
</li>
<li>
<div style="padding-top:10px;">
<label for="minPrice" style="margin-bottom:-5px;">Min Price:</label>
<input style="height:40px" type="number" name="minPrice" id="minPrice" value="<?php echo isset($_POST['minPrice']) ? $_POST['minPrice'] : (isset($_GET['minPrice']) ? $_GET['minPrice'] : ''); ?>" />
</div>
</li>
<li>
<div>
<label for="maxPrice" style="margin-bottom:-5px;">Max Price:</label>
<input style="height:40px" type="number" name="maxPrice" id="maxPrice" value="<?php echo isset($_POST['maxPrice']) ? $_POST['maxPrice'] : (isset($_GET['maxPrice']) ? $_GET['maxPrice'] : ''); ?>" />
</div>
</li>
<li>
<div style="padding-top:10px;">
<button style="font-size:12px; height:30px; width:60px;" class="btn-primary" type="submit">Apply</button>
</div>
</li>
</ul>
<!-- <button type="submit">Apply</button> -->
</form>
<!-- <form method="POST" action="<?php echo $_SERVER['PHP_SELF'] . '?' . http_build_query(array_merge($_GET, $_POST)); ?>">
<ul>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Electronics" <?php echo (isset($_POST['category']) && in_array('Electronics', $_POST['category'])) ? 'checked' : ''; ?> /> <a>Electronics</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Solar" <?php echo (isset($_POST['category']) && in_array('Solar', $_POST['category'])) ? 'checked' : ''; ?> /> <a>Solar</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="E-bike" <?php echo (isset($_POST['category']) && in_array('E-bike', $_POST['category'])) ? 'checked' : ''; ?> /> <a>E-bike</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="E-vehicle" <?php echo (isset($_POST['category']) && in_array('E-vehicle', $_POST['category'])) ? 'checked' : ''; ?> /> <a>E-vehicle</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Appliance" <?php echo (isset($_POST['category']) && in_array('Appliance', $_POST['category'])) ? 'checked' : ''; ?> /> <a>Appliance</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Smart Home" <?php echo (isset($_POST['category']) && in_array('Smart Home', $_POST['category'])) ? 'checked' : ''; ?> /> <a>Smart Home</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Home" <?php echo (isset($_POST['category']) && in_array('Home', $_POST['category'])) ? 'checked' : ''; ?> /> <a>Home</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Heavy Equipment" <?php echo (isset($_POST['category']) && in_array('Heavy Equipment', $_POST['category'])) ? 'checked' : ''; ?> /> <a>Heavy Equipment</a><span class="checked"></span>
</div>
</li>
<li>
<div>
<label for="minPrice">Min Price:</label>
<input type="number" name="minPrice" id="minPrice" value="<?php echo isset($_POST['minPrice']) ? $_POST['minPrice'] : (isset($_GET['minPrice']) ? $_GET['minPrice'] : ''); ?>" />
</div>
</li>
<li>
<div>
<label for="maxPrice">Max Price:</label>
<input type="number" name="maxPrice" id="maxPrice" value="<?php echo isset($_POST['maxPrice']) ? $_POST['maxPrice'] : (isset($_GET['maxPrice']) ? $_GET['maxPrice'] : ''); ?>" />
</div>
</li>
</ul>
<button type="submit">Apply</button>
</form> -->
</div>
</div>
<div class="ec-sb-block-content">
<ul>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" value="" checked /><a href="#">S</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" value="" /><a href="#">M</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" value="" /> <a href="#">L</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" value="" /><a href="#">XL</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" value="" /><a href="#">XXL</a><span class="checked"></span>
</div>
</li>
</ul>
</div>
</div> -->
<!-- Sidebar Color item -->
<!-- <div class="ec-sidebar-block ec-sidebar-block-clr">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Color</h3>
</div>
<div class="ec-sb-block-content">
<ul>
<li>
<div class="ec-sidebar-block-item"><span style="background-color:#c4d6f9;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span style="background-color:#ff748b;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span style="background-color:#000000;"></span></div>
</li>
<li class="active">
<div class="ec-sidebar-block-item"><span style="background-color:#2bff4a;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span style="background-color:#ff7c5e;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span style="background-color:#f155ff;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span style="background-color:#ffef00;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span style="background-color:#c89fff;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span style="background-color:#7bfffa;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span style="background-color:#56ffc1;"></span></div>
</li>
</ul>
</div>
</div> -->
<!-- 02-19-2024 Jun Jihad Search Filter -->
<!-- Sidebar Size Block -->
<!-- <div class="ec-sidebar-block">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Size</h3>
</div>
<div class="ec-sb-block-content">
<ul>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" value="" checked /><a href="#">S</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" value="" /><a href="#">M</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" value="" /> <a href="#">L</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" value="" /><a href="#">XL</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" value="" /><a href="#">XXL</a><span class="checked"></span>
</div>
</li>
</ul>
</div>
</div> -->
<!-- Sidebar Color item -->
<!-- <div class="ec-sidebar-block ec-sidebar-block-clr">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Color</h3>
</div>
<div class="ec-sb-block-content">
<ul>
<li>
<div class="ec-sidebar-block-item"><span style="background-color:#c4d6f9;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span style="background-color:#ff748b;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span style="background-color:#000000;"></span></div>
</li>
<li class="active">
<div class="ec-sidebar-block-item"><span style="background-color:#2bff4a;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span style="background-color:#ff7c5e;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span style="background-color:#f155ff;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span style="background-color:#ffef00;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span style="background-color:#c89fff;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span style="background-color:#7bfffa;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span style="background-color:#56ffc1;"></span></div>
</li>
</ul>
</div>
</div> -->
</div>
</div>
</div>
</div>
@ -781,21 +787,22 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
</div>
<!-- Modal end -->
<!-- Footer navigation panel for responsive display -->
<div class="ec-nav-toolbar">
<div class="container">
<div class="ec-nav-panel">
<div class="ec-nav-panel-icons">
<a href="#ec-mobile-menu" class="navbar-toggler-btn ec-header-btn ec-side-toggle"><i class="fi-rr-menu-burger"></i></a>
<a href="javascript:void(0)" class="ec-header-btn ec-sidebar-toggle"><i class="fi fi-rr-apps"></i></a>
</div>
<div class="ec-nav-panel-icons">
<a href="#ec-side-cart" class="toggle-cart ec-header-btn ec-side-toggle"><i class="fi-rr-shopping-bag"></i><span class="ec-cart-noti ec-header-count cart-count-lable">3</span></a>
<a href="cart.php" class="toggle-cart ec-header-btn ec-side-toggle"><i class="fi-rr-shopping-bag"></i><!-- <span class="ec-cart-noti ec-header-count cart-count-lable"></span> --></a>
</div>
<div class="ec-nav-panel-icons">
<a href="index.php" class="ec-header-btn"><i class="fi-rr-home"></i></a>
</div>
<div class="ec-nav-panel-icons">
<a href="wishlist.html" class="ec-header-btn"><i class="fi-rr-heart"></i><span class="ec-cart-noti">4</span></a>
<a href="wishlist.php" class="ec-header-btn"><i class="fi-rr-heart"></i><!-- <span class="ec-cart-noti"></span> --></a>
</div>
<div class="ec-nav-panel-icons">
<a href="login.php" class="ec-header-btn"><i class="fi-rr-user"></i></a>

View File

@ -138,8 +138,8 @@ if ($_SESSION["userId"] <> "") {
<div class="ec-pro-list-top d-flex">
<div class="col-md-6 ec-grid-list">
<div class="ec-gl-btn">
<button class="btn btn-grid"><i class="fi-rr-apps"></i></button>
<button class="btn btn-list active"><i class="fi-rr-list"></i></button>
<button class="btn btn-grid active"><i class="fi fi-rr-apps"></i></button>
<button class="btn btn-list"><i class="fi fi-rr-list"></i></button>
</div>
</div>
<div class="col-md-6 ec-sort-select">
@ -156,6 +156,27 @@ if ($_SESSION["userId"] <> "") {
</div>
</div>
</div>
<!-- <div class="ec-pro-list-top d-flex">
<div class="col-md-6 ec-grid-list">
<div class="ec-gl-btn">
<button class="btn btn-grid"><i class="fi-rr-apps"></i></button>
<button class="btn btn-list ctive"><i class="fi-rr-list"></i></button>
</div>
</div>
<div class="col-md-6 ec-sort-select">
<span class="sort-by">Sort by</span>
<div class="ec-select-inner">
<select name="ec-select" id="ec-select">
<option selected disabled>Position</option>
<option value="1">Relevance</option>
<option value="2">Name, A to Z</option>
<option value="3">Name, Z to A</option>
<option value="4">Price, low to high</option>
<option value="5">Price, high to low</option>
</select>
</div>
</div>
</div> -->
<!-- Shop Top End -->
@ -359,248 +380,250 @@ if ($_SESSION["userId"] <> "") {
</div>
<!-- Sidebar Area Start -->
<div class="ec-shop-leftside col-lg-3 order-lg-first col-md-12 order-md-last">
<div id="shop_sidebar">
<div class="ec-sidebar-heading">
<h1>Filter Products By</h1>
</div>
<div class="ec-sidebar-wrap">
<!-- Sidebar Category Block -->
<div class="ec-sidebar-block">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Category</h3>
</div>
<div class="ec-sb-block-content">
<form method="POST" action="shop-list-left-sidebar-action.php">
<ul>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Electronics" <?php echo (isset($_POST['category']) && in_array('Electronics', $_POST['category'])) || (isset($_GET['category']) && in_array('Electronics', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Electronics</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Solar" <?php echo (isset($_POST['category']) && in_array('Solar', $_POST['category'])) || (isset($_GET['category']) && in_array('Solar', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Solar</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="E-bike" <?php echo (isset($_POST['category']) && in_array('E-bike', $_POST['category'])) || (isset($_GET['category']) && in_array('E-bike', $_GET['category'])) ? 'checked' : ''; ?> /> <a>E-bike</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="E-vehicle" <?php echo (isset($_POST['category']) && in_array('E-vehicle', $_POST['category'])) || (isset($_GET['category']) && in_array('E-vehicle', $_GET['category'])) ? 'checked' : ''; ?> /> <a>E-vehicle</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Appliance" <?php echo (isset($_POST['category']) && in_array('Appliance', $_POST['category'])) || (isset($_GET['category']) && in_array('Appliance', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Appliance</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Smart Home" <?php echo (isset($_POST['category']) && in_array('Smart Home', $_POST['category'])) || (isset($_GET['category']) && in_array('Smart Home', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Smart Home</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Home" <?php echo (isset($_POST['category']) && in_array('Home', $_POST['category'])) || (isset($_GET['category']) && in_array('Home', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Home</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Apparel" <?php echo (isset($_POST['category']) && in_array('Apparel', $_POST['category'])) || (isset($_GET['category']) && in_array('Apparel', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Apparel</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Heavy Equipment" <?php echo (isset($_POST['category']) && in_array('Heavy Equipment', $_POST['category'])) || (isset($_GET['category']) && in_array('Heavy Equipment', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Heavy Equipment</a><span class="checked"></span>
</div>
</li>
<li>
<div style="padding-top:10px;">
<label for="minPrice" style="margin-bottom:-5px;">Min Price:</label>
<input style="height:40px" type="number" name="minPrice" id="minPrice" value="<?php echo isset($_POST['minPrice']) ? $_POST['minPrice'] : (isset($_GET['minPrice']) ? $_GET['minPrice'] : ''); ?>" />
</div>
</li>
<li>
<div>
<label for="maxPrice" style="margin-bottom:-5px;">Max Price:</label>
<input style="height:40px" type="number" name="maxPrice" id="maxPrice" value="<?php echo isset($_POST['maxPrice']) ? $_POST['maxPrice'] : (isset($_GET['maxPrice']) ? $_GET['maxPrice'] : ''); ?>" />
</div>
</li>
<li>
<div style="padding-top:10px;">
<button style="font-size:12px; height:30px; width:60px;" class="btn-primary" type="submit">Apply</button>
</div>
</li>
</ul>
<!-- <button type="submit">Apply</button> -->
</form>
<!-- <ul>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" checked /> <a href="#">clothes</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" /> <a href="#">Bags</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" /> <a href="#">Shoes</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" /> <a href="#">cosmetics</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" /> <a href="#">electrics</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" /> <a href="#">phone</a><span class="checked"></span>
</div>
</li>
<li id="ec-more-toggle-content" style="padding: 0; display: none;">
<div class="ec-sidebar-wrap ec-border-box">
<div id="shop_sidebar">
<div class="ec-sidebar-heading">
<h1>Filter Products By</h1>
</div>
<div class="ec-sidebar-wrap">
<!-- Sidebar Category Block -->
<div class="ec-sidebar-block">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Category</h3>
</div>
<div class="ec-sb-block-content">
<form method="POST" action="shop-list-left-sidebar-action.php">
<ul>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" /> <a href="#">Watch</a><span class="checked"></span>
<input type="checkbox" name="category[]" value="Electronics" <?php echo (isset($_POST['category']) && in_array('Electronics', $_POST['category'])) || (isset($_GET['category']) && in_array('Electronics', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Electronics</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" /> <a href="#">Cap</a><span class="checked"></span>
<input type="checkbox" name="category[]" value="Solar" <?php echo (isset($_POST['category']) && in_array('Solar', $_POST['category'])) || (isset($_GET['category']) && in_array('Solar', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Solar</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="E-bike" <?php echo (isset($_POST['category']) && in_array('E-bike', $_POST['category'])) || (isset($_GET['category']) && in_array('E-bike', $_GET['category'])) ? 'checked' : ''; ?> /> <a>E-bike</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="E-vehicle" <?php echo (isset($_POST['category']) && in_array('E-vehicle', $_POST['category'])) || (isset($_GET['category']) && in_array('E-vehicle', $_GET['category'])) ? 'checked' : ''; ?> /> <a>E-vehicle</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Appliance" <?php echo (isset($_POST['category']) && in_array('Appliance', $_POST['category'])) || (isset($_GET['category']) && in_array('Appliance', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Appliance</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Smart Home" <?php echo (isset($_POST['category']) && in_array('Smart Home', $_POST['category'])) || (isset($_GET['category']) && in_array('Smart Home', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Smart Home</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Home" <?php echo (isset($_POST['category']) && in_array('Home', $_POST['category'])) || (isset($_GET['category']) && in_array('Home', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Home</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Apparel" <?php echo (isset($_POST['category']) && in_array('Apparel', $_POST['category'])) || (isset($_GET['category']) && in_array('Apparel', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Apparel</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" name="category[]" value="Heavy Equipment" <?php echo (isset($_POST['category']) && in_array('Heavy Equipment', $_POST['category'])) || (isset($_GET['category']) && in_array('Heavy Equipment', $_GET['category'])) ? 'checked' : ''; ?> /> <a>Heavy Equipment</a><span class="checked"></span>
</div>
</li>
<li>
<div style="padding-top:10px;">
<label for="minPrice" style="margin-bottom:-5px;">Min Price:</label>
<input style="height:40px" type="number" name="minPrice" id="minPrice" value="<?php echo isset($_POST['minPrice']) ? $_POST['minPrice'] : (isset($_GET['minPrice']) ? $_GET['minPrice'] : ''); ?>" />
</div>
</li>
<li>
<div>
<label for="maxPrice" style="margin-bottom:-5px;">Max Price:</label>
<input style="height:40px" type="number" name="maxPrice" id="maxPrice" value="<?php echo isset($_POST['maxPrice']) ? $_POST['maxPrice'] : (isset($_GET['maxPrice']) ? $_GET['maxPrice'] : ''); ?>" />
</div>
</li>
<li>
<div style="padding-top:10px;">
<button style="font-size:12px; height:30px; width:60px;" class="btn-primary" type="submit">Apply</button>
</div>
</li>
</ul>
</li>
<li>
<div class="ec-sidebar-block-item ec-more-toggle">
<span class="checked"></span><span id="ec-more-toggle">More
Categories</span>
</div>
</li>
<!-- <button type="submit">Apply</button> -->
</form>
<!-- <ul>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" checked /> <a href="#">clothes</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" /> <a href="#">Bags</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" /> <a href="#">Shoes</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" /> <a href="#">cosmetics</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" /> <a href="#">electrics</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" /> <a href="#">phone</a><span class="checked"></span>
</div>
</li>
<li id="ec-more-toggle-content" style="padding: 0; display: none;">
<ul>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" /> <a href="#">Watch</a><span class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" /> <a href="#">Cap</a><span class="checked"></span>
</div>
</li>
</ul>
</li>
<li>
<div class="ec-sidebar-block-item ec-more-toggle">
<span class="checked"></span><span id="ec-more-toggle">More
Categories</span>
</div>
</li>
</ul> -->
</div>
</div>
<!-- Sidebar Price Block -->
<!-- <div class="ec-sidebar-block">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Price</h3>
</div>
<div class="ec-sb-block-content es-price-slider">
<div class="ec-price-filter">
<div id="ec-sliderPrice" class="filter__slider-price" data-min="0" data-max="250" data-step="10"></div>
<div class="ec-price-input">
<label class="filter__label"><input type="text" class="filter__input"></label>
<span class="ec-price-divider"></span>
<label class="filter__label"><input type="text" class="filter__input"></label>
</div>
</ul> -->
</div>
</div>
</div> -->
<!-- Sidebar Size Block -->
<!-- <div class="ec-sidebar-block">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Size</h3>
</div>
<div class="ec-sb-block-content">
<ul>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" value="" checked /><a href="#">S</a><span
class="checked"></span>
<!-- Sidebar Price Block -->
<!-- <div class="ec-sidebar-block">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Price</h3>
</div>
<div class="ec-sb-block-content es-price-slider">
<div class="ec-price-filter">
<div id="ec-sliderPrice" class="filter__slider-price" data-min="0" data-max="250" data-step="10"></div>
<div class="ec-price-input">
<label class="filter__label"><input type="text" class="filter__input"></label>
<span class="ec-price-divider"></span>
<label class="filter__label"><input type="text" class="filter__input"></label>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" value="" /><a href="#">M</a><span
class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" value="" /> <a href="#">L</a><span
class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" value="" /><a href="#">XL</a><span
class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" value="" /><a href="#">XXL</a><span
class="checked"></span>
</div>
</li>
</ul>
</div>
</div> -->
<!-- Sidebar Color item -->
<!-- <div class="ec-sidebar-block ec-sidebar-block-clr">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Color</h3>
</div>
<div class="ec-sb-block-content">
<ul>
<li>
<div class="ec-sidebar-block-item"><span
style="background-color:#c4d6f9;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span
style="background-color:#ff748b;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span
style="background-color:#000000;"></span></div>
</li>
<li class="active">
<div class="ec-sidebar-block-item"><span
style="background-color:#2bff4a;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span
style="background-color:#ff7c5e;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span
style="background-color:#f155ff;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span
style="background-color:#ffef00;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span
style="background-color:#c89fff;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span
style="background-color:#7bfffa;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span
style="background-color:#56ffc1;"></span></div>
</li>
</ul>
</div>
</div> -->
</div>
</div>
</div> -->
<!-- Sidebar Size Block -->
<!-- <div class="ec-sidebar-block">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Size</h3>
</div>
<div class="ec-sb-block-content">
<ul>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" value="" checked /><a href="#">S</a><span
class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" value="" /><a href="#">M</a><span
class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" value="" /> <a href="#">L</a><span
class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" value="" /><a href="#">XL</a><span
class="checked"></span>
</div>
</li>
<li>
<div class="ec-sidebar-block-item">
<input type="checkbox" value="" /><a href="#">XXL</a><span
class="checked"></span>
</div>
</li>
</ul>
</div>
</div> -->
<!-- Sidebar Color item -->
<!-- <div class="ec-sidebar-block ec-sidebar-block-clr">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Color</h3>
</div>
<div class="ec-sb-block-content">
<ul>
<li>
<div class="ec-sidebar-block-item"><span
style="background-color:#c4d6f9;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span
style="background-color:#ff748b;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span
style="background-color:#000000;"></span></div>
</li>
<li class="active">
<div class="ec-sidebar-block-item"><span
style="background-color:#2bff4a;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span
style="background-color:#ff7c5e;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span
style="background-color:#f155ff;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span
style="background-color:#ffef00;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span
style="background-color:#c89fff;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span
style="background-color:#7bfffa;"></span></div>
</li>
<li>
<div class="ec-sidebar-block-item"><span
style="background-color:#56ffc1;"></span></div>
</li>
</ul>
</div>
</div> -->
</div>
</div>
</div>
</div>
@ -724,16 +747,16 @@ if ($_SESSION["userId"] <> "") {
<div class="container">
<div class="ec-nav-panel">
<div class="ec-nav-panel-icons">
<a href="#ec-mobile-menu" class="navbar-toggler-btn ec-header-btn ec-side-toggle"><i class="fi-rr-menu-burger"></i></a>
<a href="javascript:void(0)" class="ec-header-btn ec-sidebar-toggle"><i class="fi fi-rr-apps"></i></a>
</div>
<div class="ec-nav-panel-icons">
<a href="#ec-side-cart" class="toggle-cart ec-header-btn ec-side-toggle"><i class="fi-rr-shopping-bag"></i><span class="ec-cart-noti ec-header-count cart-count-lable">3</span></a>
<a href="cart.php" class="toggle-cart ec-header-btn ec-side-toggle"><i class="fi-rr-shopping-bag"></i><!-- <span class="ec-cart-noti ec-header-count cart-count-lable"></span> --></a>
</div>
<div class="ec-nav-panel-icons">
<a href="index.php" class="ec-header-btn"><i class="fi-rr-home"></i></a>
</div>
<div class="ec-nav-panel-icons">
<a href="wishlist.html" class="ec-header-btn"><i class="fi-rr-heart"></i><span class="ec-cart-noti">4</span></a>
<a href="wishlist.php" class="ec-header-btn"><i class="fi-rr-heart"></i><!-- <span class="ec-cart-noti"></span> --></a>
</div>
<div class="ec-nav-panel-icons">
<a href="login.php" class="ec-header-btn"><i class="fi-rr-user"></i></a>

View File

@ -7,6 +7,11 @@ if ($_SESSION["userId"] <> "") {
$customer_data = getCustomerbyLoginId($_SESSION["userId"]);
} else {
$_SESSION["isLoggedIn"] = false;
header("location: login.php");
}
if ($_SESSION["isVendor"] == true) {
header("location: vendor-dashboard.php");
}
?>
<!DOCTYPE html>
@ -323,7 +328,7 @@ if ($_SESSION["userId"] <> "") {
<div id="allOrders" class=" tab-content active">
<!-- Content for "all Orders" tab -->
<table class="table ec-table">
<thead>
<thead id="allOrdersTHead">
<tr class="Title">
<th scope="col">Image</th>
<th scope="col">Name</th>
@ -342,29 +347,21 @@ if ($_SESSION["userId"] <> "") {
$customer = $customer_data[0];
$orders = getOrderbyCustomerId($customer['_id']);
$totalAmount = 0;
$orderExist = false;
if ($orders) {
$order_data = json_decode($orders, true);
$_SESSION['cart_items'] = $order_data;
foreach ($order_data as $order) {
// Ensure that the required data is available before accessing it
if (isset($order['status']) && isset($order['items'][0]['product'])) {
if (isset($order['status']) && (strtoupper($order['status']) === 'TO PAY' || strtoupper($order['status']) === 'TO SHIP' || strtoupper($order['status']) === 'TO RECEIVE' || strtoupper($order['status']) === 'COMPLETED') && isset($order['items'][0]['product'])) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
<?php
$jsonorder = json_encode($order);
?>
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
<td>
<?php
// if (isset($order['items'][0]['product']['product_image'])) {
// echo '<img class="prod-img" src="' . $order['items'][0]['product']['product_image'] . '" alt="product"> ';
// } else {
// echo '<img class="prod-img" src="https://api.obanana.com/images/storage/web_images/1710214273217-no_image.png" alt="product">';
// }
?>
<img class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product">
</td>
<!-- <img class="prod-img" src="<?php # echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td> -->
<td><img class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
<td><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
@ -374,16 +371,31 @@ if ($_SESSION["userId"] <> "") {
<!-- <td><span class="tbl-btn"><a class="btn btn-lg btn-primary" href="#">View</a></span></td> -->
</tr>
<?php } else { ?>
<td> <img class="prod-img" src="https://api.obanana.com/images/storage/web_images/1710214273217-no_image.png" alt="product"> </td>
<?php
}
}
// if (empty($order['status'])) {
// echo '<tr><p style="padding-top:30px; padding-left:20px;">No Purchased Order/s Yet.</p></tr>';
// }
}
}
// } else if (empty($order['status'])) {
// echo '<p style="padding-top:30px; padding-left:20px;">No Purchased Order/s Yet.</p>';
// }
?>
</tbody>
<?php
if (!$orderExist) {
echo '<p style="padding-top:30px; padding-left:20px;">No Order/s Yet.</p>';
?>
<script>
allOrdersTHead.style.display = 'none';
</script>
<?php
}
?>
</table>
</div>
@ -391,7 +403,7 @@ if ($_SESSION["userId"] <> "") {
<div id="toPay" class="tab-content">
<!-- Content for "To Pay" tab -->
<table class="table ec-table">
<thead>
<thead id="toPayTHead">
<tr class="Title">
<th scope="col">Image</th>
<th scope="col">Name</th>
@ -410,12 +422,14 @@ if ($_SESSION["userId"] <> "") {
$customer = $customer_data[0];
$orders = getOrderbyCustomerId($customer['_id']);
$totalAmount = 0;
$orderExist = false;
if ($orders) {
$order_data = json_decode($orders, true);
$_SESSION['cart_items'] = $order_data;
foreach ($order_data as $order) {
// Ensure that the required data is available before accessing it
if (isset($order['status']) && (strtoupper($order['status']) === 'TO PAY') && isset($order['items'][0]['product'])) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
<?php
@ -439,6 +453,18 @@ if ($_SESSION["userId"] <> "") {
}
?>
</tbody>
<?php
if (!$orderExist) {
echo '<p style="padding-top:30px; padding-left:20px;">No To Pay Order/s Yet.</p>';
?>
<script>
toPayTHead.style.display = 'none';
</script>
<?php
}
?>
</table>
</div>
@ -446,7 +472,7 @@ if ($_SESSION["userId"] <> "") {
<div id="toShip" class="tab-content">
<!-- Content for "To Ship" tab -->
<table class="table ec-table">
<thead>
<thead id="toShipTHead">
<tr class="Title">
<th scope="col">Image</th>
<th scope="col">Name</th>
@ -467,12 +493,14 @@ if ($_SESSION["userId"] <> "") {
$customer = $customer_data[0];
$orders = getOrderbyCustomerId($customer['_id']);
$totalAmount = 0;
$orderExist = false;
if ($orders) {
$order_data = json_decode($orders, true);
$_SESSION['cart_items'] = $order_data;
foreach ($order_data as $order) {
// Ensure that the required data is available before accessing it
if (isset($order['status']) && (strtoupper($order['status']) === 'TO SHIP') && isset($order['items'][0]['product'])) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
<?php
@ -496,6 +524,18 @@ if ($_SESSION["userId"] <> "") {
}
?>
</tbody>
<?php
if (!$orderExist) {
echo '<p style="padding-top:30px; padding-left:20px;">No To Ship Order/s Yet.</p>';
?>
<script>
toShipTHead.style.display = 'none';
</script>
<?php
}
?>
</table>
</div>
@ -503,7 +543,7 @@ if ($_SESSION["userId"] <> "") {
<div id="toReceive" class="tab-content">
<!-- Content for "To Receive" tab -->
<table class="table ec-table">
<thead>
<thead id="toReceiveTHead">
<tr class="Title">
<th scope="col">Image</th>
<th scope="col">Name</th>
@ -523,12 +563,14 @@ if ($_SESSION["userId"] <> "") {
$customer = $customer_data[0];
$orders = getOrderbyCustomerId($customer['_id']);
$totalAmount = 0;
$orderExist = false;
if ($orders) {
$order_data = json_decode($orders, true);
$_SESSION['cart_items'] = $order_data;
foreach ($order_data as $order) {
// Ensure that the required data is available before accessing it
if (isset($order['status']) && (strtoupper($order['status']) === 'TO RECEIVE') && isset($order['items'][0]['product'])) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
<?php
@ -560,6 +602,18 @@ if ($_SESSION["userId"] <> "") {
}
?>
</tbody>
<?php
if (!$orderExist) {
echo '<p style="padding-top:30px; padding-left:20px;">No To Receive Order/s Yet.</p>';
?>
<script>
toReceiveTHead.style.display = 'none';
</script>
<?php
}
?>
</table>
</div>
@ -567,7 +621,7 @@ if ($_SESSION["userId"] <> "") {
<div id="completed" class="tab-content">
<!-- Content for "Completed" tab -->
<table class="table ec-table">
<thead>
<thead id="completedTHead">
<tr class="Title">
<th scope="col">Image</th>
<th scope="col">Name</th>
@ -587,12 +641,14 @@ if ($_SESSION["userId"] <> "") {
$customer = $customer_data[0];
$orders = getOrderbyCustomerId($customer['_id']);
$totalAmount = 0;
$orderExist = false;
if ($orders) {
$order_data = json_decode($orders, true);
$_SESSION['cart_items'] = $order_data;
foreach ($order_data as $order) {
// Ensure that the required data is available before accessing it
if (isset($order['status']) && (strtoupper($order['status']) === 'COMPLETED') && isset($order['items'][0]['product'])) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
@ -831,6 +887,18 @@ if ($_SESSION["userId"] <> "") {
}
?>
</tbody>
<?php
if (!$orderExist) {
echo '<p style="padding-top:30px; padding-left:20px;">No Completed Order/s Yet.</p>';
?>
<script>
completedTHead.style.display = 'none';
</script>
<?php
}
?>
</table>
</div>

View File

@ -9,7 +9,14 @@ if ($_SESSION["userId"] <> "") {
$customer_data = getCustomerbyLoginId($_SESSION["userId"]);
} else {
$_SESSION["isLoggedIn"] = false;
header("location: login.php");
}
if ($_SESSION["isVendor"] == true) {
header("location: vendor-dashboard.php");
}
?>
<!DOCTYPE html>
<html lang="en">
@ -513,7 +520,7 @@ if ($_SESSION["userId"] <> "") {
})
.then(response => {
if (response.ok) {
location.reload();
// location.reload();
// filter the delete action
document.getElementById('form-check-' + addressIndex).remove();
} else {

View File

@ -9,7 +9,14 @@ if ($_SESSION["userId"] <> "") {
$customer_data = getCustomerbyLoginId($_SESSION["userId"]);
} else {
$_SESSION["isLoggedIn"] = false;
header("location: login.php");
}
if ($_SESSION["isVendor"] == true) {
header("location: vendor-dashboard.php");
}
?>
<!DOCTYPE html>
<html lang="en">
@ -338,7 +345,7 @@ if ($_SESSION["userId"] <> "") {
<div id="allRefunds" class="tab-content active">
<!-- Content for "all Orders" tab -->
<table class="table ec-table">
<thead>
<thead id="allRefundsTHead">
<tr class="Title">
<th scope="col">Image</th>
<th scope="col">Name</th>
@ -359,6 +366,7 @@ if ($_SESSION["userId"] <> "") {
$customer = $customer_data[0];
$orders = getOrderbyCustomerId($customer['_id']);
$totalAmount = 0;
$orderExist = false;
if ($orders) {
$order_data = json_decode($orders, true);
$_SESSION['cart_items'] = $order_data;
@ -367,6 +375,7 @@ if ($_SESSION["userId"] <> "") {
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO APPROVE') || (strtoupper($order['return_order']['status']) === 'TO SHIP')
|| (strtoupper($order['return_order']['status']) === 'TO RECEIVE') || (strtoupper($order['return_order']['status']) === 'TO REFUND')
|| (strtoupper($order['return_order']['status']) === 'RETURN COMPLETE') && isset($order['items'][0]['product'])) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
<?php
@ -392,6 +401,18 @@ if ($_SESSION["userId"] <> "") {
}
?>
</tbody>
<?php
if (!$orderExist) {
echo '<p style="padding-top:30px; padding-left:20px;">No Refund/s Yet.</p>';
?>
<script>
allRefundsTHead.style.display = 'none';
</script>
<?php
}
?>
</table>
</div>
@ -399,7 +420,7 @@ if ($_SESSION["userId"] <> "") {
<div id="toApprove" class="tab-content">
<!-- Content for "To Approve" tab -->
<table class="table ec-table">
<thead>
<thead id="toApproveTHead">
<tr class="Title">
<th scope="col">Image</th>
<th scope="col">Name</th>
@ -420,12 +441,14 @@ if ($_SESSION["userId"] <> "") {
$customer = $customer_data[0];
$orders = getOrderbyCustomerId($customer['_id']);
$totalAmount = 0;
$orderExist = false;
if ($orders) {
$order_data = json_decode($orders, true);
$_SESSION['cart_items'] = $order_data;
foreach ($order_data as $order) {
// Ensure that the required data is available before accessing it
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO APPROVE') && isset($order['items'][0]['product'])) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
<?php
@ -451,6 +474,18 @@ if ($_SESSION["userId"] <> "") {
}
?>
</tbody>
<?php
if (!$orderExist) {
echo '<p style="padding-top:30px; padding-left:20px;">No To Approve Refund/s Yet.</p>';
?>
<script>
toApproveTHead.style.display = 'none';
</script>
<?php
}
?>
</table>
</div>
@ -458,7 +493,7 @@ if ($_SESSION["userId"] <> "") {
<div id="toShip" class="tab-content">
<!-- Content for "To Ship" tab -->
<table class="table ec-table">
<thead>
<thead id="toShipTHead">
<tr class="Title">
<th scope="col">Image</th>
<th scope="col">Name</th>
@ -479,12 +514,14 @@ if ($_SESSION["userId"] <> "") {
$customer = $customer_data[0];
$orders = getOrderbyCustomerId($customer['_id']);
$totalAmount = 0;
$orderExist = false;
if ($orders) {
$order_data = json_decode($orders, true);
$_SESSION['cart_items'] = $order_data;
foreach ($order_data as $order) {
// Ensure that the required data is available before accessing it
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO SHIP') && isset($order['items'][0]['product'])) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
<?php
@ -510,6 +547,18 @@ if ($_SESSION["userId"] <> "") {
}
?>
</tbody>
<?php
if (!$orderExist) {
echo '<p style="padding-top:30px; padding-left:20px;">No To Ship Refund/s Yet.</p>';
?>
<script>
toShipTHead.style.display = 'none';
</script>
<?php
}
?>
</table>
</div>
@ -517,7 +566,7 @@ if ($_SESSION["userId"] <> "") {
<div id="toReceive" class="tab-content">
<!-- Content for "To Receive" tab -->
<table class="table ec-table">
<thead>
<thead id="toReceiveTHead">
<tr class="Title">
<th scope="col">Image</th>
<th scope="col">Name</th>
@ -538,12 +587,14 @@ if ($_SESSION["userId"] <> "") {
$customer = $customer_data[0];
$orders = getOrderbyCustomerId($customer['_id']);
$totalAmount = 0;
$orderExist = false;
if ($orders) {
$order_data = json_decode($orders, true);
$_SESSION['cart_items'] = $order_data;
foreach ($order_data as $order) {
// Ensure that the required data is available before accessing it
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO RECEIVE') && isset($order['items'][0]['product'])) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
<?php
@ -572,6 +623,18 @@ if ($_SESSION["userId"] <> "") {
}
?>
</tbody>
<?php
if (!$orderExist) {
echo '<p style="padding-top:30px; padding-left:20px;">No To Receive Refund/s Yet.</p>';
?>
<script>
toReceiveTHead.style.display = 'none';
</script>
<?php
}
?>
</table>
</div>
@ -579,7 +642,7 @@ if ($_SESSION["userId"] <> "") {
<div id="toRefund" class="tab-content">
<!-- Content for "To Refund" tab -->
<table class="table ec-table">
<thead>
<thead id="toRefundTHead">
<tr class="Title">
<th scope="col">Image</th>
<th scope="col">Name</th>
@ -600,12 +663,14 @@ if ($_SESSION["userId"] <> "") {
$customer = $customer_data[0];
$orders = getOrderbyCustomerId($customer['_id']);
$totalAmount = 0;
$orderExist = false;
if ($orders) {
$order_data = json_decode($orders, true);
$_SESSION['cart_items'] = $order_data;
foreach ($order_data as $order) {
// Ensure that the required data is available before accessing it
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO REFUND') && isset($order['items'][0]['product'])) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
<?php
@ -634,6 +699,18 @@ if ($_SESSION["userId"] <> "") {
}
?>
</tbody>
<?php
if (!$orderExist) {
echo '<p style="padding-top:30px; padding-left:20px;">No To Refund/s Yet.</p>';
?>
<script>
toRefundTHead.style.display = 'none';
</script>
<?php
}
?>
</table>
</div>
@ -641,7 +718,7 @@ if ($_SESSION["userId"] <> "") {
<div id="returnComplete" class="tab-content">
<!-- Content for "Return Complete" tab -->
<table class="table ec-table">
<thead>
<thead id="returnCompleteTHead">
<tr class="Title">
<th scope="col">Image</th>
<th scope="col">Name</th>
@ -661,12 +738,14 @@ if ($_SESSION["userId"] <> "") {
$customer = $customer_data[0];
$orders = getOrderbyCustomerId($customer['_id']);
$totalAmount = 0;
$orderExist = false;
if ($orders) {
$order_data = json_decode($orders, true);
$_SESSION['cart_items'] = $order_data;
foreach ($order_data as $order) {
// Ensure that the required data is available before accessing it
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'RETURN COMPLETE') && isset($order['items'][0]['product'])) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
<?php
@ -831,6 +910,18 @@ if ($_SESSION["userId"] <> "") {
}
?>
</tbody>
<?php
if (!$orderExist) {
echo '<p style="padding-top:30px; padding-left:20px;">No Completed Refund/s Yet.</p>';
?>
<script>
returnCompleteTHead.style.display = 'none';
</script>
<?php
}
?>
</table>
</div>

View File

@ -202,7 +202,7 @@ $products = productList();
</thead>
<tbody>
<?php
$products = productListVendor($vendorId);
$products = allProductListVendor($vendorId);
$totalProducts = count($products);
// 03-11-2024 Stacy added for products pagination
$productsPerPage = 10;

View File

@ -28,6 +28,11 @@ if (is_array($vendorOrderss)) {
echo "Unknown type or no 'message' property found.";
}
if ($_SESSION["isCustomer"] == true) {
header("location: user-profile.php");
}
?>
<!--=========================================================
Item Name: oBanana B2B - Elevate Your Business
@ -265,7 +270,7 @@ if (is_array($vendorOrderss)) {
}
?> -->
</td>
<td><span><?php echo $item['product']['name']; ?></span></td>
<td style="max-width:300px;"><span class="text-truncate"><?php echo $item['product']['name']; ?></span></td>
<td><span><?php echo $orderItems['status']; ?></span></td>
<td><span><?php echo $orderItems['shipping_address']['shipping_first_name']; ?></span></td>
<td><span><?php echo $orderItems['total_amount']; ?></span></td>
@ -463,7 +468,7 @@ if (is_array($vendorOrderss)) {
}
?> -->
</td>
<td><span><?php echo $product['product_name']; ?></span></td>
<td style="max-width:300px;"><span class="text-truncate"><?php echo $product['product_name']; ?></span></td>
<td><span><?php echo $product['regular_price']; ?></span></td>
<td><span><?php echo $product['sale_price']; ?></span></td>
<td><span><?php echo $product['minimum_order']; ?></span></td>

View File

@ -30,6 +30,11 @@ if (is_array($vendorDecode)) {
} else {
echo "Unknown type or no 'message' property found.";
}
if ($_SESSION["isCustomer"] == true) {
header("location: user-profile.php");
}
?>
<!DOCTYPE html>
<html lang="en">
@ -81,6 +86,7 @@ if (is_array($vendorDecode)) {
padding: 0;
margin: 0;
justify-content: center;
margin-top: 20px;
}
#pagination a {
@ -479,6 +485,7 @@ if (is_array($vendorDecode)) {
},
success: function(response) {
// Handle successful response
console.log(response);
var paymentId = response.payment.reference_number;
$('#paymentIdSpan').text(paymentId);
var gross_price = response.payment.details[0]?.attributes.data.attributes.amount;

View File

@ -8,7 +8,26 @@ if ($_SESSION["userId"] <> "") {
header("location: login.php");
}
// $customer_data = getCustomerbyLoginId($_SESSION["userId"]);
if (isset($_SESSION["token"])) {
$token = $_SESSION["token"];
$token_parts = explode(".", $token);
$token_payload = base64_decode($token_parts[1]);
$token_data = json_decode($token_payload);
$issued_at_time = $token_data->iat;
$expiration_time = $token_data->exp;
$renewal_time = $issued_at_time + 3300;
if (time() >= $renewal_time || time() >= $expiration_time) {
header("Location:vendor-payoutsTokenRN.php");
exit;
}
}
if ($_SESSION["isCustomer"] == true) {
header("location: user-profile.php");
}
$vendorLoginId = searchVendorbyLoginId($_SESSION["userId"]);
$vendorLoginIdjson = json_decode($vendorLoginId, true);
if (isset($vendorLoginIdjson['results'][0])) {
@ -17,24 +36,8 @@ if (isset($vendorLoginIdjson['results'][0])) {
$_SESSION["LoggedInVendorId"] = $vendorId;
}
$token = $_SESSION["token"];
$token_parts = explode(".", $token);
$token_payload = base64_decode($token_parts[1]);
$token_data = json_decode($token_payload);
$expiration_time = $token_data->exp;
$issued_at_time = $token_data->iat;
$renewal_time = $issued_at_time + 3300;
if (time() >= $renewal_time) {
$token = loginRenew($_SESSION["email"], $_SESSION["password"], $token);
$_SESSION["token"] = $token;
}
$authToken = $_SESSION['token'];
$response = getAllPayout($authToken);
$vendorPayoutData = json_decode($response, true);
@ -81,23 +84,6 @@ $vendorPayoutData = json_decode($response, true);
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@latest/dist/css/select2.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script src="https://cdn.jsdelivr.net/npm/select2@latest/dist/js/select2.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
<style>
#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;
}
</style>
</head>
<body class="shop_page">
@ -155,19 +141,6 @@ $vendorPayoutData = json_decode($response, true);
<!-- Sidebar Category Block -->
<div class="ec-sidebar-block">
<div class="ec-vendor-block">
<!-- <div class="ec-vendor-block-items">
<ul>
<li><a href="vendor-dashboard.php">Dashboard</a></li>
<li><a href="vendor-profile.html">Public Profile</a></li>
<li><a href="vendor-uploads.html">Uploads</a></li>
<li><a href="vendor-uploads.php">Uploads</a></li>
<li><a href="#">Track Shipping</a></li>
<li><a href="vendor-settings.php">Settings (Edit)</a></li>
<li><a href="vendor-dashboard.php">Dashboard</a></li>
<li><a href="vendor-uploads-add-product-action.php">Upload Product</a></li>
<li><a href="vendor-settings.php">Settings (Edit)</a></li>
</ul>
</div> -->
<?php include "vendor-user-tabs.php" ?>
</div>
</div>
@ -269,12 +242,12 @@ $vendorPayoutData = json_decode($response, true);
</strong>
</div>
</h4>
<div class="text-sm mt-3">
<!-- <div class="text-sm mt-3">
Payout Generation: Tue, Mar 25, 2024
</div>
<div class="text-sm">
Receive Payout on or before: Wed, Mar 26, 2024
</div>
</div> -->
<div class="text-sm">
Receipient: Philippine National Bank (PNB) Account ending in <?php echo $bankNumEnding?>
</div>
@ -324,10 +297,7 @@ $vendorPayoutData = json_decode($response, true);
<td> <?php echo $payoutDate ?> </td>
<td> <?php echo $status ?> </td>
<td>
<button type="button" class="btn btn-primary showSinglePayoutBtn" data-order-id="<?php echo $payoutId; ?>" data-bs-toggle="modal" data-bs-target="#payoutsModal">View</button>
<!-- <button type="button" class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#payoutModal">
Details
</button> -->
<button type="button" class="btn btn-primary btn-sm showSinglePayoutBtn" data-order-id="<?php echo $payoutId; ?>" data-bs-toggle="modal" data-bs-target="#payoutsModal">View</button>
</td>
</tr>
<?php
@ -336,7 +306,6 @@ $vendorPayoutData = json_decode($response, true);
</tbody>
</table>
</div>
<div id='pagination'></div>
</div>
</div>
</div>
@ -379,14 +348,14 @@ $vendorPayoutData = json_decode($response, true);
<!-- raymart remove popup feb 20 2024 -->
<!-- Recent Purchase Popup -->
<!-- <div class=" recent-purchase">
<img src="assets/images/product-image/1.jpg" alt="payment image">
<div class="detail">
<p>Someone in new just bought</p>
<h6>stylish baby shoes</h6>
<p>10 Minutes ago</p>
</div>
<a href="javascript:void(0)" class="icon-btn recent-close">×</a>
</div> -->
<img src="assets/images/product-image/1.jpg" alt="payment image">
<div class="detail">
<p>Someone in new just bought</p>
<h6>stylish baby shoes</h6>
<p>10 Minutes ago</p>
</div>
<a href="javascript:void(0)" class="icon-btn recent-close">×</a>
</div> -->
<!-- Recent Purchase Popup end -->
<!-- Cart Floating Button -->
@ -637,30 +606,25 @@ $vendorPayoutData = json_decode($response, true);
var bankNumEnding = bankNum.slice(-3); // Extract last three characters of bankNum
var maskedBankNum = "Ending in " + bankNumEnding; // Create message
var bankAccName = response.bank_information[0].bank_account_name;
// var paymentType = response.transaction_logs[0].Type;
// // var transDate = response.transaction_logs[0].Transaction + " " + date;
// // var transGrossAmt = response.transaction_logs[0].Gross + " " + amount;
// var transFee = response.transaction_logs[0].Fee;
// // var transNetAmt = response.transaction_logs[0].Net + " " + amount;
// var transDesc = response.transaction_logs[0].Description;
var transactionLogsHtml = ''; // Initialize empty string to store HTML for transaction logs
// Inside the success callback function
var transactionLogsHtml = ''; // Initialize empty string to store HTML for transaction logs
response.transaction_logs.forEach(function(log) {
var paymentType = log.Type; // Assuming Transaction field holds the date
var grossAmount = log.Gross; // Assuming Gross field holds the gross amount
response.transaction_logs.forEach(function(log)
{
var paymentType = log.Type;
var transDate = log?.Transaction_date;
var transGrossAmount = log?.Gross_Amount;
var transFee = log.Fee;
var netAmount = log.Net;
var transNetAmount = log?.Net_Amount;
var transDesc = log.Description;
// Append HTML for current transaction log to the transactionLogsHtml string
transactionLogsHtml += `
<tr>
<td>${paymentType}</td>
<td>Wala Muna</td>
<td> Wala muna</td>
<td>${transDate}</td>
<td> ${transGrossAmount}</td>
<td>- ${transFee}</td>
<td> Wala Muna</td>
<td> ${transNetAmount}</td>
<td>${transDesc}</td>
</tr>`;
});

11
vendor-payoutsTokenRN.php Normal file
View File

@ -0,0 +1,11 @@
<?php
include "functions.php";
$token = loginRenew($_SESSION["email"], $_SESSION["password"], $_SESSION["token"]);
$_SESSION["token"] = $token;
header("Location: vendor-payouts.php");
exit;
?>

View File

@ -27,6 +27,11 @@ if (is_array($vendorOrderss)) {
} else {
echo "Unknown type or no 'message' property found.";
}
if ($_SESSION["isCustomer"] == true) {
header("location: user-profile.php");
}
?>
<!DOCTYPE html>
<html lang="en">
@ -311,11 +316,12 @@ if (is_array($vendorOrderss)) {
<div class="tab" data-tab-name="returnComplete" onclick="showTab('returnComplete')">Return Complete</div>
</div> -->
<!-- 03-26-2024 Stacy added tab for all orders -->
<!-- Content for "All Refunds" tab -->
<div id="allRefunds" class="tab-content active">
<!-- Content for "All Refunds" tab -->
<table class="table ec-table">
<thead>
<thead id="allRefundTHead">
<tr class="Title">
<th scope="col">Image</th>
<th scope="col">Name</th>
@ -335,11 +341,13 @@ if (is_array($vendorOrderss)) {
$order = $vendorOrders;
$orderArray = json_encode($order, true);
$orderItems = json_decode($orderArray, true);
$orderExist = false; //for checking if order exist
foreach ($orderItems as $order) {
// Ensure that the required data is available before accessing it
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO APPROVE') || (strtoupper($order['return_order']['status']) === 'TO SHIP')
|| (strtoupper($order['return_order']['status']) === 'TO RECEIVE') || (strtoupper($order['return_order']['status']) === 'TO REFUND')
|| (strtoupper($order['return_order']['status']) === 'RETURN COMPLETE') && isset($order['items'][0]['product'])) {
$orderExist = true; //if there's an order, orderExist will be set to true
$totalAmount += $order['total_amount'];
?>
<?php
@ -361,16 +369,28 @@ if (is_array($vendorOrderss)) {
<?php
}
}
?>
</tbody>
<?php
if (!$orderExist) {
echo '<p style="padding-top:30px; padding-left:20px;">No Refund/s Yet.</p>';
?>
<script>
allRefundTHead.style.display = 'none';
</script>
<?php
}
?>
</table>
</div>
<div id="toApprove" class="tab-content active">
<!-- Content for "To Approve" tab -->
<!-- Content for "To Approve" tab -->
<div id="toApprove" class="tab-content">
<table class="table ec-table">
<thead>
<thead id="toApproveTHead">
<tr class="Title">
<th scope="col">Image</th>
<th scope="col">Name</th>
@ -390,9 +410,11 @@ if (is_array($vendorOrderss)) {
$order = $vendorOrders;
$orderArray = json_encode($order, true);
$orderItems = json_decode($orderArray, true);
$orderExist = false;
foreach ($orderItems as $order) {
// Ensure that the required data is available before accessing it
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO APPROVE') && isset($order['items'][0]['product'])) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
<?php
@ -418,16 +440,28 @@ if (is_array($vendorOrderss)) {
<?php
}
}
?>
</tbody>
<?php
if (!$orderExist) {
echo '<p style="padding-top:30px; padding-left:20px;">No To Approve Refund/s Yet.</p>';
?>
<script>
toApproveTHead.style.display = 'none';
</script>
<?php
}
?>
</table>
</div>
<!-- Content for "To Ship" tab -->
<div id="toShip" class="tab-content">
<!-- Content for "To Ship" tab -->
<table class="table ec-table">
<thead>
<thead id="toShipTHead">
<tr class="Title">
<th scope="col">Image</th>
<th scope="col">Name</th>
@ -447,9 +481,11 @@ if (is_array($vendorOrderss)) {
$order = $vendorOrders;
$orderArray = json_encode($order, true);
$orderItems = json_decode($orderArray, true);
$orderExist = false;
foreach ($orderItems as $order) {
// Ensure that the required data is available before accessing it
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO SHIP') && isset($order['items'][0]['product'])) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
<?php
@ -471,16 +507,28 @@ if (is_array($vendorOrderss)) {
<?php
}
}
?>
</tbody>
<?php
if (!$orderExist) {
echo '<p style="padding-top:30px; padding-left:20px;">No To Ship Refund/s Yet.</p>';
?>
<script>
toShipTHead.style.display = 'none';
</script>
<?php
}
?>
</table>
</div>
<!-- Content for "To Receive" tab -->
<div id="toReceive" class="tab-content">
<!-- Content for "To Receive" tab -->
<table class="table ec-table">
<thead>
<thead id="toReceiveTHead">
<tr class="Title">
<th scope="col">Image</th>
<th scope="col">Name</th>
@ -499,9 +547,11 @@ if (is_array($vendorOrderss)) {
$order = $vendorOrders;
$orderArray = json_encode($order, true);
$orderItems = json_decode($orderArray, true);
$orderExist = false;
foreach ($orderItems as $order) {
// Ensure that the required data is available before accessing it
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO RECEIVE') && isset($order['items'][0]['product'])) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
<?php
@ -528,13 +578,26 @@ if (is_array($vendorOrderss)) {
}
?>
</tbody>
<?php
if (!$orderExist) {
echo '<p style="padding-top:30px; padding-left:20px;">No To Receive Refund/s Yet.</p>';
?>
<script>
toReceiveTHead.style.display = 'none';
</script>
<?php
}
?>
</table>
</div>
<!-- Content for "To Refund" tab -->
<div id="toRefund" class="tab-content">
<!-- Content for "To Refund" tab -->
<table class="table ec-table">
<thead>
<thead id="toRefundTHead">
<tr class="Title">
<th scope="col">Image</th>
<th scope="col">Name</th>
@ -553,9 +616,11 @@ if (is_array($vendorOrderss)) {
$order = $vendorOrders;
$orderArray = json_encode($order, true);
$orderItems = json_decode($orderArray, true);
$orderExist = false;
foreach ($orderItems as $order) {
// Ensure that the required data is available before accessing it
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO REFUND') && isset($order['items'][0]['product'])) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
<?php
@ -580,16 +645,28 @@ if (is_array($vendorOrderss)) {
<?php
}
}
?>
</tbody>
<?php
if (!$orderExist) {
echo '<p style="padding-top:30px; padding-left:20px;">No To Refund/s Yet.</p>';
?>
<script>
toRefundTHead.style.display = 'none';
</script>
<?php
}
?>
</table>
</div>
<!-- Content for "Return Complete" tab -->
<div id="returnComplete" class="tab-content">
<!-- Content for "Return Complete" tab -->
<table class="table ec-table">
<thead>
<thead id="returnCompleteTHead">
<tr class="Title">
<th scope="col">Image</th>
<th scope="col">Name</th>
@ -608,9 +685,11 @@ if (is_array($vendorOrderss)) {
$order = $vendorOrders;
$orderArray = json_encode($order, true);
$orderItems = json_decode($orderArray, true);
$orderExist = false;
foreach ($orderItems as $order) {
// Ensure that the required data is available before accessing it
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'RETURN COMPLETE') && isset($order['items'][0]['product'])) {
$orderExist = true;
$totalAmount += $order['total_amount'];
?>
<?php
@ -771,9 +850,20 @@ if (is_array($vendorOrderss)) {
<?php
}
}
?>
</tbody>
<?php
if (!$orderExist) {
echo '<p style="padding-top:30px; padding-left:20px;">No Refund/s Complete Yet.</p>';
?>
<script>
returnCompleteTHead.style.display = 'none';
</script>
<?php
}
?>
</table>
</div>

View File

@ -21,6 +21,12 @@ if ($_SESSION["userId"] <> "") {
$_SESSION["isLoggedIn"] = false;
header("location: login.php");
}
if ($_SESSION["isCustomer"] == true) {
header("location: user-profile.php");
}
?>
<!DOCTYPE html>
<html lang="en">
@ -316,7 +322,7 @@ if ($_SESSION["userId"] <> "") {
</label>
</div>
<div class="selectWrap" style="display: flex; justify-content: center; align-items: center; width: 50%; margin-left:-20px;">
<div class="selectWrap" style="display: flex; justify-content: center; align-items: center; width: 50%;">
<input type="radio" style="padding-left: 0px !important; margin: 0px 0px !important;" name="selectedShippingAddress[<?php echo $vendor_index; ?>]" id="shipping_address_<?php echo $vendor_index; ?>_<?php echo $address_index; ?>" value="<?php echo $vendor_index; ?>_<?php echo $address_index; ?>" class="form-check-input" onchange="updateAddressShipping('<?php echo $vendor['_id']; ?>', <?php echo $address_index; ?>, true)" <?php echo $address["shipping"] ? 'checked' : ''; ?>>
<label class="form-check-label" style="margin: 0px 10px !important;" for="shipping_address_<?php echo $vendor_index; ?>_<?php echo $address_index; ?>">
Shipping Address
@ -524,17 +530,19 @@ if ($_SESSION["userId"] <> "") {
<div class="card-body">
<div class="container">
<div class="row">
<div class="col-md-12 mx-auto">
<label class="form-check-label" for="address_<?php echo $vendor_index; ?>_<?php echo $bank_index; ?>">
<strong style="font-weight: bold;">Bank Name: </strong><?php echo $bank['bank_name']; ?> <br>
<strong style="font-weight: bold;">Bank Account Number: </strong><?php echo $bank['bank_account_number']; ?> <br>
<strong style="font-weight: bold;">Bank Account Name: </strong><?php echo $bank['bank_account_name']; ?>
<div class="selectWrap" style="display: flex; justify-content: center; align-items: center; width: 50%;">
<input type="radio" name="payout_bank" id="payout_bank_<?php echo $vendor_index; ?>_<?php echo $bank_index; ?>" value="<?php echo $vendor_index; ?>_<?php echo $bank_index; ?>" onchange="setPayoutBank('<?php echo $vendor['_id']; ?>', <?php echo $bank_index; ?>, true)" <?php echo $bank['bank_payout'] ? 'checked' : ''; ?>>
<label for="payout_bank_<?php echo $vendor_index; ?>_<?php echo $bank_index; ?>">Set as Payout Bank</label>
</div>
</label>
</div>
<div class="col-md-12 mx-auto">
<div class="form-check" style="display: flex; align-items: center;">
<label class="form-check-label" for="address_<?php echo $vendor_index; ?>_<?php echo $bank_index; ?>">
<strong style="font-weight: bold;">Bank Name: </strong><?php echo $bank['bank_name']; ?> <br>
<strong style="font-weight: bold;">Bank Account Number: </strong><?php echo $bank['bank_account_number']; ?> <br>
<strong style="font-weight: bold;">Bank Account Name: </strong><?php echo $bank['bank_account_name']; ?>
</label>
<div class="selectWrap" style="margin-left: auto; display: flex; align-items: center;">
<input type="radio" style="height:15px !important; width: 15px !important;" name="payout_bank" id="payout_bank_<?php echo $vendor_index; ?>_<?php echo $bank_index; ?>" value="<?php echo $vendor_index; ?>_<?php echo $bank_index; ?>" onchange="setPayoutBank('<?php echo $vendor['_id']; ?>', <?php echo $bank_index; ?>, true)" <?php echo $bank['bank_payout'] ? 'checked' : ''; ?>>
<label for="payout_bank_<?php echo $vendor_index; ?>_<?php echo $bank_index; ?>" style="margin-bottom: 0; margin-left: 5px;">Set as Payout Bank</label>
</div>
</div>
</div>
</div>
</div>
@ -629,7 +637,7 @@ if ($_SESSION["userId"] <> "") {
<script>
// function for deleting address
const vendorid = `<?php echo $_SESSION["LoggedInVendorId"]; ?>`;
// const vendorid = `<?php # echo $_SESSION["LoggedInVendorId"]; ?>`;
function deleteAddress(vendorid, addressIndex) {
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/vendors/' + vendorid)
.then(response => response.json())
@ -648,7 +656,7 @@ if ($_SESSION["userId"] <> "") {
})
.then(response => {
if (response.ok) {
location.reload();
// location.reload();
// filter the delete action
document.getElementById('form-check-' + addressIndex).remove();
} else {

View File

@ -20,6 +20,11 @@ if (isset($_GET['id'])) {
}
$result = getProduct($_SESSION['newProductId']);
$array = json_decode($result, true);
if ($_SESSION["isCustomer"] == true) {
header("location: user-profile.php");
}
?>
<!DOCTYPE html>
<html lang="en">
@ -419,7 +424,7 @@ $array = json_decode($result, true);
</div>
<!-- 03-15-2024 Jun Jihad price_matrix field Product Upload Vendor Page -->
<!-- 02-19-2024 Jun Jihad Promo Field Product Upload Vendor Page -->
<div class="col-md-12" style="margin: 0 0 20px 0;">
<div class="col-md-12 pt-3" style="margin: 0 0 20px 0; white-space: nowrap;">
<label class="form-label">Promo</label>
<div class="row" justify-content-between>
<div class="col-md-6">

View File

@ -13,6 +13,10 @@ if ($_SESSION["userId"] <> "") {
} else {
$_SESSION["isLoggedIn"] = false;
}
if ($_SESSION["isVendor"] == true) {
header("location: vendor-dashboard.php");
}
?>
<!DOCTYPE html>
<html lang="en">
@ -331,7 +335,7 @@ if ($_SESSION["userId"] <> "") {
if (xhr.status === 200) {
// Product removed successfully, you can handle the UI update here if needed
console.log('Product removed successfully');
location.reload(); // Refresh the page after removing the product
// location.reload(); // Refresh the page after removing the product
} else {
// Handle error response
console.error('Error removing product:', xhr.responseText);
@ -366,7 +370,7 @@ if ($_SESSION["userId"] <> "") {
if (xhr.readyState === XMLHttpRequest.DONE) {
if (xhr.status === 200) {
console.log('Products removed successfully');
location.reload();
// location.reload();
} else {
console.error('Error removing products:', xhr.responseText);
}