-
Notifications
You must be signed in to change notification settings - Fork 0
/
game.php
75 lines (70 loc) · 2.7 KB
/
game.php
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
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
<!DOCTYPE HTML>
<html lang="fr">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="preconnect" href="https://fonts.bunny.net">
<link href="https://fonts.bunny.net/css?family=alex-brush:400" rel="stylesheet" />
<link href="https://fonts.bunny.net/css?family=acme:400" rel="stylesheet" />
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css"
integrity="sha256-sA+zWATbFveLLNqWO2gtiw3HL/lh1giY/Inf1BJ0z14="
crossorigin=""/>
<link rel="stylesheet" href="game.css"/>
<title>Escape Dalida</title>
</head>
<body>
<ul id="barre">
<li class="test" id="accueil">
<a href="main.html" class="button_link"><b>Jouer</b></a>
</li>
<li class="test" id="hof">
<a href="hof.php" class="button_link"><b>Hall of Fame</b></a>
</li>
<li class="test" id="chansons">
<a href="chansons.html" class="button_link"><b>Chansons</b></a>
</li>
<li class="test" id="ressources">
<a href="https://fr.wikipedia.org/wiki/Dalida" class="button_link"><b>Ressources</b></a>
</li>
<li id="eg"><b>Escape Game</b></li>
</ul>
<?php
$objets = [];
$link = mysqli_connect('localhost', 'root', 'root', 'dalidatabase');
$results = mysqli_query($link, "SELECT * FROM object");
foreach($results as $result){
$id = $result['id'];
$lat = $result['latitude'];
$lon = $result['longitude'];
$name = $result['name'];
$ordre = $result['ordre'];
$iconUrl = $result['iconUrl'];
$largeurIcon = $result['largeurIcon'];
$longueurIcon = $result['longueurIcon'];
$minZoom = $result['minZoom'];
$textePopup = $result['textePopup'];
$affichage = $result['affichage'];
$objets[] = [$id,$name,$lon,$lat,$ordre,$iconUrl,$largeurIcon,$longueurIcon,$minZoom,$textePopup,$affichage];
}
?>
<script type="text/javascript">
var obj_array = <?php echo json_encode($objets); ?>; // create the JavaScript array
</script>
<div id="jeu">
<div id="map"></div>
<div id="inventaire">
<div id="titre_inv"><p><b>Inventaire</b></p></div>
<div id="slot1"></div>
<div id="slot2"></div>
<div id="slot3"></div>
<div id="slot4"></div>
<div id="slot5"></div>
</div>
</div>
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"
integrity="sha256-o9N1jGDZrf5tS+Ft4gbIK7mYMipq9lqpVJ91xHSyKhg="
crossorigin=""></script>
<script src="game.js"></script>
</body>
</html>