<?php

include '../../../script/conexion.php';

$referencia_producto = $_POST['referencia_producto'];
$id = $_POST['id'];

$sql2 = "SELECT * FROM alm_novedad WHERE id='$id'";
$query2 = $conn->query($sql2);
$row2 = $query2->fetch_assoc();

$talla = $row2['talla'];

$sql1 = "DELETE FROM alm_novedad WHERE id='$id'";
if ($conn->query($sql1) === TRUE) {


    $class_referencia = $referencia_producto;
    $class_talla = $talla;

    include '../../../clases/class-referencia.php';

    echo '<script language = javascript>
                        self.location = "../devolucion.php?referencia=' . $referencia_producto . '"
                </script>';
} else {
    echo "Error: " . $sql1 . "<br>" . $conn->error;
}
