<?
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;
}
include "../../conexion/conectar.php";
require "../../libs/funciones.php";

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

$rfc=$_REQUEST['id'];
$tipodocto=$_REQUEST['id2'];
$serie=$_REQUEST['id3'];
$folio=$_REQUEST['id4'];
$uuid=$_REQUEST['id5'];

$completaQuery="";

if(trim($_REQUEST['id3']) != "")
	$completaQuery.=" and serie='$serie'";
if(trim($_REQUEST['id4']) != "")
	$completaQuery.=" and folio='$folio'";
if(trim($_REQUEST['id5']) != "")
	$completaQuery.=" and uuid='$uuid'";

$query="select id,concepto_pago,fecha_pago,referencia,monto from pago_doc_detalle where rfcemisor='$rfc' and tipodocto='$tipodocto' $completaQuery";
$result = mysqli_query($conexion->CONEXION,$query);
?>

<table class="td_general">
	<tr>
		<th width="50"></th>
		<th width="150">Referencia</th>
		<th width="200">Concepto</th>
		<th width="150">Fecha de pago</th>
		<th width="150">Monto</th>
	</tr>

<?
if(mysqli_num_rows($result) > 0){
	while($temp=mysqli_fetch_array($result,MYSQLI_ASSOC)){
?>
	<tr>
		<td><!--<img style="cursor:pointer" width="16" height="16" src="Imagenes/edit.png" onClick="editarPago(<?=$temp['id']?>,'<?=$temp['referencia']?>','<?=$temp['fecha_pago']?>','<?=$temp['concepto_pago']?>','<?=$temp['monto']?>')"/>-->
		<img style="cursor:pointer" title="Eliminar fecha de pago" width="16" height="16" src="Imagenes/remove_24.png" onClick="eliminarPago(<?=$temp['id']?>)"/></td>
		<td><?=$temp['referencia']?></td>
		<td><?=$temp['concepto_pago']?></td>
		<td><?=$temp['fecha_pago']?></td>
		<td><?=$temp['monto']?></td>
	</tr>
<?	}
}

?>

</table>