<?php
	session_start();
	include("cls_conexion.php");$CNN=new ClsMySQL();include("conexion23.php");
	if(strlen($_SESSION['SYS_USER_ID'])==0){JsDir("login.php");	return;}
	//-------------------------
	$StrId=V($_POST['TxtId']);
	$StrCmd=V($_POST['TxtAc']);
	$StrNom=V($_POST['TxtNom']);	
	$StrRuc=V($_POST['TxtRuc']);
	//-------------------------
	$StrNomT=$StrNom."%";
	$StrRucT=$StrRuc."%";
	//-------------------------
	$FF="ID>0 AND NOMBRE LIKE '$StrNomT' AND RUC LIKE '$StrRucT'";
	//-------------------------
	$VP_RegXPag=10;
	$LStrTR=gn("count(*)","vproveedores",$FF);
	$LStrPag=PagGet($LStrPag,$StrCmd,$LStrTR,$VP_RegXPag);	
	$TI=0;
?>

<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Proveedores - Seleccionar</title>
<!----------------------------------------->
<?php AddJs(); ?>
<script type="text/javascript" src="ja/funciones.js"></script>

<!----------------------------------------->
<link rel="stylesheet" type="text/css" href="css/estiloss.css"  />
<link rel="stylesheet" type="text/css" href="css/basic.css"  />
<!----------------------------------------->
<style type="text/css">
.cF {height:580px;width:780px;position:relative;top:0px}
</style>

<!----------------------------------------->
<script>
$(document).ready(function(){  
   Inicializar();
   jF("CboAlm");
});


</script>
<!----------------------------------------->

<body  <?php echo $LStrMsg;?>  >
<div align="center">


<div Id="DivFRM"  class="cF" style="background-color:#FFFFFF;" >
<form id="Frm" name="Frm" method="post" action="proveedores_edc_seleccionar.php">

<!----------------------------------------->
<div id="DivT" class="dT"  style="width:780px;">
<img src="b.png" class="iT" />
<div class="tT" style="width: 300px;">SELECCIONAR PROVEEDORES</div>
</div>
<!----------------------------------------->

<div class="s1" style="left: 35px; top: 123px; width: 164px;">
NOMBRE / RAZON SOCIAL</div>
<input name="TxtNom" type="text" id="TxtNom" 
class="lt" style="left: 35px; top: 141px; width: 395px" 
value="<?php echo $StrNom;?>"
tabindex="<?php echo ++$TI;?>"/>

<div class="s1" style="left: 443px; top: 123px; width: 78px;">
RUC</div>
<input name="TxtRuc" type="text" id="TxtRuc" 
class="lt" style="left: 438px; top: 141px; width: 109px"
value="<?php echo $StrRuc;?>" 
tabindex="<?php echo ++$TI;?>"/>

<!----------------------------------------->
<div id="DivBtn" align="left" style="position:absolute; left: 33px; top: 71px; width: 551px; height: 26px;">
<input name="CmdB" type="button" id="CmdB" class="btm"
value="Buscar" onClick="fFiltrar();"  
tabindex="<?php echo ++$TI;?>" />
</div>
<!-----------------------------------------> 
    
<div class="datagrid" style="position: absolute; left: 35px; top: 170px; width: 708px; height: 350px; overflow: auto">
<table width="100%">
<thead>
<tr>
<td colspan="5" align="center"><?php echo PagBtn($LStrTR,$VP_RegXPag,$LStrPag);?></td>
</tr>

<tr>
<th width="296">NOMBRE</th>
<th width="105">RUC</th>
<th width="118">TELEFONO</th>
<th width="133">CELULAR</th>
<th width="30">&nbsp;</th>
</tr>
</thead>
<tbody>

<?php		  		
	$s="SELECT ID,NOMBRE,RUC,TEL,CEL 
		FROM vproveedores  
		WHERE $FF 
		ORDER BY NOMBRE ";		

	$s=PagSql($s,$LStrPag,$VP_RegXPag,$LStrTR);
	$result = grs($s);				
	while ($r = $result->fetch_row()){		
		?>
		<tr onDblClick="        
		window.opener.document.Frm.TxtIdPro.value='<?php echo $r[0];?>';
		window.opener.document.Frm.TxtPro.value='<?php echo $r[1];?>';
		window.opener.document.Frm.CboMon.value='';
		window.opener.document.Frm.CboMon.focus();
		window.close();"> 
		<!----------------------------------------------->
		<td><?php echo $r[1];?></td>
		<td><?php echo $r[2];?></td>
		<td><?php echo $r[3];?></td>
		<td><?php echo $r[4];?></td>
		<!----------------------------------------------->
		<td ><a href="javascript:void(null)"onclick="
		window.opener.document.Frm.TxtIdPro.value='<?php echo $r[0];?>';
		window.opener.document.Frm.TxtPro.value='<?php echo $r[1];?>';
		window.opener.document.Frm.CboMon.value='';
		window.opener.document.Frm.CboMon.focus();
		window.close();"> 
		<img src="img/b_edit.png"  border="0"/></a>
		</td>        
		<?php
	}
?>
</tbody>
</table>
</div>
      
<!----------------------------------------->    
<?php include("ocultos.php");?>

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