Compare commits
36 Commits
19e95fc7e4
...
0e1d96069a
Author | SHA1 | Date |
---|---|---|
raymart | 0e1d96069a | |
raymart | 342edfe2a0 | |
raymart | 2fad9e25fc | |
raymart | c4f30aa999 | |
MarkHipe | 6648db6a5d | |
Stacy | 951859d610 | |
Stacy | 3219755a31 | |
Stacy | 7ab78b909b | |
MarkHipe | c6c1995baf | |
Jun Barroga | d4584e6cf1 | |
Jun Barroga | 07c80ce000 | |
Jun Barroga | 1f3d512192 | |
Jun Barroga | e30c1453e1 | |
Erwin Galang | 8a6cc056dd | |
Erwin Galang | 098858fb38 | |
MarkHipe | caab356be3 | |
jouls | 54fff000ea | |
MarkHipe | b04a48a68c | |
gelonspr | cb6440b1b5 | |
jouls | a16c916761 | |
gelonspr | 52dae43eff | |
gelonspr | 3d1b73ee47 | |
jouls | a810ab6bed | |
MarkHipe | 16bdbef65b | |
jouls | 41fe727f03 | |
jouls | 2ea2e1ffcc | |
gelonspr | 8fa22bb766 | |
Jun Barroga | ed30d71290 | |
Jun Barroga | 7be0e0cfb7 | |
jouls | d1d081aabf | |
jouls | 2ee9074e86 | |
MarkHipe | b8ac4eafc1 | |
jouls | b8ac7f827d | |
jouls | 54a1bf6306 | |
MarkHipe | 8c0454570a | |
jouls | 6d0170decf |
|
@ -0,0 +1,2 @@
|
|||
# ignore config.php
|
||||
config.php
|
|
@ -1,8 +1,9 @@
|
|||
<?php
|
||||
$_SESSION["is_test"]=true;
|
||||
$_SESSION["test_email_rcpt"]="";
|
||||
$_SESSION["test_email_rcpt"]="junjihadbarroga@gmail.com";
|
||||
$_SESSION["sales_email"]="sales@obanana.com";
|
||||
$_SESSION["data_endpoint"]="api.obanana.shop";
|
||||
$_SESSION["transfer_fee"]=0.02;
|
||||
if ($_SESSION["is_test"]){
|
||||
$_SESSION["obpay"]="web.obanana.io/test";
|
||||
$_SESSION["obpay_gate"]="gate.obanana.io/api";
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -117,7 +117,7 @@ if($_SESSION["user_type"]!="admin"){
|
|||
<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>
|
||||
<a href="../logout.php"> <i class="mdi mdi-logout"></i> Log Out </a>
|
||||
</li>
|
||||
</ul>
|
||||
</li>
|
||||
|
|
|
@ -0,0 +1,24 @@
|
|||
<?php
|
||||
include "../functions.php";
|
||||
|
||||
$payout_id = $_GET['payout_id'];
|
||||
$payoutbyId = getPayout($_SESSION["token"], $payout_id);
|
||||
$payoutData = json_decode($payoutbyId, true);
|
||||
$payout_vendor_id = $payoutData['vendor_details'][0]['vendor_id'];
|
||||
echo $payout_vendor_id;
|
||||
if (isset($payoutData['transaction_logs']) && is_array($payoutData['transaction_logs'])) {
|
||||
$orderIds = array();
|
||||
foreach ($payoutData['transaction_logs'] as $transaction) {
|
||||
if (isset($transaction['orderId'])) {
|
||||
$orderIds[] = $transaction['orderId'];
|
||||
}
|
||||
}
|
||||
editOrderPayoutStatus($_SESSION["token"], $orderIds);
|
||||
updatePayout($_SESSION["token"],$payout_id);
|
||||
} else {
|
||||
echo "No transaction logs found.";
|
||||
}
|
||||
|
||||
header("location: vendor-profile.php?id=$payout_vendor_id");
|
||||
|
||||
?>
|
|
@ -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)) {
|
||||
|
|
|
@ -99,183 +99,179 @@ $users = getUsers();
|
|||
</div>
|
||||
|
||||
<div class="row">
|
||||
<?php
|
||||
$totalUsers = count($users);
|
||||
$usersPerPage = 20;
|
||||
$totalPages = ceil($totalUsers / $usersPerPage);
|
||||
$currentPage = isset($_GET['page']) ? $_GET['page'] : 1;
|
||||
$start = ($currentPage - 1) * $usersPerPage;
|
||||
$end = $start + $usersPerPage - 1;
|
||||
<?php
|
||||
$totalUsers = count($users);
|
||||
$usersPerPage = 20;
|
||||
$totalPages = ceil($totalUsers / $usersPerPage);
|
||||
$currentPage = isset($_GET['page']) ? $_GET['page'] : 1;
|
||||
$start = ($currentPage - 1) * $usersPerPage;
|
||||
$end = $start + $usersPerPage - 1;
|
||||
|
||||
for ($x = $start; $x <= $end && $x < $totalUsers; $x++) {
|
||||
$user = $users[$x];
|
||||
// $customerUser = getCustomerbyLoginId($user['_id']);
|
||||
// $vendorUser = getVendorbyLoginId($user['_id']);
|
||||
?>
|
||||
<div class="col-lg-6 col-xl-4 mb-24px">
|
||||
<div class="ec-user-card card card-default p-4">
|
||||
<a href="javascript:0" class="view-detail" id="modalTrigger-<?php echo $user['_id']; ?>"><i class="mdi mdi-eye-plus-outline"></i></a>
|
||||
<!-- <a href="javascript:0" data-bs-toggle="modal" data-bs-target="#modalContact-<?php echo $user['_id']; ?>" class="view-detail"><i class="mdi mdi-eye-plus-outline"></i></a> -->
|
||||
<a href="javascript:0" class="media text-secondary">
|
||||
<img src="https://upload.wikimedia.org/wikipedia/commons/7/7e/Circle-icons-profile.svg" class="mr-3 img-fluid" alt="Avatar Image">
|
||||
<div class="media-body">
|
||||
<h5 class="mt-0 mb-2 text-dark"><?php echo $user['username'] ?></h5>
|
||||
<div class="icon">
|
||||
<li class="d-flex mb-1">
|
||||
<i class="mdi mdi-account-key" style="font-size: 20px;"></i>
|
||||
<span><?php echo $user['user_type'] ?></span>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
for ($x = $start; $x <= $end && $x < $totalUsers; $x++) {
|
||||
$user = $users[$x];
|
||||
?>
|
||||
<div class="col-lg-6 col-xl-4 mb-24px">
|
||||
<div class="ec-user-card card card-default p-4">
|
||||
<a href="javascript:0" class="view-detail" id="modalTrigger-<?php echo $user['_id']; ?>"><i class="mdi mdi-eye-plus-outline"></i></a>
|
||||
<!-- <a href="javascript:0" data-bs-toggle="modal" data-bs-target="#modalContact-<?php echo $user['_id']; ?>" class="view-detail"><i class="mdi mdi-eye-plus-outline"></i></a> -->
|
||||
<a href="javascript:0" class="media text-secondary">
|
||||
<img src="https://upload.wikimedia.org/wikipedia/commons/7/7e/Circle-icons-profile.svg" class="mr-3 img-fluid" alt="Avatar Image">
|
||||
<div class="media-body">
|
||||
<h5 class="mt-0 mb-2 text-dark"><?php echo $user['username'] ?></h5>
|
||||
<div class="icon">
|
||||
<li class="d-flex mb-1">
|
||||
<i class="mdi mdi-account-key" style="font-size: 20px;"></i>
|
||||
<span><?php echo $user['user_type'] ?></span>
|
||||
</li>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<div class="modal fade modal-contact-detail" id="modalContact-<?php echo $user['_id']; ?>" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header justify-content-end border-bottom-0">
|
||||
<!-- Modal -->
|
||||
<?php foreach ($users as $user) { ?>
|
||||
<div class="modal fade modal-contact-detail" id="modalContact-<?php echo $user['_id']; ?>" tabindex="-1" aria-hidden="true">
|
||||
<div class="modal-dialog modal-dialog-centered modal-lg" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header justify-content-end border-bottom-0">
|
||||
<button type="button" class="btn-close-icon" data-bs-dismiss="modal" aria-label="Close">
|
||||
<i class="mdi mdi-close"></i>
|
||||
</button>
|
||||
</div>
|
||||
<div class="modal-body pt-0">
|
||||
<div class="row no-gutters">
|
||||
<div class="col-md-12">
|
||||
<div class="profile-content-left px-4">
|
||||
<form action="user-card-action.php" method="post">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="text-dark font-weight-medium pt-3 mb-2">Email</label>
|
||||
<input type="text" name="username" class="form-control" value="<?php echo $user['username']; ?>" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="text-dark font-weight-medium pt-3 mb-2">User Type</label>
|
||||
<select class="form-select" name="user_type">
|
||||
<option value="">Select User Type</option>
|
||||
<option value="admin" <?php echo ($user['user_type'] === 'admin') ? 'selected' : ''; ?>>admin</option>
|
||||
<option value="vendor" <?php echo ($user['user_type'] === 'vendor') ? 'selected' : ''; ?>>vendor</option>
|
||||
<option value="customer" <?php echo ($user['user_type'] === 'customer') ? 'selected' : ''; ?>>customer</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<input type="hidden" name="_id" class="form-control" value="<?php echo $user['_id']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php } ?>
|
||||
|
||||
<button type="button" class="btn-close-icon" data-bs-dismiss="modal" aria-label="Close">
|
||||
<i class="mdi mdi-close"></i>
|
||||
</button>
|
||||
</div>
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
<?php foreach ($users as $user) { ?>
|
||||
registerModalTrigger('<?php echo $user['_id']; ?>');
|
||||
<?php } ?>
|
||||
});
|
||||
|
||||
<div class="modal-body pt-0">
|
||||
<div class="row no-gutters">
|
||||
<div class="col-md-12">
|
||||
<div class="profile-content-left px-4">
|
||||
<form action="user-card-action.php" method="post">
|
||||
<div class="row">
|
||||
function registerModalTrigger(userId) {
|
||||
var modalTrigger = document.getElementById('modalTrigger-' + userId);
|
||||
var sessionToken = '<?php echo isset($_SESSION["token"]) ? $_SESSION["token"] : ""; ?>';
|
||||
var email = '<?php echo isset($_SESSION["email"]) ? $_SESSION["email"] : ""; ?>';
|
||||
var password = '<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="text-dark font-weight-medium pt-3 mb-2">Email</label>
|
||||
<input type="text" name="username" class="form-control" value="<?php echo $user['username']; ?>" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label class="text-dark font-weight-medium pt-3 mb-2">User Type</label>
|
||||
<select class="form-select" name="user_type">
|
||||
<option value="">Select User Type</option>
|
||||
<option value="admin" <?php echo ($user['user_type'] === 'admin') ? 'selected' : ''; ?>>admin</option>
|
||||
<option value="vendor" <?php echo ($user['user_type'] === 'vendor') ? 'selected' : ''; ?>>vendor</option>
|
||||
<option value="customer" <?php echo ($user['user_type'] === 'customer') ? 'selected' : ''; ?>>customer</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<input type="hidden" name="_id" class="form-control" value="<?php echo $user['_id']; ?>">
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<button type="submit" class="btn btn-primary">Submit</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
if (modalTrigger) {
|
||||
modalTrigger.addEventListener('click', function() {
|
||||
renewToken(sessionToken, email, password, userId);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
<script>
|
||||
document.addEventListener('DOMContentLoaded', function() {
|
||||
<?php foreach ($users as $user) { ?>
|
||||
registerModalTrigger('<?php echo $user['_id']; ?>');
|
||||
<?php } ?>
|
||||
});
|
||||
function renewToken(sessionToken, email, password, userId) {
|
||||
login(email, password, sessionToken, function() {
|
||||
showTheModal(userId);
|
||||
});
|
||||
}
|
||||
|
||||
function registerModalTrigger(userId) {
|
||||
var modalTrigger = document.getElementById('modalTrigger-' + userId);
|
||||
var sessionToken = '<?php echo isset($_SESSION["token"]) ? $_SESSION["token"] : ""; ?>';
|
||||
var email = '<?php echo isset($_SESSION["email"]) ? $_SESSION["email"] : ""; ?>';
|
||||
var password = '<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
|
||||
function login(username, password, sessionToken, callback) {
|
||||
fetch("https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/login", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Api-Key": "{{apiKey}}"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
username: username,
|
||||
password: password
|
||||
})
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error("Unable to login");
|
||||
}
|
||||
})
|
||||
.then(data => {
|
||||
// Update the session token on the server side
|
||||
fetch("update-token-session.php", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
token: data.token
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(result => {
|
||||
if (result.status === 'success') {
|
||||
// Update the session token in the client-side variable
|
||||
sessionToken = data.token;
|
||||
console.log("New Token:", sessionToken);
|
||||
callback();
|
||||
} else {
|
||||
throw new Error("Unable to update session token");
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.error("Error:", error.message);
|
||||
});
|
||||
}
|
||||
|
||||
if (modalTrigger) {
|
||||
modalTrigger.addEventListener('click', function() {
|
||||
// Renew the login token before showing the modal
|
||||
renewToken(sessionToken, email, password, userId);
|
||||
});
|
||||
}
|
||||
}
|
||||
function showTheModal(userId) {
|
||||
// Add your logic here to show the modal
|
||||
// You may need to trigger it manually if using Bootstrap modal
|
||||
$('#modalContact-' + userId).modal('show');
|
||||
}
|
||||
</script>
|
||||
|
||||
function renewToken(sessionToken, email, password, userId) {
|
||||
// Add your logic here to renew the login token
|
||||
login(email, password, sessionToken, function() {
|
||||
// Callback function after renewing the token, e.g., show the modal
|
||||
showTheModal(userId);
|
||||
});
|
||||
}
|
||||
<!-- Pagination Links -->
|
||||
<div class="pagination">
|
||||
<?php
|
||||
for ($page = 1; $page <= $totalPages; $page++) {
|
||||
echo '<a href="?page=' . $page . '">' . $page . '</a>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
function login(username, password, sessionToken, callback) {
|
||||
fetch("https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/login", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Api-Key": "{{apiKey}}"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
username: username,
|
||||
password: password
|
||||
})
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error("Unable to login");
|
||||
}
|
||||
})
|
||||
.then(data => {
|
||||
// Update the session token on the server side
|
||||
fetch("update-token-session.php", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
token: data.token
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(result => {
|
||||
if (result.status === 'success') {
|
||||
// Update the session token in the client-side variable
|
||||
sessionToken = data.token;
|
||||
console.log("New Token:", sessionToken);
|
||||
callback();
|
||||
} else {
|
||||
throw new Error("Unable to update session token");
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.error("Error:", error.message);
|
||||
});
|
||||
}
|
||||
|
||||
function showTheModal(userId) {
|
||||
// Add your logic here to show the modal
|
||||
// You may need to trigger it manually if using Bootstrap modal
|
||||
$('#modalContact-' + userId).modal('show');
|
||||
}
|
||||
</script>
|
||||
<?php } ?>
|
||||
</div>
|
||||
|
||||
<!-- Pagination Links -->
|
||||
<div class="pagination">
|
||||
<?php
|
||||
for ($page = 1; $page <= $totalPages; $page++) {
|
||||
echo '<a href="?page=' . $page . '">' . $page . '</a>';
|
||||
}
|
||||
?>
|
||||
</div>
|
||||
|
||||
<!-- Contact Modal -->
|
||||
|
||||
|
|
|
@ -80,564 +80,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 +99,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 +121,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,$_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 +161,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 +171,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';
|
||||
?>
|
||||
|
|
|
@ -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");
|
||||
});
|
||||
}
|
||||
|
||||
|
|
|
@ -2,30 +2,91 @@
|
|||
include "../functions.php";
|
||||
|
||||
if(isset($_SESSION["vendorId"])){
|
||||
if(isset($_GET["id"])){
|
||||
$_SESSION["vendorId"]=$_GET["id"];
|
||||
}
|
||||
if(isset($_GET["id"])){
|
||||
$_SESSION["vendorId"]=$_GET["id"];
|
||||
}
|
||||
} else {
|
||||
if(isset($_GET["id"])){
|
||||
$_SESSION["vendorId"]=$_GET["id"];
|
||||
} else {
|
||||
header("location: vendor-card.php");
|
||||
}
|
||||
if(isset($_GET["id"])){
|
||||
$_SESSION["vendorId"]=$_GET["id"];
|
||||
} else {
|
||||
header("location: vendor-card.php");
|
||||
}
|
||||
}
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
|
||||
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
//$customer_data = getCustomerbyLoginId($_SESSION["userId"]);
|
||||
|
||||
} else {
|
||||
$_SESSION["isLoggedIn"] = false;
|
||||
header("location: login.php");
|
||||
header("location: login.php");
|
||||
}
|
||||
|
||||
if($_SESSION["user_type"]!="admin"){
|
||||
header("location: login.php?alert=Only admins allowed here!");
|
||||
header("location: login.php?alert=Only admins allowed here!");
|
||||
}
|
||||
|
||||
$vendor = getVendorbyId($_SESSION["vendorId"]);
|
||||
$array = json_decode($vendor,true);
|
||||
|
||||
$selectedBankAccount = null;
|
||||
foreach ($array['bank_acount_details'] as $bankAccount) {
|
||||
if ($bankAccount['bank_payout']) {
|
||||
$selectedBankAccount = $bankAccount;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if ($selectedBankAccount === null && !empty($array['bank_acount_details'])) {
|
||||
$selectedBankAccount = $array['bank_acount_details'][0];
|
||||
}
|
||||
$selectedBankAccountJSON = json_encode($selectedBankAccount);
|
||||
|
||||
|
||||
$shopOrders = getOrderbyVendorId($_SESSION["vendorId"]);
|
||||
$vendorOrderss = json_decode($shopOrders);
|
||||
if (is_array($vendorOrderss)) {
|
||||
$vendorOrders = json_decode($shopOrders);
|
||||
} elseif (is_object($vendorOrderss) && property_exists($vendorOrderss, 'message')) {
|
||||
$vendorOrders = [];
|
||||
} else {
|
||||
echo "Unknown type or no 'message' property found.";
|
||||
}
|
||||
|
||||
$allPayouts = getAllPayout($_SESSION["token"]);
|
||||
$vendorPayouts = json_decode($allPayouts,true);
|
||||
|
||||
|
||||
$filteredPayouts = [];
|
||||
foreach ($vendorPayouts as $payout) {
|
||||
if ($payout['vendor_details'][0]['vendor_id'] == $_SESSION["vendorId"]) {
|
||||
$filteredPayouts[] = $payout;
|
||||
}
|
||||
}
|
||||
|
||||
$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;
|
||||
}
|
||||
// $token = loginRenew($_SESSION["email"], $_SESSION["password"], $token);
|
||||
// $_SESSION["token"] = $token;
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<!DOCTYPE html>
|
||||
<html lang="en" dir="ltr">
|
||||
|
||||
|
@ -128,6 +189,18 @@ $array = json_decode($vendor,true);
|
|||
|
||||
<div class="contact-info pt-4">
|
||||
<h5 class="text-dark">Contact Information</h5>
|
||||
<?php
|
||||
//echo date('Y-m-d H:i:s', $issued_at_time) . "<br>";
|
||||
//echo date('Y-m-d H:i:s', $expiration_time) . "<br>";
|
||||
//echo date('Y-m-d H:i:s', $renewal_time) . "<br>";
|
||||
//echo date('Y-m-d H:i:s', time()) . "<br>";
|
||||
|
||||
|
||||
?>
|
||||
<?php echo $_SESSION["token"] ?><br>
|
||||
<?php // echo $_SESSION["email"] ?> <br>
|
||||
<?php // echo "Updated token: " . $token; ?>
|
||||
<?php // echo $_SESSION["password"] ?>
|
||||
<p class="text-dark font-weight-medium pt-24px mb-2">Email address</p>
|
||||
<p><?php echo $array["user_email"]; ?></p>
|
||||
<p class="text-dark font-weight-medium pt-24px mb-2">Phone Number</p>
|
||||
|
@ -214,176 +287,168 @@ $array = json_decode($vendor,true);
|
|||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>ObananaPay</td>
|
||||
<td>₱230</td>
|
||||
<td>
|
||||
<span class="badge badge-success">Paid</span>
|
||||
</td>
|
||||
<td><span class="badge badge-warning">No</span></td>
|
||||
<td>
|
||||
<a class="text-dark" href=""> Coach Swagger</a>
|
||||
</td>
|
||||
<td>Oct 20, 2018</td>
|
||||
<td class="text-right">
|
||||
<div
|
||||
class="dropdown show d-inline-block widget-dropdown">
|
||||
<a class="dropdown-toggle icon-burger-mini"
|
||||
href="" role="button"
|
||||
id="dropdown-recent-order1"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
data-display="static"></a>
|
||||
<ul class="dropdown-menu dropdown-menu-right"
|
||||
aria-labelledby="dropdown-recent-order1">
|
||||
<li class="dropdown-item">
|
||||
<a href="#">Details</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
$totalOrders = count($vendorOrders);
|
||||
for ($i = 0; $i < $totalOrders; $i++) {
|
||||
$order = $vendorOrders[$i];
|
||||
$orderArray = json_encode($order, true);
|
||||
$orderItems = json_decode($orderArray, true);
|
||||
|
||||
<tr>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>ObananaPay</td>
|
||||
<td>₱550</td>
|
||||
<td>
|
||||
<span class="badge badge-success">Paid</span>
|
||||
</td>
|
||||
<td><span class="badge badge-warning">No</span></td>
|
||||
<td>
|
||||
<a class="text-dark" href=""> Toddler Shoes, Gucci Watch</a>
|
||||
</td>
|
||||
<td>Nov 15, 2018</td>
|
||||
<td class="text-right">
|
||||
<div
|
||||
class="dropdown show d-inline-block widget-dropdown">
|
||||
<a class="dropdown-toggle icon-burger-mini"
|
||||
href="" role="button"
|
||||
id="dropdown-recent-order1"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
data-display="static"></a>
|
||||
<ul class="dropdown-menu dropdown-menu-right"
|
||||
aria-labelledby="dropdown-recent-order1">
|
||||
<li class="dropdown-item">
|
||||
<a href="#">Details</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
if ($orderItems['payment']['status'] === 'PAID') {
|
||||
foreach ($orderItems['items'] as $item) {
|
||||
$isPayoutCompleted = !empty($orderItems['payout_status']);
|
||||
?>
|
||||
<tr>
|
||||
<td><input type="checkbox" <?php echo $isPayoutCompleted ? 'disabled' : ''; ?>></td>
|
||||
<td><?php echo $orderItems['payment_method']; ?></td>
|
||||
<td><?php echo $item['price']; ?></td>
|
||||
<td>
|
||||
<span class="badge badge-success"><?php echo $orderItems['payment']['status']; ?></span>
|
||||
</td>
|
||||
<td>
|
||||
<span class="badge badge-warning"><?php echo $isPayoutCompleted ? 'Yes' : 'No'; ?></span>
|
||||
</td>
|
||||
<td>
|
||||
<a class="text-dark" href=""><?php echo $item['product']['name']; ?></a>
|
||||
</td>
|
||||
<td><?php echo $orderItems['updatedAt']; ?></td>
|
||||
<td hidden><?php echo $orderItems['_id']; ?></td>
|
||||
<td class="text-right">
|
||||
<div class="dropdown show d-inline-block widget-dropdown">
|
||||
<a class="dropdown-toggle icon-burger-mini" href="" role="button" id="dropdown-recent-order1" data-bs-toggle="dropdown" aria-haspopup="true" aria-expanded="false" data-display="static"></a>
|
||||
<ul class="dropdown-menu dropdown-menu-right" aria-labelledby="dropdown-recent-order1">
|
||||
<li class="dropdown-item">
|
||||
<a href="#">Details</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<tr>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>ObananaPay</td>
|
||||
<td>₱325</td>
|
||||
<td>
|
||||
<span class="badge badge-success">Paid</span>
|
||||
</td>
|
||||
<td><span class="badge badge-warning">No</span></td>
|
||||
<td>
|
||||
<a class="text-dark" href=""> Hat Black Suits</a>
|
||||
</td>
|
||||
<td>Nov 18, 2018</td>
|
||||
<td class="text-right">
|
||||
<div
|
||||
class="dropdown show d-inline-block widget-dropdown">
|
||||
<a class="dropdown-toggle icon-burger-mini"
|
||||
href="" role="button"
|
||||
id="dropdown-recent-order1"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
data-display="static"></a>
|
||||
<ul class="dropdown-menu dropdown-menu-right"
|
||||
aria-labelledby="dropdown-recent-order1">
|
||||
<li class="dropdown-item">
|
||||
<a href="#">Details</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><input type="checkbox"></td>
|
||||
<td>PayMongo</td>
|
||||
<td>₱200</td>
|
||||
<td>
|
||||
<span class="badge badge-success">Paid</span>
|
||||
</td>
|
||||
<td><span class="badge badge-warning">No</span></td>
|
||||
<td>
|
||||
<a class="text-dark" href=""> T100 Power Bank</a>
|
||||
</td>
|
||||
<td>Nov 20, 2018</td>
|
||||
<td class="text-right">
|
||||
<div
|
||||
class="dropdown show d-inline-block widget-dropdown">
|
||||
<a class="dropdown-toggle icon-burger-mini"
|
||||
href="" role="button"
|
||||
id="dropdown-recent-order1"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
data-display="static"></a>
|
||||
<ul class="dropdown-menu dropdown-menu-right"
|
||||
aria-labelledby="dropdown-recent-order1">
|
||||
<li class="dropdown-item">
|
||||
<a href="#">Details</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><input type="checkbox" disabled></td>
|
||||
<td>ObananaPay</td>
|
||||
<td>₱150</td>
|
||||
<td>
|
||||
<span class="badge badge-success">Paid</span>
|
||||
</td>
|
||||
<td><span class="badge badge-success">Yes</span></td>
|
||||
<td>
|
||||
<a class="text-dark" href=""> Vodka Milk Tea</a>
|
||||
</td>
|
||||
<td>Dec 11, 2018</td>
|
||||
<td class="text-right">
|
||||
<div
|
||||
class="dropdown show d-inline-block widget-dropdown">
|
||||
<a class="dropdown-toggle icon-burger-mini"
|
||||
href="" role="button"
|
||||
id="dropdown-recent-order1"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
data-display="static"></a>
|
||||
<ul class="dropdown-menu dropdown-menu-right"
|
||||
aria-labelledby="dropdown-recent-order1">
|
||||
<li class="dropdown-item">
|
||||
<a href="#">Details</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-flex justify-content-end mt-5">
|
||||
<button type="submit" class="btn btn-primary mb-2 btn-pill">Create Payout from Selected</button>
|
||||
</div>
|
||||
<div class="d-flex justify-content-end mt-5">
|
||||
<button type="button" class="btn btn-primary mb-2 btn-pill" onclick="createPayout()">Create Payout from Selected</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function createPayout() {
|
||||
var rows = document.querySelectorAll("#recent-orders tbody tr");
|
||||
var selectedBank = JSON.parse('<?php echo $selectedBankAccountJSON; ?>');
|
||||
var selectedOrders = [];
|
||||
var grossAmount = 0;
|
||||
var totalIndividualFee = 0;
|
||||
var feesDeductionAdjustment = <?php echo $_SESSION["transfer_fee"] ?>;
|
||||
var feesPercentage = (feesDeductionAdjustment * 100) + '%';
|
||||
const token = '<?php echo $_SESSION["token"] ?>';
|
||||
const vendorId = '<?php echo ($array['_id']); ?>';
|
||||
const vendorName = '<?php echo ($array['user_login']); ?>';
|
||||
rows.forEach(function(row) {
|
||||
var checkbox = row.querySelector("input[type=checkbox]");
|
||||
if (checkbox && checkbox.checked) {
|
||||
var amount = parseFloat(row.cells[2].innerText);
|
||||
var orderId = row.cells[7].innerText;
|
||||
grossAmount += amount;
|
||||
var individualFee = amount * <?php echo $_SESSION["transfer_fee"] ?>;
|
||||
totalIndividualFee += individualFee;
|
||||
// feesDeductionAdjustment += individualFee;
|
||||
var breakdownItem = {
|
||||
Type: "Payment",
|
||||
Transaction_date: row.cells[6].innerText,
|
||||
Gross_Amount: amount,
|
||||
Fee: individualFee,
|
||||
Net_Amount: amount - individualFee,
|
||||
Description: row.cells[5].querySelector("a").innerText,
|
||||
orderId: orderId
|
||||
};
|
||||
|
||||
selectedOrders.push(breakdownItem);
|
||||
}
|
||||
});
|
||||
|
||||
var netAmount = grossAmount - (grossAmount * feesDeductionAdjustment);
|
||||
|
||||
var fees_breakdown = {
|
||||
transfer_fee: totalIndividualFee, };
|
||||
|
||||
|
||||
var postData = {
|
||||
gross_amount: grossAmount.toFixed(2),
|
||||
fees_deduction_adjustment: feesPercentage,
|
||||
net_amount: netAmount.toFixed(2),
|
||||
breakdown: fees_breakdown,
|
||||
bank_information: [
|
||||
selectedBank
|
||||
],
|
||||
transaction_logs: selectedOrders,
|
||||
vendor_details: [
|
||||
{ vendor_id: vendorId,
|
||||
vendor_name: vendorName}
|
||||
],
|
||||
status: "PENDING",
|
||||
created_by: "Sample User",
|
||||
};
|
||||
|
||||
fetch('https://api.obanana.shop/api/v1/payouts/', {
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Authorization": "Bearer " + token,
|
||||
},
|
||||
body: JSON.stringify(postData)
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error('Failed to create payout');
|
||||
}
|
||||
})
|
||||
.then(data => {
|
||||
console.log('Payout created successfully');
|
||||
selectedOrders.forEach(order => {
|
||||
var orderId = order.orderId;
|
||||
fetch(`https://api.obanana.shop/api/v1/orders/${orderId}`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
"Authorization": "Bearer " + token,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
payout_status: {
|
||||
payout_id: data._id,
|
||||
status: "Processing"
|
||||
}
|
||||
})
|
||||
})
|
||||
.then(response => {
|
||||
// if (!response.ok) {
|
||||
// console.error(`Failed to update payout status for order ${orderId}`);
|
||||
// }
|
||||
if (!response.ok) {
|
||||
console.error(`Failed to update payout status for order ${orderId}`);
|
||||
} else {
|
||||
location.reload();
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error(`Error updating payout status for order ${orderId}:`, error);
|
||||
});
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -418,14 +483,21 @@ $array = json_decode($vendor,true);
|
|||
</thead>
|
||||
|
||||
<tbody>
|
||||
<?php
|
||||
$totalPayoutOrders = count($filteredPayouts);
|
||||
for ($i = 0; $i < $totalPayoutOrders; $i++) {
|
||||
$order_payouts = $filteredPayouts[$i];
|
||||
|
||||
|
||||
?>
|
||||
<tr>
|
||||
<td>₱1,230</td>
|
||||
<td>EastWest</td>
|
||||
<td>**** **** 1234</td>
|
||||
<td>Jon-Jon Manaay</td>
|
||||
<td>Oct 20, 2018</td>
|
||||
<td><?php echo $order_payouts['gross_amount']?></td>
|
||||
<td><?php echo $order_payouts['bank_information'][0]['bank_name']?></td>
|
||||
<td><?php echo $order_payouts['bank_information'][0]['bank_account_number']?></td>
|
||||
<td><?php echo $order_payouts['bank_information'][0]['bank_account_name']?></td>
|
||||
<td><?php echo date('F j Y', strtotime($order_payouts['createdAt'])); ?></td>
|
||||
<td>
|
||||
<span class="badge badge-success">Deposited</span>
|
||||
<span class="badge badge-success"><?php echo $order_payouts['status']?></span>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div
|
||||
|
@ -442,40 +514,14 @@ $array = json_decode($vendor,true);
|
|||
<li class="dropdown-item">
|
||||
<a href="#">Details</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td>₱2,340</td>
|
||||
<td>EastWest</td>
|
||||
<td>**** **** 1234</td>
|
||||
<td>Jon-Jon Manaay</td>
|
||||
<td>Oct 27, 2018</td>
|
||||
<td>
|
||||
<span class="badge badge-warning">Processing</span>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<div
|
||||
class="dropdown show d-inline-block widget-dropdown">
|
||||
<a class="dropdown-toggle icon-burger-mini"
|
||||
href="" role="button"
|
||||
id="dropdown-recent-order1"
|
||||
data-bs-toggle="dropdown"
|
||||
aria-haspopup="true"
|
||||
aria-expanded="false"
|
||||
data-display="static"></a>
|
||||
<ul class="dropdown-menu dropdown-menu-right"
|
||||
aria-labelledby="dropdown-recent-order1">
|
||||
<li class="dropdown-item">
|
||||
<a href="#">Details</a>
|
||||
<a href="payout_deposit_action.php?payout_id=<?php echo urlencode($order_payouts['_id']); ?>">Deposit</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<?php } ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
@ -533,7 +579,7 @@ $array = json_decode($vendor,true);
|
|||
<div class="col-xl-12">
|
||||
|
||||
<!-- Notification Table -->
|
||||
<div class="card card-default mb-24px">
|
||||
<!-- <div class="card card-default mb-24px">
|
||||
<div class="card-header justify-content-between mb-1">
|
||||
<h2>Latest Notifications</h2>
|
||||
<div>
|
||||
|
@ -685,7 +731,7 @@ $array = json_decode($vendor,true);
|
|||
|
||||
</div>
|
||||
<div class="mt-3"></div>
|
||||
</div>
|
||||
</div> -->
|
||||
|
||||
</div>
|
||||
|
||||
|
@ -909,6 +955,12 @@ $array = json_decode($vendor,true);
|
|||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-12">
|
||||
<!-- Bank Details -->
|
||||
|
||||
<!-- Bank Details -->
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -916,7 +968,23 @@ $array = json_decode($vendor,true);
|
|||
<div class="tab-pane fade" id="settings" role="tabpanel"
|
||||
aria-labelledby="settings-tab">
|
||||
<div class="tab-pane-content mt-5">
|
||||
<form>
|
||||
|
||||
<table style="width:100%; border-collapse: collapse;">
|
||||
<tr>
|
||||
<td style="border: 1px solid #dddddd; background-color: #f7f7f7; padding: 8px; font-weight: 700;">Bank Name</td>
|
||||
<td style="border: 1px solid #dddddd; padding: 8px;font-weight: 500;"><?php echo $selectedBankAccount['bank_name'] ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border: 1px solid #dddddd; background-color: #f7f7f7; padding: 8px;font-weight: 700;">Account Number</td>
|
||||
<td style="border: 1px solid #dddddd; padding: 8px;font-weight: 500;"><?php echo $selectedBankAccount["bank_account_number"] ?></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td style="border: 1px solid #dddddd; background-color: #f7f7f7; padding: 8px;font-weight: 700;">Account Name</td>
|
||||
<td style="border: 1px solid #dddddd; padding: 8px;font-weight: 500;"><?php echo $selectedBankAccount["bank_account_name"] ?></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
<!-- <form>
|
||||
<div class="form-group row mb-6">
|
||||
<label for="coverImage"
|
||||
class="col-sm-4 col-lg-2 col-form-label">User Image</label>
|
||||
|
@ -984,7 +1052,7 @@ $array = json_decode($vendor,true);
|
|||
class="btn btn-primary mb-2 btn-pill">Update
|
||||
Profile</button>
|
||||
</div>
|
||||
</form>
|
||||
</form> -->
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -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">
|
||||
|
|
243
functions.php
243
functions.php
|
@ -6,7 +6,7 @@ function simpleProducts($category)
|
|||
{
|
||||
$curl = curl_init();
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/products",
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/products",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -32,7 +32,7 @@ function simpleProducts($category)
|
|||
function sddProducts()
|
||||
{
|
||||
$curl = curl_init();
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/products";
|
||||
$url = "https://" . $_SESSION["data_endpoint"] . "/api/v1/products";
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
//CURLOPT_URL => 'https://".$_SESSION["data_endpoint"]."/api/v1/products/vendor/6527b593f79b5deac5ad6cb8',
|
||||
|
@ -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]['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');
|
||||
});
|
||||
$products = array_values($products);
|
||||
return $products;
|
||||
|
@ -90,7 +90,7 @@ function sddProducts()
|
|||
function searchProducts($query)
|
||||
{
|
||||
$query = str_replace(" ", "+", $query);
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/products/search?q=$query";
|
||||
$url = "https://" . $_SESSION["data_endpoint"] . "/api/v1/products/search?q=$query";
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
|
@ -140,7 +140,7 @@ $result = searchProducts($query);
|
|||
function searchVendor($query)
|
||||
{
|
||||
$query = str_replace(" ", "+", $query);
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/vendors/search?q=$query";
|
||||
$url = "https://" . $_SESSION["data_endpoint"] . "/api/v1/vendors/search?q=$query";
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
|
@ -202,7 +202,7 @@ $result = searchProducts($query);
|
|||
|
||||
function getProduct($product)
|
||||
{
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/products/$product";
|
||||
$url = "https://" . $_SESSION["data_endpoint"] . "/api/v1/products/$product";
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
|
@ -226,7 +226,7 @@ function productList()
|
|||
{
|
||||
$curl = curl_init();
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/products",
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/products",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -248,7 +248,7 @@ function productList()
|
|||
function productListVendor($vendorId)
|
||||
{
|
||||
$curl = curl_init();
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/products/vendor/" . $vendorId;
|
||||
$url = "https://" . $_SESSION["data_endpoint"] . "/api/v1/products/vendor/" . $vendorId;
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
//CURLOPT_URL => 'https://".$_SESSION["data_endpoint"]."/api/v1/products/vendor/6527b593f79b5deac5ad6cb8',
|
||||
|
@ -278,7 +278,7 @@ function getProductVariations($parent_id)
|
|||
{
|
||||
$curl = curl_init();
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/products",
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/products",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -314,7 +314,7 @@ function register($username, $password)
|
|||
$json = json_encode($array);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/register",
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/register",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -342,7 +342,7 @@ function login($username, $password)
|
|||
$json = json_encode($array);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/login",
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/login",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -360,9 +360,39 @@ function login($username, $password)
|
|||
$token = json_decode($response, true);
|
||||
return $token["token"];
|
||||
}
|
||||
|
||||
function loginRenew($username, $password, $token)
|
||||
{
|
||||
$curl = curl_init();
|
||||
$array = array(
|
||||
"username" => $username,
|
||||
"password" => $password
|
||||
);
|
||||
$json = json_encode($array);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/login",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
CURLOPT_TIMEOUT => 0,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'POST',
|
||||
CURLOPT_POSTFIELDS => $json,
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Content-Type: application/json',
|
||||
'X-Api-Key: {{apiKey}}'
|
||||
),
|
||||
));
|
||||
$response = curl_exec($curl);
|
||||
curl_close($curl);
|
||||
$token = json_decode($response, true);
|
||||
return $token["token"];
|
||||
}
|
||||
|
||||
function forgot_password($email)
|
||||
{
|
||||
if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){
|
||||
if ($_SESSION["is_test"] == true && $_SESSION["test_email_rcpt"] != "") {
|
||||
$email = $_SESSION["test_email_rcpt"];
|
||||
}
|
||||
$curl = curl_init();
|
||||
|
@ -372,7 +402,7 @@ function forgot_password($email)
|
|||
$json = json_encode($array);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $json);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/forgot-password",
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/forgot-password",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -392,7 +422,7 @@ function forgot_password($email)
|
|||
function getCustomerbyLoginId($id)
|
||||
{
|
||||
$curl = curl_init();
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/customers/login_id/$id";
|
||||
$url = "https://" . $_SESSION["data_endpoint"] . "/api/v1/customers/login_id/$id";
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => $url,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
|
@ -416,7 +446,7 @@ function getCustomerbyLoginId($id)
|
|||
function getCustomer($id)
|
||||
{
|
||||
$curl = curl_init();
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/customers/$id";
|
||||
$url = "https://" . $_SESSION["data_endpoint"] . "/api/v1/customers/$id";
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => $url,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
|
@ -440,7 +470,7 @@ function getCustomer($id)
|
|||
function getVendorbyLoginId($id)
|
||||
{
|
||||
$curl = curl_init();
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/vendors/login_id/$id";
|
||||
$url = "https://" . $_SESSION["data_endpoint"] . "/api/v1/vendors/login_id/$id";
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => $url,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
|
@ -464,7 +494,7 @@ function getVendorbyLoginId($id)
|
|||
function customerExists($email)
|
||||
{
|
||||
$curl = curl_init();
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/customers/search?q=$email";
|
||||
$url = "https://" . $_SESSION["data_endpoint"] . "/api/v1/customers/search?q=$email";
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
|
@ -492,7 +522,7 @@ function customerExists($email)
|
|||
function vendorExists($email)
|
||||
{
|
||||
$curl = curl_init();
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/vendors/search?q=$email";
|
||||
$url = "https://" . $_SESSION["data_endpoint"] . "/api/v1/vendors/search?q=$email";
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
|
@ -520,7 +550,7 @@ function vendorExists($email)
|
|||
|
||||
function sendEmail_obanana($fName, $lName, $email, $phone, $message)
|
||||
{
|
||||
if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){
|
||||
if ($_SESSION["is_test"] == true && $_SESSION["test_email_rcpt"] != "") {
|
||||
$email = $_SESSION["test_email_rcpt"];
|
||||
}
|
||||
$salesEmail = $_SESSION["sales_email"];
|
||||
|
@ -639,7 +669,7 @@ function sendEmail_customer($fName, $lName, $email)
|
|||
|
||||
function contact_Seller($cstm_email, $prd_name, $prd_qnty, $message)
|
||||
{
|
||||
if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){
|
||||
if ($_SESSION["is_test"] == true && $_SESSION["test_email_rcpt"] != "") {
|
||||
$cstm_email = $_SESSION["test_email_rcpt"];
|
||||
}
|
||||
$salesEmail = $_SESSION["sales_email"];
|
||||
|
@ -699,7 +729,7 @@ function contact_Seller($cstm_email, $prd_name, $prd_qnty, $message)
|
|||
|
||||
function contact_Inquirer($cstm_email)
|
||||
{
|
||||
if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){
|
||||
if ($_SESSION["is_test"] == true && $_SESSION["test_email_rcpt"] != "") {
|
||||
$cstm_email = $_SESSION["test_email_rcpt"];
|
||||
}
|
||||
$msgto_inquirer = "
|
||||
|
@ -760,7 +790,7 @@ function contact_Inquirer($cstm_email)
|
|||
|
||||
function sendOTP($email)
|
||||
{
|
||||
if($_SESSION["is_test"]==true && $_SESSION["test_email_rcpt"]!=""){
|
||||
if ($_SESSION["is_test"] == true && $_SESSION["test_email_rcpt"] != "") {
|
||||
$email = $_SESSION["test_email_rcpt"];
|
||||
}
|
||||
$curl = curl_init();
|
||||
|
@ -836,7 +866,7 @@ function createCustomer($email, $phone, $firstname, $lastname, $loginId, $token)
|
|||
curl_setopt($curl, CURLOPT_POSTFIELDS, $array);
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/customers",
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/customers",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -855,7 +885,7 @@ function createCustomer($email, $phone, $firstname, $lastname, $loginId, $token)
|
|||
|
||||
function updateCustomer($customerId, $phone, $firstname, $lastname, $loginId, $token)
|
||||
{
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/customers/$customerId";
|
||||
$url = "https://" . $_SESSION["data_endpoint"] . "/api/v1/customers/$customerId";
|
||||
$array = '{
|
||||
"last_name": "' . $lastname . '",
|
||||
"login_id": "' . $loginId . '",
|
||||
|
@ -892,7 +922,7 @@ function profile($token)
|
|||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_HTTPHEADER, $header);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/profile",
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/profile",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -967,7 +997,7 @@ function profile($token)
|
|||
// }
|
||||
function updateVendor($vendorId, $phone, $userlogin, $firstname, $lastname, $loginId, $token)
|
||||
{
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/vendors/$vendorId";
|
||||
$url = "https://" . $_SESSION["data_endpoint"] . "/api/v1/vendors/$vendorId";
|
||||
$array = '{
|
||||
"login_id": "' . $loginId . '",
|
||||
"user_login": "' . $userlogin . '",
|
||||
|
@ -1010,7 +1040,7 @@ function createVendor($email, $phone, $userlogin, $firstname, $lastname, $loginI
|
|||
);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $array);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/vendors",
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/vendors",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1105,7 +1135,7 @@ function vendorList()
|
|||
{
|
||||
$curl = curl_init();
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/vendors",
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/vendors",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1128,7 +1158,7 @@ function simpleVendors()
|
|||
{
|
||||
$curl = curl_init();
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/vendors",
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/vendors",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1157,7 +1187,7 @@ function productListVendors($vendorIds)
|
|||
|
||||
$curl = curl_init();
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/products?vendor_ids=" . $vendorIdsString,
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/products?vendor_ids=" . $vendorIdsString,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1180,7 +1210,7 @@ function simpleVendorsWithProducts()
|
|||
{
|
||||
$curl = curl_init();
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/vendors",
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/vendors",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1243,7 +1273,7 @@ function simpleVendorsWithProducts()
|
|||
|
||||
function getVendorbyId($id)
|
||||
{
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/vendors/$id";
|
||||
$url = "https://" . $_SESSION["data_endpoint"] . "/api/v1/vendors/$id";
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
|
@ -1267,7 +1297,7 @@ function getVendorbyId($id)
|
|||
function searchVendorByLoginId($id)
|
||||
{
|
||||
$id = str_replace(" ", "+", $id);
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/vendors/search?q=$id";
|
||||
$url = "https://" . $_SESSION["data_endpoint"] . "/api/v1/vendors/search?q=$id";
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
|
@ -1289,7 +1319,7 @@ function searchVendorByLoginId($id)
|
|||
|
||||
function getOrder($order)
|
||||
{
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/orders/$order";
|
||||
$url = "https://" . $_SESSION["data_endpoint"] . "/api/v1/orders/$order";
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
|
@ -1313,7 +1343,7 @@ function getAllOrder()
|
|||
{
|
||||
$curl = curl_init();
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/orders",
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/orders",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1341,7 +1371,7 @@ function getAllOrder()
|
|||
|
||||
function getOrderbyCustomerId($id)
|
||||
{
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/orders/customer/$id";
|
||||
$url = "https://" . $_SESSION["data_endpoint"] . "/api/v1/orders/customer/$id";
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
|
@ -1363,7 +1393,7 @@ function getOrderbyCustomerId($id)
|
|||
}
|
||||
function getOrderbyVendorId($id)
|
||||
{
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/orders/vendor/$id";
|
||||
$url = "https://" . $_SESSION["data_endpoint"] . "/api/v1/orders/vendor/$id";
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
|
@ -1399,11 +1429,10 @@ function editOrderStatus($orderId, $status, $currentStatus, $trackingNumber, $co
|
|||
// $data['tracking_number'] = $trackingNumber;
|
||||
$data['payment']['status'] = $paymentStatus;
|
||||
$data['payment']['reference_number'] = $paymentReference;
|
||||
|
||||
}
|
||||
$params3 = json_encode($data);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/orders/" . $orderId,
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/orders/" . $orderId,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1454,7 +1483,7 @@ function editOrderStatus($orderId, $status, $currentStatus, $trackingNumber, $co
|
|||
|
||||
function deleteOrderbyId($id)
|
||||
{
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/orders/$id";
|
||||
$url = "https://" . $_SESSION["data_endpoint"] . "/api/v1/orders/$id";
|
||||
$curl = curl_init();
|
||||
curl_setopt($curl, CURLOPT_URL, $url);
|
||||
curl_setopt_array($curl, array(
|
||||
|
@ -1508,7 +1537,7 @@ function addProduct(
|
|||
);
|
||||
curl_setopt($curl, CURLOPT_POSTFIELDS, $array);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/products",
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/products",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1573,9 +1602,9 @@ function editProduct(
|
|||
'shipping_fee' => $productSf,
|
||||
'status' => $productStatus,
|
||||
'promo' => array(
|
||||
'next-day-delivery' => $ndd ,
|
||||
'same-day-delivery' => $sdd ,
|
||||
'free-shipping' => $freeSf
|
||||
'next-day-delivery' => $ndd,
|
||||
'same-day-delivery' => $sdd,
|
||||
'free-shipping' => $freeSf
|
||||
),
|
||||
'price_matrix' => array(
|
||||
$priceMatrix
|
||||
|
@ -1618,7 +1647,7 @@ function editProduct(
|
|||
$params3 = json_encode($data);
|
||||
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/products/" . $productId,
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/products/" . $productId,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1721,7 +1750,7 @@ function addVendor(
|
|||
$params2 = json_encode($data);
|
||||
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/vendors",
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/vendors",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1746,7 +1775,7 @@ function addVendor(
|
|||
function getUsers()
|
||||
{
|
||||
$curl = curl_init();
|
||||
$url = "https://".$_SESSION["data_endpoint"]."/api/v1/users";
|
||||
$url = "https://" . $_SESSION["data_endpoint"] . "/api/v1/users";
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => $url,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
|
@ -1813,7 +1842,7 @@ function editUsers($id, $username, $userType, $token)
|
|||
$jsonPayload = json_encode($data); // Convert the array to JSON format
|
||||
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://".$_SESSION["data_endpoint"]."/api/v1/users/" . $id,
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/users/" . $id,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
|
@ -1834,4 +1863,120 @@ function editUsers($id, $username, $userType, $token)
|
|||
echo $response;
|
||||
|
||||
return $response;
|
||||
}
|
||||
}
|
||||
|
||||
function getAllPayout($token)
|
||||
{
|
||||
$curl = curl_init();
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/payouts",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
CURLOPT_TIMEOUT => 0,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'GET',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'X-Api-Key: {{apiKey}}',
|
||||
'Content-Type: application/json',
|
||||
'Authorization: Bearer ' . $token
|
||||
),
|
||||
));
|
||||
$response = curl_exec($curl);
|
||||
curl_close($curl);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
function getPayout($token, $id)
|
||||
{
|
||||
$curl = curl_init();
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/payouts/{$id}",
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
CURLOPT_TIMEOUT => 0,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'GET',
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'X-Api-Key: {{apiKey}}',
|
||||
'Content-Type: application/json',
|
||||
'Authorization: Bearer ' . $token
|
||||
),
|
||||
));
|
||||
$response = curl_exec($curl);
|
||||
curl_close($curl);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
function editOrderPayoutStatus($token, $orderIds)
|
||||
{
|
||||
$curl = curl_init();
|
||||
foreach ($orderIds as $orderId) {
|
||||
$data = array(
|
||||
'payout_status' => array(
|
||||
'payout_id' => $orderId,
|
||||
'status' => 'Deposited'
|
||||
)
|
||||
);
|
||||
|
||||
$params3 = json_encode($data);
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/orders/" . $orderId,
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
CURLOPT_TIMEOUT => 0,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'PATCH',
|
||||
CURLOPT_POSTFIELDS => $params3,
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'Accept: application/json',
|
||||
'Content-Type: application/json',
|
||||
'Authorization: Bearer ' . $token
|
||||
),
|
||||
));
|
||||
$response = curl_exec($curl);
|
||||
}
|
||||
curl_close($curl);
|
||||
|
||||
}
|
||||
|
||||
|
||||
function updatePayout($token, $payoutId)
|
||||
{
|
||||
$curl = curl_init();
|
||||
$data = array(
|
||||
'status' => "Deposited",
|
||||
);
|
||||
|
||||
$params = json_encode($data);
|
||||
|
||||
curl_setopt_array($curl, array(
|
||||
CURLOPT_URL => "https://" . $_SESSION["data_endpoint"] . "/api/v1/payouts/" . $payoutId, // Corrected URL to include $payoutId
|
||||
CURLOPT_RETURNTRANSFER => true,
|
||||
CURLOPT_ENCODING => '',
|
||||
CURLOPT_MAXREDIRS => 10,
|
||||
CURLOPT_TIMEOUT => 0,
|
||||
CURLOPT_FOLLOWLOCATION => true,
|
||||
CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
|
||||
CURLOPT_CUSTOMREQUEST => 'PATCH',
|
||||
CURLOPT_POSTFIELDS => $params, // Send the payload data
|
||||
CURLOPT_HTTPHEADER => array(
|
||||
'X-Api-Key: {{apiKey}}', // Make sure to replace {{apiKey}} with an actual API key if needed
|
||||
'Content-Type: application/json',
|
||||
'Authorization: Bearer ' . $token
|
||||
),
|
||||
));
|
||||
|
||||
$response = curl_exec($curl);
|
||||
curl_close($curl);
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
|
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 {
|
||||
|
|
|
@ -381,8 +381,8 @@ if (isset($_GET['id'])) {
|
|||
<?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 '<span id="productNewPrice" class="new-price">' . $product_details['sale_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>';
|
||||
} else {
|
||||
|
@ -510,7 +510,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 {
|
||||
|
|
|
@ -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
|
||||
}
|
||||
?>
|
||||
|
|
234
user-history.php
234
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>
|
||||
|
@ -751,7 +812,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 +943,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 +966,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 +994,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 +1018,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 +1042,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 +1066,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">
|
||||
|
|
|
@ -0,0 +1,704 @@
|
|||
<?php
|
||||
include "functions.php";
|
||||
|
||||
$_SESSION["url"] = $_SERVER['REQUEST_URI'];
|
||||
if ($_SESSION["userId"] <> "") {
|
||||
$_SESSION["isLoggedIn"] = true;
|
||||
$vendorLoginId = searchVendorbyLoginId($_SESSION["userId"]);
|
||||
$vendorLoginIdjson = json_decode($vendorLoginId, true);
|
||||
if (isset($vendorLoginIdjson['results'][0])) {
|
||||
$vendorData = $vendorLoginIdjson['results'][0];
|
||||
$vendorId = $vendorData['_id'];
|
||||
$_SESSION["LoggedInVendorId"] = $vendorId;
|
||||
}
|
||||
} 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')) {
|
||||
$vendorOrders = [];
|
||||
} else {
|
||||
echo "Unknown type or no 'message' property found.";
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
|
||||
|
||||
<title>oBanana B2B - Elevate Your Business</title>
|
||||
<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" />
|
||||
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
|
||||
|
||||
<!-- css Icon Font -->
|
||||
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
|
||||
|
||||
<!-- css All Plugins Files -->
|
||||
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
|
||||
<link rel="stylesheet" href="assets/css/plugins/swiper-bundle.min.css" />
|
||||
<link rel="stylesheet" href="assets/css/plugins/jquery-ui.min.css" />
|
||||
<link rel="stylesheet" href="assets/css/plugins/countdownTimer.css" />
|
||||
<link rel="stylesheet" href="assets/css/plugins/slick.min.css" />
|
||||
<link rel="stylesheet" href="assets/css/plugins/bootstrap.css" />
|
||||
|
||||
<!-- Main Style -->
|
||||
<link rel="stylesheet" href="assets/css/style.css" />
|
||||
<link rel="stylesheet" href="assets/css/style2.css" />
|
||||
<link rel="stylesheet" href="assets/css/responsive.css" />
|
||||
|
||||
<!-- Background css -->
|
||||
<link rel="stylesheet" id="bg-switcher-css" href="assets/css/backgrounds/bg-4.css">
|
||||
<style>
|
||||
.tab.active {
|
||||
background-color: #ffaa00;
|
||||
/* Set your desired background color for the active tab */
|
||||
color: #ffffff;
|
||||
/* Set your desired text color for the active tab */
|
||||
|
||||
}
|
||||
</style>
|
||||
<script>
|
||||
function updateCartItemCount() {
|
||||
$.get("cartitems.php?id=<?php echo $_SESSION['customerId']; ?>", function(data, status) {
|
||||
if (data != "") {
|
||||
console.log("Data: " + data + "\nStatus: " + status);
|
||||
document.getElementById("cartItemCount").innerHTML = data;
|
||||
}
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</head>
|
||||
|
||||
<body onload="updateCartItemCount()" class="shop_page">
|
||||
<div id="ec-overlay">
|
||||
<div class="ec-ellipsis">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Header start -->
|
||||
<?php include "header.php" ?>
|
||||
<!-- Header End -->
|
||||
|
||||
<!-- ekka Cart Start -->
|
||||
|
||||
<!-- ekka Cart End -->
|
||||
|
||||
<!-- Ec breadcrumb start -->
|
||||
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="row ec_breadcrumb_inner">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<h2 class="ec-breadcrumb-title">User History</h2>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<!-- ec-breadcrumb-list start -->
|
||||
<ul class="ec-breadcrumb-list">
|
||||
<li class="ec-breadcrumb-item"><a href="index.php">Home</a></li>
|
||||
<li class="ec-breadcrumb-item active">History</li>
|
||||
</ul>
|
||||
<!-- ec-breadcrumb-list end -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Ec breadcrumb end -->
|
||||
<section class="ec-page-content ec-vendor-uploads ec-user-account section-space-p">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<!-- Sidebar Area Start -->
|
||||
<div class="ec-shop-leftside ec-vendor-sidebar col-lg-3 col-md-12">
|
||||
<div class="ec-sidebar-wrap ec-border-box">
|
||||
<!-- Sidebar Category Block -->
|
||||
<div class="ec-sidebar-block">
|
||||
<div class="ec-vendor-block">
|
||||
<!-- 03-12-2024 Stacy added placeholder for vendor banner -->
|
||||
<?php
|
||||
if (!empty($vendorData['vendor_banner'])) { ?>
|
||||
<div class="ec-vendor-block-bg" style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
|
||||
<?php } else { ?>
|
||||
<div class="ec-vendor-block-bg" style="background-color: orange; background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div>
|
||||
<?php } ?>
|
||||
<!-- <div class="ec-vendor-block-bg" style="background-image: url(<?php echo $vendorData['vendor_banner'] ?>) !important;"></div> -->
|
||||
<div class="ec-vendor-block-detail">
|
||||
<?php
|
||||
if (!empty($vendorData['vendor_image'])) { ?>
|
||||
<img class="v-img" src=<?php echo $vendorData['vendor_image'] ?> alt="vendor image">
|
||||
<?php } else { ?>
|
||||
<img class="v-img" src="https://yourteachingmentor.com/wp-content/uploads/2020/12/istockphoto-1223671392-612x612-1.jpg" alt="vendor image">
|
||||
<?php } ?>
|
||||
<!-- <img class="v-img" src=<?php #echo $vendorData['vendor_image'] ?> alt="vendor image"> -->
|
||||
<h5 class="name"><?php echo $vendorData['user_login'] ?></h5>
|
||||
</div>
|
||||
<!-- <div class="ec-vendor-block-items">
|
||||
<!-- <ul>
|
||||
<li><a href="vendor-dashboard.php">Dashboard</a></li>
|
||||
<li><a href="vendor-uploads.php">Upload Product</a></li>
|
||||
<li><a href="vendor-settings.php">Settings (Edit)</a></li>
|
||||
<li><a href="user-refund-history.php">User Refund History</a></li> -->
|
||||
<!-- <li><a href="cart.html">Cart</a></li>
|
||||
<li><a href="checkout.html">Checkout</a></li>
|
||||
<li><a href="track-order.html">Track Order</a></li>
|
||||
<li><a href="user-invoice.html">Invoice</a></li> -->
|
||||
<!-- </ul>
|
||||
</div> -->
|
||||
<?php include "vendor-user-tabs.php" ?>
|
||||
</div>
|
||||
</div>
|
||||
</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>Payments</h5>
|
||||
</div>
|
||||
<div class="ec-vendor-card-body">
|
||||
<div class="ec-vendor-card-table">
|
||||
|
||||
<div id="payments" class="tab-content active">
|
||||
|
||||
<!-- Gelo added vendor payments tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Payment Method</th>
|
||||
<th scope="col">Amount</th>
|
||||
<th scope="col">Status</th>
|
||||
<th scope="col">Description</th>
|
||||
<th scope="col">Date Created</th>
|
||||
<th scope="col">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
?>
|
||||
<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> </tr>
|
||||
<?php
|
||||
// }
|
||||
// }
|
||||
?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
var sessionToken = '<?php echo isset($_SESSION["token"]) ? $_SESSION["token"] : ""; ?>';
|
||||
var email = '<?php echo isset($_SESSION["email"]) ? $_SESSION["email"] : ""; ?>';
|
||||
var password = '<?php echo isset($_SESSION["password"]) ? $_SESSION["password"] : ""; ?>';
|
||||
|
||||
function login(username, password, callback) {
|
||||
fetch("https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/login", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json",
|
||||
"X-Api-Key": "{{apiKey}}"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
username: username,
|
||||
password: password
|
||||
})
|
||||
})
|
||||
.then(response => {
|
||||
if (response.ok) {
|
||||
return response.json();
|
||||
} else {
|
||||
throw new Error("Unable to login");
|
||||
}
|
||||
})
|
||||
.then(data => {
|
||||
// Update the session token on the server side
|
||||
fetch("update-token-session.php", {
|
||||
method: "POST",
|
||||
headers: {
|
||||
"Content-Type": "application/json"
|
||||
},
|
||||
body: JSON.stringify({
|
||||
token: data.token
|
||||
})
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(result => {
|
||||
if (result.status === 'success') {
|
||||
// Update the session token in the client-side variable
|
||||
sessionToken = data.token;
|
||||
console.log("New Token:", sessionToken);
|
||||
callback();
|
||||
} else {
|
||||
throw new Error("Unable to update session token");
|
||||
}
|
||||
});
|
||||
})
|
||||
.catch(error => {
|
||||
console.error("Error:", error.message);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
function updateRefundShipStatus(orderId, image, reason) {
|
||||
login(email, password, function() {
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer ' + sessionToken,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
return_order: {
|
||||
reason: reason,
|
||||
image: image,
|
||||
status: 'To Ship',
|
||||
}
|
||||
}),
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
// Assuming the server responds with a JSON object indicating success or failure
|
||||
if (data && data !== "") {
|
||||
// Update the status in the table without reloading the page
|
||||
// document.querySelector(`[data-order-id="${orderId}"] .order-status`).innerText = 'COMPLETED';
|
||||
// location.reload();
|
||||
|
||||
} else {
|
||||
alert('Failed to update order status');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
alert('An error occurred while updating order status');
|
||||
});
|
||||
})
|
||||
}
|
||||
|
||||
function updateRefundReceiveStatus(orderId, image, reason) {
|
||||
login(email, password, function() {
|
||||
fetch(`https://<?php echo $_SESSION["data_endpoint"]; ?>/api/v1/orders/${orderId}`, {
|
||||
method: 'PATCH',
|
||||
headers: {
|
||||
'Content-Type': 'application/json',
|
||||
'Authorization': 'Bearer ' + sessionToken,
|
||||
},
|
||||
body: JSON.stringify({
|
||||
return_order: {
|
||||
reason: reason,
|
||||
image: image,
|
||||
status: 'To Refund',
|
||||
}
|
||||
}),
|
||||
})
|
||||
.then(response => response.json())
|
||||
.then(data => {
|
||||
// Assuming the server responds with a JSON object indicating success or failure
|
||||
if (data && data !== "") {
|
||||
// Update the status in the table without reloading the page
|
||||
// document.querySelector(`[data-order-id="${orderId}"] .order-status`).innerText = 'COMPLETED';
|
||||
location.reload();
|
||||
|
||||
} else {
|
||||
alert('Failed to update order status');
|
||||
}
|
||||
})
|
||||
.catch(error => {
|
||||
console.error('Error:', error);
|
||||
alert('An error occurred while updating order status');
|
||||
});
|
||||
})
|
||||
|
||||
}
|
||||
|
||||
|
||||
//S 03-06-2024 Stacy added upload function
|
||||
function addProduct() {
|
||||
console.log("Session Token:", sessionToken);
|
||||
login(email, password, function() {
|
||||
// Removed the call to updateSessionToken
|
||||
window.open("vendor-uploads-add-product-action.php", "_self");
|
||||
});
|
||||
}
|
||||
</script>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<!--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>
|
||||
<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 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>
|
||||
|
||||
|
||||
</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>
|
||||
<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>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Footer Start -->
|
||||
<?php include "footer.php" ?>
|
||||
|
||||
<!-- Footer Area End -->
|
||||
|
||||
<!-- Footer navigation panel for responsive display -->
|
||||
<div class="ec-nav-toolbar">
|
||||
<div class="container">
|
||||
<div class="ec-nav-panel">
|
||||
<div class="ec-nav-panel-icons">
|
||||
<a href="#ec-mobile-menu" class="navbar-toggler-btn ec-header-btn ec-side-toggle"><i class="fi-rr-menu-burger"></i></a>
|
||||
</div>
|
||||
<div class="ec-nav-panel-icons">
|
||||
<a href="#ec-side-cart" class="toggle-cart ec-header-btn ec-side-toggle"><i class="fi-rr-shopping-bag"></i><span class="ec-cart-noti ec-header-count cart-count-lable">3</span></a>
|
||||
</div>
|
||||
<div class="ec-nav-panel-icons">
|
||||
<a href="index.php" class="ec-header-btn"><i class="fi-rr-home"></i></a>
|
||||
</div>
|
||||
<div class="ec-nav-panel-icons">
|
||||
<a href="wishlist.html" class="ec-header-btn"><i class="fi-rr-heart"></i><span class="ec-cart-noti">4</span></a>
|
||||
</div>
|
||||
<div class="ec-nav-panel-icons">
|
||||
<a href="login.php" class="ec-header-btn"><i class="fi-rr-user"></i></a>
|
||||
</div>
|
||||
|
||||
</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">
|
||||
<a href="#ec-side-cart" class="ec-header-btn ec-side-toggle">
|
||||
<div class="header-icon"><i class="fi-rr-shopping-basket"></i>
|
||||
</div>
|
||||
<span class="ec-cart-count cart-count-lable">3</span>
|
||||
</a>
|
||||
</div>
|
||||
<!-- Cart Floating Button end -->
|
||||
|
||||
<!-- Whatsapp -->
|
||||
<div class="ec-style ec-right-bottom">
|
||||
<!-- Start Floating Panel Container -->
|
||||
<div class="ec-panel">
|
||||
<!-- Panel Header -->
|
||||
<div class="ec-header">
|
||||
<strong>Need Help?</strong>
|
||||
<p>Chat with us on WhatsApp</p>
|
||||
</div>
|
||||
<!-- Panel Content -->
|
||||
<div class="ec-body">
|
||||
<ul>
|
||||
<!-- Start Single Contact List -->
|
||||
<li>
|
||||
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
|
||||
<div class="d-flex bd-highlight">
|
||||
<!-- Profile Picture -->
|
||||
<div class="ec-img-cont">
|
||||
<img src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
|
||||
<span class="ec-status-icon"></span>
|
||||
</div>
|
||||
<!-- Display Name & Last Seen -->
|
||||
<div class="ec-user-info">
|
||||
<span>Sahar Darya</span>
|
||||
<p>Sahar left 7 mins ago</p>
|
||||
</div>
|
||||
<!-- Chat iCon -->
|
||||
<div class="ec-chat-icon">
|
||||
<i class="fa fa-whatsapp"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<!--/ End Single Contact List -->
|
||||
<!-- Start Single Contact List -->
|
||||
<li>
|
||||
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
|
||||
<div class="d-flex bd-highlight">
|
||||
<!-- Profile Picture -->
|
||||
<div class="ec-img-cont">
|
||||
<img src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
|
||||
<span class="ec-status-icon ec-online"></span>
|
||||
</div>
|
||||
<!-- Display Name & Last Seen -->
|
||||
<div class="ec-user-info">
|
||||
<span>Yolduz Rafi</span>
|
||||
<p>Yolduz is online</p>
|
||||
</div>
|
||||
<!-- Chat iCon -->
|
||||
<div class="ec-chat-icon">
|
||||
<i class="fa fa-whatsapp"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<!--/ End Single Contact List -->
|
||||
<!-- Start Single Contact List -->
|
||||
<li>
|
||||
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
|
||||
<div class="d-flex bd-highlight">
|
||||
<!-- Profile Picture -->
|
||||
<div class="ec-img-cont">
|
||||
<img src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
|
||||
<span class="ec-status-icon ec-offline"></span>
|
||||
</div>
|
||||
<!-- Display Name & Last Seen -->
|
||||
<div class="ec-user-info">
|
||||
<span>Nargis Hawa</span>
|
||||
<p>Nargis left 30 mins ago</p>
|
||||
</div>
|
||||
<!-- Chat iCon -->
|
||||
<div class="ec-chat-icon">
|
||||
<i class="fa fa-whatsapp"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<!--/ End Single Contact List -->
|
||||
<!-- Start Single Contact List -->
|
||||
<li>
|
||||
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
|
||||
<div class="d-flex bd-highlight">
|
||||
<!-- Profile Picture -->
|
||||
<div class="ec-img-cont">
|
||||
<img src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
|
||||
<span class="ec-status-icon ec-offline"></span>
|
||||
</div>
|
||||
<!-- Display Name & Last Seen -->
|
||||
<div class="ec-user-info">
|
||||
<span>Khadija Mehr</span>
|
||||
<p>Khadija left 50 mins ago</p>
|
||||
</div>
|
||||
<!-- Chat iCon -->
|
||||
<div class="ec-chat-icon">
|
||||
<i class="fa fa-whatsapp"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<!--/ End Single Contact List -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ End Floating Panel Container -->
|
||||
<!-- Start Right Floating Button-->
|
||||
<div class="ec-right-bottom">
|
||||
<div class="ec-box">
|
||||
<div class="ec-button rotateBackward">
|
||||
<img class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ End Right Floating Button-->
|
||||
</div>
|
||||
<!-- Whatsapp end -->
|
||||
|
||||
<!-- Feature tools -->
|
||||
<div class="ec-tools-sidebar-overlay"></div>
|
||||
<div class="ec-tools-sidebar">
|
||||
<div class="tool-title">
|
||||
<h3>Features</h3>
|
||||
</div>
|
||||
<a href="#" class="ec-tools-sidebar-toggle in-out">
|
||||
<img alt="icon" src="assets/images/common/settings.png" />
|
||||
</a>
|
||||
<div class="ec-tools-detail">
|
||||
<div class="ec-tools-sidebar-content ec-change-color ec-color-desc">
|
||||
<h3>Color Scheme</h3>
|
||||
<ul class="bg-panel">
|
||||
<li class="active" data-color="01"><a href="#" class="colorcode1"></a></li>
|
||||
<li data-color="02"><a href="#" class="colorcode2"></a></li>
|
||||
<li data-color="03"><a href="#" class="colorcode3"></a></li>
|
||||
<li data-color="04"><a href="#" class="colorcode4"></a></li>
|
||||
<li data-color="05"><a href="#" class="colorcode5"></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="ec-tools-sidebar-content">
|
||||
<h3>Backgrounds</h3>
|
||||
<ul class="bg-panel">
|
||||
<li class="bg"><a class="back-bg-1" id="bg-1">Background-1</a></li>
|
||||
<li class="bg"><a class="back-bg-2" id="bg-2">Background-2</a></li>
|
||||
<li class="bg"><a class="back-bg-3" id="bg-3">Background-3</a></li>
|
||||
<li class="bg"><a class="back-bg-4" id="bg-4">Default</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="ec-tools-sidebar-content">
|
||||
<h3>Full Screen mode</h3>
|
||||
<div class="ec-fullscreen-mode">
|
||||
<div class="ec-fullscreen-switch">
|
||||
<div class="ec-fullscreen-btn">Mode</div>
|
||||
<div class="ec-fullscreen-on">On</div>
|
||||
<div class="ec-fullscreen-off">Off</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-tools-sidebar-content">
|
||||
<h3>Dark mode</h3>
|
||||
<div class="ec-change-mode">
|
||||
<div class="ec-mode-switch">
|
||||
<div class="ec-mode-btn">Mode</div>
|
||||
<div class="ec-mode-on">On</div>
|
||||
<div class="ec-mode-off">Off</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-tools-sidebar-content">
|
||||
<h3>RTL mode</h3>
|
||||
<div class="ec-change-rtl">
|
||||
<div class="ec-rtl-switch">
|
||||
<div class="ec-rtl-btn">Rtl</div>
|
||||
<div class="ec-rtl-on">On</div>
|
||||
<div class="ec-rtl-off">Off</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-tools-sidebar-content">
|
||||
<h3>Clear local storage</h3>
|
||||
<a class="clear-cach" href="javascript:void(0)">Clear Cache & Default</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Feature tools end -->
|
||||
|
||||
<!-- Vendor JS -->
|
||||
<script src="assets/js/vendor/jquery-3.5.1.min.js"></script>
|
||||
<script src="assets/js/vendor/popper.min.js"></script>
|
||||
<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>
|
||||
<script src="assets/js/plugins/countdownTimer.min.js"></script>
|
||||
<script src="assets/js/plugins/scrollup.js"></script>
|
||||
<script src="assets/js/plugins/jquery.zoom.min.js"></script>
|
||||
<script src="assets/js/plugins/slick.min.js"></script>
|
||||
<script src="assets/js/plugins/infiniteslidev2.js"></script>
|
||||
<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>
|
||||
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
|
||||
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))
|
||||
</script>
|
||||
<!-- Main Js -->
|
||||
<script src="assets/js/vendor/index.js"></script>
|
||||
<script src="assets/js/main.js"></script>
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -0,0 +1,640 @@
|
|||
<?php
|
||||
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");
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge" />
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0">
|
||||
|
||||
<title>oBanana B2B - Elevate Your Business</title>
|
||||
<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" />
|
||||
<meta name="msapplication-TileImage" content="assets/images/favicon/favicon.png" />
|
||||
|
||||
<!-- css Icon Font -->
|
||||
<link rel="stylesheet" href="assets/css/vendor/ecicons.min.css" />
|
||||
|
||||
<!-- css All Plugins Files -->
|
||||
<link rel="stylesheet" href="assets/css/plugins/animate.css" />
|
||||
<link rel="stylesheet" href="assets/css/plugins/swiper-bundle.min.css" />
|
||||
<link rel="stylesheet" href="assets/css/plugins/jquery-ui.min.css" />
|
||||
<link rel="stylesheet" href="assets/css/plugins/countdownTimer.css" />
|
||||
<link rel="stylesheet" href="assets/css/plugins/slick.min.css" />
|
||||
<link rel="stylesheet" href="assets/css/plugins/bootstrap.css" />
|
||||
|
||||
<!-- Main Style -->
|
||||
<link rel="stylesheet" href="assets/css/style.css" />
|
||||
<link rel="stylesheet" href="assets/css/style2.css" />
|
||||
<link rel="stylesheet" href="assets/css/responsive.css" />
|
||||
|
||||
<!-- 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>
|
||||
</head>
|
||||
|
||||
<body class="shop_page">
|
||||
<div id="ec-overlay">
|
||||
<div class="ec-ellipsis">
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
<div></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Header start -->
|
||||
<?php include "header.php" ?>
|
||||
<!-- Header End -->
|
||||
|
||||
<!-- ekka Cart Start -->
|
||||
|
||||
<!-- ekka Cart End -->
|
||||
|
||||
<!-- Category Sidebar start -->
|
||||
<?php include "category-slider.php" ?>
|
||||
|
||||
<!-- Ec breadcrumb start -->
|
||||
<div class="sticky-header-next-sec ec-breadcrumb section-space-mb">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<div class="col-12">
|
||||
<div class="row ec_breadcrumb_inner">
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<h2 class="ec-breadcrumb-title">Vendor Settings</h2>
|
||||
</div>
|
||||
<div class="col-md-6 col-sm-12">
|
||||
<!-- ec-breadcrumb-list start -->
|
||||
<ul class="ec-breadcrumb-list">
|
||||
<li class="ec-breadcrumb-item"><a href="index.php">Home</a></li>
|
||||
<li class="ec-breadcrumb-item active">Settings</li>
|
||||
</ul>
|
||||
<!-- ec-breadcrumb-list end -->
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Ec breadcrumb end -->
|
||||
|
||||
<!-- Vendor setting section -->
|
||||
<section class="ec-page-content ec-vendor-uploads section-space-p">
|
||||
<div class="container">
|
||||
<div class="row">
|
||||
<!-- Sidebar Area Start -->
|
||||
<div class="ec-shop-leftside ec-vendor-sidebar col-lg-3 col-md-12">
|
||||
<div class="ec-sidebar-wrap ec-border-box">
|
||||
<!-- Sidebar Category Block -->
|
||||
<div class="ec-sidebar-block">
|
||||
<div class="ec-vendor-block">
|
||||
<!-- <div class="ec-vendor-block-items">
|
||||
<ul>
|
||||
<li><a href="vendor-dashboard.php">Dashboard</a></li>
|
||||
<li><a href="vendor-profile.html">Public Profile</a></li>
|
||||
<li><a href="vendor-uploads.html">Uploads</a></li>
|
||||
<li><a href="vendor-uploads.php">Uploads</a></li>
|
||||
<li><a href="#">Track Shipping</a></li>
|
||||
<li><a href="vendor-settings.php">Settings (Edit)</a></li>
|
||||
<li><a href="vendor-dashboard.php">Dashboard</a></li>
|
||||
<li><a href="vendor-uploads-add-product-action.php">Upload Product</a></li>
|
||||
<li><a href="vendor-settings.php">Settings (Edit)</a></li>
|
||||
</ul>
|
||||
</div> -->
|
||||
<?php include "vendor-user-tabs.php" ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-shop-rightside col-lg-9 col-md-12">
|
||||
<div class="ec-vendor-dashboard-card ec-vendor-setting-card">
|
||||
<div class="ec-vendor-card-body">
|
||||
<div class="row">
|
||||
|
||||
<div class="col-md-4 mb-5">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h5 class="panel-title"><strong>Upcoming Payout</strong></h5>
|
||||
</div>
|
||||
<div class="panel-body ">
|
||||
<div class="row">
|
||||
<h4 style="color: #444;">
|
||||
<div class="d-flex align-items-center">
|
||||
<strong>
|
||||
₱ 0.00
|
||||
</strong>
|
||||
</div>
|
||||
</h4>
|
||||
<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 class="text-sm">
|
||||
Receipient: Philippine National Bank (PNB) Account ending in 6685
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 mb-5">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h5 class="panel-title"><strong>Payout Generation Schedule</strong></h5>
|
||||
</div>
|
||||
<div class="panel-body ">
|
||||
<div class="row">
|
||||
<h4 style="color: #444;">
|
||||
<div class="d-flex align-items-center">
|
||||
<i class="fi-rs-calendar mt-1 mr-3 "></i>
|
||||
<strong>
|
||||
Weekly
|
||||
</strong>
|
||||
</div>
|
||||
</h4>
|
||||
<div class="mt-3">
|
||||
<h6>
|
||||
<strong class="text-primary ">Every Tuesday</strong>
|
||||
</h6>
|
||||
</div>
|
||||
<div class="text-sm">
|
||||
Payouts that will fall on holiday will be processed the next banking day
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 mb-5">
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">
|
||||
<h5 class="panel-title"><strong>Next Payout</strong></h5>
|
||||
</div>
|
||||
<div class="panel-body ">
|
||||
<div class="row">
|
||||
<h4 style="color: #444;">
|
||||
<div class="d-flex align-items-center">
|
||||
<strong>
|
||||
₱ 0.00
|
||||
</strong>
|
||||
</div>
|
||||
</h4>
|
||||
<div class="text-sm mt-3">
|
||||
Payout Generation: Tue, Mar 25, 2024
|
||||
</div>
|
||||
<div class="text-sm">
|
||||
Receive Payout on or before: Wed, Mar 26, 2024
|
||||
</div>
|
||||
<div class="text-sm">
|
||||
Receipient: Philippine National Bank (PNB) Account ending in 6685
|
||||
</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">
|
||||
<thead>
|
||||
<tr>
|
||||
<th scope="col">Amount</th>
|
||||
<th scope="col">Bank</th>
|
||||
<th scope="col">Account Number</th>
|
||||
<th scope="col">Payout Generation</th>
|
||||
<th scope="col">Status</th>
|
||||
<th scope="col">Action</th>
|
||||
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?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>";
|
||||
}
|
||||
}
|
||||
?>
|
||||
<!-- <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>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</section>
|
||||
<div class="modal fade" id="payoutModal" tabindex="-1" aria-labelledby="payoutModalLabel" 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>
|
||||
<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>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-primary" data-bs-dismiss="modal">Confirm</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- End Vendor setting section -->
|
||||
|
||||
<!-- Footer Start -->
|
||||
<?php include "footer.php" ?>
|
||||
<!-- Footer Area End -->
|
||||
<!-- Start Modal Copy-->
|
||||
<!-- Modal -->
|
||||
|
||||
<!-- 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">
|
||||
<a href="#ec-side-cart" class="ec-header-btn ec-side-toggle">
|
||||
<div class="header-icon"><i class="fi-rr-shopping-basket"></i>
|
||||
</div>
|
||||
<span class="ec-cart-count cart-count-lable">3</span>
|
||||
</a>
|
||||
</div>
|
||||
<!-- Cart Floating Button end -->
|
||||
|
||||
<!-- Whatsapp -->
|
||||
<div class="ec-style ec-right-bottom">
|
||||
<!-- Start Floating Panel Container -->
|
||||
<div class="ec-panel">
|
||||
<!-- Panel Header -->
|
||||
<div class="ec-header">
|
||||
<strong>Need Help?</strong>
|
||||
<p>Chat with us on WhatsApp</p>
|
||||
</div>
|
||||
<!-- Panel Content -->
|
||||
<div class="ec-body">
|
||||
<ul>
|
||||
<!-- Start Single Contact List -->
|
||||
<li>
|
||||
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
|
||||
<div class="d-flex bd-highlight">
|
||||
<!-- Profile Picture -->
|
||||
<div class="ec-img-cont">
|
||||
<img src="assets/images/whatsapp/profile_01.jpg" class="ec-user-img" alt="Profile image">
|
||||
<span class="ec-status-icon"></span>
|
||||
</div>
|
||||
<!-- Display Name & Last Seen -->
|
||||
<div class="ec-user-info">
|
||||
<span>Sahar Darya</span>
|
||||
<p>Sahar left 7 mins ago</p>
|
||||
</div>
|
||||
<!-- Chat iCon -->
|
||||
<div class="ec-chat-icon">
|
||||
<i class="fa fa-whatsapp"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<!--/ End Single Contact List -->
|
||||
<!-- Start Single Contact List -->
|
||||
<li>
|
||||
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
|
||||
<div class="d-flex bd-highlight">
|
||||
<!-- Profile Picture -->
|
||||
<div class="ec-img-cont">
|
||||
<img src="assets/images/whatsapp/profile_02.jpg" class="ec-user-img" alt="Profile image">
|
||||
<span class="ec-status-icon ec-online"></span>
|
||||
</div>
|
||||
<!-- Display Name & Last Seen -->
|
||||
<div class="ec-user-info">
|
||||
<span>Yolduz Rafi</span>
|
||||
<p>Yolduz is online</p>
|
||||
</div>
|
||||
<!-- Chat iCon -->
|
||||
<div class="ec-chat-icon">
|
||||
<i class="fa fa-whatsapp"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<!--/ End Single Contact List -->
|
||||
<!-- Start Single Contact List -->
|
||||
<li>
|
||||
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
|
||||
<div class="d-flex bd-highlight">
|
||||
<!-- Profile Picture -->
|
||||
<div class="ec-img-cont">
|
||||
<img src="assets/images/whatsapp/profile_03.jpg" class="ec-user-img" alt="Profile image">
|
||||
<span class="ec-status-icon ec-offline"></span>
|
||||
</div>
|
||||
<!-- Display Name & Last Seen -->
|
||||
<div class="ec-user-info">
|
||||
<span>Nargis Hawa</span>
|
||||
<p>Nargis left 30 mins ago</p>
|
||||
</div>
|
||||
<!-- Chat iCon -->
|
||||
<div class="ec-chat-icon">
|
||||
<i class="fa fa-whatsapp"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<!--/ End Single Contact List -->
|
||||
<!-- Start Single Contact List -->
|
||||
<li>
|
||||
<a class="ec-list" data-number="918866774266" data-message="Please help me! I have got wrong product - ORDER ID is : #654321485">
|
||||
<div class="d-flex bd-highlight">
|
||||
<!-- Profile Picture -->
|
||||
<div class="ec-img-cont">
|
||||
<img src="assets/images/whatsapp/profile_04.jpg" class="ec-user-img" alt="Profile image">
|
||||
<span class="ec-status-icon ec-offline"></span>
|
||||
</div>
|
||||
<!-- Display Name & Last Seen -->
|
||||
<div class="ec-user-info">
|
||||
<span>Khadija Mehr</span>
|
||||
<p>Khadija left 50 mins ago</p>
|
||||
</div>
|
||||
<!-- Chat iCon -->
|
||||
<div class="ec-chat-icon">
|
||||
<i class="fa fa-whatsapp"></i>
|
||||
</div>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
<!--/ End Single Contact List -->
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ End Floating Panel Container -->
|
||||
<!-- Start Right Floating Button-->
|
||||
<div class="ec-right-bottom">
|
||||
<div class="ec-box">
|
||||
<div class="ec-button rotateBackward">
|
||||
<img class="whatsapp" src="assets/images/common/whatsapp.png" alt="whatsapp icon" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!--/ End Right Floating Button-->
|
||||
</div>
|
||||
<!-- Whatsapp end -->
|
||||
|
||||
<!-- Feature tools -->
|
||||
<div class="ec-tools-sidebar-overlay"></div>
|
||||
<div class="ec-tools-sidebar">
|
||||
<div class="tool-title">
|
||||
<h3>Features</h3>
|
||||
</div>
|
||||
<a href="#" class="ec-tools-sidebar-toggle in-out">
|
||||
<img alt="icon" src="assets/images/common/settings.png" />
|
||||
</a>
|
||||
<div class="ec-tools-detail">
|
||||
<div class="ec-tools-sidebar-content ec-change-color ec-color-desc">
|
||||
<h3>Color Scheme</h3>
|
||||
<ul class="bg-panel">
|
||||
<li class="active" data-color="01"><a href="#" class="colorcode1"></a></li>
|
||||
<li data-color="02"><a href="#" class="colorcode2"></a></li>
|
||||
<li data-color="03"><a href="#" class="colorcode3"></a></li>
|
||||
<li data-color="04"><a href="#" class="colorcode4"></a></li>
|
||||
<li data-color="05"><a href="#" class="colorcode5"></a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="ec-tools-sidebar-content">
|
||||
<h3>Backgrounds</h3>
|
||||
<ul class="bg-panel">
|
||||
<li class="bg"><a class="back-bg-1" id="bg-1">Background-1</a></li>
|
||||
<li class="bg"><a class="back-bg-2" id="bg-2">Background-2</a></li>
|
||||
<li class="bg"><a class="back-bg-3" id="bg-3">Background-3</a></li>
|
||||
<li class="bg"><a class="back-bg-4" id="bg-4">Default</a></li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="ec-tools-sidebar-content">
|
||||
<h3>Full Screen mode</h3>
|
||||
<div class="ec-fullscreen-mode">
|
||||
<div class="ec-fullscreen-switch">
|
||||
<div class="ec-fullscreen-btn">Mode</div>
|
||||
<div class="ec-fullscreen-on">On</div>
|
||||
<div class="ec-fullscreen-off">Off</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-tools-sidebar-content">
|
||||
<h3>Dark mode</h3>
|
||||
<div class="ec-change-mode">
|
||||
<div class="ec-mode-switch">
|
||||
<div class="ec-mode-btn">Mode</div>
|
||||
<div class="ec-mode-on">On</div>
|
||||
<div class="ec-mode-off">Off</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-tools-sidebar-content">
|
||||
<h3>RTL mode</h3>
|
||||
<div class="ec-change-rtl">
|
||||
<div class="ec-rtl-switch">
|
||||
<div class="ec-rtl-btn">Rtl</div>
|
||||
<div class="ec-rtl-on">On</div>
|
||||
<div class="ec-rtl-off">Off</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="ec-tools-sidebar-content">
|
||||
<h3>Clear local storage</h3>
|
||||
<a class="clear-cach" href="javascript:void(0)">Clear Cache & Default</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Feature tools end -->
|
||||
|
||||
<!-- Vendor JS -->
|
||||
<!-- <script src="assets/js/vendor/jquery-3.5.1.min.js"></script> -->
|
||||
<script src="assets/js/vendor/popper.min.js"></script>
|
||||
<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>
|
||||
<script src="assets/js/plugins/countdownTimer.min.js"></script>
|
||||
<script src="assets/js/plugins/scrollup.js"></script>
|
||||
<script src="assets/js/plugins/jquery.zoom.min.js"></script>
|
||||
<script src="assets/js/plugins/slick.min.js"></script>
|
||||
<script src="assets/js/plugins/infiniteslidev2.js"></script>
|
||||
<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>
|
||||
const tooltipTriggerList = document.querySelectorAll('[data-bs-toggle="tooltip"]')
|
||||
const tooltipList = [...tooltipTriggerList].map(tooltipTriggerEl => new bootstrap.Tooltip(tooltipTriggerEl))
|
||||
</script>
|
||||
|
||||
<!-- Main Js -->
|
||||
<script src="assets/js/vendor/index.js"></script>
|
||||
<script src="assets/js/main.js"></script>
|
||||
|
||||
|
||||
</body>
|
||||
|
||||
</html>
|
|
@ -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">
|
||||
|
|
|
@ -1,23 +1,29 @@
|
|||
<!-- 2024-02-12 Stacy created this file -->
|
||||
<?php
|
||||
<?php
|
||||
$current_page = basename($_SERVER['PHP_SELF']);
|
||||
?>
|
||||
|
||||
<div class="ec-vendor-block-items">
|
||||
<ul>
|
||||
<li <?php if ($current_page == 'vendor-dashboard.php') echo 'class="active"'; ?>><a href="vendor-dashboard.php" id="vendor-dashboard-link">Dashboards</a></li>
|
||||
<li <?php if ($current_page == 'vendor-uploads.php') echo 'class="active"'; ?>><a onclick="addProduct();" id="vendor-uploads-link">Uploads</a></li>
|
||||
<li <?php if ($current_page == 'vendor-uploads.php') echo 'class="active"'; ?>><a onclick="addProduct();" id="vendor-uploads-link">Uploads</a></li>
|
||||
<li <?php if ($current_page == 'vendor-settings.php') echo 'class="active"'; ?>><a href="vendor-settings.php" id="vendor-settings-link">Settings (edit)</a></li>
|
||||
<li <?php if ($current_page == 'vendor-refund-history.php') echo 'class="active"'; ?>><a href="vendor-refund-history.php" id="vendor-refund-history-link">Vendor Refund History</a></li>
|
||||
<li <?php if ($current_page == 'vendor-payments.php') echo 'class="active"'; ?>><a href="vendor-payments.php" id="vendor-payments-link">Payments</a></li>
|
||||
<li <?php if ($current_page == 'vendor-payouts.php') echo 'class="active"'; ?>><a href="vendor-payouts.php" id="vendor-payouts-link">Payouts</a></li>
|
||||
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<style>.ec-vendor-block-items ul li.active a {
|
||||
color: white !important; /* Change the text color */
|
||||
background-color: #3474d4; /* Change the background color */
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
<style>
|
||||
.ec-vendor-block-items ul li.active a {
|
||||
color: white !important;
|
||||
/* Change the text color */
|
||||
background-color: #3474d4;
|
||||
/* Change the background color */
|
||||
padding: 10px;
|
||||
border-radius: 10px;
|
||||
}
|
||||
</style>
|
||||
<!-- 2024-02-12 Stacy created this file -->
|
Loading…
Reference in New Issue