<?
	header("Content-Type: text/html; charset=utf-8");
	
	$g_path = '../../my/';
	
	include $g_path."u_globals.php";
	include $g_path."html/f.php";
	include $g_path."u_spoj_na_bazu.php";
	
	include $g_path."u_headers.php";
	
	
	
	$result = array();
	
	$y = get_data('select id as rbr, name as ime, barcode, price_sell, amount, unit from articles order by name ', 1);
	
	$la_tmp = array();
	for($i = 0; $i < sizeof($y['rbr']); $i++){
		$la_tmp['rbr'] = $y['rbr'][$i];
		$la_tmp['ime'] = $y['ime'][$i].' '.$y['barcode'][$i].' ('.lova($y['price_sell'][$i]).' Kn)'.' [Stanje: '.lova($y['amount'][$i]).' '.$y['unit'][$i].']';
		$result []= $la_tmp;
	}
	
	
	$la_json = json_encode($result);
	print $la_json;
	exit;
?>
