<?php
require_once(__DIR__ . '/../config/settings.php');
// Conexión PDO usando los datos de settings
try {
    $dsn = "dblib:host={$db_settings['host']};dbname={$db_settings['name']}";
    $pdo = new PDO($dsn, $db_settings['user'], $db_settings['pass']);
    
    $stmt = $pdo->query("SELECT id, name, url FROM Web_Downloads ORDER BY id DESC");
    echo json_encode($stmt->fetchAll(PDO::FETCH_ASSOC));
} catch (Exception $e) {
    echo json_encode([]);
}