<?php
session_start();
include("cls_conexion.php");$CNN=new ClsMySQL();include("conexion23.php");
include("phpmnu_fun.php");
//
if(strlen($_SESSION['SYS_USER_ID'])==0){JsDir("login.php");	return;}
//
include("productos_buscar_bx.php");

$IdUsu=$_SESSION['SYS_USER_ID'];
$AT=gs("at","usuarios","id_usuario=$IdUsu");
?>

<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Productos - Buscar</title>
<!----------------------------------------->
<?php AddJs(); ?>
<script type="text/javascript" src="ja/funciones.js"></script>
<script type="text/javascript" src="ja/ajf.js"></script>
<!----------------------------------------->
<link rel="stylesheet" type="text/css" href="css/estiloss.css"  />
<link rel="stylesheet" type="text/css" href="css/basic.css"  />
<link rel="stylesheet" type="text/css" href="css/mnu.css"  />
<!----------------------------------------->
<style type="text/css">
.tableFixHead          { overflow-y: auto; }
.tableFixHead thead th { position: sticky; top: 0; }

table  {border-collapse:collapse;width:100%;}
th, td {padding: 3px 3px;}
th     {background:#666;}


.cF {height:600px;width:1250px;position:relative;top:0px}
.mM {height:34px;width:1250px;position:relative;top:0px;background-color:#09C; z-index:500;}

</style>

<!----------------------------------------->
<script>
$(document).ready(function(){  
   Inicializar();
   jF("TxtCod");
});

$(document).keydown(function(e){
	var AT=gv("TxtAT");

	if(e.which==66 && e.altKey){
		if(AT=="1"){	
		document.getElementById("CmdB").click();
		return;
		}
	}

	if(e.which==86 && e.altKey){
		if(AT=="1"){
		document.getElementById("CmdZ").click();
		return;
		}
	}
  
});
</script>
<!----------------------------------------->
<body  <?php echo $LStrMsg;?>  >
<div align="center">

<div class="mM" align="left" style="font-size:12px">
<?php
//$HTM=file_get_contents("http://inversionessounduniversal.com/ventas/phpmnu.php?USER_ID=$IdUsu");
echo GEN_MENU(vbval(V($_SESSION['SYS_USER_ID'])));
?>
</div>

<div Id="DivFRM"  class="cF" style="background-color:#FFFFFF;" >
<form id="Frm" name="Frm" method="post" autocomplete="off"
action="productos_buscar.php" 
style="margin:0px; padding:0px; display:inline;" onSubmit="return false;">

<!----------------------------------------->
<div id="DivT" class="dT"  style="width:1250px;">
<img src="b.png" class="iT" />
<div class="tT">PRODUCTOS - BUSCAR</div>
</div>
<!----------------------------------------->


<div class="s1" style="left:35px; top: 117px; width: 52px;">
CODIGO</div>
<input name="TxtCod" type="text" id="TxtCod"  
class="lt" style="left: 35px; top: 134px; width: 97px;"
value="<?php echo $StrCod;?>"  
tabindex="<?php echo ++$TI;?>"/>
    
<div class="s1" style="left:142px; top: 117px; width: 151px;">
TIPO DE ARTICULO</div>    
<select name="Lin" id="Lin"  
class="lt" style="left:138px; top: 134px; width: 160px;"
tabindex="<?php echo ++$TI;?>">    
<?php
echo FCBO_("lin_nombre","lineas","id_linea>0",$Lin,"S","N");
?>
</select>   
  
<div class="s1" style="left: 308px; top: 117px; width: 157px;">
DESCRIPCION</div>
<input name="TxtDes" type="text" id="TxtDes" 
class="lt" style="left: 305px; top: 134px; width: 384px;"
value="<?php echo $StrDes;?>"  
tabindex="<?php echo ++$TI;?>"/>
<div class="s1" style="left: 701px; top: 117px; width: 99px;">
  MARCA</div>    
<select name="CboMar" id="CboMar"
class="lt" style="left: 699px; top: 134px; width: 202px;"
tabindex="<?php echo ++$TI;?>">    
<?php
    echo FCBO("mar_nombre","marcas","id_marca>0",$StrMar,"S","N");
?>
</select>   



<!----------------------------------------->
<?php $VOLVER="productos.php";?>
<?php include("botones_b.php");?>;

<!----------------------------------------->  

<div  style="position:absolute; top:162px; left:29px; height:27px; background-color:#FFF; width: 1189px;">
<table width="100%" style="font-family:Arial, Helvetica, sans-serif; font-size:11px" border="0">
<tr>
<td align="center">
	<?php echo PagBtn($LStrTR,$VP_RegXPag,$LStrPag);?>
</td>
</tr>
</table>
</div> 
  
<div class="tableFixHead" id="DivT" style="position:absolute; top:194px; left:29px; border:1px solid; border-color:#666; height:382px; background-color:#FFF; overflow:auto; width: 1189px;">
<table id="Exportar_a_Excel" width="100%" style="font-family:Arial, Helvetica, sans-serif; font-size:11px">
<thead>

<tr>
<th width="11%">CODIGO</th>
<th width="16%">TIPO DE ARTICULO*</th>
<th width="41%">DESCRIPCION*</th>
<th width="9%">MARCA*</th>
<th width="4%">UNIDAD</th>
<th width="6%">P.COMPRA</th>
<th width="5%">MONEDA</th>
<th width="6%">P.VENTA(s/)</th>
<th width="2%">&nbsp;</th>
</tr>
</thead>
<tbody>

<?php
	$i=0;			  		
	$s="SELECT * FROM viz_productos WHERE $FF ORDER BY TIP,DES,MAR ";				
	$s=PagSql($s,$LStrPag,$VP_RegXPag,$LStrTR);			
	$result = grs($s);
	while ($r = $result->fetch_assoc()){
	$i++;
	$CSS="";
	if($i%2==0){
		$CSS=" style=\"background-color:#E2E2E2\" ";
	}
?>
    <tr <?php echo $CSS;?> height="10px" onDblClick="location.href='productos.php?Id=<?php echo $r['ID'];?>&Pag=0';">
    <td ><?php echo $r['COD'];?></td>	
    <td ><?php echo $r['TIP'];?></td>	
    <td ><?php echo $r['DES'];?></td>	
    <td ><?php echo $r['MAR'];?></td>				 
    <td ><?php echo $r['UNI'];?></td>	
    <td ><?php echo $r['PCO'];?></td>	
    <td ><?php echo $r['MND'];?></td>	
    <td ><?php echo $r['PVE'];?></td>	
    <td ><a href="productos.php?Id=<?php echo $r['ID'];?>&Pag=0"><img src="e.png"  border="0"></a></td>
    </tr>
<?php
	}
?>
   
</tbody>
</table>
</div>

<!----------------------------------------->    
<?php include("ocultos.php");?>

</form>
</div>
</div>
</body>
</html>
