<?php 
	ini_set('date.timezone','America/Lima');
	require_once("../include/InforegMod.php");
	$obj_ent=new InforegEnt();
	$obj_mod=new InforegMod();

	$obj_ent->setNombres($_POST['valor']);
	$obj_ent->setApellidos($_POST['valor']);
	$obj_ent->setPrograma($_POST['valor']);
	$obj_ent->setE_mail($_POST['valor']);
	$obj_ent->setTelefono($_POST['valor']);
	$obj_ent->setCelular($_POST['valor']);
	$obj_ent->setOrganizacion($_POST['valor']);
	$obj_ent->setCodsiaf($_POST['valor']);
	$obj_ent->setNombreu($_POST['valor']);
	$valor=$obj_mod->buscarInforeg($obj_ent);
?>
<?php 
	require_once("../include/UsuarioMod.php");
	$obj_ent=new UsuarioEnt();
	$obj_mod=new UsuarioMod();
	$obj_ent->setIdusua($_SESSION["session_edgard"]);
	$val=$obj_mod->mostrarUsuario($obj_ent);
	$idusua=$val->getIdusua();
	$nombreu=$val->getNombreu();
?>
<?php 
	//echo(date("d/m/Y", strtotime($arreglo[$i]->getFecha())));
	//echo date('h:i:s A');
	/*$fecha_actual = strtotime(date("d-m-Y H:i:00",time()));
	$fecha_entrada = strtotime("19-11-2008 21:00:00");
	if($fecha_actual > $fecha_entrada){
			echo "La fecha entrada ya ha pasado";
	}else{
			echo "Aun falta algun tiempo";
	}*/
	$fecha_actual=date("Y-m-d H:i:s");
?>
<style>
	.fila_0{background-color:#F0F0F9;}
	.fila_1{background-color:#FFFFFF;}
	
	
	.fuente{float: left; height: 50px; padding-left: 10px;font-size: 12px;display: flex;justify-content: center;align-content: center;flex-direction: column}
	.nom_ap{float: left;height: 50px; padding-left: 10px;display: flex;justify-content: center;align-content: center;flex-direction: column}
	.progra{float: left;height: 50px; padding-left: 10px;font-size: 12px;display: flex;justify-content: center;align-content: center;flex-direction: column}
	.correo{float: left;height: 50px; padding-left: 10px;font-size: 12px;display: flex;justify-content: center;align-content: center;flex-direction: column}
	.telefo{float: left;height: 50px; padding-left: 10px;font-size: 12px;display: flex;justify-content: center;align-content: center;flex-direction: column}
	.celula{float: left;height: 50px; padding-left: 10px;font-size: 12px;display: flex;justify-content: center;align-content: center;flex-direction: column}
	.entida{float: left;height: 50px; padding-left: 10px;font-size: 12px;display: flex;justify-content: center;align-content: center;flex-direction: column}
	.usuari{float: left;height: 50px; padding-left: 10px;font-size: 12px;display: flex;justify-content: center;align-content: center;flex-direction: column}
	.fechae{float: left;height: 50px; padding-left: 10px;font-size: 12px;display: flex;justify-content: center;align-content: center;flex-direction: column}
	.descar{float: left;height: 50px; padding-left: 10px;font-size: 17px;display: flex;justify-content: center;align-content: center;flex-direction: column}
	.subir_{float: left;height: 50px; padding-left: 10px;font-size: 17px;display: flex;justify-content: center;align-content: center;flex-direction: column}
	.atendi{float: left;height: 50px; padding-left: 10px;font-size: 17px;display: flex;justify-content: center;align-content: center;flex-direction: column;font-weight: bold;color: #057612}
	
	.nom{font-size: 14px;float: left}
	.ape{font-size: 12px;float: left}
	
</style>
<table width="100%">
	<tbody>
		<?php 
			if($valor!=0){for($i=0;$i<count($valor);$i++){ 
				$ifgx=$valor[$i]->getIdinforeg();
				$nmux=$valor[$i]->getNombreu();
				$nbsx=$valor[$i]->getNombres();
				$apsx=$valor[$i]->getApellidos();
				$eilx=$valor[$i]->getE_mail();
				$tlfx=$valor[$i]->getTelefono();
				$celx=$valor[$i]->getCelular();
				$orgx=$valor[$i]->getOrganizacion();
				$cdfx=$valor[$i]->getCodsiaf();
				$stdx=$valor[$i]->getEstado();
				$enlx=$valor[$i]->getEnlace();
				$prox=$valor[$i]->getPrograma();
				$fuex=$valor[$i]->getFuente();
				$ferx=$valor[$i]->getFecha_registro();
		?>
			
		<tr class="fila_<?= $i%2 ?>" style="color: <?php if($nmux=='' || $nmux==$nombreu){echo('#000000');}else{echo('#A4A4A4');} ?>";>
			<td width="4%" class="fuente"><?=$fuex?></td>
			<td width="10%" class="nom_ap">
				<span class="nom"><?=$nbsx?></span><br><span class="ape"><?=$apsx?></span>
			</td>
			<td width="6%" class="progra"><?=$prox?></td>
			<td width="15%" class="correo"><?=$eilx?></td>
			<td width="5%" class="telefo"> <?=$tlfx?></td>
			<td width="5%" class="celula"> <?=$celx?></td>
			<td width="27%" class="entida"> <?=$cdfx." ".$orgx?></td>
			<td width="4%" class="usuari"><span id="nombreu_<?=$ifgx?>"><?=$nmux?></span></td>
			<td width="5%" class="fechae">
				<span class="hint--top hint--small" data-hint="<?=date("d/m/Y", strtotime($ferx)) ?>">
								<?php 

						echo(date("h:i:s A", strtotime($ferx)));

					
				?>
				</span>

			</td>
			<td width="3%" align="center" class="descar">
				<?php if($nmux=='' || $nmux==$nombreu){ ?>
					<a href="file/inforeg/<?= $enlx ?>" download="<?= $enlx ?>" onClick="enlazarInforegUsuario('<?= $ifgx ?>','<?= $idusua ?>','<?= $nombreu ?>');">
						<span class="icon-arrow-down"></span>
					</a>
				<?php }else{ ?>
					<span>&nbsp;</span>
				<?php } ?>	
			</td>
			<td width="3%" align="center" class="subir_">
				<?php if($nmux=='' || $nmux==$nombreu){ ?>
				<a href="#" onClick="adjuntarClave('<?=$cdfx?>','<?=trim($orgx)?>','<?=trim($nbsx)?>','<?=trim($apsx)?>','<?=trim($eilx)?>','<?=$ifgx?>');">
					<?php if($nmux!=''){ ?>
						<span class="icon-arrow-up"></span>
					<?php } else {?>
						<span id="icar_<?= $ifgx ?>"></span>
					<?php } ?>
				</a>
				<?php }else{ ?>
					<span>&nbsp;</span>
				<?php } ?>
			</td>
			<td width="3%" align="center" class="atendi">
				<span id="atendi_<?=$ifgx?>"><?php if($stdx==1){echo('&check;');}else{echo('&nbsp;');} ?></span>
			</td>
		</tr>
		<?php }}else{?>
		<tr><td colspan="12" align="center">SIN INFOREG</td></tr>
		<?php } ?>
	</tbody>
</table>