X-Git-Url: http://git.polytechnique.org/?a=blobdiff_plain;f=include%2Fgeocoding.inc.php;h=a828366dc48aefe9feafb37d9c8e2119b70ed692;hb=03bda5524bd16c5c160a314d42baefe0b3254c62;hp=2e99434b5b5c3a84a61ff47be2cba25e3e20988b;hpb=fb813fb52d5ab65ca9a5b92b5cb9089523380d79;p=platal.git diff --git a/include/geocoding.inc.php b/include/geocoding.inc.php index 2e99434..a828366 100644 --- a/include/geocoding.inc.php +++ b/include/geocoding.inc.php @@ -1,6 +1,6 @@ numRows() == 0) { - $address[$area . 'Id'] = XDB::execute("INSERT INTO " . $databases[$area] . " (name, country) - VALUES ({?}, {?})", - $address[$area . 'Name'], $address['countryId']); + XDB::execute('INSERT INTO ' . $databases[$area] . ' (name, country) + VALUES ({?}, {?})', + $address[$area . 'Name'], $address['countryId']); + $address[$area . 'Id'] = XDB::insertId(); } else { $address[$area . 'Id'] = $res->fetchOneCell(); } @@ -414,9 +415,9 @@ class GMapsGeocoder extends Geocoder { } if ($isPseudoCountry) { - return $address['text']; + return implode("\n", array_slice($textLines, 0, -1)); } - return implode("\n", array_slice($textLines, 0, -1)); + return $address['text']; } // Search for the lign from the given address that is the closest to the geocoded thoroughfareName