<?php
session_start();
// If user is already logged in, redirect to dashboard
if (isset($_SESSION['user_id'])) {
header("Location: dashboard.php");
exit();
}
$error = isset($_GET['error']) ? htmlspecialchars($_GET['error']) : '';
?>
<!DOCTYPE html>
<html lang="ar" dir="rtl">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>لوحة التحكم - تسجيل الدخول</title>
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.2/dist/css/bootstrap.rtl.min.css">
<link href="https://fonts.googleapis.com/css2?family=Cairo:wght@400;700&display=swap" rel="stylesheet">
<style>
body {
font-family: 'Cairo', sans-serif;
background-color: #1a1a1a;
color: #f5f5f5;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.login-container {
background: rgba(0, 0, 0, 0.5);
backdrop-filter: blur(10px);
border: 1px solid rgba(255, 255, 255, 0.2);
padding: 3rem 2rem;
border-radius: 15px;
width: 100%;
max-width: 400px;
}
.form-control {
background-color: rgba(255,255,255,0.1);
border: 1px solid rgba(255,255,255,0.2);
color: white;
}
.form-control:focus {
background-color: rgba(255,255,255,0.2);
border-color: #DC143C;
color: white;
box-shadow: none;
}
.btn-danger {
background-color: #DC143C;
border: none;
width: 100%;
}
</style>
</head>
<body>
<div class="login-container">
<h2 class="text-center mb-4">تسجيل الدخول</h2>
<?php if ($error): ?>
<div class="alert alert-danger"><?= $error ?></div>
<?php endif; ?>
<form action="login_process.php" method="POST">
<div class="mb-3">
<label for="username" class="form-label">اسم المستخدم</label>
<input type="text" class="form-control" id="username" name="username" required>
</div>
<div class="mb-3">
<label for="password" class="form-label">كلمة المرور</label>
<input type="password" class="form-control" id="password" name="password" required>
</div>
<button type="submit" class="btn btn-danger btn-lg mt-3">دخول</button>
</form>
<div class="text-center mt-4">
<small> </small>
</div>
</div>
</body>
</html>