<?php
require_once __DIR__ . '/admin-server/config/database.php';

function showDecryptedPix() {
    $pdo = getDBConnection();
    $stmt = $pdo->query("SELECT p.*, s.name as site_name FROM pix_config p JOIN sites s ON p.site_id = s.id");
    
    echo "--- CONFIGURAÇÕES PIX DECRIPTADAS ---
";
    while ($row = $stmt->fetch(PDO::FETCH_ASSOC)) {
        $decryptedKey = decryptData($row['pix_key']);
        echo "ID: {$row['id']} | Site: {$row['site_name']} ({$row['site_id']}) | Estado: {$row['state']}
";
        echo "Recebedor: {$row['receiver_name']} | Cidade: {$row['receiver_city']}
";
        echo "Chave Decriptada: {$decryptedKey}
";
        echo "-------------------------------------
";
    }
}

showDecryptedPix();
