<?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->getCodPer();
  $filas=$objPer->NextRow($resultado);
  $cod_per=$filas['valor_e'].getNumCeros($filas['valor']);
  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_solicitud_cupo.php";
$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>
<!-- Copyright 2000,2001 Macromedia, Inc. All rights reserved. -->
<!-- Copyright 2000,2001 Macromedia, Inc. All rights reserved. -->
<!-- Copyright 2000,2001 Macromedia, Inc. All rights reserved. -->
</head>

<body bgcolor="<?=$c_fondo['fondo']?>" onfocus="foco()" background="../imagenes/fondo.jpg">
<form name="form1" method="post" action="procesos/cvp_pers_veri.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" >Registro de Personal </div></td>
              <td width="25"><img src="../estilo_tabla/parte_sup_der.gif" width="25" height="25" border="0" usemap="#Map"></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">Nombres</div></td>
                      <td width="5"><div align="left">:</div></td>
                      <td width="208"><div align="left">
                        <input name="nom_per" type="text" class="lblForm1" id="nom_per2" onKeyUp=fn(this.form,this) value="<? echo $nom_per?>" size="35" maxlength="40">
                      </div></td>
                      <td width="96"><input name="valor" type="hidden" id="valor3" size="3" value="<? echo $filas['valor']?>">
                      <input name="cod_per" type="hidden" class="lblForm1" id="cod_per2" onKeyUp=fn(this.form,this) value="<? echo $cod_per?>" size="20"></td>
                      <td width="5"><div align="left"></div></td>
                      <td width="245">&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td><div align="left">Apellido Pat </div></td>
                      <td><div align="left">:</div></td>
                      <td>
                        <div align="left">
                          <input name="appat_per" type="text" class="lblForm1" id="appat_per" onkeyup=fn(this.form,this) value="<? echo $appat_per?>" size="30">
                      </div></td>
                      <td>Apellido Mat </td>
                      <td><div align="left">:</div></td>
                      <td><input name="apmat_per" type="text" class="lblForm1" id="apmat_per" onkeyup=fn(this.form,this) value="<? echo $apmat_per?>" size="30"></td>
                    </tr>
                    <tr class="lblCampo">
                      <td><div align="left">Doc. Identidad</div></td>
                      <td><div align="left"></div></td>
                      <td><div align="left">                        <select name="tipodoc" id="select4">
                          <option value="DNI">DNI</option>
                          <option value="PASAPORTE">PASAPORTE</option>
                          <option value="LM">LM</option>
                          <option value="CARNET EXTRANJ.">CARNET EXTRANJ.</option>
                        </select>
                      </div></td>
                      <td><div align="left">N&ordm; Documento </div></td>
                      <td><div align="left"></div></td>
                      <td><div align="left">
                        <input name="dociden_per" type="text" class="lblForm1" id="dociden_per" onKeyUp=fn(this.form,this) value="<? echo $dociden_per?>" size="20">
                      </div></td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Empresa</td>
                      <td>&nbsp;</td>
                      <td>                      <select name="cod_emp" class="lblForm1" id="select5" onkeyup=fn(this.form,this)>
                        <option value="0">Varios</option>
                        <? 
							echo $objPer->getCboEmp($cod_emp);
							?>
                      </select>                      </td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    
                    
                    <tr class="normal">
                      <td colspan="6">
					    <div align="center">
					      <table width="660" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                              <td colspan="3"><div align="center">
                                <FIELDSET>
                                <LEGEND></LEGEND>
                                
                                </FIELDSET>
                              </div></td>
                            </tr>
                            <tr>
                              <td width="220"><div align="right">
                                <input name="button" type="button" style="<?=$stylo['st2']?>" class="botira" value=".:Grabar:." onClick="enviar_url(form1,'procesos/cvp_personal_existe.php')">
                              </div></td>
                              <td width="220"><div align="center">
                              </div></td>
                              <td width="220"><div align="left">
                                <input name="Submit2" type="button" style="<?=$stylo['st2']?>" class="botira" value=".: Regresar :." onClick="volver(this.form);">
                              </div></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>
</form>
<map name="Map">
  <area shape="rect" coords="3,4,23,21" href="fondo.php">
</map>
</body>
</html>

