';
//load Script
echo '';
echo '';
$ids = explode(",",$_REQUEST['uid']);
//get Data
$markers = array();
foreach ($ids as $id) {
$a = new Account();
$a->retrieve($id);
$addr = $a->register_address_street." ".$a->register_address_postalcode." ".$a->register_address_city." ".$a->register_address_country;
$cor = getCoordinates($addr);
$tmp = array();
$tmp['lat'] = $cor[0];
$tmp['lng'] = $cor[1];
$tmp['title'] = html_entity_decode(trim($a->name));
$tmp['info'] = ''.html_entity_decode(trim($a->name)).'
'.$a->register_address_street.'
'.$a->register_address_postalcode.'
'.$a->register_address_city.'
'.$a->register_address_country;
$markers[] = $tmp;
}
echo '';
function getCoordinates($address){
$address = str_replace(" ", "+", $address); // replace all the white space with "+" sign to match with google search pattern
$url = "http://maps.google.com/maps/api/geocode/json?sensor=false&address=$address";
$response = file_get_contents($url);
$json = json_decode($response,TRUE); //generate array object from the response from the web
return array ($json['results'][0]['geometry']['location']['lat'],$json['results'][0]['geometry']['location']['lng']);
}
?>