<?php
session_start();
require_once __DIR__ . '/../config/config.php';
require_once __DIR__ . '/../config/database.php';

$user = dbFetch('SELECT * FROM users LIMIT 1');
if($user) {
    $_SESSION['user_id'] = $user['id'];
    $_SESSION['user_type'] = 'user';
    $_SESSION['account_type'] = 'live';
    
    // Give user some balance so they can withdraw
    dbUpdate('user_wallets', ['balance' => 5000], 'user_id = :id', ['id' => $user['id']]);
    
    header('Location: withdraw.php');
} else {
    echo "NO USER FOUND!";
}
