function getMapImageUrl(tripInfo $tripInfo)
{
    $location = $tripInfo->getLatitude() . "," . $tripInfo->getLongitude();
    $location = rawurlencode(mb_convert_encoding($location, "UTF-8"));
    $poly = "45.504448,-73.614204";
    return "http://maps.googleapis.com/maps/api/staticmap?center={$location}&zoom=10&size=375x200&markers=color:red%7Clabel:P%7C" . $poly . "&markers=color:blue%7Clabel:S%7C" . $location . "&maptype=roadmap&sensor=false";
}
Exemple #2
0
function updateTripInfo($address, $city, $zipCode, $matricule)
{
    $database = database::instance();
    $results = $database->requete("SELECT " . tripInfo::ID_DB_FIELD . " \n\t\t\t\t\t\t\t\t  FROM st_trip INNER JOIN st_demande \n\t\t\t\t\t\t\t\t  WHERE st_demande." . demande::MATRICULE_DB_FIELD . " = '" . $matricule . "' \n\t\t\t\t\t\t\t\t  AND st_trip." . tripInfo::ID_DB_FIELD . " = st_demande." . demande::TRIP_DB_FIELD . "");
    if (mysql_num_rows($results) == 1) {
        $resultsArray = mysql_fetch_array($results);
        $tripId = $resultsArray[tripInfo::ID_DB_FIELD];
        $tripInfo = new tripInfo($address, $city, $zipCode);
        $tripInfo->computeValues();
        $tripInfo->saveToDatabase($tripId);
    }
}