<?php
// Include session check for admin protection
include('session_check.php');

// Include database configuration
include('../../config/database.php');

$username = 'admin';
$password = 'admin123';
$hashed_password = password_hash($password, PASSWORD_DEFAULT);

$sql = "INSERT INTO admin (username, password) VALUES (?, ?)";
if ($stmt = $conn->prepare($sql)) {
    $stmt->bind_param("ss", $username, $hashed_password);
    if ($stmt->execute()) {
        echo "Admin user created successfully.";
    } else {
        echo "Error creating admin user: " . $stmt->error;
    }
    $stmt->close();
} else {
    echo "Database error: Unable to prepare statement.";
}

$conn->close();
?>
