<?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_lineas_fun.php");
//-------------------------------------------------------------------------
$VP_RegXPag=20;
$LStrTR=gn("count(*)","lineas","id_linea>0 AND LENGTH(TRIM(lin_nombre))>0");
$LStrPag=PagGet($LStrPag,$StrCmd,$LStrTR,$VP_RegXPag);
$TI=0;
?>

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

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

<!--INI_TITULO--------------------------------->
<div id="DivT" class="dT" >
<img src="bng/line.png" class="iT" style="width:48px; height:48px" />
<div class="tT">LINEA DE PRODUCTOS</div>
</div>
<!--FIN_TITULO--------------------------------->
  
<div class="s1" style="position:absolute; left: 33px; top: 129px; width: 184px;">
NOMBRE</div>
<input name="TxtNom" type="text" id="TxtNom" 
class="lt" style="left: 32px; top: 146px; width: 355px;" 
value="<?php echo $StrNom;?>"  
tabindex="<?php echo ++$TI;?>" />

<div class="s1" style="position: absolute; left: 402px; top: 129px; width: 151px;">
DESCRIPCION</div>
<input name="TxtObs" type="text" id="TxtObs" 
class="lt" style="left: 399px; top: 146px; width: 809px;" 
value="<?php echo $StrObs;?>"   
tabindex="<?php echo ++$TI;?>" />
    



<!--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: 191px; 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: 217px; width: 1180px; height: 349px;">
<table  style="font-size:0.9rem; width:100%" >
<thead>
<tr align="left">
<th width="97%">NOMBRE</th>
<th width="3%">&nbsp;</th>
</tr>
</thead>
<tbody>
<?php
$PX=0;

$s="SELECT id_linea,lin_nombre FROM lineas
	WHERE id_linea>0 AND LENGTH(TRIM(lin_nombre))>0 ORDER BY lin_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_linea'];?>);">
        <!----------------------------------------------->
        <td ><?php echo $r['lin_nombre'];?></td>
        <!----------------------------------------------->       
        <td>
        <a href="javascript:void(0)" onClick="fActivar(<?php echo $r['id_linea'];?>);">
        <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>
