<?
session_name('portal_absa');
session_start();
$arrHTTP = explode("?",trim(strtoupper($_SERVER['HTTP_REFERER'])));
$http = trim(strtoupper($arrHTTP[0]));

if(!isset($_SESSION['usuario_p_prov_absa']) || trim($_SESSION['usuario_p_prov_absa']) == "" || (trim(strtoupper($_SESSION["URL_PORTAL"]."FORMULARIOS/FORM_EXPEDIENTE_COMPLEMENTOPAGO.PHP")) != $http && trim(strtoupper($_SESSION["URL_PORTAL"]."FORMULARIOS/FORM_EXPEDIENTE_ICFDI.PHP")) != $http && trim(strtoupper($_SESSION["URL_PORTAL"]."FORMULARIOS/FORM_EXPEDIENTE_PAGO.PHP")) != $http)){
	?><script>window.close();</script><?
	exit;
}
require("../../conexion/conectar.php");
require("../../libs/funciones.php");

$conexion = new CONDB();
$conexion->conectar();
if(!isset($_REQUEST["uuidRecibe"])){
	?><script>$j_7.messager.alert("Error","Faltan parametros.","error");</script><?exit;
}
$uuid=$_REQUEST["uuidRecibe"];
$doce_uuid=$_REQUEST["doce_uuid"];
$qDelete = "delete from pago_documentos_ref where doce_uuid='$doce_uuid' and uuidcfdirelacionado='$uuid'";
if(mysqli_query($conexion->CONEXION,$qDelete)){
	setBitacora($conexion, $_SESSION['usuario_p_prov_absa'], $_SESSION['rfc_cliente_p_prov_absa'], "DELETE", "tabla pago_documentos_ref: quita documento pago_documentos_ref.", $qDelete);
	?><script>$j_7.messager.alert("Informacion.","Se ha logrado quitar el documento.","info");recargaExpediente();</script><?exit;
}else{
	?><script>$j_7.messager.alert("Error.","Ocurrio un error al quitar el documento.","error");</script><?exit;
}
?>