Merge pull request 'louie_branch' (#59) from louie_branch into main

Reviewed-on: #59
This commit is contained in:
MarkHipe 2024-04-16 16:04:40 +08:00
commit 868fe51be8
8 changed files with 37 additions and 1 deletions

View File

@ -19,7 +19,7 @@
if ($result > 0) {
$_SESSION["isVendor"] = true;
}
header("location: index.php");
header("location: $url");
} else {
// $_SESSION["loginError"] = "Invalid email or password. Please try again.";
header("location: login.php?error=1");

View File

@ -11,6 +11,12 @@ if ($_SESSION["userId"] <> "") {
$_SESSION["isLoggedIn"] = false;
header("location: login.php");
}
if ($_SESSION["isVendor"] == true) {
header("location: vendor-dashboard.php");
}
?>
<!DOCTYPE html>
<html lang="en">

View File

@ -28,6 +28,11 @@ if (is_array($vendorOrderss)) {
echo "Unknown type or no 'message' property found.";
}
if ($_SESSION["isCustomer"] == true) {
header("location: user-profile.php");
}
?>
<!--=========================================================
Item Name: oBanana B2B - Elevate Your Business

View File

@ -30,6 +30,11 @@ if (is_array($vendorDecode)) {
} else {
echo "Unknown type or no 'message' property found.";
}
if ($_SESSION["isCustomer"] == true) {
header("location: user-profile.php");
}
?>
<!DOCTYPE html>
<html lang="en">

View File

@ -24,6 +24,10 @@ if (isset($_SESSION["token"])) {
}
}
if ($_SESSION["isCustomer"] == true) {
header("location: user-profile.php");
}
$vendorLoginId = searchVendorbyLoginId($_SESSION["userId"]);
$vendorLoginIdjson = json_decode($vendorLoginId, true);
if (isset($vendorLoginIdjson['results'][0])) {

View File

@ -27,6 +27,11 @@ if (is_array($vendorOrderss)) {
} else {
echo "Unknown type or no 'message' property found.";
}
if ($_SESSION["isCustomer"] == true) {
header("location: user-profile.php");
}
?>
<!DOCTYPE html>
<html lang="en">

View File

@ -21,6 +21,12 @@ if ($_SESSION["userId"] <> "") {
$_SESSION["isLoggedIn"] = false;
header("location: login.php");
}
if ($_SESSION["isCustomer"] == true) {
header("location: user-profile.php");
}
?>
<!DOCTYPE html>
<html lang="en">

View File

@ -20,6 +20,11 @@ if (isset($_GET['id'])) {
}
$result = getProduct($_SESSION['newProductId']);
$array = json_decode($result, true);
if ($_SESSION["isCustomer"] == true) {
header("location: user-profile.php");
}
?>
<!DOCTYPE html>
<html lang="en">