Files
2026-09-16 23:20:08 +07:00

153 lines
5.8 KiB
PHP

<?php
// index.php
session_start();
if (isset($_SESSION['loggedin']) && $_SESSION['loggedin'] === true) {
header("location: dashboard.php");
exit;
}
?>
<!DOCTYPE html>
<html lang="th">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>เข้าสู่ระบบ | ระบบจองห้องประชุมออนไลน์</title>
<!-- Favicon -->
<link rel="icon" type="image/png" href="assets/logo.png">
<!-- Google Fonts -->
<link rel="preconnect" href="https://fonts.googleapis.com">
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
<link href="https://fonts.googleapis.com/css2?family=Prompt:wght@300;400;500;600&display=swap" rel="stylesheet">
<!-- Bootstrap 5 CSS -->
<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<!-- Bootstrap Icons -->
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/bootstrap-icons@1.10.5/font/bootstrap-icons.css">
<style>
body {
font-family: 'Prompt', sans-serif;
background-color: #f8f9fa;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
}
.login-card {
border: none;
border-radius: 16px;
box-shadow: 0 10px 30px rgba(0,0,0,0.08);
overflow: hidden;
background: rgba(255, 255, 255, 0.95);
backdrop-filter: blur(10px);
}
.login-header {
background: linear-gradient(135deg, #115c32, #1b8a4b); /* Changed to green theme for MOPH */
color: white;
padding: 2rem;
text-align: center;
}
.login-body {
padding: 2.5rem;
}
.btn-primary {
background-color: #1b8a4b;
border: none;
padding: 0.75rem;
font-weight: 500;
}
.btn-primary:hover {
background-color: #115c32;
}
/* Shiny Logo Effect */
.shiny-logo {
position: relative;
overflow: hidden;
border-radius: 50%;
display: inline-block;
width: 100px;
height: 100px;
box-shadow: 0 4px 15px rgba(0,0,0,0.2);
margin-bottom: 1rem;
background-color: white;
}
.shiny-logo img {
width: 100%;
height: 100%;
object-fit: cover;
}
.shiny-logo::before {
content: '';
position: absolute;
top: 0;
left: -100%;
width: 50%;
height: 100%;
background: linear-gradient(to right, rgba(255,255,255,0) 0%, rgba(255,255,255,0.6) 50%, rgba(255,255,255,0) 100%);
transform: skewX(-25deg);
animation: shine 3s infinite;
z-index: 1;
}
@keyframes shine {
0% { left: -100%; }
20% { left: 200%; }
100% { left: 200%; }
}
</style>
</head>
<body>
<div class="container">
<div class="row justify-content-center">
<div class="col-md-5 col-lg-4">
<div class="card login-card">
<div class="login-header">
<div class="shiny-logo">
<img src="assets/logo.png" alt="Logo">
</div>
<h4>ระบบขอใช้งานประชุมออนไลน์ผ่าน Google Meet</h4>
<p class="mb-0 text-white-50">เข้าสู่ระบบด้วยบัญชีผู้ใช้</p>
</div>
<div class="login-body">
<?php if (isset($_SESSION['login_error'])): ?>
<div class="alert alert-danger alert-dismissible fade show" role="alert">
<i class="bi bi-exclamation-triangle-fill me-2"></i>
<?= htmlspecialchars($_SESSION['login_error']) ?>
<button type="button" class="btn-close" data-bs-dismiss="alert" aria-label="Close"></button>
</div>
<?php unset($_SESSION['login_error']); ?>
<?php endif; ?>
<form action="auth/login.php" method="POST">
<div class="mb-3">
<label for="username" class="form-label">ชื่อผู้ใช้งาน (Username)</label>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-person-fill"></i></span>
<input type="text" class="form-control" id="username" name="username" required autofocus>
</div>
</div>
<div class="mb-4">
<label for="password" class="form-label">รหัสผ่าน (Password)</label>
<div class="input-group">
<span class="input-group-text"><i class="bi bi-lock-fill"></i></span>
<input type="password" class="form-control" id="password" name="password" required>
</div>
</div>
<button type="submit" class="btn btn-primary w-100 rounded-pill">เข้าสู่ระบบ</button>
</form>
</div>
</div>
</div>
</div>
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
</body>
</html>