<?
require_once('../WS//lib/nusoap.php');
require_once('../WS/ws_SAT.php');
require_once('../conexion/conectar.php');

$conexion = new CONDB();
$conexion->conectar();

$re=$_REQUEST["id"];
$serie=$_REQUEST["id2"];
$folio=$_REQUEST["id3"];
$uuid=$_REQUEST["id4"];
$tipodocto=$_REQUEST["id5"];
$numeroevento=$_REQUEST["id6"];

$query ="select request,response from detallerecibedoce where numeroevento=$numeroevento and rfcemisor='$re' and tipodocto='$tipodocto' and serie='$serie' and folio='$folio' and uuid='$uuid'";

$rSAT = mysqli_query($conexion->CONEXION,$query);

if(mysqli_num_rows($rSAT) > 0){
	$tmpSAT = mysqli_fetch_array($rSAT,MYSQLI_ASSOC);
	$request = $tmpSAT['request'];
	$response = $tmpSAT['response'];
}else{
	echo "No se encontro el response de la verificación del CFDI,<br/>vuelva a intentar verificarlo.";
	exit;
}
echo htmlspecialchars($response,ENT_QUOTES);
