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

// Create a test user
try {
    // Hash the password
    $hashed_password = password_hash('password123', PASSWORD_DEFAULT);
    
    // Insert the test user
    $stmt = $pdo->prepare("INSERT IGNORE INTO users (username, email, password, role) VALUES (?, ?, ?, 'user')");
    $stmt->execute(['testuser', 'test@example.com', $hashed_password]);
    
    echo "Test user created successfully!<br>";
    echo "Username: testuser<br>";
    echo "Password: password123<br>";
    echo "<br><a href='auth/login.php'>Login to test</a>";
} catch (Exception $e) {
    echo "Error: " . $e->getMessage();
}
?>