<?php
/* Connect To Database*/
require_once "../db.php";
require_once "../php_conexion.php";
//Archivo de funciones PHP
require_once "../funciones.php";

if(isset($_POST['id_tmp'])) {
    $id_tmp = intval($_POST['id_tmp']);
    $query = mysqli_query($conexion, "SELECT detalle FROM tmp_ventas WHERE id_tmp = '$id_tmp'");
    $row = mysqli_fetch_assoc($query);
    
    header('Content-Type: application/json');
    echo json_encode(array(
        'detalle' => $row['detalle'] ?? ''
    ));
}
?>