<?php

session_start();
include("DMMYSQLG.php");
include("DSA1000.php");
include("DMMYSQLG.php"); 
include("JQUERY.inc");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="es-es">

<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>

<script language="javascript">
          $(document).ready(function(){
	function formatItem(row) {
		return " (<strong>" + row[1] + "</strong>)"+row[0];
	}
	var pagRes='AUTOSUB.php';
	var idObjDes='tbus';
        
        
	
//ademas el autocomplete se va a ejecutar con la descripcion no con la clave

	$("#"+idObjDes).autocomplete({
            source:pagRes,
		minChars: 1,                 //Caracteres Minimos antes de autocompletar
		max:20,                      //maximo de resultados mostrados, se manda como limit en autosugestion
		                 //ancho del cuadro de despliegue
		 delay: 200,           //Resalta letras coincidentes
		autoFill: true,             //autocompleta en texto la posible palabra
		scroll: true,				 //si cuadro tiene barra scroll
		scrollHeight: 100,           //alto del cuadro para el scroll
		
                           select: function( event, ui ) {
                        
                     $("#"+idObjDes).val( ui.item.gdescrip);
                     //$("#"+idObjCve).val(ui.item.id);
	
         }
 //Parametros Extra a Mandar en autosugestion
	});	
	
});
</script>
</head>

 	

<body onLoad = "self.focus (); document.form1.tbus.focus ()">

<div align="left">

</div>  
<div align="center">
  <form name="form1" method="post" action="">
    <div id="width_cabe" align="center">
	<table width="450" align="center">
      <tr> <td width="431" class="titulo" >SUB - AGRUPADORES</th>  </tr>
      
      <tr> <th>BUSQUEDA</th> </tr>
    
      <tr>
        <td><input type="submit" name="Submit" value="Buscar" class="bot_WsW" />
		<img src="magnifier.png" alt="Buscar" onClick="alert('Buscar')" />
        <input name="tbus" type="text" id="tbus" onBlur="may(this)" size="50"
		<?php

			if(isset($_POST['tbus'])){ 
				echo 'value="' . $_POST['tbus'] .  '"';
			}
		?>
		/>
		</td>
      </tr>
     </table>
	</div>
   </form>
</div>
<form name="frm1" method="post" action="" >
<body>
<div align="center">
<?php
 
	$sql = mysqli_query($con ,"SELECT * FROM fsubagrupadores order by codigo");
	include("DE10000.php");
	?>
<table width="820" border='1' bordercolor="#9B0F1A" bordercolordark="#9B0F1A">
      <tr>
        <th colspan="6"> 
          <div align="center">
			<input type="button" name="bot2" value="Modificar" onClick="openpage('AL20000_MO.php','_self')" class="original"/>
           <input type="button" name="bot4" value="Imprimir " onClick="openpage('AL20000_IM.php','_self')" class="bot_WsW"/>
            <!--input type="button" name="bot42" value="Exporta Exel" onClick="cargapag('AL20000_IME.php','_self')"class="original"/-->
          </div >
   		</th></tr>
<tr>
      <th width="30"  nowrap><div align="center"><h4>SEL</h4></div></th>
        <th width="67"  nowrap><div align="center"><h4>CODIGO</h4></div></th>
		<th width="256"  nowrap><div align="center"><h4>DESCRIPCION</h4></div></th>
		<th width="126"  nowrap><h4>AGRUPADOR</h4></th>
		<th width="201"  nowrap><h4>ALMACEN</h4></th>
      <th width="100"  nowrap><h4>STATUS</h4></th>
    </tr>
	  <?php
 $vs=(isset($_POST['submit']))?$_POST['submit']:"";
           $vpt=(isset($_POST['tbus']))?$_POST['tbus']:"";
	
	echo '<input name="txt_bus" type="hidden" value="'.$vpt.'">';
	if($vs=="")
	{
		echo '<input name="tip_bus" type="hidden" value="nombre">';
		include('AL20000_CL.php');
        $varible_clase = new clase();
        $res=$varible_clase->lista_pr();
	}
       
	while($reg = mysqli_fetch_array($res))
	{
             
	  	echo "<tr>
            		<td> <div align='center'><input name='bot' type='radio' value=". $reg['nReg']." ></div></td>
		<td> <div align='center' style=' '><strong>". $reg['nReg']." </strong></div></td>
		<td> <div align='center' style=' '><strong>". $reg['subAgruPaDor']." </strong></div></td>
		<td> <div align='center' style=' '><strong>". $reg['agruPaDor']." </strong></div></td>
		<td> <div align='center' style=' '><strong>".$reg['alMaCen']." </strong></div></td>
		<td> <div align='center' style=' '><strong> ".$reg['sTaTus']." </strong></div></td>
	    </tr>";
	}
      
	mysqli_close($con);
	?>
  </table>
</div>
</body>
</form>
</html>