<?
/*
Autor: Lic. Carlos Alberto Vaca Coronado
Version: 3.2.0
*/
session_name('portal_absa');
session_start();
if(!isset($_SESSION['usuario_p_prov_absa']) || trim($_SESSION['usuario_p_prov_absa']) == "" || trim(strtoupper($_SESSION["URL_PORTAL"]."admin.php")) != trim(strtoupper($_SERVER['HTTP_REFERER']))){
	?><script>window.location.href="<?=$_SESSION["URL_PORTAL"]."index.php"?>"</script><?
	exit;
}
require "../conexion/conectar.php";

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

$rfcemisor=$_POST['id'];
$tipodocto=$_POST['id2'];
$serie=$_POST['id3'];
$folio=$_POST['id4'];
$uuid=$_POST['id5'];
$numeroevento=$_POST['id6'];


$query="Select comentario from detallerecibedoce 
where rfcEmisor='$rfcemisor' and tipoDocto='$tipodocto' and serie='$serie' and folio='$folio' and uuid='$uuid' and numeroevento=$numeroevento limit 1";
$result = mysqli_query($conexion->CONEXION,$query);

if(mysqli_num_rows($result)>0){
	$tmp = mysqli_fetch_array($result,MYSQLI_ASSOC);
	if(trim($tmp["comentario"]) != "<<SAT>>"){
		echo str_replace("<<SAT>>","",$tmp["comentario"]);
	}else{
		echo "Falta verificaci&oacute;n del SAT";
	}
}

$conexion->desconectar();