<?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");
include("sis_validaciones.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_almacenes_fun.php");
//--------------------------------------------------------------------------
$VP_RegXPag=20;
$LStrTR=gn("count(*)","almacenes","id_almacen>0");
$LStrPag=PagGet($LStrPag,$StrCmd,$LStrTR,$VP_RegXPag);	
$TI=0;
?>

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

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

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


<div class="s1" style="left: 35px; top: 115px; width: 75px;">EMPRESA</div>
<select name="CboEmp" id="CboEmp" 
class="lt" style="left: 34px; top: 132px; width: 155px;" 
tabindex="<?php echo ++$TI;?>">
<?php 
	echo LE($StrEmp,"N","N"); 
?>
</select>

<div class="s1" style="left: 202px; top: 115px; width: 102px;">
NOMBRE</div>
<input name="TxtNom" type="text" id="TxtNom"
class="lt" style="left: 200px; top: 132px; width: 180px;" 
value="<?php echo $StrNom;?>"  
tabindex="<?php echo ++$TI;?>" />

<div class="s1" style="left: 390px; top: 115px; width: 123px;">
NOMBRE CORTO
</div>
<input name="TxtObs" type="text" id="TxtObs" 
class="lt" style="left: 389px; top: 132px; width: 156px;" 
value="<?php echo $StrObs;?>"   
tabindex="<?php echo ++$TI;?>" />

<div class="s1" style="left: 553px; top: 115px; width: 258px;">
DIRECCION (Sera impreso en la proforma)</div>
<input name="TxtDir" type="text" id="TxtDir" 
class="lt" style="left: 553px; top: 132px; width: 287px;" 
value="<?php echo $StrDir;?>"  maxlength="100"  
tabindex="<?php echo ++$TI;?>" />

<div class="s1" style="left: 848px; top: 115px; width: 52px;"> TIPO
</div>
<select name="Funcion" id="Funcion" 
class="lt" style="left: 848px; top: 132px; width: 84px;" 
tabindex="<?php echo ++$TI;?>">
<?php 
echo FCBOO("au_item","auxiliar","au_tab='ALM_FUN'",$Fun,"N","S","au_orden");
?>
</select>

<div class="s1" style="left: 942px; top: 115px; width: 293px;">
TELEFONOS (Sera impreso en las proformas)
</div>
<input name="TxtTel" type="text" id="TxtTel" 
class="lt" style="left: 942px; top: 132px; width: 283px;" 
value="<?php echo $StrTel;?>"    maxlength="65"
tabindex="<?php echo ++$TI;?>" />


<div class="s1" style="left: 35px; top: 164px; width: 293px;">
<B>DIRECCION PARA LA GUIAS DE REMISION</B>
</div>


<div class="s1" style="left: 35px; top: 181px; width: 258px;">
DIRECCION</div>
<input name="GDir" type="text" id="GDir" 
class="lt" style="left: 35px; top: 201px; width: 509px;" 
value="<?php echo $GDir;?>"  maxlength="100"  
tabindex="<?php echo ++$TI;?>" />

<div class="s1" style="left: 553px; top: 181px; width: 116px;">
DEPARTAMENTO</div>
<input name="GDep" type="text" id="GDep" 
class="lt" style="left: 553px; top: 201px; width: 155px;" 
value="<?php echo $GDep;?>"  maxlength="100"  
tabindex="<?php echo ++$TI;?>" />


<div class="s1" style="left: 720px; top: 181px; width: 116px;">
PROVINCIA</div>
<input name="GPro" type="text" id="GPro" 
class="lt" style="left: 720px; top: 201px; width: 143px;" 
value="<?php echo $GPro;?>"  maxlength="100"  
tabindex="<?php echo ++$TI;?>" />

<div class="s1" style="left: 873px; top: 181px; width: 116px;">
DISTRITO</div>
<input name="GDis" type="text" id="GDis" 
class="lt" style="left: 873px; top: 201px; width: 242px;" 
value="<?php echo $GDis;?>"  maxlength="100"  
tabindex="<?php echo ++$TI;?>" />


<div class="s1" style="left: 1123px; top: 181px; width: 98px;">
UBIGEO</div>
<input name="GUbi" type="text" id="GUbi" 
class="lt" style="left: 1123px; top: 201px; width: 102px;" 
value="<?php echo $GUbi;?>"  maxlength="6"  
tabindex="<?php echo ++$TI;?>" />



<!--INI_BOTONES-------------------------------->
<div class="ps" align="left" style="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: 230px; 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: 265px; width: 1180px; height: 301px;">
<table  style="font-size:0.9rem; width:100%" >
<thead>
<tr align="left">
<th width="11%">EMPRESA</th>
<th width="11%">NOMBRE</th>
<th width="10%">NOMBRE CORTO</th>
<th width="31%">DIRECCION</th>
<th width="20%">TELEFONO</th>
<th width="8%">TIPO</th>
<th width="7%">UBIGEO</th>
<th width="2%">&nbsp;</th>
</tr>
</thead>
<tbody>
<?php
$PX=0;
$s="SELECT * FROM vis_almacenes
	WHERE IDA> 0 ORDER BY ENC,ANL ";
$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['IDA'];?>);">
        <!----------------------------------------------->
        <td ><?php echo $r['ENC'];?></td>
        <td ><?php echo $r['ANL'];?></td>
        <td ><?php echo $r['ANC'];?></td>
        <td ><?php echo $r['ADIR'];?></td>
        <td ><?php echo $r['TEL'];?></td>
        <td ><?php echo $r['FUN'];?></td>
        <td ><?php echo $r['UBI'];?></td>
        <!----------------------------------------------->       
        <td>
        <a href="javascript:void(0)" onClick="fActivar(<?php echo $r['IDA'];?>);">
        <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>
