<?php
  include("stilos/config.inc.php");
  include("../clases/BDConexion.php");
  include("../clases/clsPer.php");
  include("Funciones.php");
  include("funcion/funciones.php");
  session_start();
  $objPer=new clsPer;
  $resultado=$objPer->getPerDatos($dociden_per);
  $filas=$objPer->NextRow($resultado);
  //$cod_per=$filas['valor_e'].getNumCeros($filas['valor']);
  $cod_per=$filas['cod_per'];
  $nom_per=$filas['nom_per'];
  $appat_per=$filas['appat_per'];
  $apmat_per=$filas['apmat_per'];
  $fnac_per=extraerfechanormal($filas['fnac_per']);
  $fono_per=$filas['fono_per'];
  $dni=$filas['dociden_per'];
  $cargo_per=$filas['cargo_per'];
  $peso_per=$filas['peso_per'];
  $cod_emp=$filas['cod_emp'];
  $cod_pais=$filas['cod_pais'];
  $foto=$filas['foto'];
  $dir_per=$filas['dir_per'];
  $estcivil_per=$filas['estcivil_per'];
  $afp_per=$filas['afp_per'];
  $numafp_per=$filas['numafp_per'];
  $seguro_per=$filas['seguro_per'];
  $numhijos_per=$filas['numhijos_per'];
  $fcontra_per=extraerfechanormal($filas['fcontra_per']);
  $profesion=$filas['profesion'];
  $vacunas=$filas['vacunas'];
  $email=$filas['email'];
  $ruc=$filas['ruc'];
  $seguro_per=$filas['seguro_per'];
  $pasaporte=$filas['pasaporte'];
  $lm=$filas['lm'];
  $carnet=$filas['carnet'];
  $onp=$filas['onp'];
  $num_onp=$filas['num_onp'];
  session_register("familiar");
  if($borrar==1){
  $familiar = array();  
  }
?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title><MMString:LoadString id="insertbar/formsHidden" /></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 language=JavaScript src="js/calendario.js"></SCRIPT>
<script language="JavaScript"> 
<!--
//sURL,x,y
function Abrir_Ventanapopup1(sURL,x,y) { 
/*var especificaciones="top=0, left=0, toolbar=no,location=no, status=yes,menubar=no,scrollbars=no, resizable=no, width=1,height=1" 
var titulo="Titulo"
window.open(el_url,titulo,especificaciones);*/ 

if (!window.focus) return;
			var par;
			par = "width=" +x + ",height="+y+","
			par = par + "dependent=no,scrollbars=yes,resizable=no"
			par = par + "menubar=no,toolbar=no,status=yes"
			var ventana = window.open(sURL,"Ver",par)
			ventana.focus();
}
//--> 
</script>
<? 
$envia="cvp_cons_per.php?tipo=$tipo&des=$des&pagina=$pagina";
$envia1="cvp_personal.php";
?>
<script>
function volverB(form)
{
location.reload('<? echo $envia1 ?>');
}
function volver(form)
{
location.reload('<? echo $envia ?>');
}
var vent = null;
function foco() {
   if (vent != null)
       vent.focus();
}
function cerrar() {
   vent = null;
}

</script>
<script language="JavaScript">
function selecciona(form)
{
 if(form.botones1.value)
  {
   form.zonasi.disabled=true;
  }
}

function cierra(form)
{
location.reload('../ventana.php');
}
function activainter(form)
{
   form.pais2.disabled=false;
   form.ciudad2.disabled=false;
   form.nacionalidad2.disabled=false;
   form.btn_ver2.disabled=false;
   form.btn_nuevo2.disabled=false;
   
   form.pais.value="";
   form.pais.disabled=true;
   form.ciudad.value="";
   form.ciudad.disabled=true;
   form.nacionalidad.value="";
   form.nacionalidad.disabled=true;
   form.idciudad1.value="";
   form.btn_ver1.disabled=true;
   form.btn_nuevo1.disabled=true;
}
</script>
<SCRIPT LANGUAGE=javascript>
function fn(form,field)
{
var next=0, found=false
var f=form
if(event.keyCode!=13) return;
for(var i=0;i<f.length;i++) {
if(field.name==f.item(i).name){
next=i+1;
found=true
break;
}
}
while(found){
if( f.item(next).disabled==false && f.item(next).type!='hidden'){
f.item(next).focus();
break;
}
else{
if(next<f.length-1)
next=next+1;
else
break;
}
}
}
</SCRIPT>
<script>
function enviar_url(form,url)
{

		/*if(form1.cod_per.value==""){
		alert("Debe Ingresar el codigo del personal");
		form1.cod_per.focus();
		return;		
	    }
		if(form1.nom_per.value==""){
		alert("Debe Ingresar el codigo del personal");
		form1.nom_per.focus;
		return;		
	    }
		if(form1.appat_per.value==""){
		alert("Debe Ingresar el apellido paterno del personal");
		form1.appat_per.focus;
		return;		
	    }
		if(form1.apmat_per.value==""){
		alert("Debe Ingresar el apellido materno del personal");
		form1.apmat_per.focus;
		return;		
	    }
		if(form1.fnac_per.value==""){
		alert("Debe Ingresar la fecha de nacimiento del personal");
		form1.fnac_per.focus;
		return;		
	    }
		if(form1.cod_emp.value==""){
		alert("Debe Ingresar la empresa del personal");
		form1.cod_emp.focus;
		return;		
	    }
		if(form1.cod_pais.value==""){
		alert("Debe Ingresar el pais del personal");
		form1.cod_pais.focus;
		return;		
	    }
		if(form1.fono_per.value==""){
		alert("Debe Ingresar el telefono del personal");
		form1.fono_per.focus;
		return;		
	    }
		if(form1.cargo_per.value==""){
		alert("Debe Ingresar el cargo del personal");
		form1.cargo_per.focus;
		return;		
	    }
		if(form1.dociden_per.value==""){
		alert("Debe Ingresar el doc de identidad del personal");
		form1.dociden_per.focus;
		return;		
	    }
		if(form1.peso_per.value==""){
		alert("Debe Ingresar el peso del personal");
		form1.peso_per.focus;
		return;		
	    }*/
		if(form1.button.value)
		{
		form1.submit();
		}
}
</script>
<script>
function poner_imagen()
{
imagen1=new Image;
imagen1.src=document.form1.foto.value;
document.imagenes['foto'].src=imagen1.src;
}
</script>
<script language="javascript">
<!--
var msg = "Función anulada.";
function RClick(boton){
if (document.layers && boton.which == 3) {
alert(msg); return false; }
if (document.all && event.button == 2 || event.button == 3) {
alert(msg); return false; }
}
document.onmousedown = RClick
//-->
</script>
</head>

<body bgcolor="<?=$c_fondo['fondo']?>" onfocus="foco()" background="../imagenes/fondo.jpg">
        <form name="form1" method="post" action="procesos/cvp_per_family_editar.php" enctype="multipart/form-data">
          <table width="850" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td width="25"><img src="../estilo_tabla/parte_sup_izq.gif" width="25" height="25"></td>
              <td width="800" background="../estilo_tabla/parte_sup_cen.gif" valign="bottom">
                <div align="left" class="lblTitulo" >Ficha de Datos del Personal </div></td>
              <td width="25"><img src="../estilo_tabla/parte_sup_der.gif" width="25" height="25" border="0" usemap="#MapMap"></td>
            </tr>
            <tr>
              <td  background="../estilo_tabla/parte_med_izq.gif">&nbsp;</td>
              <td  height="86" background="../estilo_tabla/parte_med_cen.gif"><div align="center">
                  <table width="790" border="0" cellspacing="0" cellpadding="0">
                    <tr class="lblCampo">
                      <td colspan="6">&nbsp; </td>
                    </tr>
                    <tr class="lblCampo">
                      <td width="120"><div align="left">Apellido Pat </div></td>
                      <td width="5"><div align="left">:</div></td>
                      <td width="208"><div align="left">
                        <input name="appat_per" type="text" id="appat_per2" onKeyUp="fn(this.form,this);form1.appat_per.value=form1.appat_per.value.toUpperCase();" value="<? echo $appat_per?>" size="35">
                      </div></td>
                      <td width="96">&nbsp;</td>
                      <td width="5"><div align="left"></div></td>
                      <td width="245" rowspan="9" valign="middle">
					  <div align="center">
					    <table width="242" border="0" cellpadding="0" cellspacing="0">
                          <tr align="center">
                            <td><div align="center">
                                <? if($foto!=""){?>
                                <img src="../../fotos_per/<? echo $foto?>" width="100" height="133">
                                <? }else{?>
                                <img src="../../fotos_per/desconocido.gif" width="100" height="133">
                                <? }?>
                                <br>
                            </div></td>
                          </tr>
                          <tr>
                            <td><div align="right"> </div>                              <div align="center"> </div>                              <div align="left">
                              <input type="file" name="file" onKeyUp="fn(this.form,this)"> 
                              </div></td>
                          </tr>
                        </table>
                      </div>
					  </td>
                    </tr>
                    <tr class="lblCampo">
                      <td><div align="left">Apellido Mat </div></td>
                      <td><div align="left">:</div></td>
                      <td>
                        <div align="left">
                          <input name="apmat_per" type="text" id="apmat_per2" onKeyUp="fn(this.form,this);form1.apmat_per.value=form1.apmat_per.value.toUpperCase();" value="<? echo $apmat_per?>" size="35">
</div></td>
                      <td>&nbsp;</td>
                      <td><div align="left"></div></td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Nombres</td>
                      <td>&nbsp;</td>
                      <td><input name="nom_per" type="text" id="nom_per" onKeyUp="fn(this.form,this);form1.nom_per.value=form1.nom_per.value.toUpperCase();" value="<? echo $nom_per?>" size="45" maxlength="45"></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td><div align="left">Direccion</div></td>
                      <td><div align="left"></div></td>
                      <td><div align="left">
                          <input name="dir_per" type="text" id="dir_per" value="<? echo $dir_per?>" size="35" onKeyUp="fn(this.form,this);form1.dir_per.value=form1.dir_per.value.toUpperCase();">
                      </div></td>
                      <td><div align="left"></div></td>
                      <td><div align="left"></div></td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Telefono</td>
                      <td>&nbsp;</td>
                      <td><input name="fono_per" type="text" id="fono_per2" onKeyUp="fn(this.form,this);form1.fono_per.value=form1.fono_per.value.toUpperCase();" value="<? echo $fono_per?>" size="30"></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Email</td>
                      <td>&nbsp;</td>
                      <td><input name="email" type="text" id="email" value="<? echo $email?>" onKeyUp="fn(this.form,this)"></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Estado Civil </td>
                      <td>&nbsp;</td>
                      <td><select name="estcivil_per" id="select4" onKeyUp="fn(this.form,this)">
                        <option value="0">SELECCIONE</option>
                        <option value="Soltero(a)" <? if($estcivil_per=="Soltero(a)"){?> selected <? }?>>Soltero(a)</option>
                        <option value="Casado(a)" <? if($estcivil_per=="Casado(a)"){?> selected <? }?>>Casado(a)</option>
                        <option value="Viudo(a)" <? if($estcivil_per=="Viudo(a)"){?> selected <? }?>>Viudo(a)</option>
                        <option value="Divorsiado(a)" <? if($estcivil_per=="Divorsiado(a)"){?> selected <? }?>>Divorsiado(a)</option>
						<option value="Conviviente" <? if($estcivil_per=="Conviviente"){?> selected <? }?>>Conviviente</option>
                      </select></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Compania</td>
                      <td>&nbsp;</td>
                      <td><div align="left">
                        <select name="cod_emp" id="select2" onkeyup=fn(this.form,this)>
                          <option value="0">Varios</option>
                          <? 
							echo $objPer->getCboEmp($cod_emp);
							?>
                        </select>
                      </div></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td colspan="6"><div align="left">
					  <iframe name="detalle" src="cvp_per_family_det.php?dociden_per=<? echo $dociden_per?>&q=<? echo $q?>" width="835" height="200" marginheight="0" marginwidth="0" frameborder="0" scrolling="yes"></iframe>
					  </div>
					  </td>
                    </tr>
                    <tr class="lblCampo">
                      <td><div align="left">Profesion/Ocupacion</div></td>
                      <td>:</td>
                      <td colspan="2"><div align="left">
                        <input name="profesion" type="text" id="profesion" value="<? echo $profesion?>" size="50" onKeyUp="fn(this.form,this);form1.profesion.value=form1.profesion.value.toUpperCase();">
                      </div></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td><div align="left">RUC</div></td>
                      <td>&nbsp;</td>
                      <td><input name="ruc" type="text" id="ruc" value="<? echo $ruc?>" size="25" onKeyUp="fn(this.form,this)"></td>
                      <td><div align="left">Pasaporte</div></td>
                      <td>&nbsp;</td>
                      <td><div align="left">
                        <input name="pasaporte" type="text" id="pasaporte" value="<? echo $pasaporte?>" size="30" onKeyUp="fn(this.form,this)">
                      </div></td>
                    </tr>
                    <tr class="lblCampo">
                      <td>L.M</td>
                      <td>&nbsp;</td>
                      <td><input name="lm" type="text" id="lm" value="<? echo $lm?>" size="25" onKeyUp="fn(this.form,this);form1.lm.value=form1.lm.value.toUpperCase();"></td>
                      <td>Carnet Extranj. </td>
                      <td>&nbsp;</td>
                      <td><input name="carnet" type="text" id="carnet"  onKeyUp="fn(this.form,this)" value="<? echo $carnet?>"></td>
                    </tr>
                    <tr class="lblCampo">
                      <td>DNI</td>
                      <td>&nbsp;</td>
                      <td><input name="dni" type="text" id="dni" value="<? echo $dni?>" size="25" onKeyUp="fn(this.form,this)"></td>
                      <td>Fecha Nacimiento </td>
                      <td>&nbsp;</td>
                      <td><table width="186" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="67"><div align="left">
                              <input name="fnac_per" type="text" id="fnac_per" onKeyUp=fn(this.form,this) value="<? echo $fnac_per?>" size="12" maxlength="10" title="FORMATO dd/mm/AA">
                          </div></td>
                          <td width="10">&nbsp;</td>
                          <td width="109"><div align="left"> <a onMouseOver="window.status='Calendario';return true;" onMouseOut="window.status='';return true;"  href="javascript:show_calendar('form1.fnac_per');"> <img src="../imagenes/calendar.jpg" alt="Calendario" width="16" height="15" border="0"> </a> </div></td>
                        </tr>
                      </table></td>
                    </tr>
                    <tr class="lblCampo">
                      <td>ESSALUD</td>
                      <td>&nbsp;</td>
                      <td><input name="seguro_per" type="text" id="seguro_per" value="<? echo $seguro_per?>" size="25"></td>
                      <td>Lugar Nac./Pais </td>
                      <td>&nbsp;</td>
                      <td><select name="cod_pais" id="select" onkeyup=fn(this.form,this)>
                        <option value="0">Varios</option>
                        <? 
							echo $objPer->getCboPais($cod_pais);
							?>
                      </select></td>
                    </tr>
                    <tr class="lblCampo">
                      <td><div align="left">A.F.P.</div></td>
                      <td><div align="left"></div></td>
                      <td><div align="left">
                        <select name="afp_per" id="select5"  onkeyup="fn(this.form,this)">
                          <option value="0">SELCCIONE</option>
                          <option value="INTEGRA" <? if($afp_per=="INTEGRA"){?> selected <? }?>>INTEGRA</option>
                          <option value="PROFUTURO" <? if($afp_per=="PROFUTURO"){?> selected <? }?>>PROFUTURO</option>
                          <option value="PRIMA" <? if($afp_per=="PRIMA"){?> selected <? }?>>PRIMA</option>
                          <option value="HORIZONTE" <? if($afp_per=="HORIZONTE"){?> selected <? }?>>HORIZONTE</option>
                        </select>
</div></td>
                      <td><div align="left">CUSPP</div></td>
                      <td><div align="left"></div></td>
                      <td><div align="left">
                          <input name="numafp_per1" type="text" id="numafp_per1" value="<? echo $numafp_per?>" size="25" onKeyUp="fn(this.form,this)">
                      </div></td>
                    </tr>
                    <tr class="lblCampo">
                      <td>ONP</td>
                      <td>&nbsp;</td>
                      <td><input name="onp" type="text" id="onp" value="<? echo $onp?>" size="25"></td>
                      <td>CUSNP
                      <input name="cod_per" type="hidden" id="cod_per2" onKeyUp=fn(this.form,this) value="<? echo $cod_per?>" size="20"></td>
                      <td>&nbsp;</td>
                      <td><input name="num_onp" type="text" id="num_onp" value="<? echo $num_onp;?>" size="25"></td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Vacunas</td>
                      <td>&nbsp;</td>
                      <td colspan="2"><input name="vacunas" type="text" id="vacunas" value="<? echo $vacunas?>" size="40"></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="normal">
                      <td colspan="6">
                        <hr align="left" size="1" color="#000000">
                      </td>
                    </tr>
                    <tr class="normal">
                      <td colspan="6">
                        <div align="center">                        </div></td>
                    </tr>
                    <tr class="normal">
                      <td colspan="6"><div align="center">
                        <table width="496" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="159"><input name="button" type="button" style="<?=$stylo['st2']?>" class="botira" value=".:Siguiente:." onClick="enviar_url(form1,'procesos/cvp_per_family_editar.php')"></td>
                            <td width="171"><input name="tipo" type="hidden" id="tipo2" value="<? echo $tipo?>">
                              <input name="des" type="hidden" size="5" id="des2" value="<? echo $des?>">
                              <input name="archivo" type="hidden" size="6" id="archivo2" value="<? echo $foto?>">
                              <input name="doc_actual" type="hidden" size="5" id="doc_actual2" value="<? echo $dociden_per?>">
                              <input name="pagina" type="hidden" size="2" id="pagina2" value="<? echo $pagina?>">
                              <input name="dociden_per" type="hidden" id="dociden_per" value="<? echo $dociden_per?>">
                              <input name="numafp_per" type="hidden" id="numafp_per" value="<? echo $numafp_per?>">
                              <input name="cod_emp" type="hidden" id="cod_emp" value="<? echo $cod_emp?>"></td>
                            <td width="166"><input name="Submit2" type="button" style="<?=$stylo['st2']?>" class="botira" value=".: Regresar :." onClick="volver(this.form);">
                            <input name="tipodoc" type="hidden" id="tipodoc" value="<? echo $tipodoc?>">
                            <input name="borrar" type="hidden" id="borrar" value="<? echo $borrar?>">
                            <input name="q" type="hidden" id="q" value="<? echo $q?>"></td>
                          </tr>
                        </table>
                      </div></td>
                    </tr>
                  </table>
              </div></td>
              <td background="../estilo_tabla/parte_med_der.gif">&nbsp;</td>
            </tr>
            <tr>
              <td><img src="../estilo_tabla/parte_inf_izq.gif" width="25" height="20"></td>
              <td background="../estilo_tabla/parte_inf_cen.gif">&nbsp;</td>
              <td><img src="../estilo_tabla/parte_inf_der.gif" width="25" height="20"></td>
            </tr>
          </table>
          <map name="MapMap">
            <area shape="rect" coords="3,4,23,21" href="fondo.php">
          </map>
        </form>
<map name="Map">
  <area shape="rect" coords="3,4,23,21" href="fondo.php">
</map>
</body>
</html>

