Files
2026-01-07 14:09:59 +08:00

690 lines
26 KiB
PHP

<?php
require_once 'includes/config.php';
// Start session if not started
if (session_status() === PHP_SESSION_NONE) {
session_start();
}
// Check if user is logged in and redirect accordingly
if (isset($_SESSION['logged_in']) && $_SESSION['logged_in'] === true) {
// Redirect based on role
$redirect_url = 'student/dashboard.php'; // Default
if (isset($_SESSION['role'])) {
switch ($_SESSION['role']) {
case 'admin':
$redirect_url = 'admin/dashboard.php';
break;
case 'teacher':
$redirect_url = 'teacher/dashboard.php';
break;
case 'student':
$redirect_url = 'student/dashboard.php';
break;
}
}
header('Location: ' . $redirect_url);
exit();
}
// Database connection for stats (with error handling)
function getDatabaseStats($query, $default = '0') {
global $conn; // Use the connection from config.php
if (!isset($conn)) {
return $default;
}
try {
$result = mysqli_query($conn, $query);
if ($result && mysqli_num_rows($result) > 0) {
$row = mysqli_fetch_assoc($result);
return number_format($row['total']);
}
return $default;
} catch (Exception $e) {
return $default;
}
}
// Get statistics
$active_students = getDatabaseStats("SELECT COUNT(*) as total FROM students WHERE status = 1", '0');
$course_count = getDatabaseStats("SELECT COUNT(DISTINCT id) as total FROM courses WHERE status = 1", '12');
$today_checkins = getDatabaseStats("SELECT COUNT(*) as total FROM attendance WHERE DATE(created_at) = CURDATE()", '0');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Attendance Management System - Aldersgate College</title>
<!-- Bootstrap 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.0/font/bootstrap-icons.css">
<!-- Google Fonts -->
<link href="https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700&display=swap" rel="stylesheet">
<style>
:root {
--primary-color: #167c16;
--secondary-color: #aebe22;
--accent-color: #0a5e0a;
--light-green: #e8f5e8;
--dark-green: #0c4d0c;
}
body {
font-family: 'Poppins', sans-serif;
background-color: #f8f9fc;
min-height: 100vh;
}
/* Navigation */
.navbar {
background: white;
box-shadow: 0 2px 10px rgba(0,0,0,0.1);
padding: 15px 0;
transition: all 0.3s ease;
}
.navbar.scrolled {
padding: 10px 0;
}
.navbar-brand {
font-weight: 700;
color: var(--primary-color) !important;
font-size: 1.5rem;
}
.nav-link {
color: #333 !important;
font-weight: 500;
padding: 8px 16px !important;
transition: color 0.3s;
}
.nav-link:hover {
color: var(--primary-color) !important;
}
/* Hero Section */
.hero-section {
background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
color: white;
padding: 120px 0 80px;
position: relative;
overflow: hidden;
}
.hero-section::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: url('assets/images/ACbackground.png') no-repeat center center/cover;
opacity: 0.1;
}
.hero-title {
font-size: 3rem;
font-weight: 700;
margin-bottom: 1.5rem;
text-shadow: 2px 2px 4px rgba(0,0,0,0.2);
}
.hero-subtitle {
font-size: 1.25rem;
opacity: 0.95;
margin-bottom: 2rem;
line-height: 1.6;
}
/* Features Section */
.features-section {
padding: 80px 0;
background-color: var(--light-green);
}
.section-title {
color: var(--dark-green);
font-weight: 700;
margin-bottom: 3rem;
text-align: center;
}
.feature-card {
background: white;
border: none;
border-radius: 15px;
padding: 30px;
text-align: center;
box-shadow: 0 5px 20px rgba(0,0,0,0.05);
transition: all 0.3s ease;
height: 100%;
}
.feature-card:hover {
transform: translateY(-10px);
box-shadow: 0 15px 30px rgba(0,0,0,0.1);
}
.feature-icon {
width: 80px;
height: 80px;
background: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 25px;
color: white;
font-size: 2rem;
}
.feature-title {
color: var(--dark-green);
font-weight: 600;
margin-bottom: 15px;
}
/* Stats Section */
.stats-section {
padding: 60px 0;
background: white;
}
.stat-card {
text-align: center;
padding: 30px 20px;
}
.stat-number {
font-size: 3rem;
font-weight: 700;
color: var(--primary-color);
margin-bottom: 10px;
line-height: 1;
}
.stat-label {
color: #666;
font-size: 1rem;
text-transform: uppercase;
letter-spacing: 1px;
}
/* About Section */
.about-section {
padding: 80px 0;
background-color: #f8f9fa;
}
.ac-logo {
max-width: 300px;
height: auto;
margin-bottom: 30px;
}
/* Buttons */
.btn-primary {
background: var(--primary-color);
border: none;
padding: 12px 30px;
border-radius: 50px;
font-weight: 600;
transition: all 0.3s ease;
}
.btn-primary:hover {
background: var(--dark-green);
transform: translateY(-2px);
box-shadow: 0 5px 15px rgba(10, 94, 10, 0.3);
}
.btn-outline-primary {
color: var(--primary-color);
border: 2px solid var(--primary-color);
background: transparent;
padding: 12px 30px;
border-radius: 50px;
font-weight: 600;
transition: all 0.3s ease;
}
.btn-outline-primary:hover {
background: var(--primary-color);
color: white;
transform: translateY(-2px);
}
/* Footer */
.footer {
background: var(--dark-green);
color: white;
padding: 40px 0 20px;
}
.footer-links a {
color: rgba(255,255,255,0.8);
text-decoration: none;
transition: color 0.3s;
}
.footer-links a:hover {
color: white;
}
.footer-links li {
margin-bottom: 10px;
}
.copyright {
border-top: 1px solid rgba(255,255,255,0.1);
padding-top: 20px;
margin-top: 40px;
}
/* Responsive Design */
@media (max-width: 768px) {
.hero-title {
font-size: 2.2rem;
}
.hero-subtitle {
font-size: 1.1rem;
}
.hero-section {
padding: 100px 0 60px;
}
.stat-number {
font-size: 2.5rem;
}
}
@media (max-width: 576px) {
.hero-title {
font-size: 1.8rem;
}
.navbar-brand {
font-size: 1.2rem;
}
}
/* Animation */
@keyframes fadeInUp {
from {
opacity: 0;
transform: translateY(30px);
}
to {
opacity: 1;
transform: translateY(0);
}
}
.animate-fade-in-up {
animation: fadeInUp 0.6s ease-out forwards;
}
</style>
</head>
<body>
<!-- Navigation -->
<nav class="navbar navbar-expand-lg navbar-light fixed-top">
<div class="container">
<a class="navbar-brand d-flex align-items-center" href="index.php">
<span>Attendance Management System</span>
</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarNav">
<ul class="navbar-nav ms-auto">
<li class="nav-item">
<a class="nav-link" href="#features">Features</a>
</li>
<li class="nav-item">
<a class="nav-link" href="#about">About</a>
</li>
<li class="nav-item ms-2">
<a href="auth/login.php" class="btn btn-primary">
<i class="bi bi-box-arrow-in-right me-2"></i>Login
</a>
</li>
</ul>
</div>
</div>
</nav>
<!-- Hero Section -->
<section class="hero-section">
<div class="container">
<div class="row align-items-center">
<div class="col-lg-6">
<h1 class="hero-title animate-fade-in-up">Attendance Management System</h1>
<p class="hero-subtitle animate-fade-in-up" style="animation-delay: 0.1s;">
A modern, efficient, and contactless attendance system using QR code technology.
Perfect for Aldersgate College's digital transformation needs.
</p>
<div class="animate-fade-in-up" style="animation-delay: 0.2s;">
<a href="auth/login.php" class="btn btn-primary me-3">
<i class="bi bi-box-arrow-in-right me-2"></i>Get Started
</a>
<a href="#features" class="btn btn-outline-primary text-white border-white">
<i class="bi bi-info-circle me-2"></i>Learn More
</a>
</div>
</div>
<div class="col-lg-6">
<div class="text-center mt-5 mt-lg-0">
<img src="assets/images/AClogo.png"
alt="Aldersgate College Logo"
class="img-fluid animate-fade-in-up"
style="max-height: 300px; animation-delay: 0.3s;">
</div>
</div>
</div>
</div>
</section>
<!-- Stats Section -->
<section class="stats-section">
<div class="container">
<div class="row text-center">
<div class="col-md-3 col-6 mb-4">
<div class="stat-card">
<div class="stat-number"><?php echo $active_students; ?></div>
<div class="stat-label">Active Students</div>
</div>
</div>
<div class="col-md-3 col-6 mb-4">
<div class="stat-card">
<div class="stat-number"><?php echo $course_count; ?></div>
<div class="stat-label">Courses</div>
</div>
</div>
<div class="col-md-3 col-6 mb-4">
<div class="stat-card">
<div class="stat-number"><?php echo $today_checkins; ?></div>
<div class="stat-label">Today's Check-ins</div>
</div>
</div>
<div class="col-md-3 col-6 mb-4">
<div class="stat-card">
<div class="stat-number">99.9%</div>
<div class="stat-label">Accuracy Rate</div>
</div>
</div>
</div>
</div>
</section>
<!-- Features Section -->
<section id="features" class="features-section">
<div class="container">
<h2 class="section-title">Key Features</h2>
<div class="row">
<div class="col-lg-4 col-md-6 mb-4">
<div class="feature-card animate-fade-in-up">
<div class="feature-icon">
<i class="bi bi-qr-code-scan"></i>
</div>
<h4 class="feature-title">QR Code Attendance</h4>
<p class="text-muted mb-0">
Quick and contactless attendance marking with unique student QR codes.
</p>
</div>
</div>
<div class="col-lg-4 col-md-6 mb-4">
<div class="feature-card animate-fade-in-up" style="animation-delay: 0.1s;">
<div class="feature-icon">
<i class="bi bi-graph-up"></i>
</div>
<h4 class="feature-title">Real-time Analytics</h4>
<p class="text-muted mb-0">
Comprehensive dashboards and detailed attendance reports.
</p>
</div>
</div>
<div class="col-lg-4 col-md-6 mb-4">
<div class="feature-card animate-fade-in-up" style="animation-delay: 0.2s;">
<div class="feature-icon">
<i class="bi bi-people-fill"></i>
</div>
<h4 class="feature-title">Student Management</h4>
<p class="text-muted mb-0">
Manage profiles, courses, and departments with bulk import.
</p>
</div>
</div>
<div class="col-lg-4 col-md-6 mb-4">
<div class="feature-card animate-fade-in-up">
<div class="feature-icon">
<i class="bi bi-calendar-event"></i>
</div>
<h4 class="feature-title">Activity Scheduling</h4>
<p class="text-muted mb-0">
Schedule classes, seminars, and events with specific time slots.
</p>
</div>
</div>
<div class="col-lg-4 col-md-6 mb-4">
<div class="feature-card animate-fade-in-up" style="animation-delay: 0.1s;">
<div class="feature-icon">
<i class="bi bi-bell-fill"></i>
</div>
<h4 class="feature-title">Smart Notifications</h4>
<p class="text-muted mb-0">
Automated alerts for attendance, events, and announcements.
</p>
</div>
</div>
<div class="col-lg-4 col-md-6 mb-4">
<div class="feature-card animate-fade-in-up" style="animation-delay: 0.2s;">
<div class="feature-icon">
<i class="bi bi-shield-check"></i>
</div>
<h4 class="feature-title">Secure & Reliable</h4>
<p class="text-muted mb-0">
Role-based access control with enterprise-grade security.
</p>
</div>
</div>
</div>
</div>
</section>
<!-- About Section -->
<section id="about" class="about-section">
<div class="container">
<div class="row align-items-center">
<div class="col-lg-6 text-center mb-5 mb-lg-0">
<img src="assets/images/AClogo.png" alt="Aldersgate College" class="ac-logo">
<h3 class="mb-3" style="color: var(--dark-green);">Aldersgate College</h3>
<p class="text-muted mb-4">
Solano, Nueva Vizcaya<br>
Excellence in Education Since 1947
</p>
</div>
<div class="col-lg-6">
<h2 class="mb-4" style="color: var(--dark-green);">About This System</h2>
<p class="mb-4">
Developed specifically for Aldersgate College, this system modernizes and
streamlines attendance tracking across all departments and courses with
cutting-edge QR code technology.
</p>
<div class="row mb-4">
<div class="col-md-6 mb-3">
<div class="d-flex align-items-start">
<i class="bi bi-check-circle-fill text-success me-3 mt-1"></i>
<div>
<h6 class="mb-1">Contactless Operation</h6>
<small class="text-muted">No physical contact required</small>
</div>
</div>
</div>
<div class="col-md-6 mb-3">
<div class="d-flex align-items-start">
<i class="bi bi-check-circle-fill text-success me-3 mt-1"></i>
<div>
<h6 class="mb-1">Real-time Tracking</h6>
<small class="text-muted">Live attendance monitoring</small>
</div>
</div>
</div>
<div class="col-md-6 mb-3">
<div class="d-flex align-items-start">
<i class="bi bi-check-circle-fill text-success me-3 mt-1"></i>
<div>
<h6 class="mb-1">Easy Integration</h6>
<small class="text-muted">Works with existing systems</small>
</div>
</div>
</div>
<div class="col-md-6 mb-3">
<div class="d-flex align-items-start">
<i class="bi bi-check-circle-fill text-success me-3 mt-1"></i>
<div>
<h6 class="mb-1">Mobile Ready</h6>
<small class="text-muted">Accessible on all devices</small>
</div>
</div>
</div>
</div>
<div>
<a href="auth/login.php" class="btn btn-primary">
<i class="bi bi-box-arrow-in-right me-2"></i>Access System
</a>
</div>
</div>
</div>
</div>
</section>
<!-- Footer -->
<footer class="footer">
<div class="container">
<div class="row">
<div class="col-lg-6 mb-4">
<h5 class="mb-3">Attendance Management System</h5>
<p class="mb-4" style="color: rgba(255,255,255,0.8);">
A comprehensive solution for modernizing attendance tracking
at Aldersgate College with QR code technology.
</p>
<div class="d-flex gap-3">
<a href="https://www.facebook.com/imjohnlloyd26/" class="text-white"><i class="bi bi-facebook"></i></a>
<a href="https://www.instagram.com/im_johnlloyd6/" class="text-white"><i class="bi bi-instagram"></i></a>
</div>
</div>
<div class="col-lg-3 col-md-6 mb-4">
<h5 class="mb-3">Quick Links</h5>
<ul class="list-unstyled footer-links">
<li><a href="#features">Features</a></li>
<li><a href="#about">About</a></li>
<li><a href="auth/login.php">Login</a></li>
</ul>
</div>
<div class="col-lg-3 col-md-6 mb-4">
<h5 class="mb-3">Contact Info</h5>
<ul class="list-unstyled footer-links">
<li class="mb-2">
<i class="bi bi-geo-alt me-2"></i>
Solano, Nueva Vizcaya
</li>
<li class="mb-2">
<i class="bi bi-envelope me-2"></i>
johnlloydsumawang04@gmail.com
</li>
</ul>
</div>
</div>
<div class="row copyright">
<div class="col-md-6">
<p class="mb-0" style="color: rgba(255,255,255,0.6);">
&copy; <?php echo date('Y'); ?> Attendance Management System.
</p>
</div>
<div class="col-md-6 text-md-end">
<p class="mb-0" style="color: rgba(255,255,255,0.6);">
Programmed by <span class="text-white">John Lloyd Sumawang</span>
</p>
</div>
</div>
</div>
</footer>
<!-- Bootstrap JS -->
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
// Smooth scrolling for anchor links
document.querySelectorAll('a[href^="#"]').forEach(anchor => {
anchor.addEventListener('click', function(e) {
const targetId = this.getAttribute('href');
if (targetId === '#') return;
e.preventDefault();
const targetElement = document.querySelector(targetId);
if (targetElement) {
window.scrollTo({
top: targetElement.offsetTop - 80,
behavior: 'smooth'
});
}
});
});
// Navbar scroll effect
const navbar = document.querySelector('.navbar');
window.addEventListener('scroll', function() {
if (window.scrollY > 50) {
navbar.classList.add('scrolled');
navbar.classList.add('shadow');
} else {
navbar.classList.remove('scrolled');
navbar.classList.remove('shadow');
}
});
// Animate elements on scroll
const animateOnScroll = function() {
const elements = document.querySelectorAll('.animate-fade-in-up');
elements.forEach(element => {
const elementTop = element.getBoundingClientRect().top;
const elementVisible = 150;
if (elementTop < window.innerHeight - elementVisible) {
element.style.opacity = "1";
element.style.transform = "translateY(0)";
}
});
};
// Set initial state for animated elements
document.querySelectorAll('.animate-fade-in-up').forEach(el => {
el.style.opacity = "0";
el.style.transform = "translateY(30px)";
el.style.transition = "opacity 0.6s ease, transform 0.6s ease";
});
// Trigger animation on load and scroll
window.addEventListener('load', animateOnScroll);
window.addEventListener('scroll', animateOnScroll);
});
</script>
</body>
</html>