<?
define('ROOT','../..');
define('AJAX',true);
ob_start('ob_gzhandler');

require_once(ROOT.'/.config.php');
require_once(LIBS_PATH.'/system/sys_start.php');
require_once(LIBS_PATH.'/system/load_libs.php');
$X->STR->post_filter();

header('Content-type: text/javascript');
header('Cache-Control: no-store, no-cache, must-revalidate');
header('Cache-Control: post-check=0, pre-check=0', false);
header('Pragma: no-cache');


$q=strip_tags(addslashes($_GET['q']));

$sql=$X->DB->query('
	SELECT
		id,
		imie,
		nazwisko,
		fv_firma
	FROM uzytkownicy
	WHERE imie LIKE "%'.$q.'%" OR nazwisko LIKE "%'.$q.'%" OR fv_firma LIKE "%'.$q.'%"
	ORDER BY nazwisko, imie, id
	LIMIT 30
');
while($dane=$X->DB->fa($sql)) {
	echo $X->STR->out($dane['nazwisko'].' '.$dane['imie']).'|'.$dane['id'].'
';
}
?>