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

$password = 'Admin123!';
$hash = password_hash($password, PASSWORD_DEFAULT);

$emails = [
    'admin@flashcore.com',
    'user@flashcore.com',
    'qwerty@mail.com',
    'john.doe@example.com',
    'jane.smith@example.com'
];

try {
    foreach ($emails as $email) {
        $stmt = $pdo->prepare("UPDATE users SET password_hash = ? WHERE email = ?");
        $stmt->execute([$hash, $email]);
        if ($stmt->rowCount() > 0) {
            echo "Updated password for $email\n";
        } else {
            // If user doesn't exist, maybe we should create them?
            // For now just report.
            echo "User $email not found or already has this password.\n";
        }
    }
    echo "Password reset complete.\n";
} catch (Exception $e) {
    echo "Error: " . $e->getMessage() . "\n";
}
?>
