<?php
/**
 * Fix Admin Password
 * Upload this file to your server and run it once
 * Then delete it for security
 */

require_once __DIR__ . '/config/database.php';

try {
    $db = getDB();
    
    // Generate new password hash
    $password = 'AntorNusrat@@13';
    $hash = password_hash($password, PASSWORD_BCRYPT, ['cost' => 12]);
    
    // Update admin password
    $stmt = $db->prepare("UPDATE admins SET password = ? WHERE email = 'xantuf@gmail.com'");
    $stmt->execute([$hash]);
    
    echo "✅ Password updated successfully!\n\n";
    echo "Email: xantuf@gmail.com\n";
    echo "Password: AntorNusrat@@13\n\n";
    echo "You can now login to the admin panel.\n";
    echo "⚠️ DELETE THIS FILE IMMEDIATELY for security!\n";
    
} catch (Exception $e) {
    echo "❌ Error: " . $e->getMessage() . "\n";
}
?>
