<?php
require_once('../../config/Conexion.php');

// Consultar ODF
$sql_odf = "SELECT * FROM odf";
$result_odf = $conexion->query($sql_odf);

$odfs = [];
while ($row = $result_odf->fetch_assoc()) {
    $odfs[] = $row;
}

// Consultar MUFA
$sql_mufa = "SELECT * FROM mufa";
$result_mufa = $conexion->query($sql_mufa);

$mufas = [];
while ($row = $result_mufa->fetch_assoc()) {
    $mufas[] = $row;
}

// Devolver datos en formato JSON
$response = [
    "odfs" => $odfs,
    "mufas" => $mufas
];

echo json_encode($response);

$conexion->close();
?>