<?php
session_start();
include("cls_conexion.php");$CNN=new ClsMySQL();include("conexion23.php");
//
if(strlen($_SESSION['SYS_USER_ID'])==0){JsDir("login.php");	return;}
//
include("deos_oferta_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>Consulta de precios / Oferta</title>
<!----------------------------------------->
<?php AddJs(); ?>
<script type="text/javascript" src="ja/funciones.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">
.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 $HTM;
?>
</div>

<div Id="DivFRM"  class="cF" style="background-color:#FFFFFF;" >
<form id="Frm" name="Frm" method="post" action="pre_productos_oferta.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">CONSULTA DE PRECIOS / Ofertas</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: 95px" 
value="<?php echo $StrCod;?>"  
tabindex="<?php echo ++$TI;?>" />

<div class="s1" style="left: 143px; top: 117px; width: 136px;">LINEA DE PRODUCTO</div>
<select name="CboLin" id="CboLin" 
class="lt" style="left: 140px; top: 134px; width: 144px" 
tabindex="<?php echo ++$TI;?>">
<?php echo FCBO_("lin_nombre","lineas","id_linea>0",$StrLin,"S","");?>
</select>
<div class="s1" style="left: 295px; top: 117px; width: 498px;">DESCRIPCION</div>
<input name="TxtDes" type="text" id="TxtDes" 
class="lt" style="left: 295px; top: 134px; width: 522px" 
value="<?php echo $StrDes;?>"  
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 826px; top: 117px; width: 125px;">MARCA</div>
<select name="CboMar" id="CboMar" 
class="lt" style="left: 824px; top: 134px; width: 145px" 
tabindex="<?php echo ++$TI;?>">
<?php echo FCBO_("mar_nombre","marcas","id_marca>0",$StrMar,"S","");?>
</select>

<div class="s1" style="left: 981px; top: 117px; width: 111px;">EN OFERTA</div>
<select name="Ofe" id="Ofe" 
class="lt" style="position: absolute; left: 980px; top: 134px; width: 105px;"
tabindex="<?php echo ++$TI;?>">
<?php
	echo FCBO("aux_nom","auxiliar","aux_des='SN'",$Ofe,"S","N");
?>
</select>


<!----------------------------------------->
<div id="DivBtn" align="left" style="position:absolute; left: 33px; top: 71px; width: 551px; height: 26px;">
<input name="CmdB" type="button" id="CmdB" class="btm"
value="Buscar" onClick="fFiltrar();"  
tabindex="<?php echo ++$TI;?>" />

</div>
<!-----------------------------------------> 

<div class="datagrid" style="position: absolute; left: 35px; top: 165px; width: 1180px; height: 416px; overflow: auto">
<table width="100%">
<thead>
<tr>
<td colspan="13" align="center"><?php echo PagBtn($LStrTR,$VP_RegXPag,$LStrPag);?></td>
</tr>

<tr>
<th width="10%">CODIGO</th>
<th width="16%">LINEA</th>
<th width="25%">DESCRIPCION</th>
<th width="9%" style="text-align:right;">PV. MIN</th>
<th width="9%" style="text-align:right;">PV. MAX</th>
<th width="9%" style="text-align:right;">PxU</th>
<th width="9%" style="text-align:right;">PxC</th>
<th width="9%" style="text-align:right;">PxM</th>
<th width="4%">&nbsp;</th>
</tr>
</thead>
<tbody>

<?php		  		
$s="SELECT ID,COD,SUBSTRING(LINEA,1,15)as LIN,
	SUBSTRING(DESCRIPCION,1,15) as DEZ,
	FORMAT(PV_MIN,1) as PM,FORMAT(PV_MAX,1) as PW,
	SUBSTRING(FAB,1,15) as FAK,SUBSTRING(MODELO,1,15) as MOK,
	PXU,PXC,PXM,OFE
	FROM vproductos 
	WHERE $FF ORDER BY DESCRIPCION,MARCA ";
	
	$s=PagSql($s,$LStrPag,$VP_RegXPag,$LStrTR);						
	$result = grs($s);
	while ($row = $result->fetch_assoc()){
		$PXU="PXU_".$row['ID'];
		$PXC="PXC_".$row['ID'];
		$PXM="PXM_".$row['ID'];
		$OFE="OFE_".$row['ID'];
		?>
		<tr>
		<td bgcolor="#FFFFFF">'<?php echo $row['COD'];?></td>
		<td bgcolor="#FFFFFF"><?php echo $row['LIN'];?></td>
		<td bgcolor="#FFFFFF"><?php echo $row['DEZ'];?></td>
		<td bgcolor="#FFFFFF" align=\"right\"><?php echo $row['PM'];?></td>
		<td bgcolor="#FFFFFF" align=\"right\"><?php echo $row['PW'];?></td>
        <td bgcolor="#FFFFFF" align=\"right\"><?php echo $row['PXU'];?></td>
        <td bgcolor="#FFFFFF" align=\"right\"><?php echo $row['PXC'];?></td>
        <td bgcolor="#FFFFFF" align=\"right\"><?php echo $row['PXM'];?></td>
        <td bgcolor="#FFFFFF"><?php echo $row['OFE'];?></td>
		</tr>
		<?php
	}
?>		  
</tbody>
</table>
</div>

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

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