-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathflightsinclude.php
529 lines (450 loc) · 21.6 KB
/
flightsinclude.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
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
<!DOCTYPE html>
<?php
include_once 'con.php';
include('session.php');
include('flightsinsert.php');
if(!isset($_SESSION['login_user'])){
header("location: index.php"); // Redirecting To Home Page
}
//las time activity on session and destroy session
if (isset($_SESSION['LAST_ACTIVITY']) && (time() - $_SESSION['LAST_ACTIVITY'] > 1440)) {
// last request was more than 30 minutes ago
session_unset(); // unset $_SESSION variable for the run-time
session_destroy(); // destroy session data in storage
//header("location: index.php");
}
$_SESSION['LAST_ACTIVITY'] = time(); // update last activity time stamp
//Regenerate session id
if (!isset($_SESSION['CREATED'])) {
$_SESSION['CREATED'] = time();
} else if (time() - $_SESSION['CREATED'] > 1440) {
// session started more than 30 minutes ago
session_regenerate_id(true); // change session ID for the current session and invalidate old session ID
$_SESSION['CREATED'] = time(); // update creation time
}
?>
<head>
<meta charset="utf-8">
<title>GPB Survey from the Sky</title>
<!--<link rel="stylesheet" type="text/css" href="bootstrap.css">-->
<link rel="stylesheet" type="text/css" href="../css/stylesuav5.css">
<link rel="stylesheet" type="text/css" href="../css/stylesuav2.css">
<link rel="stylesheet" type="text/css" href="../css/stylesheet6.css">
<link rel="icon" href="img/picture1.png" type="image/png" sizes="any">
<link rel="script" type="javascript" href="photo.js">
</head>
<body>
<!-- Primer encabezado -->
<div class="row" id="container1">
<div class="col-2 head1" id="izq">
<img src="img/gpblogo2.svg" id="logo2">
</div>
<div class="col-8 head2" id="titulo">
<h1>Survey From The Sky</h1>
</div>
<div class="col-2 head2" id="der">
<img src="img/surveylogo.svg" id="survey">
</div>
</div>
<!-- Nav bar -->
<div class="row" id="container2">
<div class="col-2" id="vacio">
</div>
<div class="col-8" id="navegador">
<ul class="men1">
<li><a href="">RAV</a>
<ul class="smen1">
<li><a href="pdf/RAV_5.pdf">Rav 5</a></li>
<li><a href="pdf/RAV_21.pdf">Rav 21</a></li>
<li><a href="pdf/RAV_39.pdf">Rav 39</a></li>
<li><a href="pdf/RAV_45.pdf">Rav 45</a></li>
<li><a href="pdf/RAV_47.pdf">Rav 47</a></li>
<li><a href="pdf/RAV_60.pdf">Rav 60</a></li>
<li><a href="pdf/RAV_67.pdf">Rav 67</a></li>
<li><a href="pdf/RAV_91.pdf">Rav 91</a></li>
<li><a href="pdf/RAV_130.pdf">Rav 130</a></li>
<li><a href="pdf/RAV_145.pdf">Rav 145</a></li>
<li><a href="pdf/RAV_273.pdf">Rav 273</a></li>
<li><a href="pdf/RAV_281.pdf">Rav 281</a></li>
</ul>
</li>
<li><a href="">Emergency Numbers</a>
<ul class="smen1">
<li><a href="pdf/RAV_5.pdf">ATC</a></li>
</ul>
</li>
</ul>
</div>
<div class="col-2" id="lgt">
<section class="row">
<section class="col-6 logt">
<p><a class="logta" href="menu1.php"><img src="img/home.svg" class="out"> Home</a></p>
</section>
<section class="col-6 logt">
<p><a class="logta" href="logout.php"><img src="img/lgt.svg" class="out"> Logout</a></p>
</section>
</section>
</div>
</div>
<!-- Cuerpo principal -->
<div class="row" id="container3">
<div class="col-2" id="menup">
<div class="row" id="ipers">
<img id="pers">
</div>
<div class="row" id="u">
<p id="user"><?php echo $login_session; ?></p>
</div>
<div class="row" id="m">
<ul class="mn2">
<li>
<a href="flights.php">Flights</a>
</li>
<li>
<a href="">Maintenance</a>
</li>
<li>
<a href="">Inventory</a>
<ul class="smen2">
<li><a href="uav.php">UAV</a></li>
<li><a href="batteries.php">Batteries</a></li>
<li><a href="motors.php">Motors</a></li>
<li><a href="servos.php">Servos</a></li>
<li><a href="payloads.php">Payloads</a></li>
<li><a href="consummables.php">Consumables</a></li>
<li><a href="equipment.php">Equipment</a></li>
<li><a href="vehicles.php">Vehicles</a></li>
<li><a href="locations.php">Locations</a></li>
</ul>
</li>
<li>
<a href="crewfront.php">Crew</a>
</li>
<li>
<a href="reports.php">Reports</a>
</li>
<li>
<a href="incidents.php">Incidents</a>
</li>
</ul>
</div>
</div>
<div class="col-10" id="form1">
<div class="col-11 borsupe" id="flights">
<div class="topr"> </div>
<div class="topr">
<p>NEW FLIGHT</p>
</div>
<div class="topr right">
</div>
</div>
<div class="col-11 formcontainer" id="">
<div class="err"><span ><?php echo "$errorp <br> $relalert <br> $releasemsg <br><br><br>"; ?></span></div>
<form class="incform" action="<?php echo htmlspecialchars($_SERVER["PHP_SELF"]);?>" method="post">
<div>
<label class="label1">Date of Flight</label>
<input type="date" name="fdate" value="" class="input1" required>
<label class="label1">Start Time</label>
<input type="text" name="start_time" value="" class="input1" maxlength="8" placeholder="HH:MM:SS" required>
<label class="label1">End Time</label>
<input type="text" name="end_time" value="" class="input1" maxlength="8" placeholder="HH:MM:SS" required>
<label class="label1">Time of Flight</label>
<input type="text" name="time_flight" value="" class="input1" maxlength="8" placeholder="HH:MM:SS" required>
<br><br><br><br>
<label class="label1">UAV</label>
<select name="uav" class="input1">
<option value"0" class="tabb"></option>
<?php
$sqlsent3="SELECT * FROM uav;";
$result3=mysqli_query($conn, $sqlsent3);
$result3check = mysqli_num_rows($result3);
if ($result3check > 0)
{
while ($row = mysqli_fetch_assoc($result3))
{
echo "<option class='tabd' value=".$row['uav_id'].">".$row['uav_serial']."</option>";
}
}
?>
</select>
<label class="label1">Battery</label>
<select name="battery" class="input1">
<option value"0" class="tabb"></option>
<?php
$sqlsent3="SELECT * FROM batteries;";
$result3=mysqli_query($conn, $sqlsent3);
$result3check = mysqli_num_rows($result3);
if ($result3check > 0)
{
while ($row = mysqli_fetch_assoc($result3))
{
echo "<option class='tabd' value=".$row['batteries_id'].">".$row['batt_serial']."</option>";
}
}
?>
</select>
<label class="label1">Payload</label>
<select name="payload" class="input1">
<option value"0" class="tabb"></option>
<?php
$sqlsent3="SELECT * FROM payloads;";
$result3=mysqli_query($conn, $sqlsent3);
$result3check = mysqli_num_rows($result3);
if ($result3check > 0)
{
while ($row = mysqli_fetch_assoc($result3))
{
echo "<option class='tabd' value=".$row['payload_id'].">".$row['pay_serial']."</option>";
}
}
?>
</select>
<label class="label1">Antenna</label>
<select name="antenna" class="input1">
<option value"0" class="tabb"></option>
<?php
$sqlsent3="SELECT * FROM antenna;";
$result3=mysqli_query($conn, $sqlsent3);
$result3check = mysqli_num_rows($result3);
if ($result3check > 0)
{
while ($row = mysqli_fetch_assoc($result3))
{
echo "<option class='tabd' value=".$row['antenna_id'].">".$row['antenna']."</option>";
}
}
?>
</select>
<br><br><br><br>
<label class="label1">Battery Usage</label>
<input type="text" name="battery_usage" value="" class="input1" maxlength="4" placeholder="Volts" required>
<label class="label1">Voltage Drop</label>
<input type="text" name="voltage_drop" value="" class="input1" maxlength="4" placeholder="Volts" required>
<br><br><br><br>
<label class="label1">Windspeed</label>
<input type="text" name="windspeed" value="" class="input1" maxlength="2" placeholder="m/s" required>
<label class="label1">Temperature</label>
<input type="text" name="flight_temperature" value="" class="input1" maxlength="3" placeholder="ºC" required>
<label class="label1">Weather Condition</label>
<select name="weather_condition" class="input1">
<option value"0" class="tabb"></option>
<?php
$sqlsent3="SELECT * FROM weather;";
$result3=mysqli_query($conn, $sqlsent3);
$result3check = mysqli_num_rows($result3);
if ($result3check > 0)
{
while ($row = mysqli_fetch_assoc($result3))
{
echo "<option class='tabd' value=".$row['wconditions_id'].">".$row['weather_name']."</option>";
}
}
?>
</select>
<br><br><br><br>
<label class="label1">Operations Area</label>
<select name="operations_area" class="input1">
<option value"0" class="tabb"></option>
<?php
$sqlsent3="SELECT * FROM operation_area;";
$result3=mysqli_query($conn, $sqlsent3);
$result3check = mysqli_num_rows($result3);
if ($result3check > 0)
{
while ($row = mysqli_fetch_assoc($result3))
{
echo "<option class='tabd' value=".$row['operation_area_id'].">".$row['operation_area_name']."</option>";
}
}
?>
</select>
<label class="label1">Operations Objective</label>
<select name="operations_objective" class="input1">
<option value"0" class="tabb"></option>
<?php
$sqlsent3="SELECT * FROM objective;";
$result3=mysqli_query($conn, $sqlsent3);
$result3check = mysqli_num_rows($result3);
if ($result3check > 0)
{
while ($row = mysqli_fetch_assoc($result3))
{
echo "<option class='tabd' value=".$row['opeobj_id'].">".$row['ope_name']."</option>";
}
}
?>
</select>
<label class="label1">Max Height Reached</label>
<input type="text" name="max_height" value="" class="input1" maxlength="4" placeholder="mts" required>
<br><br><br><br>
<label class="label1">Launching Point</label>
<select name="launchingp" class="input1">
<option value"0" class="tabb"></option>
<?php
$sqlsent3="SELECT * FROM locations;";
$result3=mysqli_query($conn, $sqlsent3);
$result3check = mysqli_num_rows($result3);
if ($result3check > 0)
{
while ($row = mysqli_fetch_assoc($result3))
{
echo "<option class='tabd' value=".$row['locations_id'].">".$row['locations_name']."</option>";
}
}
?>
</select>
<label class="label1">Landing Point</label>
<select name="landingp" class="input1">
<option value"0" class="tabb"></option>
<?php
$sqlsent3="SELECT * FROM locations;";
$result3=mysqli_query($conn, $sqlsent3);
$result3check = mysqli_num_rows($result3);
if ($result3check > 0)
{
while ($row = mysqli_fetch_assoc($result3))
{
echo "<option class='tabd' value=".$row['locations_id'].">".$row['locations_name']."</option>";
}
}
?>
</select>
<br><br><br><br>
<label class="label1">Operator</label>
<select name="operator" class="input1">
<option value"0" class="tabb"></option>
<?php
$sqlsent3="SELECT * FROM crew;";
$result3=mysqli_query($conn, $sqlsent3);
$result3check = mysqli_num_rows($result3);
if ($result3check > 0)
{
while ($row = mysqli_fetch_assoc($result3))
{
echo "<option class='tabd' value=".$row['crew_id'].">".$row['first_name']." ".$row['first_surname']."</option>";
}
}
?>
</select>
<label class="label1">Technic</label>
<select name="technic" class="input1">
<option value"0" class="tabb"></option>
<?php
$sqlsent3="SELECT * FROM crew;";
$result3=mysqli_query($conn, $sqlsent3);
$result3check = mysqli_num_rows($result3);
if ($result3check > 0)
{
while ($row = mysqli_fetch_assoc($result3))
{
echo "<option class='tabd' value=".$row['crew_id'].">".$row['first_name']." ".$row['first_surname']."</option>";
}
}
?>
</select>
<br><br><br><br>
<label class="label1">Parachute Responsible</label>
<select name="parachuter" class="input1">
<option value"0" class="tabb"></option>
<?php
$sqlsent3="SELECT * FROM crew;";
$result3=mysqli_query($conn, $sqlsent3);
$result3check = mysqli_num_rows($result3);
if ($result3check > 0)
{
while ($row = mysqli_fetch_assoc($result3))
{
echo "<option class='tabd' value=".$row['crew_id'].">".$row['first_name']." ".$row['first_surname']."</option>";
}
}
?>
</select>
<label class="label1">UAV Responsible</label>
<select name="uavresp" class="input1">
<option value"0" class="tabb"></option>
<?php
$sqlsent3="SELECT * FROM crew;";
$result3=mysqli_query($conn, $sqlsent3);
$result3check = mysqli_num_rows($result3);
if ($result3check > 0)
{
while ($row = mysqli_fetch_assoc($result3))
{
echo "<option class='tabd' value=".$row['crew_id'].">".$row['first_name']." ".$row['first_surname']."</option>";
}
}
?>
</select>
<br><br><br>
<label class="label1">Release Changed Before Flight</label>
<select name="releasech" class="input1" required>
<option value"" class="tabb"></option>
<option value"0" class="tabb">No</option>
<option value"1" class="tabb">Yes</option>
</select>
<label class="label1">Release Activated on Landing</label>
<select name="releaseact" class="input1" required>
<option value"" class="tabb"></option>
<option value"0" class="tabb">No</option>
<option value"1" class="tabb">Yes</option>
</select>
<br><br><br><br>
<label class="label1">Comments</label>
<input type="text" name="comments" value="" class="input1" maxlength="255" placeholder="Comments">
<br><br><br><br>
<p class="alert">If there are any damages infringed to the UAV or any component, please fill the damages bellow</p>
<br><br>
<label class="label1">Damage Type</label>
<select name="damaget" class="input1">
<option value"0" class="tabb"></option>
<?php
$sqlsent3="SELECT * FROM damage_type;";
$result3=mysqli_query($conn, $sqlsent3);
$result3check = mysqli_num_rows($result3);
if ($result3check > 0)
{
while ($row = mysqli_fetch_assoc($result3))
{
echo "<option class='tabd' value=".$row['damage_type_id'].">".$row['damage_name']."</option>";
}
}
?>
</select>
<br><br><br><br>
<label class="label1">Damage Description</label>
<input type="text" name="damadesc" value="" class="input1" maxlength="255" placeholder="Describe the damages">
<br><br><br><br>
<br><br>
<input type="submit" class="include" name="submit" value="Submit">
</form>
</div>
</div>
</div>
</div>
<script src="photo.js" ></script>
</body>