<?php
require_once __DIR__ . '/db/config.php';

try {
    $username = 'admin';
    $password = 'admin123';
    $hash = password_hash($password, PASSWORD_DEFAULT);
    $uid = '618120001';
    
    $stmt = db()->prepare("INSERT INTO users (username, email, password_hash, uid, role, credit_score) VALUES (?, ?, ?, ?, ?, ?)");
    $stmt->execute([$username, 'admin@byro.io', $hash, $uid, 'admin', 100]);
    
    echo "Admin user created successfully with password: admin123\n";
} catch (Exception $e) {
    echo "Error or Admin already exists: " . $e->getMessage() . "\n";
}
