<?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;
}
//+++
function P_F($s){
	$d=explode("-",$s);
	$dia=$d[2];
	$mes=$d[1];
	$ani=$d[0]-2000;
	return $dia."-".$mes."-".$ani;
}
//--------------------------------------------------------------------------++
include("sis_numeracion_fun.php");
//--------------------------------------------------------------------------++
$VP_RegXPag=20;
$LStrTR=gn("count(*)","numeracion","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>Numeracion</title>
<?php AddJs(); ?>

<script type="text/javascript" src="js/sis_funciones.js"></script>
<script type="text/javascript" src="js/sis_numeracion.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_numeracion.php" autocomplete="off">

<!--INI_TITULO--------------------------------->
<div id="DivT" class="dT" >
<img src="bng/prod.png" class="iT" style="width:48px; height:48px" />
<div class="tT">NUMERACION</div>
</div>
<!--FIN_TITULO--------------------------------->

<div class="s1" style="left: 35px; top: 129px; width: 183px;"> CODIGO
</div>
<?php if(strlen($Cod)==0)$Cod="***";?>
<input name="Cod" type="text" id="Cod"
class="roi" style="left: 35px; top: 146px; width: 62px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Cod;?>" maxlength="150" />

<div class="s1" style="left: 110px; top: 129px; width: 82px;"> FECHA
</div>
<?php if(strlen($Fec)==0)$Fec=date("d-m-y");?>
<input name="Fec" type="text" id="Fec" 
class="roi" style="left: 109px; top: 146px; width: 83px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Fec;?>" maxlength="20" />

<div class="s1" style="left: 203px; top: 129px; width: 127px;"> NOMBRE (Opcional)
</div>
<input name="Nom" type="text" id="Nom" 
class="lt" style="left: 202px; top: 146px; width: 147px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Nom;?>" maxlength="50" />

<div class="s1" style="left: 360px; top: 129px; width: 19px;"> 0
</div>
<input name="Num0" type="text" id="Num0" 
class="lt" style="left:360px; top: 146px; width: 50px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Num0;?>" maxlength="3" />

<div class="s1" style="left: 420px; top: 129px; width: 19px;">1
</div>
<input name="Num1" type="text" id="Num1" 
class="lt" style="left:420px; top: 146px; width: 50px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Num1;?>" maxlength="3" />

<div class="s1" style="left: 480px; top: 129px; width: 19px;">2
</div>
<input name="Num2" type="text" id="Num2" 
class="lt" style="left:480px; top: 146px; width: 50px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Num2;?>" maxlength="3" />

<div class="s1" style="left: 540px; top: 129px; width: 19px;">3
</div>
<input name="Num3" type="text" id="Num3" 
class="lt" style="left:540px; top: 146px; width: 50px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Num3;?>" maxlength="3" />

<div class="s1" style="left: 600px; top: 129px; width: 19px;">4
</div>
<input name="Num4" type="text" id="Num4" 
class="lt" style="left:600px; top: 146px; width: 50px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Num4;?>" maxlength="3" />

<div class="s1" style="left: 660px; top: 129px; width: 19px;">5
</div>
<input name="Num5" type="text" id="Num5" 
class="lt" style="left:660px; top: 146px; width: 50px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Num5;?>" maxlength="3" />

<div class="s1" style="left:720px; top: 129px; width: 19px;">6
</div>
<input name="Num6" type="text" id="Num6" 
class="lt" style="left:720px; top: 146px; width: 50px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Num6;?>" maxlength="3" />


<div class="s1" style="left:780px; top: 129px; width: 19px;">7
</div>
<input name="Num7" type="text" id="Num7" 
class="lt" style="left:780px; top: 146px; width: 50px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Num7;?>" maxlength="3" />

<div class="s1" style="left:840px; top: 129px; width: 19px;">8
</div>
<input name="Num8" type="text" id="Num8" 
class="lt" style="left:840px; top: 146px; width: 50px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Num8;?>" maxlength="3" />

<div class="s1" style="left:900px; top: 129px; width: 19px;">9
</div>
<input name="Num9" type="text" id="Num9" 
class="lt" style="left:900px; top: 146px; width: 50px;" 
tabindex="<?php echo ++$TI;?>"
value="<?php echo $Num9;?>" maxlength="3" />

<?php if(strlen($Hab)==0)$Hab="SI";?>
<div class="s1" style="left: 959px; top: 129px; width: 79px;">
  HABILITADO</div>
<select name="Hab" id="Hab" 
class="lt" style="left: 959px; top: 146px; width: 104px;" 
tabindex="<?php echo ++$TI;?>">
<?php echo FCBO_("au_item","auxiliar","au_tab='SI_NO'",$Hab,"N","N");?>
</select>

<!--INI_BOTONES-------------------------------->
<div id="DivBtn" 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="Menu" onClick="fBuscar('menu.php');"  
tabindex="<?php echo ++$TI;?>" />
</div>
<!--FIN_BOTONES-------------------------------->


<div style="position: absolute; left: 35px; top: 180px; 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: 214px; width: 1180px; height: 363px;">
<table  style="font-size:0.9rem; width:100%" >
<thead>
<tr align="left">
<th width="5%">CODIGO</th>
<th width="11%">FECHA</th>
<th width="24%">NOMBRE</th>
<th width="4%">0</th>
<th width="4%">1</th>
<th width="4%">2</th>
<th width="5%">3</th>
<th width="4%">4</th>
<th width="5%">5</th>
<th width="4%">6</th>
<th width="5%">7</th>
<th width="5%">8</th>
<th width="5%">9</th>
<th width="13%">HAB</th>
<th width="2%">&nbsp;</th>
</tr>
</thead>
<tbody>
<?php
$PX=0;

$s="SELECT * FROM numeracion
	WHERE id> 0 ORDER BY id";
$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['id'];?></td>
        <td ><?php echo P_F($r['fec']);?></td>
        <td ><?php echo $r['nom'];?></td>
        <td ><?php echo $r['n0'];?></td>
        <td ><?php echo $r['n1'];?></td>
        <td ><?php echo $r['n2'];?></td>
        <td ><?php echo $r['n3'];?></td>
        <td ><?php echo $r['n4'];?></td>
        <td ><?php echo $r['n5'];?></td>
        <td ><?php echo $r['n6'];?></td>
        <td ><?php echo $r['n7'];?></td>
        <td ><?php echo $r['n8'];?></td>
        <td ><?php echo $r['n9'];?></td>
        <td ><?php echo $r['hab'];?></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>
