<?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");
$SYS_MSG="";$SYS_FOC="";$OK=1;
$StrId=V($_POST['TxtId']);$StrCmd=V($_POST['TxtAc']);$LStrPag=V($_POST['TxtPag']);
//++
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;
}
//--------------------------------------------------------------------------
include("sis_personal_fun.php");
//--------------------------------------------------------------------------
$VP_RegXPag=20;
$LStrTR=gn("count(*)","vpersonal","ID>0");
$LStrPag=PagGet($LStrPag,$StrCmd,$LStrTR,$VP_RegXPag);	
$TI=0;
?>

<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Personal</title>
<?php AddJs(); ?>

<script type="text/javascript" src="js/sis_funciones.js"></script>
<script type="text/javascript" src="js/sis_personal.js"></script>

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

<style type="text/css">
.mM {height:34px;width:1250px;position:relative;top:0px;background-color:#09C; z-index:500;}
.cF {height:600px;width:1250px;position:relative;top:0px}
</style>

<script>
$(document).ready(function(){  
   Inicializar();
   SYS_LOAD();
});
</script>

</head>
<body>

<div align="center">
<div Id="DivFRM"  class="cF" style="background-color:#FFFFFF;">
<form id="Frm" name="Frm" method="post" action="sis_personal.php" autocomplete="off" >

<!--INI_TITULO--------------------------------->
<div id="DivT" class="dT" >
<img src="bng/clientes.png" class="iT" style="width:48px; height:48px" />
<div class="tT">PERSONAL</div>
</div>
<!--FIN_TITULO--------------------------------->
    
<div class="s1" style="left: 36px; top: 125px; width: 255px;">
NOMBRE (Para los cuadros de seleccion)</div>
<input name="TxtNom" type="text" id="TxtNom" 
class="lt" style="left: 36px; top: 142px; width: 241px;" 
value="<?php echo $StrNom;?>"  
tabindex="<?php echo ++$TI;?>" />

<div class="s1" style="left: 285px; top: 125px; width: 312px;">
Nombres y apellidos ( Dato interno)</div>
<input name="TxtNomApe" type="text" id="TxtNomApe" 
class="lt" style="left: 284px; top: 142px; width: 331px;" 
value="<?php echo $StrNomApe;?>"  
tabindex="<?php echo ++$TI;?>" />

<div class="s1" style="left: 633px; top: 125px; width: 78px;">
DIRECCION</div>
<input name="TxtDir" type="text" id="TxtDir" 
class="lt" style="left: 633px; top: 142px; width: 368px;" 
value="<?php echo $StrDir;?>"  
tabindex="<?php echo ++$TI;?>" />

<div class="s1" style="left: 1012px; top: 125px; width: 138px;">
DEPARTAMENTO</div>
<select name="CboDis" id="CboDis" 
class="lt" style="left: 1008px; top: 142px; width: 205px;" 
tabindex="<?php echo ++$TI;?>">
<?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 class="s1" style="left: 41px; top: 179px; width: 73px;">
FEC. NAC. (dd-mm-yy)</div>
<input name="TxtFn" type="text" id="TxtFn" 
class="fe" style="left: 41px; top: 210px; width: 100px;" 
value="<?php echo $StrFn;?>"  
tabindex="<?php echo ++$TI;?>" />

<div class="s1" style="left: 150px; top: 193px; width: 75px;">
DNI</div>
<input name="TxtDni" type="text" id="TxtDni" 
class="lt" style="left: 148px; top: 210px; width: 126px;" 
value="<?php echo $StrDni;?>"  
tabindex="<?php echo ++$TI;?>" maxlength="8" />

<div class="s1" style="left: 284px; top: 193px; width: 119px;">
TELEFONO FIJO</div>
<input name="TxtTel" type="text" id="TxtTel" 
class="lt" style="left: 282px; top: 210px; width: 122px;" 
value="<?php echo $StrTel;?>"  

tabindex="<?php echo ++$TI;?>" />

<div class="s1" style="left: 415px; top: 193px; width: 76px;">
CELULAR</div>
<input name="TxtCel" type="text" id="TxtCel" 
class="lt" style="left: 415px; top: 210px; width: 125px;" 
value="<?php echo $StrCel;?>"  
tabindex="<?php echo ++$TI;?>" />


<div class="s1" style="left: 548px; top: 180px; width: 100px;">
FEC. INGRESO</div>
<div class="s1" style="left: 548px; top: 195px; width: 88px; color: #00F; cursor:pointer;" onClick="fFecha('TxtFi')">(dd-mm-yy) +</div>
<input name="TxtFi" type="text" id="TxtFi" 
class="fe" style="left: 548px; top: 210px; width: 100px;" 
value="<?php echo $StrFi;?>"  
tabindex="<?php echo ++$TI;?>" />

<div class="s1" style="left: 657px; top: 193px; width: 83px;">
EMAIL</div>
<input name="TxtEma" type="text" id="TxtEma" 
class="lt" style="left: 654px; top: 210px; width: 348px;" 
value="<?php echo $StrEma;?>"  
tabindex="<?php echo ++$TI;?>" />

<div class="s1" style="left: 1010px; top: 193px; width: 172px;">
CARGO</div>
<select name="CboCar" id="CboCar" 
class="lt" style="left: 1010px; top: 210px; width: 202px;" 
tabindex="<?php echo ++$TI;?>">
<?php
	echo FCBO_("car_nombre","cargos","id_cargo>0",$StrCar,"N","S");
?>
</select>

    
<!--INI_BOTONES-------------------------------->
<div align="left" style="position:absolute; left: 33px; top: 71px; width:1000px; height: 26px;">
<input name="CmdB" type="button" id="CmdG" class="btm" 
<?php GOM($StrId);?>
onclick="fGuardar();"  
tabindex="<?php echo ++$TI;?>"/>

<input name="CmdB" type="button" id="CmdC"  class="btm" 
value="Nuevo" onClick="fCancelar();"  
tabindex="<?php echo ++$TI;?>" />

<input name="CmdB" type="button" id="CmdE" class="btm" 
value="Eliminar" onClick="fEliminar();"
<?php DIS($StrId);?>
tabindex="<?php echo ++$TI;?>" />

<input name="CmdB" type="button" id="CmdB" class="btm"
value="Buscar" onClick="fBuscar('sis_personal_b.php');"  
tabindex="<?php echo ++$TI;?>" />

<input name="CmdB" type="button" id="CmdB" class="btm"
value="Menu" onClick="fBuscar('menu.php');"  
tabindex="<?php echo ++$TI;?>" />
</div>
<!--FIN_BOTONES-------------------------------->

<div style="position: absolute; left: 35px; top: 247px; width: 1180px; height: 22px;">
<table  style="font-size:0.9rem; width:100%" >
<thead>
<tr>
<td colspan="5"  align="center"><?php echo PagBtn($LStrTR,$VP_RegXPag,$LStrPag);?></td>
</tr>
</thead>
</table>
</div>

<div class="tableFixHead" style="position: absolute; left: 35px; top: 273px; width: 1180px; height: 292px;">
<table  style="font-size:0.9rem; width:100%" >
<thead>
<tr align="left">
<th width="46%">NOMBRE</th>
<th width="13%">DNI</th>
<th width="10%">TELEFONO</th>
<th width="11%">CELULAR</th>
<th width="17%">CARGO</th>
<th width="3%">&nbsp;</th>
</tr>
</thead>
<tbody>
<?php
$PX=0;

$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);
while ($r = $result->fetch_assoc()){
	$PX++;
	$CSS="";
	if($PX%2==0)$CSS=' style="background-color:#D4D4D4" ';
		?>
        <tr <?php echo $CSS;?> onDblClick="fActivar(<?php echo $r['ID'];?>);">
        <!----------------------------------------------->
        <td ><?php echo $r['NOMBRE'];?></td>
        <td ><?php echo $r['DNI'];?></td>
        <td ><?php echo $r['TEL'];?></td>
        <td ><?php echo $r['CEL'];?></td>
        <td ><?php echo $r['CARGO'];?></td>
        <!----------------------------------------------->       
        <td>
        <a href="javascript:void(0)" onClick="fActivar(<?php echo $r['ID'];?>);">
        <img src="img/b_edit.png"  border="0"/></a>
        </td>    
        </tr>
		<?php
    }    
?>	

	  
</tbody>
</table>
</div>
	
<?php include("sis_ocultos.php");?>
 
</form>
</div>
</div>
</body>
</html>
