Compare commits
No commits in common. "ba91559ff3d63cf398b5ee5d38f73aa8cbd6671c" and "69a94fdfb0102476048927a79854b31ebf869784" have entirely different histories.
ba91559ff3
...
69a94fdfb0
|
@ -1056,9 +1056,6 @@ $allSignups = array_merge($all_customers, $all_vendors);
|
|||
<div class="card card-table-border-none card-default recent-orders" id="recent-orders">
|
||||
<div class="card-header justify-content-between">
|
||||
<h2>Recent Orders</h2>
|
||||
<!-- <div class="date-range-report">
|
||||
<span></span>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="card-body pt-0 pb-5">
|
||||
<table class="table card-table table-responsive table-responsive-large"
|
||||
|
|
|
@ -93,7 +93,7 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
|
|||
<!-- 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">
|
||||
<form action="vendor-product-search-action.php">
|
||||
|
@ -648,22 +648,22 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
|
|||
</header>
|
||||
|
||||
|
||||
<!-- 3-19-24 raymart added vendor search -->
|
||||
<?php if (!empty($vendorSearchResult['results'])) : ?>
|
||||
<div class="shop-pro-content" style="margin-bottom:40px; margin-right: 2%; margin-left: 2%;">
|
||||
<div class="ec-product-inner">
|
||||
<h5 class="ec-pro-title" style="margin-top: 25px; margin-left: 5%; font-size: 25px;">Vendor Search Results</h5>
|
||||
<div class="row mt-4">
|
||||
<?php
|
||||
$count = 0;
|
||||
foreach ($vendorSearchResult['results'] as $vendor) {
|
||||
if ($count < 2) {
|
||||
?>
|
||||
<div class="col-md-12">
|
||||
<div class="card" style="margin:5px">
|
||||
<div class="card-body">
|
||||
<div class="vendor-info" style="display: flex; align-items: center;">
|
||||
<div class="ec-catalog-vendor" style="display: inline-block;">
|
||||
<!-- 3-19-24 raymart added vendor search -->
|
||||
<?php if (!empty($vendorSearchResult['results'])) : ?>
|
||||
<div class="shop-pro-content" style="margin-bottom:40px; margin-right: 2%; margin-left: 2%;">
|
||||
<div class="ec-product-inner">
|
||||
<h5 class="ec-pro-title" style="margin-top: 25px; margin-left: 5%; font-size: 25px;">Vendor Search Results</h5>
|
||||
<div class="row mt-4">
|
||||
<?php
|
||||
$count = 0;
|
||||
foreach ($vendorSearchResult['results'] as $vendor) {
|
||||
if ($count < 2) {
|
||||
?>
|
||||
<div class="col-md-12">
|
||||
<div class="card" style="margin:5px">
|
||||
<div class="card-body">
|
||||
<div class="vendor-info" style="display: flex; align-items: center;">
|
||||
<div class="ec-catalog-vendor" style="display: inline-block;">
|
||||
<a href="vendor-profile.php?id=<?php echo $vendor["_id"] ?>">
|
||||
<?php if (isset($vendor['vendor_image'])) : ?>
|
||||
<img loading="lazy" src="<?php echo $vendor['vendor_image']; ?>" alt="<?php echo $vendor['user_login']; ?>" class="vendor-image" style="max-width: 100px; max-height: 100px;">
|
||||
|
@ -671,124 +671,117 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
|
|||
<img loading="lazy" 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; ?>
|
||||
</a>
|
||||
</div>
|
||||
<div class="vendor-details" style="display:inline-block;">
|
||||
<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;">
|
||||
<a href="vendor-profile.php?id=<?php echo $vendor["_id"] ?>">
|
||||
<?php echo $vendor['user_login']; ?>
|
||||
</a>
|
||||
</h6>
|
||||
</div>
|
||||
<div class="card text-center" style="margin-left: auto; margin-right: 5px;">
|
||||
<div class="card-body">
|
||||
<h6>Seller Products</h6>
|
||||
<?php
|
||||
$products = productList();
|
||||
$vendorId = $vendor['_id'];
|
||||
$product = array_filter($products, function ($var) use ($vendorId) {
|
||||
return ($var['vendor_api_id'] == $vendorId);
|
||||
});
|
||||
?>
|
||||
<p><?php echo count($product); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card text-center" style="margin-left: 5px; margin-right: 5px;">
|
||||
<div class="card-body">
|
||||
<h6>Seller since</h6>
|
||||
<p>
|
||||
<div class="vendor-details" style="display:inline-block;">
|
||||
<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;">
|
||||
<a href="vendor-profile.php?id=<?php echo $vendor["_id"] ?>">
|
||||
<?php echo $vendor['user_login']; ?>
|
||||
</a>
|
||||
</h6>
|
||||
</div>
|
||||
<div class="card text-center" style="margin-left: auto; margin-right: 5px;">
|
||||
<div class="card-body">
|
||||
<h6>Seller Products</h6>
|
||||
<?php
|
||||
if (!empty($vendor['date_registered'])) {
|
||||
echo $vendor['date_registered'];
|
||||
} else {
|
||||
echo "Not yet registered";
|
||||
}
|
||||
$products = productList();
|
||||
$vendorId = $vendor['_id'];
|
||||
$product = array_filter($products, function ($var) use ($vendorId) {
|
||||
return ($var['vendor_api_id'] == $vendorId);
|
||||
});
|
||||
?>
|
||||
</p>
|
||||
<p><?php echo count($product); ?></p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card text-center" style="margin-left: 5px; margin-right: 5px;">
|
||||
<div class="card-body">
|
||||
<h6>Seller since</h6>
|
||||
<p><?php echo $vendor['date_registered']; ?></p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<!-- vendor search end -->
|
||||
|
||||
<!-- 3-19-24 raymart added Shop content Start -->
|
||||
<div class="shop-pro-content" style="margin-right: 2%; margin-left: 2%;">
|
||||
<div class="shop-pro-inner list-view">
|
||||
<div class="row">
|
||||
<?php
|
||||
// $productSearchResult = [];
|
||||
// foreach ($productSearchResult['results'] as $product => $productListVendor) {
|
||||
// echo "$product .":" . $productListVendor";
|
||||
// $vendorOfProduct = getVendorbyId($product['vendor_api_id']);
|
||||
|
||||
$products = productListVendor($vendorId);
|
||||
$totalProducts = count($products);
|
||||
|
||||
|
||||
for ($i = 0; $i <= $totalProducts - 1; $i++) {
|
||||
$product = $products[$i];
|
||||
?>
|
||||
<div class="col-lg-3 col-md-4 col-sm-6">
|
||||
<div class="card-wrapper">
|
||||
<div class="card-container">
|
||||
<div class="card-top">
|
||||
<div class="image-container" style="height: 300px;"> <!-- Adjust the height as needed -->
|
||||
<?php
|
||||
if (isset($product['images'])) {
|
||||
$image_urls = explode(',', $product['images']);
|
||||
if (!empty($image_urls)) {
|
||||
$first_image_url = trim($image_urls[0]);
|
||||
?>
|
||||
<img loading="lazy" class="img-fluid" src="<?php echo $first_image_url; ?>" alt="edit" style="object-fit: cover; width: 100%; height: 100%;"/>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<img loading="lazy" class="img-fluid rounded-circle" src="https://api.obanana.com/images/storage/web_images/1710214273217-no_image.png" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card-bottom">
|
||||
<h3><?php echo $product['product_name']; ?></h3>
|
||||
<p>₱<?php echo $product['regular_price']; ?></p>
|
||||
</div>
|
||||
<div class="card-action">
|
||||
<div class="card-edit" onclick="editProduct('<?php echo $product['_id'] ?>');"><i class="mdi mdi-circle-edit-outline"></i></div>
|
||||
<div class="card-preview"><i class="mdi mdi-eye-outline"></i></div>
|
||||
<div class="card-remove" onclick="deleteProd('<?php echo $product['_id'] ?>');"><i class="mdi mdi mdi-delete-outline"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
$count++;
|
||||
}
|
||||
?>
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<!-- vendor search end -->
|
||||
<!--Shop content End -->
|
||||
|
||||
<!-- 3-19-24 raymart added function for delete & edit -->
|
||||
<script>
|
||||
|
||||
<!-- 3-19-24 raymart added Shop content Start -->
|
||||
<div class="shop-pro-content" style="margin-right: 2%; margin-left: 2%;">
|
||||
<div class="shop-pro-inner list-view">
|
||||
<div class="row">
|
||||
<?php
|
||||
// $productSearchResult = [];
|
||||
// foreach ($productSearchResult['results'] as $product => $productListVendor) {
|
||||
// echo "$product .":" . $productListVendor";
|
||||
// $vendorOfProduct = getVendorbyId($product['vendor_api_id']);
|
||||
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"] : ""; ?>';
|
||||
|
||||
$products = productListVendor($vendorId);
|
||||
$totalProducts = count($products);
|
||||
|
||||
|
||||
for ($i = 0; $i <= $totalProducts - 1; $i++) {
|
||||
$product = $products[$i];
|
||||
?>
|
||||
<div class="col-lg-3 col-md-4 col-sm-6">
|
||||
<div class="card-wrapper">
|
||||
<div class="card-container">
|
||||
<div class="card-top">
|
||||
<div class="image-container" style="height: 300px;"> <!-- Adjust the height as needed -->
|
||||
<?php
|
||||
if (isset($product['images'])) {
|
||||
$image_urls = explode(',', $product['images']);
|
||||
if (!empty($image_urls)) {
|
||||
$first_image_url = trim($image_urls[0]);
|
||||
?>
|
||||
<img loading="lazy" class="img-fluid" src="<?php echo $first_image_url; ?>" alt="edit" style="object-fit: cover; width: 100%; height: 100%;" />
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<img loading="lazy" class="img-fluid rounded-circle" src="https://api.obanana.com/images/storage/web_images/1710214273217-no_image.png" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="card-bottom">
|
||||
<h3><?php echo $product['product_name']; ?></h3>
|
||||
<p>₱<?php echo $product['regular_price']; ?></p>
|
||||
</div>
|
||||
<div class="card-action">
|
||||
<div class="card-edit" onclick="editProduct('<?php echo $product['_id'] ?>');"><i class="mdi mdi-circle-edit-outline"></i></div>
|
||||
<div class="card-preview"><i class="mdi mdi-eye-outline"></i></div>
|
||||
<div class="card-remove" onclick="deleteProd('<?php echo $product['_id'] ?>');"><i class="mdi mdi mdi-delete-outline"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--Shop content End -->
|
||||
|
||||
<!-- 3-19-24 raymart added function for delete & edit -->
|
||||
<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"] : ""; ?>';
|
||||
|
||||
function editProduct(productId) {
|
||||
function editProduct(productId) {
|
||||
console.log("Session Token:", sessionToken);
|
||||
login(email, password, function() {
|
||||
// Removed the call to updateSessionToken
|
||||
|
@ -825,35 +818,36 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
|
|||
.then(data => {
|
||||
// Update the session token on the server side
|
||||
fetch("update-token-session.php", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
token: data.token
|
||||
})
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
token: data.token
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(result => {
|
||||
if (result.status === 'success') {
|
||||
// Update the session token in the client-side variable
|
||||
sessionToken = data.token;
|
||||
console.log("New Token:", sessionToken);
|
||||
callback();
|
||||
} else {
|
||||
throw new Error("Unable to update session token");
|
||||
}
|
||||
});
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(result => {
|
||||
if (result.status === 'success') {
|
||||
// Update the session token in the client-side variable
|
||||
sessionToken = data.token;
|
||||
console.log("New Token:", sessionToken);
|
||||
callback();
|
||||
} else {
|
||||
throw new Error("Unable to update session token");
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.error("Error:", error.message);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
<!-- 3-19-24 raymart added function for delete & edit -->
|
||||
}
|
||||
|
||||
</script>
|
||||
<!-- 3-19-24 raymart added function for delete & edit -->
|
||||
|
||||
|
||||
<!-- Common Javascript -->
|
||||
<!-- Common Javascript -->
|
||||
<script src="assets/plugins/jquery/jquery-3.5.1.min.js"></script>
|
||||
<script src="assets/js/bootstrap.bundle.min.js"></script>
|
||||
<script src="assets/plugins/simplebar/simplebar.min.js"></script>
|
||||
|
@ -866,6 +860,6 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
|
|||
<!-- Ekka Custom -->
|
||||
<script src="assets/js/ekka.js"></script>
|
||||
|
||||
</body>
|
||||
</body>
|
||||
|
||||
</html>
|
File diff suppressed because it is too large
Load Diff
|
@ -345,6 +345,7 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
|
|||
<p>Level : 9 out of 10</p>
|
||||
</div> -->
|
||||
<div class="col-lg-3 col-md-6 ec-catalog-pro-count pad-15">
|
||||
|
||||
<h6>Seller Products</h6>
|
||||
<?php
|
||||
?>
|
||||
|
@ -352,16 +353,12 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
|
|||
<p><?php echo count($products) ?> Products</p>
|
||||
</div>
|
||||
<div class="col-lg-3 col-md-6 ec-catalog-since pad-15">
|
||||
|
||||
<h6>Seller since</h6>
|
||||
<p>
|
||||
<?php
|
||||
if (!empty($vendor['date_registered'])){
|
||||
echo date('F j, Y', strtotime($vendor['date_registered']));
|
||||
} else {
|
||||
echo "Not Yet Registered";
|
||||
}
|
||||
?>
|
||||
</p>
|
||||
<!-- <p><?php echo $vendor["date_registered"] ?></p> -->
|
||||
<p><?php echo date('F j, Y', strtotime($vendor['date_registered'])); ?></p>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -28,6 +28,10 @@
|
|||
<div class="ec-footer-links">
|
||||
<ul class="align-items-center">
|
||||
<li class="ec-footer-link">16F PMI Tower,Makati, Makati, Philippines</li>
|
||||
<li class="ec-footer-link"><span>Call Us:</span><a
|
||||
href="Mobile:+63 917 722 6002">+63 (2) 8807-6379</a></li>
|
||||
<li class="ec-footer-link"><span>Email:</span><a
|
||||
href="mailto:sales@obanana.com">sales@obanana.com</a></li>
|
||||
<li class="ec-footer-link"><span>Call Us:</span><a
|
||||
href="Mobile:+63 (2) 8807-6379">+63 (2) 8807-6379</a></li>
|
||||
<li class="ec-footer-link"><span>Email:</span><a
|
||||
|
|
|
@ -1802,7 +1802,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="header-top-download">
|
||||
<!-- 04-01-2024 Stacy modified this block of code -->
|
||||
<!-- <button class="text-upper" onclick="displayPopup()">Download App <i aria-hidden="true"></i></button> -->
|
||||
<?php if(!empty($customer_data)) { ?>
|
||||
<?php if(isset($customer_data)) { ?>
|
||||
<button style="cursor:default;">Hi <span
|
||||
class="text-upper"><?php echo $customer_data[0]['first_name'] ?>!</span></button>
|
||||
<?php } else if (isset($vendorData)) {?>
|
||||
|
|
|
@ -408,23 +408,14 @@ xhrVendors.onreadystatechange = function() {
|
|||
if(vendorsResponse.results.length>0){
|
||||
|
||||
vendorsResponse.results.slice(0,6).forEach(function(vendor) {
|
||||
let vendorDateRegistered = "";
|
||||
let vendorId = vendor._id;
|
||||
let productCount = vendorProductCounts[vendorId] || 0;
|
||||
if (vendor.date_registered) {
|
||||
vendorDateRegistered = new Date(vendor.date_registered);
|
||||
} else {
|
||||
vendorDateRegistered = "Not yet registered";
|
||||
}
|
||||
let vendorDateRegistered = new Date(vendor.date_registered);
|
||||
|
||||
// Format the date as "Month DD, YYYY"
|
||||
let options = { month: 'long', day: '2-digit', year: 'numeric' };
|
||||
let formattedDate = "";
|
||||
if (vendorDateRegistered !== "Not yet registered") {
|
||||
formattedDate = vendorDateRegistered.toLocaleDateString('en-US', options);
|
||||
} else {
|
||||
formattedDate = "Not yet registered";
|
||||
}
|
||||
let formattedDate = vendorDateRegistered.toLocaleDateString('en-US', options);
|
||||
|
||||
// Create a product card element
|
||||
let card = document.createElement("div");
|
||||
card.classList.add("col-md-12");
|
||||
|
|
|
@ -205,7 +205,7 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<div class="ec-vendor-detail-block ec-vendor-block-contact space-bottom-30">
|
||||
<h6>Contact number</h6>
|
||||
<ul>
|
||||
<li><strong><?php echo $customer_data['phone_number'] ?></li>
|
||||
<li><strong><?php echo $customer_data[0]['phone_number'] ?></li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -216,9 +216,6 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<div class="shipping">
|
||||
<?php foreach ($customer_data[0]['address'] as $address) : ?>
|
||||
<?php if ($address['shipping']) : ?>
|
||||
<div>
|
||||
<span style="font-size:16px;font-weight:800;">Shipping Address:</span>
|
||||
</div>
|
||||
<div class="sName">
|
||||
<span>Name:
|
||||
<span id="selectedFName"><?php echo $address['first_name']; ?></span>
|
||||
|
@ -239,60 +236,8 @@ if ($_SESSION["isVendor"] == true) {
|
|||
</span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($address['billing']) : ?>
|
||||
<div>
|
||||
<span style="font-size:16px;font-weight:800;">Billing Address:</span>
|
||||
</div>
|
||||
<div class="sName">
|
||||
<span>Name:
|
||||
<span id="selectedBillingFName"><?php echo $address['first_name']; ?></span>
|
||||
<span id="selectedBillingLName"> <?php echo $address['last_name']; ?></span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="sContact">
|
||||
<span id="selectedBillingContact">Contact #: <?php echo $address['phone']; ?></span>
|
||||
</div>
|
||||
<div class="sAddress">
|
||||
<span>Address:
|
||||
<span id="sBillingBuilding"><?php echo $address['address_1']; ?></span>
|
||||
<span id="sBillingStreet"><?php echo $address['address_2']; ?></span>
|
||||
<span id="sBillingBarangay"><?php echo $address['barangay']; ?></span>
|
||||
<span id="sBillingCity"><?php echo $address['city']; ?></span>
|
||||
<span id="sBillingProvince"><?php echo $address['province']; ?></span>
|
||||
<span id="sBillingCountry"><?php echo $address['country']; ?></span>
|
||||
</span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<!-- <div class="billing">
|
||||
<php foreach ($customer_data[0]['address'] as $address) : ?>
|
||||
<php if ($address['billing']) : ?>
|
||||
<div>
|
||||
<span style="font-size:16px;font-weight:800;"><php var_dump($address); ?>Billing Address:</span>
|
||||
</div>
|
||||
<div class="sName">
|
||||
<span>Name:
|
||||
<span id="selectedBillingFName"><php echo $address['first_name']; ?></span>
|
||||
<span id="selectedBillingLName"> <php echo $address['last_name']; ?></span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="sContact">
|
||||
<span id="selectedBillingContact">Contact #: <php echo $address['phone']; ?></span>
|
||||
</div>
|
||||
<div class="sAddress">
|
||||
<span>Address:
|
||||
<span id="sBillingBuilding"><php echo $address['address_1']; ?></span>
|
||||
<span id="sBillingStreet"><php echo $address['address_2']; ?></span>
|
||||
<span id="sBillingBarangay"><php echo $address['barangay']; ?></span>
|
||||
<span id="sBillingCity"><php echo $address['city']; ?></span>
|
||||
<span id="sBillingProvince"><php echo $address['province']; ?></span>
|
||||
<span id="sBillingCountry"><php echo $address['country']; ?></span>
|
||||
</span>
|
||||
</div>
|
||||
<php endif; ?>
|
||||
<php endforeach; ?>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -319,16 +264,16 @@ if ($_SESSION["isVendor"] == true) {
|
|||
<div class="card-body">
|
||||
<div class="selectCon">
|
||||
<div class="selectWrap" style="display: flex; justify-content: center; align-items: center; width: 50%;">
|
||||
<input type="radio" style="padding-left: 0px !important; margin: 0px 0px !important;" name="selectedBillingAddress[<?php echo $customer_index; ?>]" id="billing_address_<?php echo $customer_index; ?>_<?php echo $address_index; ?>" value="<?php echo $customer_index; ?>_<?php echo $address_index; ?>" class="form-check-input" onchange="updateAddressBilling('<?php echo $customer['_id']; ?>', <?php echo $address_index; ?>, true)" <?php echo $address["billing"] ? 'checked' : ''; ?>>
|
||||
<!-- <input type="radio" style="padding-left: 0px !important; margin: 0px 0px !important;" name="selectedBillingAddress[<?php # echo $customer_index; ?>]" id="billing_address_<?php # echo $customer_index; ?>_<?php # echo $address_index; ?>" value="<?php # echo $customer_index; ?>_<?php # echo $address_index; ?>" class="form-check-input" <?php # echo $address["billing"] ? 'checked' : ''; ?>> -->
|
||||
<!-- <input type="radio" style="padding-left: 0px !important; margin: 0px 0px !important;" name="selectedBillingAddress[<?php # echo $customer_index; ?>]" id="billing_address_<?php # echo $customer_index; ?>_<?php # echo $address_index; ?>" value="<?php # echo $customer_index; ?>_<?php # echo $address_index; ?>" class="form-check-input" onchange="updateAddressBilling('<?php # echo $customer['_id']; ?>', <?php # echo $address_index; ?>, true)" <?php # echo $address["billing"] ? 'checked' : ''; ?>> -->
|
||||
<input type="radio" style="padding-left: 0px !important; margin: 0px 0px !important;" name="selectedBillingAddress[<?php echo $customer_index; ?>]" id="billing_address_<?php echo $customer_index; ?>_<?php echo $address_index; ?>" value="<?php echo $customer_index; ?>_<?php echo $address_index; ?>" class="form-check-input" <?php echo $address["billing"] ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" style="margin: 0px 10px !important;" for="billing_address_<?php echo $customer_index; ?>_<?php echo $address_index; ?>">
|
||||
Billing Address
|
||||
</label>
|
||||
</div>
|
||||
|
||||
<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' : ''; ?>>
|
||||
<!-- <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" <?php # echo $address["billing"] ? 'checked' : ''; ?>> -->
|
||||
<!-- <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' : ''; ?>> -->
|
||||
<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" <?php echo $address["billing"] ? 'checked' : ''; ?>>
|
||||
<label class="form-check-label" style="margin: 0px 10px !important;" for="shipping_address_<?php echo $customer_index; ?>_<?php echo $address_index; ?>">
|
||||
Shipping Address
|
||||
</label>
|
||||
|
@ -368,7 +313,7 @@ if ($_SESSION["isVendor"] == true) {
|
|||
</div>
|
||||
<?php } ?>
|
||||
<?php } ?>
|
||||
<!-- <button type="button" onclick="updateAddressBilling('<?php # echo $customer['_id']; ?>', <?php # echo $address_index; ?>, true)">Use Selected Address</button> -->
|
||||
<button type="button" onclick="updateAddressBilling('<?php echo $customer['_id']; ?>', <?php echo $address_index; ?>, true)">Use Selected Address</button>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1140,27 +1085,6 @@ if ($_SESSION["isVendor"] == true) {
|
|||
if (!updateResponse.ok) {
|
||||
throw new Error(`Failed to update address: ${updateResponse.status}`);
|
||||
}
|
||||
|
||||
const selectedBillingElement = document.getElementById('selectedBillingFName');
|
||||
const selectedBillingLNameElement = document.getElementById('selectedBillingLName');
|
||||
const selectedBillingContactElement = document.getElementById('selectedBillingContact');
|
||||
const sBillingBuildingElement = document.getElementById('sBillingBuilding');
|
||||
const sBillingStreetElement = document.getElementById('sBillingStreet');
|
||||
const sBillingBarangayElement = document.getElementById('sBillingBarangay');
|
||||
const sBillingCityElement = document.getElementById('sBillingCity');
|
||||
const sBillingProvinceElement = document.getElementById('sBillingProvince');
|
||||
const sBillingCountryElement = document.getElementById('sBillingCountry');
|
||||
if (selectedBillingElement) {
|
||||
selectedBillingElement.textContent = customerData.address[addressIndex].first_name;
|
||||
selectedBillingLNameElement.textContent = customerData.address[addressIndex].last_name;
|
||||
selectedBillingContactElement.textContent = 'Contact #: ' + customerData.address[addressIndex].phone;
|
||||
sBillingBuildingElement.textContent = customerData.address[addressIndex].address_1;
|
||||
sBillingStreetElement.textContent = customerData.address[addressIndex].address_2;
|
||||
sBillingBarangayElement.textContent = customerData.address[addressIndex].barangay;
|
||||
sBillingCityElement.textContent = customerData.address[addressIndex].city;
|
||||
sBillingProvinceElement.textContent = customerData.address[addressIndex].province;
|
||||
sBillingCountryElement.textContent = customerData.address[addressIndex].country;
|
||||
}
|
||||
console.log(`Address updated successfully for customer ${customerId}`);
|
||||
} catch (error) {
|
||||
console.error('Error updating address:', error.message);
|
||||
|
@ -1238,8 +1162,8 @@ if ($_SESSION["isVendor"] == true) {
|
|||
sCountryElement.textContent = customerData.address[addressIndex].country;
|
||||
}
|
||||
console.log(`Address updated successfully for customer ${customerId}`);
|
||||
// location.reload();
|
||||
// header("location: user-profile.php");
|
||||
location.reload();
|
||||
header("location: user-profile.php");
|
||||
} catch (error) {
|
||||
console.error('Error updating address:', error.message);
|
||||
}
|
||||
|
|
|
@ -137,13 +137,13 @@ $vendorPayoutData = json_decode($response, true);
|
|||
<div class="col-12">
|
||||
<div class="row ec_breadcrumb_inner">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<h2 class="ec-breadcrumb-title">Vendor Payouts</h2>
|
||||
<h2 class="ec-breadcrumb-title">Vendor Settings</h2>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<!-- ec-breadcrumb-list start -->
|
||||
<ul class="ec-breadcrumb-list">
|
||||
<li class="ec-breadcrumb-item"><a href="index.php">Home</a></li>
|
||||
<li class="ec-breadcrumb-item active">Payouts</li>
|
||||
<li class="ec-breadcrumb-item active">Settings</li>
|
||||
</ul>
|
||||
<!-- ec-breadcrumb-list end -->
|
||||
</div>
|
||||
|
|
|
@ -265,6 +265,10 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
</span>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<div class="billing">
|
||||
<?php foreach ($vendorData['address'] as $address) : ?>
|
||||
<?php if ($address['billing']) : ?>
|
||||
<div>
|
||||
<span style="font-size:16px;font-weight:800;">Billing Address:</span>
|
||||
|
@ -291,34 +295,6 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
<?php endif; ?>
|
||||
<?php endforeach; ?>
|
||||
</div>
|
||||
<!-- <div class="billing">
|
||||
<php foreach ($vendorData['address'] as $address) : ?>
|
||||
<php if ($address['billing']) : ?>
|
||||
<div>
|
||||
<span style="font-size:16px;font-weight:800;">Billing Address:</span>
|
||||
</div>
|
||||
<div class="sName">
|
||||
<span>Name:
|
||||
<span id="selectedBillingFName"><php echo $address['first_name']; ?></span>
|
||||
<span id="selectedBillingLName"> <php echo $address['last_name']; ?></span>
|
||||
</span>
|
||||
</div>
|
||||
<div class="sContact">
|
||||
<span id="selectedBillingContact">Contact #: <php echo $address['phone']; ?></span>
|
||||
</div>
|
||||
<div class="sAddress">
|
||||
<span>Address:
|
||||
<span id="sBillingBuilding"><php echo $address['address_1']; ?></span>
|
||||
<span id="sBillingStreet"><php echo $address['address_2']; ?></span>
|
||||
<span id="sBillingBarangay"><php echo $address['barangay']; ?></span>
|
||||
<span id="sBillingCity"><php echo $address['city']; ?></span>
|
||||
<span id="sBillingProvince"><php echo $address['province']; ?></span>
|
||||
<span id="sBillingCountry"><php echo $address['country']; ?></span>
|
||||
</span>
|
||||
</div>
|
||||
<php endif; ?>
|
||||
<php endforeach; ?>
|
||||
</div> -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -31,19 +31,19 @@ $token = $_SESSION["token"];
|
|||
|
||||
|
||||
$response = addProduct(
|
||||
$vendorId,
|
||||
$productName,
|
||||
$stock,
|
||||
$price,
|
||||
$salePrice,
|
||||
$weight,
|
||||
$length,
|
||||
$width,
|
||||
$height,
|
||||
$specifications,
|
||||
$productType,
|
||||
$parentId,
|
||||
$token);
|
||||
$vendorId,
|
||||
$productName,
|
||||
$stock,
|
||||
$price,
|
||||
$salePrice,
|
||||
$weight,
|
||||
$length,
|
||||
$width,
|
||||
$height,
|
||||
$specifications,
|
||||
$productType,
|
||||
$parentId,
|
||||
$token);
|
||||
$array = json_decode($response,true);
|
||||
$_SESSION['newProductId'] = $array['_id'];
|
||||
header("location: vendor-uploads.php");
|
||||
|
|
|
@ -54,32 +54,32 @@ for ($i = 0; $i < count($quantities); $i++) {
|
|||
|
||||
|
||||
$response = editProduct(
|
||||
$productId,
|
||||
$vendorId,
|
||||
$productName,
|
||||
$stock,
|
||||
$ndd,
|
||||
$sdd,
|
||||
$freeSf,
|
||||
$price,
|
||||
$salePrice,
|
||||
$weight,
|
||||
$length,
|
||||
$width,
|
||||
$height,
|
||||
$description,
|
||||
$specifications,
|
||||
$productType,
|
||||
$productCategory,
|
||||
$productSf,
|
||||
$productStatus,
|
||||
$parentId,
|
||||
$minimumOrder,
|
||||
$color,
|
||||
$material,
|
||||
$size,
|
||||
$priceMatrix,
|
||||
$token);
|
||||
$productId,
|
||||
$vendorId,
|
||||
$productName,
|
||||
$stock,
|
||||
$ndd,
|
||||
$sdd,
|
||||
$freeSf,
|
||||
$price,
|
||||
$salePrice,
|
||||
$weight,
|
||||
$length,
|
||||
$width,
|
||||
$height,
|
||||
$description,
|
||||
$specifications,
|
||||
$productType,
|
||||
$productCategory,
|
||||
$productSf,
|
||||
$productStatus,
|
||||
$parentId,
|
||||
$minimumOrder,
|
||||
$color,
|
||||
$material,
|
||||
$size,
|
||||
$priceMatrix,
|
||||
$token);
|
||||
$array = json_decode($response,true);
|
||||
$_SESSION['newProdictId'] = $array['_id'];
|
||||
header("location: vendor-all-product-list.php");
|
||||
|
|
|
@ -345,32 +345,32 @@ if ($_SESSION["isCustomer"] == true) {
|
|||
<div class="col-md-12">
|
||||
<label for="slug" class="col-12 col-form-label">Slug</label>
|
||||
<div class="col-12">
|
||||
<input id="slug" name="slug" class="form-control here set-slug" type="text" required>
|
||||
<input id="slug" name="slug" class="form-control here set-slug" type="text">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<!-- <label for="weight" class="form-label">Weight</label> -->
|
||||
<!-- raymart edit weight -->
|
||||
<label for="weight" class="form-label">Weight(grams)</label>
|
||||
<input type="number" class="form-control slug-title" id="width" name="weight" value="<?php echo $array['weight']; ?>" required>
|
||||
<input type="number" class="form-control slug-title" id="width" name="weight" value="<?php echo $array['weight']; ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<!-- <label for="length" class="form-label">Length</label> -->
|
||||
<!-- raymart edit length -->
|
||||
<label for="length" class="form-label">Length(cm)</label>
|
||||
<input type="number" class="form-control slug-title" id="width" name="length" value="<?php echo $array['length']; ?>" required>
|
||||
<input type="number" class="form-control slug-title" id="width" name="length" value="<?php echo $array['length']; ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<!-- <label for="width" class="form-label">Width</label> -->
|
||||
<!-- raymart edit width -->
|
||||
<label for="width" class="form-label">Width(cm)</label>
|
||||
<input type="number" class="form-control slug-title" id="width" name="width" value="<?php echo $array['width']; ?>" required>
|
||||
<input type="number" class="form-control slug-title" id="width" name="width" value="<?php echo $array['width']; ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<!-- <label for="height" class="form-label">Height</label> -->
|
||||
<!-- raymart edit height -->
|
||||
<label for="height" class="form-label">Height(cm)</label>
|
||||
<input type="number" class="form-control slug-title" id="height" name="height" value="<?php echo $array['height']; ?>" required>
|
||||
<input type="number" class="form-control slug-title" id="height" name="height" value="<?php echo $array['height']; ?>">
|
||||
</div>
|
||||
<!-- raymart added short des feb 21 2024 -->
|
||||
<div class="col-md-12">
|
||||
|
|
Loading…
Reference in New Issue