<?php
ini_set("session.cookie_lifetime",60*60*10);
ini_set("session.gc_maxlifetime", 60*60*10);
session_start();
include("cls_conexion.php");$CNN=new ClsMySQL();include("conexion23.php");
if(strlen($_SESSION['SYS_USER_ID'])==0){JsDir("login.php");	return;}
//
if(vbval($_SESSION['SYS_USER_GI'])!=USU_GET_GI($_SESSION['SYS_USER_ID'])){
JsDir("cerrar.php");	
return;
}
//
//-------------------------	
$StrGT="";

$LStrMsg="";
$LStrFoc="";
$LStrMM="";
//-------------------------
$StrId=V($_POST['TxtId']);
$StrCmd=V($_POST['TxtAc']);

$LStrPag=V($_POST['TxtPag']);
include("personal_fun.php");
$VP_RegXPag=5;
$LStrTR=gn("count(*)","vpersonal","ID>0");
$LStrPag=PagGet($LStrPag,$StrCmd,$LStrTR,$VP_RegXPag);	
	
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Personal</title>
<link rel="stylesheet" type="text/css" href="estiloss.css"  />
<link rel="stylesheet" type="text/css" href="basic.css"  />
<script src="jquery-1.7.2.min.js" type="text/javascript"></script>
<script src="jquery.maskedinput.min.js" type="text/javascript"></script>
<script type="text/javascript" src="fe/funciones.js"></script>
<script type="text/javascript" src="fe/personal.js"></script>
<script>
$(document).ready(function(){
   $("#TxtFn").mask("99-99-99"); 
   $("#TxtFi").mask("99-99-99"); 

});
</script>
<style type="text/css">
<!--
body {
	background-color: #CCC;
}
#Layer1 {
	position:absolute;
	left:345px;
	top:115px;
	width:123px;
	height:35px;
	z-index:1;
}
.centrarFrm{
     width:700px;
     height:600px;
     position:absolute;
     left:<?php echo "50%";?>;
     top:<?php echo "50%";?>;
	 background-color:#006699;
	 margin:<?php echo "-300px";?> 0 0 <?php echo "-350px";?>;

}
#Layer2 {
	position:absolute;
	left:409px;
	top:205px;
	width:82px;
	height:24px;
	z-index:1;
}
.Estilo1 {
	font-family: Arial, Helvetica, sans-serif;
	font-weight: bold;
	color: #FFFFFF;
}
.f2 {font-family: Arial, Helvetica, sans-serif; font-weight: bold; color: #FFFFFF; font-size: 12px; }
.Estilo3 {color: #FFFFFF; font-size: 12px; font-family: Arial, Helvetica, sans-serif;}
.Estilo4 {color: #000099}
.Estilo5 {color: #000000}
#Frm center #DivFRM #layer .Estilo1 strong {
	color: #900;
}
-->
</style>

</head>
<body  <?php echo $LStrMsg;?>>
<form id="Frm" name="Frm" method="post" action="personal.php">
<center> 
  <div Id="DivFRM"  class="centrarFrm" >
    
    <div id="layer4" style="position:absolute; left: 30px; top: 85px; width: 442px; height: 26px;">
      <div align="left" class="f2">
        <input name="CmdB" type="button" id="CmdG"
		<?php
		if(strlen($StrId)==0){
			echo "value=\"Guardar\"";
		}else{
			echo "value=\"Modificar\"";
		}
		?>
		onclick="fGuardar();" style="width:80px" tabindex="11"/>
		<input name="CmdB" type="button" id="CmdC" value="Nuevo" onclick="fCancelar();"  tabindex="12"/>
		<input name="CmdB" type="button" id="CmdE" value="Eliminar" onclick="fEliminar();"
		<?php
		if(strlen($StrId)==0){
			echo "disabled=\"disabled\"";
		}
		?>
		 tabindex="13"/>
		 <input name="CmdB" type="button" id="CmdB" 
         value="Buscar" onclick="fBuscar('personal_buscar.php');"  tabindex="14"/>
         <input name="CmdB" type="button" id="CmdZ" 
         value="Menu" onclick="fBuscar('menu.php');"  tabindex="15"/>
      </div>
    </div>

<div id="layer3" style="position:absolute; left: 30px; top: 384px; width: 638px; height: 200px;">
<div align="left" class="f2">
<table width="622" height="19" border="1" cellpadding="0" cellspacing="0">

<tr>
<td height="18" colspan="6" bgcolor="#666666" align="center"><?php echo PagBtn($LStrTR,$VP_RegXPag,$LStrPag);?></td>
</tr>

<tr>
<td width="223" bgcolor="#999999"><span class="Estilo4">NOMBRES </span></td>
<td width="92" bgcolor="#999999"><span class="Estilo4">DNI</span></td>
<td width="81" bgcolor="#999999"><span class="Estilo4">TELEFONO</span></td>
<td width="97" bgcolor="#999999"><span class="Estilo4">CELULAR</span></td>
<td width="80" bgcolor="#999999"><span class="Estilo4">CARGO</span></td>            
<td width="20" bgcolor="#999999">&nbsp;</td>
</tr>
<?php
$s="SELECT ID,NOMBRE,DNI,TEL,CEL,CARGO FROM vpersonal
WHERE ID> 0 ORDER BY NOMBRE";
$s=PagSql($s,$LStrPag,$VP_RegXPag,$LStrTR);	  				
$result = grs($s);
$X1="<td bgcolor=\"#FFFFFF\"><span class=\"Estilo5\">";
$X2="</span></td>";
while ($row = $result->fetch_row()){
	echo "<tr ondblclick=\"fActivar($row[0]);\">";
	echo $X1.VV($row[1]).$X2;
	echo $X1.VV($row[2]).$X2;
	echo $X1.VV($row[3]).$X2;
	echo $X1.VV($row[4]).$X2;
	echo $X1.VV($row[5]).$X2;
	echo "<td bgcolor=\"#FFFFFF\" align=\"center\">
	<a href=\"javascript:void(0)\" onclick=\"fActivar($row[0]);\">
	<img src=\"img/b_edit.png\"  border=\"0\"/>
	</a>
	</td>";
	echo "</tr>";
}

?>		  
</table>
</div>
</div>


    <div id="layer" style="position:absolute; left: 116px; top: 21px; width: 412px; height: 45px; z-index: 100;">
      <div align="left" class="Estilo1">
        <input name="TxtId" type="hidden" id="TxtId" value="<?php echo $StrId;?>"/>
		<input name="TxtAc" type="hidden" id="TxtAc" value="" />
		<input name="TxtPag" type="hidden" id="TxtPag" value="<?php echo $LStrPag; ?>" />
		<input name="FEC_SERVER" type="hidden" id="FEC_SERVER" value="<?php echo date("d-m-y");?>"/>
      <strong>PERSONAL</strong></div>
    </div>
<div id="layer5" style="position:absolute; left: 30px; top: 157px; width: 255px;">
<div align="left" class="f2">NOMBRE (Para los cuadros de seleccion)</div>
</div>
<input name="TxtNom" type="text" id="TxtNom" style="position:absolute; left: 30px; top: 177px; width: 244px;" 
value="<?php echo $StrNom;?>"  
onKeyDown="return SoloTextoEx(event,'TxtNomApe');" 
tabindex="1" />

<div id="layer5" style="position:absolute; left: 287px; top: 157px; width: 355px;">
<div align="left" class="f2">Nombres y apellidos ( Dato interno)</div>
</div>
<input name="TxtNomApe" type="text" id="TxtNomApe" style="position:absolute; left: 286px; top: 177px; width: 360px;" 
value="<?php echo $StrNomApe;?>"  
onKeyDown="return SoloTextoEx(event,'TxtDir');" 
tabindex="2" />

    <div id="LblTit" style="position:absolute; left: 52px; top: 15px; width: 64px; z-index: 100;">
    <div align="left" class="Estilo1"><img src="img/personal.png" width="56" height="52" /></div>
  </div>
    <div id="layer8" style="position:absolute; left: 0px; top: 0px; width: 700px; height: 79px; background-color: #FFFFFF; layer-background-color: #FFFFFF; border: 1px none #000000; z-index: 0;">
      <div align="left" class="Estilo1">        
      </div>
</div>
    <div id="layer9" style="position:absolute; left: 30px; top: 213px; width: 78px;">
      <div align="left" class="f2">DIRECCION</div>
  </div>
        <input name="TxtDir" type="text" id="TxtDir" style="position:absolute; left: 30px; top: 231px; width: 410px;" 
          value="<?php echo $StrDir;?>"  
          onkeydown="return SoloTextoEx(event,'CboDis');" 
          tabindex="3" />

        <select name="CboDis" id="CboDis" style="position:absolute; left: 453px; top: 231px; width: 194px;" 
onkeydown="return SoloTextoEx(event,'TxtFn');" tabindex="4">
          <?php
	$s="SELECT dis_nombre FROM distritos WHERE id_distrito>= 0 ORDER BY dis_nombre";
	$result = grs($s);
	while ($row = $result->fetch_row()){
	if($StrDis==$row[0]){
		echo "<option value=\"$row[0]\" selected=\"selected\">$row[0]</option>";
	}else{
		echo "<option value=\"$row[0]\" >$row[0]</option>";
	}
	}
?>
        </select>

    <div id="layer12" style="position:absolute; left: 457px; top: 213px; width: 138px;">
      <div align="left" class="f2">DEPARTAMENTO</div>
    </div>

<div id="layer13" style="position:absolute; left: 30px; top: 257px; width: 73px;">
<div align="left" class="f2">FEC. NAC. (dd-mm-yy)</div></div>
<input name="TxtFn" type="text" id="TxtFn" style="position:absolute; left: 30px; top: 288px; width: 100px;" 
value="<?php echo $StrFn;?>"  
onkeydown="return SoloFec(this,event,'TxtDni');" 
tabindex="5" />

<input name="TxtDni" type="text" id="TxtDni" style="position:absolute; left: 144px; top: 288px; width: 126px;" 
value="<?php echo $StrDni;?>"  
onkeydown="return SoloEnterosEx(this,event,'TxtTel');" 
tabindex="6" maxlength="8" />

    <div id="layer16" style="position:absolute; left: 146px; top: 268px; width: 75px;">
      <div align="left" class="f2">DNI</div>
    </div>
        <input name="TxtTel" type="text" id="TxtTel" style="position:absolute; left: 285px; top: 288px; width: 152px;" 
          value="<?php echo $StrTel;?>"  
          onkeydown="return SoloTextoEx(event,'TxtCel');" 
          tabindex="7" />

    <div id="layer18" style="position:absolute; left: 287px; top: 268px; width: 150px;">
      <div align="left" class="f2">TELEFONO FIJO</div>
    </div>
    <div id="layer19" style="position:absolute; left: 453px; top: 268px; width: 76px;">
      <div align="left" class="f2">CELULAR</div>
    </div>
        <input name="TxtCel" type="text" id="TxtCel" style="position:absolute; left: 453px; top: 288px; width: 192px;" 
          value="<?php echo $StrCel;?>"  
          onkeydown="return SoloTextoEx(event,'TxtFi');" 
          tabindex="8" />

<div style="position:absolute; left: 30px; top: 317px; width: 100px;">
<div align="left" class="f2">FEC. INGRESO</div></div>

<div class="EV" style="position:absolute; left: 30px; top: 332px; width: 88px; color:#FF0"><u><a onclick="fFecServer('TxtFi')">(dd-mm-yy) +</a></u></div>

<input name="TxtFi" type="text" id="TxtFi" 
class="ps" style="position:absolute; left: 30px; top: 347px; width: 100px;" 
value="<?php echo $StrFi;?>"  
onkeydown="return SoloFec(this,event,'TxtEma');"  
tabindex="9" />

<div style="position:absolute; left: 149px; top: 325px; width: 83px;">
<div align="left" class="f2">EMAIL</div></div>
<input name="TxtEma" type="text" id="TxtEma" 
class="ps" style="position:absolute; left: 146px; top: 347px; width: 291px;" 
value="<?php echo $StrEma;?>"  
onkeydown="return SoloTextoEx(event,'CboCar');" 
tabindex="10" />

<div style="position:absolute; left: 453px; top: 328px; width: 172px;">
<div align="left" class="f2">CARGO</div></div>
<select name="CboCar" id="CboCar" style="position:absolute; left: 453px; top: 347px; width: 194px;" 
onkeydown="return SoloTextoEx(event,'CmdG');" tabindex="11">
<?php
	echo FCBO_("car_nombre","cargos","id_cargo>0",$StrCar,"N","S");
?>
</select>

  </div>
</center>	
        </form>
</body>
</html>
