<?php
session_start();
require('../../conexion.php');

$id_nota = $_SESSION['cveNota'];
$id_pdn = $_POST['pdn_id'];
$total = $_POST['total'];
$subtotal = $_POST['subtotal'];
try {
    $query= query("UPDATE productos_nota SET pdn_estatus = 'eliminado', updated_at=CURRENT_TIME() 
WHERE id_nota_venta = $id_nota and id = $id_pdn");

    query("UPDATE notas_venta SET ntv_subtotal='$subtotal', ntv_total_nota='$total', updated_at=CURRENT_TIME() WHERE id='$id_nota';");

    echo 1;
} catch (Exception $e) {
    echo $e;
}


?>