-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.php
313 lines (249 loc) · 10.7 KB
/
index.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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="apple-touch-icon" sizes="180x180" href="assets/apple-touch-icon.png" />
<link rel="icon" type="image/png" sizes="32x32" href="assets/favicon-32x32.png" />
<link rel="icon" type="image/png" sizes="16x16" href="assets/favicon-16x16.png" />
<link rel="manifest" href="assets/site.webmanifest" />
<link rel="stylesheet" href="./css/style.css" />
<link rel="stylesheet" href="./css/carte.css" />
<link rel="stylesheet" href="./css/utils.css" />
<link rel="stylesheet" href="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v4.7.2/mapbox-gl-geocoder.css" type="text/css">
<link href='https://api.mapbox.com/mapbox-gl-js/v2.3.1/mapbox-gl.css' rel='stylesheet' />
<title>WOODZIP</title>
<!-- Insert this script -->
<script type="text/javascript" src="https://static.sketchfab.com/api/sketchfab-viewer-1.10.4.js"></script>
</head>
<body>
<?php
require_once './config.php';
function queryTable($conn, $table, $fields, $where)
{
if (isset($where)) {
$sql = "SELECT * FROM $table WHERE $where";
} else {
$sql = "SELECT * FROM $table";
}
$results = $conn->query($sql);
if ($results->num_rows > 0) {
$finalResults = array();
while ($row = $results->fetch_assoc()) {
$tempArray = array();
foreach ($row as $key => $val) {
$tempArray[$key] = $val;
}
array_push($finalResults, $tempArray);
}
return $finalResults;
} else {
return false;
}
}
//Here we load the houses available in the database
$conn = mysqli_connect(DB_SERVER, DB_USERNAME, DB_PASSWORD, DB_NAME);
// Check connection
if ($conn === false) {
die("ERROR: Could not connect... "
. mysqli_connect_error());
}
$maisons = queryTable($conn, "maisons", "", null);
$options = queryTable($conn, "options", "", null);
// Close connection
mysqli_close($conn);
?>
<section class="page-3d">
<aside class="sidebar">
<div class="sidebar__upper">
<div class="content-wrapper">
<div class="logo">
<img src="./assets/logo.jpg" alt="logo" />
<a href="https://www.woodzip.com">← Retour au site</a>
<span onclick="toggleMainMenu()" class="toggle-menu-but">❯</span>
</div>
<div class="main-menu">
<div onclick="toggleConfigMenu('maisons',false,event)" class="mainmenu-item maisons">
<div class="item-title maisons">
<strong>MODELE DE MAISON</strong>
</div>
<div class="item-desc maisons">CHOISIR LA MAISON A CONFIGURER</div>
</div>
<div onclick="toggleConfigMenu('enduits',true,event)" class="mainmenu-item">
<div class="item-title">
<strong> REVETEMENT PRINCIPAL</strong>
</div>
<div class="item-desc">CHANGER LE REVETEMENT PRINCIPAL</div>
</div>
<div onclick="toggleConfigMenu('bardages',true,event)" class="mainmenu-item">
<div class="item-title">
<strong> REVETEMENT SECONDAIRE </strong>
</div>
<div class="item-desc">CHANGER LE REVETEMENT SECONDAIRE</div>
</div>
<div onclick="toggleConfigMenu('options',false,event)" class="mainmenu-item">
<div class="item-title">
<strong> OPTIONS</strong>
</div>
<div class="item-desc">AJOUTER OU ENLEVER DES OPTIONS</div>
</div>
<div onclick="toggleMap()" class="mainmenu-item">
<div class="item-title">
<strong> EMPLACEMENT</strong>
</div>
<div class="item-desc">CHOISSIR UN EMPLACEMENT SUR LA CARTE</div>
</div>
</div>
</div>
</div>
<div class="sidebar__lower">
<div class="config-item">
<a href="https://docs.google.com/document/d/1Kt8zVKYRNJh1hPW9PC-TScNGgysIHul9q4gFG3_ByY4/edit?usp=sharing" style="padding: 5px 0 10px">
<span></span>
<span>Descriptif technique</span>
</a>
<div class="tech-xtics"></div>
</div>
<div class="config-details">
<div class="detail-upper">
<a href="https://docs.google.com/document/d/1j-zQ5xa9y9XuVEQ7EjVrdSlM_edPeyvLPT6hc3p-_fs/edit?usp=sharing" style="padding: 5px 0 10px">
<span></span>
<span>Plans d'intérieur</span>
</a>
<div class="price-details"></div>
</div>
<div class="detail-lower">
<div class="cost-title">Total prix</div>
<div class="total-cost">
<div>€ <span id="total-cost">0</span>,<span>00</span></div>
<div class="tva-text"></div>
</div>
</div>
<div class="toggle-tva">
<button class="tva-button" onclick="UI.toggleTVA_UI('include',event)">
Incl. T.V.A
</button>
<button class="tva-button selected" onclick="UI.toggleTVA_UI('exclude',event)">
Excl. T.V.A
</button>
</div>
</div>
<div class="config-devis">
<button onclick="toggleSharePopup()">
<img src="./assets/share.png" alt="share icon" />
</button>
<button class="devis-but" onclick="Configurator.submitConfigData()">
DEMANDER UN DEVIS
</button>
</div>
</div>
<!---- The the sub-menu which appears when we click on an item which has a sub menu -->
<!-- <div id="sub-menu" class="drawer-sub-menu">
<div onclick="toggleSubMenu()" class="return-but">❮ Retour</div>
<div class="item-title">EXTENSIONS</div>
<div id="sub-items-list" class="sub-items-list">
</div>
</div> -->
<!---- The config menu which appears when we click on a sub-menu item -->
<div id="config-menu" class="hconfig-menu">
<div onclick="toggleConfigMenu()" style="margin-bottom: 10px" class="return-but">
❮ Retour
</div>
<div class="item-title config-menu-title"></div>
<div id="hconfig-items-list" class="hconfig-items-list"></div>
</div>
</aside>
<main class="main-content">
<nav class="top-bar">
<a href="https://www.woodzip.com">← Retour au site</a>
<a href="#"> ☰ </a>
</nav>
<div class="content-3d">
<!-- Loader div -->
<div class="barrage">
<div class="lds-dual-ring"></div>
</div>
<!-- Insert an empty iframe with attributes -->
<iframe src="" id="api-frame" allow="autoplay; fullscreen; xr-spatial-tracking" xr-spatial-tracking execution-while-out-of-viewport execution-while-not-rendered web-share allowfullscreen mozallowfullscreen="true" webkitallowfullscreen="true"></iframe>
<form class="options"></form>
</div>
</main>
<div class="placeholder-div"></div>
<div class="partager-popup">
<div class="popup-wrapper">
<div class="popup-title">
<span> Partager la configuration</span>
<span onclick="toggleSharePopup()">✕</span>
</div>
<div class="popup-social">
<a target="_blank" href="https://www.facebook.com/sharer/sharer.php?u=http%3A%2F%2F3d.woodzip.com%2F" class="share-iconbut">
<span id="configuration-share-link-facebook" class="configurator-share-popup__button">
<img src="assets/facebook.png" alt="facebook logo" />
</span>
</a>
<a target="_blank" href="http://twitter.com/intent/tweet?text=Configuration%20de%20la%maison%20Woodzip" class="share-iconbut">
<span id="configuration-share-link-twitter" class="configurator-share-popup__button">
<img src="assets/twitter.png" alt="twitter logo" />
</span>
</a>
<a target="_blank" href="https://wa.me/?text=https://3d.woodzip.com" class="share-iconbut">
<span id="configuration-share-link-whatsapp" class="configurator-share-popup__button">
<img src="assets/whatsapp.png" alt="whatsapp logo" />
</span>
</a>
<a href="mailto:?subject=Configuration%20de%20la%20maison%20Woodzip&body=https://3d.woodzip.com" class="share-iconbut">
<span id="configuration-share-link-mail" class="configurator-share-popup__button">
<img src="assets/email.png" alt="email icon" />
</span>
</a>
</div>
<div class="popup-link">
<label name="link">Lien</label>
<input id="link" type="text" readonly="readonly" value="https://3d.woodzip.com" name="link" />
</div>
<div class="popup-copy">
<button onclick="copyLink(event)">Copier le lien</button>
</div>
<div class="phonenum">
<img src="./assets/phone-call.png" alt="phone number"> <span>09 77 25 05 75</span>
</div>
</div>
</div>
</section>
<!-----------------------------MAP HERE----------------------------------------------------------------->
<section class="wz_map">
<!-- bouton pour cacher la carte -->
<a class="exit-map" href="javascript:toggleMap(false)">
➜
</a>
<!-- l'icone de chargement ici --->
<div class="barrage2">
<div class="lds-dual-ring"></div>
</div>
<div class="image-to-snap" style="width: 100%; height: 100vh;">
<div id='map' style='width: 100%; height: 100%;'></div>
</div>
<button id="save-button" style="display:none;" class="save-button">Enregistrer</button>
<input type="text" name="mapImage" id="mapImage" hidden/>
<input type="text" name="location" id="location" hidden/>
</section>
<!-----------------------------MAP END------------------------------------------------------------------>
<div class="message-toast"></div>
<!-- Initialize the viewer -->
<?php
if (isset($maisons) && isset($options)) {
$maisonEncoded = json_encode($maisons);
$optionsEncoded = json_encode($options);
echo "<script> const maisons = $maisonEncoded; const maisonOptions = $optionsEncoded;</script>";
echo '<script src="./js/configurator.js"></script>';
}
?>
<script src="./js/main.js"></script>
<script src="./js/utils.js"></script>
<script src='https://api.mapbox.com/mapbox-gl-js/v2.3.1/mapbox-gl.js'></script>
<script src="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-geocoder/v4.7.2/mapbox-gl-geocoder.min.js"></script>
<script src="./js/html2canvas.min.js">
</script>
<script type="text/javascript" src="./js/carte.js"></script>
</body>
</html>