<?php
  include("../clases/BDConexion.php");
  include("../clases/clsPer.php");
  include("Funciones.php");
  include("stilos/config.inc.php");
  session_start();
  $objPer=new clsPer;
?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>.::Buscar Pais::.</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">

<link href="Estilos.css" rel="stylesheet" type="text/css">

<link href="stilos/Estilos.css" rel="stylesheet" type="text/css">
<script>
function volver(form)
{
location.reload('sh_usuarios_lista.php');
}
</script>
<script language="javascript">
function cerrarPop() {
  opener.cerrar();
  window.close();
}
</script>


<script>
function ponPrefijo(pref,pref1,pref2){
	opener.document.form1.dociden_per.value=pref
	opener.document.form1.nombres.value=pref1
	opener.document.form1.codigo_mpass.value=pref2
	opener.document.form1.tipo_mpass.focus();			
	window.close()
}
</script>
<script> 
function centrar() { 
    iz=(screen.width-document.body.clientWidth) / 2; 
    de=(screen.height-document.body.clientHeight) / 2-50; 
    moveTo(iz,de); 
}     
</script>
<style type="text/css">
<!--
.Estilo1 {color: #000000}
.Estilo2 {font-size: 10px}
.Estilo3 {color: #000000; font-size: 10px; }
-->
</style>
</head>

<body background="../imagenes/fondo.jpg" onunload="opener.cerrar()" onLoad="document.form1.appat_per.focus();centrar()">
<table width="425" border="0" align="center" cellpadding="0" cellspacing="0" >
  <tr valign="top" >
  <form name="form1" method="post" action="cvp_pass_ver01.php">
    <td colspan="4">    <div align="left" class="lblCampo"><strong>Apellido Personal :</strong>      
      <input name="appat_per" type="text" class="lblForm" id="appat_per" size="30">
      
      
      <input type="submit" name="Submit" value="Buscar" style="<?=$stylo['st2']?>" class="botira">
</div>
	
	</td>
	</form>
  </tr>
  <tr class="lblCampo" >
    <td colspan="4"><div align="center">
      <table width="434" border="1" cellpadding="0" cellspacing="0" style="<?=$stylo['tabla']?>" bgcolor="<?=$c_fondo['fondo tabla']?>" bordercolor="<?=$bordetabla?>">
        <tr valign="top" class="lblCampoBlanco" bgcolor="<?=$c_fondo_tr["fondo tr"]?>">
          <td width="167"><div align="center" class="Estilo1 Estilo2">Apellidos </div></td>
          <td width="138"><div align="center" class="Estilo3">Nombres</div></td>
          <td><div align="left" class="Estilo3">Doc. de Identidad </div></td>
        </tr>
        <? 
				  if($appat_per!=""){
					$regxpag=10;
					if(!isset($pagina)){
					$pagina=0;
					}					
					$regini=$pagina*$regxpag;				   
				   	$resultado=$objPer->getPersonalPag01($appat_per,$regini,$regxpag);			   
                    while($filas=$objPer->NextRow($resultado))
                    {
				   ?>
        <tr valign="top" class="lblForm" >
          <td class="lblForm">
            <div align="left">
			<a href="#" class="lblForm" onClick="ponPrefijo('<? echo $filas['dociden_per'] ?>','<? echo $filas['nom_per'] ?> <? echo $filas['appat_per'] ?> <? echo $filas['apmat_per'] ?>','<? echo $filas['codigo_mpass'] ?>')">
			<font color="#0000FF"><U><? echo $filas['appat_per']; ?>
            <? echo $filas['apmat_per']; ?></U></font>
			</a>	
			</div></td>
          <td><div align="right" class="lblForm"> </div>             
            <div align="left">
			<a href="#" class="lblForm" onClick="ponPrefijo('<? echo $filas['dociden_per'] ?>','<? echo $filas['nom_per'] ?> <? echo $filas['appat_per'] ?> <? echo $filas['apmat_per'] ?>','<? echo $filas['codigo_mpass'] ?>')">
			<font color="#0000FF"><U><? echo $filas['nom_per']; ?></U></font>
			</a>			</div>
			</td>
          <td width="121">		  <div align="left">
		  <a href="#" class="lblForm" onClick="ponPrefijo('<? echo $filas['dociden_per'] ?>','<? echo $filas['nom_per'] ?> <? echo $filas['appat_per'] ?> <? echo $filas['apmat_per'] ?>','<? echo $filas['codigo_mpass'] ?>')">
		  <font color="#0000FF"><U><? echo $filas['dociden_per']; ?></U></font>
		  </a>
		  </div>
		  </td>
        </tr>
        <? 
			}
			$objPer->Liberar($resultado); 
		} 
			?>
        <?
			if($appat_per!=""){
			$resultado=$objPer->getPersonalT01($appat_per);			
			$nfilas=$objPer->totalrows($resultado);
			$ntotpag=floor(($nfilas/$regxpag));
			if(($nfilas%$regxpag)>0){$ntotpag++;}
			if($ntotpag>0){
			?>
        <tr valign="top" class="lblCampo" >
          <td colspan="3"><div align="left">
              <hr align="left" color="#000099">
          </div></td>
        </tr>
        <tr valign="top" class="lblCampo" >
          <td colspan="3"><div align="left" class="lblForm"> Pagina <? echo ($pagina+1);?> de <? echo $ntotpag;?> </div></td>
        </tr>
        <tr valign="top" class="lblForm" >
          <td colspan="3"><div align="center">
              <?
  for($i=0;$i<$ntotpag;$i++){
  	if($i==$pagina){
		echo "[".($i+1)."]";
	}else{ ?>
              <a href='<? echo $PHP_SELF."?pagina=$i&appat_per=$appat_per"?>'><? echo "[".($i+1)."]";?></a>
              <?
	}
	}
  ?>
          </div></td>
        </tr>
        <? }}?>
      </table>
        
    </div></td>
  </tr>
  <tr valign="top" class="lblCampo" >
    <td colspan="4">
      <div align="center"> </div></td>
  </tr>
</table>
</body>

</html>

