diff --git a/user-history.php b/user-history.php
index 3ceed23..ed80055 100644
--- a/user-history.php
+++ b/user-history.php
@@ -7,6 +7,7 @@ if ($_SESSION["userId"] <> "") {
$customer_data = getCustomerbyLoginId($_SESSION["userId"]);
} else {
$_SESSION["isLoggedIn"] = false;
+ header("location: login.php");
}
?>
@@ -323,7 +324,7 @@ if ($_SESSION["userId"] <> "") {
@@ -391,7 +401,7 @@ if ($_SESSION["userId"] <> "") {
-
+
Image |
Name |
@@ -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'];
?>
"") {
}
?>
+
+ No To Pay Order/s Yet.';
+ ?>
+
+
+
@@ -446,7 +470,7 @@ if ($_SESSION["userId"] <> "") {
-
+
Image |
Name |
@@ -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'];
?>
"") {
}
?>
+
+ No To Ship Order/s Yet.';
+ ?>
+
+
+
@@ -503,7 +541,7 @@ if ($_SESSION["userId"] <> "") {
-
+
Image |
Name |
@@ -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'];
?>
"") {
}
?>
+
+ No To Receive Order/s Yet.';
+ ?>
+
+
+
@@ -567,7 +619,7 @@ if ($_SESSION["userId"] <> "") {
-
+
Image |
Name |
@@ -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"] <> "") {
}
?>
+
+ No Completed Order/s Yet.';
+ ?>
+
+
+
diff --git a/user-refund-history.php b/user-refund-history.php
index 9cda15c..b5f6722 100644
--- a/user-refund-history.php
+++ b/user-refund-history.php
@@ -9,6 +9,7 @@ if ($_SESSION["userId"] <> "") {
$customer_data = getCustomerbyLoginId($_SESSION["userId"]);
} else {
$_SESSION["isLoggedIn"] = false;
+ header("location: login.php");
}
?>
@@ -338,7 +339,7 @@ if ($_SESSION["userId"] <> "") {
-
+
Image |
Name |
@@ -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'];
?>
"") {
}
?>
+
+ No Refund/s Yet.';
+ ?>
+
+
+
@@ -399,7 +414,7 @@ if ($_SESSION["userId"] <> "") {
-
+
Image |
Name |
@@ -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'];
?>
"") {
}
?>
+
+ No To Approve Refund/s Yet.';
+ ?>
+
+
+
@@ -458,7 +487,7 @@ if ($_SESSION["userId"] <> "") {
-
+
Image |
Name |
@@ -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'];
?>
"") {
}
?>
+
+ No To Ship Refund/s Yet.';
+ ?>
+
+
+
@@ -517,7 +560,7 @@ if ($_SESSION["userId"] <> "") {
-
+
Image |
Name |
@@ -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'];
?>
"") {
}
?>
+
+ No To Receive Refund/s Yet.';
+ ?>
+
+
+
@@ -579,7 +636,7 @@ if ($_SESSION["userId"] <> "") {
-
+
Image |
Name |
@@ -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'];
?>
"") {
}
?>
+
+ No To Refund/s Yet.';
+ ?>
+
+
+
@@ -641,7 +712,7 @@ if ($_SESSION["userId"] <> "") {
-
+
Image |
Name |
@@ -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'];
?>
"") {
}
?>
+
+ No Completed Refund/s Yet.';
+ ?>
+
+
+
diff --git a/vendor-refund-history.php b/vendor-refund-history.php
index 52efb5a..7d52a7c 100644
--- a/vendor-refund-history.php
+++ b/vendor-refund-history.php
@@ -311,11 +311,12 @@ if (is_array($vendorOrderss)) {
Return Complete
-->
+
+
-
-
+
Image |
Name |
@@ -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'];
?>
+
+ No Refund/s Yet.';
+ ?>
+
+
+
-
-
+
+
+
-
+
Image |
Name |
@@ -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'];
?>
+
+ No To Approve Refund/s Yet.';
+ ?>
+
+
+
+
+
-
-
+
Image |
Name |
@@ -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'];
?>
+
+ No To Ship Refund/s Yet.';
+ ?>
+
+
+
+
+
-
-
+
Image |
Name |
@@ -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'];
?>
+
+ No To Receive Refund/s Yet.';
+ ?>
+
+
+
+
+
-
-
+
Image |
Name |
@@ -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'];
?>
+
+ No To Refund/s Yet.';
+ ?>
+
+
+
+
+
-
-
+
Image |
Name |
@@ -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'];
?>
+
+ No Refund/s Complete Yet.';
+ ?>
+
+
+