140 lines
4.1 KiB
PHP
140 lines
4.1 KiB
PHP
<?php
|
|
session_start();
|
|
|
|
// If user is already logged in, redirect to dashboard
|
|
if (isset($_SESSION['user_id'])) {
|
|
header("Location: dashboard.php");
|
|
exit();
|
|
}
|
|
?>
|
|
<!DOCTYPE html>
|
|
<html lang="en">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>Login - MajuroEats</title>
|
|
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@400;600;700&display=swap" rel="stylesheet">
|
|
<link rel="stylesheet" href="assets/css/custom.css?v=<?php echo time(); ?>">
|
|
<style>
|
|
body {
|
|
font-family: 'Poppins', sans-serif;
|
|
background-color: #F8F9FA;
|
|
color: #333;
|
|
display: flex;
|
|
justify-content: center;
|
|
align-items: center;
|
|
min-height: 100vh;
|
|
margin: 0;
|
|
}
|
|
.login-container {
|
|
background-color: #FFFFFF;
|
|
padding: 3rem;
|
|
border-radius: 0.5rem;
|
|
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
|
width: 100%;
|
|
max-width: 400px;
|
|
}
|
|
.login-container h1 {
|
|
font-size: 2rem;
|
|
font-weight: 700;
|
|
color: #2E8B57;
|
|
text-align: center;
|
|
margin-bottom: 2rem;
|
|
}
|
|
.form-group {
|
|
margin-bottom: 1.5rem;
|
|
}
|
|
.form-group label {
|
|
display: block;
|
|
margin-bottom: 0.5rem;
|
|
font-weight: 600;
|
|
color: #333;
|
|
}
|
|
.form-group input {
|
|
width: 100%;
|
|
padding: 0.75rem;
|
|
border: 1px solid #ccc;
|
|
border-radius: 0.5rem;
|
|
box-sizing: border-box;
|
|
}
|
|
.btn-submit {
|
|
width: 100%;
|
|
padding: 0.75rem;
|
|
border: none;
|
|
border-radius: 0.5rem;
|
|
background-color: #40E0D0;
|
|
color: #fff;
|
|
font-size: 1rem;
|
|
font-weight: 600;
|
|
cursor: pointer;
|
|
transition: background-color 0.3s ease;
|
|
}
|
|
.btn-submit:hover {
|
|
background-color: #2E8B57;
|
|
}
|
|
.signup-link {
|
|
text-align: center;
|
|
margin-top: 1.5rem;
|
|
}
|
|
.signup-link a {
|
|
color: #2E8B57;
|
|
font-weight: 600;
|
|
text-decoration: none;
|
|
}
|
|
.message {
|
|
padding: 1rem;
|
|
margin-bottom: 1rem;
|
|
border-radius: 0.5rem;
|
|
text-align: center;
|
|
}
|
|
.message.success {
|
|
background-color: #d4edda;
|
|
color: #155724;
|
|
}
|
|
.message.error {
|
|
background-color: #f8d7da;
|
|
color: #721c24;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
|
|
<div class="login-container">
|
|
<h1>Partner Login</h1>
|
|
|
|
<?php if (isset($_GET['signup']) && $_GET['signup'] == 'success'): ?>
|
|
<div class="message success">
|
|
Your account has been created successfully! Please log in.
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<?php if (isset($_GET['error'])):
|
|
// Corrected: Changed " to ' for the $_GET['error'] comparison
|
|
?>
|
|
<div class="message error">
|
|
<?php
|
|
if ($_GET['error'] == 'invalid') echo "Invalid email or password.";
|
|
if ($_GET['error'] == 'not_owner') echo "Access denied. Only restaurant owners can log in here.";
|
|
?>
|
|
</div>
|
|
<?php endif; ?>
|
|
|
|
<form action="login_handler.php" method="POST">
|
|
<div class="form-group">
|
|
<label for="email">Email</label>
|
|
<input type="email" id="email" name="email" required>
|
|
</div>
|
|
<div class="form-group">
|
|
<label for="password">Password</label>
|
|
<input type="password" id="password" name="password" required>
|
|
</div>
|
|
<button type="submit" class="btn-submit">Log In</button>
|
|
</form>
|
|
<div class="signup-link">
|
|
<p>Don't have an account? <a href="restaurant_signup.php">Sign Up</a></p>
|
|
</div>
|
|
</div>
|
|
|
|
</body>
|
|
</html>
|