<?php

session_start();
$com="AS";
include("DMMYSQLG.php");
$resultado=[];  
$textBus=mysqli_real_escape_string($con,$_REQUEST['term']);
	  if(trim($textBus)!=''){
              $sq_invent=mysqli_query($con ,"SELECT DISTINCT(gpo_basico),des_basico FROM dgbasicop WHERE des_basico like '$textBus%' or
                  gpo_basico like '$textBus%'  order by gpo_basico");
  }
              while(@$reg = mysqli_fetch_array($sq_invent)){
  	
                      $row["label"]="(".$reg['gpo_basico'].")".$reg['des_basico'];
                       $row["des_basico"]=$reg['des_basico'];
                      $row["id"]=$reg['gpo_basico'];
                      $row["value"]=$reg['des_basico'];
                       
              $resultado[]=$row;  
		  }
	  
          
  echo json_encode($resultado);
//$q = mysqli_real_escape_string($con,$_GET["q"]);
//$limit= mysqli_real_escape_string($con,$_GET["limit"]);
//if($_GET['tipBus']=='d')
//	$sq_invent=mysqli_query($con ,"SELECT dgbasicop.des_basico,dgbasicop.gpo_basico FROM dgbasicop WHERE des_basico like '$q%' order by des_basico limit $limit");
//elseif($_GET['tipBus']=='c')
//		$sq_invent=mysqli_query($con ,"SELECT * FROM dgbasicop WHERE gpo_basico like '$q%' OR cod_var='$q' order by gpo_basico limit $limit");
//while($dt_invent=mysqli_fetch_array($sq_invent)){
//
//        if(isset($dt_invent['des_basico'])&&isset($dt_invent['des_basico'])==''){
//            echo '$dt_invent["des_basico"]';
//        }
//        if(isset($dt_invent['gpo_basico'])&&isset($dt_invent['gpo_basico'])==''){
//        echo '$dt_invent["des_basico"]';
//        }
//}
?>
