<?php
if(!isset($_SESSION)) session_start();
include('../clases/clase.conexion.php');
include('../funciones/variables.php');
include('../funciones/funciones.php');
$var = VarServer("MYSQLI");
$obj = new clsConexion($var[0],$var[1],$var[2],$var[3],$var[4]);
$varTitulo = "LISTADO DE UNIDADES DE MEDIDA";
?>
<HTML>
<HEAD>
<TITLE><?php echo $_SESSION["_CABR"]." - ".$param[1]?></TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<link rel="stylesheet" type="text/css" href="../css/paginate.css" />
<script type="text/javascript" src="../js/funciones.js"></script>
<script type="text/javascript" src="../stmenu.js"></script>
<script type="text/javascript">
xajax.callback.global.onRequest = function() {xajax.$('loading').style.display = 'block';}
xajax.callback.global.beforeResponseProcessing = function() {xajax.$('loading').style.display='none';}
</script>
<script language='javascript'>
function seleccionar(codigo,nombre, pcod, pnom) {
	var cod1 = opener.document.getElementById(pcod);
	var nom1 = opener.document.getElementById(pnom); 
	//var form = opener.document.getElementById('form');
	//form.rcod.value = codigo;
	//form.rnom.value = nombre;
	cod1.value = codigo;
	nom1.value = nombre;
	window.close();
  	}
</script>

<meta http-equiv="msthemecompatible" content="no" />
<link href="../images/login/logo_sisgesint_32x32.png" rel="shortcut icon" type="image/x-icon" />
</HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<script type="text/javascript" src="../js/wz_tooltip.js"></script>
<script type="text/javascript" src="../js/tip_balloon.js"></script>
<div id="loading"><div id="FondoMensaje"><img src="../images/cargando.gif" alt="loading"/></div></div>
<table cellpadding="0" cellspacing="0" border="0" style="height:100%; width:100% ">
                            <!--DWLayoutTable-->
                            <tr>
                              
<td width="750" align="center" valign="top">
<?php 
	$varTabla=array("id"=>"tabla", "name"=>"table", "tamano"=>"400", "clase"=>"FormTitulo", "titulo"=>$varTitulo,
					"formu"=>array("id"=>"form", "name"=>"form", "metodo"=>"POST"),						
					"ocult"=>array(array("tipo"=>"oculto", "id"=>"ucod", "name"=>"ucod", "valor"=>$_GET[ucod]),
								   array("tipo"=>"oculto", "id"=>"unom", "name"=>"unom", "valor"=>$_GET[unom]),
								   array("tipo"=>"oculto", "id"=>"valor", "name"=>"valor", "valor"=>$_GET[valor])
								  ),
					"conte"=>array(array("titulo"=>"Codigo :", "clase1"=>"FormCampo1", "clase2"=>"interior", "tamano"=>"75",
										 "campo" =>array("tipo"=>"texto", "id"=>"cod", "name"=>"cod", "valor"=>$_POST["cod"], "ancho"=>"100")),
								   array("titulo"=>"Nombre :", "clase1"=>"FormCampo1", "clase2"=>"interior", "tamano"=>"75",
										 "campo" =>array("tipo"=>"texto", "id"=>"nom", "name"=>"nom", "valor"=>$_POST["nom"], "ancho"=>"306"))							   
								   ),
					"boton"=>array(array("tipo"=>"submit", "id"=>"bcon", "name"=>"bcon", "ancho"=>"80", "alto"=>"22", "texto"=>"Buscar")
								   )
					);
	echo $obj->setTablaForm($varTabla);
	


	$rs_cab = array(array("Tamano"=>60, "Titulo"=>"CPRO", "Negrita"=>"SI", "Alinear"=>"center"),
					array("Tamano"=>500,"Titulo"=>"NOMBRE LISTA PRECIOS"),
					array("Tamano"=>500, "Oculto"=>"SI"),
					array("Tamano"=>500, "Oculto"=>"SI"),
					array("Tamano"=>500, "Oculto"=>"SI"),
					array("Tamano"=>500, "Oculto"=>"SI"),
					array("Tamano"=>500, "Oculto"=>"SI"),
					array("Tamano"=>500, "Oculto"=>"SI")
				   );
	$Boton = array(0=>array(0 => array("Java"=>"seleccionar", "Boton"=>"b_table_add.png", 
										"Mensaje"=>"Haga Click para <b>Seleccioar</b> el Registro"),
							1 => array("Campo"=>"valor","Valor"=>0),
							2 => array("Campo"=>"valor","Valor"=>1),
							3 => array("Campo"=>"cod","Valor"=>$_GET["ucod"], "Tipo"=>"IN"),
							4 => array("Campo"=>"nom","Valor"=>$_GET["unom"], "Tipo"=>"IN")							
							)
					);	
	
	$sql = "call spQuery_Lista_Unidad_Medida_Factor('$_POST[cod]','$_POST[nom]','$_GET[valor]');";
	echo $obj->SetGrid(550,$rs_cab,$sql,NULL,4,NULL,NULL, NULL, "IZQ", $Boton); 
?>
</td>
</tr>
</table>
</body>
</html>
<frameset rows="100,*" border=0 frameborder="0">
<frameset rows="100,*" border=0 frameborder="0">