<?php
include 'config.php';

// الباسورد الجديدة اللي هنثبتها
$new_password = 'admin123';
$hashed_password = password_hash($new_password, PASSWORD_DEFAULT);

try {
    // تحديث باسورد اليوزر اللي اسمه admin
    $stmt = $pdo->prepare("UPDATE users SET password = ? WHERE username = 'admin'");
    $stmt->execute([$hashed_password]);

    if($stmt->rowCount() > 0) {
        echo "Successfully updated! <br>";
        echo "Username: admin <br>";
        echo "Password: admin123 <br>";
        echo "<a href='login.php'>Go to Login</a>";
    } else {
        echo "User 'admin' not found in database. Make sure you ran the SQL insert first.";
    }
} catch (Exception $e) {
    echo "Error: " . $e->getMessage();
}
?>