%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /home/alliance/domains/congress-intercultural.eu/public_html/
Upload File :
Create Path :
Current File : /home/alliance/domains/congress-intercultural.eu/public_html/p-carte2.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;
verif_get(8);
$actu = new Actu;
$sec = $section->getSection(8,$lang->getlangid());
if($sec == null) {
	header("Location: 404.html");
	exit(0);
}

$this_edition=$edition->getCurrentEdition("front",$lang->getlangid());

$query="SELECT c.*,cl.name FROM `country` c LEFT JOIN `country_lang` cl ON c.`id`=cl.`country` WHERE cl.lang=".$lang->getlangid()." AND c.`id`=".$sec['pays'];
$country = $db->select_array($query);

$affsec = true;
$pagesec = $lang->getlang()."/".$sec['id']."-".$sec['permalien']."/";

$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');
	
		<?
		$this_edition=$edition->getCurrentEdition("front",$lang->getlangid());
		$secs = $section->getSections($lang->getlangid(),$this_edition['id']);
		foreach($secs as $key=>$sec):
		
			
			$query="SELECT c.*,cl.name FROM `country` c LEFT JOIN `country_lang` cl ON c.`id`=cl.`country` WHERE cl.lang=".$lang->getlangid()." AND c.`id`=".$sec['pays'];
			$country = $db->select_array($query);
			if($sec['lat']==null){
				$array = lookup(utf8_encode(html_entity_decode($sec['ville'])).", ".utf8_encode(html_entity_decode($country['name'])));
				if(isset($array['latitude']) && $array['latitude']!=null){
					$sec['lat']=$array['latitude'];
					$sec['long']=$array['longitude'];
					$sql="UPDATE section 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">'+
					'</div>'+
					'<h1 id="firstHeading" class="firstHeading"><?=$sec['titre']?></h1>'+
					'<div id="bodyContent">'+
					'<p><?= str_replace(CHR(13),"",str_replace(CHR(10),"",addslashes(utf8_encode(html_entity_decode($sec['texte'])))))?></p>'+
					'</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

if($sec['elu'] == 1) {
	$queryelu = "SELECT * FROM `user` WHERE section = ".$sec['id']." ORDER BY id ASC LIMIT 1";
	$dataelu = $db->select_array($queryelu);
}


?>
</head>
<body>

<div class="page_section">

		<div id="gmap3"></div>
		
		
	
	
</div>


</body>
</html>

Zerion Mini Shell 1.0