%PDF- %PDF-
Direktori : /home/alliance/domains/congress-intercultural.eu/public_html/ |
Current File : /home/alliance/domains/congress-intercultural.eu/public_html/p-carte3.php |
<?php include_once("inc/config.php"); include_once("inc/functions.php"); include_once("inc/init.php"); include_once("inc/session.php"); $db = new BaseOps; @ini_set('display_errors', 'on'); $db = new BaseOps; verif_get(8); $actu = new Actu; $sec = $section->getSection(8,$lang->getlangid()); if($sec == null) { header("Location: 404.html"); exit(0); } $facebookapi = true; $main2 = true; function lookup($string){ $string = str_replace (" ", "+", urlencode($string)); $details_url = "http://maps.googleapis.com/maps/api/geocode/json?address=".$string."&sensor=false"; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $details_url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $response = json_decode(curl_exec($ch), true); // If Status Code is ZERO_RESULTS, OVER_QUERY_LIMIT, REQUEST_DENIED or INVALID_REQUEST if ($response['status'] != 'OK') { return null; } //print_r($response); $geometry = $response['results'][0]['geometry']; $longitude = $geometry['location']['lng']; $latitude = $geometry['location']['lat']; $array = array( 'latitude' => $geometry['location']['lat'], 'longitude' => $geometry['location']['lng'], 'location_type' => $geometry['location_type'], ); return $array; } //affichage du html include("theme/html.php"); //affichage des metas include("theme/meta.php"); echo " \n<title>".lang("carte")." - ".$info_titresite."</title>\n"; ?> <meta property="og:titre" content="<?php echo $sec['titre']; ?>"/> <?php if ($sec['photo1'] != null) { ?> <meta property="og:image" content="<?php echo $url_site."uploads/".$sec['photo1'] ?>"/> <?php } else { ?> <meta property="og:image" content="<?php echo $url_site."images/noimg.jpg" ?>"/> <?php } ?> <meta property="og:type" content="non_profit"/> <meta property="fb:app_id" content="166400090179579"/> <meta property="og:url" content="<?php echo $url_site.$pagesec; ?>"/> <meta property="og:site_name" content="<?php echo $info_titresite; ?>"/> <script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=AIzaSyCNqrscFrr-2YFpDfVFZkYoQNkR87AjRwI&sensor=true&language=<?php echo $lang->getlang(); ?>"></script> <script type="text/javascript"> var strasbourg = new google.maps.LatLng(48.562451,7.738556); var marker; var centre; var map; var geocoder; var markersArray = []; var styles = [ { stylers: [ { hue: "#0E99D3" }, { saturation: 30 } ] },{ featureType: "road", elementType: "geometry.fill", stylers: [ { hue: "#000000" }, { lightness: 30 }, { saturation: -100 } ] },{ featureType: "road", elementType: "geometry.stroke", stylers: [ { hue: "#000000" }, { lightness: 0 }, { saturation: -100 } ] },{ featureType: "landscape.man_made", elementType: "geometry", stylers: [ { hue: "#f7d4a8" } ] },{ featureType: "poi.park", elementType: "geometry", stylers: [ { color: "#e2f7a8" } ] },{ featureType: "road", elementType: "labels", stylers: [ { visibility: "off" } ] } ]; $(document).ready(function() { geocoder = new google.maps.Geocoder(); var styledMap = new google.maps.StyledMapType(styles, {name: "<?=lang("titresite");?>"}); centre = new google.maps.LatLng(48.5232398,11.994461600000022);//results[0].geometry.location; //Création de la map var mapOptions = { zoom: 4, center: centre, mapTypeControlOptions: { mapTypeIds: [google.maps.MapTypeId.HYBRID, 'map_style'] } }; map = new google.maps.Map(document.getElementById('gmap3'), mapOptions); map.mapTypes.set('map_style', styledMap); map.setMapTypeId('map_style'); <? $villes=$db->select_arrays("SELECT * FROM map"); foreach($villes as $key=>$sec): if($sec['lat']==null){ $array = lookup(html_entity_decode($sec['ville']).", ".html_entity_decode($sec['pays'])); if(isset($array['latitude']) && $array['latitude']!=null){ $sec['lat']=$array['latitude']; $sec['long']=$array['longitude']; $sql="UPDATE map SET `lat`='".$sec['lat']."', `long`='".$sec['long']."' WHERE id=".$sec['id']; mysql_query($sql); } } if($sec['lat']!=""): ?> var contentString<?=$key?> = '<div class="siteNotice" id="content">'+ '<div id="siteNotice">'+ '<h1 id="firstHeading" class="firstHeading"><?=str_replace(" "," ",$sec['nom'])?></h1>'+ '</div>'+ '</div>'; var infowindow<?=$key?> = new google.maps.InfoWindow({ content: contentString<?=$key?> }); var myLatlng = new google.maps.LatLng(<?=$sec['lat']?>,<?=$sec['long']?>); // Création du marker var marker<?=$key?> = new google.maps.Marker({ map: map, animation: google.maps.Animation.DROP, position: myLatlng }); google.maps.event.addListener(marker<?=$key?>, 'click', function() { infowindow<?=$key?>.open(map,marker<?=$key?>); }); <? endif; endforeach;?> }); </script> <?php //affichage du header ?> </head> <body> <div class="page_section"> <div id="gmap3"></div> </div> </body> </html>