RoamEase/indexes/user/home.php
2025-06-06 17:31:03 +08:00

91 lines
2.9 KiB
PHP

<html>
<head>
<title>RoamEase</title>
<link rel="shortcut icon" href="../../icon/favicon/favicon.ico" type="image/x-icon" />
<link rel="icon" href="../../icon/favicon/favicon.ico" type="image/x-icon" />
<link rel="stylesheet" href="./home.css?version=1" type="text/css" />
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<?php
include "../ConnectDB.php";
// Start the session
session_start();
// Check if the user is already logged in
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) {
if(isset($_SESSION['user_type']) && $_SESSION['user_type'] === 'seller'){
echo "<script type='text/javascript'>
window.top.location.href = '../seller/home.php';
</script>";
}
if(isset($_SESSION['user_type']) && $_SESSION['user_type'] === 'admin'){
echo "<script type='text/javascript'>
window.top.location.href = '../admin/home.php';
</script>";
}
if(isset($_SESSION['user_type']) && $_SESSION['user_type'] === 'guide'){
echo "<script type='text/javascript'>
window.top.location.href = '../guide/home.php';
</script>";
}
}
?>
<header>
<div class="logo">
<a href="../../index.php"><img src="../../icon/favicon/logo_white.svg" alt="RoamEase"></a>
</div>
<div class="nav-links">
<?php
if (isset($_SESSION['loggedin'])) {
echo '<a href="./process/cart.php">Cart</a>
<a href="../../login/login.php">Account</a>';
}
else {
echo '<a href="../../login/register.php">Sign up</a>
<a href="../../login/username.php">Log in</a>';
}
?>
</div>
</header>
<header>
<nav>
<a href="stays.php">
<img src="../../icon/header/stays.svg" alt="Stays">
</a>
<a href="transport.php">
<img src="../../icon/header/transportations.svg" alt="Transportations">
</a>
<a href="foods.php">
<img src="../../icon/header/foods.svg" alt="Foods">
</a>
<a href="attractions.php">
<img src="../../icon/header/attractions.svg" alt="Attractions">
</a>
<a href="guiding.php">
<img src="../../icon/header/guiding.svg" alt="Guiding">
</a>
<a href="plans.php">
<img src="../../icon/header/plans.svg" alt="Plans">
</a>
</nav>
</header>
<footer>
<img src="../../icon/favicon/logo_white.svg" alt="RoamEase" width="300px">
<div style="margin: 20px 0;">
<a href="#" style="color: white; margin: 0 10px;">About us</a>
<a href="#" style="color: white; margin: 0 10px;">Privacy Policy</a>
<a href="#" style="color: white; margin: 0 10px;">Terms For Usage</a>
</div>
<p>© 2023 COMP3013 Group10. All rights reserved.</p>
</footer>
</body>
</html>