<?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]);
?>
<HTML>
<HEAD>
<TITLE>LISTADO DE PROVEEDORES</TITLE>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<style type="text/css">
<!--
td {
	font-family:Tahoma;
	font-size:11px;
	color:#727272;
}
a {
	text-decoration: underline;
	color:#727272;
}
a.1 {
	text-decoration: none;
	color: 000000;
}
.t11 {
	font-family: Tahoma;
	font-size: 11px;
	font-style: normal;
}
body  {margin:0px;padding:0px}
.style3 {font-size: 9px}
-->
</style>
<link rel="stylesheet" type="text/css" href="css/ajax_registro.css">
<link rel="stylesheet" type="text/css" href="forms/paginate1.css">
<link rel="stylesheet" type="text/css" href="css/paginate.css" />
<script language='javascript'>
function seleccionar(codigo,nombre, pcod, pnom) {
	var ccod1 = opener.document.getElementById(pcod);
	var cnom1 = opener.document.getElementById(pnom); 
	//var form = opener.document.getElementById('form');
	//form.rcod.value = codigo;
	//form.rnom.value = nombre;
	ccod1.value = codigo;
	cnom1.value = nombre;
	window.close();
  	}
</script>
<script type="text/javascript" src="js/tablesort.js"></script>
<script type="text/javascript" src="js/paginate.js"></script>
<script type="text/javascript" src="js/popcalendar.js"> </script>
<script type="text/javascript" src="js/funciones.js"></script>
<script type="text/javascript" src="js/wz_tooltip.js"></script>
<script type="text/javascript" src="js/tip_balloon.js"></script>
<!--[if IE]>
<style type="text/css">
ul.fdtablePaginater {display:inline-block;}
ul.fdtablePaginater {display:inline;}
ul.fdtablePaginater li {float:left;}
ul.fdtablePaginater {text-align:center;}
table { border-bottom:1px solid #C1DAD7; }
</style>
<![endif]-->
<script type="text/javascript" src="stmenu.js"></script>
<meta http-equiv="msthemecompatible" content="no" />
<link href="images/logo_siscomges_32x32.png" rel="shortcut icon" type="image/x-icon" />
</HEAD>
</HEAD>
<BODY BGCOLOR=#FFFFFF LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<table cellpadding="0" cellspacing="0" border="0" style="height:100%; width:100% ">
                            <!--DWLayoutTable-->
                            <tr>
                              
<td width="750" align="center" valign="top">
<?php 
	$varPCOD = (isset($_GET["pcod"]))? $_GET["pcod"] : NULL;
	$varPNOM= (isset($_GET["pnom"]))? $_GET["pnom"] : NULL;
	$varNAM = (isset($_GET["nam"]))? $_GET["nam"] : NULL;
	$varDIRE= (isset($_GET["dire"]))? $_GET["dire"] : NULL;
	$sqlcd = "select id_cd, nombre from _sv_cd;";
	$Form ='{
			"id":"formulario", "name":"formulario", "metodo":"GET", "valida":"return validaForm(this)",
			"titulo":"BUSQUEDA DE PROVEEDORES", "tam_tabla":"400", "cla_titu":"FormTitulo",
			"tam_campo1":"100", "tam_campo2":"300",
			"cla_campo1":"FormCampo1","cla_campo2":"interior",
			"oculto":[
				 {"tipo":"hidden", "id":"pcod", "name":"pcod", "valor":"'.$varPCOD.'"},
				 {"tipo":"hidden", "id":"pnom", "name":"pnom", "valor":"'.$varPNOM.'"}
				 ],
			"contenido":[				
				 {"tipo":"text", "id":"nam", "name":"nam", "texto":"Nombre :", "ancho":"280", "valor":"'.$varNAM.'"}			 
				 ],
			"botones":[
				 {"tipo":"submit", "id":"buscar", "name":"buscar", "texto":"Buscar", "ancho":"80", "alto":"22"}
				 ]
		    }';
	echo $obj->SetForm($Form); 

	$rs_cab = array(0=>array("Tamano"=>60, "Titulo"=>"CPRO", "Negrita"=>"SI", "Alinear"=>"center"),
					1=>array("Tamano"=>500 , "Titulo"=>"NOMBRE DEL PROVEEDOR"),
					2=>array("Tamano"=>60, "Titulo"=>"RUC", "Alinear"=>"center")
				   );
	$Boton = array(0=>array(0 => array("Java"=>"seleccionar", "Boton"=>"b_table_add.png", 
										"Mensaje"=>"Haga Click para <b>Seleccioar</b> el Comodato"),
							1 => array("Campo"=>"valor","Valor"=>0),
							2 => array("Campo"=>"valor","Valor"=>1),
							3 => array("Campo"=>"ccod","Valor"=>$varPCOD, "Tipo"=>"IN"),
							4 => array("Campo"=>"cnam","Valor"=>$varPNOM, "Tipo"=>"IN")							
							)
					);	
	
	$sql = "call spQuery_Lista_Proveedor(NULL,'$varNAM',1);";
	echo $obj->SetGrid(550,$rs_cab,$sql,NULL,4,NULL,NULL, NULL, "IZQ", $Boton); 
?>
</td>
	</tr>
  </table>


<!--  PopCalendar(tag name and id must match) Tags should not be enclosed in tags other than the html body tag. -->
<iframe width=174 height=189 name="gToday:normal:agenda.js" id="gToday:normal:agenda.js" src="HelloWorld/ipopeng.htm" scrolling="no" frameborder="0" style="visibility:visible; z-index:999; position:absolute; top:-500px; left:-500px;"> </iframe>
</body>
</html>
<frameset rows="100,*" border=0 frameborder="0">
<frameset rows="100,*" border=0 frameborder="0">