<?php
header('Content-Type: application/json');
include("../conex.php");

$query = "SELECT idbodega AS id, detalle AS nombre FROM tb_bodega WHERE condicion = 1";
$result = mysqli_query($conn, $query);

$data = [];
while ($row = mysqli_fetch_assoc($result)) {
    $data[] = $row;
}

echo json_encode($data);
