<?php

session_start();
$com="AS";
include("DMMYSQLG.php");
//include("DSA1000.php");
include("DMMYSQLG.php");

$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 valeryus32.pdescrip,valeryus32.n_reg,valeryus32.cod_var FROM valeryus32 WHERE valeryus32.modulo='".$_SESSION['mod_sis']."' AND   pdescrip like '$q%' order by pdescrip limit $limit");
elseif($_GET['tipBus']=='c')
		$sq_invent=mysqli_query($con ,"SELECT * FROM valeryus32 WHERE valeryus32.modulo='".$_SESSION['mod_sis']."' AND   n_reg like '$q%' OR cod_var='$q' order by n_reg limit $limit");
while($dt_invent=mysqli_fetch_array($sq_invent)){
	echo "$dt_invent['pdescrip']|$dt_invent['n_reg']\n";
}
?>