<?php
	session_start();
	include("cls_conexion.php");$CNN=new ClsMySQL();include("conexion23.php");
	if(strlen($_SESSION['SYS_USER_ID'])==0){JsDir("login.php");	return;}
	//-------------------------	
	
	$StrId=V($_POST['TxtId']);
	$StrCmd=V($_POST['TxtAc']);
	$StrNom=V($_POST['TxtNom']);		
	
	//-------------------------
	$StrNomT=$StrNom."%";
	$LStrTR=gn("count(*)","almacenes","alm_nombre LIKE '$StrNomT'");
	$LStrPag=V($_POST['TxtPag']);	
	if($StrCmd=="F"){$LStrPag="1";}
	$VP_RegXPag=10;	
	$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=iso-8859-1" />
<title>Categorias</title>
<script type="text/javascript" src="funciones.js"></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:50%;
     top:50%;
	 background-color:#006699;
	 margin:-300px 0 0 -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;
}
.Estilo2 {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}

-->
</style>

</head>
<body  <?php echo $StrMsg;?>>
<form id="Frm" name="Frm" method="post" action="almacenes_buscar.php">
<center> 
  <div Id="DivFRM"  class="centrarFrm" >
    <div id="layer6" style="position:absolute; left: 60px; top: 86px; width: 124px;">
      <div align="left" class="Estilo2">NOMBRE</div>
    </div>

    <div id="layer5" style="position:absolute; left: 116px; top: 50px; width: 85px; height: 28px;">
      <div align="left" class="Estilo2">
        <input name="CmdV" type="button" id="CmdV" 
        value="Volver" onclick="fVolver('almacenes.php');" />
      </div>
    </div>

    <div id="layer3" style="position:absolute; left: 60px; top: 138px; width: 608px; height: 200px;">
      <div align="left" class="Estilo2">
        <table width="393" border="1" cellpadding="0" cellspacing="0">
          <tr>
            <td colspan="2" bgcolor="#999999" height="25px" align="center">
            <?php echo PagBtn($LStrTR,$VP_RegXPag,$LStrPag);?>
            </td>
            </tr>
          <tr>
            <td width="252" bgcolor="#999999"><span class="Estilo4">NOMBRE</span></td>
            <td width="39" bgcolor="#999999">&nbsp;</td>
          </tr>
  <?php		  		
		$s="SELECT id_almacen,alm_nombre 
			FROM almacenes WHERE id_almacen> 0 AND 
			alm_nombre LIKE '$StrNomT' ORDER BY id_almacen ";
        $s=PagSql($s,$LStrPag,$VP_RegXPag,$LStrTR);		  				
        $result = grs($s);
        while ($row = $result->fetch_row()){
            echo "<tr 
            ondblclick=\"location.href='almacenes.php?Id=$row[0]&Pag=0';\">";
            echo "<td bgcolor=\"#FFFFFF\">
                 <span class=\"Estilo5\">$row[1]</span></td>";
            echo "<td bgcolor=\"#FFFFFF\" align=\"center\">
                 <a href=\"almacenes.php?Id=$row[0]&Pag=0\" >
                 <img src=\"img/b_edit.png\"  border=\"0\"/>
                 </a>
                 </td>";
            echo "</tr>";
        }

  ?>		  
          <tr  >
            <td bgcolor="#FFFFFF">

			</td>
            <td bgcolor="#FFFFFF" ></td>
          </tr>
        </table>
      </div>
    </div>
    <div id="layer" style="position:absolute; left: 116px; top: 30px; width: 412px; height: 24px;">
      <div align="left" class="Estilo1">ALMACENES - BUSCAR
        <input name="TxtId" type="hidden" id="TxtId" value="<?php echo $StrId;?>"/>
        <input name="TxtPag" type="hidden" id="TxtPag" value="<?php echo $LStrPag; ?>" />
		<input name="TxtAc" type="hidden" id="TxtAc" value="" />
      </div>
    </div>
    <div id="layer2" style="position:absolute; left: 60px; top: 109px; width: 173px; height: 25px;">
      <div align="left" class="Estilo2">        
          <input name="TxtNom" type="text" id="TxtNom" style="width:200px" value="<?php echo $StrNom;?>"  onKeyDown="return SoloTexto(event);" onkeypress="return pulsar(event);" tabindex="1" />
      </div>
    </div>
    <div id="LblTit" style="position:absolute; left: 55px; top: 25px; width: 64px;">
    <div align="left" class="Estilo1"><img src="img/buscar.png" width="57" height="60" /></div>
  </div>	
    <div id="layer4" style="position:absolute; left: 268px; top: 109px; width: 183px; height: 26px;">
      <div align="left" class="Estilo2">
        <input name="CmdB" type="button" id="CmdB" value="Filtrar" onclick="fFiltrar();" />
      </div>
    </div>
    </div>
</center>	
</form>
</body>
</html>
