Compare commits

...

7 Commits

20 changed files with 1047 additions and 199 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

View File

@ -40,7 +40,9 @@ if($_SESSION["user_type"]!="admin"){
<link id="ekka-css" href="assets/css/ekka.css" rel="stylesheet" />
<!-- FAVICON -->
<link href="assets/img/favicon.png" rel="shortcut icon" />
<!-- <link href="assets/img/favicon.png" rel="shortcut icon" /> -->
<!-- 03-13-2024 Stacy changed the icon -->
<link href="assets/img/favicon/favicon.png" rel="shortcut icon" />
</head>

View File

@ -48,7 +48,8 @@ $users = getUsers();
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="description" content="Ekka - Admin Dashboard HTML Template.">
<title>Ekka - Admin Dashboard HTML Template.</title>
<!-- <title>Ekka - Admin Dashboard HTML Template.</title> -->
<title>oBanana B2B - Admin Dashboard</title>
<!-- GOOGLE FONTS -->
<link rel="preconnect" href="https://fonts.googleapis.com">
@ -66,7 +67,9 @@ $users = getUsers();
<link id="ekka-css" rel="stylesheet" href="assets/css/ekka.css" />
<!-- FAVICON -->
<link href="assets/img/favicon.png" rel="shortcut icon" />
<!-- <link href="assets/img/favicon.png" rel="shortcut icon" /> -->
<link href="assets/img/favicon/favicon.png" rel="shortcut icon" />
</head>
<body class="ec-header-fixed ec-sidebar-fixed ec-sidebar-dark ec-header-light" id="body">

View File

@ -0,0 +1,8 @@
<?php
// 03-07-2024 Stacy created Search Vendor Filter Action
$search = isset($_POST['search']) ? $_POST['search'] : null;
header("location: vendor-card.php?&search=$search");
// 03-07-2024 Stacy created Search Vendor Filter Action

View File

@ -4,7 +4,7 @@ include "../functions.php";
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
if ($_SESSION["userId"] <> "") {
$_SESSION["isLoggedIn"] = true;
//$customer_data = getCustomerbyLoginId($_SESSION["userId"]);
$customer_data = getCustomerbyLoginId($_SESSION["userId"]);
} else {
$_SESSION["isLoggedIn"] = false;
header("location: login.php");
@ -14,6 +14,8 @@ if ($_SESSION["user_type"] != "admin") {
header("location: login.php?alert=Only admins allowed here!");
}
$products = productList();
$vendorSearchResult = $_SESSION["vendorSearchResult"];
?>
<!DOCTYPE html>
<html lang="en" dir="ltr">
@ -64,7 +66,8 @@ $products = productList();
<link id="ekka-css" rel="stylesheet" href="assets/css/ekka.css" />
<!-- FAVICON -->
<link href="assets/img/favicon.png" rel="shortcut icon" />
<!-- <link href="assets/img/favicon.png" rel="shortcut icon" /> -->
<link href="assets/img/favicon/favicon.png" rel="shortcut icon" />
<!-- FONTAWESOME -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
@ -89,17 +92,22 @@ $products = productList();
<!-- Sidebar toggle button -->
<button id="sidebar-toggler" class="sidebar-toggle"></button>
<!-- search form -->
<!-- 03-07-2024 Stacy & Raymart modified this block of code -->
<div class="search-form d-lg-inline-block">
<div class="input-group">
<input type="text" name="query" id="search-input" class="form-control" placeholder="search.." autofocus autocomplete="off" />
<button type="button" name="search" id="search-btn" class="btn btn-flat">
<i class="mdi mdi-magnify"></i>
</button>
</div>
<form method="POST" action="vendor-card-action.php">
<div class="input-group">
<input type="text" name="search" id="search-input" class="form-control" placeholder="search.." autofocus autocomplete="off" />
<button class="submit" type="submit" id="search-btn" class="btn btn-flat">
<i class="mdi mdi-magnify" style="font-size:20px; color:gray; padding-right:8px;"></i>
</button>
</div>
</form>
<div id="search-results-container">
<ul id="search-results"></ul>
</div>
</div>
<!-- 03-07-2024 Stacy & Raymart modified this block of code -->
<!-- navbar right -->
<div class="navbar-right">
@ -665,10 +673,49 @@ $products = productList();
$start = ($currentpage - 1) * $vendorsPerPage;
$end = $start + $vendorsPerPage - 1;
$vendorsCopy = $vendors;
// var_dump($vendorsCopy
// );
// 03-07-2024 added searh filter
if (!empty($_GET['search']) ) {
$filteredProducts=[];
foreach ($vendorsCopy as $result) {
$vendorName = strtolower($result['user_login']);
if (
// $result['user_login'] == $_GET['search']
strpos($vendorName,$_GET['search'])!==false
) {
$filteredProducts[] = $result;
// var_dump("herees");
// var_dump($_GET['search']);
} else{
// var_dump("none");
}
}
$vendors = $filteredProducts;
$totalVendors = count($filteredProducts);
$vendorsPerPage = 20;
}
else{
// $vendors=$vendorsCopy;
}
if ($totalVendors == 0) {
echo '<p style="padding-top:30px; padding-left:20px;">No vendor found.</p>';
}
// $vendors = vendorList();
for ($x = $start; $x <= $end && $x < $totalVendors; $x++) {
$vendor = $vendors[$x];
?>
<div class="col-lg-6 col-xl-4 col-xxl-3">
<div class="card card-default mt-24px">
<a href="javascript:0" data-bs-toggle="modal" data-bs-target="#modal-contact-<?php echo $vendor['_id']; ?>" class="view-detail me-auto">
@ -684,7 +731,7 @@ $products = productList();
if (isset($vendor['vendor_image']) && !empty($vendor['vendor_image'])) {
echo '<img src="' . $vendor['vendor_image'] . '" class="img-fluid rounded-circle" alt="Avatar Image" style="width: 150px; height: 150px; object-fit: cover; border-radius: 50%;"> ';
} else {
echo '<img src="assets/img/vendor/u1.jpg" class="img-fluid rounded-circle" alt="Placeholder Image">';
echo '<img src="https://api.obanana.com/images/storage/web_images/1710214273217-no_image.png" class="img-fluid rounded-circle" alt="Placeholder Image">';
}
?>
</div>
@ -894,7 +941,8 @@ $products = productList();
</div>
</div>
</div>
</div>
</div>
<script>
function deleteVendor(vendorId){
let text = "Please confirm delete action!\nClick OK or Cancel button.";
@ -1328,13 +1376,16 @@ function validateEmail(vendorId) {
<!-- Ec Pagination Start -->
<div class="pagination mt-3">
<?php
for ($i = 1; $i <= $totalPages; $i++) {
echo "<a href='?page=$i' class='" . ($currentpage == $i ? 'active' : '') . "'>$i</a>";
}
if ($totalVendors >= $vendorsPerPage) {
for ($i = 1; $i <= $totalPages; $i++) {
echo "<a href='?page=$i' class='" . ($currentpage == $i ? 'active' : '') . "'>$i</a>";
}
}
?>
</div>
<!-- Ec Pagination End -->
</div>
<!-- Contact Modal -->

View File

@ -48,6 +48,29 @@ if ($_SESSION["userId"] <> "") {
<!-- Background css -->
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
<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;
margin: 0 5px;
border-radius: 4px;
}
.pagination a.active {
background-color: #007bff;
color: #fff;
}
</style>
<script>
function updateCartItemCount() {
$.get("cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data, status) {
@ -196,7 +219,7 @@ if ($_SESSION["userId"] <> "") {
<!-- Ec breadcrumb end -->
<!-- Page detail section -->
<section class="ec-bnr-detail ec-catalog-vendor-sec section-space-pt">
<section class="ec-bnr-detail ec-catalog-vendor-sec section-space-pt">
<div class="ec-page-detail">
<div class="container">
<div class="ec-main-heading d-none">
@ -209,14 +232,14 @@ if ($_SESSION["userId"] <> "") {
$vendor = json_decode($json, true);
?>
<div class="col-lg-12 col-md-12 profile-banner space-info margin-bottom-30">
<ul class="social-bar mb-0">
<li class="list-inline-item"><a class="hdr-facebook" href="#"><i class="ecicon eci-facebook"></i></a></li>
<li class="list-inline-item"><a class="hdr-twitter" href="#"><i class="ecicon eci-twitter"></i></a></li>
<li class="list-inline-item"><a class="hdr-instagram" href="#"><i class="ecicon eci-instagram"></i></a></li>
<li class="list-inline-item"><a class="hdr-linkedin" href="#"><i class="ecicon eci-linkedin"></i></a></li>
</ul>
<div class="ec-page-description ec-page-description-info">
<div class="ec-page-block">
<!-- <ul class="social-bar mb-0">
<li class="list-inline-item"><a class="hdr-facebook" href="#"><i class="ecicon eci-facebook"></i></a></li>
<li class="list-inline-item"><a class="hdr-twitter" href="#"><i class="ecicon eci-twitter"></i></a></li>
<li class="list-inline-item"><a class="hdr-instagram" href="#"><i class="ecicon eci-instagram"></i></a></li>
<li class="list-inline-item"><a class="hdr-linkedin" href="#"><i class="ecicon eci-linkedin"></i></a></li>
</ul> -->
<div class="ec-page-description ec-page-description-info"style="background: orange;">
<div class="ec-page-block" style="background: #393e46;">
<div class="ec-catalog-vendor">
<a href="vendor-profile.html">
<?php
@ -263,11 +286,12 @@ if ($_SESSION["userId"] <> "") {
<div class="col-lg-12 col-md-12 margin-bottom-30">
<div class="ec-page-description p-30">
<h5 class="ec-desc-title">About Our Firm</h5>
<p>Lorem Ipsum is simply dummy text of the printing and typesetting
industry. Lorem Ipsum has been the industry's standard dummy text ever
since the 1500s, when an unknown printer took a galley of type and
scrambled it to make a type specimen book.
</p>
<!-- raymart replace the vendor descript march 8 2024 -->
<?php if (!empty($vendorData['vendor_description'])): ?>
<p><?php echo $vendorData['vendor_description']; ?></p>
<?php else: ?>
<p>No description available.</p>
<?php endif; ?>
</div>
</div>
</div>
@ -308,36 +332,53 @@ if ($_SESSION["userId"] <> "") {
<div class="shop-pro-content">
<div class="shop-pro-inner">
<div class="row">
<?php
<?php
//var_dump($products);
foreach ($products as $product) {
// raymart added vendorproduct feb 14 2024
$vendorOfProduct = getVendorbyId($product['vendor_api_id']);
foreach ($products as $product){
// $vendorOfProduct = getVendorbyId($product['vendor_api_id']);
// $pid = $i;
$vendorOfProduct = getVendorbyId($simpleProducts[$pid]['vendor_api_id']);
?>
<div class="col-lg-4 col-md-6 col-sm-6 col-xs-6 mb-6 pro-gl-content">
<div class="ec-product-inner">
<div class="ec-pro-image-outer">
<div class="ec-pro-image-outer" style="max-width: 290px; height: 350px;">
<div class="ec-pro-image">
<!-- raymart added for link for product feb 22 2024 -->
<a class="image" href="product-left-sidebar.php?id=<?php echo $product["_id"] ?>"<?php echo $product["product_image"] ?>>
<?php
if (isset($product["product_image"]) && $product["product_image"] <> "") {
?>
<img class="main-image" src="<?php echo $product["product_image"] ?>" alt="Product" />
<!-- <img class="hover-image" src="<?php echo $product["product_image"] ?>" alt="Product" /> -->
<!-- raymart replace new function for images of the product march 8 2024 -->
<?php
} else {
if (isset($product['images'])) {
$image_urls = explode(',', $product['images']);
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img class="main-image" src="assets/images/product-image/6_1.jpg" alt="Product" />
<!-- <img class="hover-image" src="assets/images/product-image/6_2.jpg" alt="Product" /> -->
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 330px; object-fit: cover;"/>
<?php
}
} else {
?>
<img class="main-image" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019" alt="edit" />
<?php
}
?>
</a>
<!-- raymart edit action feb 14 2024 -->
<div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<div class="ec-pro-actions" style="bottom: -36px;">
<!-- raymart replace updated prize for the product march 8 2024 -->
<?php if (isset($product["sale_price"]) && $product["sale_price"] > 0) : ?>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php elseif (isset($product["regular_price"]) && $product["regular_price"] != "") : ?>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php else : ($product["regular_price"] == "" || $product["regular_price"] == null) ?>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php endif; ?>
</div>
<!-- <span class="percentage">20%</span>
<a href="#" class="quickview" data-link-action="quickview" title="Quick view" data-bs-toggle="modal" data-bs-target="#ec_quickview_modal"><i class="fi-rr-eye"></i></a>
@ -349,7 +390,7 @@ if ($_SESSION["userId"] <> "") {
</div>
</div>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="product-left-sidebar.php?id=<?php echo $product["_id"] ?>"><?php echo $product["product_name"] ?></a></h5>
<h5 class="ec-pro-title"><a href="product-left-sidebar.php?id=<?php echo $product["_id"] ?>" style="width: 90%; text-wrap: wrap;"><?php echo $product["product_name"] ?></a></h5>
<!-- raymart remove ratings feb 22 2024 -->
<!-- <div class="ec-pro-rating">
<i class="ecicon eci-star fill"></i>
@ -358,7 +399,7 @@ if ($_SESSION["userId"] <> "") {
<i class="ecicon eci-star fill"></i>
<i class="ecicon eci-star"></i>
</div> -->
<div class="ec-pro-list-desc">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dutmmy text ever since the 1500s, when an unknown printer took a galley.</div>
<!-- <div class="ec-pro-list-desc">Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum is simply dutmmy text ever since the 1500s, when an unknown printer took a galley.</div> -->
<span class="ec-price">
<!-- raymart added $ to pesos function feb 22 2024 -->
<?php if (isset($product["sale_price"]) && $product["sale_price"] > 0) : ?>
@ -421,10 +462,12 @@ if ($_SESSION["userId"] <> "") {
<?php
}
?>
</div>
</div>
<!-- Ec Pagination Start -->
<div class="ec-pro-pagination">
<!-- <div class="ec-pro-pagination">
<span>Showing 1-12 of 21 item(s)</span>
<ul class="ec-pro-pagination-inner">
<li><a class="active" href="#">1</a></li>
@ -434,7 +477,7 @@ if ($_SESSION["userId"] <> "") {
<li><a href="#">5</a></li>
<li><a class="next" href="#">Next <i class="ecicon eci-angle-right"></i></a></li>
</ul>
</div>
</div> -->
<!-- Ec Pagination End -->
</div>
<!--Shop content End -->
@ -501,12 +544,11 @@ if ($_SESSION["userId"] <> "") {
Categories</span>
</div>
</li>
</ul>
</div>
</div>
<!-- Sidebar Size Block -->
<div class="ec-sidebar-block">
<!-- <div class="ec-sidebar-block">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Size</h3>
</div>
@ -539,9 +581,9 @@ if ($_SESSION["userId"] <> "") {
</li>
</ul>
</div>
</div>
</div> -->
<!-- Sidebar Color item -->
<div class="ec-sidebar-block ec-sidebar-block-clr">
<!-- <div class="ec-sidebar-block ec-sidebar-block-clr">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Color</h3>
</div>
@ -579,9 +621,9 @@ if ($_SESSION["userId"] <> "") {
</li>
</ul>
</div>
</div>
</div> -->
<!-- Sidebar Price Block -->
<div class="ec-sidebar-block">
<!-- <div class="ec-sidebar-block">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Price</h3>
</div>
@ -595,9 +637,9 @@ if ($_SESSION["userId"] <> "") {
</div>
</div>
</div>
</div>
</div> -->
<!-- Sidebar Price Block -->
<div class="ec-sidebar-block ec-contact-form">
<!-- <div class="ec-sidebar-block ec-contact-form">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Contact With Seller</h3>
</div>
@ -615,7 +657,7 @@ if ($_SESSION["userId"] <> "") {
<button type="submit" class="btn btn-lg btn-primary" tabindex="0">Submit</button>
</form>
</div>
</div>
</div> -->
</div>
</div>
@ -625,7 +667,9 @@ if ($_SESSION["userId"] <> "") {
<!-- End catalog page -->
<!-- Footer Start -->
<footer class="ec-footer section-space-mt">
<?php include "footer.php" ?>
<!-- <footer class="ec-footer section-space-mt">
<div class="footer-container">
<div class="footer-offer">
<div class="container">
@ -718,9 +762,9 @@ if ($_SESSION["userId"] <> "") {
</div>
<div class="footer-bottom">
<div class="container">
<div class="row align-items-center">
<div class="row align-items-center"> -->
<!-- Footer social Start -->
<div class="col text-left footer-bottom-left">
<!-- <div class="col text-left footer-bottom-left">
<div class="footer-bottom-social">
<span class="social-text text-upper">Follow us on:</span>
<ul class="mb-0">
@ -730,30 +774,30 @@ if ($_SESSION["userId"] <> "") {
<li class="list-inline-item"><a class="hdr-linkedin" href="#"><i class="ecicon eci-linkedin"></i></a></li>
</ul>
</div>
</div>
</div> -->
<!-- Footer social End -->
<!-- Footer Copyright Start -->
<div class="col text-center footer-copy">
<!-- <div class="col text-center footer-copy">
<div class="footer-bottom-copy ">
<div class="ec-copy">Copyright © 2023 <a class="site-name text-upper" href="#">ekka<span>.</span></a>. All Rights Reserved</div>
</div>
</div>
</div> -->
<!-- Footer Copyright End -->
<!-- Footer payment -->
<div class="col footer-bottom-right">
<!-- <div class="col footer-bottom-right">
<div class="footer-bottom-payment d-flex justify-content-end">
<div class="payment-link">
<img src="assets/images/icons/payment.png" alt="">
</div>
</div>
</div>
</div> -->
<!-- Footer payment -->
</div>
<!-- </div>
</div>
</div>
</div>
</footer>
</footer> -->
<!-- Footer Area End -->
<!-- Modal -->

View File

@ -11,6 +11,7 @@
<meta name="description" content="Best ecommerce html template for single and multi vendor store.">
<meta name="author" content="ashishmaraviya">
<!-- CATEGORY-SLIDER -->
<!-- site Favicon -->
<link rel="icon" href="assets/images/favicon/favicon.png" sizes="32x32" />
<link rel="apple-touch-icon" href="assets/images/favicon/favicon.png" />
@ -42,9 +43,17 @@
border-radius: 10px;
color: #ffffff;
}
#sidebar-category:hover .ec-sidebar-block-item{
#sidebar-category:hover .ec-sidebar-block-items{
color: #ffffff;
}
.ec-sidebar-block-items {
height: 40px;
padding-top:10px;
font-size:15px;
}
#best-sellers-title.bs-title:hover{
color: #ffaa00;
}
</style>
</head>
@ -64,8 +73,8 @@
<ul>
<li>
<a href="search_product_action.php?category=Electronics">
<div class="ec-sidebar-block-item">
<i class="fi fi-rs-headset" style="padding-right:10px; padding-top:2px;"></i>Electronics</div></a>
<div class="ec-sidebar-block-items" id="sidebar-category-content" style="display:flex; height: 40px; font-size:15px;">
<i class="fi fi-rs-headset" style="padding-right:15px; padding-top:2px;"></i>Electronics</div></a>
<!-- <ul style="display: block;">
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Shirt <span title="Available Stock">- 25</span></a>
@ -91,8 +100,8 @@
<ul>
<li>
<a href="search_product_action.php?category=Solar">
<div class="ec-sidebar-block-item" id="sidebar-category-content">
<i class="fi fi-rr-square" style="padding-right:10px; padding-top:2px;"></i>Solar</div></a>
<div class="ec-sidebar-block-items" id="sidebar-category-content" style="display:flex; height: 40px; font-size:15px;">
<i class="fi fi-rr-square" style="padding-right:15px; padding-top:3px;"></i>Solar</div></a>
<!-- <ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Sports <span title="Available Stock">- 25</span></a>
@ -118,8 +127,8 @@
<ul>
<li>
<a href="search_product_action.php?category=E-bike">
<div class="ec-sidebar-block-item">
<i class="fi fi-rs-bike" style="padding-right:10px; padding-top:2px;"></i>E-Bike</div></a>
<div class="ec-sidebar-block-items" id="sidebar-category-content" style="display:flex; height: 40px; font-size:15px;">
<i class="fi fi-rs-bike" style="padding-right:15px; padding-top:2px;"></i>E-Bike</div></a>
<!-- <ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Earrings <span title="Available Stock">- 50</span></a>
@ -141,8 +150,8 @@
<ul>
<li>
<a href="search_product_action.php?category=E-vehicle">
<div class="ec-sidebar-block-item">
<i class="fi fi-rs-car-side" style="padding-right:10px; padding-top:2px;"></i>E-Vehicle</div></a>
<div class="ec-sidebar-block-items" id="sidebar-category-content" style="display:flex; height: 40px; font-size:15px;">
<i class="fi fi-rs-car-side" style="padding-right:15px; padding-top:2px;"></i>E-Vehicle</div></a>
<!-- <ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Clothes perfume<span title="Available Stock">- 4 pcs</span></a>
@ -169,8 +178,8 @@
<ul>
<li>
<a href="search_product_action.php?category=Appliance">
<div class="ec-sidebar-block-item">
<i class="fi fi-rr-calculator" style="padding-right:10px; padding-top:2px;"></i>Appliance</div></a>
<div class="ec-sidebar-block-items" id="sidebar-category-content" style="display:flex; height: 40px; font-size:15px;">
<i class="fi fi-rr-calculator" style="padding-right:15px; padding-top:2px;"></i>Appliance</div></a>
<!-- <ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">shampoo<span title="Available Stock"></span></a>
@ -197,8 +206,8 @@
<ul>
<li>
<a href="search_product_action.php?category=Smart Home">
<div class="ec-sidebar-block-item">
<i class="fi fi-rs-screen" style="padding-right:10px; padding-top:2px;"></i>Smart Home</div></a>
<div class="ec-sidebar-block-items" id="sidebar-category-content" style="display:flex; height: 40px; font-size:15px;">
<i class="fi fi-rs-screen" style="padding-right:15px; padding-top:2px;"></i>Smart Home</div></a>
<!-- <ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">Sunglasses <span title="Available Stock">- 20</span></a>
@ -216,8 +225,8 @@
<ul>
<li>
<a href="search_product_action.php?category=Home">
<div class="ec-sidebar-block-item">
<i class="fi fi-rr-home" style="padding-right:10px; padding-top:2px;"></i>Home</div></a>
<div class="ec-sidebar-block-items" id="sidebar-category-content" style="display:flex; height: 40px; font-size:15px;">
<i class="fi fi-rr-home" style="padding-right:15px; padding-top:2px;"></i>Home</div></a>
<!-- <ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">shopping bag <span title="Available Stock">- 25</span></a>
@ -243,9 +252,9 @@
<div class="ec-sb-block-content" id="sidebar-category">
<ul>
<li>
<a href="search_product_action.php?category=Apparell">
<div class="ec-sidebar-block-item">
<i class="fi fi-rr-user" style="padding-right:10px; padding-top:2px;"></i>Apparel</div></a>
<a href="search_product_action.php?category=Apparel">
<div class="ec-sidebar-block-items" id="sidebar-category-content" style="display:flex; height: 40px; font-size:15px;">
<i class="fi fi-rr-user" style="padding-right:15px; padding-top:2px;"></i>Apparel</div></a>
<!-- <ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">shopping bag <span title="Available Stock">- 25</span></a>
@ -272,8 +281,8 @@
<ul>
<li>
<a href="search_product_action.php?category=Heavy Equipment">
<div class="ec-sidebar-block-item">
<i class="fi fi-rr-tool-box" style="padding-right:10px; padding-top:2px;"></i>Heavy Equipment</div></a>
<div class="ec-sidebar-block-items" id="sidebar-category-content" style="display:flex; height: 40px; font-size:15px;">
<i class="fi fi-rr-tool-box" style="padding-right:15px; padding-top:2px;"></i>Heavy Equipment</div></a>
<!-- <ul>
<li>
<div class="ec-sidebar-sub-item"><a href="shop-left-sidebar-col-4.php">shopping bag <span title="Available Stock">- 25</span></a>
@ -307,21 +316,15 @@
<div class="ec-sb-pro-sl">
<div>
<?php
$productBestSellers = simpleProducts("");
$array = array_filter($productBestSellers, function ($var) {
return (fnmatch("Solar*", $var['product_category']) || fnmatch("E-bike*", $var['product_category'])
|| fnmatch("Appliance*", $var['product_category']) || fnmatch("E-Vehicle*", $var['product_category'])
|| fnmatch("Electronics*", $var['product_category']) || fnmatch("Smart Home*", $var['product_category'])
|| fnmatch("Heavy Equipment*", $var['product_category']) || fnmatch("Home*", $var['product_category']));
});
$bestSellers = array_values($array);
$bestSellers = simpleProducts("");
for ($x = 0; $x <= 3; $x++) {
$pid = rand(0, count($bestSellers) - 1);
?>
<div class="ec-sb-pro-sl-item">
<a href="product-left-sidebar.php?id=<?php echo $bestSellers[$pid]["_id"]; ?>" class="sidekka_pro_img"><img src="<?php echo $bestSellers[$pid]["product_image"] ?>" alt="product" /></a>
<div class="ec-pro-content">
<h5 class="ec-pro-title"><a href="product-left-sidebar.php?id=<?php echo $bestSellers[$pid]["_id"]; ?>"><?php echo $bestSellers[$pid]["product_name"] ?></a></h5>
<h5 class="ec-pro-title"><a id="best-sellers-title" class="bs-title" href="product-left-sidebar.php?id=<?php echo $bestSellers[$pid]["_id"]; ?>"><?php echo $bestSellers[$pid]["product_name"] ?></a></h5>
<!-- <div class="ec-pro-rating">
<i class="ecicon eci-star fill"></i>
<i class="ecicon eci-star fill"></i>

View File

@ -940,7 +940,16 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
});
</script>
<span class="ec-check-order-btn">
<?php
if (empty($cartItems)) {
echo '<!-- $cartItems is empty, "Place Order" button will not be displayed -->';
} else {
echo '
<span class="ec-check-order-btn">
<a class="btn btn-primary" id="submitButton">Place Order</a>
</span>';
}
?>
</span>
</div>
</div>
@ -1401,6 +1410,30 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
const randomIndex = Math.floor(Math.random() * refchar.length);
uniqueRef += refchar.charAt(randomIndex);
}
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; // Stop further execution
}
newArray.forEach(async (orderId) => {
console.log(orderId)
const token = '<?php echo $_SESSION["token"] ?>';
@ -1454,7 +1487,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
'Authorization': "Bearer " + token,
},
});
// added marhc 7 2024
if (!patchResponse.ok) {
throw new Error(`Error updating payment status: ${patchResponse.status} ${patchResponse.statusText}`);
}

View File

@ -256,7 +256,7 @@ if ($_SESSION["userId"] <> "") {
<div class="ec-pro-actions" style="bottom: -36px;">
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
<?php if (isset($forAll[$pid]["sale_price"]) && $forAll[$pid]["sale_price"] > 0) : ?>
<button title="Add To Cart" style="display:none;" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($forAll[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php elseif (isset($forAll[$pid]["regular_price"]) && $forAll[$pid]["regular_price"] != "") : ?>
@ -377,11 +377,11 @@ if ($_SESSION["userId"] <> "") {
<div class="ec-pro-actions" style="bottom: -36px;">
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
<?php if (isset($electronics[$pid]["sale_price"]) && $electronics[$pid]["sale_price"] > 0) : ?>
<button title="Add To Cart" style="display:none;" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Carttt</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php elseif (isset($electronics[$pid]["regular_price"]) && $electronics[$pid]["regular_price"] != "") : ?>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Carttt</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($electronics[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php else : ($electronics[$pid]["regular_price"] == "" || $electronics[$pid]["regular_price"] == null) ?>
@ -498,7 +498,7 @@ if ($_SESSION["userId"] <> "") {
<div class="ec-pro-actions"style="bottom: -36px;">
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
<?php if (isset($smartHome[$pid]["sale_price"]) && $smartHome[$pid]["sale_price"] > 0) : ?>
<button title="Add To Cart" style="display:none;" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($smartHome[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($smartHome[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($smartHome[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php elseif (isset($smartHome[$pid]["regular_price"]) && $smartHome[$pid]["regular_price"] != "") : ?>
@ -618,7 +618,7 @@ if ($_SESSION["userId"] <> "") {
<div class="ec-pro-actions"style="bottom: -36px;">
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
<?php if (isset($forVehicle[$pid]["sale_price"]) && $forVehicle[$pid]["sale_price"] > 0) : ?>
<button title="Add To Cart" style="display:none;" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($forVehicle[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($forVehicle[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($forVehicle[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php elseif (isset($forVehicle[$pid]["regular_price"]) && $forVehicle[$pid]["regular_price"] != "") : ?>
@ -1240,8 +1240,23 @@ if ($_SESSION["userId"] <> "") {
</a> -->
<!-- raymart edit action feb 14 2024 -->
<div class="ec-pro-actions"style="bottom: -36px;">
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($newArrival[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($newArrival[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
<?php if (isset($newArrival[$pid]["sale_price"]) && $newArrival[$pid]["sale_price"] > 0) : ?>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($newArrival[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($newArrival[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php elseif (isset($newArrival[$pid]["regular_price"]) && $newArrival[$pid]["regular_price"] != "") : ?>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($newArrival[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($newArrival[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php else : ($newArrival[$pid]["regular_price"] == "" || $newArrival[$pid]["regular_price"] == null) ?>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($newArrival[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php endif; ?>
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
<!-- <button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($newArrival[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($newArrival[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a> -->
</div>
<!-- <div class="ec-pro-actions">
<button title="Add To Cart" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>

View File

@ -74,6 +74,7 @@ if (isset($_GET['id'])) {
<link rel="stylesheet" href="assets/css/plugins/countdownTimer.css" />
<link rel="stylesheet" href="assets/css/plugins/slick.min.css" />
<link rel="stylesheet" href="assets/css/plugins/bootstrap.css" />
<link rel="stylesheet" href="assets/css/plugins/nouislider.css" />
<!-- Main Style -->
<link rel="stylesheet" href="assets/css/style.css" />
@ -503,8 +504,8 @@ if (isset($_GET['id'])) {
echo (!empty($product_details['minimum_order'])) ? $product_details['minimum_order'] : "1";
echo '" id="qty-input" />';
echo '<div class="qty-btn" style="color:#ffaa00; font-size:25px; padding-left:5px; cursor: pointer;" onclick="increment()">+</div>';
echo '<div id="addToCartMessage"></div>';
echo '<button class="btn btn-primary" id="addToCartButton" style="background:#ffaa00; margin-left:55px;"><i class="fi-rr-shopping-bag" style="font-size:20px; margin-bottom:-3px; margin-right:10px;"></i>Add To Cart</button>';
// echo '<div id="addToCartMessage" style="border:1px solid red;"></div>';
echo '<div> <div id="addToCartMessage" style="padding-left:45px;"></div> <button class="btn btn-primary" id="addToCartButton" style="background:#ffaa00; margin-left:55px;"><i class="fi-rr-shopping-bag" style="font-size:20px; margin-bottom:-3px; margin-right:10px;"></i>Add To Cart</button></div>';
echo '<div class="ec-single-wishlist">
<a class="ec-btn-group wishlist" title="Wishlist" onclick="wishlist()"><i class="fi fi-rr-heart" style="color:#B80F0A; font-size:20px;"></i></a>
</div>';
@ -1511,9 +1512,24 @@ if (isset($_GET['id'])) {
</div> -->
<!-- 02-21-2024 Stacy commented out -->
<!-- 02-21-2024 Stacy added -->
<div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($similar_products[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($similar_products[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<div class="ec-pro-actions" style="bottom: -36px;">
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
<?php if (isset($similar_products[$pid]["sale_price"]) && $similar_products[$pid]["sale_price"] > 0) : ?>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($similar_products[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($similar_products[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php elseif (isset($similar_products[$pid]["regular_price"]) && $similar_products[$pid]["regular_price"] != "") : ?>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($similar_products[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($similar_products[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php else : ($similar_products[$pid]["regular_price"] == "" || $similar_products[$pid]["regular_price"] == null) ?>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($similar_products[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php endif; ?>
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
<!-- <button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($similar_products[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($similar_products[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a> -->
</div>
<!-- 02-21-2024 Stacy added -->
</div>

View File

@ -169,12 +169,17 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
<div></div>
</div>
</div>
<!-- Header -->
<?php include "header.php" ?>
<?php include "category-slider.php" ?>
<!-- ekka Cart Start -->
<!-- ekka Cart End -->
<!-- Category Slider -->
<?php include "category-slider.php" ?>
<!-- Ec breadcrumb start -->
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
<div class="container">
@ -253,7 +258,7 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
<img src="https://api.obanana.com/images/storage/web_images/1708588564876-viber_image_2024-02-22_15-54-42-498.png" class="vendor-image-placeholder" style="max-width: 100px; max-height: 100px;">
<?php endif; ?>
</div>
<div class="vendor-details" style="display: inline-block;">
<div class="vendor-details" style="display:inline-block;">
<a href="catalog-single-vendor.php?id=<?php echo $vendor['_id'] ?>">
<h6 class="ec-pro-title" style="padding:0 30px;font-family: Poppins, sans-serif; text-decoration: none; color: #777;white-space: nowrap;text-overflow: ellipsis;display: block;font-size: 16px;font-weight: 400;">
<?php echo $vendor['user_login']; ?>
@ -339,9 +344,24 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
<img class="main-image" src="<?php echo $product_image ?>" alt="Product" />
<img class="hover-image" src="<?php echo $product_image ?>" alt="Product" />
</a> -->
<div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($productWithoutSpecs), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($productWithoutSpecs), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<div class="ec-pro-actions" style="bottom: -36px;">
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
<?php if (isset($product["sale_price"]) && $product["sale_price"] > 0) : ?>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php elseif (isset($product["regular_price"]) && $product["regular_price"] != "") : ?>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php else : ($product["regular_price"] == "" || $product["regular_price"] == null) ?>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($product), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php endif; ?>
<!-- 02-29-2024 Stacy disabling hover add to cart if there's no price -->
<!-- <button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($productWithoutSpecs), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($productWithoutSpecs), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a> -->
</div>
</div>
</div>
@ -476,25 +496,35 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
<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>
<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 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">Max Price:</label>
<input type="number" name="maxPrice" id="maxPrice" value="<?php echo isset($_POST['maxPrice']) ? $_POST['maxPrice'] : (isset($_GET['maxPrice']) ? $_GET['maxPrice'] : ''); ?>" />
<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>
<!-- <button type="submit">Apply</button> -->
</form>
<!-- <form method="POST" action="<?php echo $_SERVER['PHP_SELF'] . '?' . http_build_query(array_merge($_GET, $_POST)); ?>">

View File

@ -101,6 +101,7 @@ if ($_SESSION["userId"] <> "") {
</div>
<?php include "header.php" ?>
<!-- ekka Cart Start -->
<?php include "category-slider.php" ?>
<!-- ekka Cart End -->
@ -178,16 +179,47 @@ if ($_SESSION["userId"] <> "") {
<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">
<?php $simpleProducts ?>
<div class="ec-pro-image-outer">
<div class="ec-pro-image-outer" style="max-width: 290px; height: 350px;">
<div class="ec-pro-image">
<a href="shop-left-sidebar-col-4.php" class="image">
<img class="main-image" src="<?php echo $simpleProducts[$pid]["product_image"] ?>" alt="Product" />
<img class="hover-image" src="<?php echo $simpleProducts[$pid]["product_image"] ?>" alt="Product" />
<a href="product-left-sidebar.php?id=<?php echo $simpleProducts[$pid]["_id"]; ?>"class="image">
<!-- raymart changes product images to images march 8 2024 -->
<?php
if (isset($simpleProducts[$pid]['images'])) {
$image_urls = explode(',', $simpleProducts[$pid]['images']);
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 330px;" />
<?php
}
} else {
?>
<img class="hover-image" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019" alt="edit" />
<?php
}
?>
<!-- <img class="main-image" src="<?php echo $simpleProducts[$pid]["product_image"] ?>" alt="Product" /> -->
<!-- <img class="hover-image" src="<?php echo $simpleProducts[$pid]["product_image"] ?>" alt="Product" /> -->
</a>
<div class="ec-pro-actions">
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($simpleProducts[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($simpleProducts[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<div class="ec-pro-actions" style="bottom: -36px;">
<!-- raymart added update prize for the product -->
<?php if (isset($simpleProducts[$pid]["sale_price"]) && $simpleProducts[$pid]["sale_price"] > 0) : ?>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($simpleProducts[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($simpleProducts[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php elseif (isset($simpleProducts[$pid]["regular_price"]) && $simpleProducts[$pid]["regular_price"] != "") : ?>
<button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($simpleProducts[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($simpleProducts[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php else : ($simpleProducts[$pid]["regular_price"] == "" || $simpleProducts[$pid]["regular_price"] == null) ?>
<a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($simpleProducts[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a>
<?php endif; ?>
<!-- <button title="Add To Cart" onclick="popupAddToCart(`<?php echo htmlspecialchars(json_encode($simpleProducts[$pid]), ENT_QUOTES, 'UTF-8'); ?>`,`<?php echo htmlspecialchars($vendorOfProduct, ENT_QUOTES, 'UTF-8'); ?>`, `<?php echo isset($_SESSION['token']) ? $_SESSION['token'] : ''; ?>` , `<?php echo isset($_SESSION['email']) ? $_SESSION['email'] : ''; ?>` , `<?php echo isset($_SESSION['password']) ? $_SESSION['password'] : ''; ?>` , `<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>`);" class="add-to-cart"><i class="fi-rr-shopping-basket"></i> Add To Cart</button> -->
<!-- <a class="ec-btn-group wishlist" title="Wishlist" onclick="popupWishlist('<?php echo htmlspecialchars(json_encode($simpleProducts[$pid]), ENT_QUOTES, 'UTF-8'); ?>', '<?php echo htmlspecialchars(json_encode($customer_data), ENT_QUOTES, 'UTF-8'); ?>');"><i class="fi-rr-heart"></i></a> -->
</div>
<!-- <span class="percentage">20%</span>
<a href="#" class="quickview" data-link-action="quickview" title="Quick view" data-bs-toggle="modal" data-bs-target="#ec_quickview_modal"><i class="fi-rr-eye"></i></a>
@ -394,7 +426,7 @@ if ($_SESSION["userId"] <> "") {
</div>
</div>
<!-- Sidebar Price Block -->
<div class="ec-sidebar-block">
<!-- <div class="ec-sidebar-block">
<div class="ec-sb-title">
<h3 class="ec-sidebar-title">Price</h3>
</div>
@ -408,7 +440,7 @@ if ($_SESSION["userId"] <> "") {
</div>
</div>
</div>
</div>
</div> -->
<!-- Sidebar Size Block -->
<!-- <div class="ec-sidebar-block">
<div class="ec-sb-title">
@ -643,7 +675,7 @@ if ($_SESSION["userId"] <> "") {
<!-- 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>
@ -651,7 +683,7 @@ if ($_SESSION["userId"] <> "") {
<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 -->
@ -868,11 +900,11 @@ if ($_SESSION["userId"] <> "") {
<!-- Main Js -->
<script src="assets/js/vendor/index.js"></script>
<script src="assets/js/main.js"></script>
<script src="assets/js/newjs.js"></script>
<!-- <script src="assets/js/newjs.js"></script> -->
<!-- raymart added js link feb 14 2024 -->
<?php
if ($_SESSION["is_test"]==true) {
echo '<script src="assets/js/tester10.js"></script>';
echo '<script src="assets/js/tester11.js"></script>';
} else {
echo '<script src="assets/js/produc3.js"></script>';
}

View File

@ -45,6 +45,9 @@ if ($_SESSION["userId"] <> "") {
<link rel="stylesheet" href="assets/css/style2.css" />
<link rel="stylesheet" href="assets/css/responsive.css" />
<!-- FONTAWESOME -->
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<!-- Background css -->
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
@ -84,6 +87,11 @@ if ($_SESSION["userId"] <> "") {
background-color: rgba(0, 0, 0, 0.6);
border-radius: 5px;
}
#editDelete:hover i{
color: #ffaa00;
cursor: pointer;
}
</style>
</head>
@ -106,7 +114,7 @@ if ($_SESSION["userId"] <> "") {
<!-- ekka Cart End -->
<!-- Category Sidebar start -->
<?php include "category-slider.php" ?>
<?php #include "category-slider.php" ?>
<!-- Ec breadcrumb start -->
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
@ -241,7 +249,8 @@ if ($_SESSION["userId"] <> "") {
<form id="addressForm">
<?php foreach ($customer_data as $customer_index => $customer) { ?>
<?php foreach ($customer['address'] as $address_index => $address) { ?>
<div class="card mb-3">
<!-- added id -->
<div class="card mb-3" id="form-check-<?php echo $address_index ?>">
<div class="card-body">
<div class="selectCon">
<div class="selectWrap" style="display: flex; justify-content: center; align-items: center; width: 50%;">
@ -251,7 +260,7 @@ if ($_SESSION["userId"] <> "") {
</label>
</div>
<div class="selectWrap" style="display: flex; justify-content: center; align-items: center; width: 50%;">
<div class="selectWrap" style="display: flex; justify-content: center; align-items: center; width: 50%; margin-left:-20px;">
<input type="radio" style="padding-left: 0px !important; margin: 0px 0px !important;" name="selectedShippingAddress[<?php echo $customer_index; ?>]" id="shipping_address_<?php echo $customer_index; ?>_<?php echo $address_index; ?>" value="<?php echo $customer_index; ?>_<?php echo $address_index; ?>" class="form-check-input" onchange="updateAddressShipping('<?php echo $customer['_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 $customer_index; ?>_<?php echo $address_index; ?>">
Shipping Address
@ -259,10 +268,23 @@ if ($_SESSION["userId"] <> "") {
</div>
</div>
<!-- 03-01-2024 Stacy modified this block of code -->
<div class="container">
<div class="row">
<div class="col-md-12 mx-auto"> <!-- Adjust the column size as needed -->
<div class="col-md-12 mx-auto" > <!-- Adjust the column size as needed -->
<div id="editDelete" style="display:flex; float:right; width:20px; margin-right:-10px;" >
<?php
$address['id'] =$address_index;
$jsonAddress = json_encode($address)?>
<a href="javascript:0" data-bs-toggle="modal" data-value=' <?php echo $jsonAddress; ?>' data-bs-target="#thirdModal">
<i class="fa-regular fa-pen-to-square" style="font-size:15px; float:right;"></i></a>
<!-- <i class="fa-regular fa-trash-can" style="font-size:15px; float:right;"></i> -->
</div>
<div id="editDelete" style="display:flex; float:right; width:20px; margin-top:20px; margin-right:-20px; margin-top:30px;">
<!-- <i class="fa-solid fa-pen" style="font-size:15px; float:right;"></i></a> -->
<i onclick="deleteAddress('<?php echo $customer['_id']; ?>', <?php echo $address_index; ?>, true)"
class="fa-regular fa-trash-can" style="font-size:15px; float:right;"></i>
</div>
<label class="form-check-label" for="address_<?php echo $customer_index; ?>_<?php echo $address_index; ?>">
<?php echo $address['first_name']; ?> <?php echo $address['last_name']; ?><br>
<?php echo $address['address_1']; ?> <?php echo $address['address_2']; ?>
@ -270,6 +292,7 @@ if ($_SESSION["userId"] <> "") {
<?php echo $address['province']; ?> <?php echo $address['country']; ?><br>
Phone: <?php echo $address['phone']; ?>
</label>
</div>
</div>
</div>
@ -284,6 +307,7 @@ if ($_SESSION["userId"] <> "") {
</div>
</div>
<!-- secondModal -->
<div class="modal fade" id="secondModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-sm" role="document" style="max-width: 800px;">
<div class="modal-content">
@ -329,7 +353,7 @@ if ($_SESSION["userId"] <> "") {
</div>
<div class="form-group">
<label for="addressCountry" class="text-dark font-weight-medium pt-3 mb-2">Country</label>
<input type="text" class="form-control" id="addressCountry">
<input type="text" class="form-control" id="addressCountry" >
</div>
<button type="button" class="btn btn-primary" id="submitBtn">Submit</button>
@ -339,6 +363,91 @@ if ($_SESSION["userId"] <> "") {
</div>
</div>
</div>
<!-- 03-01-2024 Stacy added thirdModal -->
<div class="modal fade" id="thirdModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog modal-dialog-centered modal-sm" role="document" style="max-width: 800px;">
<div class="modal-content">
<div class="modal-body" style="overflow-y: auto; max-height: 90vh;">
<form>
<div class="form-group">
<label for="addressFirstName" class="text-dark font-weight-medium pt-3 mb-2">First Name</label>
<input type="text" class="form-control"
id="addressFirstName2"
value="<?php echo $address['first_name']; ?>">
<!-- <label for="addressFirstName" class="text-dark font-weight-medium pt-3 mb-2">First Name</label>-->
<input type="hidden" class="form-control" id="addressId" >
</div>
<div class="form-group">
<label for="addressLastName" class="text-dark font-weight-medium pt-3 mb-2">Last Name</label>
<input type="text" class="form-control" id="addressLastName2" value="<?php echo $address['last_name']; ?>">
<!-- <label for="addressLastName" class="text-dark font-weight-medium pt-3 mb-2">Last Name</label>
<input type="text" class="form-control" id="addressLastName"> -->
</div>
<div class="form-group">
<label for="addressContact" class="text-dark font-weight-medium pt-3 mb-2">Contact Number</label>
<input type="text" class="form-control" id="addressContact2" value="<?php echo $address['phone']; ?>">
<!-- <label for="addressContact" class="text-dark font-weight-medium pt-3 mb-2">Contact Number</label>
<input type="number" class="form-control" id="addressContact"> -->
</div>
<div class="form-group">
<label for="addressBuilding" class="text-dark font-weight-medium pt-3 mb-2">Building,Number</label>
<input type="text" class="form-control" id="addressBuilding2" value="<?php echo $address['address_1']; ?>">
<!-- <label for="addressBuilding" class="text-dark font-weight-medium pt-3 mb-2"> Building,Number </label>
<input type="text" class="form-control" id="addressBuilding"> -->
</div>
<div class="form-group">
<label for="addressStreet" class="text-dark font-weight-medium pt-3 mb-2">Street </label>
<input type="text" class="form-control" id="addressStreet2" value="<?php echo $address['address_2']; ?>">
<!-- <label for="addressStreet" class="text-dark font-weight-medium pt-3 mb-2"> Street </label>
<input type="text" class="form-control" id="addressStreet"> -->
</div>
<div class="form-group">
<label for="provinceSelect2">Province</label>
<select class="form-select" id="provinceSelect2">
<option id="provinceSelect2Opt" value="<?php echo $address['province']; ?>" >Select Province</option>
</select>
<!-- <label for="provinceSelect">Province</label>
<select class="form-select" id="provinceSelect">
<option value="" disabled selected hidden>Select Province</option>
</select> -->
</div>
<div class="form-group">
<label for="citySelect2">Municipality/City</label>
<select class="form-select" id="citySelect2" required>
<option value="" id="citySelect2Opt" selected hidden>Select Municipality/City</option>
</select>
</div>
<div class="form-group">
<label for="barangaySelect2">Barangay</label>
<select class="form-select" id="barangaySelect2" required>
<option value="" id="barangaySelect2Opt" selected hidden>Select Barangay</option>
</select>
</div>
<div class="form-group">
<label for="addressCountry2" class="text-dark font-weight-medium pt-3 mb-2">Country</label>
<input type="text" class="form-control" id="addressCountry2">
</div>
<button type="button" class="btn btn-primary" id="submitBtn2">Submit</button>
</form>
</div>
</div>
</div>
</div>
<script>
// var myElement = document.getElementById('myElement');
// myElement.style.backgroundImage = 'red';
@ -385,6 +494,205 @@ if ($_SESSION["userId"] <> "") {
</script>
<script>
// function for delete
function deleteAddress(customerId, addressIndex) {
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId)
.then(response => response.json())
.then(data => {
let existingAddresses = data.address || [];
if (addressIndex >= 0 && addressIndex < existingAddresses.length) {
existingAddresses.splice(addressIndex, 1);
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
address: existingAddresses
}),
})
.then(response => {
if (response.ok) {
location.reload();
// filter the delete action
document.getElementById('form-check-' + addressIndex).remove();
} else {
console.error('Failed to submit data');
alert('Failed to submit data');
}
})
.catch(error => {
console.error('Error:', error);
alert('Error submitting data');
});
} else {
console.log("Invalid address index.");
}
})
.catch(error => {
console.error('Error:', error);
alert('Error fetching customer data');
});
}
</script>
<script>
// 03-04-2024 added
$('#thirdModal').on('shown.bs.modal', function (event) {
var jsonString = $(event.relatedTarget).data('value');
var jsonObject = JSON.parse(jsonString);
console.log(jsonObject)
// document.getElementById("addressFirstName2").value('mmmm');
// $('#addressFirstName2').setAttribute('value','My default value');
// shows inputed data by the customer
document.querySelector('input[id="addressFirstName2"]').value = jsonObject.first_name;
document.querySelector('input[id="addressLastName2"]').value = jsonObject.last_name;
document.querySelector('input[id="addressContact2"]').value = jsonObject.phone;
document.querySelector('input[id="addressBuilding2"]').value = jsonObject.address_1;
document.querySelector('input[id="addressStreet2"]').value = jsonObject.address_2;
document.querySelector('option[id="provinceSelect2Opt"]').text = jsonObject.province;
document.querySelector('option[id="provinceSelect2Opt"]').value = jsonObject.province;
document.querySelector('option[id="citySelect2Opt"]').text = jsonObject.city;
document.querySelector('option[id="citySelect2Opt"]').value = jsonObject.city;
document.querySelector('option[id="barangaySelect2Opt"]').text = jsonObject.barangay;
document.querySelector('option[id="barangaySelect2Opt"]').value = jsonObject.barangay;
document.querySelector('input[id="addressCountry2"]').value = jsonObject.country;
document.querySelector('input[id="addressId"]').value = jsonObject.id;
console.log('id ' + jsonObject.id)
const provinceSelect = $('#provinceSelect2'); // Use jQuery to select the element
const citySelect = $('#citySelect2'); // Use jQuery to select the element
const barangaySelect = $('#barangaySelect2'); // Use jQuery to select the element
// Initialize Select2 on the provinceSelect, citySelect, and barangaySelect elements
provinceSelect.select2({
dropdownParent: $('#thirdModal'),
containerCssClass: 'select2-zindex-high' // Optional, add a custom class for styling
});
citySelect.select2({
dropdownParent: $('#thirdModal'),
containerCssClass: 'select2-zindex-high' // Optional, add a custom class for styling
});
barangaySelect.select2({
dropdownParent: $('#thirdModal'),
containerCssClass: 'select2-zindex-high' // Optional, add a custom class for styling
});
// Fetch provinces data
fetch('https://psgc.gitlab.io/api/provinces')
.then(response => {
if (response.ok) {
return response.json();
} else {
console.error('Failed to fetch provinces');
throw new Error('Failed to fetch provinces');
}
})
.then(provincesData => {
// Iterate through the provinces data and add options
provincesData.forEach(province => {
const option = new Option(province.name, province.code);
provinceSelect.append(option);
});
// Add an extra option manually
const extraOption = new Option('Metro Manila', '130000000');
provinceSelect.append(extraOption);
// Add event listener to provinceSelect
provinceSelect.on('change', function() {
// Clear existing options in citySelect and barangaySelect
citySelect.html('<option value="" disabled selected hidden>Select City</option>');
barangaySelect.html('<option value="" disabled selected hidden>Select Barangay</option>');
// Fetch and update cities/municipalities based on the selected province
updateCities();
});
})
.catch(error => {
console.error('Error:', error);
});
// Function to update city/municipality options based on the selected province
function updateCities() {
const selectedProvinceCode = provinceSelect.val(); // Use val() to get the selected value with Select2
if (selectedProvinceCode) {
let citiesEndpoint;
if (selectedProvinceCode === '130000000') {
// Check if Metro Manila is selected
citiesEndpoint = 'https://psgc.gitlab.io/api/regions/130000000/cities-municipalities/';
} else {
citiesEndpoint = `https://psgc.gitlab.io/api/provinces/${selectedProvinceCode}/cities-municipalities/`;
}
fetch(citiesEndpoint)
.then(response => {
if (response.ok) {
return response.json();
} else {
console.error('Failed to fetch cities/municipalities');
throw new Error('Failed to fetch cities/municipalities');
}
})
.then(citiesData => {
// Iterate through the cities data and add options
citiesData.forEach(city => {
const option = new Option(city.name, city.code);
citySelect.append(option);
});
})
.catch(error => {
console.error('Error:', error);
});
}
}
// Add event listener to citySelect
citySelect.on('change', function() {
// Clear existing options in barangaySelect
barangaySelect.html('<option value="" disabled selected hidden>Select Barangay</option>');
// Fetch and update barangays based on the selected city/municipality
const selectedCityCode = citySelect.val();
if (selectedCityCode) {
fetch(`https://psgc.gitlab.io/api/cities-municipalities/${selectedCityCode}/barangays/`)
.then(response => {
if (response.ok) {
return response.json();
} else {
console.error('Failed to fetch barangays');
throw new Error('Failed to fetch barangays');
}
})
.then(barangaysData => {
// Iterate through the barangays data and add options
barangaysData.forEach(barangay => {
const option = new Option(barangay.name, barangay.code);
barangaySelect.append(option);
});
})
.catch(error => {
console.error('Error:', error);
});
}
});
// document.querySelector('input[id="addressFirstName2"]').value = jsonObject.last_name;
});
const customerId = '<?php echo $customer_data[0]['_id']; ?>';
document.addEventListener('DOMContentLoaded', function() {
// Get the select elements
@ -511,6 +819,7 @@ if ($_SESSION["userId"] <> "") {
$('#submitBtn').on('click', function() {
// Retrieve existing addresses from the API
// fetch('https://api.obanana.shop/api/v1/customers/65482e8d209ff8d348bd30fd')
console.log('clickkkkkkkk')
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId)
.then(response => response.json())
.then(data => {
@ -575,6 +884,93 @@ if ($_SESSION["userId"] <> "") {
});
// Added function for edit
$('#submitBtn2').on('click', function() {
// function updateAddress(){
// Retrieve existing addresses from the API
// fetch('https://api.obanana.shop/api/v1/customers/65482e8d209ff8d348bd30fd')
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId)
.then(response => response.json())
.then(data => {
// Get the existing addresses array
const existingAddresses = data.address || [];
// Get the new address details
const firstName = $('#addressFirstName2').val();
const lastName = $('#addressLastName2').val();
const contact = $('#addressContact2').val();
const buildingNumber = $('#addressBuilding2').val();
const street = $('#addressStreet2').val();
const province = $('#provinceSelect2 :selected').text();
const city = $('#citySelect2 :selected').text();
const barangay = $('#barangaySelect2 :selected').text();
const country = $('#addressCountry2').val();
const id = $('#addressId').val();
console.log('clickkkkkkkk'+ id)
// Create a new address object
const newAddress = {
first_name: firstName,
last_name: lastName,
phone: contact,
address_1: buildingNumber,
address_2: street,
city: city,
province: province,
barangay: barangay,
country: country,
};
// Add the new address to the existing addresses
// existingAddresses.push(newAddress);
// var newAddresses= existingAddresses.filter((e,i)=>i!==id)
let existingAddress = existingAddresses
existingAddress[id]={
first_name: firstName,
last_name: lastName,
phone: contact,
address_1: buildingNumber,
address_2: street,
city: city,
province: province,
barangay: barangay,
country: country,
};
console.log( existingAddress[id])
// Make a PATCH request to update the addresses array
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId, {
method: 'PATCH',
headers: {
'Content-Type': 'application/json'
},
body: JSON.stringify({
address: existingAddress
}),
});
})
.then(response => {
if (response.ok) {
// Handle success (e.g., show a success message)
location.reload();
} else {
// Handle error
console.error('Failed to submit data');
alert('Failed to submit data');
}
})
.catch(error => {
// Handle network or other errors
console.error('Error:', error);
alert('Error submitting data');
});
});
</script>
<script>
@ -636,6 +1032,8 @@ if ($_SESSION["userId"] <> "") {
async function updateAddressShipping(customerId, addressIndex, isShipping) {
try {
// const customerId = `<?php #echo $customer_data[0]['_id']; ?>`;
const apiUrl = `https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/${customerId}`;
const response = await fetch(apiUrl, {
method: 'GET',
@ -703,6 +1101,8 @@ if ($_SESSION["userId"] <> "") {
sCountryElement.textContent = customerData.address[addressIndex].country;
}
console.log(`Address updated successfully for customer ${customerId}`);
// location.reload();
// header("location: user-profile.php");
} catch (error) {
console.error('Error updating address:', error.message);
}

View File

@ -66,6 +66,28 @@ $products = productList();
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" integrity="sha512-DTOQO9RWCH3ppGqcWaEA1BIZOC6xxalwEsw9c2QQeAIftl+Vegovlnee1c9QX4TctnWMn13TZye+giMm8e2LwA==" crossorigin="anonymous" referrerpolicy="no-referrer" />
<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;
}
.pagination a.active {
background-color: #007bff;
color: #fff;
}
</style>
</head>
<body class="shop_page">
@ -116,9 +138,23 @@ $products = productList();
<!-- Sidebar Category Block -->
<div class="ec-sidebar-block">
<div class="ec-vendor-block">
<div class="ec-vendor-block-bg" style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
<!-- 03-12-2024 Stacy added placeholder for vendor banner -->
<?php
if (!empty($vendorData['vendor_banner'])) { ?>
<div class="ec-vendor-block-bg" style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
<?php } else { ?>
<div class="ec-vendor-block-bg" style="background-color: orange; background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
<?php } ?>
<!-- <div class="ec-vendor-block-bg" style="background-color: orange; background-image: url(<?php #echo $vendorData['vendor_banner'] ?>) !important;"></div> -->
<div class="ec-vendor-block-detail">
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
<!-- 03-12-2024 Stacy added placeholder for vendor profile -->
<?php
if (!empty($vendorData['vendor_image'])) { ?>
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
<?php } else { ?>
<img class="v-img" src="https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg" alt="vendor image">
<?php } ?>
<!-- <img class="v-img" src=<?php #echo $vendorData['vendor_image'] ?> alt="vendor image"> -->
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
</div>
<!-- <div class="ec-vendor-block-items">
@ -168,13 +204,21 @@ $products = productList();
<?php
$products = productListVendor($vendorId);
$totalProducts = count($products);
for ($i = 0; $i <= $totalProducts - 1; $i++) {
// 03-11-2024 Stacy added for products pagination
$productsPerPage = 10;
$totalPages = ceil($totalProducts / $productsPerPage);
$currentpage = isset($_GET['page']) ? $_GET['page'] : 1;
$start = ($currentpage - 1) * $productsPerPage;
$end = $start + $productsPerPage - 1;
for ($i = $start; $i <= $end && $i < $totalProducts; $i++) {
$product = $products[$i];
?>
<tr id="<?php echo $product['_id']; ?>">
<td>
<!-- raymart added function feb 21 2024 -->
<?php
if (isset($product['images'])) {
@ -182,12 +226,12 @@ $products = productList();
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img class="prod-img" src="<?php echo $first_image_url; ?>" alt="edit" />
<img style="margin-top:8px;" class="prod-img" src="<?php echo $first_image_url; ?>" alt="edit" />
<?php
}
} else {
?>
<img class="prod-img rounded-circle" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019" alt="edit" />
<img style="margin-top:8px;" class="prod-img rounded-circle" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019" alt="edit" />
<?php
}
?>
@ -198,21 +242,21 @@ $products = productList();
echo '<img src="admin/assets/img/vendor/u1.jpg" class="prod-img rounded-circle" alt="Placeholder Image" >';
}
?> -->
</td>
<td><span><?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>
<td><span><?php echo $product['stock']; ?></span></td>
<td style="display: flex; justify-content: space-around;">
<span>
<input type="checkbox" name="product_checkbox[]" style="width: 20px; height: 33px; " value="<?php echo $product['_id']; ?>">
</td>
<td><span style="margin-top:8px;"><?php echo $product['product_name']; ?></span></td>
<td><span style="margin-top:8px;"><?php echo $product['regular_price']; ?></span></td>
<td><span style="margin-top:8px;"><?php echo $product['sale_price']; ?></span></td>
<td><span style="margin-top:8px;"><?php echo $product['minimum_order']; ?></span></td>
<td><span style="margin-top:8px;"><?php echo $product['stock']; ?></span></td>
<td style="display:flex; justify-content:space-around;">
<span style="margin-top:4px;">
<input type="checkbox" name="product_checkbox[]" style="width:20px; height:33px; " value="<?php echo $product['_id']; ?>">
</span>
<span onclick="editProduct('<?php echo $product['_id'] ?>');">
<a class="mdi mdi-circle-edit-outline" style="font-size: 20px;"></a>
<span style="margin-top:4px;" onclick="editProduct('<?php echo $product['_id'] ?>');">
<a class="mdi mdi-circle-edit-outline" style="font-size:20px;"></a>
</span>
<span onclick="deleteProduct('<?php echo $product['_id'] ?>');">
<a class="mdi mdi mdi-delete-outline" style="font-size: 20px;"></a>
<span style="margin-top:4px;" onclick="deleteProduct('<?php echo $product['_id'] ?>');">
<a class="mdi mdi mdi-delete-outline" style="font-size:20px;"></a>
</span>
</td>
</tr>
@ -223,6 +267,14 @@ $products = productList();
</table>
</div>
</div>
<!-- 03-11-2024 Stacy added pagination -->
<div class="pagination mt-3">
<?php
for ($p = 1; $p <= $totalPages; $p++) {
echo "<a href='?page=$p' class='" . ($currentpage == $p ? 'active' : '') . "'>$p</a>";
}
?>
</div>
</div>
</div>

View File

@ -72,6 +72,24 @@ if (is_array($vendorOrderss)) {
<!-- Background css -->
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
<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">
@ -125,9 +143,23 @@ if (is_array($vendorOrderss)) {
<!-- Sidebar Category Block -->
<div class="ec-sidebar-block">
<div class="ec-vendor-block">
<div class="ec-vendor-block-bg" style="background-color:orange; background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
<!-- 03-12-2024 Stacy added placeholder for vendor banner -->
<?php
if (!empty($vendorData['vendor_banner'])) { ?>
<div class="ec-vendor-block-bg" style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
<?php } else { ?>
<div class="ec-vendor-block-bg" style="background-color: orange; background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
<?php } ?>
<!-- <div class="ec-vendor-block-bg" style="background-image: url(<?php #echo $vendorData['vendor_banner'] ?>) !important;"></div> -->
<div class="ec-vendor-block-detail">
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
<!-- <img class="v-img" src=<?php #echo $vendorData['vendor_image'] ?> alt="vendor image"> -->
<!-- 03-12-2024 Stacy added placeholder for vendor profile -->
<?php
if (!empty($vendorData['vendor_image'])) { ?>
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
<?php } else { ?>
<img class="v-img" src="https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg" alt="vendor image">
<?php } ?>
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
</div>
<!-- <div class="ec-vendor-block-items">
@ -213,16 +245,13 @@ if (is_array($vendorOrderss)) {
<td>
<!-- raymart added function feb 21 2024 -->
<?php
if (isset($product['images'])) {
$image_urls = explode(',', $product['images']);
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
# 03-11-2024 Stacy modified
if (isset($orderItems['items'][0]['product']['product_image'])) {
?>
<img class="prod-img" src="<?php echo $first_image_url; ?>" alt="edit" />
<?php
}
<img class="prod-img" src="<?php echo $orderItems['items'][0]['product']['product_image']; ?>" alt="edit" />
<?php
} else {
?>
?>
<img class="prod-img rounded-circle" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019" alt="edit" />
<?php
}
@ -240,9 +269,9 @@ if (is_array($vendorOrderss)) {
<td><span><?php echo $orderItems['status']; ?></span></td>
<td><span><?php echo $orderItems['shipping_address']['shipping_first_name']; ?></span></td>
<td><span><?php echo $item['price']; ?></span></td>
<td style="display: flex; justify-content: center;">
<td style="display:flex; justify-content:center; margin-top:-4px;">
<span onclick="editVendorOrder('<?php echo $orderItems['_id'] ?>');">
<i class="mdi mdi-circle-edit-outline"></i>
<a class="mdi mdi-circle-edit-outline" style="font-size: 20px;"></a>
</span>
</td>
</tr>
@ -329,11 +358,25 @@ if (is_array($vendorOrderss)) {
const totalItems = <?php echo $totalOrders; ?>;
const totalPages = Math.ceil(totalItems / itemsPerPage);
//03-11-2024 Stacy modified for the pagination UI
function showPage(page) {
const startIndex = (page - 1) * itemsPerPage;
const endIndex = startIndex + itemsPerPage;
const tableRows = document.querySelectorAll('#orderItemsBody tr');
// for pagination button
const pager = document.querySelectorAll('.page-btn')
pager.forEach((row, index) => {
if (index!==page-1) {
row.style.backgroundColor="white";
row.style.color="black";
} else {
row.style.backgroundColor="#007bff";
row.style.color="white";
}
});
// document.querySelector('.page-' + page).style.backgroundColor="red";
tableRows.forEach((row, index) => {
if (index >= startIndex && index < endIndex) {
row.style.display = 'table-row';
@ -347,7 +390,10 @@ if (is_array($vendorOrderss)) {
const paginationContainer = document.getElementById('pagination');
for (let i = 1; i <= totalPages; i++) {
const pageButton = document.createElement('button');
// created a tag
const pageButton = document.createElement('a');
// created class for a tag
pageButton.className = "page-btn page-" + i
pageButton.textContent = i;
pageButton.addEventListener('click', () => showPage(i));
paginationContainer.appendChild(pageButton);
@ -365,7 +411,7 @@ if (is_array($vendorOrderss)) {
<div class="ec-header-btn">
<a class="btn btn-lg btn-primary" href="vendor-all-product-list.php">View All</a>
<!-- <a class="btn btn-lg btn-primary" href="vendor-uploads-add-product-action.php">Add</a> -->
<a class="btn btn-lg btn-primary" onclick="addProduct();" href="">Add</a>
<a class="btn btn-lg btn-primary" href="vendor-uploads-add-product-action.php" onclick="addProduct('<?php echo $product['_id'] ?>');">Add</a>
</div>
</div>
<div class="ec-vendor-card-body">
@ -399,7 +445,7 @@ if (is_array($vendorOrderss)) {
if (!empty($image_urls)) {
$first_image_url = trim($image_urls[0]);
?>
<img class="prod-img" src="<?php echo $first_image_url; ?>" alt="edit" />
<img class="prod-img" src="<?php echo $first_image_url; ?>" alt="edit" />
<?php
}
} else {
@ -407,7 +453,8 @@ if (is_array($vendorOrderss)) {
<img class="prod-img rounded-circle" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019" alt="edit" />
<?php
}
?>
?>
<!-- <?php
if (isset($product['product_image']) && !empty($product['product_image'])) {
echo '<img src="' . $product['product_image'] . '" alt="Product Image" class="prod-img" >';
@ -428,6 +475,7 @@ if (is_array($vendorOrderss)) {
</tbody>
</table>
</div>
<div id="pagination"></div>
</div>
</div>
<!-- 02-26-2024 Stacy commented out -->

View File

@ -59,6 +59,30 @@ $products = productList();
});
}
</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;
/* margin: 0 5px; */
border-radius: 4px;
}
.pagination a.active {
background-color: #007bff;
color: #fff;
}
</style>
</head>
<body onload="updateCartItemCount()">
@ -171,7 +195,18 @@ $products = productList();
<div class="section-space-p">
<?php
foreach ($vendors as $vendor) {
$vendors = vendorList();
$totalVendors = count($vendors);
$vendorsPerPage = 10;
$totalPages = ceil($totalVendors / $vendorsPerPage);
$currentpage = isset($_GET['page']) ? $_GET['page'] : 1;
$start = ($currentpage - 1) * $vendorsPerPage;
$end = $start + $vendorsPerPage - 1;
?>
<?php
for ($x = $start; $x <= $end && $x < $totalVendors; $x++) {
$vendor = $vendors[$x];
?>
<!-- Vendor list Section Start -->
<section class="section ec-catalog-multi-vendor margin-bottom-30">
@ -183,7 +218,7 @@ $products = productList();
<a href="catalog-single-vendor.php?id=<?php echo $vendor['_id'] ?>"></a>
<?php
if(!isset($vendor['vendor_image'])){
?><img src="assets/images/vendor/1.jpg" alt="vendor img"><?php
?><img src="https://api.obanana.com/images/storage/web_images/1710214273217-no_image.png" alt="vendor img"><?php
}else{
?><img src="<?php echo $vendor['vendor_image'] ?>" alt="vendor img"><?php
}
@ -233,14 +268,25 @@ $products = productList();
</div>
</div>
</div>
</section>
<!-- Vendor list Section End -->
<?php
}
?>
<!-- 03-11-2024 Stacy added pagination for vendor -->
<!-- Ec Pagination Start -->
<div class="pagination mt-3">
<?php
for ($i = 1; $i <= $totalPages; $i++) {
echo "<a href='?page=$i' class='" . ($currentpage == $i ? 'active' : '') . "'>$i</a>";
}
?>
</div>
<!-- Ec Pagination End -->
</div>
</div>
</div>
</section>
<!-- Vendor list Section End -->
<?php
}
?>
</div>
<!-- Footer Start -->

View File

@ -66,7 +66,7 @@ if (is_array($vendorOrderss)) {
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
<style>
.tab.active {
background-color: #3498db;
background-color: #ffaa00;
/* Set your desired background color for the active tab */
color: #ffffff;
/* Set your desired text color for the active tab */
@ -137,18 +137,37 @@ if (is_array($vendorOrderss)) {
<!-- Sidebar Category Block -->
<div class="ec-sidebar-block">
<div class="ec-vendor-block">
<div class="ec-vendor-block-items">
<ul>
<!-- 03-12-2024 Stacy added placeholder for vendor banner -->
<?php
if (!empty($vendorData['vendor_banner'])) { ?>
<div class="ec-vendor-block-bg" style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
<?php } else { ?>
<div class="ec-vendor-block-bg" style="background-color: orange; background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
<?php } ?>
<!-- <div class="ec-vendor-block-bg" style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div> -->
<div class="ec-vendor-block-detail">
<?php
if (!empty($vendorData['vendor_image'])) { ?>
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
<?php } else { ?>
<img class="v-img" src="https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg" alt="vendor image">
<?php } ?>
<!-- <img class="v-img" src=<?php #echo $vendorData['vendor_image'] ?> alt="vendor image"> -->
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
</div>
<!-- <div class="ec-vendor-block-items">
<!-- <ul>
<li><a href="vendor-dashboard.php">Dashboard</a></li>
<li><a onclick="addProduct();" href="">Upload Product</a></li>
<li><a href="vendor-uploads.php">Upload Product</a></li>
<li><a href="vendor-settings.php">Settings (Edit)</a></li>
<li><a href="user-refund-history.php">User Refund History</a></li>
<li><a href="user-refund-history.php">User Refund History</a></li> -->
<!-- <li><a href="cart.html">Cart</a></li>
<li><a href="checkout.html">Checkout</a></li>
<li><a href="track-order.html">Track Order</a></li>
<li><a href="user-invoice.html">Invoice</a></li> -->
</ul>
</div>
<!-- </ul>
</div> -->
<?php include "vendor-user-tabs.php" ?>
</div>
</div>
</div>
@ -158,7 +177,7 @@ if (is_array($vendorOrderss)) {
<div class="ec-vendor-card-header">
<h5>Refund History</h5>
<div class="ec-header-btn">
<a class="btn btn-lg btn-primary" href="#">Shop Now</a>
<a class="btn btn-lg btn-primary" href="shop-list-left-sidebar2.php">Shop Now</a>
</div>
</div>
<div class="ec-vendor-card-body">
@ -566,6 +585,7 @@ if (is_array($vendorOrderss)) {
<script>
var sessionToken = '<?php echo isset($_SESSION["token"]) ? $_SESSION["token"] : ""; ?>';
var email = '<?php echo isset($_SESSION["email"]) ? $_SESSION["email"] : ""; ?>';
var password = '<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
@ -718,6 +738,16 @@ if (is_array($vendorOrderss)) {
})
}
//S 03-06-2024 Stacy added upload function
function addProduct() {
console.log("Session Token:", sessionToken);
login(email, password, function() {
// Removed the call to updateSessionToken
window.open("vendor-uploads-add-product-action.php", "_self");
});
}
</script>
</div>
</div>

View File

@ -152,7 +152,7 @@ if ($_SESSION["userId"] <> "") {
} else {
$banner_style = 'background-image: url(' . $vendorData['vendor_banner'] . ') !important; width: 100% !important; height: 200px !important; background-size: cover !important; background-position: center !important; background-repeat: no-repeat !important; background-blend-mode: overlay !important; background-color: rgba(0, 0, 0, 0.6) !important; border-radius: 5px !important;';
}
?>
?>
<div class="ec-vendor-block-bg" style="<?php echo $banner_style; ?>">
<a href="#" class="btn btn-lg btn-primary" data-link-action="editmodal" title="Edit Detail" data-bs-toggle="modal" data-bs-target="#edit_modal">Edit Detail</a>
</div>
@ -160,9 +160,14 @@ if ($_SESSION["userId"] <> "") {
<div class="ec-vendor-block-detail">
<!-- 02-26-2024 Stacy added placeholder-->
<?php
$vendor_image = isset($vendorData[0]['vendor_image']) ? $vendorData[0]['vendor_image'] : 'https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg';
?>
<img class="v-img" src=<?php echo $vendor_image ?> alt="vendor image">
if (!empty($vendorData['vendor_image'])) { ?>
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
<?php } else { ?>
<img class="v-img" src="https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg" alt="vendor image">
<?php } ?>
<!-- $vendor_image = isset($vendorData[0]['vendor_image']) ? $vendorData[0]['vendor_image'] : 'https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg'; -->
<!-- <img class="v-img" src=<?php #echo $vendorData['vendor_image'] ?> alt="vendor image"> -->
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
</div>
</div>
@ -387,6 +392,15 @@ if ($_SESSION["userId"] <> "") {
});
}
//S 03-06-2024 Stacy added upload function
function addProduct() {
console.log("Session Token:", sessionToken);
login(email, password, function() {
// Removed the call to updateSessionToken
window.open("vendor-uploads-add-product-action.php", "_self");
});
}
</script>
<script>
const vendorid = `<?php echo $_SESSION["LoggedInVendorId"]; ?>`;

View File

@ -116,15 +116,34 @@ $array = json_decode($result, true);
<!-- Sidebar Category Block -->
<div class="ec-sidebar-block">
<div class="ec-vendor-block">
<!-- 03-12-2024 Stacy added placeholder for vendor banner -->
<?php
if (!empty($vendorData['vendor_banner'])) { ?>
<div class="ec-vendor-block-bg" style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
<?php } else { ?>
<div class="ec-vendor-block-bg" style="background-color: orange; background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
<?php } ?>
<!-- <div class="ec-vendor-block-bg" style="background-image: url(<?php #echo $vendorData['vendor_banner'] ?>) !important;"></div> -->
<div class="ec-vendor-block-detail">
<!-- <img class="v-img" src=<?php #echo $vendorData['vendor_image'] ?> alt="vendor image"> -->
<!-- 03-12-2024 Stacy added placeholder for vendor profile -->
<?php
if (!empty($vendorData['vendor_image'])) { ?>
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
<?php } else { ?>
<img class="v-img" src="https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg" alt="vendor image">
<?php } ?>
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
</div>
<!-- 2024-02-12 Stacy deleted div with class "ec-vendor-block-items", and inserted vendor-profile-tabs.php -->
<div class="ec-vendor-block-items">
<!-- <div class="ec-vendor-block-items">
<ul>
<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>
</div> -->
<?php include "vendor-user-tabs.php" ?>
<!-- 2024-02-12 Stacy deleted div with class "ec-vendor-block-items", and inserted vendor-profile-tabs.php -->
</div>
</div>
@ -141,7 +160,7 @@ $array = json_decode($result, true);
<div class="avatar-upload">
<div class="avatar-edit">
<input type='file' id="imageUpload" class="ec-image-upload" accept=".png, .jpg, .jpeg" multiple onchange="uploadProductImage()" />
<label for="imageUpload"><i class="fi-rr-edit"></i></label>
<label for="imageUpload"><i class="fi-rr-edit" style="margin-top:5px;"></i></label>
</div>
<div class="avatar-preview ec-preview">
<div class="imagePreview ec-div-preview">
@ -416,6 +435,7 @@ $array = json_decode($result, true);
<option value="Appliance" <?php echo ($array['product_category'] === 'Appliance') ? 'selected' : ''; ?>>Appliance</option>
<option value="Smart Home" <?php echo ($array['product_category'] === 'Smart Home') ? 'selected' : ''; ?>>Smart Home</option>
<option value="Home" <?php echo ($array['product_category'] === 'Home') ? 'selected' : ''; ?>>Home</option>
<option value="Apparel" <?php echo ($array['product_category'] === 'Apparel') ? 'selected' : ''; ?>>Apparel</option>
<option value="Heavy Equipment" <?php echo ($array['product_category'] === 'Heavy Equipment') ? 'selected' : ''; ?>>Heavy Equipment</option>
</select>
</div>

View File

@ -8,6 +8,7 @@ $current_page = basename($_SERVER['PHP_SELF']);
<li <?php if ($current_page == 'vendor-dashboard.php') echo 'class="active"'; ?>><a href="vendor-dashboard.php" id="vendor-dashboard-link">Dashboards</a></li>
<li <?php if ($current_page == 'vendor-uploads.php') echo 'class="active"'; ?>><a onclick="addProduct();" id="vendor-uploads-link">Uploads</a></li>
<li <?php if ($current_page == 'vendor-settings.php') echo 'class="active"'; ?>><a href="vendor-settings.php" id="vendor-settings-link">Settings (edit)</a></li>
<li <?php if ($current_page == 'vendor-refund-history.php') echo 'class="active"'; ?>><a href="vendor-refund-history.php" id="vendor-refund-history-link">Vendor Refund History</a></li>
</ul>
</div>