2025-06-06 17:14:52 +08:00

77 lines
2.9 KiB
PHP

<html>
<head>
<title>Online Fruit Store</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="./index.css" type="text/css" />
<script src="./home.js"></script>
</head>
<body>
<div class="dynamic-background"></div>
<!--banner-->
<table id="banner">
<tr>
<td width="3%"></td>
<td style="text-align: right" width="6%">
<img width="64%" class="banner_img" height="64%" src="./icon/icon.svg" onmousedown="changetohome()">
</td>
<td width="70%">
<p onmousedown="changetohome()">Online Fruit Store</p>
</td>
<td width="6%">
<img title="Search" id="search_icon" class="banner_img" src="./icon/search.svg" alt="Search"
onclick="search()">
</td>
<td width="6%">
<img title="Cart" class="banner_img" id="cart" src="./icon/cart.svg" alt="Cart"
onmousedown="changetocart()">
</td>
<td width="6%">
<img title="User" class="banner_img" src="./icon/user.svg" alt="User"
onmousedown="makeIFrame('./login/login.php', 'login', 'overlay')">
</td>
<td width="3%"></td>
</tr>
</table>
<?php
include "./indexes/ConnectDB.php";
// Start the session
session_start();
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) {
if(isset($_SESSION['user_type']) && $_SESSION['user_type'] === "admin"){
echo "<script type='text/javascript'>
window.top.location.href = './indexes/manage/admin.php';
</script>";
}
}
else{
echo "<script type='text/javascript'>
window.top.location.href = './index.html';
</script>";
}
?>
<!--open buyer/seller page-->
<script>
var existence = document.getElementById("customerpage");
if (!existence) {
// Create the iframe and add it to the overlay div
var iframe = document.createElement("iframe");
iframe.setAttribute("src", "./indexes/process/index_.php");
iframe.id = "customerpage";
document.body.appendChild(iframe);
}
function changetohome(){
window.top.location.href = './home.php';
}
function changetocart(){
window.top.location.href = './cart.php';
}
</script>
</body>
</html>