diff --git a/admin/login_action_admin.php b/admin/login_action_admin.php
new file mode 100644
index 0000000..b916649
--- /dev/null
+++ b/admin/login_action_admin.php
@@ -0,0 +1,41 @@
+ 0) {
+ $_SESSION["isCustomer"] = true;
+ }
+ $result = vendorExists($_SESSION["email"]);
+ if ($result > 0) {
+ $_SESSION["isVendor"] = true;
+ }
+ header("location: index.php");
+ } else {
+ // $_SESSION["loginError"] = "Invalid email or password. Please try again.";
+ header("location: login.php?error=1");
+ }
+
+
+ // $_SESSION["token"] = $result;
+ // $result = profile($_SESSION["token"]);
+ // $_SESSION["userId"] = $result["profile"]["userId"];
+ // $result = customerExists($_SESSION["email"]);
+ // if($result>0){
+ // $_SESSION["isCustomer"] = true;
+ // }
+ // $result = vendorExists($_SESSION["email"]);
+ // if($result>0){
+ // $_SESSION["isVendor"] = true;
+ // }
+ // header("location: $url")
+?>
\ No newline at end of file
diff --git a/admin/token-renew.php b/admin/token-renew.php
new file mode 100644
index 0000000..104fa25
--- /dev/null
+++ b/admin/token-renew.php
@@ -0,0 +1,11 @@
+
diff --git a/admin/vendor-profile.php b/admin/vendor-profile.php
index 5e07d7e..11acc9f 100644
--- a/admin/vendor-profile.php
+++ b/admin/vendor-profile.php
@@ -65,21 +65,20 @@ foreach ($vendorPayouts as $payout) {
}
}
-$token = $_SESSION["token"];
+if (isset($_SESSION["token"])) {
+ $token = $_SESSION["token"];
+ $token_parts = explode(".", $token);
+ $token_payload = base64_decode($token_parts[1]);
+ $token_data = json_decode($token_payload);
-$token_parts = explode(".", $token);
-$token_payload = base64_decode($token_parts[1]);
-$token_data = json_decode($token_payload);
+ $issued_at_time = $token_data->iat;
+ $expiration_time = $token_data->exp;
+ $renewal_time = $issued_at_time + 3300;
-$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;
+ if (time() >= $renewal_time || time() >= $expiration_time) {
+ header("Location: token-renew.php");
+ exit;
+ }
}
// $token = loginRenew($_SESSION["email"], $_SESSION["password"], $token);
// $_SESSION["token"] = $token;
@@ -115,6 +114,23 @@ if (time() >= $renewal_time) {
+
diff --git a/login_action.php b/login_action.php
index adb9c4e..0530f51 100644
--- a/login_action.php
+++ b/login_action.php
@@ -19,7 +19,7 @@
if ($result > 0) {
$_SESSION["isVendor"] = true;
}
- header("location: $url");
+ header("location: index.php");
} else {
// $_SESSION["loginError"] = "Invalid email or password. Please try again.";
header("location: login.php?error=1");
diff --git a/product-left-sidebar.php b/product-left-sidebar.php
index ca03584..2484b5d 100644
--- a/product-left-sidebar.php
+++ b/product-left-sidebar.php
@@ -215,7 +215,8 @@ if (isset($_GET['id'])) {
right: 15px;
bottom: 0;
border-radius: 0 0 10px 10px;
- }
+ }
+
/* 02-21-2024 Stacy added css for addtocart & wishlist */
@@ -276,17 +277,17 @@ if (isset($_GET['id'])) {
';
- echo $_SESSION["SuccessfullySent"];
- echo '
';
- unset($_SESSION["SuccessfullySent"]);
- echo " ";
- }
+ }
?>
@@ -325,7 +326,8 @@ if (isset($_GET['id'])) {
$productImage = $i;
}
?>
-
+
@@ -378,16 +380,16 @@ if (isset($_GET['id'])) {
As low as
0) {
- echo '' . $product_details['regular_price'] . '';
- echo '' . $product_details['sale_price'] . '';
- } elseif (!isset($product_details['regular_price']) || $product_details['regular_price'] <= 0) {
- echo 'Contact Seller for Price';
- } else {
- echo '' . $product_details['regular_price'] . '';
- }
- // 02-13-24 Jun Jihad Removed Logic to DIsplay Price Range of Variable Products
+ // 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 '' . $product_details['regular_price'] . '';
+ echo '' . $product_details['sale_price'] . '';
+ } elseif (!isset($product_details['regular_price']) || $product_details['regular_price'] <= 0) {
+ echo 'Contact Seller for Price';
+ } else {
+ echo '' . $product_details['regular_price'] . '';
+ }
+ // 02-13-24 Jun Jihad Removed Logic to DIsplay Price Range of Variable Products
?>
@@ -396,7 +398,7 @@ if (isset($_GET['id'])) {
-
+
@@ -405,7 +407,7 @@ if (isset($_GET['id'])) {