<?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;}
//
$StrCmd=V($_POST['TxtAc']);
$SYS_MSG="";
$SYS_FOC="Pie";
$SYS_CMD="";
//
$INV_KOD=vbval(V($_GET['INV_KOD']));
$INV_ITE=vbval(V($_GET['INV_ITE']));
$INV_PID=vbval(V($_GET['INV_PID']));
$TMP_KOD=vbval(V($_GET['TMP_KOD']));
$HWN=vbval(V($_GET['HWN']));
//
if($INV_KOD==0){
	$INV_KOD=vbval($_POST['INV_KOD']);
	$INV_ITE=vbval($_POST['INV_ITE']);	
	$INV_PID=vbval($_POST['INV_PID']);	
	$TMP_KOD=vbval($_POST['TMP_KOD']);	
	$HWN=V($_POST['TXT_HWN']);	
}
//
$REF_KOD=vbval(V($_POST['REF_KOD']));
//
if($StrCmd=="ADD_REF"){
	//
	$Emp=VU($_POST['Emp']);
	$InvFec=VU($_POST['InvFec']);
	$InvSer=VU($_POST['InvSer']);
	$InvNum=VU($_POST['InvNum']);
	$InvIte=VU($_POST['InvIte']);
	$PaiOri=VU($_POST['PaiOri']);
	$PaiDes=VU($_POST['PaiDes']);
	$Par=VU($_POST['Par']);
	$NomCom=VU($_POST['NomCom']);
	$Est=VU($_POST['Est']);
	$FobUsd=VU($_POST['FobUsd']);
	$FobKg=VU($_POST['FobKg']);
	$UndR=VU($_POST['UndR']);
	$Can=VU($_POST['Can']);
	$Mod=VU($_POST['Mod']);
	$Cla=VU($_POST['Cla']);
	$Dua=VU($_POST['Dua']);
	$DuaIte=VU($_POST['DuaIte']);
	$Lnk="";
	$Obs=VU($_POST['Obs']);
	//
	$SYS_FEC=date("Y-m-d");
	$SYS_HOR=GetHoraAP();
	$SYS_TIM=time();
	//
	$_PRO=$INV_PID;//vbval($StrId);
	$_INV_FEC=ToDate($InvFec);
	$_INV_NUM=vbval($InvNum);
	$_INV_ITE=vbval($InvIte);
	$_FOB_USD=vbval($FobUsd);
	$_FOB_KG=vbval($FobKg);
	$_CAN=vbval($Can);
	$_DUA_ITE=vbval($DuaIte);
	//
	$Emp_=gn("id_emp","ges_empresas","emp_nom_cor='$Emp'");	
	//
	$ref_inv_id=0;
	$ref_inv_id_pro=0;
	$ref_inv_ok=0;
	//
	$ref_inv_id=gn("id_in","ges_invoice","in_inv_ser='".$InvSer."' AND in_inv_num_=".$_INV_NUM);
	if($ref_inv_id>0){
		$ref_inv_id_pro=gn("det_id_pro","ges_invoice_det","det_id_inv=$ref_inv_id AND det_cx=$_INV_ITE");
		if($ref_inv_id_pro==$_PRO){
			$ref_inv_ok=1;		
		}
	}
	//
	$XXX_UNIDAD="";
	//
	$_KOD=GenId("id_ref","ges_productos_referencias");
	$s="INSERT INTO ges_productos_referencias 
		VALUES ($_KOD,'$SYS_FEC','$SYS_HOR',
		$SYS_TIM,$_PRO,$Emp_,'$_INV_FEC','$InvSer','$InvNum',
		$_INV_NUM,$_INV_ITE,'$PaiOri','$PaiDes','$Par',
		'$NomCom','$Est',$_FOB_USD,$_FOB_KG,'$UndR',
		$_CAN,'$Mod','$Cla','$Dua',$_DUA_ITE,'$Lnk',
		'$Obs',0,$ref_inv_id,$ref_inv_id_pro,$ref_inv_ok,'','',0,0,'','INV','$XXX_UNIDAD')";
	ejt($s);
	//++
	$Emp="";
	$InvFec="";
	$InvSer="";
	$InvNum="";
	$InvIte="";
	$PaiOri="";
	$PaiDes="";
	$Par="";
	$NomCom="";
	$Est="";
	$FobUsd="";
	$FobKg="";
	$UndR="";
	$Can="";
	$Mod="";
	$Cla="";
	$Dua="";
	$DuaIte="";
	$Lnk="";
	$Obs="";
	//++	
	$SYS_MSG="Referencia registrada";
	$SYS_FOC="Emp";
	$SYS_CMD="SI";
}

//+++++++++++++++++++++++++++++++++++++++
$r_i=gr("vis_ges_invoice","ID=$INV_KOD");
$INV_EMP=$r_i['EMP_NC'];
$INV_FEC=$r_i['FEC_'];
$INV_SER=$r_i['INV_SER'];
$INV_NUM=$r_i['INV_NUM'];
//+++++++++++++++++++++++++++++++++++++++
$r=gr("vis_ges_invoice_det_t","CX=$TMP_KOD");
$Cod=$r['COD'];
$Des=$r['DES'];
$Med=$r['MEDIDAS'];
$Pie=$r['PIE'];
$Caj=$r['CAJ'];
$Und=$r['UND'];
$TotPie=$r['TOT_PIE'];
$TotUni=$r['TOT_UNI'];
$TotUwi=$r['TOT_UWI'];
$Pre=$r['PRE'];
$Imp=$r['IMP'];
$DET_PRO=$r['ID_PRO'];

?>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Editar item</title>
<!--INI_SCRIPT------------------------------------------------------------------------------>
<?php AddJs(); ?>
<script type="text/javascript" src="ja/funciones.js"></script>
<script type="text/javascript" src="ja/ges_inv_prod_edit1.js"></script>
<!--FIN_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">
.mM {height:34px;width:1250px;position:relative;top:0px;background-color:#09C; z-index:500;}
.cF {height:650px;width:1250px;position:relative;top:0px}

.tableFixHead          { overflow-y: auto; overflow:auto; border:solid 1px #363636;position: absolute; }
.tableFixHead thead th { position: sticky; top: 0; }
table  {border-collapse:collapse;width:100%;}
th, td {padding: 3px 3px;}
th     {background:#CCC}
.tzt{
	background-color:transparent; width:100%; font-size:11px; position:inherit!Important; border:none;
}
</style>
<script>
$(document).ready(function(){  
   Inicializar();
   var sys_msg=gv("SYS_MSG");
   var sys_foc=gv("SYS_FOC");
   var sys_cmd=gv("SYS_CMD");
   if(jL(sys_msg)>0){
	   alert(sys_msg);
   }
   if(jL(sys_foc)>0){
	   jF(sys_foc);
   }
   if(jL(sys_cmd)=="SI"){
	 window.opener.SM();
   }
     
});
//
var UNI_TOT=<?php echo gn("count(*)","ges_unidades","id_und>0");?>;
var UNI_ABR=new Array();
var UNI_FAC=new Array();
//
<?php
$IDX=0;
$s="SELECT * FROM ges_unidades WHERE id_und>0";
$rs=grs($s);
while($r=$rs->fetch_assoc()){
	$A=$r['und_abr'];
	$F=$r['und_factor'];
	$IDX++;
?>
UNI_ABR[<?php echo $IDX;?>]="<?php echo $A;?>";
UNI_FAC[<?php echo $IDX;?>]=<?php echo $F;?>;
<?php
}
?>
</script>
</head>
<body >
<div align="center">

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

<!--INI_TITULO--------------------------------->
<div id="DivT" class="dT" style="width:1250px" >
<img src="png/descuento2.png" class="iT" />
<div class="tT">EDITAR ITEM</div>
</div>
<!--FIN_TITULO--------------------------------->

<div class="s1" style="left: 35px; top: 84px; width: 86px;" > CODIGO
</div>
<input name="Cod" type="text" id="Cod" 
class="roi" style="left: 35px; top: 101px; width: 91px" 
value='<?php echo $Cod;?>'  
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 138px; top: 84px; width: 239px;">
NOMBRE / DESCRIPCION</div>
<input name="Des" type="text" id="Des" 
class="roi" style="left: 137px; top: 101px; width: 233px" 
value='<?php echo $Des;?>'  
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 380px; top: 84px; width: 88px;">
MEASURES</div>
<input name="Med" type="text" id="Med" 
class="roi" style="left: 380px; top: 101px; width: 111px" 
value='<?php echo $Med;?>'  
tabindex="<?php echo ++$TI;?>"/>


<div class="s1" style="left: 505px; top: 84px; width: 63px;">PIEZAS</div>
<input name="Pie"  type="text" id="Pie"
class="ned" style="left:505px; top: 101px; width:65px;"
value='<?php echo $Pie;?>' onKeyUp="fImporte();"
onfocus="selecciona_value(this);"
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 577px; top: 84px; width: 63px;">CAJAS</div>
<input name="Caj"  type="text" id="Caj"
class="ned" style="left:577px; top: 101px; width: 70px;"
value='<?php echo $Caj;?>' onKeyUp="fImporte();"
onfocus="selecciona_value(this);"
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left:660px; top: 84px; width: 54px;">UNIDAD</div>
<select name="Und" id="Und"  onChange="fImporte()"
class="lt" style="left:659px; top: 101px; width: 75px" 
tabindex="<?php echo ++$TI;?>">
<?php 
	echo FCBO("und_abr","ges_unidades","id_und>0",$Und,"N","S");
?>
</select>


<div class="s1" style="left:741px; top: 69px; width: 55px;">
TOTAL PIEZAS</div>
<input name="TotPie"  type="text" id="TotPie"
class="rod" style="left:741px; top: 101px; width: 73px;"
value='<?php echo $TotPie;?>' 
tabindex="<?php echo ++$TI;?>"/>


<div class="s1" style="left:824px; top: 69px; width: 91px;">
TOTAL UNIDADES (1)</div>
<input name="TotUni"  type="text" id="TotUni"
class="rod" style="left:824px; top: 101px; width: 103px;"
value='<?php echo $TotUni;?>' 
tabindex="<?php echo ++$TI;?>"/>



<div class="s1" style="left:940px; top: 69px; width: 90px;">
TOTAL UNIDADES (2)</div>
<input name="TotUwi"  type="text" id="TotUwi"
onKeyUp="cImporte();" class="ndd" style="left:941px; top: 101px; width: 91px;"
value='<?php echo $TotUwi;?>' 
tabindex="<?php echo ++$TI;?>"/>


<div class="s1" style="left: 1040px; top: 84px; width: 53px;">PRECIO</div>
<input name="Pre"  type="text" id="Pre"
class="ndd" style="left: 1040px; top: 101px; width: 72px;" 
value='<?php echo $Pre;?>' onKeyUp="cImporte();"
onfocus="selecciona_value(this);"
tabindex="<?php echo ++$TI;?>"/>


<div class="s1" style="left: 1126px; top: 84px; width: 72px;">IMPORTE</div>
<input name="Imp"  type="text" id="Imp"
class="rod" style="left: 1122px; top: 101px; width: 96px;"
value='<?php echo $Imp;?>'/>


<input name="CmdG" type="button" id="CmdG" 
style="position:absolute; left:1033px; top:136px; width: 186px;"
value="Modificar item" onClick="fAplicar();"  
tabindex="<?php echo ++$TI;?>" />


<div class="s1" style="left: 33px; top: 182px; width: 246px;">
  <b>AGREGAR / MODIFICAR REFERENCIA</b></div>

<div class="s1" style="left: 33px; top: 222px; width: 104px;">
EMPRESA</div>
<select name="Emp" id="Emp" 
class="lt" style="left: 33px; top: 239px; width: 123px"
tabindex="<?php echo ++$TI;?>">
<?php 
echo FCBO_("emp_nom_cor","ges_empresas","id_emp>0",$Emp,"","S");
?>
</select>

<div class="s1" style="left: 169px; top: 206px; width: 75px;">
INVOICE FECHA</div>
<input name="InvFec"  type="text" id="InvFec"
class="fe tcal" style="left: 169px; top: 239px; width: 75px"
tabindex="<?php echo ++$TI;?>"
value='<?php echo $InvFec;?>'/>

<div class="s1" style="left: 255px; top: 206px; width: 68px;">
INVOICE SERIE</div>
<input name="InvSer"  type="text" id="InvSer"
class="lt" style="left: 253px; top: 239px; width: 70px"
tabindex="<?php echo ++$TI;?>"
value='<?php echo $InvSer;?>'/>

<div class="s1" style="left: 332px; top: 206px; width: 82px;">
INVOICE NUMERO</div>
<input name="InvNum"  type="text" id="InvNum"
class="lt" style="left: 331px; top: 239px; width: 78px"
tabindex="<?php echo ++$TI;?>"
value='<?php echo $InvNum;?>'/>

<div class="s1" style="left: 417px; top: 206px; width: 58px;">
INVOICE ITEM</div>
<input name="InvIte"  type="text" id="InvIte"
class="lt" style="left: 417px; top: 239px; width: 57px"
tabindex="<?php echo ++$TI;?>"
value='<?php echo $InvIte;?>'/>


<input name="CmdII" type="button" id="CmdII" 
style="position: absolute; left: 481px; top: 240px; width: 118px;"
value="<< Invoice / item" onClick="fInvItem();"  
tabindex="<?php echo ++$TI;?>" />

<div class="s1" style="left: 610px; top: 222px; width: 56px;">
DUA
</div>
<input name="Dua"  type="text" id="Dua"
class="lt" style="left: 608px; top: 239px; width: 77px"
tabindex="<?php echo ++$TI;?>"
value='<?php echo $Dua;?>'/>

<div class="s1" style="left: 697px; top: 222px; width: 71px;">
DUA ITEM
</div>
<input name="DuaIte"  type="text" id="DuaIte"
class="lt" style="left: 695px; top: 239px; width: 65px"
tabindex="<?php echo ++$TI;?>"
value='<?php echo $DuaIte;?>'/>




<div class="s1" style="left: 771px; top: 207px; width: 61px;">
PAIS ORIGEN</div>
<input name="PaiOri"  type="text" id="PaiOri"
class="lt" style="left: 771px; top: 239px; width: 64px"
tabindex="<?php echo ++$TI;?>"
value='<?php echo $PaiOri;?>'/>

<div class="s1" style="left: 843px; top: 206px; width: 99px;">
PAIS DESEMBARCO</div>
<input name="PaiDes"  type="text" id="PaiDes"
class="lt" style="left: 841px; top: 239px; width: 89px"
tabindex="<?php echo ++$TI;?>"
value='<?php echo $PaiDes;?>'/>

<div class="s1" style="left: 941px; top: 222px; width: 90px;"> PARTIDA
</div>
<input name="Par"  type="text" id="Par"
class="lt" style="left: 940px; top: 239px; width: 106px"
tabindex="<?php echo ++$TI;?>"
value='<?php echo $Par;?>'/>

<div class="s1" style="left: 1055px; top: 222px; width: 172px;">
NOMBRE COMERCIAL</div>
<input name="NomCom"  type="text" id="NomCom"
class="lt" style="left: 1055px; top: 239px; width:164px"
tabindex="<?php echo ++$TI;?>"
value='<?php echo $NomCom;?>'/>

<div class="s1" style="left: 33px; top: 267px; width: 59px;"> ESTADO
</div>
<input name="Est"  type="text" id="Est"
class="lt" style="left: 33px; top: 284px; width: 74px"
tabindex="<?php echo ++$TI;?>"
value='<?php echo $Est;?>'/>


<div class="s1" style="left: 117px; top: 267px; width: 59px;">
FOB USD
</div>
<input name="FobUsd"  type="text" id="FobUsd"
class="lt" style="left: 117px; top: 284px; width: 61px"
tabindex="<?php echo ++$TI;?>"
value='<?php echo $FobUsd;?>'/>

<div class="s1" style="left: 187px; top: 267px; width: 59px;">
FOB KG
</div>
<input name="FobKg"  type="text" id="FobKg"
class="lt" style="left: 187px; top: 284px; width: 60px"
tabindex="<?php echo ++$TI;?>"
value='<?php echo $FobKg;?>'/>

<div class="s1" style="left: 257px; top: 267px; width: 57px;">
UNIDAD
</div>

<select name="UndR" id="UndR" 
class="lt" style="left: 256px; top: 284px; width: 71px"
tabindex="<?php echo ++$TI;?>">
<?php 
echo FCBO_("und_abr","ges_unidades","id_und>0",$UndR,"N","S");
?>
</select>


<div class="s1" style="left: 334px; top: 267px; width: 80px;">
CANTIDAD
</div>
<input name="Can"  type="text" id="Can"
class="lt" style="left: 334px; top: 284px; width: 64px"
tabindex="<?php echo ++$TI;?>"
value='<?php echo $Can;?>'/>

<div class="s1" style="left: 406px; top: 267px; width: 84px;">
MODELO
</div>
<input name="Mod"  type="text" id="Mod"
class="lt" style="left: 406px; top: 284px; width: 79px"
tabindex="<?php echo ++$TI;?>"
value='<?php echo $Mod;?>'/>

<div class="s1" style="left: 496px; top: 267px; width: 117px;">
CLASE VARIEDAD
</div>
<input name="Cla"  type="text" id="Cla"
class="lt" style="left: 496px; top: 284px; width: 106px"
tabindex="<?php echo ++$TI;?>"
value='<?php echo $Cla;?>'/>




<div class="s1" style="left: 612px; top: 267px; width: 570px;">
OBSERVACION
</div>
<input name="Obs"  type="text" id="Obs"
class="lt" style="left: 612px; top: 284px; width: 607px"
tabindex="<?php echo ++$TI;?>"
value='<?php echo $Obs;?>'/>

<input name="CmdG" type="button" id="CmdG" 
style="position: absolute; left: 1033px; top: 314px; width: 186px;"
value="Agregar referencia" onClick="AddRef();"  
tabindex="<?php echo ++$TI;?>" />





<div class="tableFixHead" style="left:35px; top: 354px; width: 1182px; height: 242px; background-color:#FFF">
<table width="100%" style="font-family:Arial, Helvetica, sans-serif; font-size:11px" >
<thead>
<tr>
<th width="6%">EMPRESA</th>
<th width="6%">INV.FEC</th>
<th width="6%">INV.SERIE</th>
<th width="6%">INV.NUM</th>
<th width="4%">ITEM</th>

<th width="8%">DUA</th>
<th width="4%">ITEM</th>


<th width="7%">PAIS ORI.</th>
<th width="6%">PAIS DES.</th>
<th width="7%">PARTIDA</th>
<th width="9%">NOM.COMERCIAL</th>
<th width="6%">ESTADO</th>
<th width="5%">FobUSS</th>
<th width="5%">FobKG</th>
<th width="5%">UNIDAD</th>
<th width="5%">CANT.</th>
<th width="5%">MODELO</th>
<th width="8%">CLASE</th>

<th width="4%">LINK</th>
<th width="4%">OBSERVACION</th>
<th width="4%">IR</th>
<th width="2%">&nbsp;</th>
</tr>
</thead>
<tbody>
<?php
$PX=0;
$s="SELECT * FROM vis_ges_productos_referencias WHERE ID_PRO=$INV_PID ORDER BY INV_FEC DESC ";	
$rs=grs($s);
while($r=$rs->fetch_assoc()){	
	$PX++;
	$CSS="";
	if($PX%2==0)$CSS=' style="background-color:#D4D4D4" ';
	$TXT_URL="URL_".$r['ID_REF'];
?>
    <tr  <?php echo $CSS;?>>
    <!----------------------------------------------->
    <td><input name="" type="text" class="tzt" readonly value="<?php echo $r['NC_EMP'];?>" style="width:100px"></td>
    <td><input name="" type="text" class="tzt" readonly value="<?php echo $r['INV_FEC_'];?>" style="width:100px"></td>
    <td><input name="" type="text" class="tzt" readonly value="<?php echo $r['INV_SER'];?>" style="width:100px"></td>
    <td><input name="" type="text" class="tzt" readonly value="<?php echo $r['INV_NUM'];?>" style="width:100px"></td>
    <td><input name="" type="text" class="tzt" readonly value="<?php echo $r['INV_ITE'];?>" style="width:50px"></td>
    
    <td><input name="" type="text" class="tzt" readonly value="<?php echo $r['DUA'];?>" style="width:100px"></td>
    <td><input name="" type="text" class="tzt" readonly value="<?php echo $r['DUA_ITEM'];?>" style="width:50px"></td>
    
    <td><input name="" type="text" class="tzt" readonly value="<?php echo $r['PAI_ORI'];?>" style="width:100px"></td>
    <td><input name="" type="text" class="tzt" readonly value="<?php echo $r['PAI_DES'];?>" style="width:100px"></td>
    <td><input name="" type="text" class="tzt" readonly value="<?php echo $r['PARTIDA'];?>" style="width:100px"></td>
    <td><input name="" type="text" class="tzt" readonly value="<?php echo $r['NOM_COM'];?>" style="width:250px"></td>
    <td><input name="" type="text" class="tzt" readonly value="<?php echo $r['ESTADO'];?>" style="width:90px"></td>
    <td><input name="" type="text" class="tzt" readonly value="<?php echo $r['FOB_USS'];?>" style="width:75px"></td>
    <td><input name="" type="text" class="tzt" readonly value="<?php echo $r['FOB_KG'];?>" style="width:75px"></td>
    <td><input name="" type="text" class="tzt" readonly value="<?php echo $r['UNIDAD'];?>" style="width:90px"></td>
    <td><input name="" type="text" class="tzt" readonly value="<?php echo $r['CANTIDAD'];?>" style="width:60px"></td>
    <td><input name="" type="text" class="tzt" readonly value="<?php echo $r['MODELO'];?>" style="width:100px"></td>
    <td><input name="" type="text" class="tzt" readonly value="<?php echo $r['CLASE'];?>" style="width:100px"></td>    
    
    <td><input name="<?php echo $TXT_URL;?>" id="<?php echo $TXT_URL;?>" type="text" class="tzt" readonly value="<?php echo $r['LINK'];?>" style="width:100px"></td>    
    <td><input name="" type="text" class="tzt" readonly value="<?php echo $r['OBS'];?>" style="width:100px"></td>

    <!----------------------------------------------->
    <td align="center">
    <a href="javascript:void(0)" onClick="fIr(<?php echo $r['ID_REF'];?>);">
    <img src="png/ir.png"  border="0"/></a></td>
    <td align="center">
    <a href="javascript:void(0)" onClick="fEr(<?php echo $r['ID_REF'];?>);">
    <img src="img/eliminar.png" style="display:none"  border="0"/></a></td>
    </tr>
<?php
}
?>		  

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


<input name="CmdKlose" type="button" id="CmdKlose" 
style="position: absolute; left: 1033px; top: 606px; width: 186px;"
value="Cerrar" onClick="window.close();"  
tabindex="<?php echo ++$TI;?>" />

<input name="TXT_PID" type="hidden" id="TXT_PID" value="<?php echo $PID;?>"/>
<input name="TXT_HWN" type="hidden" id="TXT_HWN" value="<?php echo $HWN;?>"/>
<input name="TXT_CLOSE" type="hidden" id="TXT_CLOSE" value="<?php echo $SYS_CLOSE;?>"/>
<!--FIN_OCULTOS-------------------------------->

<input name="INV_KOD" type="hidden" id="INV_KOD" value="<?php echo $INV_KOD;?>"/>
<input name="INV_EMP" type="hidden" id="INV_EMP" value="<?php echo $INV_EMP;?>"/>
<input name="INV_FEC" type="hidden" id="INV_FEC" value="<?php echo $INV_FEC;?>"/>
<input name="INV_SER" type="hidden" id="INV_SER" value="<?php echo $INV_SER;?>"/>
<input name="INV_NUM" type="hidden" id="INV_NUM" value="<?php echo $INV_NUM;?>"/>
<input name="INV_ITE" type="hidden" id="INV_ITE" value="<?php echo $INV_ITE;?>"/>
<input name="INV_PID" type="hidden" id="INV_PID" value="<?php echo $INV_PID;?>"/>

<input name="TMP_KOD" type="hidden" id="TMP_KOD" value="<?php echo $TMP_KOD;?>"/>

<input name="TxtAc" type="hidden" id="TxtAc" value=""/>

<input name="SYS_MSG" type="hidden" id="SYS_MSG" value="<?php echo $SYS_MSG;?>"/>
<input name="SYS_FOC" type="hidden" id="SYS_FOC" value="<?php echo $SYS_FOC;?>"/>
<input name="REF_KOD" type="hidden" id="REF_KOD" value="<?php echo $REF_KOD;?>"/>
<input name="SYS_CMD" type="hidden" id="SYS_CMD" value="<?php echo $SYS_CMD;?>"/>

<a href="http://www.google.com" id="LNK_X" target="_new" style="display:none" >IR</a>

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