<?
	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";
	
	//include $l_path_minus.'_all_reports.php';
	
	$can_live_alone = 1;
	include $g_path."u_headers.php";
	
	
	$l_person_id = $_SESSION['__id'];
	if(!$l_person_id){
		exit;
	}
	
	$l_sql = '';
	
	
	$l_sql = 'select id, concat(display, " (", name, ")") as name '.
		' from suppliers '.
		' where 1 = 1 '.
		' order by id ';
	
	$la_supplier = array();
	
	if($l_sql){
		$y = get_data($l_sql, 1);
		
		for($i = 0; $i < sizeof($y['id']); $i++){
			array_push($la_supplier, array('id' => $y['id'][$i], 'name' => $y['name'][$i]));
		}
	}else{
	}
	
	
	$la_data = array();
	$la_data['result'] = 1;
	$la_data['supplier'] = $la_supplier;
	
	$la_json = json_encode($la_data);
	print $la_json;
	exit;
?>
