<?php
require_once __DIR__ . '/../../config.php';
$db = getDB();
$tables = ['transacciones', 'inversionista', 'depositos', 'pagovta', 'transaccion_adicionales', 'direccionenvio', 'pedido_real', 'banco'];
$result = [];
foreach ($tables as $t) {
    try {
        $stmt = $db->query("DESCRIBE `$t`");
        $cols = $stmt->fetchAll(PDO::FETCH_COLUMN);
        $result[$t] = $cols;
    } catch (Exception $e) {
        $result[$t] = 'ERROR: ' . $e->getMessage();
    }
}
header('Content-Type: application/json');
echo json_encode($result, JSON_PRETTY_PRINT);
