Compare commits
35 Commits
d4584e6cf1
...
10ccc1d7fe
Author | SHA1 | Date |
---|---|---|
Jun Barroga | 10ccc1d7fe | |
MarkHipe | 0f4d180411 | |
Stacy | 1b4746336f | |
Stacy | 2a4f5a4755 | |
Stacy | a05bd1db37 | |
Stacy | ba7ef1d47d | |
MarkHipe | 424dfd8ca4 | |
gelonspr | 011ae8496e | |
gelonspr | 7f571bd37a | |
MarkHipe | ae80b26726 | |
jouls | ff0fb59674 | |
MarkHipe | 5e606c9199 | |
raymart | 0e1d96069a | |
raymart | 342edfe2a0 | |
raymart | 2fad9e25fc | |
jouls | 844ef1ff6f | |
raymart | c4f30aa999 | |
MarkHipe | 6648db6a5d | |
Stacy | 951859d610 | |
Stacy | 3219755a31 | |
Stacy | 7ab78b909b | |
gelonspr | 64c5c756c0 | |
jouls | 41e64df669 | |
gelonspr | 85d8f31847 | |
jouls | c3523bfddc | |
jouls | 957b1f2249 | |
jouls | d941237b30 | |
jouls | 00bcc4441f | |
jouls | ecf89b070f | |
MarkHipe | c6c1995baf | |
jouls | 1067ee2efd | |
jouls | 8eb07ad94f | |
jouls | 947f491a23 | |
jouls | ce9edf6593 | |
jouls | 9d3c301ab5 |
|
@ -9,14 +9,14 @@
|
|||
|
||||
<!-- 03-07-2024 Stacy & Raymart modified this block of code -->
|
||||
<div class="search-form d-lg-inline-block">
|
||||
<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>
|
||||
<form action="vendor-product-search-action.php">
|
||||
<div class="input-group">
|
||||
<input type="text" name="search" id="search-input" class="form-control" placeholder="search for vendor with products.." 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>
|
||||
|
|
|
@ -65,6 +65,7 @@ $response = editProduct(
|
|||
$color,
|
||||
$material,
|
||||
$size,
|
||||
$priceMatrix,
|
||||
$token);
|
||||
$array = json_decode($response, true);
|
||||
$_SESSION['prodictId'] = $array['_id'];
|
||||
|
|
|
@ -907,6 +907,33 @@ $vendorId = $_SESSION["vendorId"];
|
|||
)</span></label>
|
||||
<input type="number" class="form-control" id="price2" name="sale_price" value="<?php echo $array['sale_price'] ?>">
|
||||
</div>
|
||||
|
||||
<!-- 3-20-24 raymart added table for price matrix -->
|
||||
<div class="col-md-12">
|
||||
<label class="form-label">Price Matrix</label>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Quantity</th>
|
||||
<th scope="col">Price (PHP)</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="price-matrix-body">
|
||||
<?php foreach ($array['price_matrix'][0] as $index => $pair) : ?>
|
||||
<tr data-row-index="<?php echo $index; ?>">
|
||||
<td><input type="number" class="form-control" name="quantity[]" value="<?php echo $pair['quantity']; ?>"></td>
|
||||
<td><input type="number" class="form-control" name="price[]" value="<?php echo $pair['price']; ?>"></td>
|
||||
<td><button type="button" class="btn btn-danger delete-row">Delete</button></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
<button type="button" class="btn btn-secondary" id="add-row">Add Row</button>
|
||||
</div>
|
||||
<!-- 3-20-24 raymart added table for price matrix -->
|
||||
|
||||
<!-- 02-19-2024 Jun Jihad Promo Field Product Upload Vendor Page -->
|
||||
<div class="col-md-12" style="margin: 0 0 20px 0;">
|
||||
<label class="form-label">Promo</label>
|
||||
|
@ -1021,6 +1048,100 @@ $vendorId = $_SESSION["vendorId"];
|
|||
newquill.on('text-change', function() {
|
||||
document.getElementById('short-hidden-editor').value = newquill.root.innerHTML;
|
||||
});
|
||||
|
||||
// 3-20-24 raymart added function for price matrix
|
||||
document.getElementById("add-row").addEventListener("click", function() {
|
||||
var newRow = '<tr>' +
|
||||
'<td><input type="number" class="form-control quantity-input" name="quantity[]"></td>' +
|
||||
'<td><input type="number" class="form-control" name="price[]"></td>' +
|
||||
'<td><button type="button" class="btn btn-danger delete-row">Delete</button></td>' +
|
||||
'</tr>';
|
||||
document.getElementById("price-matrix-body").insertAdjacentHTML('beforeend', newRow);
|
||||
|
||||
var quantityInputs = document.querySelectorAll('.quantity-input');
|
||||
var lastIndex = quantityInputs.length - 1;
|
||||
quantityInputs[lastIndex].addEventListener('blur', function(event) {
|
||||
checkQuantity(event, lastIndex);
|
||||
});
|
||||
});
|
||||
|
||||
document.getElementById("price-matrix-body").addEventListener("click", function(event) {
|
||||
if (event.target.classList.contains("delete-row")) {
|
||||
event.preventDefault();
|
||||
var rows = document.querySelectorAll("#price-matrix-body tr");
|
||||
if (rows.length > 1) {
|
||||
event.target.closest("tr").remove();
|
||||
} else {
|
||||
alert("At least one row is required.");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function checkQuantity(event, index) {
|
||||
var currentInput = event.target;
|
||||
var previousRow = currentInput.parentNode.parentNode.previousElementSibling;
|
||||
var nextRow = currentInput.parentNode.parentNode.nextElementSibling;
|
||||
|
||||
if (previousRow !== null) {
|
||||
var previousQuantityInput = previousRow.querySelector('input[name="quantity[]"]');
|
||||
var currentQuantity = parseInt(currentInput.value);
|
||||
var previousQuantity = parseInt(previousQuantityInput.value);
|
||||
|
||||
if (currentQuantity <= previousQuantity) {
|
||||
alert("Quantity must be greater than the previous row's quantity.");
|
||||
currentInput.value = previousQuantity + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (nextRow !== null) {
|
||||
var nextQuantityInput = nextRow.querySelector('input[name="quantity[]"]');
|
||||
var nextQuantity = parseInt(nextQuantityInput.value);
|
||||
|
||||
if (currentQuantity >= nextQuantity) {
|
||||
alert("Quantity must be less than the next row's quantity.");
|
||||
currentInput.value = nextQuantity - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkExistingQuantity(row) {
|
||||
var currentInput = row.querySelector('input[name="quantity[]"]');
|
||||
var allRows = document.querySelectorAll("#price-matrix-body tr");
|
||||
var currentIndex = Array.from(allRows).indexOf(row);
|
||||
|
||||
for (var i = currentIndex - 1; i >= 0; i--) {
|
||||
var previousRow = allRows[i];
|
||||
var previousQuantityInput = previousRow.querySelector('input[name="quantity[]"]');
|
||||
var currentQuantity = parseInt(currentInput.value);
|
||||
var previousQuantity = parseInt(previousQuantityInput.value);
|
||||
|
||||
if (currentQuantity <= previousQuantity) {
|
||||
alert("Quantity must be greater than the previous row's quantity.");
|
||||
currentInput.value = previousQuantity + 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var nextRow = allRows[currentIndex + 1];
|
||||
if (nextRow !== undefined) {
|
||||
var nextQuantityInput = nextRow.querySelector('input[name="quantity[]"]');
|
||||
var nextQuantity = parseInt(nextQuantityInput.value);
|
||||
|
||||
if (currentQuantity >= nextQuantity) {
|
||||
alert("Quantity must be less than the next row's quantity.");
|
||||
currentInput.value = nextQuantity - 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById("price-matrix-body").addEventListener("blur", function(event) {
|
||||
if (event.target.tagName === "INPUT" && event.target.name === "quantity[]") {
|
||||
checkExistingQuantity(event.target.closest("tr"));
|
||||
}
|
||||
}, true);
|
||||
// 3-20-24 raymart added function for price matrix
|
||||
|
||||
</script>
|
||||
<script>
|
||||
function onload() {
|
||||
|
@ -1133,6 +1254,7 @@ $vendorId = $_SESSION["vendorId"];
|
|||
// 03-14-2024 Jun Jihad modified this block of code to properly upload images with comma in the filename
|
||||
Promise.all(promises)
|
||||
.then(filenames => {
|
||||
// const updatedImages = existingImages.concat(filenames.map(filename => `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/product_uploads/${filename}`));
|
||||
const updatedImages = existingImages.concat(filenames.map(filename => `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/product_uploads/${encodeURIComponent(filename)}`));
|
||||
|
||||
if (!Array.isArray(updatedImages)) {
|
||||
|
|
|
@ -5,6 +5,7 @@ $_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 +15,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 +67,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" />
|
||||
|
@ -80,564 +84,12 @@ $products = productList();
|
|||
<!-- LEFT MAIN SIDEBAR -->
|
||||
<?php include 'left-main-sidebar.php' ?>
|
||||
|
||||
<!-- HEADER -->
|
||||
<?php include 'header.php' ?>
|
||||
|
||||
<!-- PAGE WRAPPER -->
|
||||
<div class="ec-page-wrapper">
|
||||
|
||||
<!-- Header -->
|
||||
<header class="ec-main-header" id="header">
|
||||
<nav class="navbar navbar-static-top navbar-expand-lg">
|
||||
<!-- Sidebar toggle button -->
|
||||
<button id="sidebar-toggler" class="sidebar-toggle"></button>
|
||||
<!-- search form -->
|
||||
<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>
|
||||
<div id="search-results-container">
|
||||
<ul id="search-results"></ul>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- navbar right -->
|
||||
<div class="navbar-right">
|
||||
<ul class="nav navbar-nav">
|
||||
<!-- User Account -->
|
||||
<li class="dropdown user-menu">
|
||||
<button class="dropdown-toggle nav-link ec-drop" data-bs-toggle="dropdown" aria-expanded="false">
|
||||
<img src="assets/img/user/user.png" class="user-image" alt="User Image" />
|
||||
</button>
|
||||
<ul class="dropdown-menu dropdown-menu-right ec-dropdown-menu">
|
||||
<!-- User image -->
|
||||
<li class="dropdown-header">
|
||||
<img src="assets/img/user/user.png" class="img-circle" alt="User Image" />
|
||||
<div class="d-inline-block">
|
||||
John Deo <small class="pt-1">john.example@gmail.com</small>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<a href="user-profile.html">
|
||||
<i class="mdi mdi-account"></i> My Profile
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="mdi mdi-email"></i> Message
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#"> <i class="mdi mdi-diamond-stone"></i> Projects </a>
|
||||
</li>
|
||||
<li class="right-sidebar-in">
|
||||
<a href="javascript:0"> <i class="mdi mdi-settings-outline"></i> Setting </a>
|
||||
</li>
|
||||
<li class="dropdown-footer">
|
||||
<a href="/logout.php"> <i class="mdi mdi-logout"></i> Log Out </a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="dropdown notifications-menu custom-dropdown">
|
||||
<button class="dropdown-toggle notify-toggler custom-dropdown-toggler">
|
||||
<i class="mdi mdi-bell-outline"></i>
|
||||
</button>
|
||||
|
||||
<div class="card card-default dropdown-notify dropdown-menu-right mb-0">
|
||||
<div class="card-header card-header-border-bottom px-3">
|
||||
<h2>Notifications</h2>
|
||||
</div>
|
||||
|
||||
<div class="card-body px-0 py-0">
|
||||
<ul class="nav nav-tabs nav-style-border p-0 justify-content-between" id="myTab" role="tablist">
|
||||
<li class="nav-item mx-3 my-0 py-0">
|
||||
<a href="#" class="nav-link active pb-3" id="home2-tab" data-bs-toggle="tab" data-bs-target="#home2" role="tab" aria-controls="home2" aria-selected="true">All (10)</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item mx-3 my-0 py-0">
|
||||
<a href="#" class="nav-link pb-3" id="profile2-tab" data-bs-toggle="tab" data-bs-target="#profile2" role="tab" aria-controls="profile2" aria-selected="false">Msgs (5)</a>
|
||||
</li>
|
||||
|
||||
<li class="nav-item mx-3 my-0 py-0">
|
||||
<a href="#" class="nav-link pb-3" id="contact2-tab" data-bs-toggle="tab" data-bs-target="#contact2" role="tab" aria-controls="contact2" aria-selected="false">Others (5)</a>
|
||||
</li>
|
||||
</ul>
|
||||
|
||||
<div class="tab-content" id="myTabContent3">
|
||||
<div class="tab-pane fade show active" id="home2" role="tabpanel">
|
||||
<ul class="list-unstyled" data-simplebar style="height: 360px">
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u2.jpg" alt="Image">
|
||||
<span class="status away"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Nitin</h4>
|
||||
<p class="last-msg">Lorem ipsum dolor sit, amet
|
||||
consectetur adipisicing elit. Nam itaque
|
||||
doloremque odio, eligendi delectus vitae.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 30 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification media-active">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u1.jpg" alt="Image">
|
||||
<span class="status active"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Lovina</h4>
|
||||
<p class="last-msg">Donec mattis augue a nisl
|
||||
consequat, nec imperdiet ex rutrum. Fusce et
|
||||
vehicula enim. Sed in enim eu odio vehic.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-white">
|
||||
<i class="mdi mdi-clock-outline"></i> Just
|
||||
now...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u5.jpg" alt="Image">
|
||||
<span class="status away"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Crinali</h4>
|
||||
<p class="last-msg">Lorem ipsum dolor sit, amet
|
||||
consectetur adipisicing elit. Nam itaque
|
||||
doloremque odio, eligendi delectus vitae.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification event-active">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-info text-white">
|
||||
<i class="mdi mdi-calendar-check font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Upcomming event added</h4>
|
||||
<p class="last-msg font-size-14">03/Jan/2020 (1pm -
|
||||
2pm)</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 10 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-warning text-white">
|
||||
<i class="mdi mdi-chart-areaspline font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Yearly Sales report</h4>
|
||||
<p class="last-msg font-size-14">Lorem ipsum dolor
|
||||
sit, amet consectetur adipisicing elit. Nam
|
||||
itaque doloremque odio, eligendi delectus vitae.
|
||||
</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-primary text-white">
|
||||
<i class="mdi mdi-account-multiple-check font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">New request</h4>
|
||||
<p class="last-msg font-size-14">Add Dany Jones as
|
||||
your contact consequat nec imperdiet ex rutrum.
|
||||
Fusce et vehicula enim. Sed in enim.</p>
|
||||
|
||||
<span class="my-1 btn btn-sm btn-success">Accept</span>
|
||||
<span class="my-1 btn btn-sm btn-secondary">Delete</span>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary d-block">
|
||||
<i class="mdi mdi-clock-outline"></i> 5 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-danger text-white">
|
||||
<i class="mdi mdi-server-network-off font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Server overloaded</h4>
|
||||
<p class="last-msg font-size-14">Donec mattis augue
|
||||
a nisl consequat, nec imperdiet ex rutrum. Fusce
|
||||
et vehicula enim. Sed in enim eu odio vehic.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 30 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-purple text-white">
|
||||
<i class="mdi mdi-playlist-check font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Task complete</h4>
|
||||
<p class="last-msg font-size-14">Nam ut nisi erat.
|
||||
Ut quis tortor varius, hendrerit arcu quis,
|
||||
congue nisl. In scelerisque, sem ut ve.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 2 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="profile2" role="tabpanel">
|
||||
<ul class="list-unstyled" data-simplebar style="height: 360px">
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u6.jpg" alt="Image">
|
||||
<span class="status away"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Hardiko</h4>
|
||||
<p class="last-msg">Donec mattis augue a nisl
|
||||
consequat, nec imperdiet ex rutrum. Fusce et
|
||||
vehicula enim. Sed in enim eu odio vehic.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u7.jpg" alt="Image">
|
||||
<span class="status away"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Browin</h4>
|
||||
<p class="last-msg">Nam ut nisi erat. Ut quis tortor
|
||||
varius, hendrerit arcu quis, congue nisl. In
|
||||
scelerisque, sem ut ve.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification media-active">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u1.jpg" alt="Image">
|
||||
<span class="status active"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">jenelia</h4>
|
||||
<p class="last-msg">Donec mattis augue a nisl
|
||||
consequat, nec imperdiet ex rutrum. Fusce et
|
||||
vehicula enim. Sed in enim eu odio vehic.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-white">
|
||||
<i class="mdi mdi-clock-outline"></i> Just
|
||||
now...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u2.jpg" alt="Image">
|
||||
<span class="status away"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Bhavlio</h4>
|
||||
<p class="last-msg">Lorem ipsum dolor sit, amet
|
||||
consectetur adipisicing elit. Nam itaque
|
||||
doloremque odio, eligendi delectus vitae.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
<div class="position-relative mr-3">
|
||||
<img class="rounded-circle" src="assets/img/user/u5.jpg" alt="Image">
|
||||
<span class="status away"></span>
|
||||
</div>
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Browini</h4>
|
||||
<p class="last-msg">Lorem ipsum dolor sit, amet
|
||||
consectetur adipisicing elit. Nam itaque
|
||||
doloremque odio, eligendi delectus vitae.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="tab-pane fade" id="contact2" role="tabpanel">
|
||||
<ul class="list-unstyled" data-simplebar style="height: 360px">
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification event-active">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-info text-white">
|
||||
<i class="mdi mdi-calendar-check font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Upcomming event added</h4>
|
||||
<p class="last-msg font-size-14">03/Jan/2020 (1pm -
|
||||
2pm)</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 10 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-warning text-white">
|
||||
<i class="mdi mdi-chart-areaspline font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">New Sales report</h4>
|
||||
<p class="last-msg font-size-14">Lorem ipsum dolor
|
||||
sit, amet consectetur adipisicing elit. Nam
|
||||
itaque doloremque odio, eligendi delectus vitae.
|
||||
</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 1 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-primary text-white">
|
||||
<i class="mdi mdi-account-multiple-check font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">New Request</h4>
|
||||
<p class="last-msg font-size-14">Add Dany Jones as
|
||||
your contact consequat nec imperdiet ex rutrum.
|
||||
Fusce et vehicula enim. Sed in enim.</p>
|
||||
|
||||
<span class="my-1 btn btn-sm btn-success">Accept</span>
|
||||
<span class="my-1 btn btn-sm btn-secondary">Delete</span>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary d-block">
|
||||
<i class="mdi mdi-clock-outline"></i> 5 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-danger text-white">
|
||||
<i class="mdi mdi-server-network-off font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">Server overloaded</h4>
|
||||
<p class="last-msg font-size-14">Donec mattis augue
|
||||
a nisl consequat, nec imperdiet ex rutrum. Fusce
|
||||
et vehicula enim. Sed in enim eu odio vehic.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 30 min
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
|
||||
<li>
|
||||
<a href="javscript:void(0)" class="media media-message media-notification">
|
||||
|
||||
<div class="d-flex rounded-circle align-items-center justify-content-center mr-3 media-icon iconbox-45 bg-purple text-white">
|
||||
<i class="mdi mdi-playlist-check font-size-20"></i>
|
||||
</div>
|
||||
|
||||
<div class="media-body d-flex justify-content-between">
|
||||
<div class="message-contents">
|
||||
<h4 class="title">New Task complete</h4>
|
||||
<p class="last-msg font-size-14">Nam ut nisi erat.
|
||||
Ut quis tortor varius, hendrerit arcu quis,
|
||||
congue nisl. In scelerisque, sem ut ve.</p>
|
||||
|
||||
<span class="font-size-12 font-weight-medium text-secondary">
|
||||
<i class="mdi mdi-clock-outline"></i> 2 hrs
|
||||
ago...
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<ul class="dropdown-menu dropdown-menu-right d-none">
|
||||
<li class="dropdown-header">You have 5 notifications</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="mdi mdi-account-plus"></i> New user registered
|
||||
<span class=" font-size-12 d-inline-block float-right"><i class="mdi mdi-clock-outline"></i> 10 AM</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="mdi mdi-account-remove"></i> User deleted
|
||||
<span class=" font-size-12 d-inline-block float-right"><i class="mdi mdi-clock-outline"></i> 07 AM</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="mdi mdi-chart-areaspline"></i> Sales report is ready
|
||||
<span class=" font-size-12 d-inline-block float-right"><i class="mdi mdi-clock-outline"></i> 12 PM</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="mdi mdi-account-supervisor"></i> New client
|
||||
<span class=" font-size-12 d-inline-block float-right"><i class="mdi mdi-clock-outline"></i> 10 AM</span>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#">
|
||||
<i class="mdi mdi-server-network-off"></i> Server overloaded
|
||||
<span class=" font-size-12 d-inline-block float-right"><i class="mdi mdi-clock-outline"></i> 05 AM</span>
|
||||
</a>
|
||||
</li>
|
||||
<li class="dropdown-footer">
|
||||
<a class="text-center" href="#"> View All </a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li class="right-sidebar-in right-sidebar-2-menu">
|
||||
<i class="mdi mdi-settings-outline mdi-spin"></i>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
|
||||
<!-- CONTENT WRAPPER -->
|
||||
<div class="ec-content-wrapper ec-vendor-wrapper">
|
||||
<div class="content">
|
||||
|
@ -651,8 +103,16 @@ $products = productList();
|
|||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="card card-default p-4 ec-card-space">
|
||||
<div class="col-lg-6 col-md-12">
|
||||
<form style="display:flex; margin-bottom:50px;" method="POST" action="vendor-card-action.php">
|
||||
<input type="text" name="search" class="form-control" id="searchProduct" placeholder="search with vendor name..">
|
||||
<button class="submit" type="submit" id="search-btn" class="btn btn-flat">
|
||||
<i class="mdi mdi-magnify" style="font-size:20px; color:gray; margin-left:-40px;"></i>
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div class="ec-vendor-card mt-m-24px row">
|
||||
|
||||
<?php
|
||||
|
@ -665,6 +125,27 @@ $products = productList();
|
|||
$start = ($currentpage - 1) * $vendorsPerPage;
|
||||
$end = $start + $vendorsPerPage - 1;
|
||||
|
||||
$vendorsCopy = $vendors;
|
||||
|
||||
if (!empty($_GET['search']) ) {
|
||||
$filteredProducts=[];
|
||||
foreach ($vendorsCopy as $result) {
|
||||
$vendorName = strtolower($result['user_login']);
|
||||
if (
|
||||
strpos($vendorName,strtolower($_GET['search']))!==false
|
||||
) {
|
||||
$filteredProducts[] = $result;
|
||||
} else{
|
||||
}
|
||||
}
|
||||
|
||||
$vendors = $filteredProducts;
|
||||
$totalVendors = count($filteredProducts);
|
||||
// $vendorsPerPage = 20;
|
||||
}
|
||||
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];
|
||||
|
@ -684,7 +165,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>
|
||||
|
@ -694,15 +175,15 @@ $products = productList();
|
|||
<ul class="list-unstyled">
|
||||
<li class="d-flex mb-1">
|
||||
<i class="mdi mdi-cellphone-basic mr-1"></i>
|
||||
<span>
|
||||
<span style="font-size:13px;">
|
||||
<?php
|
||||
echo isset($vendor['phone']) && !empty($vendor['phone']) ? $vendor['phone'] : 'No Number yet';
|
||||
echo isset($vendor['phone']) && !empty($vendor['phone']) ? $vendor['phone']: 'No Number yet';
|
||||
?>
|
||||
</span>
|
||||
</li>
|
||||
<li class="d-flex">
|
||||
<i class="mdi mdi-email mr-1"></i>
|
||||
<span>
|
||||
<span style="font-size:13px;">
|
||||
<?php
|
||||
echo isset($vendor['user_email']) && !empty($vendor['user_email']) ? $vendor['user_email'] : 'No Email yet';
|
||||
?>
|
||||
|
@ -1329,10 +810,17 @@ 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>";
|
||||
// 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 -->
|
||||
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
|
||||
$productId = $_SESSION['productId'];
|
||||
$vendorId = $_SESSION['vendorId'];
|
||||
//echo '$vendorId: '.$vendorId.'<br>';
|
||||
$productName = $_POST['product_name'];
|
||||
//echo '$productName: '.$productName.'<br>';
|
||||
$stock = $_POST['stock'];
|
||||
// 02-19-2024 Jun Jihad Promo Field Product Upload Vendor Page Action
|
||||
$ndd = isset($_POST['promo']['next-day-delivery']) ? $_POST['promo']['next-day-delivery'] : 'No';
|
||||
$sdd = isset($_POST['promo']['same-day-delivery']) ? $_POST['promo']['same-day-delivery'] : 'No';
|
||||
$freeSf = isset($_POST['promo']['free-shipping']) ? $_POST['promo']['free-shipping'] : 'No';
|
||||
// 02-19-2024 Jun Jihad Promo Field Product Upload Vendor Page Action
|
||||
$minimumOrder = $_POST['minimum_order'];
|
||||
//echo '$stock: '.$stock.'<br>';
|
||||
$price = $_POST['regular_price'];
|
||||
//echo '$price: '.$price.'<br>';
|
||||
$salePrice = $_POST['sale_price'];
|
||||
//echo '$salePrice: '.$salePrice.'<br>';
|
||||
$weight = $_POST['weight'];
|
||||
$length = $_POST['length'];
|
||||
$width = $_POST['width'];
|
||||
$height = $_POST['height'];
|
||||
$description = $_POST['product_description'];
|
||||
$specifications = $_POST['specifications'];
|
||||
//echo '$specifications: '.$specifications.'<br>';
|
||||
$productType = $_POST['product_type'];
|
||||
$productCategory = $_POST['product_category'];
|
||||
$productSf = $_POST['shipping_fee'];
|
||||
$productStatus = $_POST['status'];
|
||||
//echo '$productType: '.$productType.'<br>';
|
||||
$parentId = $_POST['parent_id'];
|
||||
//echo '$parentId: '.$parentId.'<br>';
|
||||
$size = $_POST['size'];
|
||||
//echo '$size: '.$size.'<br>';
|
||||
$color = $_POST['color'];
|
||||
//echo '$color: '.$color.'<br>';
|
||||
$material = $_POST['material'];
|
||||
//echo '$material: '.$material.'<br>';
|
||||
$token = $_SESSION["token"];
|
||||
|
||||
$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);
|
||||
$array = json_decode($response, true);
|
||||
$_SESSION['prodictId'] = $array['_id'];
|
||||
header("location: vendor-product-search.php");
|
||||
?>
|
|
@ -0,0 +1,726 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
$vendorId = $_SESSION["vendorId"];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
|
||||
} else {
|
||||
$_SESSION["isLoggedIn"] = false;
|
||||
header("location: login.php");
|
||||
exit();
|
||||
}
|
||||
if ($_SESSION["user_type"] != "admin") {
|
||||
header("location: login.php?alert=Only admins allowed here!");
|
||||
}
|
||||
|
||||
if (isset($_GET['id'])) {
|
||||
$_SESSION['productId'] = $_GET['id'];
|
||||
}
|
||||
$result = getProduct($_SESSION['productId']);
|
||||
$array = json_decode($result, true);
|
||||
$_SESSION["vendorId"] = $array['vendor_api_id'];
|
||||
$vendorId = $_SESSION["vendorId"];
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" dir="ltr">
|
||||
|
||||
<head>
|
||||
<meta charset="utf-8" />
|
||||
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<meta name="description" content="oBanana B2B - Admin Dashboard">
|
||||
|
||||
<title>oBanana B2B - Admin Dashboard</title>
|
||||
|
||||
<!-- GOOGLE FONTS -->
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link href="https://fonts.googleapis.com/css2?family=Montserrat:wght@200;300;400;500;600;700;800&family=Poppins:wght@300;400;500;600;700;800;900&family=Roboto:wght@400;500;700;900&display=swap" rel="stylesheet">
|
||||
|
||||
<link href="https://cdn.materialdesignicons.com/4.4.95/css/materialdesignicons.min.css" rel="stylesheet" />
|
||||
|
||||
<!-- PLUGINS CSS STYLE -->
|
||||
<link href="assets/plugins/simplebar/simplebar.css" rel="stylesheet" />
|
||||
|
||||
<!-- ekka CSS -->
|
||||
<link id="ekka-css" rel="stylesheet" href="assets/css/ekka.css" />
|
||||
|
||||
<!-- FAVICON -->
|
||||
<link href="assets/img/favicon.png" rel="shortcut icon" />
|
||||
<link href="https://cdn.quilljs.com/1.3.6/quill.snow.css" rel="stylesheet">
|
||||
|
||||
</head>
|
||||
|
||||
<body class="ec-header-fixed ec-sidebar-fixed ec-sidebar-dark ec-header-light" id="body" onload="onload()">
|
||||
<!-- WRAPPER -->
|
||||
<div class="wrapper">
|
||||
|
||||
<!-- LEFT MAIN SIDEBAR -->
|
||||
<?php include 'left-main-sidebar.php' ?>
|
||||
|
||||
<!-- HEADER -->
|
||||
<?php include 'header.php' ?>
|
||||
|
||||
<!-- PAGE WRAPPER -->
|
||||
<div class="ec-page-wrapper">
|
||||
|
||||
<!-- CONTENT WRAPPER -->
|
||||
<div class="ec-content-wrapper">
|
||||
<div class="content">
|
||||
<div class="breadcrumb-wrapper d-flex align-items-center justify-content-between">
|
||||
<div>
|
||||
<h1>Add Product</h1>
|
||||
<p class="breadcrumbs"><span><a href="index.php">Home</a></span>
|
||||
<span><i class="mdi mdi-chevron-right"></i></span><span><a href="vendor-card.php">Vendors</a></span>
|
||||
<span><i class="mdi mdi-chevron-right"></i></span><span><a href="vendor-profile.php">Profile</a></span>
|
||||
<span><i class="mdi mdi-chevron-right"></i></span><span><a href="vendor-product-grid.php">Products</a></span>
|
||||
<span><i class="mdi mdi-chevron-right"></i></span>Add
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="card card-default">
|
||||
<div class="card-header card-header-border-bottom">
|
||||
<h2>Add Product</h2>
|
||||
</div>
|
||||
<div class="card-body">
|
||||
<div class="row ec-vendor-uploads">
|
||||
<div class="col-lg-4">
|
||||
<div class="ec-vendor-img-upload">
|
||||
<div class="ec-vendor-main-img">
|
||||
<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"><img src="assets/img/icons/edit.svg" class="svg_img header_svg" alt="edit" /></label>
|
||||
</div>
|
||||
<div class="avatar-preview ec-preview">
|
||||
<div class="imagePreview ec-div-preview">
|
||||
<?php
|
||||
if (isset($array['images'])) {
|
||||
$image_urls = explode(',', $array['images']);
|
||||
if (!empty($image_urls)) {
|
||||
$first_image_url = trim($image_urls[0]);
|
||||
?>
|
||||
<img class="ec-image-preview" src="<?php echo $first_image_url; ?>" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<img class="ec-image-preview" src="https://upload.wikimedia.org/wikipedia/commons/thumb/6/65/No-Image-Placeholder.svg/495px-No-Image-Placeholder.svg.png?20200912122019" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="thumb-upload-set colo-md-12">
|
||||
<?php
|
||||
if (isset($array['images'])) {
|
||||
$image_urls = explode(',', $array['images']);
|
||||
foreach ($image_urls as $index => $image_url) {
|
||||
$image_url = trim($image_url);
|
||||
?>
|
||||
<div class="thumb-upload">
|
||||
<div class="thumb-edit">
|
||||
<button class="delete-image-button" onclick="deleteImage('<?php echo $array['_id']; ?>', <?php echo $index; ?>)">
|
||||
<i class="mdi mdi-delete" style="font-size:16px; color: black; background-color:white; border-radius:3px;"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
<img class="" src="<?php echo $image_url; ?>" alt="edit" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
?>
|
||||
<div class="thumb-upload">
|
||||
<div class="thumb-edit">
|
||||
<input type='file' id="thumbUpload" class="ec-image-upload" accept=".png, .jpg, .jpeg" />
|
||||
<label for="thumbUpload"><i class="fi-rr-edit"></i></label>
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
<img class="image-thumb-preview ec-image-preview" src="assets/images/product-image/vender-upload-thumb-preview.jpg" alt="edit" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
function deleteImage(productId, indexToDelete) {
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/products/' + productId)
|
||||
.then(response => response.json())
|
||||
.then(product => {
|
||||
let imagesArray = product.images.split(',');
|
||||
if (indexToDelete >= 0 && indexToDelete < imagesArray.length) {
|
||||
imagesArray.splice(indexToDelete, 1);
|
||||
}
|
||||
const updatedImages = imagesArray.join(',');
|
||||
const payload = {
|
||||
images: updatedImages,
|
||||
};
|
||||
const token = '<?php echo $_SESSION["token"] ?>';
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/products/' + productId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer ' + token,
|
||||
},
|
||||
body: JSON.stringify(payload),
|
||||
});
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
console.log('Image deleted successfully');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Image deletion failed');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during image deletion:', error);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-8">
|
||||
<div class="ec-vendor-upload-detail">
|
||||
<form action="vendor-edit-product-action.php" method="post">
|
||||
<div class="row g-3">
|
||||
<div class="col-md-6">
|
||||
<label for="inputEmail4" class="form-label">Product name</label>
|
||||
<input type="text" class="form-control" id="inputEmail4" name="product_name" value="<?php echo $array['product_name']; ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Product Type</label>
|
||||
<select id="Categories" class="form-select" name="product_type" onchange="variables()">
|
||||
<option value="simple" <?php if ($array['product_type'] == 'simple') {
|
||||
echo 'selected';
|
||||
} ?>>Simple</option>
|
||||
<option value="variable" <?php if ($array['product_type'] == 'variable') {
|
||||
echo 'selected';
|
||||
} ?>>Variable</option>
|
||||
<option value="variation" <?php if ($array['product_type'] == 'variation') {
|
||||
echo 'selected';
|
||||
} ?>>Variation</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row collapse" id="variation">
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Parent Id</label>
|
||||
<select class="form-select" name="parent_id" id="variation-type-select">
|
||||
<!-- Your variation options go here -->
|
||||
<option value="" disabled selected>Select Product</option>
|
||||
<?php
|
||||
$products = productListVendor($vendorId);
|
||||
foreach ($products as $product) {
|
||||
// Check if the product type matches the selected product type
|
||||
if ($product['product_type'] == "variable") {
|
||||
if ($product['_id'] == $array['parent_id']) {
|
||||
echo '<option value="' . $product['_id'] . '" selected >' . $product['product_name'] . '</option>';
|
||||
} else {
|
||||
echo '<option value="' . $product['_id'] . '">' . $product['product_name'] . '</option>';
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</select>
|
||||
<!-- <label class="form-label">Colors</label>
|
||||
<input type="color" class="form-control form-control-color" id="exampleColorInput1" value="#ff6191" title="Choose your color">
|
||||
<input type="color" class="form-control form-control-color" id="exampleColorInput2" value="#33317d" title="Choose your color">
|
||||
<input type="color" class="form-control form-control-color" id="exampleColorInput3" value="#56d4b7" title="Choose your color">
|
||||
<input type="color" class="form-control form-control-color" id="exampleColorInput4" value="#009688" title="Choose your color"> -->
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Size</label>
|
||||
<select class="form-select" name="size" id="size">
|
||||
<!-- Your variation options go here -->
|
||||
<option value="">Select Size</option>
|
||||
<option value="XS" <?php echo ($array['variants'][0]['size'] === 'XS') ? 'selected' : ''; ?>>XS</option>
|
||||
<option value="S" <?php echo ($array['variants'][0]['size'] === 'S') ? 'selected' : ''; ?>>S</option>
|
||||
<option value="M" <?php echo ($array['variants'][0]['size'] === 'M') ? 'selected' : ''; ?>>M</option>
|
||||
<option value="L" <?php echo ($array['variants'][0]['size'] === 'L') ? 'selected' : ''; ?>>L</option>
|
||||
<option value="XL" <?php echo ($array['variants'][0]['size'] === 'XL') ? 'selected' : ''; ?>>XL</option>
|
||||
<option value="XXL" <?php echo ($array['variants'][0]['size'] === 'XXL') ? 'selected' : ''; ?>>XXL</option>
|
||||
<option value="XXXL" <?php echo ($array['variants'][0]['size'] === 'XXXL') ? 'selected' : ''; ?>>XXXL</option>
|
||||
</select>
|
||||
<!-- <label class="form-label">Size</label>
|
||||
<div class="form-checkbox-box">
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="checkbox" name="size1" value="size">
|
||||
<label>S</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="checkbox" name="size1" value="size">
|
||||
<label>M</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="checkbox" name="size1" value="size">
|
||||
<label>L</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="checkbox" name="size1" value="size">
|
||||
<label>XL</label>
|
||||
</div>
|
||||
<div class="form-check form-check-inline">
|
||||
<input type="checkbox" name="size1" value="size">
|
||||
<label>XXL</label>
|
||||
</div>
|
||||
</div> -->
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="Color" class="form-label">Color</label>
|
||||
<input type="text" class="form-control slug-title" id="color" name="color" value="<?php echo $array['variants'][0]['color']; ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="Material" class="form-label">Material</label>
|
||||
<input type="text" class="form-control slug-title" id="material" name="material" value="<?php echo $array['variants'][0]['material']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<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">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label for="weight" class="form-label">Weight(g)</label>
|
||||
<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(cm)</label>
|
||||
<input type="number" class="form-control slug-title" id="length" name="length" value="<?php echo $array['length']; ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<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']; ?>">
|
||||
</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']; ?>">
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label class="form-label">Short Description</label>
|
||||
<textarea class="form-control" name="product_description" id="short-hidden-editor" style="display: none;" rows="2"><?php echo $array['product_description'] ?></textarea>
|
||||
<div id="short-editor-container" style="height: 200px;"><?php echo $array['product_description'] ?></div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Regular Price <span>( In PHP
|
||||
)</span></label>
|
||||
<input type="number" class="form-control" id="price1" name="regular_price" value="<?php echo $array['regular_price'] ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Sale Price <span>( In PHP
|
||||
)</span></label>
|
||||
<input type="number" class="form-control" id="price2" name="sale_price" value="<?php echo $array['sale_price'] ?>">
|
||||
</div>
|
||||
|
||||
<!-- 3-20-24 raymart added table for price matrix -->
|
||||
<div class="col-md-12">
|
||||
<label class="form-label">Price Matrix</label>
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Quantity</th>
|
||||
<th scope="col">Price (PHP)</th>
|
||||
<th scope="col"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody id="price-matrix-body">
|
||||
<?php foreach ($array['price_matrix'][0] as $index => $pair) : ?>
|
||||
<tr data-row-index="<?php echo $index; ?>">
|
||||
<td><input type="number" class="form-control" name="quantity[]" value="<?php echo $pair['quantity']; ?>"></td>
|
||||
<td><input type="number" class="form-control" name="price[]" value="<?php echo $pair['price']; ?>"></td>
|
||||
<td><button type="button" class="btn btn-danger delete-row">Delete</button></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
</tbody>
|
||||
|
||||
</table>
|
||||
<button type="button" class="btn btn-secondary" id="add-row">Add Row</button>
|
||||
</div>
|
||||
<!-- 3-20-24 raymart added table for price matrix -->
|
||||
|
||||
<!-- 02-19-2024 Jun Jihad Promo Field Product Upload Vendor Page -->
|
||||
<div class="col-md-12" style="margin: 0 0 20px 0;">
|
||||
<label class="form-label">Promo</label>
|
||||
<div class="row" justify-content-between>
|
||||
<div class="col-md-4">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" id="nextDayDeliveryCheckbox" name="promo[next-day-delivery]" value="Yes" <?php if ($array['promo'][0]['next-day-delivery'] === "Yes") echo "checked"; ?> style="background-color: blue;">
|
||||
<label class="form-check-label" for="nextDayDeliveryCheckbox">Next Day Delivery</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" id="sameDayDeliveryCheckbox" name="promo[same-day-delivery]" value="Yes" <?php if ($array['promo'][0]['same-day-delivery'] === "Yes") echo "checked"; ?> style="background-color: blue;">
|
||||
<label class="form-check-label" for="sameDayDeliveryCheckbox">Same Day Delivery</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" id="freeShippingCheckbox" name="promo[free-shipping]" value="Yes" <?php if ($array['promo'][0]['free-shipping'] === "Yes") echo "checked"; ?> style="background-color: blue;">
|
||||
<label class="form-check-label" for="freeShippingCheckbox">Free Shipping</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 02-19-2024 Jun Jihad Promo Field Product Upload Vendor Page -->
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Stock</label>
|
||||
<input type="number" class="form-control" id="quantity1" name="stock" value="<?php echo $array['stock'] ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Minimum Order</label>
|
||||
<input type="number" class="form-control" id="minOrder" name="minimum_order" value="<?php echo $array['minimum_order'] ?>">
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<label class="form-label">Full Detail</label>
|
||||
<textarea class="form-control" rows="4" name="specifications" id="hidden-editor" style="display: none;"><?php echo $array['specifications'] ?></textarea>
|
||||
<div id="editor-container" style="height: 200px;"><?php echo $array['specifications'] ?></div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Product Category</label>
|
||||
<select class="form-select" name="product_category" id="product_category">
|
||||
<option value="">Select Category</option>
|
||||
<option value="Electronics" <?php echo ($array['product_category'] === 'Electronics') ? 'selected' : ''; ?>>Electronics</option>
|
||||
<option value="Solar" <?php echo ($array['product_category'] === 'Solar') ? 'selected' : ''; ?>>Solar</option>
|
||||
<option value="E-bike" <?php echo ($array['product_category'] === 'E-bike') ? 'selected' : ''; ?>>E-bike</option>
|
||||
<option value="E-vehicle" <?php echo ($array['product_category'] === 'E-vehicle') ? 'selected' : ''; ?>>E-Vehicle</option>
|
||||
<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="Heavy Equipment" <?php echo ($array['product_category'] === 'Heavy Equipment') ? 'selected' : ''; ?>>Heavy Equipment</option>
|
||||
<option value="Apparel" <?php echo ($array['product_category'] === 'Apparel') ? 'selected' : ''; ?>>Apparel</option>
|
||||
<option value="Petcare" <?php echo ($array['product_category'] === 'Petcare') ? 'selected' : ''; ?>>Petcare</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Shipping Fee</label>
|
||||
<input type="number" class="form-control" id="sfee" name="shipping_fee" value="<?php echo $array['shipping_fee'] ?>">
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Product Status</label>
|
||||
<select class="form-select" name="status" id="status">
|
||||
<option value="">Select Product Status</option>
|
||||
<option value="Active" <?php echo ($array['status'] === 'Active') ? 'selected' : ''; ?>>Active</option>
|
||||
<option value="Inactive" <?php echo ($array['status'] === 'Inactive') ? 'selected' : ''; ?>>Inactive</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<label class="form-label">Product Tags <span>( Type and
|
||||
make comma to separate tags )</span></label>
|
||||
<input type="text" class="form-control" id="group_tag" name="group_tag" value="" placeholder="" data-role="tagsinput" />
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> <!-- End Content -->
|
||||
</div> <!-- End Content Wrapper -->
|
||||
|
||||
<script src="https://cdn.quilljs.com/1.3.6/quill.js"></script>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var quill = new Quill('#editor-container', {
|
||||
theme: 'snow'
|
||||
});
|
||||
quill.clipboard.dangerouslyPasteHTML(document.getElementById('hidden-editor').value);
|
||||
quill.on('text-change', function() {
|
||||
document.getElementById('hidden-editor').value = quill.root.innerHTML;
|
||||
});
|
||||
|
||||
var newquill = new Quill('#short-editor-container', {
|
||||
theme: 'snow'
|
||||
});
|
||||
newquill.clipboard.dangerouslyPasteHTML(document.getElementById('short-hidden-editor').value);
|
||||
newquill.on('text-change', function() {
|
||||
document.getElementById('short-hidden-editor').value = newquill.root.innerHTML;
|
||||
});
|
||||
|
||||
// 3-20-24 raymart added function for price matrix
|
||||
document.getElementById("add-row").addEventListener("click", function() {
|
||||
var newRow = '<tr>' +
|
||||
'<td><input type="number" class="form-control quantity-input" name="quantity[]"></td>' +
|
||||
'<td><input type="number" class="form-control" name="price[]"></td>' +
|
||||
'<td><button type="button" class="btn btn-danger delete-row">Delete</button></td>' +
|
||||
'</tr>';
|
||||
document.getElementById("price-matrix-body").insertAdjacentHTML('beforeend', newRow);
|
||||
|
||||
var quantityInputs = document.querySelectorAll('.quantity-input');
|
||||
var lastIndex = quantityInputs.length - 1;
|
||||
quantityInputs[lastIndex].addEventListener('blur', function(event) {
|
||||
checkQuantity(event, lastIndex);
|
||||
});
|
||||
});
|
||||
|
||||
document.getElementById("price-matrix-body").addEventListener("click", function(event) {
|
||||
if (event.target.classList.contains("delete-row")) {
|
||||
event.preventDefault();
|
||||
var rows = document.querySelectorAll("#price-matrix-body tr");
|
||||
if (rows.length > 1) {
|
||||
event.target.closest("tr").remove();
|
||||
} else {
|
||||
alert("At least one row is required.");
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
function checkQuantity(event, index) {
|
||||
var currentInput = event.target;
|
||||
var previousRow = currentInput.parentNode.parentNode.previousElementSibling;
|
||||
var nextRow = currentInput.parentNode.parentNode.nextElementSibling;
|
||||
|
||||
if (previousRow !== null) {
|
||||
var previousQuantityInput = previousRow.querySelector('input[name="quantity[]"]');
|
||||
var currentQuantity = parseInt(currentInput.value);
|
||||
var previousQuantity = parseInt(previousQuantityInput.value);
|
||||
|
||||
if (currentQuantity <= previousQuantity) {
|
||||
alert("Quantity must be greater than the previous row's quantity.");
|
||||
currentInput.value = previousQuantity + 1;
|
||||
}
|
||||
}
|
||||
|
||||
if (nextRow !== null) {
|
||||
var nextQuantityInput = nextRow.querySelector('input[name="quantity[]"]');
|
||||
var nextQuantity = parseInt(nextQuantityInput.value);
|
||||
|
||||
if (currentQuantity >= nextQuantity) {
|
||||
alert("Quantity must be less than the next row's quantity.");
|
||||
currentInput.value = nextQuantity - 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function checkExistingQuantity(row) {
|
||||
var currentInput = row.querySelector('input[name="quantity[]"]');
|
||||
var allRows = document.querySelectorAll("#price-matrix-body tr");
|
||||
var currentIndex = Array.from(allRows).indexOf(row);
|
||||
|
||||
for (var i = currentIndex - 1; i >= 0; i--) {
|
||||
var previousRow = allRows[i];
|
||||
var previousQuantityInput = previousRow.querySelector('input[name="quantity[]"]');
|
||||
var currentQuantity = parseInt(currentInput.value);
|
||||
var previousQuantity = parseInt(previousQuantityInput.value);
|
||||
|
||||
if (currentQuantity <= previousQuantity) {
|
||||
alert("Quantity must be greater than the previous row's quantity.");
|
||||
currentInput.value = previousQuantity + 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
var nextRow = allRows[currentIndex + 1];
|
||||
if (nextRow !== undefined) {
|
||||
var nextQuantityInput = nextRow.querySelector('input[name="quantity[]"]');
|
||||
var nextQuantity = parseInt(nextQuantityInput.value);
|
||||
|
||||
if (currentQuantity >= nextQuantity) {
|
||||
alert("Quantity must be less than the next row's quantity.");
|
||||
currentInput.value = nextQuantity - 1;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
document.getElementById("price-matrix-body").addEventListener("blur", function(event) {
|
||||
if (event.target.tagName === "INPUT" && event.target.name === "quantity[]") {
|
||||
checkExistingQuantity(event.target.closest("tr"));
|
||||
}
|
||||
}, true);
|
||||
// 3-20-24 raymart added function for price matrix
|
||||
|
||||
</script>
|
||||
|
||||
<script>
|
||||
function onload() {
|
||||
variables();
|
||||
}
|
||||
|
||||
function variables() {
|
||||
var x = document.getElementById('Categories').value;
|
||||
var y = document.getElementById('variation');
|
||||
if (x != 'variation') {
|
||||
y.style.visibility = 'hidden';
|
||||
y.classList.add('collapse');
|
||||
} else {
|
||||
y.style.visibility = 'visible';
|
||||
y.classList.remove('collapse');
|
||||
}
|
||||
}
|
||||
|
||||
function uploadProductImage() {
|
||||
var productId = '<?php echo $_SESSION['productId'] ?>';
|
||||
var fileInput = document.getElementById('imageUpload');
|
||||
var files = fileInput.files;
|
||||
|
||||
if (files.length > 0) {
|
||||
var promises = [];
|
||||
var existingImages = [];
|
||||
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/products/' + productId)
|
||||
.then(response => response.json())
|
||||
.then(product => {
|
||||
existingImages = product.images || [];
|
||||
existingImages = Array.isArray(existingImages) ? existingImages : [existingImages];
|
||||
existingImages = existingImages.filter(image => image);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error fetching existing images:', error);
|
||||
});
|
||||
|
||||
for (let i = 0; i < files.length; i++) {
|
||||
const file = files[i];
|
||||
const reader = new FileReader();
|
||||
|
||||
const promise = new Promise((resolve, reject) => {
|
||||
reader.onload = function(e) {
|
||||
const img = new Image();
|
||||
img.onload = function() {
|
||||
const canvas = document.createElement('canvas');
|
||||
const ctx = canvas.getContext('2d');
|
||||
const maxWidth = 1200;
|
||||
const maxHeight = 1000;
|
||||
const aspectRatio = img.width / img.height;
|
||||
let newWidth = img.width;
|
||||
let newHeight = img.height;
|
||||
|
||||
if (img.width > maxWidth) {
|
||||
newWidth = maxWidth;
|
||||
newHeight = newWidth / aspectRatio;
|
||||
}
|
||||
|
||||
if (newHeight > maxHeight) {
|
||||
newHeight = maxHeight;
|
||||
newWidth = newHeight * aspectRatio;
|
||||
}
|
||||
|
||||
canvas.width = newWidth;
|
||||
canvas.height = newHeight;
|
||||
ctx.drawImage(img, 0, 0, newWidth, newHeight);
|
||||
|
||||
canvas.toBlob((blob) => {
|
||||
const resizedFile = new File([blob], file.name, {
|
||||
type: 'image/jpeg'
|
||||
});
|
||||
|
||||
var formData = new FormData();
|
||||
formData.append('image_id', productId);
|
||||
formData.append('category', 'product');
|
||||
formData.append('image', resizedFile);
|
||||
|
||||
fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/upload_image', {
|
||||
method: 'POST',
|
||||
body: formData
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
console.error('File upload failed');
|
||||
reject(new Error('File upload failed'));
|
||||
}
|
||||
})
|
||||
.then(result => {
|
||||
const filename = result.filename;
|
||||
resolve(filename);
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during fetch:', error);
|
||||
reject(error);
|
||||
});
|
||||
}, 'image/jpeg');
|
||||
};
|
||||
|
||||
img.src = e.target.result;
|
||||
};
|
||||
|
||||
reader.readAsDataURL(file);
|
||||
});
|
||||
|
||||
promises.push(promise);
|
||||
}
|
||||
// 03-14-2024 Jun Jihad modified this block of code to properly upload images with comma in the filename
|
||||
Promise.all(promises)
|
||||
.then(filenames => {
|
||||
// const updatedImages = existingImages.concat(filenames.map(filename => `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/product_uploads/${filename}`));
|
||||
const updatedImages = existingImages.concat(filenames.map(filename => `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/product_uploads/${encodeURIComponent(filename)}`));
|
||||
|
||||
if (!Array.isArray(updatedImages)) {
|
||||
console.error('Updated images is not an array:', updatedImages);
|
||||
throw new Error('Updated images is not an array');
|
||||
}
|
||||
const imagesString = updatedImages.join(',');
|
||||
const payload = {
|
||||
images: imagesString,
|
||||
};
|
||||
|
||||
const token = '<?php echo $_SESSION["token"] ?>';
|
||||
return fetch('https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/products/' + productId, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer ' + token,
|
||||
},
|
||||
body: JSON.stringify(payload)
|
||||
});
|
||||
})
|
||||
// 03-14-2024 Jun Jihad modified this block of code to properly upload images with comma in the filename
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
console.log('Images uploaded successfully');
|
||||
location.reload();
|
||||
} else {
|
||||
console.error('Image upload failed');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error during image upload:', error);
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<!-- 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/tags-input/bootstrap-tagsinput.js"></script>
|
||||
<script src="assets/plugins/simplebar/simplebar.min.js"></script>
|
||||
<script src="assets/plugins/jquery-zoom/jquery.zoom.min.js"></script>
|
||||
<script src="assets/plugins/slick/slick.min.js"></script>
|
||||
|
||||
<!-- Option Switcher -->
|
||||
<script src="assets/plugins/options-sidebar/optionswitcher.js"></script>
|
||||
|
||||
<!-- Ekka Custom -->
|
||||
<script src="assets/js/ekka.js"></script>
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -785,7 +785,7 @@ $vendorSearchResult = $_SESSION["vendorSearchResult"];
|
|||
console.log("Session Token:", sessionToken);
|
||||
login(email, password, function() {
|
||||
// Removed the call to updateSessionToken
|
||||
window.open("product-edit.php?id=" + productId, "_self");
|
||||
window.open("vendor-edit-product.php?id=" + productId, "_self");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -131,29 +131,6 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
|
|||
|
||||
<!-- 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) {
|
||||
|
@ -329,7 +306,7 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
|
|||
if (isset($vendor["vendor_image"])) {
|
||||
?><img src="<?php echo $vendor["vendor_image"] ?>" alt="vendor img"><?php
|
||||
} else {
|
||||
?><img src="assets/images/vendor/5.jpg" alt="vendor img"><?php
|
||||
?><img src="https://api.obanana.com/images/storage/web_images/1710214273217-no_image.png" alt="vendor img"><?php
|
||||
}
|
||||
?>
|
||||
</a>
|
||||
|
@ -417,11 +394,8 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
|
|||
<?php
|
||||
//var_dump($products);
|
||||
foreach ($filteredProducts as $product){
|
||||
|
||||
// $vendorOfProduct = getVendorbyId($product['vendor_api_id']);
|
||||
// $pid = $i;
|
||||
$vendorOfProduct = getVendorbyId($simpleProducts[$pid]['vendor_api_id']);
|
||||
?>
|
||||
$vendorOfProduct = getVendorbyId($product['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" style="max-width: 290px; height: 350px;">
|
||||
|
@ -548,7 +522,6 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
|
|||
</div>
|
||||
</div>
|
||||
<!-- Ec Pagination Start -->
|
||||
|
||||
<!-- <div class="ec-pro-pagination">
|
||||
<span>Showing 1-12 of 21 item(s)</span>
|
||||
<ul class="ec-pro-pagination-inner">
|
||||
|
@ -648,6 +621,65 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
|
|||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="ec-sidebar-block">
|
||||
<div class="ec-sb-title">
|
||||
<h3 class="ec-sidebar-title">Category</h3>
|
||||
</div>
|
||||
<div class="ec-sb-block-content">
|
||||
<ul>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" checked /> <a href="#">clothes</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">Bags</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">Shoes</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">cosmetics</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">electrics</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">phone</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li id="ec-more-toggle-content" style="padding: 0; display: none;">
|
||||
<ul>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">Watch</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item">
|
||||
<input type="checkbox" /> <a href="#">Cap</a><span class="checked"></span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
<li>
|
||||
<div class="ec-sidebar-block-item ec-more-toggle">
|
||||
<span class="checked"></span><span id="ec-more-toggle">More
|
||||
Categories</span>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- Sidebar Size Block -->
|
||||
<!-- <div class="ec-sidebar-block">
|
||||
<div class="ec-sb-title">
|
||||
|
|
|
@ -1151,11 +1151,9 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
$freeShipping = true;
|
||||
}
|
||||
|
||||
// Set the shipping fee based on the condition
|
||||
$shippingFee = $freeShipping ? 0 : $checkout['shipping_fee'];
|
||||
|
||||
// Calculate total amount for each item
|
||||
$totalAmount += ($item['price'] + $shippingFee) * $item['quantity'];
|
||||
$totalAmount += ($item['price'] * $item['quantity']) + $shippingFee ;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
@ -1288,6 +1286,30 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
}
|
||||
} else if (pay2RadioButton.checked) {
|
||||
try {
|
||||
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;
|
||||
}
|
||||
|
||||
<?php foreach ($cartItems as $checkout) { ?>
|
||||
<?php foreach ($checkout['items'] as $item) { ?>
|
||||
itemNames.push("<?php echo str_replace('"', "\\'", $item['product']['name']) . ' (' . $item['quantity'] . ')'; ?>");
|
||||
|
@ -1335,15 +1357,15 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
method: "PATCH",
|
||||
body: JSON.stringify({
|
||||
shipping_address: {
|
||||
shipping_first_name: document.getElementById('selectedFName').innerText,
|
||||
shipping_last_name: document.getElementById('selectedLName').innerText,
|
||||
shipping_phone: document.getElementById('selectedContact').innerText,
|
||||
shipping_address_1: document.getElementById('sBuilding').innerText,
|
||||
shipping_address_2: document.getElementById('sStreet').innerText,
|
||||
shipping_city: document.getElementById('sCity').innerText,
|
||||
shipping_barangay: document.getElementById('sBarangay').innerText,
|
||||
shipping_state: document.getElementById('sProvince').innerText,
|
||||
shipping_country: document.getElementById('sCountry').innerText,
|
||||
shipping_first_name: selectedFName,
|
||||
shipping_last_name: selectedLName,
|
||||
shipping_phone: selectedContact,
|
||||
shipping_address_1: sBuilding,
|
||||
shipping_address_2: sStreet,
|
||||
shipping_city: sCity,
|
||||
shipping_barangay: sBarangay,
|
||||
shipping_state: sProvince,
|
||||
shipping_country: sCountry,
|
||||
},
|
||||
billing_address: {
|
||||
billing_first_name: billingFName,
|
||||
|
@ -1367,8 +1389,6 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': "Bearer " + token,
|
||||
|
||||
// Add any additional headers as needed
|
||||
},
|
||||
});
|
||||
|
||||
|
@ -1376,25 +1396,14 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
throw new Error(`Error updating payment status: ${patchResponse.status} ${patchResponse.statusText}`);
|
||||
}
|
||||
})
|
||||
// Handle the result of the original POST request as needed
|
||||
console.log("COD Successfull")
|
||||
console.log("Payment Successfull")
|
||||
window.location.href = 'user-history.php';
|
||||
// console.log( <?php echo $filteredIdsJSON; ?>);
|
||||
|
||||
|
||||
// const patchResult = await patchResponse.json();
|
||||
// console.log(patchResult);
|
||||
|
||||
// Handle the result of the PATCH request as needed
|
||||
}
|
||||
|
||||
// Handle the result of the original POST request as needed
|
||||
// window.open(result.attributes.checkout_url);
|
||||
window.location.href = result.attributes.checkout_url;
|
||||
|
||||
} catch (error) {
|
||||
console.error('Error:', error);
|
||||
// Handle errors
|
||||
}
|
||||
|
||||
} else if (pay3RadioButton.checked) {
|
||||
|
@ -1432,7 +1441,7 @@ if (isset($customer_data[0]["address"]) && is_array($customer_data[0]["address"]
|
|||
sCountry.trim() === ""
|
||||
) {
|
||||
alert("Please select address.");
|
||||
return; // Stop further execution
|
||||
return;
|
||||
}
|
||||
newArray.forEach(async (orderId) => {
|
||||
console.log(orderId)
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
|
||||
include "functions.php";
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
|
|
@ -51,7 +51,7 @@ function sddProducts()
|
|||
curl_close($curl);
|
||||
$json = json_decode($response, true);
|
||||
$products = array_filter($json, function ($var) {
|
||||
return ($var['promo'][0]['same-day-delivery'] === "Yes" && $var['product_type'] == '' || $var['promo'][0]['same-day-delivery'] === "Yes" && $var['product_type'] == 'simple' || $var['promo'][0]['same-day-delivery'] === "Yes" && $var['product_type'] == 'variable');
|
||||
return ($var['promo'][0]['next-day-delivery'] === "Yes" && $var['product_type'] == '' || $var['promo'][0]['next-day-delivery'] === "Yes" && $var['product_type'] == 'simple' || $var['promo'][0]['next-day-delivery'] === "Yes" && $var['product_type'] == 'variable');
|
||||
});
|
||||
$products = array_values($products);
|
||||
return $products;
|
||||
|
@ -1980,3 +1980,4 @@ function updatePayout($token, $payoutId)
|
|||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
|
27
header.php
27
header.php
|
@ -1,3 +1,15 @@
|
|||
<?php
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
$customer_data = getCustomerbyLoginId($_SESSION["userId"]);
|
||||
// $customerData = json_decode($customer_data, true);
|
||||
|
||||
} else {
|
||||
$_SESSION["isLoggedIn"] = false;
|
||||
}
|
||||
?>
|
||||
|
||||
<?php ?>
|
||||
<header class="ec-header">
|
||||
<style>
|
||||
|
@ -136,18 +148,25 @@
|
|||
</div>
|
||||
<!-- Header Top social End -->
|
||||
<!-- Header Top Message Start -->
|
||||
<div class="col text-center header-top-center">
|
||||
<!-- <div class="col text-center header-top-center">
|
||||
<div class="header-top-message text-upper">
|
||||
<span>Free Shipping</span>This Week Order Over - $75
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<!-- Header Top Message End -->
|
||||
<!-- Header Top Language Currency -->
|
||||
<div class="col header-top-right d-none d-lg-block">
|
||||
<div class="header-top-lan-curr d-flex justify-content-end">
|
||||
<!-- Download Modal -->
|
||||
<div class="header-top-download">
|
||||
<button class="text-upper" onclick="displayPopup()">Download App <i aria-hidden="true"></i></button>
|
||||
<!-- 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(isset($customer_data)) { ?>
|
||||
<button style="cursor:default;">Hi <span class="text-upper"><?php echo $customer_data[0]['first_name'] ?>!</span></button>
|
||||
<?php } else { ?>
|
||||
<button class="text-upper"><a href="login.php">Login</a></button>
|
||||
<?php } ?>
|
||||
|
||||
</div>
|
||||
<script>
|
||||
function displayPopup() {
|
||||
|
@ -878,7 +897,7 @@
|
|||
<li><a href="privacy-policy.html">Privacy Policy</a></li>
|
||||
</ul> -->
|
||||
</li>
|
||||
<li class="dropdown"><span class="main-label-note-new" data-toggle="tooltip" title="NEW"></span><a href="same_day_delivery.php">Next-Day-Delivery</a>
|
||||
<li class="dropdown"><span class="main-label-note-new" data-toggle="tooltip" title="NEW"></span><a href="next_day_delivery.php">Next-Day-Delivery</a>
|
||||
<!-- <ul class="sub-menu">
|
||||
<li class="dropdown position-static"><a href="javascript:void(0)">Mail
|
||||
Confirmation
|
||||
|
|
30
index.php
30
index.php
|
@ -224,9 +224,9 @@ if ($_SESSION["userId"] <> "") {
|
|||
$vendorOfProduct = getVendorbyId($forAll[$pid]['vendor_api_id']);
|
||||
?>
|
||||
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 mb-6 ec-product-content" data-animation="fadeIn">
|
||||
<div class="ec-product-inner">
|
||||
<div class="ec-product-inner" style="width: 260px;">
|
||||
<!-- raymart added style feb 26 2024 -->
|
||||
<div class="ec-pro-image-outer" style="width: 290; height: 350px;">
|
||||
<div class="ec-pro-image-outer">
|
||||
<!-- <div class="ec-pro-image-outer"> -->
|
||||
<div class="ec-pro-image">
|
||||
<a href="product-left-sidebar.php?id=<?php echo $forAll[$pid]["_id"]; ?>">
|
||||
|
@ -237,7 +237,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
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;" />
|
||||
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 280px;" />
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
|
@ -344,9 +344,9 @@ if ($_SESSION["userId"] <> "") {
|
|||
$vendorOfProduct = getVendorbyId($electronics[$pid]['vendor_api_id']);
|
||||
?>
|
||||
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 mb-6 ec-product-content" data-animation="fadeIn">
|
||||
<div class="ec-product-inner">
|
||||
<div class="ec-product-inner" style="width: 260px;">
|
||||
<!-- raymart added style feb 26 2024 -->
|
||||
<div class="ec-pro-image-outer" style="width: 290; height: 350px;">
|
||||
<div class="ec-pro-image-outer">
|
||||
<!-- <div class="ec-pro-image-outer"> -->
|
||||
<div class="ec-pro-image">
|
||||
<a href="product-left-sidebar.php?id=<?php echo $electronics[$pid]["_id"]; ?>">
|
||||
|
@ -357,7 +357,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
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;"/>
|
||||
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 280px;" />
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
|
@ -466,9 +466,9 @@ if ($_SESSION["userId"] <> "") {
|
|||
$vendorOfProduct = getVendorbyId($smartHome[$pid]['vendor_api_id']);
|
||||
?>
|
||||
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 mb-6 ec-product-content" data-animation="fadeIn">
|
||||
<div class="ec-product-inner">
|
||||
<div class="ec-product-inner" style="width: 260px;">
|
||||
<!-- raymart added style feb 26 2024 -->
|
||||
<div class="ec-pro-image-outer" style="width: 290; height: 350px;">
|
||||
<div class="ec-pro-image-outer">
|
||||
<!-- <div class="ec-pro-image-outer"> -->
|
||||
<div class="ec-pro-image">
|
||||
<a href="product-left-sidebar.php?id=<?php echo $smartHome[$pid]["_id"]; ?>">
|
||||
|
@ -479,7 +479,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
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;"/>
|
||||
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 280px;" />
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
|
@ -586,9 +586,9 @@ if ($_SESSION["userId"] <> "") {
|
|||
$vendorOfProduct = getVendorbyId($forVehicle[$pid]['vendor_api_id']);
|
||||
?>
|
||||
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 mb-6 ec-product-content" data-animation="fadeIn">
|
||||
<div class="ec-product-inner">
|
||||
<div class="ec-product-inner" style="width: 260px;">
|
||||
<!-- raymart added style feb 26 2024-->
|
||||
<div class="ec-pro-image-outer" style="width: 290; height: 350px;">
|
||||
<div class="ec-pro-image-outer">
|
||||
<!-- <div class="ec-pro-image-outer"> -->
|
||||
<div class="ec-pro-image">
|
||||
<a href="product-left-sidebar.php?id=<?php echo $forVehicle[$pid]["_id"]; ?>">
|
||||
|
@ -599,7 +599,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
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;"/>
|
||||
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 280px;" />
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
|
@ -1211,9 +1211,9 @@ if ($_SESSION["userId"] <> "") {
|
|||
$vendorOfProduct = getVendorbyId($newArrival[$pid]['vendor_api_id']);
|
||||
?>
|
||||
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 mb-6 ec-product-content" data-animation="flipInY">
|
||||
<div class="ec-product-inner">
|
||||
<div class="ec-product-inner" style="width: 260px;">
|
||||
<!-- raymart added style feb 26 2024 -->
|
||||
<div class="ec-pro-image-outer" style="width: 290; height: 350px;">
|
||||
<div class="ec-pro-image-outer">
|
||||
<!-- <div class="ec-pro-image-outer"> -->
|
||||
<div class="ec-pro-image">
|
||||
<a href="product-left-sidebar.php?id=<?php echo $newArrival[$pid]["_id"]; ?>">
|
||||
|
@ -1224,7 +1224,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
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;" />
|
||||
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 280px;" />
|
||||
<?php
|
||||
}
|
||||
} else {
|
||||
|
|
|
@ -211,17 +211,17 @@ if ($_SESSION["userId"] <> "") {
|
|||
$vendorOfProduct = getVendorbyId($simpleProducts[$pid]['vendor_api_id']);
|
||||
?>
|
||||
<div class="col-lg-3 col-md-6 col-sm-6 col-xs-6 mb-6 pro-gl-content">
|
||||
<div class="ec-product-inner">
|
||||
<div class="ec-product-inner" style="width: 260px;">
|
||||
<div class="ec-pro-image-outer">
|
||||
<div class="ec-pro-image">
|
||||
<a href="shop-left-sidebar-col-4.php" class="image">
|
||||
<a href="product-left-sidebar.php?id=<?php echo $simpleProducts[$pid]["_id"]; ?>" >
|
||||
<?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="ec-image-preview" src="<?php echo $first_image_url; ?>" alt="edit" />
|
||||
<img class="main-image" src="<?php echo $first_image_url; ?>" alt="edit" style="border: 1px solid #eeeeee; height: 280px; width: 100%;"/>
|
||||
<?php
|
||||
}
|
||||
} else {
|
|
@ -44,12 +44,12 @@
|
|||
list-style-type: square;
|
||||
}
|
||||
|
||||
.ec-common-wrapper .table-of-cotents ol {
|
||||
.ec-common-wrapper .table-of-contents ol {
|
||||
list-style-type: square;
|
||||
margin-left: 1.5rem;
|
||||
}
|
||||
|
||||
.ec-common-wrapper .table-of-cotents li {
|
||||
.ec-common-wrapper .table-of-contents li {
|
||||
margin-bottom: 0.5rem;
|
||||
list-style-type: square;
|
||||
}
|
||||
|
@ -66,13 +66,13 @@
|
|||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Header start -->
|
||||
<?php include "header.php" ?>
|
||||
<!-- Header End -->
|
||||
<!-- Header start -->
|
||||
<?php include "header.php" ?>
|
||||
<!-- Header End -->
|
||||
|
||||
<!-- ekka Cart Start -->
|
||||
<!-- ekka Cart Start -->
|
||||
|
||||
<!-- ekka Cart End -->
|
||||
<!-- ekka Cart End -->
|
||||
|
||||
<!-- Ec breadcrumb start -->
|
||||
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
|
||||
|
@ -104,8 +104,8 @@
|
|||
<div class="row">
|
||||
<div class="col-md-12 text-center">
|
||||
<div class="section-title">
|
||||
<h2 class="ec-bg-title">Privacy & Policy</h2>
|
||||
<h2 class="ec-title">Privacy & Policy</h2>
|
||||
<h2 class="ec-bg-title">PRIVACY & POLICY</h2>
|
||||
<h2 class="ec-title">PRIVACY & POLICY</h2>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
|
@ -149,7 +149,7 @@
|
|||
<p>Want to learn more about what we do with any information we collect? Review the privacy notice in full.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 ec-cms-block table-of-cotents">
|
||||
<div class="col-sm-12 ec-cms-block table-of-contents">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">TABLE OF CONTENTS</h3>
|
||||
<ol>
|
||||
|
|
|
@ -374,14 +374,13 @@ if (isset($_GET['id'])) {
|
|||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="ec-single-price-stoke">
|
||||
<div class="ec-single-price">
|
||||
<span class="ec-single-ps-title">As low as</span>
|
||||
<?php
|
||||
// 02-13-24 Jun Jihad Removed Logic to DIsplay Price Range of Variable Products
|
||||
if (isset($product_details['sale_price']) && $product_details['sale_price'] > 0) {
|
||||
echo '<span id="productPrice" class="old-price">' . $product_details['regular_price'] . '</span>';
|
||||
echo '<s><span id="productPrice" class="old-price">' . $product_details['regular_price'] . '</span></s>';
|
||||
echo '<span id="productNewPrice" class="new-price">' . $product_details['sale_price'] . '</span>';
|
||||
} elseif (!isset($product_details['regular_price']) || $product_details['regular_price'] <= 0) {
|
||||
echo '<span id="productPrice" class="new-price">Contact Seller for Price</span>';
|
||||
|
@ -510,7 +509,7 @@ if (isset($_GET['id'])) {
|
|||
<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>';
|
||||
} else {
|
||||
echo '<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#priceModal">Contact seller</button>';
|
||||
echo '<button type="button" class="btn btn-primary" data-bs-toggle="modal" data-bs-target="#priceModal" style="text-wrap:nowrap;" >Contact seller</button>';
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -763,6 +762,7 @@ if (isset($_GET['id'])) {
|
|||
console.log("Button clicked");
|
||||
|
||||
login(email, password, function(token) {
|
||||
var priceMatrix = <?php echo (!empty($product_details['price_matrix'])) ? json_encode($product_details['price_matrix']) : "[]"; ?>;
|
||||
var quantityValue = document.getElementById("qty-input").value;
|
||||
var minimumOrder = <?php echo (!empty($product_details['minimum_order'])) ? $product_details['minimum_order'] : "1"; ?>;
|
||||
var shippingFee = "<?php echo isset($product_details['shipping_fee']) && $product_details['shipping_fee'] !== '' ? $product_details['shipping_fee'] : '50'; ?>";
|
||||
|
@ -771,19 +771,42 @@ if (isset($_GET['id'])) {
|
|||
alert("The minimum order quantity is " + minimumOrder);
|
||||
}
|
||||
|
||||
// April 3, 2024 Jun Jihad Apply Matrix
|
||||
var productPrice;
|
||||
var foundPrice = false;
|
||||
|
||||
if (priceMatrix.length > 0) {
|
||||
for (var i = 0; i < priceMatrix.length; i++) {
|
||||
for (var j = 0; j < priceMatrix[i].length; j++) {
|
||||
if (quantityValue <= parseInt(priceMatrix[i][j].quantity)) {
|
||||
productPrice = parseFloat(priceMatrix[i][j].price);
|
||||
foundPrice = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (foundPrice) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!foundPrice) {
|
||||
productPrice = parseFloat(document.getElementById("productNewPrice") ? document.getElementById("productNewPrice").innerText : document.getElementById("productPrice").innerText);
|
||||
}
|
||||
var productData = {
|
||||
product: {
|
||||
product_image: document.getElementById("mainProductImage").getAttribute('src'),
|
||||
product_id: document.getElementById("product_Id").value,
|
||||
name: document.getElementById("productTitle").innerText,
|
||||
},
|
||||
price: document.getElementById("productNewPrice") ? document.getElementById("productNewPrice").innerText : document.getElementById("productPrice").innerText,
|
||||
price: productPrice,
|
||||
quantity: quantityValue,
|
||||
vendor_id: "<?php echo $vendor_details['_id'] ?>",
|
||||
vendor_name: "<?php echo $vendor_details['user_login'] ?>",
|
||||
};
|
||||
// April 3, 2024 Jun Jihad Apply Matrix
|
||||
|
||||
console.log("Product data:", productData); // Debugging statement
|
||||
console.log("Product data:", productData);
|
||||
|
||||
var totalAmount = productData.price * productData.quantity;
|
||||
|
||||
|
@ -793,7 +816,7 @@ if (isset($_GET['id'])) {
|
|||
name: "<?php echo $customer['first_name']; ?> <?php echo $customer['last_name']; ?>",
|
||||
};
|
||||
|
||||
console.log("Customer data:", customerData); // Debugging statement
|
||||
console.log("Customer data:", customerData);
|
||||
|
||||
// Check if the product is already in the order API
|
||||
var existingOrder;
|
||||
|
@ -842,7 +865,7 @@ if (isset($_GET['id'])) {
|
|||
shipping_fee: shippingFee,
|
||||
};
|
||||
|
||||
console.log("Request data:", requestData); // Debugging statement
|
||||
console.log("Request data:", requestData);
|
||||
// const token = '<?php echo $_SESSION["token"] ?>';
|
||||
xhr.open("POST", "https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders", true);
|
||||
xhr.setRequestHeader("Content-Type", "application/json", );
|
||||
|
@ -852,7 +875,7 @@ if (isset($_GET['id'])) {
|
|||
if (xhr.status === 201) {
|
||||
var response = JSON.parse(xhr.responseText);
|
||||
|
||||
console.log("Response:", response); // Debugging statement
|
||||
console.log("Response:", response);
|
||||
|
||||
// Update the cart dynamically
|
||||
var cartList = document.querySelector(".eccart-pro-items");
|
||||
|
@ -922,24 +945,24 @@ if (isset($_GET['id'])) {
|
|||
}
|
||||
|
||||
function updateOrder(orderId, existingItemId) {
|
||||
var updateOrderXhr = new XMLHttpRequest();
|
||||
// const token = '<?php echo $_SESSION["token"] ?>';
|
||||
updateOrderXhr.open("PUT", `https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}/items/${existingItemId}`, true);
|
||||
updateOrderXhr.setRequestHeader("Content-Type", "application/json");
|
||||
updateOrderXhr.setRequestHeader("Authorization", "Bearer " + token);
|
||||
updateOrderXhr.onreadystatechange = function() {
|
||||
if (updateOrderXhr.readyState === 4) {
|
||||
if (updateOrderXhr.status === 200) {
|
||||
var response = JSON.parse(updateOrderXhr.responseText);
|
||||
console.log("Order updated:", response);
|
||||
var updateOrderXhr = new XMLHttpRequest();
|
||||
// const token = '<?php echo $_SESSION["token"] ?>';
|
||||
updateOrderXhr.open("PUT", `https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}/items/${existingItemId}`, true);
|
||||
updateOrderXhr.setRequestHeader("Content-Type", "application/json");
|
||||
updateOrderXhr.setRequestHeader("Authorization", "Bearer " + token);
|
||||
updateOrderXhr.onreadystatechange = function() {
|
||||
if (updateOrderXhr.readyState === 4) {
|
||||
if (updateOrderXhr.status === 200) {
|
||||
var response = JSON.parse(updateOrderXhr.responseText);
|
||||
console.log("Order updated:", response);
|
||||
|
||||
var cartItem = document.getElementById(`order_${response._id}`);
|
||||
var cartItem = document.getElementById(`order_${response._id}`);
|
||||
|
||||
if (cartItem) {
|
||||
var updatedQuantity = response.items[0].quantity; // Use the correct quantity from the updated order
|
||||
var totalAmount = response.items[0].price * updatedQuantity;
|
||||
// If the cart item already exists, update its content using innerHTML
|
||||
cartItem.innerHTML = `
|
||||
if (cartItem) {
|
||||
var updatedQuantity = response.items[0].quantity;
|
||||
var totalAmount = response.items[0].price * updatedQuantity;
|
||||
// If the cart item already exists, update its content using innerHTML
|
||||
cartItem.innerHTML = `
|
||||
<a href="shop-left-sidebar-col-4.php" class="sidekka_pro_img">
|
||||
<img src="${response.items[0].product.product_image}" alt="product">
|
||||
</a>
|
||||
|
@ -957,50 +980,74 @@ if (isset($_GET['id'])) {
|
|||
<a href="#" class="removeCart" onclick="deleteOrder('${response._id}')">x</a>
|
||||
</div>
|
||||
`;
|
||||
document.getElementById(`qty-input-${response.items[0]._id}`).value = updatedQuantity;
|
||||
} else {
|
||||
// If the cart item doesn't exist, create a new one
|
||||
console.log("Error updating order:", updateOrderXhr.responseText);
|
||||
}
|
||||
document.getElementById(`qty-input-${response.items[0]._id}`).value = updatedQuantity;
|
||||
} else {
|
||||
// If the cart item doesn't exist, create a new one
|
||||
console.log("Error updating order:", updateOrderXhr.responseText);
|
||||
}
|
||||
|
||||
getLatestOrders();
|
||||
updateCartItemCount();
|
||||
document.getElementById("addToCartMessage").innerText = "Product added to cart!";
|
||||
setTimeout(function() {
|
||||
document.getElementById("addToCartMessage").innerText = "";
|
||||
}, 1000);
|
||||
} else {
|
||||
// Handle error response from the server
|
||||
console.log("Error response from the server");
|
||||
console.log(xhr.responseText); // Log the server's response
|
||||
}
|
||||
}
|
||||
};
|
||||
var existingQuantity = parseInt(existingOrder.items[0].quantity, 10);
|
||||
var newQuantity = parseInt(quantityValue, 10);
|
||||
var updatedQuantity = existingQuantity + newQuantity;
|
||||
getLatestOrders();
|
||||
updateCartItemCount();
|
||||
document.getElementById("addToCartMessage").innerText = "Product added to cart!";
|
||||
setTimeout(function() {
|
||||
document.getElementById("addToCartMessage").innerText = "";
|
||||
}, 1000);
|
||||
} else {
|
||||
// Handle error response from the server
|
||||
console.log("Error response from the server");
|
||||
console.log(xhr.responseText); // Log the server's response
|
||||
}
|
||||
}
|
||||
};
|
||||
var existingQuantity = parseInt(existingOrder.items[0].quantity, 10);
|
||||
var newQuantity = parseInt(quantityValue, 10);
|
||||
var updatedQuantity = existingQuantity + newQuantity;
|
||||
|
||||
var updateData = {
|
||||
quantity: updatedQuantity,
|
||||
};
|
||||
// Check if the updated quantity exceeds the previous price matrix
|
||||
var newProductPrice = productPrice; // Assume the initial productPrice
|
||||
var foundNewPrice = false;
|
||||
if (priceMatrix.length > 0) {
|
||||
for (var i = 0; i < priceMatrix.length; i++) {
|
||||
for (var j = 0; j < priceMatrix[i].length; j++) {
|
||||
if (updatedQuantity <= parseInt(priceMatrix[i][j].quantity)) {
|
||||
newProductPrice = parseFloat(priceMatrix[i][j].price);
|
||||
foundNewPrice = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (foundNewPrice) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
updateOrderXhr.send(JSON.stringify(updateData));
|
||||
// Update product price if a new price is found in the price matrix
|
||||
if (foundNewPrice) {
|
||||
productPrice = newProductPrice;
|
||||
}
|
||||
|
||||
var patchTotalAmountXhr = new XMLHttpRequest();
|
||||
patchTotalAmountXhr.open("PATCH", `https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, true);
|
||||
patchTotalAmountXhr.setRequestHeader("Content-Type", "application/json");
|
||||
patchTotalAmountXhr.setRequestHeader("Authorization", "Bearer " + token);
|
||||
var updateData = {
|
||||
quantity: updatedQuantity,
|
||||
price: productPrice // Update the price for the item
|
||||
};
|
||||
|
||||
var originalPrice = document.getElementById("productPrice").innerText;
|
||||
var totalAmount = originalPrice * updatedQuantity;
|
||||
console.log(originalPrice);
|
||||
console.log(totalAmount);
|
||||
var patchData = {
|
||||
total_amount: totalAmount
|
||||
};
|
||||
updateOrderXhr.send(JSON.stringify(updateData));
|
||||
|
||||
patchTotalAmountXhr.send(JSON.stringify(patchData));
|
||||
}
|
||||
var patchTotalAmountXhr = new XMLHttpRequest();
|
||||
patchTotalAmountXhr.open("PATCH", `https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, true);
|
||||
patchTotalAmountXhr.setRequestHeader("Content-Type", "application/json");
|
||||
patchTotalAmountXhr.setRequestHeader("Authorization", "Bearer " + token);
|
||||
|
||||
var originalPrice = document.getElementById("productPrice").innerText;
|
||||
var totalAmount = originalPrice * updatedQuantity;
|
||||
console.log(originalPrice);
|
||||
console.log(totalAmount);
|
||||
var patchData = {
|
||||
total_amount: totalAmount
|
||||
};
|
||||
|
||||
patchTotalAmountXhr.send(JSON.stringify(patchData));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
|
||||
|
||||
<style>
|
||||
ol {
|
||||
/* ol {
|
||||
padding-left: 2rem;
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
|
@ -44,7 +44,27 @@
|
|||
li a {
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
}
|
||||
} */
|
||||
|
||||
.ec-common-wrapper .ec-cms-block-inner ul {
|
||||
list-style-type: square;
|
||||
margin-left: 1.5rem;
|
||||
}
|
||||
|
||||
.ec-common-wrapper .ec-cms-block-inner li {
|
||||
margin-bottom: 0.5rem;
|
||||
list-style-type: square;
|
||||
}
|
||||
|
||||
.ec-common-wrapper .table-of-contents ol {
|
||||
list-style-type: square;
|
||||
margin-left: 1.5rem;
|
||||
}
|
||||
|
||||
.ec-common-wrapper .table-of-contents li {
|
||||
margin-bottom: 0.5rem;
|
||||
list-style-type: square;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
@ -109,27 +129,27 @@
|
|||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 ec-cms-block">
|
||||
<div class="col-sm-12 ec-cms-block table-of-contents">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Content</h3>
|
||||
<h3 class="ec-cms-block-title">TABLE OF CONTENTS</h3>
|
||||
<ol>
|
||||
<li><a href="#prescription">Prescription Drugs and Pharmaceuticals</a></li>
|
||||
<li><a href="#firearms">Firearms and Ammunition</a></li>
|
||||
<li><a href="#tobacco">Tobacco and Tobacco Products</a></li>
|
||||
<li><a href="#alcohol">Alcoholic Beverages</a></li>
|
||||
<li><a href="#counterfeit">Counterfeit Goods</a></li>
|
||||
<li><a href="#explosives">Explosives and Hazardous Materials</a></li>
|
||||
<li><a href="#narcotics">Illegal Drugs and Narcotics</a></li>
|
||||
<li><a href="#wildlife">Endangered Species and Wildlife Products</a></li>
|
||||
<li><a href="#fire">Pyrotechnic Devices</a></li>
|
||||
<li><a href="#gambling">Gambling Services</a></li>
|
||||
<li><a href="#prescription">PRESCRIPTION DRUGS AND PHARMACEUTICALS</a></li>
|
||||
<li><a href="#firearms">FIREARMS AND AMMUNITION</a></li>
|
||||
<li><a href="#tobacco">TOBACCO AND TOBACCO PRODUCTS</a></li>
|
||||
<li><a href="#alcohol">ALCOHOLIC BEVERAGES</a></li>
|
||||
<li><a href="#counterfeit">COUNTERFEIT GOODS</a></li>
|
||||
<li><a href="#explosives">EXPLOSIVES AND HAZARDOUS MATERIALS</a></li>
|
||||
<li><a href="#narcotics">ILLEGAL DRUGS AND NARCOTICS</a></li>
|
||||
<li><a href="#wildlife">ENDANGERED SPECIES AND WILDLIFE PRODUCTS</a></li>
|
||||
<li><a href="#fire">PYROTECHNIC DEVICES</a></li>
|
||||
<li><a href="#gambling">GAMBLING SERVICES</a></li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="col-sm-12 ec-cms-block" id="prescription">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Prescription Drugs and Pharmaceuticals:</h3>
|
||||
<h3 class="ec-cms-block-title">PRESCRIPTION DRUGS AND PHARMACEUTICALS:</h3>
|
||||
<p>Prohibited to be sold online without proper authorization.</p>
|
||||
<p><b>Penalties:</b> Permanent ban, fines, imprisonment, and revocation of licenses for sellers found violating
|
||||
regulations set by the Food and Drug Administration (FDA).</p>
|
||||
|
@ -137,7 +157,7 @@
|
|||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="firearms">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Firearms and Ammunition:</h3>
|
||||
<h3 class="ec-cms-block-title">FIREARMS AND AMMUNITION:</h3>
|
||||
<p>Strict regulations govern the sale of firearms and ammunition. <br>
|
||||
Prohibited to be sold online without proper permits and licenses.
|
||||
</p>
|
||||
|
@ -147,7 +167,7 @@
|
|||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="tobacco">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Tobacco and Tobacco Products:</h3>
|
||||
<h3 class="ec-cms-block-title">TOBACCO AND TOBACCO PRODUCTS:</h3>
|
||||
<p>Sale of tobacco products to minors is strictly prohibited. <br>
|
||||
Prohibited to be sold online to minors and without proper health warnings and taxation.
|
||||
</p>
|
||||
|
@ -157,7 +177,7 @@
|
|||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="alcohol">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Alcoholic Beverages:</h3>
|
||||
<h3 class="ec-cms-block-title">ALCOHOLIC BEVERAGES:</h3>
|
||||
<p>Sale of alcoholic beverages to minors is strictly prohibited. <br>
|
||||
Prohibited to be sold online without proper permits and age verification mechanisms.
|
||||
</p>
|
||||
|
@ -167,7 +187,7 @@
|
|||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="counterfeit">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Counterfeit Goods:</h3>
|
||||
<h3 class="ec-cms-block-title">COUNTERFEIT GOODS:</h3>
|
||||
<p>Sale of counterfeit products, including branded goods, is illegal. <br>
|
||||
Prohibited to be sold online to prevent intellectual property infringement
|
||||
</p>
|
||||
|
@ -177,7 +197,7 @@
|
|||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="explosives">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Explosives and Hazardous Materials:</h3>
|
||||
<h3 class="ec-cms-block-title">EXPLOSIVES AND HAZARDOUS MATERIALS:</h3>
|
||||
<p>Strict regulations govern the sale and transportation of explosives and hazardous materials. <br>
|
||||
Prohibited to be sold online without proper permits and safety protocols.
|
||||
</p>
|
||||
|
@ -187,7 +207,7 @@
|
|||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="narcotics">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Illegal Drugs and Narcotics:</h3>
|
||||
<h3 class="ec-cms-block-title">ILLEGAL DRUGS AND NARCOTICS:</h3>
|
||||
<p>Sale of illegal drugs and narcotics is strictly prohibited. <br>
|
||||
Prohibited to be sold online under any circumstances.
|
||||
</p>
|
||||
|
@ -196,7 +216,7 @@
|
|||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="wildlife">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Endangered Species and Wildlife Products:</h3>
|
||||
<h3 class="ec-cms-block-title">ENDANGERED SPECIES AND WILDLIFE PRODUCTS:</h3>
|
||||
<p>Sale of products derived from endangered species and wildlife is illegal. <br>
|
||||
Prohibited to be sold online to prevent wildlife trafficking and protect biodiversity.
|
||||
</p>
|
||||
|
@ -206,7 +226,7 @@
|
|||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="fire">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Pyrotechnic Devices:</h3>
|
||||
<h3 class="ec-cms-block-title">PYROTECHNIC DEVICES:</h3>
|
||||
<p>Sale and use of pyrotechnic devices are regulated, especially during festivities. <br>
|
||||
Prohibited to be sold online without proper permits and safety measures.
|
||||
</p>
|
||||
|
@ -216,7 +236,7 @@
|
|||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="gambling">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Gambling Services:</h3>
|
||||
<h3 class="ec-cms-block-title">GAMBLING SERVICES:</h3>
|
||||
<p>Sale of unauthorized gambling services and products is illegal. <br>
|
||||
Prohibited to be sold online without proper licenses and permits. <br>
|
||||
</p>
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
<?php
|
||||
|
||||
include "functions.php";
|
||||
|
||||
$customers = getVendorbyId($_SESSION["customerId"]);
|
||||
$customerData = json_decode($customers, true);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
|
|
@ -335,7 +335,7 @@ if (!empty($_GET['minPrice']) || !empty($_GET['maxPrice']) || !empty($_GET['cate
|
|||
}
|
||||
} else {
|
||||
?>
|
||||
<img class="hover-image" src="https://api.obanana.com/images/storage/web_images/1709002636671-viber_image_2024-02-22_15-54-42-498.png" alt="edit" />
|
||||
<img style="width: 290px; height: 200px; object-fit: cover;" class="hover-image" src="https://api.obanana.com/images/storage/web_images/1709002636671-viber_image_2024-02-22_15-54-42-498.png" alt="edit" />
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -35,7 +35,7 @@
|
|||
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
|
||||
|
||||
<style>
|
||||
ol {
|
||||
/* ol {
|
||||
padding-left: 2rem;
|
||||
margin-top: 0;
|
||||
margin-bottom: 1rem;
|
||||
|
@ -44,7 +44,27 @@
|
|||
li a {
|
||||
font-weight: bold;
|
||||
text-decoration: underline;
|
||||
}
|
||||
} */
|
||||
|
||||
.ec-common-wrapper .ec-cms-block-inner ul {
|
||||
list-style-type: square;
|
||||
margin-left: 1.5rem;
|
||||
}
|
||||
|
||||
.ec-common-wrapper .ec-cms-block-inner li {
|
||||
margin-bottom: 0.5rem;
|
||||
list-style-type: square;
|
||||
}
|
||||
|
||||
.ec-common-wrapper .table-of-contents ol {
|
||||
list-style-type: square;
|
||||
margin-left: 1.5rem;
|
||||
}
|
||||
|
||||
.ec-common-wrapper .table-of-contents li {
|
||||
margin-bottom: 0.5rem;
|
||||
list-style-type: square;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
@ -111,31 +131,31 @@
|
|||
not agree with these Terms of Use please do not use the Website.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 ec-cms-block">
|
||||
<div class="col-sm-12 ec-cms-block table-of-contents">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Content</h3>
|
||||
<h3 class="ec-cms-block-title">TABLE OF CONTENTS</h3>
|
||||
<ol>
|
||||
<li><a href="#right-to-use-site-content">Right to Use Site Content</a></li>
|
||||
<li><a href="#changes-to-the-website">Changes to the Website and Terms of Use</a></li>
|
||||
<li><a href="#intellectual-property-rights">Intellectual Property Rights</a></li>
|
||||
<li><a href="#copyright-complaints">Copyright Complaints</a></li>
|
||||
<li><a href="#interactive-forums">Interactive Forums and Groups and Feedback</a></li>
|
||||
<li><a href="#merchants-and-merchant-offers">Merchants and Merchant Offers</a></li>
|
||||
<li><a href="#sweepstakes">Sweepstakes</a></li>
|
||||
<li><a href="#third-party-content">Third Party Content and Links to Other Web Sites</a></li>
|
||||
<li><a href="#privacy-policy">Privacy Policy</a></li>
|
||||
<li><a href="#indemnification">Indemnification</a></li>
|
||||
<li><a href="#disclaimer-of-warranties">Disclaimer of Warranties</a></li>
|
||||
<li><a href="#disclaimer-of-damages">Disclaimer of Damages and Limitation of Liability</a></li>
|
||||
<li><a href="#miscellaneous">Miscellaneous</a></li>
|
||||
<li><a href="#customer-service">Customer Service and Contact information</a></li>
|
||||
<li><a href="#right-to-use-site-content">RIGHT TO USE SITE CONTENT</a></li>
|
||||
<li><a href="#changes-to-the-website">CHANGES TO THE WEBSITE AND TERMS OF USE</a></li>
|
||||
<li><a href="#intellectual-property-rights">INTELLECTUAL PROPERTY RIGHTS</a></li>
|
||||
<li><a href="#copyright-complaints">COPYRIGHT COMPLAINTS</a></li>
|
||||
<li><a href="#interactive-forums">INTERACTIVE FORUMS AND GROUPS AND FEEDBACK</a></li>
|
||||
<li><a href="#merchants-and-merchant-offers">MERCHANTS AND MERCHANT OFFERS</a></li>
|
||||
<li><a href="#sweepstakes">SWEEPSTAKES</a></li>
|
||||
<li><a href="#third-party-content">THIRD PARTY CONTENT AND LINKS TO OTHER WEB SITES</a></li>
|
||||
<li><a href="#privacy-policy">PRIVACY POLICY</a></li>
|
||||
<li><a href="#indemnification">INDEMNIFICATION</a></li>
|
||||
<li><a href="#disclaimer-of-warranties">DISCLAIMER OF WARRANTIES</a></li>
|
||||
<li><a href="#disclaimer-of-damages">DISCLAIMER OF DAMAGES AND LIMITATION OF LIABILITY</a></li>
|
||||
<li><a href="#miscellaneous">MISCELLANEOUS</a></li>
|
||||
<li><a href="#customer-service">CUSTOMER SERVICE AND CONTACT INFORMATION</a></li>
|
||||
</ol>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<div class="col-sm-12 ec-cms-block" id="right-to-use-site-content">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Right to Use Site Content</h3>
|
||||
<h3 class="ec-cms-block-title">RIGHT TO USE SITE CONTENT</h3>
|
||||
<p>The Company grants you a limited, nonexclusive, revocable license for you to view, share, print, or download any Content,
|
||||
as defined below, from the Website for your own personal use. You are not granted the right to license, republish, distribute,
|
||||
copy, assign, sublicense, transfer, sell, prepare derivative works or other non-personal use of any Content on the Website. No
|
||||
|
@ -155,7 +175,7 @@
|
|||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="changes-to-the-website">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Changes to the Website and Terms of Use</h3>
|
||||
<h3 class="ec-cms-block-title">CHANGES TO THE WEBSITE AND TERMS OF USE</h3>
|
||||
<p>The Company reserves the right to change or modify Content, materials, or information appearing on or in connection with the
|
||||
Website, including the Terms of Use, at any time without notice to you. The Company may at any time revise these Terms of Use
|
||||
by updating this posting. You are bound by such revisions and should therefore visit these pages to review the current Terms of
|
||||
|
@ -164,7 +184,7 @@
|
|||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="intellectual-property-rights">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Intellectual Property Rights</h3>
|
||||
<h3 class="ec-cms-block-title">INTELLECTUAL PROPERTY RIGHTS</h3>
|
||||
<p>The Website Content is protected by applicable intellectual property laws and all Content is owned by the Company or used by the
|
||||
Company under a license or with permission. All text, formatting (including without limitation the selection, coordination and
|
||||
arrangement of materials on the Website), images, graphics, animation, tools, widgets, applications, commercials, videos, music,
|
||||
|
@ -185,7 +205,7 @@
|
|||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="copyright-complaints">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Copyright Complaints</h3>
|
||||
<h3 class="ec-cms-block-title">COPYRIGHT COMPLAINTS</h3>
|
||||
<p>In operating the Website the Company may act as a services provider and offer services as online provider of materials and links to
|
||||
third party web sites. As a result, third party materials that the Company does not own or control may be transmitted, stored, accessed
|
||||
or otherwise made available using the Website. The Company has in place procedures regarding allegations of copyright infringement occurring
|
||||
|
@ -222,7 +242,7 @@
|
|||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="interactive-forums">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Interactive Forums and Groups and Feedback</h3>
|
||||
<h3 class="ec-cms-block-title">INTERACTIVE FORUMS AND GROUPS AND FEEDBACK</h3>
|
||||
<b>User Submissions and Conduct</b>
|
||||
<p>As a user of the Website you may submit your comments, which may consist of textual content and potentially photos, videos, images audio files, other types of
|
||||
content and links to such content if allowed by the Website (collectively referred to as “User Submissions”). You will be solely responsible for your own User
|
||||
|
@ -275,7 +295,7 @@
|
|||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="merchants-and-merchant-offers">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Merchant and Merchants Offers</h3>
|
||||
<h3 class="ec-cms-block-title">MERCHANTS AND MERCHANT OFFERS</h3>
|
||||
<p>Merchants may provide to the Company certain discounts, rebates, or other benefits (e.g. free shipping) on the purchases of goods and services (“Offers”) that may be available on the
|
||||
Website. Such Offers are subject to certain terms and conditions and may change at any time without notice to you. The Company will not be liable for any loss or damage incurred as
|
||||
a result of any interaction between you and a merchant with respect to such Offers. Except as set forth herein all matters, including but not limited to delivery of goods and services,
|
||||
|
@ -285,14 +305,14 @@
|
|||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="sweepstakes">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Sweepstakes</h3>
|
||||
<h3 class="ec-cms-block-title">SWEEPSTAKES</h3>
|
||||
<p>From time to time, We make you aware of certain Company related sweepstakes or other promotions. All such sweepstakes and promotions are subject to the official rules for such sweepstakes
|
||||
and promotions and all related applicable laws, regulations, and statutes.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="third-party-content">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Third-Party Content and Links to Other Web Sites</h3>
|
||||
<h3 class="ec-cms-block-title">THIRD PARTY CONTENT AND LINKS TO OTHER WEB SITES</h3>
|
||||
<p>The Website may contain third-party content and links to other websites that are completely independent of this Website. Third-party content and links are included solely for the convenience
|
||||
of users and do not constitute any approval, endorsement, or warranty by the Company. Moreover, the Company is not responsible for the accuracy, completeness, or reliability of third-party
|
||||
information, or the products or services offered or sold through any linked website and you assume sole responsibility for the use of third-party information. Any agreements, transactions,
|
||||
|
@ -303,14 +323,14 @@
|
|||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="privacy-policy">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Privacy Policy</h3>
|
||||
<h3 class="ec-cms-block-title">PRIVACY POLICY</h3>
|
||||
<p>The Company recognizes the importance of respecting the privacy of those who visit and choose to take advantage of the programs and information offered on the Website. The Company’s Privacy Policy
|
||||
(available here: <a href="privacy-policy.php"><b>Privacy & Policy</b></a>) provides an overview of what you can expect when you enroll in one of our programs or simply browse the Website.</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="indemnification">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Indemnification</h3>
|
||||
<h3 class="ec-cms-block-title">INDEMNIFICATION</h3>
|
||||
<p>You agree to indemnify, defend and hold the Company and its business partners, staff, and affiliates harmless from any liability, loss, claim, and expense, including reasonable attorneys’ fees and
|
||||
expenses, related to either your violation of these Terms of Use or your use of the Website. You will indemnify and hold the Company harmless from and against any claim, suit, or proceeding brought
|
||||
against the Company arising from or in connection with violations of copyright or other intellectual property or other rights of third parties contained in your User Submissions and/or any other
|
||||
|
@ -320,7 +340,7 @@
|
|||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="disclaimer-of-warranties">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Disclaimer of Warranties</h3>
|
||||
<h3 class="ec-cms-block-title">DISCLAIMER OF WARRANTIES</h3>
|
||||
<p>While the Company will use reasonable efforts to ensure that all material on the Website is correct; however, accuracy cannot be guaranteed and the Company does not assume any responsibility or liability
|
||||
for the accuracy, completeness, or authenticity of any information contained in the Website.</p>
|
||||
<p>The Website and all content contained herein are provided to you “As is” and “As available” and all warranties, express or implied, are hereby disclaimed, including any warranty of merchantability,
|
||||
|
@ -334,7 +354,7 @@
|
|||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="disclaimer-of-damages">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Disclaimer of Damages and Limitation of Liability</h3>
|
||||
<h3 class="ec-cms-block-title">DISCLAIMER OF DAMAGES AND LIMITATION OF LIABILITY</h3>
|
||||
<p>In no event will the Company or its affiliates be liable for any direct, indirect, special, punitive, exemplary, consequential, or other damages whatsoever, including but not limited to property damage, loss of
|
||||
use, loss of business, economic loss, loss of data or loss of profits, without regard to the form of action (including but not limited to contract, negligence, or other tortious actions) arising out of or in
|
||||
connection with your use or access of the Website or its content, even if the Company or its business partners, employees, representatives or affiliates have been advised of the possibility of such damage or
|
||||
|
@ -345,7 +365,7 @@
|
|||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="miscellaneous">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Miscellaneous</h3>
|
||||
<h3 class="ec-cms-block-title">MISCELLANEOUS</h3>
|
||||
<p>These Terms of Use will be construed, interpreted, and performed exclusively according to the laws of the Philippines, without giving effect to any principles of conflicts of law. You expressly agree that any action
|
||||
at law or in equity arising out of or directly or indirectly relating to these Terms of Use or the Website will be filed only in Philippine courts. You hereby consent and submit to the personal jurisdiction of such
|
||||
courts for the purposes of any action related to the Website, your access or use thereof, or these Terms of Use, and to extra-territorial service of process.</p>
|
||||
|
@ -361,7 +381,7 @@
|
|||
</div>
|
||||
<div class="col-sm-12 ec-cms-block" id="customer-service">
|
||||
<div class="ec-cms-block-inner">
|
||||
<h3 class="ec-cms-block-title">Customer Service and Contact Information</h3>
|
||||
<h3 class="ec-cms-block-title">CUSTOMER SERVICE AND CONTACT INFORMATION</h3>
|
||||
<table>
|
||||
<tr>
|
||||
<td style="border-bottom: 1px solid black;">Company Name</td>
|
||||
|
|
249
user-history.php
249
user-history.php
|
@ -65,22 +65,24 @@ if ($_SESSION["userId"] <> "") {
|
|||
font-weight: 400;
|
||||
/* margin: 2px; */
|
||||
text-align: center;
|
||||
margin-right: -25px;
|
||||
/* margin-right: -25px; */
|
||||
}
|
||||
.tab i {
|
||||
font-size: 15px;
|
||||
/* padding-left: 3px; */
|
||||
}
|
||||
.tableView:hover {
|
||||
background-color: #f5f5f5;
|
||||
/* background-color: #f5f5f5; */
|
||||
background-color: #e5e5e5;
|
||||
}
|
||||
.tab-content {
|
||||
border: none;
|
||||
margin-top: -30px;
|
||||
}
|
||||
.theadTitle {
|
||||
/* .theadTitle {
|
||||
background-color: #dddddd;
|
||||
padding-top: -50px;
|
||||
}
|
||||
padding-top: -90px;
|
||||
} */
|
||||
|
||||
@media only screen and (max-width: 640px) {
|
||||
#tableTitle {
|
||||
|
@ -98,6 +100,32 @@ if ($_SESSION["userId"] <> "") {
|
|||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
/* for status buttons */
|
||||
@media only screen and (max-width: 10000px) {
|
||||
.tab {
|
||||
font-size: 15px;
|
||||
width: 11rem;
|
||||
}
|
||||
}
|
||||
@media only screen and (max-width: 685px) {
|
||||
.tab {
|
||||
font-size: 11px;
|
||||
width: 7rem;
|
||||
}
|
||||
.tab i {
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
@media only screen and (max-width: 566px) {
|
||||
.tab {
|
||||
font-size: 0px;
|
||||
width: 5rem;
|
||||
}
|
||||
.tab i {
|
||||
font-size: 14px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
|
@ -196,9 +224,8 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
</div>
|
||||
<div class="ec-shop-rightside col-lg-9 col-md-12">
|
||||
|
||||
<!-- 03-14-2024 Stacy added cards -->
|
||||
<div class="row" id="rowTabs" style="justify-content:center; padding-bottom:20px; padding-right:20px; display:flex; align-items:center; text-align:center;">
|
||||
<!-- <div class="row d-flex justify-content-around" id="rowTabs" >
|
||||
<div id="tableTabs" class="col-lg-3 col-md-6" style="width:8rem;">
|
||||
<div class="tab h-40" data-tab-name="allOrders" onclick="showTab('allOrders'), document.getElementById('tableTitle').innerHTML = 'All Order History'">All Orders
|
||||
<i class="fa-solid fa-cubes"></i>
|
||||
|
@ -224,7 +251,8 @@ if ($_SESSION["userId"] <> "") {
|
|||
<i class="fa-solid fa-square-check"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="ec-vendor-dashboard-card">
|
||||
<div class="ec-vendor-card-header">
|
||||
<h5 id="tableTitle">All Order History</h5>
|
||||
|
@ -236,20 +264,49 @@ if ($_SESSION["userId"] <> "") {
|
|||
<a class="btn btn-lg btn-primary" id="shopNow" style="background:none; color:#3474d4;" href="index.php">Shop Now</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card" style="border: none;">
|
||||
<div class="card-body" style="margin-bottom:-20px;">
|
||||
<div class="tab-container d-flex justify-content-around">
|
||||
<!-- 03-25-2024 Stacy modified cards -->
|
||||
<div class="tab active" data-tab-name="allOrders" onclick="showTab('allOrders'), document.getElementById('tableTitle').innerHTML = 'All Order History'">All Orders
|
||||
<i class="fa-solid fa-cubes"></i></div>
|
||||
<div class="tab" data-tab-name="toPay" onclick="showTab('toPay'), document.getElementById('tableTitle').innerHTML = 'All To Pay Products'">To Pay
|
||||
<i class="fa-solid fa-money-bill-1-wave"></i></div>
|
||||
<div class="tab" data-tab-name="toShip" onclick="showTab('toShip'), document.getElementById('tableTitle').innerHTML = 'All To Ship Products'">To Ship
|
||||
<i class="fa-solid fa-truck"></i></div>
|
||||
<div class="tab" data-tab-name="toReceive" onclick="showTab('toReceive'), document.getElementById('tableTitle').innerHTML = 'All To Receive Products'">To Receive
|
||||
<i class="fa-solid fa-box-archive"></i></div>
|
||||
<div class="tab" data-tab-name="completed" onclick="showTab('completed'), document.getElementById('tableTitle').innerHTML = 'All Completed Purchase'">Complete
|
||||
<i class="fa-solid fa-square-check"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- <div class="ec-vendor-card-header" style="border: none;">
|
||||
<div class="tab-container d-flex justify-content-around">
|
||||
<!-- 03-25-2024 Stacy modified cards -->
|
||||
<!-- <div class="tab" data-tab-name="allOrders" onclick="showTab('allOrders'), document.getElementById('tableTitle').innerHTML = 'All Order History'">All orders
|
||||
<i class="fa-solid fa-cubes"></i></div>
|
||||
<div class="tab" data-tab-name="toPay" onclick="showTab('toPay'), document.getElementById('tableTitle').innerHTML = 'All To Pay Products'">To Pay
|
||||
<i class="fa-solid fa-money-bill-1-wave"></i></div>
|
||||
<div class="tab" data-tab-name="toShip" onclick="showTab('toShip'), document.getElementById('tableTitle').innerHTML = 'All To Ship Products'">To Ship
|
||||
<i class="fa-solid fa-truck"></i></div>
|
||||
<div class="tab" data-tab-name="toReceive" onclick="showTab('toReceive'), document.getElementById('tableTitle').innerHTML = 'All To Receive Products'">To Receive
|
||||
<i class="fa-solid fa-box-archive"></i></div>
|
||||
<div class="tab" data-tab-name="completed" onclick="showTab('completed'), document.getElementById('tableTitle').innerHTML = 'All Completed Purchase'">Completed
|
||||
<i class="fa-solid fa-square-check"></i></div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="ec-vendor-card-body">
|
||||
<div class="ec-vendor-card-table">
|
||||
<!-- <div class="tab-container">
|
||||
<div class="tab" data-tab-name="toPay" onclick="showTab('toPay')">To Pay</div>
|
||||
<div class="tab" data-tab-name="toShip" onclick="showTab('toShip')">To Ship</div>
|
||||
<div class="tab" data-tab-name="toReceive" onclick="showTab('toReceive')">To Receive</div>
|
||||
<div class="tab" data-tab-name="completed" onclick="showTab('completed')">Completed</div>
|
||||
</div> -->
|
||||
|
||||
<!-- 03-15-2024 Stacy added tab for all orders -->
|
||||
<div id="allOrders" class="tab-content active">
|
||||
<div id="allOrders" class=" tab-content active">
|
||||
<!-- Content for "all Orders" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead class="theadTitle">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -288,6 +345,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
// echo '<img class="prod-img" src="https://api.obanana.com/images/storage/web_images/1710214273217-no_image.png" alt="product">';
|
||||
// }
|
||||
?>
|
||||
<img class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product">
|
||||
</td>
|
||||
<!-- <img class="prod-img" src="<?php # echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td> -->
|
||||
<td><span><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
|
@ -525,6 +583,9 @@ if ($_SESSION["userId"] <> "") {
|
|||
$totalAmount += $order['total_amount'];
|
||||
|
||||
?>
|
||||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
|
@ -536,13 +597,22 @@ if ($_SESSION["userId"] <> "") {
|
|||
<td><span><?php echo $order['courier_name']; ?></span></td> -->
|
||||
<td><span><?php echo date("F j, Y", strtotime($order['updatedAt'])); ?></span></td>
|
||||
<td>
|
||||
<?php
|
||||
<?php
|
||||
$currentDate = time(); // Current Unix timestamp
|
||||
|
||||
if ($order['return_order']['status'] === 'To Approve') {
|
||||
echo '<span class="tbl-btn">Refund Requested</span>';
|
||||
} elseif ($order['return_order']['status'] === 'To Ship') {
|
||||
echo '<span class="tbl-btn">For Refund</span>';
|
||||
}else {
|
||||
echo '<a class="btn btn-lg btn-primary" data-bs-toggle="modal" data-bs-target="#modal-refund-' . $order['_id'] . '">Return/Refund</a>';
|
||||
} else {
|
||||
$orderDate = strtotime($order['updatedAt']);
|
||||
$sevenDaysAfterOrder = strtotime('+7 days', $orderDate); // Seven days after the order date
|
||||
|
||||
if ($currentDate >= $sevenDaysAfterOrder) {
|
||||
echo '<span class="tbl-btn" disabled></span>';
|
||||
} else {
|
||||
echo '<a class="btn btn-lg btn-primary" data-bs-toggle="modal" data-bs-target="#modal-refund-' . $order['_id'] . '">Return/Refund</a>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</td>
|
||||
|
@ -751,7 +821,6 @@ if ($_SESSION["userId"] <> "") {
|
|||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<script>
|
||||
var sessionToken = '<?php echo isset($_SESSION["token"]) ? $_SESSION["token"] : ""; ?>';
|
||||
var email = '<?php echo isset($_SESSION["email"]) ? $_SESSION["email"] : ""; ?>';
|
||||
|
@ -883,25 +952,21 @@ if ($_SESSION["userId"] <> "") {
|
|||
<?php include "footer.php" ?>
|
||||
<!-- Footer Area End -->
|
||||
|
||||
<!-- Modal -->
|
||||
<!-- Modal Start -->
|
||||
<!-- 03-15-2024 Stacy added modal -->
|
||||
<div class="modal fade" id="productDetails" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<div class="modal-header" style="height:5px;">
|
||||
<button type="button" class="btn-close-icon" style="align-items: end;" data-bs-dismiss="modal" aria-label="Close">
|
||||
<i class="mdi mdi-close"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="row" id="modalContent" style="justify-content:center; align-items:center;">
|
||||
<!-- modal content placed under script -->
|
||||
<!-- modal header placed under script -->
|
||||
<div class="row" id="modalContent" style="display:flex; justify-content:center;">
|
||||
<!-- modal body placed under script -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal end -->
|
||||
<!-- Modal End -->
|
||||
|
||||
<script>
|
||||
// 03-18-2024 Stacy added script for showing productDetails modal
|
||||
|
@ -910,24 +975,27 @@ if ($_SESSION["userId"] <> "") {
|
|||
var jsonString = $(event.relatedTarget).data('value');
|
||||
|
||||
var jsonObject = JSON.parse(jsonString);
|
||||
const modal = document.getElementById('modalContent'); // No changes here
|
||||
const modal = document.getElementById('modalContent');
|
||||
|
||||
const date = new Date(jsonObject.updatedAt); const formatter = new Intl. DateTimeFormat('en-US', { day: '2-digit', month: '2-digit', year: 'numeric' }); const formattedDate = formatter. format(date);
|
||||
const date = new Date(jsonObject.updatedAt); const formatter = new Intl. DateTimeFormat('en-US', { day: '2-digit', month: 'long', year: 'numeric' }); const formattedDate = formatter. format(date);
|
||||
|
||||
if (jsonObject.status === 'TO PAY') { // Changed $order['status'] to jsonObject.status
|
||||
modal.innerHTML = `
|
||||
<div class="row" style="margin-left:20px;">
|
||||
<div class="modal-header" style="height:5px;">
|
||||
<h5 class="modal-title fs-5 font-weight-bold">${jsonObject.items[0].product.name}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="row" style="display:flex; justify-content:center; margin-left:20px;">
|
||||
<div class="col-md-6">
|
||||
<img class="image-thumb-preview" style="width:100%; height:100%; padding-left:20px;" src="${jsonObject.items[0].product.product_image}" alt="product" />
|
||||
<img class="image-thumb-preview pt-3 pb-3" style="width:100%; height:100%; padding-left:20px;" src="${jsonObject.items[0].product.product_image}" alt="product" />
|
||||
</div>
|
||||
<div class="col-md-6" style="margin:auto;">
|
||||
<ul style="font-size:14px;">
|
||||
<li><b>Product Name:</b> ${jsonObject.items[0].product.name}</li>
|
||||
<li><b>Quantity:</b> ${jsonObject.items[0].quantity}</li>
|
||||
<li><b>Unit Price:</b> ${jsonObject.items[0].price}</li>
|
||||
<li><b>Price:</b> ${jsonObject.total_amount}</li>
|
||||
<li><b>Status:</b> ${jsonObject.status}</li>
|
||||
<li><b>Date:</b> ${formattedDate}</li>
|
||||
<ul>
|
||||
<li class="fs-6"><b>Quantity:</b> ${jsonObject.items[0].quantity}</li>
|
||||
<li class="fs-6"><b>Unit Price:</b> ${jsonObject.items[0].price}</li>
|
||||
<li class="fs-6"><b>Price:</b> ${jsonObject.total_amount}</li>
|
||||
<li class="fs-6"><b>Status:</b> ${jsonObject.status}</li>
|
||||
<li class="fs-6"><b>Date:</b> ${formattedDate}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>`;
|
||||
|
@ -935,20 +1003,23 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
if (jsonObject.status === 'TO SHIP') {
|
||||
modal.innerHTML = `
|
||||
<div class="row" style="margin-left:20px;">
|
||||
<div class="modal-header" style="height:5px;">
|
||||
<h5 class="modal-title fs-5 font-weight-bold">${jsonObject.items[0].product.name}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="row" style="display:flex; justify-content:center; margin-left:20px;">
|
||||
<div class="col-md-6">
|
||||
<img class="image-thumb-preview" style="width:100%; height:100%; padding-left:20px;" src="${jsonObject.items[0].product.product_image}" alt="product" />
|
||||
<img class="image-thumb-preview pt-3 pb-3" style="width:100%; height:100%; padding-left:20px;" src="${jsonObject.items[0].product.product_image}" alt="product" />
|
||||
</div>
|
||||
<div class="col-md-6" style="margin:auto;">
|
||||
<ul style="font-size:14px;">
|
||||
<li><b>Product Name:</b> ${jsonObject.items[0].product.name}</li>
|
||||
<li><b>Quantity:</b> ${jsonObject.items[0].quantity}</li>
|
||||
<li><b>Unit Price:</b> ${jsonObject.items[0].price}</li>
|
||||
<li><b>Price:</b> ${jsonObject.total_amount}</li>
|
||||
<li><b>Status:</b> ${jsonObject.status}</li>
|
||||
<li><b>Tracking Number:</b> ${jsonObject.tracking_number}</li>
|
||||
<li><b>Courier Name:</b> ${jsonObject.courier_name}</li>
|
||||
<li><b>Date:</b> ${formattedDate}</li>
|
||||
<ul>
|
||||
<li class="fs-6"><b>Quantity:</b> ${jsonObject.items[0].quantity}</li>
|
||||
<li class="fs-6"><b>Unit Price:</b> ${jsonObject.items[0].price}</li>
|
||||
<li class="fs-6"><b>Price:</b> ${jsonObject.total_amount}</li>
|
||||
<li class="fs-6"><b>Status:</b> ${jsonObject.status}</li>
|
||||
<li class="fs-6"><b>Tracking Number:</b> ${jsonObject.tracking_number}</li>
|
||||
<li class="fs-6"><b>Courier Name:</b> ${jsonObject.courier_name}</li>
|
||||
<li class="fs-6"><b>Date:</b> ${formattedDate}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>`;
|
||||
|
@ -956,20 +1027,23 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
if (jsonObject.status === 'TO RECEIVE') {
|
||||
modal.innerHTML = `
|
||||
<div class="row" style="margin-left:20px;">
|
||||
<div class="modal-header" style="height:5px;">
|
||||
<h5 class="modal-title fs-5 font-weight-bold">${jsonObject.items[0].product.name}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="row" style="display:flex; justify-content:center; margin-left:20px;">
|
||||
<div class="col-md-6">
|
||||
<img class="image-thumb-preview" style="width:100%; height:100%; padding-left:20px;" src="${jsonObject.items[0].product.product_image}" alt="product" />
|
||||
<img class="image-thumb-preview pt-3 pb-3" style="width:100%; height:100%; padding-left:20px;" src="${jsonObject.items[0].product.product_image}" alt="product" />
|
||||
</div>
|
||||
<div class="col-md-6" style="margin:auto;">
|
||||
<ul style="font-size:14px;">
|
||||
<li><b>Product Name:</b> ${jsonObject.items[0].product.name}</li>
|
||||
<li><b>Quantity:</b> ${jsonObject.items[0].quantity}</li>
|
||||
<li><b>Unit Price:</b> ${jsonObject.items[0].price}</li>
|
||||
<li><b>Price:</b> ${jsonObject.total_amount}</li>
|
||||
<li><b>Status:</b> ${jsonObject.status}</li>
|
||||
<li><b>Tracking Number:</b> ${jsonObject.tracking_number}</li>
|
||||
<li><b>Courier Name:</b> ${jsonObject.courier_name}</li>
|
||||
<li><b>Date:</b> ${formattedDate}</li>
|
||||
<ul>
|
||||
<li class="fs-6"><b>Quantity:</b> ${jsonObject.items[0].quantity}</li>
|
||||
<li class="fs-6"><b>Unit Price:</b> ${jsonObject.items[0].price}</li>
|
||||
<li class="fs-6"><b>Price:</b> ${jsonObject.total_amount}</li>
|
||||
<li class="fs-6"><b>Status:</b> ${jsonObject.status}</li>
|
||||
<li class="fs-6"><b>Tracking Number:</b> ${jsonObject.tracking_number}</li>
|
||||
<li class="fs-6"><b>Courier Name:</b> ${jsonObject.courier_name}</li>
|
||||
<li class="fs-6"><b>Date:</b> ${formattedDate}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>`;
|
||||
|
@ -977,20 +1051,23 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
if (jsonObject.status === 'COMPLETED') {
|
||||
modal.innerHTML = `
|
||||
<div class="row" style="margin-left:20px;">
|
||||
<div class="modal-header" style="height:5px;">
|
||||
<h5 class="modal-title fs-5 font-weight-bold">${jsonObject.items[0].product.name}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="row" style="display:flex; justify-content:center; margin-left:20px;">
|
||||
<div class="col-md-6">
|
||||
<img class="image-thumb-preview" style="width:100%; height:100%; padding-left:20px;" src="${jsonObject.items[0].product.product_image}" alt="product" />
|
||||
<img class="image-thumb-preview pt-3 pb-3" style="width:100%; height:100%; padding-left:20px;" src="${jsonObject.items[0].product.product_image}" alt="product" />
|
||||
</div>
|
||||
<div class="col-md-6" style="margin:auto;">
|
||||
<ul style="font-size:14px;">
|
||||
<li><b>Product Name:</b> ${jsonObject.items[0].product.name}</li>
|
||||
<li><b>Quantity:</b> ${jsonObject.items[0].quantity}</li>
|
||||
<li><b>Unit Price:</b> ${jsonObject.items[0].price}</li>
|
||||
<li><b>Price:</b> ${jsonObject.total_amount}</li>
|
||||
<li><b>Status:</b> ${jsonObject.status}</li>
|
||||
<li><b>Tracking Number:</b> ${jsonObject.tracking_number}</li>
|
||||
<li><b>Courier Name:</b> ${jsonObject.courier_name}</li>
|
||||
<li><b>Date:</b> ${formattedDate}</li>
|
||||
<ul>
|
||||
<li class="fs-6"><b>Quantity:</b> ${jsonObject.items[0].quantity}</li>
|
||||
<li class="fs-6"><b>Unit Price:</b> ${jsonObject.items[0].price}</li>
|
||||
<li class="fs-6"><b>Price:</b> ${jsonObject.total_amount}</li>
|
||||
<li class="fs-6"><b>Status:</b> ${jsonObject.status}</li>
|
||||
<li class="fs-6"><b>Tracking Number:</b> ${jsonObject.tracking_number}</li>
|
||||
<li class="fs-6"><b>Courier Name:</b> ${jsonObject.courier_name}</li>
|
||||
<li class="fs-6"><b>Date:</b> ${formattedDate}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>`;
|
||||
|
@ -998,20 +1075,24 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
if (jsonObject.status === 'RETURNED') {
|
||||
modal.innerHTML = `
|
||||
<div class="row" style="margin-left:20px;">
|
||||
<div class="modal-header" style="height:5px;">
|
||||
<h5 class="modal-title fs-5 font-weight-bold">${jsonObject.items[0].product.name}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="row" style="display:flex; justify-content:center; margin-left:20px;">
|
||||
<div class="col-md-6">
|
||||
<img class="image-thumb-preview" style="width:100%; height:100%; padding-left:20px;" src="${jsonObject.items[0].product.product_image}" alt="product" />
|
||||
<img class="image-thumb-preview pt-3 pb-3" style="width:100%; height:100%; padding-left:20px;" src="${jsonObject.items[0].product.product_image}" alt="product" />
|
||||
</div>
|
||||
<div class="col-md-6" style="margin:auto;">
|
||||
<ul style="font-size:14px;">
|
||||
<li><b>Product Name:</b> ${jsonObject.items[0].product.name}</li>
|
||||
<li><b>Quantity:</b> ${jsonObject.items[0].quantity}</li>
|
||||
<li><b>Unit Price:</b> ${jsonObject.items[0].price}</li>
|
||||
<li><b>Price:</b> ${jsonObject.total_amount}</li>
|
||||
<li><b>Status:</b> ${jsonObject.status}</li>
|
||||
<li><b>Tracking Number:</b> ${jsonObject.tracking_number}</li>
|
||||
<li><b>Courier Name:</b> ${jsonObject.courier_name}</li>
|
||||
<li><b>Date:</b> ${formattedDate}</li>
|
||||
<ul>
|
||||
<li class="fs-6"><b>Product Name:</b> ${jsonObject.items[0].product.name}</li>
|
||||
<li class="fs-6"><b>Quantity:</b> ${jsonObject.items[0].quantity}</li>
|
||||
<li class="fs-6"><b>Unit Price:</b> ${jsonObject.items[0].price}</li>
|
||||
<li class="fs-6"><b>Price:</b> ${jsonObject.total_amount}</li>
|
||||
<li class="fs-6"><b>Status:</b> ${jsonObject.status}</li>
|
||||
<li class="fs-6"><b>Tracking Number:</b> ${jsonObject.tracking_number}</li>
|
||||
<li class="fs-6"><b>Courier Name:</b> ${jsonObject.courier_name}</li>
|
||||
<li class="fs-6"><b>Date:</b> ${formattedDate}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>`;
|
||||
|
|
|
@ -40,6 +40,9 @@ if ($_SESSION["userId"] <> "") {
|
|||
<link rel="stylesheet" href="assets/css/plugins/slick.min.css" />
|
||||
<link rel="stylesheet" href="assets/css/plugins/bootstrap.css" />
|
||||
|
||||
<!-- FLATICON -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Main Style -->
|
||||
<link rel="stylesheet" href="assets/css/style.css" />
|
||||
<link rel="stylesheet" href="assets/css/style2.css" />
|
||||
|
@ -49,13 +52,92 @@ if ($_SESSION["userId"] <> "") {
|
|||
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
|
||||
<style>
|
||||
.tab.active {
|
||||
background-color: #ffaa00;
|
||||
background-color: #ffffff;
|
||||
/* Set your desired background color for the active tab */
|
||||
color: #ffffff;
|
||||
color: #ffaa00;
|
||||
/* Set your desired text color for the active tab */
|
||||
border: 1px solid #ffaa00
|
||||
/* Set your desired border color for the active tab */
|
||||
}
|
||||
.tab {
|
||||
background-color: #ffaa00;
|
||||
color: #ffffff;
|
||||
font-family: "Poppins, sans-serif";
|
||||
font-weight: 400;
|
||||
/* margin: 2px; */
|
||||
text-align: center;
|
||||
/* margin-right: -25px; */
|
||||
}
|
||||
.tab i {
|
||||
font-size: 15px;
|
||||
/* padding-left: 3px; */
|
||||
}
|
||||
.tableView:hover {
|
||||
/* background-color: #f5f5f5; */
|
||||
background-color: #e5e5e5;
|
||||
}
|
||||
.tab-content {
|
||||
border: none;
|
||||
margin-top: -30px;
|
||||
}
|
||||
/* .theadTitle {
|
||||
background-color: #dddddd;
|
||||
padding-top: -90px;
|
||||
} */
|
||||
|
||||
@media only screen and (max-width: 640px) {
|
||||
#tableTitle {
|
||||
font-size: 14px;
|
||||
}
|
||||
#shopNow {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
@media only screen and (max-width: 460px) {
|
||||
#tableTitle {
|
||||
font-size: 12px;
|
||||
}
|
||||
#shopNow {
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
/* for status buttons */
|
||||
@media only screen and (max-width: 10000px) {
|
||||
.tab {
|
||||
font-size: 13px;
|
||||
width: 9rem;
|
||||
}
|
||||
}
|
||||
@media only screen and (max-width: 1200px) {
|
||||
.tab {
|
||||
font-size: 10px;
|
||||
width: 7rem;
|
||||
}
|
||||
.tab i {
|
||||
font-size: 9px;
|
||||
}
|
||||
}
|
||||
@media only screen and (max-width: 700px) {
|
||||
.tab {
|
||||
font-size: 9px;
|
||||
width: 6rem;
|
||||
}
|
||||
.tab i {
|
||||
font-size: 9px;
|
||||
}
|
||||
}
|
||||
@media only screen and (max-width: 620px) {
|
||||
.tab {
|
||||
font-size: 0px;
|
||||
width:5rem;
|
||||
}
|
||||
.tab i {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function updateCartItemCount() {
|
||||
$.get("cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data, status) {
|
||||
|
@ -152,28 +234,94 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
</div>
|
||||
<div class="ec-shop-rightside col-lg-9 col-md-12">
|
||||
<div class="ec-vendor-dashboard-card">
|
||||
<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>
|
||||
|
||||
<!-- 03-14-2024 Stacy added cards -->
|
||||
<!-- <div class="row" id="rowTabs" style="justify-content:center; padding-bottom:20px; padding-right:20px; display:flex; align-items:center; text-align:center;">
|
||||
<div id="tableTabs" class="col-lg-3 col-md-6" style="width:8rem;">
|
||||
<div class="tab h-40" data-tab-name="allRefunds" onclick="showTab('allRefunds'), document.getElementById('tableTitle').innerHTML = 'All Refund History'">All Refunds
|
||||
<i class="fa-solid fa-money-bills"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tableTabs" class="col-lg-3 col-md-6" style="width:8rem;">
|
||||
<div class="tab h-40" data-tab-name="toApprove" onclick="showTab('toApprove'), document.getElementById('tableTitle').innerHTML = 'All To Approve Refunds'">To Approve
|
||||
<i class="fa-solid fa-rectangle-list"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tableTabs" class="col-lg-3 col-md-6" style="width:8rem;">
|
||||
<div class="tab h-40" data-tab-name="toShip" onclick="showTab('toShip'), document.getElementById('tableTitle').innerHTML = 'All To Ship Refunds'">To Ship
|
||||
<i class="fa-solid fa-truck"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tableTabs" class="col-lg-3 col-md-6" style="width:8rem;">
|
||||
<div class="tab h-40" data-tab-name="toReceive" onclick="showTab('toReceive'), document.getElementById('tableTitle').innerHTML = 'All To Receive Refunds'">To Receive
|
||||
<i class="fa-solid fa-box-archive"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tableTabs" class="col-lg-3 col-md-6" style="width:8rem;">
|
||||
<div class="tab h-40" data-tab-name="completed" onclick="showTab('completed'), document.getElementById('tableTitle').innerHTML = 'All To Refund Products'">To Refund
|
||||
<i class="fa-solid fa-square-check"></i>
|
||||
</div>
|
||||
</div>
|
||||
<div id="tableTabs" class="col-lg-3 col-md-6" style="width:8rem;">
|
||||
<div class="tab h-40" data-tab-name="completed" onclick="showTab('completed'), document.getElementById('tableTitle').innerHTML = 'All Completed Refund'">Complete
|
||||
<i class="fa-solid fa-square-check"></i>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
<div class="ec-vendor-dashboard-card">
|
||||
<div class="ec-vendor-card-header">
|
||||
<h5 id="tableTitle">All 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" id="shopNow" style="background:none; color:#3474d4;" href="index.php">Shop Now</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card" style="border: none;">
|
||||
<div class="card-body" style="margin-bottom:-20px;">
|
||||
<div class="tab-container d-flex justify-content-around">
|
||||
<!-- 03-25-2024 Stacy modified cards -->
|
||||
<div class="tab active" data-tab-name="allRefunds" onclick="showTab('allRefunds'), document.getElementById('tableTitle').innerHTML = 'All Refund History'">All Refunds
|
||||
<i class="fa-solid fa-money-bills"></i></div>
|
||||
<div class="tab" data-tab-name="toApprove" onclick="showTab('toApprove'), document.getElementById('tableTitle').innerHTML = 'All To Approve Refunds'">To Approve
|
||||
<i class="fa-solid fa-rectangle-list"></i></div>
|
||||
<div class="tab" data-tab-name="toShip" onclick="showTab('toShip'), document.getElementById('tableTitle').innerHTML = 'All To Ship Refunds'">To Ship
|
||||
<i class="fa-solid fa-truck"></i></div>
|
||||
<div class="tab" data-tab-name="toReceive" onclick="showTab('toReceive'), document.getElementById('tableTitle').innerHTML = 'All To Receive Refunds'">To Receive
|
||||
<i class="fa-solid fa-box-archive"></i></div>
|
||||
<div class="tab" data-tab-name="toRefund" onclick="showTab('toRefund'), document.getElementById('tableTitle').innerHTML = 'All To Refund Products'">To Refund
|
||||
<i class="fa-solid fa-money-bill-1-wave"></i></div>
|
||||
<div class="tab" data-tab-name="returnComplete" onclick="showTab('returnComplete'), document.getElementById('tableTitle').innerHTML = 'All Completed Refund'">Complete
|
||||
<i class="fa-solid fa-square-check"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ec-vendor-card-body">
|
||||
<div class="ec-vendor-card-table">
|
||||
<div class="tab-container">
|
||||
<div class="tab" data-tab-name="toApprove" onclick="showTab('toApprove')">To Approve</div>
|
||||
<div class="tab" data-tab-name="toShip" onclick="showTab('toShip')">To Ship</div>
|
||||
<div class="tab" data-tab-name="toReceive" onclick="showTab('toReceive')">To Receive</div>
|
||||
<div class="tab" data-tab-name="toRefund" onclick="showTab('toRefund')">To Refund</div>
|
||||
<div class="tab" data-tab-name="returnComplete" onclick="showTab('returnComplete')">Return Complete</div>
|
||||
|
||||
</div>
|
||||
<div id="toApprove" class="tab-content active">
|
||||
<!-- <div class="tab-container">
|
||||
<!-- 03-25-2024 Stacy modified cards -->
|
||||
<!-- <div class="tab" data-tab-name="allRefunds" onclick="showTab('allRefunds'), document.getElementById('tableTitle').innerHTML = 'All Refund History'">All Refunds
|
||||
<i class="fa-solid fa-money-bills"></i></div>
|
||||
<div class="tab" data-tab-name="toApprove" onclick="showTab('toApprove'), document.getElementById('tableTitle').innerHTML = 'All To Approve Refunds'">To Approve
|
||||
<i class="fa-solid fa-rectangle-list"></i></div>
|
||||
<div class="tab" data-tab-name="toShip" onclick="showTab('toShip'), document.getElementById('tableTitle').innerHTML = 'All To Ship Refunds'">To Ship
|
||||
<i class="fa-solid fa-truck"></i></div>
|
||||
<div class="tab" data-tab-name="toReceive" onclick="showTab('toReceive'), document.getElementById('tableTitle').innerHTML = 'All To Receive Refunds'">To Receive
|
||||
<i class="fa-solid fa-box-archive"></i></div>
|
||||
<div class="tab" data-tab-name="toRefund" onclick="showTab('toRefund'), document.getElementById('tableTitle').innerHTML = 'All To Refund Products'">To Refund
|
||||
<i class="fa-solid fa-square-check"></i></div>
|
||||
<div class="tab" data-tab-name="returnComplete" onclick="showTab('returnComplete'), document.getElementById('tableTitle').innerHTML = 'All Completed Refund'">Return Complete
|
||||
<i class="fa-solid fa-square-check"></i></div>
|
||||
</div> -->
|
||||
|
||||
<!-- Content for "To Pay" tab -->
|
||||
<!-- 03-15-2024 Stacy added tab for all orders -->
|
||||
<div id="allRefunds" class="tab-content active">
|
||||
<!-- Content for "all Orders" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead class="theadTitle">
|
||||
<tr>
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -181,8 +329,69 @@ if ($_SESSION["userId"] <> "") {
|
|||
<th scope="col">Unit Price</th>
|
||||
<th scope="col">Price</th>
|
||||
<th scope="col">Refund Status</th>
|
||||
<th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th>
|
||||
<!-- <th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th> -->
|
||||
<th scope="col">Date</th>
|
||||
|
||||
<!-- <th scope="col">Actions</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
if ($_SESSION["isLoggedIn"] && $customer_data) {
|
||||
$customer = $customer_data[0];
|
||||
$orders = getOrderbyCustomerId($customer['_id']);
|
||||
$totalAmount = 0;
|
||||
if ($orders) {
|
||||
$order_data = json_decode($orders, true);
|
||||
$_SESSION['cart_items'] = $order_data;
|
||||
foreach ($order_data as $order) {
|
||||
// Ensure that the required data is available before accessing it
|
||||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO APPROVE') || (strtoupper($order['return_order']['status']) === 'TO SHIP')
|
||||
|| (strtoupper($order['return_order']['status']) === 'TO RECEIVE') || (strtoupper($order['return_order']['status']) === 'TO REFUND')
|
||||
|| (strtoupper($order['return_order']['status']) === 'RETURN COMPLETE') && isset($order['items'][0]['product'])) {
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
<td><span><?php echo date("F j, Y", strtotime($order['updatedAt'])); ?></span></td>
|
||||
|
||||
<!-- <td><span class="tbl-btn"><a class="btn btn-lg btn-primary" href="#">View</a></span></td> -->
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="toApprove" class="tab-content">
|
||||
<!-- Content for "To Approve" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead class="theadTitle">
|
||||
<tr>
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col">Quantity</th>
|
||||
<th scope="col">Unit Price</th>
|
||||
<th scope="col">Price</th>
|
||||
<th scope="col">Refund Status</th>
|
||||
<!-- <th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th> -->
|
||||
<th scope="col">Date</th>
|
||||
|
||||
<!-- <th scope="col">Actions</th> -->
|
||||
|
@ -202,15 +411,18 @@ if ($_SESSION["userId"] <> "") {
|
|||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO APPROVE') && isset($order['items'][0]['product'])) {
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php echo $order['return_order']['image']; ?>" alt="product"></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
<td><span><?php echo date("F j, Y", strtotime($order['updatedAt'])); ?></span></td>
|
||||
|
||||
<!-- <td><span class="tbl-btn"><a class="btn btn-lg btn-primary" href="#">View</a></span></td> -->
|
||||
|
@ -224,11 +436,12 @@ if ($_SESSION["userId"] <> "") {
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="toShip" class="tab-content">
|
||||
|
||||
|
||||
<div id="toShip" class="tab-content">
|
||||
<!-- Content for "To Ship" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead class="theadTitle">
|
||||
<tr>
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -236,8 +449,8 @@ if ($_SESSION["userId"] <> "") {
|
|||
<th scope="col">Unit Price</th>
|
||||
<th scope="col">Price</th>
|
||||
<th scope="col">Refund Status</th>
|
||||
<th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th>
|
||||
<!-- <th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th> -->
|
||||
<th scope="col">Date</th>
|
||||
|
||||
<!-- <th scope="col">Actions</th> -->
|
||||
|
@ -257,15 +470,18 @@ if ($_SESSION["userId"] <> "") {
|
|||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO SHIP') && isset($order['items'][0]['product'])) {
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php echo $order['return_order']['image']; ?>" alt="product"></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
<td><span><?php echo date("F j, Y", strtotime($order['updatedAt'])); ?></span></td>
|
||||
|
||||
<!-- <td><span class="tbl-btn"><a class="btn btn-lg btn-primary" href="#">View</a></span></td> -->
|
||||
|
@ -280,9 +496,11 @@ if ($_SESSION["userId"] <> "") {
|
|||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="toReceive" class="tab-content">
|
||||
<!-- Content for "To Receive" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead class="theadTitle">
|
||||
<tr>
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -290,9 +508,10 @@ if ($_SESSION["userId"] <> "") {
|
|||
<th scope="col">Unit Price</th>
|
||||
<th scope="col">Price</th>
|
||||
<th scope="col">Refund Status</th>
|
||||
<th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th>
|
||||
<!-- <th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th> -->
|
||||
<th scope="col">Date</th>
|
||||
|
||||
<!-- <th scope="col">Actions</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -310,15 +529,18 @@ if ($_SESSION["userId"] <> "") {
|
|||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO RECEIVE') && isset($order['items'][0]['product'])) {
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php echo $order['return_order']['image']; ?>" alt="product"></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
<td><span><?php echo date("F j, Y", strtotime($order['updatedAt'])); ?></span></td>
|
||||
<!-- <td>
|
||||
<span class="tbl-btn">
|
||||
|
@ -336,9 +558,11 @@ if ($_SESSION["userId"] <> "") {
|
|||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="toRefund" class="tab-content">
|
||||
<!-- Content for "To Refund" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead class="theadTitle">
|
||||
<tr>
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -346,9 +570,10 @@ if ($_SESSION["userId"] <> "") {
|
|||
<th scope="col">Unit Price</th>
|
||||
<th scope="col">Price</th>
|
||||
<th scope="col">Refund Status</th>
|
||||
<th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th>
|
||||
<!-- <th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th> -->
|
||||
<th scope="col">Date</th>
|
||||
|
||||
<!-- <th scope="col">Actions</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
|
@ -366,15 +591,18 @@ if ($_SESSION["userId"] <> "") {
|
|||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO REFUND') && isset($order['items'][0]['product'])) {
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php echo $order['return_order']['image']; ?>" alt="product"></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
<td><span><?php echo date("F j, Y", strtotime($order['updatedAt'])); ?></span></td>
|
||||
<!-- <td>
|
||||
<span class="tbl-btn">
|
||||
|
@ -392,9 +620,11 @@ if ($_SESSION["userId"] <> "") {
|
|||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<div id="returnComplete" class="tab-content">
|
||||
<!-- Content for "Return Complete" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead class="theadTitle">
|
||||
<tr>
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -402,8 +632,8 @@ if ($_SESSION["userId"] <> "") {
|
|||
<th scope="col">Unit Price</th>
|
||||
<th scope="col">Price</th>
|
||||
<th scope="col">Refund Status</th>
|
||||
<th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th>
|
||||
<!-- <th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th> -->
|
||||
<th scope="col">Date</th>
|
||||
<!-- <th scope="col">Actions</th> -->
|
||||
</tr>
|
||||
|
@ -422,15 +652,18 @@ if ($_SESSION["userId"] <> "") {
|
|||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'RETURN COMPLETE') && isset($order['items'][0]['product'])) {
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php echo $order['return_order']['image']; ?>" alt="product"></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
<td><span><?php echo date("F j, Y", strtotime($order['updatedAt'])); ?></span></td>
|
||||
<!-- <td>
|
||||
<span class="tbl-btn">
|
||||
|
@ -667,9 +900,170 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
<!-- Footer Start -->
|
||||
<?php include "footer.php" ?>
|
||||
|
||||
<!-- Footer Area End -->
|
||||
|
||||
|
||||
<!-- Modal Start -->
|
||||
<!-- 03-15-2024 Stacy added modal -->
|
||||
<div class="modal fade" id="productDetails" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<!-- modal header placed under script -->
|
||||
<div class="row" id="modalContent" style="display:flex; justify-content:center;">
|
||||
<!-- modal body placed under script -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal End -->
|
||||
|
||||
<script>
|
||||
// 03-21-2024 Stacy added script for showing productDetails modal
|
||||
document.getElementById('productDetails').addEventListener('shown.bs.modal', function (event) {
|
||||
|
||||
var jsonString = $(event.relatedTarget).data('value');
|
||||
|
||||
var jsonObject = JSON.parse(jsonString);
|
||||
const modal = document.getElementById('modalContent');
|
||||
|
||||
const date = new Date(jsonObject.updatedAt); const formatter = new Intl. DateTimeFormat('en-US', { day: '2-digit', month: 'long', year: 'numeric' }); const formattedDate = formatter. format(date);
|
||||
|
||||
if (jsonObject.return_order.status === 'To Approve') {
|
||||
modal.innerHTML = `
|
||||
<div class="modal-header" style="height:5px;">
|
||||
<h5 class="modal-title fs-5 font-weight-bold">${jsonObject.items[0].product.name}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="row pt-3" style="display:flex; justify-content:center; margin-left:20px;">
|
||||
<div class="col-md-6">
|
||||
<img class="image-thumb-preview pt-3 pb-3" style="width:100%; height:100%; padding-left:20px;" src="${jsonObject.items[0].product.product_image}" alt="product" />
|
||||
</div>
|
||||
<div class="col-md-6" style="margin:auto;">
|
||||
<ul>
|
||||
<li class="fs-6"><b>Quantity:</b> ${jsonObject.items[0].quantity}</li>
|
||||
<li class="fs-6"><b>Unit Price:</b> ${jsonObject.items[0].price}</li>
|
||||
<li class="fs-6"><b>Price:</b> ${jsonObject.total_amount}</li>
|
||||
<li class="fs-6"><b>Refund Status:</b> ${jsonObject.return_order.status}</li>
|
||||
<li class="fs-6"><b>Refund Reason:</b> ${jsonObject.return_order.reason}</li>
|
||||
<li class="fs-6"><b>Refund Proof:</b></li>
|
||||
<li class="fs-6 pl-3"><img class="prod-img" style="width:50%; height:50%;" src="${jsonObject.return_order.image}" alt="product"></li>
|
||||
<li class="fs-6"><b>Date:</b> ${formattedDate}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
if (jsonObject.return_order.status === 'To Ship') {
|
||||
modal.innerHTML = `
|
||||
<div class="modal-header" style="height:5px;">
|
||||
<h5 class="modal-title fs-5 font-weight-bold">${jsonObject.items[0].product.name}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="row pt-3" style="display:flex; justify-content:center; margin-left:20px;">
|
||||
<div class="col-md-6">
|
||||
<img class="image-thumb-preview pt-3 pb-3" style="width:100%; height:100%; padding-left:20px;" src="${jsonObject.items[0].product.product_image}" alt="product" />
|
||||
</div>
|
||||
<div class="col-md-6" style="margin:auto;">
|
||||
<ul>
|
||||
<li class="fs-6"><b>Quantity:</b> ${jsonObject.items[0].quantity}</li>
|
||||
<li class="fs-6"><b>Unit Price:</b> ${jsonObject.items[0].price}</li>
|
||||
<li class="fs-6"><b>Price:</b> ${jsonObject.total_amount}</li>
|
||||
<li class="fs-6"><b>Refund Status:</b> ${jsonObject.return_order.status}</li>
|
||||
<li class="fs-6"><b>Refund Reason:</b> ${jsonObject.return_order.reason}</li>
|
||||
<li class="fs-6"><b>Refund Proof:</b></li>
|
||||
<li class="fs-6 pl-3"><img class="prod-img" style="width:50%; height:50%;" src="${jsonObject.return_order.image}" alt="product"></li>
|
||||
<li class="fs-6"><b>Date:</b> ${formattedDate}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
if (jsonObject.return_order.status === 'To Receive') {
|
||||
modal.innerHTML = `
|
||||
<div class="modal-header" style="height:5px;">
|
||||
<h5 class="modal-title fs-5 font-weight-bold">${jsonObject.items[0].product.name}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="row pt-3" style="display:flex; justify-content:center; margin-left:20px;">
|
||||
<div class="col-md-6">
|
||||
<img class="image-thumb-preview pt-3 pb-3" style="width:100%; height:100%; padding-left:20px;" src="${jsonObject.items[0].product.product_image}" alt="product" />
|
||||
</div>
|
||||
<div class="col-md-6" style="margin:auto;">
|
||||
<ul>
|
||||
<li class="fs-6"><b>Quantity:</b> ${jsonObject.items[0].quantity}</li>
|
||||
<li class="fs-6"><b>Unit Price:</b> ${jsonObject.items[0].price}</li>
|
||||
<li class="fs-6"><b>Price:</b> ${jsonObject.total_amount}</li>
|
||||
<li class="fs-6"><b>Refund Status:</b> ${jsonObject.return_order.status}</li>
|
||||
<li class="fs-6"><b>Refund Reason:</b> ${jsonObject.return_order.reason}</li>
|
||||
<li class="fs-6"><b>Refund Proof:</b></li>
|
||||
<li class="fs-6 pl-3"><img class="prod-img" style="width:50%; height:50%;" src="${jsonObject.return_order.image}" alt="product"></li>
|
||||
<li class="fs-6"><b>Date:</b> ${formattedDate}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
if (jsonObject.return_order.status === 'To Refund') {
|
||||
modal.innerHTML = `
|
||||
<div class="modal-header" style="height:5px;">
|
||||
<h5 class="modal-title fs-5 font-weight-bold">${jsonObject.items[0].product.name}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="row pt-3" style="display:flex; justify-content:center; margin-left:20px;">
|
||||
<div class="col-md-6">
|
||||
<img class="image-thumb-preview pt-3 pb-3" style="width:100%; height:100%; padding-left:20px;" src="${jsonObject.items[0].product.product_image}" alt="product" />
|
||||
</div>
|
||||
<div class="col-md-6" style="margin:auto;">
|
||||
<ul>
|
||||
<li class="fs-6"><b>Quantity:</b> ${jsonObject.items[0].quantity}</li>
|
||||
<li class="fs-6"><b>Unit Price:</b> ${jsonObject.items[0].price}</li>
|
||||
<li class="fs-6"><b>Price:</b> ${jsonObject.total_amount}</li>
|
||||
<li class="fs-6"><b>Refund Status:</b> ${jsonObject.return_order.status}</li>
|
||||
<li class="fs-6"><b>Refund Reason:</b> ${jsonObject.return_order.reason}</li>
|
||||
<li class="fs-6"><b>Refund Proof:</b></li>
|
||||
<li class="fs-6 pl-3"><img class="prod-img" style="width:50%; height:50%;" src="${jsonObject.return_order.image}" alt="product"></li>
|
||||
<li class="fs-6"><b>Date:</b> ${formattedDate}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
if (jsonObject.return_order.status === 'Return Complete') {
|
||||
modal.innerHTML = `
|
||||
<div class="modal-header" style="height:5px;">
|
||||
<h5 class="modal-title fs-5 font-weight-bold">${jsonObject.items[0].product.name}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="row pt-3" style="display:flex; justify-content:center; margin-left:20px;">
|
||||
<div class="col-md-6">
|
||||
<img class="image-thumb-preview pt-3 pb-3" style="width:100%; height:100%; padding-left:20px;" src="${jsonObject.items[0].product.product_image}" alt="product" />
|
||||
</div>
|
||||
<div class="col-md-6" style="margin:auto;">
|
||||
<ul>
|
||||
<li class="fs-6"><b>Quantity:</b> ${jsonObject.items[0].quantity}</li>
|
||||
<li class="fs-6"><b>Unit Price:</b> ${jsonObject.items[0].price}</li>
|
||||
<li class="fs-6"><b>Price:</b> ${jsonObject.total_amount}</li>
|
||||
<li class="fs-6"><b>Refund Status:</b> ${jsonObject.return_order.status}</li>
|
||||
<li class="fs-6"><b>Refund Reason:</b> ${jsonObject.return_order.reason}</li>
|
||||
<li class="fs-6"><b>Refund Proof:</b></li>
|
||||
<li class="fs-6 pl-3"><img class="prod-img" style="width:50%; height:50%;" src="${jsonObject.return_order.image}" alt="product"></li>
|
||||
<li class="fs-6"><b>Date:</b> ${formattedDate}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
|
||||
console.log(jsonObject);
|
||||
});
|
||||
|
||||
const modal = document.getElementById('productDetails');
|
||||
console.log(modal);
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Footer navigation panel for responsive display -->
|
||||
<div class="ec-nav-toolbar">
|
||||
<div class="container">
|
||||
|
|
|
@ -181,7 +181,7 @@ $products = productList();
|
|||
|
||||
<a class="btn btn-lg btn-primary" onclick="deleteSelectedProduct('<?php echo $product['_id'] ?>');">Delete Selected</a>
|
||||
|
||||
<a class="btn btn-lg btn-primary" href="vendor-uploads-add-product-action.php" onclick="addProduct('<?php echo $product['_id'] ?>');">Add</a>
|
||||
<a class="btn btn-lg btn-primary" onclick="addProduct('<?php echo $product['_id'] ?>');">Add</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-vendor-card-body">
|
||||
|
@ -362,7 +362,8 @@ $products = productList();
|
|||
console.log("Session Token:", sessionToken);
|
||||
login(email, password, function() {
|
||||
// Removed the call to updateSessionToken
|
||||
window.open("vendor-uploads-add-product-action.php" + productId, "_self");
|
||||
// window.open("vendor-uploads-add-product-action.php" + productId, "_self");
|
||||
window.location.href = "vendor-uploads-add-product-action.php?productId=" + productId;
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -10,18 +10,22 @@ if ($_SESSION["userId"] <> "") {
|
|||
$vendorData = $vendorLoginIdjson['results'][0];
|
||||
$vendorId = $vendorData['_id'];
|
||||
$_SESSION["LoggedInVendorId"] = $vendorId;
|
||||
}
|
||||
|
||||
}
|
||||
$authtoken = $_SESSION['token'];
|
||||
|
||||
} else {
|
||||
$_SESSION["isLoggedIn"] = false;
|
||||
header("location: login.php");
|
||||
}
|
||||
$products = productList();
|
||||
$shopOrders = getOrderbyVendorId($vendorId);
|
||||
$vendorOrderss = json_decode($shopOrders);
|
||||
|
||||
if (is_array($vendorOrderss)) {
|
||||
$vendorOrders = json_decode($shopOrders);
|
||||
} elseif (is_object($vendorOrderss) && property_exists($vendorOrderss, 'message')) {
|
||||
$response = getOrderbyVendorId($vendorId);
|
||||
$vendorDecode = json_decode($response);
|
||||
|
||||
// var_dump($vendorDecode);
|
||||
if (is_array($vendorDecode)) {
|
||||
$vendorOrders = json_decode($response);
|
||||
} elseif (is_object($vendorDecode) && property_exists($vendorDecode, 'message')) {
|
||||
$vendorOrders = [];
|
||||
} else {
|
||||
echo "Unknown type or no 'message' property found.";
|
||||
|
@ -39,7 +43,7 @@ if (is_array($vendorOrderss)) {
|
|||
<meta name="keywords" content="apparel, catalog, clean, ecommerce, ecommerce HTML, electronics, fashion, html eCommerce, html store, minimal, multipurpose, multipurpose ecommerce, online store, responsive ecommerce template, shops" />
|
||||
<meta name="description" content="Best ecommerce html template for single and multi vendor store.">
|
||||
<meta name="author" content="ashishmaraviya">
|
||||
|
||||
|
||||
<!-- site Favicon -->
|
||||
<link rel="icon" href="assets/images/favicon/favicon.png" sizes="32x32" />
|
||||
<link rel="apple-touch-icon" href="assets/images/favicon/favicon.png" />
|
||||
|
@ -71,7 +75,23 @@ if (is_array($vendorOrderss)) {
|
|||
/* Set your desired text color for the active tab */
|
||||
|
||||
}
|
||||
#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>
|
||||
<script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
|
||||
<script>
|
||||
function updateCartItemCount() {
|
||||
$.get("cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data, status) {
|
||||
|
@ -153,7 +173,7 @@ if (is_array($vendorOrderss)) {
|
|||
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
|
||||
</div>
|
||||
<!-- <div class="ec-vendor-block-items">
|
||||
<!-- <ul>
|
||||
<ul>
|
||||
<li><a href="vendor-dashboard.php">Dashboard</a></li>
|
||||
<li><a href="vendor-uploads.php">Upload Product</a></li>
|
||||
<li><a href="vendor-settings.php">Settings (Edit)</a></li>
|
||||
|
@ -191,25 +211,92 @@ if (is_array($vendorOrderss)) {
|
|||
<th scope="col">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
<tbody id="paymentsTableBody">
|
||||
<?php
|
||||
$totalPayments = 0;
|
||||
foreach ($vendorOrders as $order) {
|
||||
$orderArray = json_encode($order, true);
|
||||
$orderItems = json_decode($orderArray, true);
|
||||
if(strtolower($orderItems['payment']['status']) == 'paid'){
|
||||
|
||||
$rawDate = $orderItems['payment']['details'][0]['attributes']['data']['attributes']['payments'][0]['createdAt'];
|
||||
if ($rawDate) {
|
||||
$createdAt = new DateTime($rawDate);
|
||||
$formattedDate = $createdAt->format('m/d/Y');
|
||||
}
|
||||
$totalPayments++;
|
||||
?>
|
||||
<tr>
|
||||
<td><span><?php echo $orderItems['status']; ?></span></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td></td>
|
||||
<td><button type="button" class="btn btn-primary" id="vendorPaymentsModalBtn" data-bs-toggle="modal" data-bs-target="#vendorPaymentsModal">View</button></td>
|
||||
<tr>
|
||||
<td><?php echo $orderItems['payment_method']; ?></td>
|
||||
<td>₱ <?php echo $orderItems['total_amount']; ?></td>
|
||||
<td><?php echo $orderItems['payment']['status']; ?></td>
|
||||
<td><?php echo $orderItems['items'][0]['product']['name']; ?></td>
|
||||
<td><?php echo $formattedDate?></td>
|
||||
<td><button type="button" class="btn btn-primary showSinglePaymentBtn" data-order-id="<?php echo $orderItems['_id']; ?>" data-bs-toggle="modal" data-bs-target="#vendorPaymentsModal">View</button></td>
|
||||
|
||||
</tr> </tr>
|
||||
|
||||
</tr>
|
||||
<?php
|
||||
// }
|
||||
}
|
||||
}
|
||||
// }
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="pagination"></div>
|
||||
|
||||
|
||||
<script>
|
||||
const itemsPerPage = 5;
|
||||
const totalItems = <?php echo $totalPayments; ?>;
|
||||
const totalPages = Math.ceil(totalItems / itemsPerPage);
|
||||
|
||||
|
||||
function showPage(page) {
|
||||
const startIndex = (page - 1) * itemsPerPage;
|
||||
const endIndex = startIndex + itemsPerPage;
|
||||
const tableRows = document.querySelectorAll('#paymentsTableBody 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";
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
tableRows.forEach((row, index) => {
|
||||
if (index >= startIndex && index < endIndex) {
|
||||
row.style.display = 'table-row';
|
||||
} else {
|
||||
row.style.display = 'none';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
function createPagination() {
|
||||
const paginationContainer = document.getElementById('pagination');
|
||||
|
||||
for (let i = 1; i <= totalPages; i++) {
|
||||
// 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);
|
||||
}
|
||||
}
|
||||
|
||||
createPagination();
|
||||
showPage(1); // Show the first page by default
|
||||
</script>
|
||||
<script>
|
||||
|
||||
var sessionToken = '<?php echo isset($_SESSION["token"]) ? $_SESSION["token"] : ""; ?>';
|
||||
|
@ -356,88 +443,200 @@ if (is_array($vendorOrderss)) {
|
|||
<!--Gelo added payment details modal-->
|
||||
<div class="modal fade" id="vendorPaymentsModal" tabindex="-1" aria-labelledby="vendorPaymentsModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-xl" style="min-width: 90%;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title fs-5" id="vendorPaymentsModalLabel">Payment ID: 123456</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title fs-5" id="vendorPaymentsModalLabel">Payment ID: <span id="paymentIdSpan"></span></h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="container-fluid" id="orderDetailsContainer">
|
||||
<!-- Dynamic content will be inserted here -->
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="container-fluid">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-4 ">
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<h6><strong>Payment Details</strong></h6>
|
||||
<button disabled class=" border border-success border-2 text-sm btn-outline-success">PAID</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- GELO ADDED AJAX FUNCTION FOR MODAL BOX QUERY -->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.showSinglePaymentBtn').click(function() {
|
||||
var orderId = $(this).data('order-id');
|
||||
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<div class="fw-bold">Gross Amount</div>
|
||||
<div>₱ 150.00</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between p-2" style="border-bottom: 1px solid #000;">
|
||||
<div class="fw-bold"> Fees <span data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
data-bs-custom-class="custom-tooltip"
|
||||
data-bs-title="Insert fee information here"><i class="fi fi-rr-info"></i></span></div>
|
||||
<div>- ₱ 4.35</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<div class="fw-bold"> Net Amount</div>
|
||||
<div>- ₱ 145.65</div>
|
||||
</div>
|
||||
<div class="d-flex p-2">
|
||||
<div class="fw-bold"> Payment Description </div>
|
||||
</div>
|
||||
<div class="d-flex pl-2">
|
||||
Cesar Ryan - 175
|
||||
</div>
|
||||
var token = "<?php echo $authtoken;?>";
|
||||
<?php
|
||||
?>
|
||||
|
||||
$.ajax({
|
||||
|
||||
// url: 'https://api.obanana.shop/api/v1/orders/' + orderId,
|
||||
url: 'https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/' + orderId,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + token
|
||||
},
|
||||
success: function(response) {
|
||||
// Handle successful response
|
||||
var paymentId = response.payment.reference_number;
|
||||
$('#paymentIdSpan').text(paymentId);
|
||||
var gross_price = response.payment.details[0]?.attributes.data.attributes.amount;
|
||||
var payment_status = response.payment.status;
|
||||
var fee = response.payment.details[0]?.attributes.data.attributes.fee;
|
||||
var net_amount = response.payment.details[0]?.attributes.data.attributes.payments[0].attributes.net_amount;
|
||||
var desc = response.items[0].product.name;
|
||||
var method = response.payment_method;
|
||||
var name = response.billing_address.billing_first_name + " " + response.billing_address.billing_last_name;
|
||||
var email = response.payment.details[0]?.attributes.data.attributes.payments[0].attributes.billing?.email;
|
||||
var phone = response.billing_address.billing_phone;
|
||||
var rawDate = response.payment.details[0]?.attributes.data.attributes.payments[0]?.createdAt;
|
||||
var payoutStatus = response.payout_status[0]?.status;
|
||||
if (rawDate){
|
||||
var createdAtDate = new Date(rawDate);
|
||||
var month = String(createdAtDate.getMonth() + 1).padStart(2, '0');
|
||||
var day = String(createdAtDate.getDate()).padStart(2, '0');
|
||||
var year = createdAtDate.getFullYear();
|
||||
var date = month + '/' + day + '/' + year;
|
||||
}
|
||||
|
||||
if(payoutStatus === 'Deposited'){
|
||||
var orderDetailsHtml = `
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-4 ">
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<h6><strong>Payment Details</strong></h6>
|
||||
<button disabled class=" border border-success border-2 text-sm btn-outline-success">PAID</button>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<div class="fw-bold">Gross Amount</div>
|
||||
<div>₱ ${net_amount}</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between p-2" style="border-bottom: 1px solid #000;">
|
||||
<div class="fw-bold"> Fees <span data-bs-toggle="tooltip" data-bs-placement="top"
|
||||
data-bs-custom-class="custom-tooltip"
|
||||
data-bs-title="Insert fee information here"><i class="fi fi-rr-info"></i></span></div>
|
||||
<div>- ₱ ${fee}</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<div class="fw-bold"> Net Amount</div>
|
||||
<div>₱ ${gross_price} </div>
|
||||
</div>
|
||||
<div class="d-flex p-2">
|
||||
<div class="fw-bold"> Payment Description </div>
|
||||
</div>
|
||||
<div class="d-flex pl-2">
|
||||
${desc}
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="fw-bold">Payment Method</div>
|
||||
<div class="text-end">GCash<br> Paid on 11/15/2001</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="fw-bold">Payment Method</div>
|
||||
<div class="text-end">${method}<br> Paid on ${date}</div>
|
||||
</div>
|
||||
<p class="py-2 text-success mt-3 border border-success rounded text-center" style="font-size: 0.975em"><svg xmlns="http://www.w3.org/2000/svg" width="15" height="15" fill="currentColor" class="bi bi-check-circle-fill" viewBox="0 0 16 16">
|
||||
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"/>
|
||||
</svg>
|
||||
This payment is now on your bank account.
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="fw-bold">Billing Details</div>
|
||||
<div >${name}</div>
|
||||
<div> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-envelope-at-fill" viewBox="0 0 16 16">
|
||||
<path d="M2 2A2 2 0 0 0 .05 3.555L8 8.414l7.95-4.859A2 2 0 0 0 14 2zm-2 9.8V4.698l5.803 3.546zm6.761-2.97-6.57 4.026A2 2 0 0 0 2 14h6.256A4.5 4.5 0 0 1 8 12.5a4.49 4.49 0 0 1 1.606-3.446l-.367-.225L8 9.586zM16 9.671V4.697l-5.803 3.546.338.208A4.5 4.5 0 0 1 12.5 8c1.414 0 2.675.652 3.5 1.671"/>
|
||||
<path d="M15.834 12.244c0 1.168-.577 2.025-1.587 2.025-.503 0-1.002-.228-1.12-.648h-.043c-.118.416-.543.643-1.015.643-.77 0-1.259-.542-1.259-1.434v-.529c0-.844.481-1.4 1.26-1.4.585 0 .87.333.953.63h.03v-.568h.905v2.19c0 .272.18.42.411.42.315 0 .639-.415.639-1.39v-.118c0-1.277-.95-2.326-2.484-2.326h-.04c-1.582 0-2.64 1.067-2.64 2.724v.157c0 1.867 1.237 2.654 2.57 2.654h.045c.507 0 .935-.07 1.18-.18v.731c-.219.1-.643.175-1.237.175h-.044C10.438 16 9 14.82 9 12.646v-.214C9 10.36 10.421 9 12.485 9h.035c2.12 0 3.314 1.43 3.314 3.034zm-4.04.21v.227c0 .586.227.8.581.8.31 0 .564-.17.564-.743v-.367c0-.516-.275-.708-.572-.708-.346 0-.573.245-.573.791"/>
|
||||
</svg>
|
||||
${email}
|
||||
|
||||
</div>
|
||||
<div> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-telephone-fill" viewBox="0 0 16 16">
|
||||
<path fill-rule="evenodd" d="M1.885.511a1.745 1.745 0 0 1 2.61.163L6.29 2.98c.329.423.445.974.315 1.494l-.547 2.19a.68.68 0 0 0 .178.643l2.457 2.457a.68.68 0 0 0 .644.178l2.189-.547a1.75 1.75 0 0 1 1.494.315l2.306 1.794c.829.645.905 1.87.163 2.611l-1.034 1.034c-.74.74-1.846 1.065-2.877.702a18.6 18.6 0 0 1-7.01-4.42 18.6 18.6 0 0 1-4.42-7.009c-.362-1.03-.037-2.137.703-2.877z"/>
|
||||
</svg>
|
||||
${phone}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<p class="py-2" style="font-size: 0.975em"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-check-circle-fill" viewBox="0 0 16 16">
|
||||
<path d="M16 8A8 8 0 1 1 0 8a8 8 0 0 1 16 0m-3.97-3.03a.75.75 0 0 0-1.08.022L7.477 9.417 5.384 7.323a.75.75 0 0 0-1.06 1.06L6.97 11.03a.75.75 0 0 0 1.079-.02l3.992-4.99a.75.75 0 0 0-.01-1.05z"/>
|
||||
</svg>
|
||||
This payment is now on your bank account.
|
||||
</p>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="fw-bold">Billing Details</div>
|
||||
<div >Cesar Ryan</div>
|
||||
<div> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-envelope-at-fill" viewBox="0 0 16 16">
|
||||
<path d="M2 2A2 2 0 0 0 .05 3.555L8 8.414l7.95-4.859A2 2 0 0 0 14 2zm-2 9.8V4.698l5.803 3.546zm6.761-2.97-6.57 4.026A2 2 0 0 0 2 14h6.256A4.5 4.5 0 0 1 8 12.5a4.49 4.49 0 0 1 1.606-3.446l-.367-.225L8 9.586zM16 9.671V4.697l-5.803 3.546.338.208A4.5 4.5 0 0 1 12.5 8c1.414 0 2.675.652 3.5 1.671"/>
|
||||
<path d="M15.834 12.244c0 1.168-.577 2.025-1.587 2.025-.503 0-1.002-.228-1.12-.648h-.043c-.118.416-.543.643-1.015.643-.77 0-1.259-.542-1.259-1.434v-.529c0-.844.481-1.4 1.26-1.4.585 0 .87.333.953.63h.03v-.568h.905v2.19c0 .272.18.42.411.42.315 0 .639-.415.639-1.39v-.118c0-1.277-.95-2.326-2.484-2.326h-.04c-1.582 0-2.64 1.067-2.64 2.724v.157c0 1.867 1.237 2.654 2.57 2.654h.045c.507 0 .935-.07 1.18-.18v.731c-.219.1-.643.175-1.237.175h-.044C10.438 16 9 14.82 9 12.646v-.214C9 10.36 10.421 9 12.485 9h.035c2.12 0 3.314 1.43 3.314 3.034zm-4.04.21v.227c0 .586.227.8.581.8.31 0 .564-.17.564-.743v-.367c0-.516-.275-.708-.572-.708-.346 0-.573.245-.573.791"/>
|
||||
</svg>
|
||||
cr.ecom@gmail.com
|
||||
</div>
|
||||
<div> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-telephone-fill" viewBox="0 0 16 16">
|
||||
<path fill-rule="evenodd" d="M1.885.511a1.745 1.745 0 0 1 2.61.163L6.29 2.98c.329.423.445.974.315 1.494l-.547 2.19a.68.68 0 0 0 .178.643l2.457 2.457a.68.68 0 0 0 .644.178l2.189-.547a1.75 1.75 0 0 1 1.494.315l2.306 1.794c.829.645.905 1.87.163 2.611l-1.034 1.034c-.74.74-1.846 1.065-2.877.702a18.6 18.6 0 0 1-7.01-4.42 18.6 18.6 0 0 1-4.42-7.009c-.362-1.03-.037-2.137.703-2.877z"/>
|
||||
</svg>
|
||||
09876543210
|
||||
</div>
|
||||
`;
|
||||
}else{
|
||||
var orderDetailsHtml = `
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
|
||||
<div class="row">
|
||||
|
||||
<div class="col-4 ">
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<h6><strong>Payment Details</strong></h6>
|
||||
<button disabled class=" border border-success border-2 text-sm btn-outline-success">PAID</button>
|
||||
</div>
|
||||
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<div class="fw-bold">Gross Amount</div>
|
||||
<div>₱ ${net_amount}</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between p-2" style="border-bottom: 1px solid #000;">
|
||||
<div class="fw-bold"> Fees </div>
|
||||
<div>- ₱ ${fee}</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<div class="fw-bold"> Net Amount</div>
|
||||
<div>₱ ${gross_price} </div>
|
||||
</div>
|
||||
<div class="d-flex p-2">
|
||||
<div class="fw-bold"> Payment Description </div>
|
||||
</div>
|
||||
<div class="d-flex pl-2">
|
||||
${desc}
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="d-flex justify-content-between">
|
||||
<div class="fw-bold">Payment Method</div>
|
||||
<div class="text-end">${method}<br> Paid on ${date}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-4">
|
||||
<div class="fw-bold">Billing Details</div>
|
||||
<div >${name}</div>
|
||||
<div> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-envelope-at-fill" viewBox="0 0 16 16">
|
||||
<path d="M2 2A2 2 0 0 0 .05 3.555L8 8.414l7.95-4.859A2 2 0 0 0 14 2zm-2 9.8V4.698l5.803 3.546zm6.761-2.97-6.57 4.026A2 2 0 0 0 2 14h6.256A4.5 4.5 0 0 1 8 12.5a4.49 4.49 0 0 1 1.606-3.446l-.367-.225L8 9.586zM16 9.671V4.697l-5.803 3.546.338.208A4.5 4.5 0 0 1 12.5 8c1.414 0 2.675.652 3.5 1.671"/>
|
||||
<path d="M15.834 12.244c0 1.168-.577 2.025-1.587 2.025-.503 0-1.002-.228-1.12-.648h-.043c-.118.416-.543.643-1.015.643-.77 0-1.259-.542-1.259-1.434v-.529c0-.844.481-1.4 1.26-1.4.585 0 .87.333.953.63h.03v-.568h.905v2.19c0 .272.18.42.411.42.315 0 .639-.415.639-1.39v-.118c0-1.277-.95-2.326-2.484-2.326h-.04c-1.582 0-2.64 1.067-2.64 2.724v.157c0 1.867 1.237 2.654 2.57 2.654h.045c.507 0 .935-.07 1.18-.18v.731c-.219.1-.643.175-1.237.175h-.044C10.438 16 9 14.82 9 12.646v-.214C9 10.36 10.421 9 12.485 9h.035c2.12 0 3.314 1.43 3.314 3.034zm-4.04.21v.227c0 .586.227.8.581.8.31 0 .564-.17.564-.743v-.367c0-.516-.275-.708-.572-.708-.346 0-.573.245-.573.791"/>
|
||||
</svg>
|
||||
${email}
|
||||
|
||||
</div>
|
||||
<div> <svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-telephone-fill" viewBox="0 0 16 16">
|
||||
<path fill-rule="evenodd" d="M1.885.511a1.745 1.745 0 0 1 2.61.163L6.29 2.98c.329.423.445.974.315 1.494l-.547 2.19a.68.68 0 0 0 .178.643l2.457 2.457a.68.68 0 0 0 .644.178l2.189-.547a1.75 1.75 0 0 1 1.494.315l2.306 1.794c.829.645.905 1.87.163 2.611l-1.034 1.034c-.74.74-1.846 1.065-2.877.702a18.6 18.6 0 0 1-7.01-4.42 18.6 18.6 0 0 1-4.42-7.009c-.362-1.03-.037-2.137.703-2.877z"/>
|
||||
</svg>
|
||||
${phone}
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
`;
|
||||
}
|
||||
$('#orderDetailsContainer').html(orderDetailsHtml);
|
||||
},
|
||||
})
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<!-- Footer Start -->
|
||||
<?php include "footer.php" ?>
|
||||
|
||||
|
@ -466,20 +665,6 @@ if (is_array($vendorOrderss)) {
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Footer navigation panel for responsive display end -->
|
||||
|
||||
<!-- raymart remove popup feb 20 2024 -->
|
||||
<!-- Recent Purchase Popup -->
|
||||
<!-- <div class="recent-purchase">
|
||||
<img src="assets/images/product-image/1.jpg" alt="payment image">
|
||||
<div class="detail">
|
||||
<p>Someone in new just bought</p>
|
||||
<h6>stylish baby shoes</h6>
|
||||
<p>10 Minutes ago</p>
|
||||
</div>
|
||||
<a href="javascript:void(0)" class="icon-btn recent-close">×</a>
|
||||
</div> -->
|
||||
<!-- Recent Purchase Popup end -->
|
||||
|
||||
<!-- Cart Floating Button -->
|
||||
<div class="ec-cart-float">
|
||||
|
@ -680,6 +865,8 @@ if (is_array($vendorOrderss)) {
|
|||
<script src="assets/js/vendor/bootstrap.min.js"></script>
|
||||
<script src="assets/js/vendor/jquery-migrate-3.3.0.min.js"></script>
|
||||
<script src="assets/js/vendor/modernizr-3.11.2.min.js"></script>
|
||||
|
||||
|
||||
|
||||
<!--Plugins JS-->
|
||||
<script src="assets/js/plugins/swiper-bundle.min.js"></script>
|
||||
|
|
|
@ -3,24 +3,41 @@ include "functions.php";
|
|||
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
// $customer_data = getCustomerbyLoginId($_SESSION["userId"]);
|
||||
$vendorLoginId = searchVendorbyLoginId($_SESSION["userId"]);
|
||||
$vendorLoginIdjson = json_decode($vendorLoginId, true);
|
||||
if (isset($vendorLoginIdjson['results'][0])) {
|
||||
$vendorData = $vendorLoginIdjson['results'][0];
|
||||
$vendorId = $vendorData['_id'];
|
||||
$_SESSION["LoggedInVendorId"] = $vendorId;
|
||||
}
|
||||
// $vendor= getVendorbyId($vendorLoginIdjson['results'][0]['_id']);
|
||||
// // var_dump($vendor);
|
||||
// $array = json_decode($vendor,true);
|
||||
// var_dump($array);
|
||||
$response = getAllPayout($_SESSION['token']);
|
||||
$vendorPayoutData = json_decode($response, true);
|
||||
} else {
|
||||
$_SESSION["isLoggedIn"] = false;
|
||||
header("location: login.php");
|
||||
}
|
||||
|
||||
// $customer_data = getCustomerbyLoginId($_SESSION["userId"]);
|
||||
$vendorLoginId = searchVendorbyLoginId($_SESSION["userId"]);
|
||||
$vendorLoginIdjson = json_decode($vendorLoginId, true);
|
||||
if (isset($vendorLoginIdjson['results'][0])) {
|
||||
$vendorData = $vendorLoginIdjson['results'][0];
|
||||
$vendorId = $vendorData['_id'];
|
||||
$_SESSION["LoggedInVendorId"] = $vendorId;
|
||||
}
|
||||
|
||||
$token = $_SESSION["token"];
|
||||
|
||||
$token_parts = explode(".", $token);
|
||||
$token_payload = base64_decode($token_parts[1]);
|
||||
$token_data = json_decode($token_payload);
|
||||
|
||||
$expiration_time = $token_data->exp;
|
||||
$issued_at_time = $token_data->iat;
|
||||
|
||||
$renewal_time = $issued_at_time + 3300;
|
||||
|
||||
|
||||
if (time() >= $renewal_time) {
|
||||
$token = loginRenew($_SESSION["email"], $_SESSION["password"], $token);
|
||||
$_SESSION["token"] = $token;
|
||||
}
|
||||
|
||||
$authToken = $_SESSION['token'];
|
||||
$response = getAllPayout($authToken);
|
||||
$vendorPayoutData = json_decode($response, true);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
@ -55,12 +72,32 @@ if ($_SESSION["userId"] <> "") {
|
|||
<link rel="stylesheet" href="assets/css/style.css" />
|
||||
<link rel="stylesheet" href="assets/css/style2.css" />
|
||||
<link rel="stylesheet" href="assets/css/responsive.css" />
|
||||
<link href="https://cdn.datatables.net/v/bs5/dt-2.0.3/r-3.0.0/sp-2.3.0/datatables.min.css" rel="stylesheet">
|
||||
|
||||
|
||||
|
||||
<!-- Background css -->
|
||||
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/select2@latest/dist/css/select2.min.css" crossorigin="anonymous" referrerpolicy="no-referrer" />
|
||||
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
|
||||
<script src="https://cdn.jsdelivr.net/npm/select2@latest/dist/js/select2.min.js" crossorigin="anonymous" referrerpolicy="no-referrer"></script>
|
||||
<style>
|
||||
#pagination {
|
||||
display: flex;
|
||||
list-style: none;
|
||||
padding: 0;
|
||||
margin: 0;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
#pagination a {
|
||||
color: #333;
|
||||
text-decoration: none;
|
||||
padding: 5px 10px;
|
||||
border: 1px solid #ccc;
|
||||
border-radius: 4px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body class="shop_page">
|
||||
|
@ -150,19 +187,42 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div class="row">
|
||||
<h4 style="color: #444;">
|
||||
<div class="d-flex align-items-center">
|
||||
<?php
|
||||
$response = getOrderbyVendorId($vendorId);
|
||||
$upcomingPayout = json_decode($response, true);
|
||||
$payoutSum = 0;
|
||||
|
||||
foreach ($upcomingPayout as $x => $val) {
|
||||
$paymentStatus = strtolower($val['payment']['status']);
|
||||
$orderStatus = $val['status'];
|
||||
$payoutStatus = empty($val['payout_status']);
|
||||
if(( $paymentStatus == "paid") && ( $orderStatus == "COMPLETED") && ($payoutStatus == true)){
|
||||
$orderAmount = $val['total_amount'];
|
||||
$payoutSum += $orderAmount;
|
||||
}
|
||||
}
|
||||
|
||||
$finalPayoutSum = number_format($payoutSum, 2, '.', ',');
|
||||
?>
|
||||
<strong>
|
||||
₱ 0.00
|
||||
₱ <?php echo $finalPayoutSum ?>
|
||||
</strong>
|
||||
</div>
|
||||
</h4>
|
||||
<div class="text-sm mt-3">
|
||||
<!-- <div class="text-sm mt-3">
|
||||
Payout Generation: Tue, Mar 19, 2024
|
||||
</div>
|
||||
<div class="text-sm">
|
||||
Receive Payout on or before: Wed, Mar 20, 2024
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="text-sm">
|
||||
Receipient: Philippine National Bank (PNB) Account ending in 6685
|
||||
<?php
|
||||
$vendorResponse = getVendorbyId($vendorId);
|
||||
$vendorInformation = json_decode($vendorResponse, true);
|
||||
$bankAccountNumber = $vendorInformation['bank_acount_details'][0]['bank_account_number'];
|
||||
$bankNumEnding = substr($bankAccountNumber, -3);
|
||||
?>
|
||||
Receipient: Philippine National Bank (PNB) Account ending in <?php echo $bankNumEnding?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -216,16 +276,16 @@ if ($_SESSION["userId"] <> "") {
|
|||
Receive Payout on or before: Wed, Mar 26, 2024
|
||||
</div>
|
||||
<div class="text-sm">
|
||||
Receipient: Philippine National Bank (PNB) Account ending in 6685
|
||||
Receipient: Philippine National Bank (PNB) Account ending in <?php echo $bankNumEnding?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12 mt-3">
|
||||
<h5><strong>Payout History</strong></h5>
|
||||
<div class="table-responsive">
|
||||
<table id="example" class="table ec-table">
|
||||
<h5 class='m-0'><strong>Payout History</strong></h5>
|
||||
<div class="table-responsive px-4">
|
||||
<table id='payoutsTableContent' class="table ec-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Amount</th>
|
||||
|
@ -237,54 +297,46 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tbody class='table-group-divider'>
|
||||
<?php
|
||||
foreach ($vendorPayoutData as $x => $val) {
|
||||
$vendorIdCheck = $val['vendor_details'][0]['vendor_id'];
|
||||
if ((empty($vendorIdCheck) == false) && ($vendorIdCheck == $vendorId) && ($val['status'] == "DEPOSITED")) {
|
||||
echo "<tr>";
|
||||
echo "<td>" . "₱ " . $val['net_amount'] . "</td>";
|
||||
if (empty($val['bank_information'][0]['bank_name']) == false) {
|
||||
echo "<td>" . $val['bank_information'][0]['bank_name'] . "</td>";
|
||||
// echo "<td>" . $val['bank_information'][0]['account_number'] . "</td>";
|
||||
} else {
|
||||
echo '<td>N/A</td>';
|
||||
}
|
||||
if (empty($val['bank_information'][0]['bank_account_number']) == false) {
|
||||
$accNum = $val['bank_information'][0]['bank_account_number'];
|
||||
// Replace characters with asterisks for all characters except the last three segments
|
||||
$maskedAccNum = substr_replace($accNum, str_repeat('*', strlen($accNum) - 3), 0, -3);
|
||||
echo "<td>" . $maskedAccNum . "</td>";
|
||||
// echo "<td>" . $val['bank_information'][0]['bank_account_number'] . "</td>";
|
||||
} else {
|
||||
echo '<td>N/A</td>';
|
||||
};
|
||||
echo "<td>December 08, 2024</td>";
|
||||
echo "<td>" . $val['status'] . "</td>";
|
||||
echo "<td>" .
|
||||
"<button type='button' class='btn btn-primary btn-sm' data-bs-toggle='modal' data-bs-target='#payoutModal'>
|
||||
Details
|
||||
</button>" .
|
||||
"</td>";
|
||||
echo "</tr>";
|
||||
$status = ucfirst(strtolower($val['status']));
|
||||
$payoutDate = date("F d, Y", strtotime($val['createdAt']));
|
||||
$payoutId = $val['_id'];
|
||||
if ((empty($vendorIdCheck) == false) && ($vendorIdCheck == $vendorId) && ($status == "Deposited")) { ?>
|
||||
<tr>
|
||||
<td> <?php echo "₱ " . $val['net_amount'] ?> </td>
|
||||
<?php if (empty($val['bank_information'][0]['bank_name']) == false) {
|
||||
?>
|
||||
<td> <?php echo $val['bank_information'][0]['bank_name'] ?> </td>
|
||||
<?php } else { ?>
|
||||
<td> N/A </td>
|
||||
<?php }
|
||||
if (empty($val['bank_information'][0]['bank_account_number']) == false) {
|
||||
$accNum = $val['bank_information'][0]['bank_account_number'];
|
||||
// Replace characters with asterisks for all characters except the last three segments
|
||||
$maskedAccNum = substr_replace($accNum, str_repeat('*', strlen($accNum) - 3), 0, -3); ?>
|
||||
<td> <?php echo $maskedAccNum ?> </td>
|
||||
<?php } else { ?>
|
||||
<td> N/A </td>
|
||||
<?php } ?>
|
||||
<td> <?php echo $payoutDate ?> </td>
|
||||
<td> <?php echo $status ?> </td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-primary showSinglePayoutBtn" data-order-id="<?php echo $payoutId; ?>" data-bs-toggle="modal" data-bs-target="#payoutsModal">View</button>
|
||||
<!-- <button type="button" class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#payoutModal">
|
||||
Details
|
||||
</button> -->
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!-- <tr>
|
||||
<td> ₱ 1,165.65 </td>
|
||||
<td> EastWest Bank </td>
|
||||
<td> ****6618 </td>
|
||||
<td> December 08, 2023 </td>
|
||||
<td> Deposited </td>
|
||||
<td>
|
||||
<button type="button" class="btn btn-primary btn-sm" data-bs-toggle="modal" data-bs-target="#payoutModal">
|
||||
Details
|
||||
</button>
|
||||
</td>
|
||||
</tr> -->
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id='pagination'></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -293,105 +345,27 @@ if ($_SESSION["userId"] <> "") {
|
|||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="modal fade" id="payoutModal" tabindex="-1" aria-labelledby="payoutModalLabel" aria-hidden="true">
|
||||
|
||||
<!-- Modal Box for the breakdown of payouts from the payouts data table - JOHN LOUIE C. SUEPERALIS MARCH 22, 2024 -->
|
||||
<div class="modal fade" id="payoutsModal" tabindex="-1" aria-labelledby="payoutsModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog modal-xl" style="min-width: 90%;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title fs-5" id="payoutModalLabel">Payout ID: po123034923482934</h5>
|
||||
<h5 class="modal-title fs-5" id="payoutsModalLabel">Payment ID: <span id="payoutIdSpan"></span></h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="container-fluid">
|
||||
<div class="row">
|
||||
<div class="col-md-7 mb-4">
|
||||
<div class="d-flex flex-column">
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<div>
|
||||
<h6><strong>Payout Information</strong></h6>
|
||||
</div>
|
||||
<!-- <php
|
||||
if ($_SESSION['status'] == "DEPOSITED")
|
||||
$className = "fw-bold border border-success border-2 rounded-pill btn-outline-success btn-sm";
|
||||
else if ($_SESSION['statis'] == "PENDING")
|
||||
$className = "fw-bold border border-warning border-2 rounded-pill btn-outline-warning btn-sm";
|
||||
?> -->
|
||||
<button class="fw-bold border border-success border-2 btn-outline-success btn-sm" disabled>DEPOSITED</button>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<div class="fw-bold">Gross Amount</div>
|
||||
<div>₱ 1,150.00</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between p-2" style="border-bottom: 1px solid #000;">
|
||||
<div class="fw-bold"> Fees, Deductions, Adjustments
|
||||
<!-- <span data-bs-toggle="tooltip" data-bs-placement="top" data-bs-custom-class="custom-tooltip" data-bs-title="Insert fee information here">
|
||||
<i class="fi fi-rr-info"></i>
|
||||
</span> -->
|
||||
</div>
|
||||
<div>- ₱ 35.00</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<div class="fw-bold"> Net Amount</div>
|
||||
<div>- ₱ 1125.00</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5 mb-4">
|
||||
<div class="d-flex flex-column" style="border-bottom: 1px solid #000;">
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<h6><strong>Bank Information</strong></h6>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<div class="fw-bold">Bank</div>
|
||||
<div>EastWest Bank</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<div class="fw-bold">Account Name</div>
|
||||
<div>Juan De La Cruz</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<div class="fw-bold">Account Number</div>
|
||||
<div>Ending in 6618</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="mt-5">
|
||||
<h6><strong>Transaction Logs</strong></h6>
|
||||
<div class="table-responsive">
|
||||
<table id="example" class="table ec-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<th>Transaction Date</th>
|
||||
<th>Gross Amount</th>
|
||||
<th>Fee</th>
|
||||
<th>Net Amount</th>
|
||||
<th>Description</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<td> Payment </td>
|
||||
<td> December 1, 2020, 10:00 PM </td>
|
||||
<td> ₱ 150.OO </td>
|
||||
<td> - ₱ 5.00 </td>
|
||||
<td> ₱ 145.00 </td>
|
||||
<td> FOURFORTY - 175 </td>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="container-fluid" id="payoutDetailsContainer">
|
||||
<!-- Dynamic content will be inserted here -->
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">Confirm</button>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- End Vendor setting section -->
|
||||
|
||||
<!-- Footer Start -->
|
||||
|
@ -625,15 +599,158 @@ if ($_SESSION["userId"] <> "") {
|
|||
<script src="assets/js/vendor/jquery.magnific-popup.min.js"></script>
|
||||
<script src="assets/js/plugins/jquery.sticky-sidebar.js"></script>
|
||||
<script src="assets/js/plugins/nouislider.js"></script>
|
||||
<script>
|
||||
<script src="https://cdn.datatables.net/v/bs5/dt-2.0.3/r-3.0.0/sp-2.3.0/datatables.min.js"></script>
|
||||
|
||||
<!-- <script>
|
||||
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
|
||||
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))
|
||||
</script>
|
||||
</script> -->
|
||||
|
||||
<!-- Main Js -->
|
||||
<script src="assets/js/vendor/index.js"></script>
|
||||
<script src="assets/js/main.js"></script>
|
||||
|
||||
<!-- JS CRIPT FOR DYNAMIC MODAL BOX USING AJAX - JOHN LOUIE C. SUPERALIS MARCH 22, 2024 -->
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$('.showSinglePayoutBtn').click(function() {
|
||||
var payoutId = $(this).data('order-id');
|
||||
var token = "<?php echo $authToken; ?>";
|
||||
$('#payoutIdSpan').text(payoutId);
|
||||
$.ajax({
|
||||
// url: 'https://api.obanana.shop/api/v1/payouts/' + payoutId,
|
||||
url: 'https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/payouts/' + payoutId,
|
||||
type: 'GET',
|
||||
headers: {
|
||||
'Authorization': 'Bearer ' + token
|
||||
},
|
||||
success: function(response) {
|
||||
// Handle successful response
|
||||
console.log(response);
|
||||
var grossAmount = response.gross_amount;
|
||||
var totalFees = response.fees_deduction_adjustment;
|
||||
var netAmount = response.net_amount;
|
||||
var payoutStatus = response.status;
|
||||
payoutStatus = payoutStatus.charAt(0).toUpperCase() + payoutStatus.slice(1).toLowerCase();
|
||||
var bankName = response.bank_information[0].bank_name;
|
||||
var bankNum = response.bank_information[0].bank_account_number;
|
||||
var bankNumEnding = bankNum.slice(-3); // Extract last three characters of bankNum
|
||||
var maskedBankNum = "Ending in " + bankNumEnding; // Create message
|
||||
var bankAccName = response.bank_information[0].bank_account_name;
|
||||
// var paymentType = response.transaction_logs[0].Type;
|
||||
// // var transDate = response.transaction_logs[0].Transaction + " " + date;
|
||||
// // var transGrossAmt = response.transaction_logs[0].Gross + " " + amount;
|
||||
// var transFee = response.transaction_logs[0].Fee;
|
||||
// // var transNetAmt = response.transaction_logs[0].Net + " " + amount;
|
||||
// var transDesc = response.transaction_logs[0].Description;
|
||||
var transactionLogsHtml = ''; // Initialize empty string to store HTML for transaction logs
|
||||
// Inside the success callback function
|
||||
var transactionLogsHtml = ''; // Initialize empty string to store HTML for transaction logs
|
||||
response.transaction_logs.forEach(function(log) {
|
||||
var paymentType = log.Type; // Assuming Transaction field holds the date
|
||||
var grossAmount = log.Gross; // Assuming Gross field holds the gross amount
|
||||
var transFee = log.Fee;
|
||||
var netAmount = log.Net;
|
||||
var transDesc = log.Description;
|
||||
|
||||
// Append HTML for current transaction log to the transactionLogsHtml string
|
||||
transactionLogsHtml += `
|
||||
<tr>
|
||||
<td>${paymentType}</td>
|
||||
<td>Wala Muna</td>
|
||||
<td>₱ Wala muna</td>
|
||||
<td>- ₱ ${transFee}</td>
|
||||
<td>₱ Wala Muna</td>
|
||||
<td>${transDesc}</td>
|
||||
</tr>`;
|
||||
});
|
||||
|
||||
|
||||
// Populate data dynamically using the response
|
||||
var payoutDetailsHtml = `
|
||||
<div class="row">
|
||||
<div class="col-md-7 mb-4">
|
||||
<div class="d-flex flex-column">
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<div>
|
||||
<h6><strong>Payout Information</strong></h6>
|
||||
</div>
|
||||
|
||||
<button class="fw-bold border border-success border-2 btn-outline-success btn-sm" disabled>${payoutStatus}</button>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<div class="fw-bold">Gross Amount</div>
|
||||
<div>₱ ${grossAmount}</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between p-2" style="border-bottom: 1px solid #000;">
|
||||
<div class="fw-bold"> Fees, Deductions, Adjustments
|
||||
|
||||
</div>
|
||||
<div> - ${totalFees}</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<div class="fw-bold"> Net Amount</div>
|
||||
<div>₱ ${netAmount}</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-5 mb-4">
|
||||
<div class="d-flex flex-column" style="border-bottom: 1px solid #000;">
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<h6><strong>Bank Information</strong></h6>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<div class="fw-bold">Bank</div>
|
||||
<div>${bankName}</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<div class="fw-bold">Account Name</div>
|
||||
<div>${bankAccName}</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-between p-2">
|
||||
<div class="fw-bold">Account Number</div>
|
||||
<div>${maskedBankNum}</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<div class="mt-5">
|
||||
<h6><strong>Transaction Logs</strong></h6>
|
||||
<div class="table-responsive">
|
||||
<table id="example" class="table ec-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<th>Transaction Date</th>
|
||||
<th>Gross Amount</th>
|
||||
<th>Fee</th>
|
||||
<th>Net Amount</th>
|
||||
<th>Description</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
${transactionLogsHtml} <!-- Insert transaction logs HTML here -->
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>`;
|
||||
$('#payoutDetailsContainer').html(payoutDetailsHtml);
|
||||
|
||||
},
|
||||
})
|
||||
|
||||
});
|
||||
});
|
||||
</script>
|
||||
<script>
|
||||
$(document).ready( function () {
|
||||
$('#payoutsTableContent').DataTable();
|
||||
} );
|
||||
</script>
|
||||
|
||||
</body>
|
||||
|
||||
|
|
|
@ -57,6 +57,9 @@ if (is_array($vendorOrderss)) {
|
|||
<link rel="stylesheet" href="assets/css/plugins/slick.min.css" />
|
||||
<link rel="stylesheet" href="assets/css/plugins/bootstrap.css" />
|
||||
|
||||
<!-- FLATICON -->
|
||||
<link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.1/css/all.min.css" rel="stylesheet">
|
||||
|
||||
<!-- Main Style -->
|
||||
<link rel="stylesheet" href="assets/css/style.css" />
|
||||
<link rel="stylesheet" href="assets/css/style2.css" />
|
||||
|
@ -66,13 +69,92 @@ if (is_array($vendorOrderss)) {
|
|||
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
|
||||
<style>
|
||||
.tab.active {
|
||||
background-color: #ffaa00;
|
||||
background-color: #ffffff;
|
||||
/* Set your desired background color for the active tab */
|
||||
color: #ffffff;
|
||||
color: #ffaa00;
|
||||
/* Set your desired text color for the active tab */
|
||||
border: 1px solid #ffaa00
|
||||
/* Set your desired border color for the active tab */
|
||||
}
|
||||
.tab {
|
||||
background-color: #ffaa00;
|
||||
color: #ffffff;
|
||||
font-family: "Poppins, sans-serif";
|
||||
font-weight: 400;
|
||||
/* margin: 2px; */
|
||||
text-align: center;
|
||||
/* margin-right: -25px; */
|
||||
}
|
||||
.tab i {
|
||||
font-size: 15px;
|
||||
/* padding-left: 3px; */
|
||||
}
|
||||
.tableView:hover {
|
||||
/* background-color: #f5f5f5; */
|
||||
background-color: #e5e5e5;
|
||||
}
|
||||
.tab-content {
|
||||
border: none;
|
||||
margin-top: -30px;
|
||||
}
|
||||
/* .theadTitle {
|
||||
background-color: #dddddd;
|
||||
padding-top: -90px;
|
||||
} */
|
||||
|
||||
@media only screen and (max-width: 640px) {
|
||||
#tableTitle {
|
||||
font-size: 14px;
|
||||
}
|
||||
#shopNow {
|
||||
font-size: 12px;
|
||||
}
|
||||
}
|
||||
@media only screen and (max-width: 460px) {
|
||||
#tableTitle {
|
||||
font-size: 12px;
|
||||
}
|
||||
#shopNow {
|
||||
font-size: 10px;
|
||||
}
|
||||
}
|
||||
|
||||
/* for status buttons */
|
||||
@media only screen and (max-width: 10000px) {
|
||||
.tab {
|
||||
font-size: 13px;
|
||||
width: 9rem;
|
||||
}
|
||||
}
|
||||
@media only screen and (max-width: 1200px) {
|
||||
.tab {
|
||||
font-size: 10px;
|
||||
width: 7rem;
|
||||
}
|
||||
.tab i {
|
||||
font-size: 9px;
|
||||
}
|
||||
}
|
||||
@media only screen and (max-width: 700px) {
|
||||
.tab {
|
||||
font-size: 9px;
|
||||
width: 6rem;
|
||||
}
|
||||
.tab i {
|
||||
font-size: 9px;
|
||||
}
|
||||
}
|
||||
@media only screen and (max-width: 620px) {
|
||||
.tab {
|
||||
font-size: 0px;
|
||||
width:5rem;
|
||||
}
|
||||
.tab i {
|
||||
font-size: 13px;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
<script>
|
||||
function updateCartItemCount() {
|
||||
$.get("cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data, status) {
|
||||
|
@ -175,24 +257,46 @@ if (is_array($vendorOrderss)) {
|
|||
<div class="ec-shop-rightside col-lg-9 col-md-12">
|
||||
<div class="ec-vendor-dashboard-card">
|
||||
<div class="ec-vendor-card-header">
|
||||
<h5>Refund History</h5>
|
||||
<h5 id="tableTitle">All Refund History</h5>
|
||||
<div class="ec-header-btn">
|
||||
<a class="btn btn-lg btn-primary" href="shop-list-left-sidebar2.php">Shop Now</a>
|
||||
<a class="btn btn-lg btn-primary" id="shopNow" style="background:none; color:#3474d4;" href="index.php">Shop Now</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="card" style="border: none;">
|
||||
<div class="card-body" style="margin-bottom:-20px;">
|
||||
<div class="tab-container d-flex justify-content-around">
|
||||
<!-- 03-25-2024 Stacy modified cards -->
|
||||
<div class="tab" data-tab-name="allRefunds" onclick="showTab('allRefunds'), document.getElementById('tableTitle').innerHTML = 'All Refund History'">All Refunds
|
||||
<i class="fa-solid fa-money-bills"></i></div>
|
||||
<div class="tab" data-tab-name="toApprove" onclick="showTab('toApprove'), document.getElementById('tableTitle').innerHTML = 'All To Approve Refunds'">To Approve
|
||||
<i class="fa-solid fa-rectangle-list"></i></div>
|
||||
<div class="tab" data-tab-name="toShip" onclick="showTab('toShip'), document.getElementById('tableTitle').innerHTML = 'All To Ship Refunds'">To Ship
|
||||
<i class="fa-solid fa-truck"></i></div>
|
||||
<div class="tab" data-tab-name="toReceive" onclick="showTab('toReceive'), document.getElementById('tableTitle').innerHTML = 'All To Receive Refunds'">To Receive
|
||||
<i class="fa-solid fa-box-archive"></i></div>
|
||||
<div class="tab" data-tab-name="toRefund" onclick="showTab('toRefund'), document.getElementById('tableTitle').innerHTML = 'All To Refund Products'">To Refund
|
||||
<i class="fa-solid fa-money-bill-1-wave"></i></div>
|
||||
<div class="tab" data-tab-name="returnComplete" onclick="showTab('returnComplete'), document.getElementById('tableTitle').innerHTML = 'All Completed Refund'">Complete
|
||||
<i class="fa-solid fa-square-check"></i></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="ec-vendor-card-body">
|
||||
<div class="ec-vendor-card-table">
|
||||
<div class="tab-container">
|
||||
|
||||
<!-- <div class="tab-container">
|
||||
<div class="tab" data-tab-name="toApprove" onclick="showTab('toApprove')">To Approve</div>
|
||||
<div class="tab" data-tab-name="toShip" onclick="showTab('toShip')">To Ship</div>
|
||||
<div class="tab" data-tab-name="toReceive" onclick="showTab('toReceive')">To Receive</div>
|
||||
<div class="tab" data-tab-name="toRefund" onclick="showTab('toRefund')">To Refund</div>
|
||||
<div class="tab" data-tab-name="returnComplete" onclick="showTab('returnComplete')">Return Complete</div>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
<div id="toApprove" class="tab-content active">
|
||||
|
||||
<!-- Content for "To Pay" tab -->
|
||||
<!-- 03-26-2024 Stacy added tab for all orders -->
|
||||
<div id="allRefunds" class="tab-content">
|
||||
<!-- Content for "All Refunds" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -202,8 +306,63 @@ if (is_array($vendorOrderss)) {
|
|||
<th scope="col">Unit Price</th>
|
||||
<th scope="col">Price</th>
|
||||
<th scope="col">Refund Status</th>
|
||||
<th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th>
|
||||
<!-- <th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th> -->
|
||||
<th scope="col">Date</th>
|
||||
|
||||
<!-- <th scope="col">Actions</th> -->
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$order = $vendorOrders;
|
||||
$orderArray = json_encode($order, true);
|
||||
$orderItems = json_decode($orderArray, true);
|
||||
foreach ($orderItems as $order) {
|
||||
// Ensure that the required data is available before accessing it
|
||||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO APPROVE') || (strtoupper($order['return_order']['status']) === 'TO SHIP')
|
||||
|| (strtoupper($order['return_order']['status']) === 'TO RECEIVE') || (strtoupper($order['return_order']['status']) === 'TO REFUND')
|
||||
|| (strtoupper($order['return_order']['status']) === 'RETURN COMPLETE') && isset($order['items'][0]['product'])) {
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
<td><span><?php echo date("F j, Y", strtotime($order['updatedAt'])); ?></span></td>
|
||||
|
||||
<!-- <td><span class="tbl-btn"><a class="btn btn-lg btn-primary" href="#">View</a></span></td> -->
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="toApprove" class="tab-content active">
|
||||
<!-- Content for "To Approve" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
<th scope="col">Quantity</th>
|
||||
<th scope="col">Unit Price</th>
|
||||
<th scope="col">Price</th>
|
||||
<th scope="col">Refund Status</th>
|
||||
<!-- <th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th> -->
|
||||
<th scope="col">Date</th>
|
||||
<th scope="col">Action</th>
|
||||
<!-- <th scope="col">Actions</th> -->
|
||||
|
@ -219,15 +378,18 @@ if (is_array($vendorOrderss)) {
|
|||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO APPROVE') && isset($order['items'][0]['product'])) {
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php echo $order['return_order']['image']; ?>" alt="product"></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
<td><span><?php echo date("F j, Y", strtotime($order['updatedAt'])); ?></span></td>
|
||||
<td>
|
||||
<span class="tbl-btn">
|
||||
|
@ -244,8 +406,8 @@ if (is_array($vendorOrderss)) {
|
|||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div id="toShip" class="tab-content">
|
||||
|
||||
<div id="toShip" class="tab-content">
|
||||
<!-- Content for "To Ship" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
|
@ -256,8 +418,8 @@ if (is_array($vendorOrderss)) {
|
|||
<th scope="col">Unit Price</th>
|
||||
<th scope="col">Price</th>
|
||||
<th scope="col">Refund Status</th>
|
||||
<th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th>
|
||||
<!-- <th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th> -->
|
||||
<th scope="col">Date</th>
|
||||
|
||||
<!-- <th scope="col">Actions</th> -->
|
||||
|
@ -273,15 +435,18 @@ if (is_array($vendorOrderss)) {
|
|||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO SHIP') && isset($order['items'][0]['product'])) {
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php echo $order['return_order']['image']; ?>" alt="product"></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
<td><span><?php echo date("F j, Y", strtotime($order['updatedAt'])); ?></span></td>
|
||||
|
||||
<!-- <td><span class="tbl-btn"><a class="btn btn-lg btn-primary" href="#">View</a></span></td> -->
|
||||
|
@ -296,6 +461,7 @@ if (is_array($vendorOrderss)) {
|
|||
</div>
|
||||
|
||||
<div id="toReceive" class="tab-content">
|
||||
<!-- Content for "To Receive" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -305,8 +471,8 @@ if (is_array($vendorOrderss)) {
|
|||
<th scope="col">Unit Price</th>
|
||||
<th scope="col">Price</th>
|
||||
<th scope="col">Refund Status</th>
|
||||
<th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th>
|
||||
<!-- <th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th> -->
|
||||
<th scope="col">Date</th>
|
||||
<th scope="col">Actions</th>
|
||||
</tr>
|
||||
|
@ -321,15 +487,18 @@ if (is_array($vendorOrderss)) {
|
|||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO RECEIVE') && isset($order['items'][0]['product'])) {
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php echo $order['return_order']['image']; ?>" alt="product"></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
<td><span><?php echo date("F j, Y", strtotime($order['updatedAt'])); ?></span></td>
|
||||
<td>
|
||||
<span class="tbl-btn">
|
||||
|
@ -346,6 +515,7 @@ if (is_array($vendorOrderss)) {
|
|||
</div>
|
||||
|
||||
<div id="toRefund" class="tab-content">
|
||||
<!-- Content for "To Refund" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -355,8 +525,8 @@ if (is_array($vendorOrderss)) {
|
|||
<th scope="col">Unit Price</th>
|
||||
<th scope="col">Price</th>
|
||||
<th scope="col">Refund Status</th>
|
||||
<th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th>
|
||||
<!-- <th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th> -->
|
||||
<th scope="col">Date</th>
|
||||
<!-- <th scope="col">Actions</th> -->
|
||||
</tr>
|
||||
|
@ -371,19 +541,22 @@ if (is_array($vendorOrderss)) {
|
|||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO REFUND') && isset($order['items'][0]['product'])) {
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php echo $order['return_order']['image']; ?>" alt="product"></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
<td><span><?php echo date("F j, Y", strtotime($order['updatedAt'])); ?></span></td>
|
||||
<!-- <td>
|
||||
<span class="tbl-btn">
|
||||
<a class="btn btn-lg btn-primary" onclick="updateCompletedStatus('<?php echo $order['_id']; ?>')">Received</a>
|
||||
<a class="btn btn-lg btn-primary" onclick="updateCompletedStatus('<?php # echo $order['_id']; ?>')">Received</a>
|
||||
</span>
|
||||
</td> -->
|
||||
</tr>
|
||||
|
@ -397,6 +570,7 @@ if (is_array($vendorOrderss)) {
|
|||
</div>
|
||||
|
||||
<div id="returnComplete" class="tab-content">
|
||||
<!-- Content for "Return Complete" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
@ -406,8 +580,8 @@ if (is_array($vendorOrderss)) {
|
|||
<th scope="col">Unit Price</th>
|
||||
<th scope="col">Price</th>
|
||||
<th scope="col">Refund Status</th>
|
||||
<th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th>
|
||||
<!-- <th scope="col">Refund Reason</th>
|
||||
<th scope="col">Refund Proof</th> -->
|
||||
<th scope="col">Date</th>
|
||||
<!-- <th scope="col">Actions</th> -->
|
||||
</tr>
|
||||
|
@ -422,15 +596,18 @@ if (is_array($vendorOrderss)) {
|
|||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'RETURN COMPLETE') && isset($order['items'][0]['product'])) {
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<tr>
|
||||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td><img class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
<td><span><?php echo $order['total_amount'] ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['status']; ?></span></td>
|
||||
<td><span><?php echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php echo $order['return_order']['image']; ?>" alt="product"></td>
|
||||
<!-- <td><span><?php # echo $order['return_order']['reason']; ?></span></td>
|
||||
<td><img class="prod-img" src="<?php # echo $order['return_order']['image']; ?>" alt="product"></td> -->
|
||||
<td><span><?php echo date("F j, Y", strtotime($order['updatedAt'])); ?></span></td>
|
||||
<!-- <td>
|
||||
<span class="tbl-btn">
|
||||
|
@ -760,9 +937,172 @@ if (is_array($vendorOrderss)) {
|
|||
|
||||
<!-- Footer Start -->
|
||||
<?php include "footer.php" ?>
|
||||
|
||||
<!-- Footer Area End -->
|
||||
|
||||
|
||||
<!-- Modal Start -->
|
||||
<!-- 03-26-2024 Stacy added modal -->
|
||||
<div class="modal fade" id="productDetails" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-dialog-centered" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-body">
|
||||
<!-- modal header placed under script -->
|
||||
<div class="row" id="modalContent" style="display:flex; justify-content:center;">
|
||||
<!-- modal body placed under script -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Modal End -->
|
||||
|
||||
<script>
|
||||
// 03-26-2024 Stacy added script for showing productDetails modal
|
||||
document.getElementById('productDetails').addEventListener('shown.bs.modal', function (event) {
|
||||
|
||||
var jsonString = $(event.relatedTarget).data('value');
|
||||
|
||||
var jsonObject = JSON.parse(jsonString);
|
||||
const modal = document.getElementById('modalContent');
|
||||
|
||||
const date = new Date(jsonObject.updatedAt); const formatter = new Intl. DateTimeFormat('en-US', { day: '2-digit', month: 'long', year: 'numeric' }); const formattedDate = formatter. format(date);
|
||||
|
||||
if (jsonObject.return_order.status === 'To Approve') {
|
||||
modal.innerHTML = `
|
||||
<div class="modal-header" style="height:5px;">
|
||||
<h5 class="modal-title fs-5 font-weight-bold">${jsonObject.items[0].product.name}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="row pt-3" style="display:flex; justify-content:center; margin-left:20px;">
|
||||
<div class="col-md-6">
|
||||
<img class="image-thumb-preview pt-3 pb-3" style="width:100%; height:100%; padding-left:20px;" src="${jsonObject.items[0].product.product_image}" alt="product" />
|
||||
</div>
|
||||
<div class="col-md-6" style="margin:auto;">
|
||||
<ul>
|
||||
<li class="fs-6"><b>Quantity:</b> ${jsonObject.items[0].quantity}</li>
|
||||
<li class="fs-6"><b>Unit Price:</b> ${jsonObject.items[0].price}</li>
|
||||
<li class="fs-6"><b>Price:</b> ${jsonObject.total_amount}</li>
|
||||
<li class="fs-6"><b>Refund Status:</b> ${jsonObject.return_order.status}</li>
|
||||
<li class="fs-6"><b>Refund Reason:</b> ${jsonObject.return_order.reason}</li>
|
||||
<li class="fs-6"><b>Refund Proof:</b></li>
|
||||
<li class="fs-6 pl-3"><img class="prod-img" style="width:50%; height:50%;" src="${jsonObject.return_order.image}" alt="product"></li>
|
||||
<li class="fs-6"><b>Date:</b> ${formattedDate}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
if (jsonObject.return_order.status === 'To Ship') {
|
||||
modal.innerHTML = `
|
||||
<div class="modal-header" style="height:5px;">
|
||||
<h5 class="modal-title fs-5 font-weight-bold">${jsonObject.items[0].product.name}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="row pt-3" style="display:flex; justify-content:center; margin-left:20px;">
|
||||
<div class="col-md-6">
|
||||
<img class="image-thumb-preview pt-3 pb-3" style="width:100%; height:100%; padding-left:20px;" src="${jsonObject.items[0].product.product_image}" alt="product" />
|
||||
</div>
|
||||
<div class="col-md-6" style="margin:auto;">
|
||||
<ul>
|
||||
<li class="fs-6"><b>Quantity:</b> ${jsonObject.items[0].quantity}</li>
|
||||
<li class="fs-6"><b>Unit Price:</b> ${jsonObject.items[0].price}</li>
|
||||
<li class="fs-6"><b>Price:</b> ${jsonObject.total_amount}</li>
|
||||
<li class="fs-6"><b>Refund Status:</b> ${jsonObject.return_order.status}</li>
|
||||
<li class="fs-6"><b>Refund Reason:</b> ${jsonObject.return_order.reason}</li>
|
||||
<li class="fs-6"><b>Refund Proof:</b></li>
|
||||
<li class="fs-6 pl-3"><img class="prod-img" style="width:50%; height:50%;" src="${jsonObject.return_order.image}" alt="product"></li>
|
||||
<li class="fs-6"><b>Date:</b> ${formattedDate}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
if (jsonObject.return_order.status === 'To Receive') {
|
||||
modal.innerHTML = `
|
||||
<div class="modal-header" style="height:5px;">
|
||||
<h5 class="modal-title fs-5 font-weight-bold">${jsonObject.items[0].product.name}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="row pt-3" style="display:flex; justify-content:center; margin-left:20px;">
|
||||
<div class="col-md-6">
|
||||
<img class="image-thumb-preview pt-3 pb-3" style="width:100%; height:100%; padding-left:20px;" src="${jsonObject.items[0].product.product_image}" alt="product" />
|
||||
</div>
|
||||
<div class="col-md-6" style="margin:auto;">
|
||||
<ul>
|
||||
<li class="fs-6"><b>Quantity:</b> ${jsonObject.items[0].quantity}</li>
|
||||
<li class="fs-6"><b>Unit Price:</b> ${jsonObject.items[0].price}</li>
|
||||
<li class="fs-6"><b>Price:</b> ${jsonObject.total_amount}</li>
|
||||
<li class="fs-6"><b>Refund Status:</b> ${jsonObject.return_order.status}</li>
|
||||
<li class="fs-6"><b>Refund Reason:</b> ${jsonObject.return_order.reason}</li>
|
||||
<li class="fs-6"><b>Refund Proof:</b></li>
|
||||
<li class="fs-6 pl-3"><img class="prod-img" style="width:50%; height:50%;" src="${jsonObject.return_order.image}" alt="product"></li>
|
||||
<li class="fs-6"><b>Date:</b> ${formattedDate}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
if (jsonObject.return_order.status === 'To Refund') {
|
||||
modal.innerHTML = `
|
||||
<div class="modal-header" style="height:5px;">
|
||||
<h5 class="modal-title fs-5 font-weight-bold">${jsonObject.items[0].product.name}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="row pt-3" style="display:flex; justify-content:center; margin-left:20px;">
|
||||
<div class="col-md-6">
|
||||
<img class="image-thumb-preview pt-3 pb-3" style="width:100%; height:100%; padding-left:20px;" src="${jsonObject.items[0].product.product_image}" alt="product" />
|
||||
</div>
|
||||
<div class="col-md-6" style="margin:auto;">
|
||||
<ul>
|
||||
<li class="fs-6"><b>Quantity:</b> ${jsonObject.items[0].quantity}</li>
|
||||
<li class="fs-6"><b>Unit Price:</b> ${jsonObject.items[0].price}</li>
|
||||
<li class="fs-6"><b>Price:</b> ${jsonObject.total_amount}</li>
|
||||
<li class="fs-6"><b>Refund Status:</b> ${jsonObject.return_order.status}</li>
|
||||
<li class="fs-6"><b>Refund Reason:</b> ${jsonObject.return_order.reason}</li>
|
||||
<li class="fs-6"><b>Refund Proof:</b></li>
|
||||
<li class="fs-6 pl-3"><img class="prod-img" style="width:50%; height:50%;" src="${jsonObject.return_order.image}" alt="product"></li>
|
||||
<li class="fs-6"><b>Date:</b> ${formattedDate}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
if (jsonObject.return_order.status === 'Return Complete') {
|
||||
modal.innerHTML = `
|
||||
<div class="modal-header" style="height:5px;">
|
||||
<h5 class="modal-title fs-5 font-weight-bold">${jsonObject.items[0].product.name}</h5>
|
||||
<button type="button" class="btn-close" data-bs-dismiss="modal" aria-label="Close"></button>
|
||||
</div>
|
||||
<div class="row pt-3" style="display:flex; justify-content:center; margin-left:20px;">
|
||||
<div class="col-md-6">
|
||||
<img class="image-thumb-preview pt-3 pb-3" style="width:100%; height:100%; padding-left:20px;" src="${jsonObject.items[0].product.product_image}" alt="product" />
|
||||
</div>
|
||||
<div class="col-md-6" style="margin:auto;">
|
||||
<ul>
|
||||
<li class="fs-6"><b>Quantity:</b> ${jsonObject.items[0].quantity}</li>
|
||||
<li class="fs-6"><b>Unit Price:</b> ${jsonObject.items[0].price}</li>
|
||||
<li class="fs-6"><b>Price:</b> ${jsonObject.total_amount}</li>
|
||||
<li class="fs-6"><b>Refund Status:</b> ${jsonObject.return_order.status}</li>
|
||||
<li class="fs-6"><b>Refund Reason:</b> ${jsonObject.return_order.reason}</li>
|
||||
<li class="fs-6"><b>Refund Proof:</b></li>
|
||||
<li class="fs-6 pl-3"><img class="prod-img" style="width:50%; height:50%;" src="${jsonObject.return_order.image}" alt="product"></li>
|
||||
<li class="fs-6"><b>Date:</b> ${formattedDate}</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>`;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
console.log(jsonObject);
|
||||
});
|
||||
|
||||
const modal = document.getElementById('productDetails');
|
||||
console.log(modal);
|
||||
</script>
|
||||
|
||||
|
||||
<!-- Footer navigation panel for responsive display -->
|
||||
<div class="ec-nav-toolbar">
|
||||
<div class="container">
|
||||
|
|
|
@ -196,7 +196,7 @@ $array = json_decode($result, true);
|
|||
<div class="thumb-upload">
|
||||
<div class="thumb-edit">
|
||||
<input type='file' id="thumbUpload<?php echo $index + 1; ?>" class="ec-image-upload" accept=".png, .jpg, .jpeg" />
|
||||
<label for="thumbUpload<?php echo $index + 1; ?>"><i class="fi-rr-edit"></i></label>
|
||||
<!-- <label for="thumbUpload<?php echo $index + 1; ?>"><i class="fi-rr-edit"></i></label> -->
|
||||
</div>
|
||||
<div class="thumb-preview ec-preview">
|
||||
<div class="image-thumb-preview">
|
||||
|
@ -396,15 +396,24 @@ $array = json_decode($result, true);
|
|||
</tr>
|
||||
</thead>
|
||||
<tbody id="price-matrix-body">
|
||||
<?php foreach ($array['price_matrix'][0] as $index => $pair) : ?>
|
||||
<tr data-row-index="<?php echo $index; ?>">
|
||||
<td><input type="number" class="form-control" name="quantity[]" value="<?php echo $pair['quantity']; ?>"></td>
|
||||
<td><input type="number" class="form-control" name="price[]" value="<?php echo $pair['price']; ?>"></td>
|
||||
<?php if (empty($array['price_matrix'][0])) : ?>
|
||||
<tr data-row-index="0">
|
||||
<td><input type="number" class="form-control" name="quantity[]"></td>
|
||||
<td><input type="number" class="form-control" name="price[]"></td>
|
||||
<td><button type="button" class="btn btn-danger delete-row">Delete</button></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php else : ?>
|
||||
<?php foreach ($array['price_matrix'][0] as $index => $pair) : ?>
|
||||
<tr data-row-index="<?php echo $index; ?>">
|
||||
<td><input type="number" class="form-control" name="quantity[]" value="<?php echo $pair['quantity']; ?>"></td>
|
||||
<td><input type="number" class="form-control" name="price[]" value="<?php echo $pair['price']; ?>"></td>
|
||||
<td><button type="button" class="btn btn-danger delete-row">Delete</button></td>
|
||||
</tr>
|
||||
<?php endforeach; ?>
|
||||
<?php endif; ?>
|
||||
</tbody>
|
||||
|
||||
|
||||
</table>
|
||||
<button type="button" class="btn btn-secondary" id="add-row">Add Row</button>
|
||||
</div>
|
||||
|
@ -413,19 +422,19 @@ $array = json_decode($result, true);
|
|||
<div class="col-md-12" style="margin: 0 0 20px 0;">
|
||||
<label class="form-label">Promo</label>
|
||||
<div class="row" justify-content-between>
|
||||
<div class="col-md-4">
|
||||
<div class="col-md-6">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" id="nextDayDeliveryCheckbox" name="promo[next-day-delivery]" value="Yes" <?php if ($array['promo'][0]['next-day-delivery'] === "Yes") echo "checked"; ?> style="background-color: blue;">
|
||||
<label class="form-check-label" for="nextDayDeliveryCheckbox">Next Day Delivery</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<!-- <div class="col-md-4">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" id="sameDayDeliveryCheckbox" name="promo[same-day-delivery]" value="Yes" <?php if ($array['promo'][0]['same-day-delivery'] === "Yes") echo "checked"; ?> style="background-color: blue;">
|
||||
<label class="form-check-label" for="sameDayDeliveryCheckbox">Same Day Delivery</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
</div> -->
|
||||
<div class="col-md-6">
|
||||
<div class="form-check">
|
||||
<input type="checkbox" id="freeShippingCheckbox" name="promo[free-shipping]" value="Yes" <?php if ($array['promo'][0]['free-shipping'] === "Yes") echo "checked"; ?> style="background-color: blue;">
|
||||
<label class="form-check-label" for="freeShippingCheckbox">Free Shipping</label>
|
||||
|
@ -721,7 +730,7 @@ $array = json_decode($result, true);
|
|||
|
||||
Promise.all(promises)
|
||||
.then(filenames => {
|
||||
const updatedImages = existingImages.concat(filenames.map(filename => `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/product_uploads/${filename}`));
|
||||
const updatedImages = existingImages.concat(filenames.map(filename => `https://<?php echo $_SESSION["data_endpoint"]; ?>/images/storage/product_uploads/${encodeURIComponent(filename)}`));
|
||||
|
||||
if (!Array.isArray(updatedImages)) {
|
||||
console.error('Updated images is not an array:', updatedImages);
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
|
@ -325,7 +323,8 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
// Make an AJAX request to update the favorites with the remaining products
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('PATCH', 'https://api.obanana.shop/api/v1/customers/' + customerId, true);
|
||||
// xhr.open('PATCH', 'https://api.obanana.shop/api/v1/customers/' + customerId, true);
|
||||
xhr.open('PATCH', 'https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId, true);
|
||||
xhr.setRequestHeader('Content-Type', 'application/json');
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === XMLHttpRequest.DONE) {
|
||||
|
@ -360,7 +359,8 @@ if ($_SESSION["userId"] <> "") {
|
|||
// Function to delete multiple products
|
||||
function deleteProducts(productIds) {
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open('PATCH', 'https://api.obanana.shop/api/v1/customers/' + customerId, true);
|
||||
// xhr.open('PATCH', 'https://api.obanana.shop/api/v1/customers/' + customerId, true);
|
||||
xhr.open('PATCH', 'https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/customers/' + customerId, true);
|
||||
xhr.setRequestHeader('Content-Type', 'application/json');
|
||||
xhr.onreadystatechange = function() {
|
||||
if (xhr.readyState === XMLHttpRequest.DONE) {
|
||||
|
|
Loading…
Reference in New Issue