<?
	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";
	
	
	if(!empty($_POST['data'])){
		
		$la_data = array();
		
		$la_tmp = explode('#', $_POST['data']);
		for($i = 0; $i < sizeof($la_tmp) - 1; $i++){
			$la2_tmp = explode(':', $la_tmp[$i]);
			
			$l_name = get_item('select concat(name, " (", unit, ")") as name from articles where id = '.$la2_tmp[0]);
			
			array_push($la_data, $l_name);
		}
		
	}
	
	$result = array(
		'ok' => 1,
		'data' => $la_data,
	);
	$la_json = json_encode($result);
	print $la_json;
	exit;
?>
