<?
	header("Content-Type: text/html; charset=utf-8");
	
	$la_tmp = explode('/app/', $_SERVER['SCRIPT_FILENAME']);
	
	$l_path_minus = $la_tmp[0].'/app/webroot/iso/';
	$g_path = $la_tmp[0].'/app/webroot/iso/my/';
	
	include $g_path."u_globals.php";
	include $g_path."html/f.php";
	include $g_path."u_spoj_na_bazu.php";
	
	$can_live_alone = 1;
	include $g_path."u_headers.php";
	
	
	$l_person_id = $_SESSION['__id'];
	if(!$l_person_id){
		exit;
	}
	
	
	
	$l_sql = 'select concat(articles.name, " ", product_items.amount, " ",articles.unit) as name '.
		' from product_items, articles '.
		' where product_items.article_id = articles.id '.
		' and product_items.product_id = '.intval(str_replace('action-detail-', '', $_GET['id']));
		
	$y = get_data($l_sql, 1);
	
	
	$la_articles = array();
	for($i = 0; $i < sizeof($y['name']); $i++){
		array_push($la_articles, array('name' => $y['name'][$i]));
	}
	
	$la_data = array();
	$la_data['ok'] = 1;
	$la_data['data'] = $la_articles;
	
	
	
	$la_json = json_encode($la_data);
	print $la_json;
	exit;
?>
