36557-vm/login.php
Flatlogic Bot 08fcb2dae0 0.2
2025-12-01 21:25:15 +00:00

76 lines
3.5 KiB
PHP

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Login - Your Brand</title>
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.11.3/font/bootstrap-icons.min.css">
<link href="assets/css/auth.css" rel="stylesheet">
</head>
<body class="auth-wrapper">
<?php
require_once 'auth.php';
$error = '';
if ($_SERVER['REQUEST_METHOD'] == 'POST') {
$email = $_POST['email'];
$password = $_POST['password'];
if (login($email, $password)) {
if ($_SESSION['user_type'] === 'Admin') {
header("Location: admin_dashboard.php");
} else {
header("Location: dashboard.php");
}
exit;
} else {
$error = 'Invalid email or password.';
}
}
?>
<div class="auth-container">
<div class="auth-branding-section">
<a href="index.php" class="text-white text-decoration-none h1"> <i class="bi bi-buildings"></i> <?php echo htmlspecialchars($content['site_name']); ?></a>
<p class="lead mt-3">Log in to access your dashboard and manage your network.</p>
</div>
<div class="auth-form-section">
<div class="text-center mb-5">
<h2>Sign In</h2>
<p class="text-muted">Enter your credentials to continue.</p>
</div>
<?php if ($error): ?>
<div class="alert alert-danger"><?php echo htmlspecialchars($error); ?></div>
<?php endif; ?>
<form method="POST">
<div class="mb-4">
<label for="email" class="form-label">Email Address</label>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-envelope-fill"></i></span>
<input type="email" name="email" id="email" class="form-control form-control-lg" placeholder="e.g., name@example.com" required>
</div>
</div>
<div class="mb-4">
<div class="d-flex justify-content-between">
<label for="password" class="form-label">Password</label>
<a href="#" class="text-decoration-none">Forgot Password?</a>
</div>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-lock-fill"></i></span>
<input type="password" name="password" id="password" class="form-control form-control-lg" placeholder="Your password" required>
</div>
</div>
<div class="d-grid mb-4">
<button type="submit" class="btn btn-primary btn-lg">Sign In</button>
</div>
<p class="text-center">Don't have an account? <a href="register.php">Sign up now</a>.</p>
</form>
<div class="text-center mt-5">
<a href="index.php" class="text-muted text-decoration-none"><i class="bi bi-arrow-left"></i> Back to Homepage</a>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>