Changeset View
Changeset View
Standalone View
Standalone View
branches/5.2.x/core/units/helpers/geocode_helper.php
Show First 20 Lines • Show All 78 Lines • ▼ Show 20 Line(s) | |||||
{ | { | ||||
// 1908 Pike pl, Seattle, WA | // 1908 Pike pl, Seattle, WA | ||||
// http://maps.google.com/maps/geo? | // http://maps.google.com/maps/geo? | ||||
// ABQIAAAAzNbTbxHki-PAnXzsrA7z2hR0fs2_a3JecCfKmMFhGT8VtEjV7xRV8rMK1czaEH2ZG3eiYJMuej_vnQ | // ABQIAAAAzNbTbxHki-PAnXzsrA7z2hR0fs2_a3JecCfKmMFhGT8VtEjV7xRV8rMK1czaEH2ZG3eiYJMuej_vnQ | ||||
$delay = 0; | $delay = 0; | ||||
$query_address = $address . ', ' . $city . ', ' . $state; | $query_address = $address . ', ' . $city . ', ' . $state; | ||||
/** @var kCurlHelper $curl_helper */ | |||||
$curl_helper = $this->Application->recallObject('CurlHelper'); | $curl_helper = $this->Application->recallObject('CurlHelper'); | ||||
/* @var $curl_helper kCurlHelper */ | |||||
while ( true ) { | while ( true ) { | ||||
$curl_helper->SetRequestData(array( | $curl_helper->SetRequestData(array( | ||||
'output' => 'xml', | 'output' => 'xml', | ||||
'key' => $this->Application->ConfigValue('GoogleMapsKey'), | 'key' => $this->Application->ConfigValue('GoogleMapsKey'), | ||||
'q' => $query_address | 'q' => $query_address | ||||
)); | )); | ||||
▲ Show 20 Lines • Show All 93 Lines • ▼ Show 20 Line(s) | |||||
{ | { | ||||
$zip = substr($zip, 0, 5); // use only first 5 digits | $zip = substr($zip, 0, 5); // use only first 5 digits | ||||
$sql = 'SELECT lon, lat | $sql = 'SELECT lon, lat | ||||
FROM ' . TABLE_PREFIX . 'ZipCodes | FROM ' . TABLE_PREFIX . 'ZipCodes | ||||
WHERE zipcode = ' . $this->Conn->qstr($zip); | WHERE zipcode = ' . $this->Conn->qstr($zip); | ||||
return $this->Conn->GetRow($sql); | return $this->Conn->GetRow($sql); | ||||
} | } | ||||
} | } | ||||
No newline at end of file | No newline at end of file |