<?php
require_once 'config/database.php';

$admin_username = 'admin';
$admin_password = password_hash('admin123', PASSWORD_DEFAULT);
$admin_email = 'admin@hrsystem.com';

$stmt = $pdo->prepare("INSERT INTO users (username, password, email, role) VALUES (?, ?, ?, 'admin')");
$stmt->execute([$admin_username, $admin_password, $admin_email]);

echo "Admin user created successfully!<br>";
echo "Username: admin<br>";
echo "Password: admin123<br>";
echo "<a href='login.php'>Login Now</a>";

// Delete this file after use for security
// unlink(__FILE__);
?>