-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.php
355 lines (322 loc) · 19.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
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
<!-- Main File
Creates the tabs, filters etc. using bootstraps components
Uses Bootstrap 4 , jQuery 3.5.0, jquery UI, AwesomFont (for the edit icon) and Zerba Browser Print JS Library
-->
<!DOCTYPE html>
<html>
<head>
<title>Inventory Management</title>
<link rel="stylesheet" href="/css/bootstrap.css">
<link rel="stylesheet" href="/css/style.css">
<link rel="stylesheet" href="/css/loading.scss">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css">
<link rel="stylesheet" href="/css/jquery-ui.min.css">
<script src="/js/jquery-3.5.0.min.js"></script>
<script src="/js/bootstrap.js"></script>
<script src="/js/main.js"></script>
<script src="/js/printer.js"></script>
<script src="/js/filters.js"></script>
<script src="/js/export.js"></script>
<script src="/js/forms.js"></script>
<script src="/js/modals.js"></script>
<script type="text/javascript" src="js/jquery-ui.min.js"></script>
<script type="text/javascript" src="js/BrowserPrint-3.0.216.min.js"></script>
<?php include("add-entry-form.php");
include("fetch-actifs.php");
include("affect-ops-elements.php");
include("fetch-ops.php"); ?>
<meta http-equiv="Content-type" content="text/html; charset=utf-8" />
</head>
<body onload="countEntries(); loadpage();" class="sb-nav-fixed">
<!-- ------------------------------------------------------------- Page de chargement --------------------------------------------------------- -->
<div id="loading-full-size">
<div class="container" id="centerLoading">
<div class="dot-container">
<div class="dot"></div>
<div class="dot"></div>
<div class="dot"></div>
</div>
<div class="dot-container">
<div class="dot"></div>
<div class="dot"></div>
<div class="dot"></div>
</div>
<div class="dot-container">
<div class="dot"></div>
<div class="dot"></div>
<div class="dot"></div>
</div>
</div>
</div>
<!-- ------------------------------------------------------------------- NavBar --------------------------------------------------------- -->
<nav class="navbar navbar-dark bg-dark mb-5">
<div class="col-auto mr-auto">
<img src="/assets/img/logo.webp" style="width:200px; height:48px;">
</div>
<div class="col-auto text-white"><span class="pull-right">
<h1 style="margin-bottom:0px;">Inventaire</h2>
</span></div>
</nav>
<!-- ------------------------------------------------------------- Contenu principal --------------------------------------------------------- -->
<div class="container-fluid">
<!------------------------------------------ Tabs Selectors ------------------------------ -->
<div class="row">
<div class="col-9">
<div class="d-flex">
<ul class="w-100 nav nav-tabs custom_pills nav-pills" id="pills-tab" role="tablist">
<li class="nav-item">
<a class="nav-link active nav-link-color" id="drone-tab" data-toggle="tab" href="#drone" role="tab" aria-selected="true" aria-controls="drone" onclick="clearFilters();">Drones</a>
</li>
<li class="nav-item">
<a class="nav-link nav-link-color" id="equipement-tab" data-toggle="tab" href="#equipement" role="tab" aria-selected="false" aria-controls="equipement" onclick="clearFilters();">Equipement</a>
</li>
<li class="ml-auto navOp nav-item align-self-end">
<a class="nav-link nav-link-colorOp" id="operations-tab" data-toggle="tab" href="#operations" role="tab" aria-selected="false" aria-controls="operations" onclick="clearFilters();">Operations</a>
</li>
</ul>
</div>
</div>
</div>
<!-- ------------------------------------- Tabs and filters ----------------------------- -->
<div class="row justify-content-around">
<!-- TABS -->
<div class="col-9">
<div class="table-responsive tab-content mb-5">
<div class="tab-pane fade show active" id="drone" role="tabpanel" aria-labelledby="drone-tab"><?php createTab("drones"); ?></div>
<div class="tab-pane fade" id="equipement" role="tabpanel" aria-labelledby="equipement-tab"><?php createTab("equip"); ?></div>
<div class="tab-pane fade" id="operations" role="tabpanel" aria-labelledby="operations-tab"><?php createOpsTab(); ?></div>
</div>
</div>
<!-- FILTERS -->
<div class="col-3">
<div class="container-fluid">
<div class="row">
<div class="btn-group">
<button type="button" class="p-2 btn btn-outline-secondary btn-control col-md-3" data-toggle="modal" data-target="#addEntryModal">Ajouter un actif</button>
<button type="button" class="p-2 btn btn-outline-secondary btn-control col-md-3" data-toggle="modal" data-target="#printModal">Imprimer l'étiquette</button>
<button type="button" class="p-2 btn btn-outline-secondary btn-control col-md-3" data-toggle="modal" data-target="#delEntryModal">Supprimer des actifs</button>
<button type="button" class="p-2 btn btn-outline-secondary btn-control col-md-3" onclick="exportXLS();">Exporter en XLS</button>
</div>
</div>
<div class="row">
<div class=" btn-group">
<button type="button" class="p-2 btn btn-outline-warning btn-control col-md-4" data-toggle="modal" data-target="#addOperationModal">Affecter à une opération</button>
<button type="button" class="p-2 btn btn-outline-danger btn-control col-md-4" data-toggle="modal" data-target="#addOperationModal" data-ops="MAINTENANCE">Passer en Maintenance</button>
<button type="button" class="p-2 btn btn-outline-success btn-control col-md-4" data-toggle="modal" data-target="#addOperationModal" data-ops="STOCK">Remettre en stock</button>
</div>
</div>
</div>
<div class="card">
<div class="card-header">
<div class="row justify-content-around">
<h5>Filtres</h5>
<div class="btn-group">
<button type="button" class="btn btn-dark" id="add-filter" onclick="addField();">Ajouter un filtre</button>
<button type="button" class="btn btn-dark" onclick="addField('maintenance'); updateFilters();">M</button>
<button type="button" class="btn btn-dark" onclick="addField('stock'); updateFilters();">S</button>
<button type="button" class="btn btn-info" id="clear-filter" onclick="clearFilters();">Reset</button>
</div>
</div>
</div>
<div class="card-body">
<div id="entryNb"></div>
<div id="form-cont"></div>
</div>
</div>
</div>
</div>
<!-- ---------------------------------- MODALS ---------------------------------- -->
<div class="row justify-content-around">
<!-- EDIT DRONE MODAL -->
<div class="modal fade" id="editEntryModal" tabindex="-1" role="dialog" aria-labelledby="editEntryModal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="editEntryModal">Editer un actif</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<!-- MODAL BODY -->
<div class="modal-body">
<div class="form-group card">
<div class="card-body">
<div class="row justify-content-center" id="editLoadingSpinner">
<div class="container">
<div class="dot-container">
<div class="dot"></div>
<div class="dot"></div>
<div class="dot"></div>
</div>
<div class="dot-container">
<div class="dot"></div>
<div class="dot"></div>
<div class="dot"></div>
</div>
<div class="dot-container">
<div class="dot"></div>
<div class="dot"></div>
<div class="dot"></div>
</div>
</div>
</div>
<form id="editEntryForm" onsubmit="return false;">
</form>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Fermer</button>
<button type="button" class="btn btn-primary" data-dismiss="" onclick="validateForm(document.forms['editEntryForm'])">Editer</button>
</div>
</div>
</div>
</div>
<!-- PRINT MODAL -->
<div class="modal fade" id="printModal" tabindex="-1" role="dialog" aria-labelledby="printModal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="printModal">Imprimer une étiquette</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body">
<!-- CREATE PDF MODAL BODY -->
<div class='col mb-3'>
<label for="labelTypeSelector">Type d'étiquette : </label>
<select class="form-control" id="labelTypeSelector" onchange="changeLabelTypeImg();">
<option value="zephyr">Drone Zephyr</option>
<option value="helios">Drone Helios</option>
<option value="materiel">Materiel</option>
<option value="bureautique">Bureautique</option>
</select>
</div>
<div class='col'>
<img src='assets/img/drone_zephyr.png' id="labelTypeImg">
</div>
<div class='col'>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Fermer</button>
<button type="button" class="btn btn-primary" onclick="printLabel();" data-dismiss="modal">Imprimer</button>
</div>
</div>
</div>
</div>
<!-- ADD ENTRY MODAL -->
<div class="modal fade" id="addEntryModal" tabindex="-1" role="dialog" aria-labelledby="addEntryModal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addEntryModal">Ajouter un actif</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<!-- MODAL BODY -->
<div class="modal-body">
<!-- FORM SELECTOR -->
<div class="form-group">
<label for="entryType">Type d'actif : </label>
<select class="form-control" id="entryType" onchange="selectForm();"> <!-- Trigger la fonction selectForm() qui change la visibilité des formulaire selon le type d'actif choisi -->
<option value="drone">
Drone
</option>
<option value="equipement">
Equipement
</option>
</select>
</div>
<!-- FORM DRONE -->
<div class="form-group card">
<div class="card-body">
<form id="droneForm" onsubmit="return validateForm(this, 'drone');">
<?php createEntryForm("drones"); ?> <!-- Trigger le fichier add-entry-form.php-->
<input type="submit" class="btn btn-primary" value="Ajouter">
<input type="submit" class="btn btn-primary" value="Ajouter et Imprimer" onclick="printFromAdd('drone');">
</form>
<!-- FORM EQUIPEMENT -->
<form id="equipementForm" class="hide" onsubmit="return validateForm(this, 'equipement');">
<?php createEntryForm("equip"); ?>
<input type="submit" class="btn btn-primary" value="Ajouter">
<input type="submit" class="btn btn-primary" value="Ajouter et Imprimer" onclick="printFromAdd('equipement');">
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<!-- ADD OPS MODAL -->
<div class="modal fade" id="addOperationModal" tabindex="-1" role="dialog" aria-labelledby="addOperationModal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="addOperationModal">Affecter à une Opération</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<!-- MODAL BODY -->
<div class="modal-body">
<div class="form-group">
<label for="operationName">Nom de l'opération : </label>
<input class="form-control autocomplete" type="text" id="operationName">
<div class="input-group mt-3 mb-3">
<input id="serialInput" type="text" onkeydown="onKeyDownInput('ops');" class="form-control" placeholder="Serial" aria-label="Serial" aria-describedby="basic-addon2">
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="button" onclick="addEntryOpsList();">+</button>
</div>
</div>
<div>
<ul class="list-group" id="actList">
</ul>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" onclick="clearEntryList();">Fermer</button>
<button type="button" class="btn btn-primary" data-dismiss="modal" onclick="addOpsButton();">Affecter à l'Opération</button>
</div>
</div>
</div>
</div>
<!-- DEL ENTRY MODAL -->
<div class="modal fade" id="delEntryModal" tabindex="-1" role="dialog" aria-labelledby="delEntryModal" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title" id="delEntryModal">Supprimer des actifs</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<!-- MODAL BODY -->
<div class="modal-body">
<div class="input-group mt-3 mb-3">
<input id="serialInput2" type="text" onkeydown="onKeyDownInput('del');" class="form-control" placeholder="Serial" aria-label="Serial" aria-describedby="basic-addon2">
<div class="input-group-append">
<button class="btn btn-outline-secondary" type="button" onclick="addEntryDelList();">+</button>
</div>
</div>
<div>
<ul class="list-group" id="delList">
</ul>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal" onclick="clearEntryList();">Fermer</button>
<button type="button" class="btn btn-danger" data-dismiss="modal" onclick="delEntries();">Supprimer les actifs</button>
</div>
</div>
</div>
</div>
</div>
</body>
<footer>
<div style="height: 50px;"></div>
</footer>
</html>