<?php
session_start();

// Hardcoded credentials (can later be moved to DB)
$admin_username = "admin";
$admin_password = "12345";

// Get data from form
$username = $_POST['username'] ?? '';
$password = $_POST['password'] ?? '';

if ($username === $admin_username && $password === $admin_password) {
    $_SESSION['admin_logged_in'] = true;
    header("Location: index.php");
    exit;
} else {
    echo "<script>alert('Invalid username or password!'); window.location.href='login.php';</script>";
}
