<?php
session_start();
include("cls_conexion.php");$CNN=new ClsMySQL();include("conexion23.php");
if(strlen($_SESSION['SYS_USER_ID'])==0){JsDir("login.php");	return;}
//
$HW=$_SESSION['SYS_HW'];
$StrGT="";$LStrMsg="";$LStrFoc="";$LStrMM="";
//
$StrId=V($_POST['TxtId']);
$StrCmd=V($_POST['TxtAc']);
$LStrPag=V($_POST['TxtPag']);
//
include("transferencias_fun.php");
//
$VP_RegXPag=15;
$LStrTR=gn("count(*)","temp_compras","cod_temc='$StrHWND_T'");
$LStrPag=PagGet($LStrPag,$StrCmd,$LStrTR,$VP_RegXPag);	
$TI=0;

$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>Transferencias - Validar</title>
<!----------------------------------------->
<?php AddJs(); ?>
<script type="text/javascript" src="ja/funciones.js"></script>
<script type="text/javascript" src="ja/transferencias.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>
var myVar=setInterval(function(){myTimer()},500);
function myTimer(){
	t=GetHora();
	tt=document.getElementById("TxtHora").value;
	if(tt>0){
		if(t-tt>=1){
			document.getElementById("TxtHora").value=0;
			fGetTabla();			
		}
	}
}
function myStopFunction(){
	clearInterval(myVar);
}


$(document).ready(function(){  
   Inicializar();
   jF("TxtFec");
});


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

	if(e.which==78 && e.altKey){
		if(AT=="1"){
		document.getElementById("CmdC").click();
		return;
		}
	}
	
	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;" onunload="myStopFunction();">
<form id="Frm" name="Frm" method="post" action="transferenciasv.php"  autocomplete="off" 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">VALIDAR TRASFERENCIA</div>
</div>
<!----------------------------------------->

<div class="s1" style="left: 35px; top: 108px; width: 68px;">FECHA *</div>
<div class="s1" style="left: 35px; top: 124px; width: 79px;">(dd-mm-yy)</div>
<input name="TxtFec" type="text" id="TxtFec" 
class="fe"  style="left: 35px; top: 141px; width: 80px" 
value="<?php echo $StrFec;?>"  
tabindex="<?php echo ++$TI;?>" />

<div class="s1" style="left: 127px; top: 124px; width: 177px;">
ALMACEN ORIGEN *</div>
<select name="CboAlm" id="CboAlm" 
class="lt"  style="left: 127px; top: 141px; width: 218px" 
tabindex="<?php echo ++$TI;?>">
<?php echo FCBO_("alm_nombre","almacenes","id_almacen>=0",$StrAlm,"","S");?>     
</select>

<div class="s1" style="left: 355px; top: 109px; width: 102px;">
NUMERO AUTOGENERADO</div>
<input name="TxtNum" type="text" id="TxtNum" 
class="lt"  style="left: 353px; top: 141px; width: 100px; background: #CCC" 
value="<?php echo $StrNum;?>"  
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 470px; top: 124px; width: 180px;">
ALMACEN DESTINO *</div>
<select name="CboAlmD" id="CboAlmD" 
class="lt"  style="left: 466px; top: 141px; width: 200px" 
tabindex="<?php echo ++$TI;?>">
<?php echo ListALM($StrAlmD); ?>
</select>

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

<input name="CmdB" type="button" id="CmdA" class="btm"
value="Validar" onClick="fValidar();"
<?php
if(strlen($StrId)==0){
    echo "disabled=\"disabled\"";
}else{
    $_OK=0;
    $StrAnu=gs("anu","transferencias","id_trans=$StrId");
    if($StrAnu=="S"){
        echo " disabled=\"disabled\"";
        $_OK=1;
    }
    if($_OK==0){
    $StrAnu=gs("val","transferencias","id_trans=$StrId");
    if($StrAnu=="S"){
        echo " disabled=\"disabled\"";
        $_OK=1;
    }
        
    }
}
?>
tabindex="<?php echo ++$TI;?>"/>

<input name="CmdB" type="button" id="CmdB" class="btm"
value="Buscar" onClick="fBuscar('transferenciasv_buscar.php');"  
tabindex="<?php echo ++$TI;?>" />

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

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

<tr>
<th width="104">CODIGO</th>
<th width="416">DESCRIPCION</th>
<th width="458">MARCA</th>
<th width="96" style="text-align:right;">CANT</th>
<th width="42">&nbsp;</th>
</tr>
</thead>
<tbody>


<?php
	$StrHWND_T=$_SESSION['SYS_HW']."_T";
	$s="SELECT * FROM temp_compras WHERE cod_temc='$StrHWND_T' ORDER BY temc_index";
	$result = grs($s);
	while ($row = $result->fetch_row()){
		$X_ID=$row[1];
		$X_CO=VV(gs("COD","vproductos","ID=$X_ID"));
		$X_DE=VV(gs("DESCRIPCION","vproductos","ID=$X_ID"));
		$X_MA=VV(gs("MARCA","vproductos","ID=$X_ID"));
		$X_CA=$row[2];
		
		?>
		<tr>
		<!----------------------------------------------->
		<td ><?php echo $X_CO;?></td>
		<td ><?php echo $X_DE;?></td>
		<td ><?php echo $X_MAR;?></td>
		<td style="text-align:right"><?php echo $X_CA;?></td>
		<!----------------------------------------------->
		<td bgcolor="#FFFFFF" align="center">
		<a href="javascript:void(0)" onClick="fKiller(<?php echo $row[5];?>);">
		<img src="img/eliminar.png"  border="0"/></a></td>
		</tr>
		<?php
	}	
?>

</tbody>
</table>
</div>

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

<input name="TxtHora" type="hidden" id="TxtHora" value="0" />
<input name="TxtRuc_" type="hidden" id="TxtRuc_"  />

<div id="DivDatosProd">
<input name="Pro_TxtId" type="hidden" id="Pro_TxtId" value=""/>
<input name="Pro_TxtDes" type="hidden" id="Pro_TxtDes" value=""/>
<input name="Pro_TxtPre" type="hidden" id="Pro_TxtPre" value=""/>
<input name="Pro_TxtCod" type="hidden" id="Pro_TxtCod" value=""/>
<input name="Pro_TxtMarca" type="hidden" id="Pro_TxtMarca" value=""/>
</div>

<div id="TAB_AJAX" class="datagrid" style="visibility:hidden; height:202px; width:1126px; overflow-x:hidden; position:absolute; left: 31px; top: 346px; overflow-y:scroll; color: #0FF; background-color: #FFFFFF; layer-background-color: #CCCCCC; border: 1px none #000000;" align="left"></div>
<div id="TAB_CAPTION" class="datagrid" style="visibility:hidden; height:20px; width:1125px; position:absolute; left: 31px; top: 327px; color: #0FF; background-color: #CCCCCC; layer-background-color: #CCCCCC; border: 1px none #000000;" align="left">
<table width="1080" border="1" cellpadding="0" cellspacing="0" bgcolor="#d4e3e5" class="estilo888">   
<tr  height="10 px">
<td width="136" bgcolor="#CCCCCC">CODIGO</td>
<td width="365" bgcolor="#CCCCCC">DESCRIPCION</td>
<td width="121" bgcolor="#CCCCCC">MARCA</td>
<td width="56" align="right" bgcolor="#CCCCCC">PC SOL</td>
<td width="53" align="right" bgcolor="#CCCCCC">PC DOL</td>
</tr>   
</table>
<div style="position:absolute; top:0px; left:758px"><input name="CmdClose" type="button" value="Cerrar" onClick="CerrarDIV();" style="background-color:#F90" /></div>
</div>



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

