array(
"header" => "User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36"
)
)
);
$url = 'http://nominatim.openstreetmap.org/search?q='. urlencode($_POST['city']) . '&format=json';
$citiesJson = file_get_contents($url, false, $streamContext);
$cities = json_decode($citiesJson);
$_SESSION['lat'] = $cities[0]->lat;
$_SESSION['lon'] = $cities[0]->lon;
$_SESSION['city'] = htmlspecialchars($_POST['city']);
}
include('header.php');
echo '
Événements à venir près de '. $_SESSION['city'] . '
';
echo 'Pas d\'événement prévu en ce moment.
';
echo 'Contacter d\'autres junistes près de '. $_SESSION['city'] . '
';
echo '
Groupe de discussion par mail du groupe de '. $_SESSION['city']. '
';
$users = $cesiumPlus->getNearbyUsers($_SESSION['lat'], $_SESSION['lon'], RADIUS);
echo 'Nouveaux utilisateurs à '. RADIUS . ' autour de '. $_SESSION['city'] .'
';
echo '';
foreach ($users as $user) {
$date = new DateTime();
$date->setTimestamp($user->_source->time);
echo '
'. $date->format('j') . ' ' . moisFr($date->format('n')) . ' ' . $date->format('Y') . ' |
' . $user->_source->title . '
|
';
}
echo '
';
$offers = $gchange->getNearbyOffers($_SESSION['lat'], $_SESSION['lon'], RADIUS);
echo 'Annonces à '. RADIUS . ' autour de '. $_SESSION['city'] .'
';
echo '';
foreach ($offers as $offer) {
$description = isset($offer->_source->description) ? ' title="'. substr($offer->_source->description, 0, 30) . '"' : '';
echo '
-
' . $offer->_source->title . '
('. $offer->_source->city . ')
';
}
echo '
';
$offers = $gchange->getShippable();
echo 'Envoi possible
';
echo '';
foreach ($offers as $offer) {
$description = isset($offer->_source->description) ? ' title="'. substr($offer->_source->description, 0, 30) . '"' : '';
echo '
-
' . $offer->_source->title . '
';
}
echo '
';
$offers = $gchange->getImmaterialOffers();
echo 'Annonces d\'ordre "immatériel"
';
echo '';
foreach ($offers as $offer) {
$description = isset($offer->_source->description) ? ' title="'. substr($offer->_source->description, 0, 30) . '"' : '';
echo '
-
' . $offer->_source->title . '
';
}
echo '
';
include('footer.php');