Placeholder for Empty List
This commit is contained in:
parent
5448ee0c5e
commit
181b602087
106
user-history.php
106
user-history.php
|
@ -7,6 +7,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
$customer_data = getCustomerbyLoginId($_SESSION["userId"]);
|
||||
} else {
|
||||
$_SESSION["isLoggedIn"] = false;
|
||||
header("location: login.php");
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
@ -323,7 +324,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div id="allOrders" class=" tab-content active">
|
||||
<!-- Content for "all Orders" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead id="allOrdersTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -342,29 +343,23 @@ if ($_SESSION["userId"] <> "") {
|
|||
$customer = $customer_data[0];
|
||||
$orders = getOrderbyCustomerId($customer['_id']);
|
||||
$totalAmount = 0;
|
||||
$orderExist = false;
|
||||
if ($orders) {
|
||||
$order_data = json_decode($orders, true);
|
||||
$_SESSION['cart_items'] = $order_data;
|
||||
foreach ($order_data as $order) {
|
||||
// Ensure that the required data is available before accessing it
|
||||
if (isset($order['status']) && isset($order['items'][0]['product'])) {
|
||||
if (isset($order['status']) && (strtoupper($order['status']) === 'TO PAY') || (strtoupper($order['status']) === 'TO SHIP')
|
||||
|| (strtoupper($order['status']) === 'TO RECEIVE') || (strtoupper($order['status']) === 'COMPLETED')
|
||||
&& isset($order['items'][0]['product'])) {
|
||||
$orderExist = true;
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<?php
|
||||
$jsonorder = json_encode($order);
|
||||
?>
|
||||
<tr class="tableView" data-value=' <?php echo $jsonorder; ?>' data-bs-toggle="modal" data-bs-target="#productDetails">
|
||||
<td>
|
||||
<?php
|
||||
// if (isset($order['items'][0]['product']['product_image'])) {
|
||||
// echo '<img class="prod-img" src="' . $order['items'][0]['product']['product_image'] . '" alt="product"> ';
|
||||
// } else {
|
||||
// echo '<img class="prod-img" src="https://api.obanana.com/images/storage/web_images/1710214273217-no_image.png" alt="product">';
|
||||
// }
|
||||
?>
|
||||
<img class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product">
|
||||
</td>
|
||||
<!-- <img class="prod-img" src="<?php # echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td> -->
|
||||
<td><img class="prod-img" src="<?php echo $order['items'][0]['product']['product_image']; ?>" alt="product"></td>
|
||||
<td><span class="text-truncate"><?php echo $order['items'][0]['product']['name']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['quantity']; ?></span></td>
|
||||
<td><span><?php echo $order['items'][0]['price']; ?></span></td>
|
||||
|
@ -374,16 +369,31 @@ if ($_SESSION["userId"] <> "") {
|
|||
|
||||
<!-- <td><span class="tbl-btn"><a class="btn btn-lg btn-primary" href="#">View</a></span></td> -->
|
||||
</tr>
|
||||
|
||||
<?php } else { ?>
|
||||
<td> <img class="prod-img" src="https://api.obanana.com/images/storage/web_images/1710214273217-no_image.png" alt="product"> </td>
|
||||
<?php
|
||||
}
|
||||
}
|
||||
if (empty($order['status'])) {
|
||||
echo '<tr><p style="padding-top:30px; padding-left:20px;">No Purchased Order/s Yet.</p></tr>';
|
||||
}
|
||||
}
|
||||
}
|
||||
// } else if (empty($order['status'])) {
|
||||
// echo '<p style="padding-top:30px; padding-left:20px;">No Purchased Order/s Yet.</p>';
|
||||
// }
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<?php
|
||||
if (!$orderExist) {
|
||||
echo '<p style="padding-top:30px; padding-left:20px;">No Order/s Yet.</p>';
|
||||
?>
|
||||
<script>
|
||||
allOrdersTHead.style.display = 'none';
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -391,7 +401,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div id="toPay" class="tab-content">
|
||||
<!-- Content for "To Pay" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead id="toPayTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -410,12 +420,14 @@ if ($_SESSION["userId"] <> "") {
|
|||
$customer = $customer_data[0];
|
||||
$orders = getOrderbyCustomerId($customer['_id']);
|
||||
$totalAmount = 0;
|
||||
$orderExist = false;
|
||||
if ($orders) {
|
||||
$order_data = json_decode($orders, true);
|
||||
$_SESSION['cart_items'] = $order_data;
|
||||
foreach ($order_data as $order) {
|
||||
// Ensure that the required data is available before accessing it
|
||||
if (isset($order['status']) && (strtoupper($order['status']) === 'TO PAY') && isset($order['items'][0]['product'])) {
|
||||
$orderExist = true;
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<?php
|
||||
|
@ -439,6 +451,18 @@ if ($_SESSION["userId"] <> "") {
|
|||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<?php
|
||||
if (!$orderExist) {
|
||||
echo '<p style="padding-top:30px; padding-left:20px;">No To Pay Order/s Yet.</p>';
|
||||
?>
|
||||
<script>
|
||||
toPayTHead.style.display = 'none';
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -446,7 +470,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div id="toShip" class="tab-content">
|
||||
<!-- Content for "To Ship" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead id="toShipTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -467,12 +491,14 @@ if ($_SESSION["userId"] <> "") {
|
|||
$customer = $customer_data[0];
|
||||
$orders = getOrderbyCustomerId($customer['_id']);
|
||||
$totalAmount = 0;
|
||||
$orderExist = false;
|
||||
if ($orders) {
|
||||
$order_data = json_decode($orders, true);
|
||||
$_SESSION['cart_items'] = $order_data;
|
||||
foreach ($order_data as $order) {
|
||||
// Ensure that the required data is available before accessing it
|
||||
if (isset($order['status']) && (strtoupper($order['status']) === 'TO SHIP') && isset($order['items'][0]['product'])) {
|
||||
$orderExist = true;
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<?php
|
||||
|
@ -496,6 +522,18 @@ if ($_SESSION["userId"] <> "") {
|
|||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<?php
|
||||
if (!$orderExist) {
|
||||
echo '<p style="padding-top:30px; padding-left:20px;">No To Ship Order/s Yet.</p>';
|
||||
?>
|
||||
<script>
|
||||
toShipTHead.style.display = 'none';
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -503,7 +541,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div id="toReceive" class="tab-content">
|
||||
<!-- Content for "To Receive" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead id="toReceiveTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -523,12 +561,14 @@ if ($_SESSION["userId"] <> "") {
|
|||
$customer = $customer_data[0];
|
||||
$orders = getOrderbyCustomerId($customer['_id']);
|
||||
$totalAmount = 0;
|
||||
$orderExist = false;
|
||||
if ($orders) {
|
||||
$order_data = json_decode($orders, true);
|
||||
$_SESSION['cart_items'] = $order_data;
|
||||
foreach ($order_data as $order) {
|
||||
// Ensure that the required data is available before accessing it
|
||||
if (isset($order['status']) && (strtoupper($order['status']) === 'TO RECEIVE') && isset($order['items'][0]['product'])) {
|
||||
$orderExist = true;
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<?php
|
||||
|
@ -560,6 +600,18 @@ if ($_SESSION["userId"] <> "") {
|
|||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<?php
|
||||
if (!$orderExist) {
|
||||
echo '<p style="padding-top:30px; padding-left:20px;">No To Receive Order/s Yet.</p>';
|
||||
?>
|
||||
<script>
|
||||
toReceiveTHead.style.display = 'none';
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -567,7 +619,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div id="completed" class="tab-content">
|
||||
<!-- Content for "Completed" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead id="completedTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -587,12 +639,14 @@ if ($_SESSION["userId"] <> "") {
|
|||
$customer = $customer_data[0];
|
||||
$orders = getOrderbyCustomerId($customer['_id']);
|
||||
$totalAmount = 0;
|
||||
$orderExist = false;
|
||||
if ($orders) {
|
||||
$order_data = json_decode($orders, true);
|
||||
$_SESSION['cart_items'] = $order_data;
|
||||
foreach ($order_data as $order) {
|
||||
// Ensure that the required data is available before accessing it
|
||||
if (isset($order['status']) && (strtoupper($order['status']) === 'COMPLETED') && isset($order['items'][0]['product'])) {
|
||||
$orderExist = true;
|
||||
$totalAmount += $order['total_amount'];
|
||||
|
||||
?>
|
||||
|
@ -831,6 +885,18 @@ if ($_SESSION["userId"] <> "") {
|
|||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<?php
|
||||
if (!$orderExist) {
|
||||
echo '<p style="padding-top:30px; padding-left:20px;">No Completed Order/s Yet.</p>';
|
||||
?>
|
||||
<script>
|
||||
completedTHead.style.display = 'none';
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
$customer_data = getCustomerbyLoginId($_SESSION["userId"]);
|
||||
} else {
|
||||
$_SESSION["isLoggedIn"] = false;
|
||||
header("location: login.php");
|
||||
}
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
|
@ -338,7 +339,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div id="allRefunds" class="tab-content active">
|
||||
<!-- Content for "all Orders" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead id="allRefundsTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -359,6 +360,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
$customer = $customer_data[0];
|
||||
$orders = getOrderbyCustomerId($customer['_id']);
|
||||
$totalAmount = 0;
|
||||
$orderExist = false;
|
||||
if ($orders) {
|
||||
$order_data = json_decode($orders, true);
|
||||
$_SESSION['cart_items'] = $order_data;
|
||||
|
@ -367,6 +369,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO APPROVE') || (strtoupper($order['return_order']['status']) === 'TO SHIP')
|
||||
|| (strtoupper($order['return_order']['status']) === 'TO RECEIVE') || (strtoupper($order['return_order']['status']) === 'TO REFUND')
|
||||
|| (strtoupper($order['return_order']['status']) === 'RETURN COMPLETE') && isset($order['items'][0]['product'])) {
|
||||
$orderExist = true;
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<?php
|
||||
|
@ -392,6 +395,18 @@ if ($_SESSION["userId"] <> "") {
|
|||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<?php
|
||||
if (!$orderExist) {
|
||||
echo '<p style="padding-top:30px; padding-left:20px;">No Refund/s Yet.</p>';
|
||||
?>
|
||||
<script>
|
||||
allRefundsTHead.style.display = 'none';
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -399,7 +414,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div id="toApprove" class="tab-content">
|
||||
<!-- Content for "To Approve" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead id="toApproveTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -420,12 +435,14 @@ if ($_SESSION["userId"] <> "") {
|
|||
$customer = $customer_data[0];
|
||||
$orders = getOrderbyCustomerId($customer['_id']);
|
||||
$totalAmount = 0;
|
||||
$orderExist = false;
|
||||
if ($orders) {
|
||||
$order_data = json_decode($orders, true);
|
||||
$_SESSION['cart_items'] = $order_data;
|
||||
foreach ($order_data as $order) {
|
||||
// Ensure that the required data is available before accessing it
|
||||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO APPROVE') && isset($order['items'][0]['product'])) {
|
||||
$orderExist = true;
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<?php
|
||||
|
@ -451,6 +468,18 @@ if ($_SESSION["userId"] <> "") {
|
|||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<?php
|
||||
if (!$orderExist) {
|
||||
echo '<p style="padding-top:30px; padding-left:20px;">No To Approve Refund/s Yet.</p>';
|
||||
?>
|
||||
<script>
|
||||
toApproveTHead.style.display = 'none';
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -458,7 +487,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div id="toShip" class="tab-content">
|
||||
<!-- Content for "To Ship" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead id="toShipTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -479,12 +508,14 @@ if ($_SESSION["userId"] <> "") {
|
|||
$customer = $customer_data[0];
|
||||
$orders = getOrderbyCustomerId($customer['_id']);
|
||||
$totalAmount = 0;
|
||||
$orderExist = false;
|
||||
if ($orders) {
|
||||
$order_data = json_decode($orders, true);
|
||||
$_SESSION['cart_items'] = $order_data;
|
||||
foreach ($order_data as $order) {
|
||||
// Ensure that the required data is available before accessing it
|
||||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO SHIP') && isset($order['items'][0]['product'])) {
|
||||
$orderExist = true;
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<?php
|
||||
|
@ -510,6 +541,18 @@ if ($_SESSION["userId"] <> "") {
|
|||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<?php
|
||||
if (!$orderExist) {
|
||||
echo '<p style="padding-top:30px; padding-left:20px;">No To Ship Refund/s Yet.</p>';
|
||||
?>
|
||||
<script>
|
||||
toShipTHead.style.display = 'none';
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -517,7 +560,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div id="toReceive" class="tab-content">
|
||||
<!-- Content for "To Receive" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead id="toReceiveTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -538,12 +581,14 @@ if ($_SESSION["userId"] <> "") {
|
|||
$customer = $customer_data[0];
|
||||
$orders = getOrderbyCustomerId($customer['_id']);
|
||||
$totalAmount = 0;
|
||||
$orderExist = false;
|
||||
if ($orders) {
|
||||
$order_data = json_decode($orders, true);
|
||||
$_SESSION['cart_items'] = $order_data;
|
||||
foreach ($order_data as $order) {
|
||||
// Ensure that the required data is available before accessing it
|
||||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO RECEIVE') && isset($order['items'][0]['product'])) {
|
||||
$orderExist = true;
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<?php
|
||||
|
@ -572,6 +617,18 @@ if ($_SESSION["userId"] <> "") {
|
|||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<?php
|
||||
if (!$orderExist) {
|
||||
echo '<p style="padding-top:30px; padding-left:20px;">No To Receive Refund/s Yet.</p>';
|
||||
?>
|
||||
<script>
|
||||
toReceiveTHead.style.display = 'none';
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -579,7 +636,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div id="toRefund" class="tab-content">
|
||||
<!-- Content for "To Refund" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead id="toRefundTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -600,12 +657,14 @@ if ($_SESSION["userId"] <> "") {
|
|||
$customer = $customer_data[0];
|
||||
$orders = getOrderbyCustomerId($customer['_id']);
|
||||
$totalAmount = 0;
|
||||
$orderExist = false;
|
||||
if ($orders) {
|
||||
$order_data = json_decode($orders, true);
|
||||
$_SESSION['cart_items'] = $order_data;
|
||||
foreach ($order_data as $order) {
|
||||
// Ensure that the required data is available before accessing it
|
||||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO REFUND') && isset($order['items'][0]['product'])) {
|
||||
$orderExist = true;
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<?php
|
||||
|
@ -634,6 +693,18 @@ if ($_SESSION["userId"] <> "") {
|
|||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<?php
|
||||
if (!$orderExist) {
|
||||
echo '<p style="padding-top:30px; padding-left:20px;">No To Refund/s Yet.</p>';
|
||||
?>
|
||||
<script>
|
||||
toRefundTHead.style.display = 'none';
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
@ -641,7 +712,7 @@ if ($_SESSION["userId"] <> "") {
|
|||
<div id="returnComplete" class="tab-content">
|
||||
<!-- Content for "Return Complete" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead id="returnCompleteTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -661,12 +732,14 @@ if ($_SESSION["userId"] <> "") {
|
|||
$customer = $customer_data[0];
|
||||
$orders = getOrderbyCustomerId($customer['_id']);
|
||||
$totalAmount = 0;
|
||||
$orderExist = false;
|
||||
if ($orders) {
|
||||
$order_data = json_decode($orders, true);
|
||||
$_SESSION['cart_items'] = $order_data;
|
||||
foreach ($order_data as $order) {
|
||||
// Ensure that the required data is available before accessing it
|
||||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'RETURN COMPLETE') && isset($order['items'][0]['product'])) {
|
||||
$orderExist = true;
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<?php
|
||||
|
@ -831,6 +904,18 @@ if ($_SESSION["userId"] <> "") {
|
|||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<?php
|
||||
if (!$orderExist) {
|
||||
echo '<p style="padding-top:30px; padding-left:20px;">No Completed Refund/s Yet.</p>';
|
||||
?>
|
||||
<script>
|
||||
returnCompleteTHead.style.display = 'none';
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
|
|
@ -311,11 +311,12 @@ if (is_array($vendorOrderss)) {
|
|||
<div class="tab" data-tab-name="returnComplete" onclick="showTab('returnComplete')">Return Complete</div>
|
||||
</div> -->
|
||||
|
||||
|
||||
<!-- 03-26-2024 Stacy added tab for all orders -->
|
||||
<!-- Content for "All Refunds" tab -->
|
||||
<div id="allRefunds" class="tab-content active">
|
||||
<!-- Content for "All Refunds" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead id="allRefundTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -335,11 +336,13 @@ if (is_array($vendorOrderss)) {
|
|||
$order = $vendorOrders;
|
||||
$orderArray = json_encode($order, true);
|
||||
$orderItems = json_decode($orderArray, true);
|
||||
$orderExist = false; //for checking if order exist
|
||||
foreach ($orderItems as $order) {
|
||||
// Ensure that the required data is available before accessing it
|
||||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO APPROVE') || (strtoupper($order['return_order']['status']) === 'TO SHIP')
|
||||
|| (strtoupper($order['return_order']['status']) === 'TO RECEIVE') || (strtoupper($order['return_order']['status']) === 'TO REFUND')
|
||||
|| (strtoupper($order['return_order']['status']) === 'RETURN COMPLETE') && isset($order['items'][0]['product'])) {
|
||||
$orderExist = true; //if there's an order, orderExist will be set to true
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<?php
|
||||
|
@ -361,16 +364,28 @@ if (is_array($vendorOrderss)) {
|
|||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<?php
|
||||
if (!$orderExist) {
|
||||
echo '<p style="padding-top:30px; padding-left:20px;">No Refund/s Yet.</p>';
|
||||
?>
|
||||
<script>
|
||||
allRefundTHead.style.display = 'none';
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div id="toApprove" class="tab-content active">
|
||||
<!-- Content for "To Approve" tab -->
|
||||
|
||||
<!-- Content for "To Approve" tab -->
|
||||
<div id="toApprove" class="tab-content">
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead id="toApproveTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -390,9 +405,11 @@ if (is_array($vendorOrderss)) {
|
|||
$order = $vendorOrders;
|
||||
$orderArray = json_encode($order, true);
|
||||
$orderItems = json_decode($orderArray, true);
|
||||
$orderExist = false;
|
||||
foreach ($orderItems as $order) {
|
||||
// Ensure that the required data is available before accessing it
|
||||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO APPROVE') && isset($order['items'][0]['product'])) {
|
||||
$orderExist = true;
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<?php
|
||||
|
@ -418,16 +435,28 @@ if (is_array($vendorOrderss)) {
|
|||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<?php
|
||||
if (!$orderExist) {
|
||||
echo '<p style="padding-top:30px; padding-left:20px;">No To Approve Refund/s Yet.</p>';
|
||||
?>
|
||||
<script>
|
||||
toApproveTHead.style.display = 'none';
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Content for "To Ship" tab -->
|
||||
<div id="toShip" class="tab-content">
|
||||
<!-- Content for "To Ship" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead id="toShipTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -447,9 +476,11 @@ if (is_array($vendorOrderss)) {
|
|||
$order = $vendorOrders;
|
||||
$orderArray = json_encode($order, true);
|
||||
$orderItems = json_decode($orderArray, true);
|
||||
$orderExist = false;
|
||||
foreach ($orderItems as $order) {
|
||||
// Ensure that the required data is available before accessing it
|
||||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO SHIP') && isset($order['items'][0]['product'])) {
|
||||
$orderExist = true;
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<?php
|
||||
|
@ -471,16 +502,28 @@ if (is_array($vendorOrderss)) {
|
|||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<?php
|
||||
if (!$orderExist) {
|
||||
echo '<p style="padding-top:30px; padding-left:20px;">No To Ship Refund/s Yet.</p>';
|
||||
?>
|
||||
<script>
|
||||
toShipTHead.style.display = 'none';
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Content for "To Receive" tab -->
|
||||
<div id="toReceive" class="tab-content">
|
||||
<!-- Content for "To Receive" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead id="toReceiveTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -499,9 +542,11 @@ if (is_array($vendorOrderss)) {
|
|||
$order = $vendorOrders;
|
||||
$orderArray = json_encode($order, true);
|
||||
$orderItems = json_decode($orderArray, true);
|
||||
$orderExist = false;
|
||||
foreach ($orderItems as $order) {
|
||||
// Ensure that the required data is available before accessing it
|
||||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO RECEIVE') && isset($order['items'][0]['product'])) {
|
||||
$orderExist = true;
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<?php
|
||||
|
@ -528,13 +573,26 @@ if (is_array($vendorOrderss)) {
|
|||
}
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<?php
|
||||
if (!$orderExist) {
|
||||
echo '<p style="padding-top:30px; padding-left:20px;">No To Receive Refund/s Yet.</p>';
|
||||
?>
|
||||
<script>
|
||||
toReceiveTHead.style.display = 'none';
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Content for "To Refund" tab -->
|
||||
<div id="toRefund" class="tab-content">
|
||||
<!-- Content for "To Refund" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead id="toRefundTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -553,9 +611,11 @@ if (is_array($vendorOrderss)) {
|
|||
$order = $vendorOrders;
|
||||
$orderArray = json_encode($order, true);
|
||||
$orderItems = json_decode($orderArray, true);
|
||||
$orderExist = false;
|
||||
foreach ($orderItems as $order) {
|
||||
// Ensure that the required data is available before accessing it
|
||||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'TO REFUND') && isset($order['items'][0]['product'])) {
|
||||
$orderExist = true;
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<?php
|
||||
|
@ -580,16 +640,28 @@ if (is_array($vendorOrderss)) {
|
|||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<?php
|
||||
if (!$orderExist) {
|
||||
echo '<p style="padding-top:30px; padding-left:20px;">No To Refund/s Yet.</p>';
|
||||
?>
|
||||
<script>
|
||||
toRefundTHead.style.display = 'none';
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
<!-- Content for "Return Complete" tab -->
|
||||
<div id="returnComplete" class="tab-content">
|
||||
<!-- Content for "Return Complete" tab -->
|
||||
<table class="table ec-table">
|
||||
<thead>
|
||||
<thead id="returnCompleteTHead">
|
||||
<tr class="Title">
|
||||
<th scope="col">Image</th>
|
||||
<th scope="col">Name</th>
|
||||
|
@ -608,9 +680,11 @@ if (is_array($vendorOrderss)) {
|
|||
$order = $vendorOrders;
|
||||
$orderArray = json_encode($order, true);
|
||||
$orderItems = json_decode($orderArray, true);
|
||||
$orderExist = false;
|
||||
foreach ($orderItems as $order) {
|
||||
// Ensure that the required data is available before accessing it
|
||||
if (isset($order['return_order']['status']) && (strtoupper($order['return_order']['status']) === 'RETURN COMPLETE') && isset($order['items'][0]['product'])) {
|
||||
$orderExist = true;
|
||||
$totalAmount += $order['total_amount'];
|
||||
?>
|
||||
<?php
|
||||
|
@ -771,9 +845,20 @@ if (is_array($vendorOrderss)) {
|
|||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
</tbody>
|
||||
|
||||
<?php
|
||||
if (!$orderExist) {
|
||||
echo '<p style="padding-top:30px; padding-left:20px;">No Refund/s Complete Yet.</p>';
|
||||
?>
|
||||
<script>
|
||||
returnCompleteTHead.style.display = 'none';
|
||||
</script>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Reference in New Issue