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

$LStrPag=V($_POST['TxtPag']);
include("transformaciones_fun.php");
$VP_RegXPag=15;
$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>
<!--CSS_NEW------------------------------------->
<link rel="stylesheet" type="text/css" href="estiloss.css"  />
<link rel="stylesheet" type="text/css" href="basic.css"  />
<!--CSS_NEW------------------------------------->
<?php AddJs();?>
<script type="text/javascript" src="fe/funcionez.js"></script>
<script type="text/javascript" src="fe/transformaciones2022.js"></script>
<script type="text/javascript" src="fe/leo.js"></script>
<script>
$(document).ready(function(){
$("#TxtFec").mask("99-99-99");
});
</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:1000px;
	height:600px;
	position:absolute;
	left:<?php echo "50%";?>;
	top:<?php echo "50%";?>;
	background-color:#006699;
	margin:<?php echo "-300px";?> 0 0 <?php echo "-500px";?>;
}
#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;}
.x4 {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.php">
<input name="TXT_FECHA" type="hidden" id="TXT_FECHA" value="<?php echo date("d-m-y");?>" />
<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"/>
		 <input name="CmdB" type="button" id="CmdB" 
         value="Buscar" onclick="fBuscar('transformaciones_buscar.php');"  tabindex="3"/>
         <input name="CmdB" type="button" id="CmdZ" 
         value="Menu" onclick="fBuscar('menu.php');"  tabindex="3"/>
      </div>
  </div>
<div id="layer3" style="position:absolute; left: 32px; top: 227px; width: 958px; height: 319px; overflow:auto">
<div align="left" class="f2">
<table width="933" height="19" border="1" cellpadding="0" cellspacing="0">

<tr>
<td height="18" colspan="10" bgcolor="#666666" align="center"><?php echo PagBtn($LStrTR,$VP_RegXPag,$LStrPag);?></td>
</tr>

<tr>
<td width="53" bgcolor="#999999"><span class="x4">FECHA</span></td>
<td width="86" bgcolor="#999999"><span class="x4">ALMACEN</span></td>
<td width="99" bgcolor="#999999"><span class="x4">CODIGO</span></td>
<td width="242" bgcolor="#999999"><span class="x4">PRODUCTO</span></td>
<td width="105" bgcolor="#999999"><span class="x4">CANT.Unidad(es)</span></td>
<td width="66" bgcolor="#999999"><span class="x4">DE.Caja(s)</span></td>
<td width="74" bgcolor="#999999"><span class="x4">Uni_x_Caja</span></td>
<td width="87" bgcolor="#999999"><span class="x4">HACIA.Caja(s)</span></td>
<td width="82" bgcolor="#999999"><span class="x4">DE.unidad(es)</span></td>          
<td width="17" 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,COD 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[9]).$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; ?>" />
<input name="FEC_SERVER" type="hidden" id="FEC_SERVER" value="<?php echo date("d-m-y");?>"/>  
<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:1000px; 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: 32px; top: 139px; width: 54px;">
<div align="left" class="f2">FECHA </div></div>
<div class="EV" style="left: 32px; top: 155px; width: 88px; color:#FF0"><u><a onclick="fFecServer('TxtFec')">(dd-mm-yy) +</a></u></div>
<input name="TxtFec" type="text" id="TxtFec" 
class="ps" style="position:absolute; left: 32px; top: 172px; width: 66px;" 
value="<?php echo $StrFec;?>"  
onkeydown="return SoloFec(this,event,'CboEmp');" 
tabindex="1" />

<div style="position:absolute; left:113px; top: 155px; width: 87px;">
<div align="left" class="f2">EMPRESA</div></div>
<select name="CboEmp" id="CboEmp" 
style="position:absolute; left:112px; top:172px; width: 125px;" 
onchange="EM_OC();"
onkeydown="return SoloTextoEx(event,'CboAlm');" tabindex="1">
<?php 
	echo LE($StrEmp,"N","N");
?>
</select>

<div style="position:absolute; left: 245px; top: 155px; width: 87px;">
<div align="left" class="f2">ALMACEN</div></div>
<select name="CboAlm" id="CboAlm" 
class="ps" style="position:absolute; left: 245px; top: 172px; width: 111px;" 
onkeydown="return SoloTextoEx(event,'TxtCod');" tabindex="2">
<?php 
	echo LA($StrEmp,$StrAlm,"N","N"); 
?>
</select>

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

<div id="layer25" style="position:absolute; left: 449px; 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: 446px; top: 172px; width: 160px; 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: 615px; top: 142px; width: 35px;">
<div align="left" class="f2">CANT</div></div>
<input name="TxtCan" type="text" id="TxtCan" 
style="position:absolute; left: 616px; top: 172px; width: 59px;" 
value="<?php echo $StrCan;?>"  
onkeydown="return SoloEnterosEx(this,event,'TxtDe1');" 
tabindex="4"/>
<div id="layer16" style="position:absolute; left: 615px; top: 157px; width: 31px;">
<div align="left" class="f2">unidad(es)</div></div>

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

<div id="layer16" style="position:absolute; left: 751px; 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: 752px; top: 172px; width: 64px;" 
value="<?php echo $StrUXC;?>"
onkeydown="return SoloEnterosEx(this,event,'TxtACI');" 
tabindex="6"/>

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

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


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