<?php

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

$q = mysqli_real_escape_string($con,trim($_GET["q"]));

if($_GET['tipBus']=='c')
	$sq_empresas=mysqli_query($con ,"SELECT * FROM dlmedicos WHERE cve_med like '$q%' order by cve_med");
elseif($_GET['tipBus']=='d')
		$sq_empresas=mysqli_query($con ,"SELECT * FROM dlmedicos WHERE CONCAT(nom_med,' ',ape_pat_med,' ',ape_mat_med) like '%$q%' order by nom_med");
while($dt_invent=mysqli_fetch_array($sq_empresas)){
	echo "$dt_invent['nom_med'] $dt_invent['ape_pat_med'] $dt_invent['ape_mat_med']|$dt_invent['cve_med']|$dt_invent['id_medico']\n";
}
?>