<?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'];
  $dociden_per=$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'];
  session_register("remu");
  if($borrar==1){
  $remu = array();  
  }
  $resultadof=$objPer->getContratoDoc($dociden_per);
  $filaf=$objPer->NextRow($resultadof);
  $cod_ficha=$filaf['cod_ficha'];
  $cargo=$filaf['cargo'];
  $area=$filaf['area'];
  $lugar=$filaf['lugar'];
  $fingre_planilla=extraerfechanormal($filaf['fingre_planilla']);
  $tipo_contrato=$filaf['tipo_contrato'];
  $contrato=$filaf['contrato'];
  $ingre_men=$filaf['ingre_men'];
  $otros_ingre=$filaf['otros_ingre'];
  $ingre_anual=$filaf['ingre_anual'];
  $banco1=$filaf['banco1'];
  $moneda1=$filaf['moneda1'];
  $ncta1=$filaf['ncta1'];
  $tipo1=$filaf['tipo1'];
  $banco2=$filaf['banco2'];
  $moneda2=$filaf['moneda2'];
  $ncta2=$filaf['ncta2'];
  $archivo_digital=$filaf['archivo'];
?>

<!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 ver1(sURL,x,y) {
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,"Ver1",par)
			ventana.focus();
}
function ver2(sURL,x,y) {
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,"Ver2",par)
			ventana.focus();
}
function ver3(sURL,x,y) {
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,"Ver3",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>
<!-- 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_per_contrato_editar01.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" >Informacion de la Empresa </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" valign="top">
                      <td width="184"><div align="left">Apellido Pat </div></td>
                      <td width="4"><div align="left">:</div></td>
                      <td width="274"><div align="left">
                        <input name="appat_per" type="text" id="appat_per2" onKeyUp=fn(this.form,this) value="<? echo $appat_per?>" size="35">
                      </div></td>
                      <td width="104">&nbsp;</td>
                      <td width="6"><div align="left"></div></td>
                      <td width="218" rowspan="11" valign="middle">
					  <div align="center">
					    <table width="176" border="0" cellpadding="0" cellspacing="0">
                          <tr align="center">
                            <td colspan="3"><div align="center">
                                
                                <img src="../../fotos_per/<? if($foto!=""){echo $foto;}else{ echo "desconocido.gif";}?>" width="100" height="133">
                                
                                
                                
                                <br>
                            </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) 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><div align="left">:</div></td>
                      <td><input name="nom_per" type="text" id="nom_per2" onKeyUp=fn(this.form,this) value="<? echo $nom_per?>" size="45" maxlength="45"></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td><div align="left">Cargo</div></td>
                      <td><div align="left">:</div></td>
                      <td><div align="left">
                          <input name="cargo" type="text" id="cargo" value="<? echo $cargo?>" size="35" onKeyUp="fn(this.form,this);form1.cargo.value=form1.cargo.value.toUpperCase();">
                      </div></td>
                      <td><div align="left"></div></td>
                      <td><div align="left"></div></td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Area</td>
                      <td><div align="left">:</div></td>
                      <td><input name="area" type="text" id="fono_per2" onKeyUp="fn(this.form,this);form1.area.value=form1.area.value.toUpperCase();" value="<? echo $area?>" size="15"></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Lugar</td>
                      <td><div align="left">:</div></td>
                      <td><input name="lugar" type="text" id="lugar" value="<? echo $lugar?>" onKeyUp="fn(this.form,this);form1.lugar.value=form1.lugar.value.toUpperCase();"></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td>F. Ingreso a Planilla </td>
                      <td><div align="left">:</div></td>
                      <td><table width="186" border="0" cellspacing="0" cellpadding="0">
                        <tr>
                          <td width="67"><div align="left">
                              <input name="fingre_planilla" type="text" id="fingre_planilla" onKeyUp=fn(this.form,this) value="<? echo $fingre_planilla?>" 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.fingre_planilla');"> <img src="../imagenes/calendar.jpg" alt="Calendario" width="16" height="15" border="0"> </a> </div></td>
                        </tr>
                      </table></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Tipo Contrato </td>
                      <td><div align="left">:</div></td>
                      <td colspan="2"><div align="left">
                        <table width="336" border="0" cellspacing="0" cellpadding="0">
                          <tr>
                            <td width="106"><div align="left">
                              <select name="tipo_contrato" id="tipo_contrato">
                                <option value="INDEF" <? if($tipo_contrato=="INDEF"){?> selected<? }?>>INDEF</option>
                                <option value="TEMP" <? if($tipo_contrato=="TEMP"){?> selected<? }?>>TEMP</option>
                                <option value="PLAZO FIJO" <? if($tipo_contrato=="PLAZO FIJO"){?> selected<? }?>>PLAZO FIJO</option>
                                <option value="OTROS" <? if($tipo_contrato=="OTROS"){?> selected<? }?>>OTROS</option>
                              </select>
                            </div></td>
                            <td width="10">&nbsp;</td>
                            <td width="220"><div align="left">
                              <input name="contrato" type="text" id="contrato" value="<? echo $contrato?>" size="30" onKeyUp="fn(this.form,this);form1.contrato.value=form1.contrato.value.toUpperCase();">
                            </div></td>
                          </tr>
                        </table>
                      </div></td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Ing. Mensual </td>
                      <td><div align="left">:</div></td>
                      <td><div align="left">
					  <?
					  if($ingre_men!=NULL){
					  $tipotext="password";
					  }else{
					  $tipotext="text";
					  }
					  ?>
                        <input name="ingre_men" type="<?=$tipotext;?>" id="ingre_men" value="<? if($ingre_men!=NULL){ echo number_format($ingre_men,2,'.','');}else{ echo number_format(0,2,'.','');}?>" size="30">
                      
					    <input name="btn_ver1" type="button" class="botira" id="btn_ver1" style="<?=$stylo['st2']?>" value="Ver" onClick="javascript:ver1('logueo.php?monto=<? echo $ingre_men;?>',260,105)" >
                      </div></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Otros Ing. </td>
                      <td><div align="left">:</div></td>
                      <td><div align="left">
					  
                        <?
					  if($otros_ingre!=NULL){
					  $tipotext1="password";
					  }else{
					  $tipotext1="text";
					  }
					  ?>
                        <input name="otros_ingre" type="<?=$tipotext1;?>" id="otros_ingre" value="<? if($otros_ingre!=NULL){ echo number_format($otros_ingre,2,'.','');}else{ echo number_format(0,2,'.','');}?>" size="30">
                        <input name="btn_ver2" type="button" class="botira" id="btn_ver2" style="<?=$stylo['st2']?>" value="Ver" onClick="javascript:ver2('logueo.php?monto=<? echo $otros_ingre;?>',260,105)" >
                      </div></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Ing. Anual </td>
                      <td><div align="left">:</div></td>
                      <td><div align="left">
                        <?
					  if($ingre_anual!=NULL){
					  $tipotext2="password";
					  }else{
					  $tipotext2="text";
					  }
					  ?>
                        <input name="ingre_anual" type="<?=$tipotext2;?>" id="ingre_anual" value="<? if($ingre_anual!=NULL){ echo number_format($ingre_anual,2,'.','');}else{ echo number_format(0,2,'.','');}?>" size="30">
                        <input name="btn_ver3" type="button" class="botira" id="btn_ver3" style="<?=$stylo['st2']?>" value="Ver" onClick="javascript:ver3('logueo.php?monto=<? echo $ingre_anual;?>',260,105)" >
                      </div></td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Contrato en Digital </td>
                      <td><div align="left">:</div></td>
                      <td colspan="2"><div align="left">
                        <input name="file" type="file" class="botira" id="file" style="<?=$stylo['st2']?>">
                        <input name="archivo" type="hidden" size="6" id="archivo" value="<? echo $archivo_digital?>">
						<? if($archivo_digital!=NULL){?>
						<a href="procesos/bajando_pdf.php?arch=<? echo $filaf['archivo'];?>">Descargar</a>
						<? }?>                      
						</div>
					  </td>
                      <td>&nbsp;</td>
                      <td valign="middle">&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td colspan="6"><div align="left">
					  <iframe name="detalle" src="cvp_per_remu_det01.php?dociden_per=<? echo $dociden_per?>&q=<? echo $q?>&cod_ficha=<? echo $filaf['cod_ficha']?>" width="835" height="150" marginheight="0" marginwidth="0" frameborder="0" scrolling="yes"></iframe>
					  </div>
					  </td>
                    </tr>
                    <tr class="lblCampo">
                      <td>INGRESOS</td>
                      <td>&nbsp;</td>
                      <td colspan="2">&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td><div align="left">Banco</div></td>
                      <td>:</td>
                      <td><div align="left">
                        <input name="banco1" type="text" id="banco1" value="<? echo $banco1?>" size="50" onKeyUp="fn(this.form,this);form1.banco1.value=form1.banco1.value.toUpperCase();">
                      </div></td>
                      <td>Moneda</td>
                      <td>&nbsp;</td>
                      <td><input name="moneda1" type="text" id="pasaporte2" value="<? echo $moneda1?>" size="30" onKeyUp="fn(this.form,this);form1.moneda1.value=form1.moneda1.value.toUpperCase();"></td>
                    </tr>
                    <tr class="lblCampo">
                      <td><div align="left">N&ordm; CTA </div></td>
                      <td>&nbsp;</td>
                      <td><input name="ncta1" type="text" id="ncta1" value="<? echo $ncta1?>" size="25"></td>
                      <td><div align="left">Tipo</div></td>
                      <td>&nbsp;</td>
                      <td><div align="left">
                        <input name="tipo1" type="text" id="pasaporte3" value="<? echo $tipo1?>" size="30">
                      </div></td>
                    </tr>
                    <tr class="lblCampo">
                      <td>CTS</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                      <td>&nbsp;</td>
                    </tr>
                    <tr class="lblCampo">
                      <td>Banco</td>
                      <td>&nbsp;</td>
                      <td><input name="banco2" type="text" id="banco2" value="<? echo $banco2?>" size="50" onKeyUp="fn(this.form,this);form1.banco2.value=form1.banco2.value.toUpperCase();"></td>
                      <td>Moneda</td>
                      <td>&nbsp;</td>
                      <td><input name="moneda2" type="text" id="pasaporte4" value="<? echo $moneda2?>" size="30" onKeyUp="fn(this.form,this);form1.moneda2.value=form1.moneda2.value.toUpperCase();"></td>
                    </tr>
                    <tr class="lblCampo">
                      <td>N&ordm; CTA</td>
                      <td>&nbsp;</td>
                      <td><input name="ncta2" type="text" id="ncta2" value="<? echo $tipo2?>" size="25"></td>
                      <td>&nbsp;</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=".:Grabar:." onClick="enviar_url(form1,'procesos/cvp_per_contrato_editar01.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="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" size="5" id="dociden_per" value="<? echo $dociden_per?>">
                              <input name="numafp_per" type="hidden" id="numafp_per" value="<? echo $numafp_per?>"></td>
                            <td width="166"><input name="Submit2" type="button" style="<?=$stylo['st2']?>" class="botira" value=".: Regresar :." onClick="volver(this.form);">
                            <input name="cod_ficha" type="hidden" size="5" id="cod_ficha" value="<? echo $cod_ficha?>"></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>

