<?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");
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;
}
//
$Z=V($_POST['Z']);
if(strlen($Z)==0)$Z=V($_GET['Z']);
//-------------------------	
$StrGT="";	
$LStrMsg="";
$LStrFoc="";
$LStrMM="";
//-------------------------
$StrId=V($_POST['TxtId']);
$StrCmd=V($_POST['TxtAc']);

$LStrPag=V($_POST['TxtPag']);
include("transformaciones_fun.php");
$VP_RegXPag=5;
$LStrTR=gn("count(*)","vis_transformaciones","ID>0");
$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=utf-8" />
<title>TRASFORMACIONES</title>
<script type="text/javascript" src="fe/funciones.js"></script>
<script type="text/javascript" src="fe/transformaciones2_2022.js"></script>
<script type="text/javascript" src="fe/leo.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:900px;
	height:380px;
	position:absolute;
	left:50%;
	top:50%;
	background-color:#0066CC;
	margin:-190px 0 0 -450px;
}
#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;
}
.f2 {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}
#Frm center #DivFRM #layer .Estilo1 strong {
	color: #900;
}

-->
</style>

</head>
<body  <?php echo $LStrMsg;?> >
<form id="Frm" name="Frm" method="post" action="transformaciones_2.php">
<input name="L_USU" type="hidden" id="L_USU" value="<?php echo vbval(V($_SESSION['SYS_USER_ID']))?>">
<input name="Z" type="hidden" id="Z" value="<?php echo $Z?>" />
<center> 
  <div Id="DivFRM"  class="centrarFrm" >
    <div id="layer4" style="position:absolute; left: 35px; top: 85px; width: 525px; height: 26px;">
      <div align="left" class="f2">
        <input name="CmdB" type="button" id="CmdG" 
		<?php
		if(strlen($StrId)==0){
			echo "value=\"Guardar\"";			
		}else{
			echo "value=\"Modificar\"";	
			echo "disabled=\"disabled\"";						
		}
		?>
		onclick="fGuardar();" style="width:80px" tabindex="2"/>

		<input name="CmdB" type="button" id="CmdC" value="Nuevo" onclick="fCancelar();"  tabindex="3"/>
		<input name="CmdB" type="button" id="CmdE" value="Eliminar" onclick="flEliminar();"
		<?php
		if(strlen($StrId)==0){
			echo "disabled=\"disabled\"";	
		}
		?>
		 tabindex="4"/>
      </div>
  </div>
    <div id="layer3" style="position:absolute; left: 32px; top: 227px; width: 842px; height: 142px;">
      <div align="left" class="f2">
<table width="839" height="19" border="1" cellpadding="0" cellspacing="0">
<tr  >
<td height="18" colspan="9" bgcolor="#666666" align="center">
<?php echo PagBtn($LStrTR,$VP_RegXPag,$LStrPag);?>
</td>
</tr>

<tr>
<td width="60" bgcolor="#999999"><span class="Estilo4">FECHA</span></td>
<td width="116" bgcolor="#999999"><span class="Estilo4">ALMACEN</span></td>
<td width="220" bgcolor="#999999"><span class="Estilo4">PRODUCTO</span></td>
<td width="103" bgcolor="#999999"><span class="Estilo4">CANT.Unidad(es)</span></td>
<td width="67" bgcolor="#999999"><span class="Estilo4">DE.Caja(s)</span></td>
<td width="74" bgcolor="#999999"><span class="Estilo4">Uni_x_Caja</span></td>
<td width="86" bgcolor="#999999"><span class="Estilo4">HACIA.Caja(s)</span></td>
<td width="78" bgcolor="#999999"><span class="Estilo4">DE.unidad(es)</span></td>          
<td width="15" bgcolor="#999999">&nbsp;</td>
</tr>
<?php
	$s="SELECT ID,DATE_FORMAT(FEC,'%d-%m-%y'),ALM,DES_PRO,CAN,D_CAJA,D_U_X_CAJA,A_CAJA,A_U_X_CAJA 
	FROM vis_transformaciones
	WHERE ID> 0 ORDER BY ID DESC";

	$s=PagSql($s,$LStrPag,$VP_RegXPag,$LStrTR);	  				
	$result = grs($s);
	$X1="<td bgcolor=\"#FFFFFF\"><span class=\"Estilo5\">";
	$X2="</span></td>";
	while ($row = $result->fetch_row()){
		echo "<tr ondblclick=\"fActivar($row[0]);\">";
		echo $X1.VV($row[1]).$X2;
		echo $X1.VV($row[2]).$X2;
		echo $X1.VV($row[3]).$X2;
		echo $X1.VV($row[4]).$X2;
		echo $X1.VV($row[5]).$X2;
		echo $X1.VV($row[6]).$X2;
		echo $X1.VV($row[7]).$X2;
		echo $X1.VV($row[8]).$X2;
		echo "<td bgcolor=\"#FFFFFF\" align=\"center\">
			 <a href=\"javascript:void(0)\" onclick=\"fActivar($row[0]);\">
			 <img src=\"img/b_edit.png\"  border=\"0\"/>
			 </a>
			 </td>";
		echo "</tr>";
	}

?>		  
          
        </table>
      </div>
    </div>
    <div id="layer" style="position:absolute; left: 116px; top: 21px; width: 412px; height: 45px; z-index: 100;">
    	<div id="DivSunat">
        <input name="T_RS" type="hidden" id="T_RS" value=""/>
        <input name="T_DI" type="hidden" id="T_DI" value=""/>
        <input name="T_TE" type="hidden" id="T_TE" value=""/>
        </div>
<div align="left" class="Estilo1">
        <input name="TxtId" type="hidden" id="TxtId" value="<?php echo $StrId;?>"/>
		<input name="TxtAc" type="hidden" id="TxtAc" value="" />
		<input name="TxtPag" type="hidden" id="TxtPag" value="<?php echo $LStrPag; ?>" />
<strong>TRASFORMACIONES</strong></div>

<div id="DivDatosActividad">

</div>

</div>
    <div id="LblTit" style="position:absolute; left: 52px; top: 15px; width: 64px; z-index: 100;">
      <div align="left" class="Estilo1"><img src="img/clientes.png" width="56" height="52" /></div>
</div>
    <div id="layer8" style="position:absolute; left: 0px; top: 0px; width: 900px; height: 79px; background-color: #FFFFFF; layer-background-color: #FFFFFF; border: 1px none #000000; z-index: 0;">
      <div align="left" class="Estilo1">        
      </div>
</div>

<div id="layer6" style="position:absolute; left: 35px; top: 139px; width: 54px;">
<div align="left" class="f2">FECHA </div></div>
<div id="layer27" style="position:absolute; left: 35px; top: 155px; width: 79px;">
<div align="left" class="f2">(dd-mm-yy)</div></div>
<input name="TxtFec" type="text" id="TxtFec" 
class="ps" style="position:absolute; left: 35px; top: 172px; width: 66px;" 
value="<?php echo $StrFec;?>"  
onkeydown="return SoloFec(this,event,'CboAlm');" 
tabindex="1" />

<div id="layer25" style="position:absolute; left: 114px; top: 155px; width: 87px;">
<div align="left" class="f2">ALMACEN</div></div>
<select name="CboAlm" id="CboAlm" 
class="ps" style="position:absolute; left: 112px; top: 172px; width: 116px;" 
onkeydown="return SoloTextoEx(event,'TxtCod');" tabindex="2">
<?php
 echo FCBO_("ANC","vis_almacenes","IDA>0",$StrAlm,"N","N");	
 ?>
</select>

<div id="layer25" style="position:absolute; left: 239px; top: 155px; width: 71px;">
<div align="left" class="f2">COD.PRO + </div></div>
<input name="TxtCod" type="text" id="TxtCod"  style="position:absolute; left: 240px; top: 172px; width: 56px;" 
value="<?php echo $StrCod;?>"
onKeyDown="return GetLib(event,'TxtCan');"
tabindex="3" />

<div id="layer25" style="position:absolute; left: 312px; top: 155px; width: 93px;">
<div align="left" class="f2">DESCRIPCION</div></div>
<input name="TxtDes" type="text" id="TxtDes" 
class="ps"  style="position:absolute; left: 309px; top: 172px; width: 188px; background-color:#CCC;" 
value="<?php echo $StrDes;?>"
onkeydown="return SoloTextoEx(event,'TxtDes');"
onkeyup="document.getElementById('TxtHora').value=GetHora();"
tabindex="3" readonly="readonly"/>

<div id="layer16" style="position:absolute; left: 518px; top: 142px; width: 35px;">
<div align="left" class="f2">CANT</div></div>
<input name="TxtCan" type="text" id="TxtCan" 
style="position:absolute; left: 519px; top: 172px; width: 50px;" 
value="<?php echo $StrCan;?>"  
onkeydown="return SoloEnterosEx(this,event,'TxtDe1');" 
tabindex="4"/>
<div id="layer16" style="position:absolute; left: 518px; top: 157px; width: 31px;">
<div align="left" class="f2">unidad(es)</div></div>

<div id="layer16" style="position:absolute; left: 593px; top: 142px; width: 26px;">
<div align="left" class="f2">DE</div></div>
<input name="TxtDe1" type="text" id="TxtDe1" 
style="position:absolute; left: 594px; top: 172px; width: 50px;" 
value="<?php echo $StrDe1;?>"  
onkeydown="return SoloEnterosEx(this,event,'TxtUXC');" 
tabindex="5"/>
<div id="layer16" style="position:absolute; left: 593px; top: 157px; width: 48px;">
<div align="left" class="f2">Caja(s)</div></div>

<div id="layer16" style="position:absolute; left: 654px; top: 157px; width: 72px;">
<div align="left" class="f2">UNI x CAJA</div></div>
<input name="TxtUXC" type="text" id="TxtUXC" 
style="position:absolute; left: 655px; top: 172px; width: 64px;" 
value="<?php echo $StrUXC;?>"
onkeydown="return SoloEnterosEx(this,event,'TxtACI');" 
tabindex="6"/>

<div id="layer16" style="position:absolute; left: 748px; top: 142px; width: 43px;">
<div align="left" class="f2">HACIA</div></div>
<input name="TxtACI" type="text" id="TxtACI" 
style="position:absolute; left: 749px; top: 172px; width: 50px;" 
value="<?php echo $StrACI;?>"  
onkeydown="return SoloEnterosEx(this,event,'TxtDe2');" 
tabindex="7"/>
<div id="layer16" style="position:absolute; left: 749px; top: 157px; width: 49px;">
<div align="left" class="f2">Caja(s)</div></div>

<div id="layer16" style="position:absolute; left: 809px; top: 142px; width: 26px;">
<div align="left" class="f2">DE</div></div>
<input name="TxtDe2" type="text" id="TxtDe2" 
style="position:absolute; left: 810px; top: 172px; width: 51px;" 
value="<?php echo $StrDe2;?>"  
onkeydown="return SoloEnterosEx(this,event,'CmdG');" 
tabindex="8"/>
<div id="layer16" style="position:absolute; left: 809px; top: 157px; width: 48px;">
<div align="left" class="f2">unidad(es)</div></div>

<div id="layer21" style="position:absolute; left: 515px; top: 116px; width: 58px; z-index: 400;">
<div align="left">PROCESAR</div></div>


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