-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathindex.php
More file actions
55 lines (51 loc) · 2.39 KB
/
index.php
File metadata and controls
55 lines (51 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
<?php
session_start();
?>
<!doctype html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html" charset="UTF-8" />
<link rel="stylesheet" href="css/leaflet.css" />
<link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
<link href='https://fonts.googleapis.com/css?family=Open+Sans' rel='stylesheet' type='text/css'>
<link href="css/style.css" rel="stylesheet" media="screen">
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/leaflet.js"></script>
<title>Geoloc Agro</title>
</head>
<body>
<?php
include('model/bdd_connect.php');?>
<div class="filtre-image">
<div class="jumbotron">
<h1 class="titre">Les entreprises de l’Agroalimentaire en</h1>
<h1 class="titre">Drôme Ardèche</h1>
<?php include('form.php');?>
</div>
</div>
<h2 class="titre-activite-affiche">Secteur d'activité : <?php if(isset($_SESSION['activite'])){ echo $_SESSION['activite'];} ?></h2>
<div id="map"></div>
<script type="text/javascript">
var map = L.map('map').setView([44.729735,5.2386539], 9);
map.scrollWheelZoom.disable();
var myIcon = L.icon({
iconUrl: 'images/marker-icon.png'
});
L.tileLayer('http://{s}.tile.openstreetmap.org/{z}/{x}/{y}.png', { attribution: 'Map data © <a href="http://www.osm.org">OpenStreetMap</a>' }).addTo(map);
var myItems = [<?php echo $_SESSION['entreprise'] ?>]
var markers = new L.featureGroup();
for (var i = 0; i < myItems.length; i++) {
var item = myItems[i];
marker = new L.marker([item[6],item[5]], {icon: myIcon}).bindPopup(
"Nom de l'entreprise : " + item[0] + "</b><br /> Activité : " + item[1] + "</b><br /> Contact : " + item[2] + "</b><br /> Téléphone : " + item[3] + "</b><br /> Nombre d'employés : " + item[4]
);
markers.addLayer(marker);
}
markers.on('mouseover', function(e){ e.layer.openPopup(); })
.on('mouseout', function(e){ e.layer.closePopup(); });
map.addLayer(markers);
map.fitBounds(markers.getBounds());
</script>
</body>
</html>