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

try {
    $conn = connectDB();
    
    // Generate a new hash for 'admin123'
    $password = 'admin123';
    $hash = password_hash($password, PASSWORD_DEFAULT);
    
    // Update admin password
    $stmt = $conn->prepare("UPDATE admins SET password = :password WHERE username = 'admin'");
    $stmt->bindParam(':password', $hash);
    
    if ($stmt->execute()) {
        echo "Password admin berhasil diperbarui!<br>";
        echo "Username: admin<br>";
        echo "Password: admin123<br>";
    } else {
        echo "Gagal memperbarui password admin.";
    }
} catch (PDOException $e) {
    echo "Error: " . $e->getMessage();
}
?> 