<?
	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 = 'select id, full_name, username '.
		' from users '.
		' where 1 = 1 '.
		' order by full_name ';
		
	$y = get_data($l_sql, 1);
	
	$la_user = array();
	for($i = 0; $i < sizeof($y['id']); $i++){
		array_push($la_user, array('id' => $y['id'][$i], 'name' => $y['full_name'][$i].' ('.$y['username'][$i].')'));
	}
	
	
	$la_data = array();
	$la_data['result'] = 1;
	$la_data['user'] = $la_user;
	
	$la_json = json_encode($la_data);
	print $la_json;
	exit;
?>
