<?php
define('SECURE_ACCESS', true);
require_once __DIR__ . '/../includes/config.php';
require_once __DIR__ . '/../includes/db.php';

try {
    $db = getDBConnection(true);
    
    // Simulate updating signup_bonus and referral_bonus
    $stmt = $db->prepare("INSERT INTO system_settings (key, value) VALUES (?, ?) ON CONFLICT (key) DO UPDATE SET value = EXCLUDED.value");
    $stmt->execute(['signup_bonus', '1500']);
    $stmt->execute(['referral_bonus', '600']);
    
    // Fetch them back
    $sel = $db->query("SELECT value FROM system_settings WHERE key = 'signup_bonus'")->fetchColumn();
    $sel2 = $db->query("SELECT value FROM system_settings WHERE key = 'referral_bonus'")->fetchColumn();
    
    if ($sel === '1500' && $sel2 === '600') {
        echo "Database Settings Update Verification: SUCCESS!\n";
    } else {
        echo "Database Settings Update Verification: FAILED (Values mismatch).\n";
    }
} catch (PDOException $e) {
    echo "Database error: " . $e->getMessage() . "\n";
}
