Fichier actes/index.php
[......]
if($userlevel > 2) {
if (GEO_MODE_PUBLIC==5 or $vue=="C") // si pas localité isolée et avec carte
{
if (GEO_CENTRE_CARTE <> ""){
$georeq = "select LON,LAT from ".EA_DB."_geoloc where COMMUNE = '".sql_quote(GEO_CENTRE_CARTE)."' and STATUT in ('A','M')";
$geores = EA_sql_query($georeq);
if ($geo = EA_sql_fetch_array($geores)){
$lat=$geo['LAT'];
$lon=$geo['LON'];
}else{
$lat=0;
$lon=0;
}
}
if (GEO_ZOOM_INITIAL=="") $geo_zoom=0;
else $geo_zoom=GEO_ZOOM_INITIAL;
echo '<link rel="stylesheet" href="/leaflet/leaflet.css" />';
echo '<script src="/leaflet/leaflet.js" ></script>';
echo '<link rel="stylesheet" href="/leaflet/leaflet.fullscreen.css" />';
echo '<script src="/leaflet/Leaflet.fullscreen.min.js"></script>';
echo '<script type="text/javascript">';
echo ' var lat = '.$lat.';';
echo ' var lon = '.$lon.';';
echo ' var macarte = null;';
echo ' function initMap() {';
echo ' var iconBase = "/actes/img/pin_eye.png";';
echo " macarte = L.map('map').setView([lat, lon], ".$geo_zoom.");";
echo ' L.tileLayer("https://{s}.tile.openstreetmap.fr/osmfr/{z}/{x}/{y}.png", {';
echo ' attribution: \'données © <a href="//osm.org/copyright">OpenStreetMap</a>/ODbL - rendu <a href="//openstreetmap.fr">OSM France</a>\',';
echo ' minZoom: 1,';
echo ' maxZoom: 20';
echo ' }).addTo(macarte);';
echo ' var myIcon = L.icon({';
echo ' iconUrl: iconBase ,';
echo ' iconSize: [21, 34],';
echo ' iconAnchor: [21, 34],';
echo ' popupAnchor: [-25, -80],';
echo ' });';
$georeq = "select LON,LAT,commune,depart from ".EA_DB."_geoloc where STATUT in ('A','M')";
$geores = EA_sql_query($georeq);
while ($geo = EA_sql_fetch_array($geores)){
$texte_html="<b>".$geo['commune']." [".$geo['depart']."]</b><br /> <br />";
$lstreq = "select LIBELLE,sum(NB_TOT) as nbtot,TYPACT from ".EA_DB."_sums where commune='".$geo['commune']."' and depart='".$geo['depart']."'";
$lstres=EA_sql_query($lstreq);
while ($lst=EA_sql_fetch_array($lstres)){
$linkdiv = "";
switch ($lst['TYPACT']){
case "N":
$typel = "Naissances/Baptêmes";
$prog = "tab_naiss.php";
$sigle = "°";
break;
case "M":
$typel = "Mariages";
$prog = "tab_mari.php";
$sigle = "x";
break;
case "D":
$typel = "Décès/Sépultures";
$prog = "tab_deces.php";
$sigle = "+";
break;
case "V":
if ($lst['LIBELLE']=="")
$typel = "Divers";
else{
$typel = $lst['LIBELLE'];
$linkdiv = ';'.$lst['LIBELLE'];
}
$prog = "tab_bans.php";
$sigle = "#";
break;
}
$href = '<a href='.mkurl($root.$chemin.$prog,$geo['commune'].' ['.$geo['depart'].']'.$linkdiv).'>';
$texte_html.=$href.$lst['nbtot']." ".$lst['LIBELLE']."</a><br />";
}
echo 'var marker = L.marker(['.$geo['LAT'].','.$geo['LON'].'],{ icon: myIcon }).addTo(macarte).bindPopup("'.$texte_html.'");';
}
// pour le passage en plein écran
echo ' macarte.addControl(new L.Control.Fullscreen({';
echo ' title: {';
echo " 'false': 'Passer en plein écran',";
echo " 'true': 'Sortir du plein écran'";
echo ' }';
echo ' }));';
echo ' }';
// on charge la carte
echo 'window.onload = function(){';
echo ' initMap(); ';
echo '};';
echo '</script>';
echo '<style type="text/css">';
echo ' #map{ ';
echo ' height:400px;';
echo ' }';
echo '</style>';
} else
$JSheader = "";
}
[....]
echo '<h2>Communes et paroisses';
if (GEO_MODE_PUBLIC>=3 and GEO_MODE_PUBLIC<5)
{
echo " : ";
if ($xtyp=="")
$argtyp = "";
else
$argtyp = "&xtyp=".$xtyp;
$href = '<a href="'.$root.$chemin.'index.php';
if ($vue=="C")
echo "Carte";
else
echo '<a href="'.$root.$chemin.'index.php?vue=C'.$argtyp.'">Carte</a>';
echo " | ";
if ($vue=="T")
echo "Tableau";
else
echo '<a href="'.$root.$chemin.'index.php?vue=T'.$argtyp.'">Tableau</a>';
}
echo '</h2>';
if (GEO_MODE_PUBLIC==5 or $vue=="C") // si pas localité isolée et avec carte
{
echo '<p><b>'.$menu_actes.'</b></p>';
//--- affiche la Carte
echo '<div id="map"></div>';
echo '<style type="text/css">';
echo ' #map{ ';
echo ' height:600px;';
echo ' }';
echo '</style>';
}
[........]