-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcrewfrontmod.php
402 lines (358 loc) · 18.9 KB
/
crewfrontmod.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
<!DOCTYPE html>
<?php
include_once 'con.php';
include('session.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">
<link rel="script" type="javascript" href="state.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>CREW</p>
</div>
<div class="topr right">
</div>
</div>
<div class="col-11 formcontainer" id="">
<!--crew information-->
<?php
$special = 'htmlspecialchars($_SERVER["PHP_SELF"]);';
$errorp = ''; // Variable To Store Error Message
if (isset($_POST['submit']))
{
$crewid= $_POST["view1"];
//reemplazar por funciones//
$sqlsent="SELECT * FROM crew where crew_id=$crewid;";
$result1=mysqli_query($conn, $sqlsent);
$result1check = mysqli_num_rows($result1);
if ($result1check > 0)
{
while ($row = mysqli_fetch_assoc($result1))
{
$citycode = $row['city_id'];
$sqlsent2="SELECT * FROM city where city_id=$citycode;";
$result2=mysqli_query($conn, $sqlsent2);
$result2check = mysqli_num_rows($result2);
if ($result2check > 0)
{
while ($row = mysqli_fetch_assoc($result2))
{
$cityname = $row['name'];
$municipcode = $row['municipality_id'];
$sqlsent3="SELECT * FROM municipality where municipality_id=$municipcode;";
$result3=mysqli_query($conn, $sqlsent3);
$result3check = mysqli_num_rows($result3);
if ($result3check > 0)
{
while ($row = mysqli_fetch_assoc($result3))
{
$municipname = $row['name'];
$stateid = $row['estate_id'];
$sqlsent4="SELECT * FROM estate where estate_id=$stateid;";
$result4=mysqli_query($conn, $sqlsent4);
$result4check = mysqli_num_rows($result4);
if ($result4check > 0)
{
while ($row = mysqli_fetch_assoc($result4))
{
$statename = $row['name'];
$sqlsent="SELECT * FROM crew where crew_id=$crewid;";
$result1=mysqli_query($conn, $sqlsent);
$result1check = mysqli_num_rows($result1);
if ($result1check > 0)
{
while ($row = mysqli_fetch_assoc($result1))
{
echo "<form class='incform' action='<?php echo ".$special."?>' method='post'>
<section>
<section class='row'>
<section class='col-2'><img src='../img/".$row['dni'].".jpg' alt='no encontrada' class='crewimg'>
</section>
<section class='col-10'>
<section class='row sepa'>
<section class='col-2'><label>DNI</label>
</section>
<section class='col-4'><input type='text' name='dni' value='".$row['dni']."' placeholder='Dni' class='input1' maxlength='10'>
</section>
<section class='col-2'><label>Birth Date</label></section>
<section class='col-4'><input type='date' name='birthdate' value='".$row['birthdate']."' placeholder='Birthdate' class='input1'>
</section>
</section>
<section class='row sepa'>
<section class='col-2'><label>Firstname</label>
</section>
<section class='col-4'><input type='text' name='firstname' value='".$row['first_name']."' placeholder='First Name' class='input1' maxlength='20'>
</section>
<section class='col-2'><label>Middlename</label>
</section>
<section class='col-4'><input type='text' name='secondname' value='".$row['middle_name']."' placeholder='Second Name' class='input1' maxlength='20'>
</section>
</section>
<section class='row sepa'>
<section class='col-2'><label>First Surname</label>
</section>
<section class='col-4'><input type='text' name='firstsurname' value='".$row['first_surname']."' placeholder='First Surname' class='input1' maxlength='20'>
</section>
<section class='col-2'><label>Second Surname</label>
</section>
<section class='col-4'><input type='text' name='secondsurname' value='".$row['second_surname']."' placeholder='Second Surname' class='input1' maxlength='20'>
</section>
</section>
</section>
</section>
<section class='row'>
<section class='col-2'>
</section>
<section class='col-10'>
<section class='row sepa'>
<section class='col-2'><label>Estate</label></section>
<section class='col-10'><input type='text' name='state' value='".$statename."' placeholder='State' class='input1' maxlength='20'>
</section>
</section>
</section>
</section>
<section class='row'>
<section class='col-2'>
</section>
<section class='col-10'>
<section class='row sepa'>
<section class='col-2'><label>Municipality</label></section>
<section class='col-10'><input type='text' name='municipality' value='".$municipname."' placeholder='Municipality' class='input1' maxlength='20'>
</section>
</section>
</section>
</section>
<section class='row'><p class='cent'>Address</p>
</section>
<section class='row'>
<section class='col-2'>
</section>
<section class='col-10'>
<section class='row sepa'>
<section class='col-2'><label>Address</label>
</section>
<section class='col-10'><input type='text' name='address' value='".$row['address']."' placeholder='Address' class='input1' size='80%' maxlength='100'>
</section>
</section>
</section>
</section>
<section class='row'>
<section class='col-2'>
</section>
<section class='col-10'>
<section class='row sepa'>
<section class='col-2'><label>City</label>
</section>
<section class='col-10'><input type='text' name='city' value='".$cityname."' placeholder='City' class='input1' maxlength='20'>
</section>
</section>
</section>
</section>
<section class='row'>
<section class='col-2'>
</section>
<section class='col-10'>
<section class='row sepa'>
<section class='col-2'><label>Emergency Contact</label>
</section>
<section class='col-10'><input type='text' name='emergencyc' value='".$row['emergency_cont']."' placeholder='Emergency contact' class='input1' maxlength='30'>
</section>
</section>
</section>
</section>
<section class='row'>
<section class='col-2'>
</section>
<section class='col-10'>
<section class='row sepa'>
<section class='col-2'></section>
<section class='col-10'><input type='submit' class='include' name='modify' value='Modify'>
</section>
</section>
</section>
</section>
</section></form> ";
} }}}}}}}}
}
}
?>
<span><?php echo "$errorp"; ?></span>
<!-- CREW LICENCE border -->
</div>
<div class='col-11 borsupe' id='flights'>
<div class='topr'> </div>
<div class='topr'>
<p>LICENCE</p>
</div>
<div class='topr right'>
</div>
</div>
<div class='col-11 formcontainer' id=''>
<?php
//$special = 'htmlspecialchars($_SERVER["PHP_SELF"]);';
//$errorp = ''; // Variable To Store Error Message
if (isset($_POST['submit']))
{
$crewid= $_POST["view1"];
$sqlsentl="SELECT * FROM licence where crew_id=$crewid;";
$resultl=mysqli_query($conn, $sqlsentl);
$resultlcheck = mysqli_num_rows($resultl);
if ($resultlcheck > 0)
{
while ($row = mysqli_fetch_assoc($resultl))
{
echo "<form class='incform' action='<?php echo ".$special."?>' method='post'>" ;
echo "<div>";
echo "<input type='text' name='licence' value='".$row['number']."' placeholder='Licence Number' class='input1' maxlength='10'><br><br>";
echo "<input type='text' name='expirationdate' value='".$row['expiration_date']."' placeholder='Expiration Date' class='input1' maxlength='20'><br><br>";
//echo "<input type='submit' class='include' name='modifyl' value='Modify'>";
//echo "</div></form> ";
}}
$sqlsentm = "SELECT * FROM medcheck where crew_id=$crewid;";
$resultm=mysqli_query($conn, $sqlsentm);
$resultmcheck = mysqli_num_rows($resultm);
if ($resultmcheck > 0)
{
while ($row = mysqli_fetch_assoc($resultm))
{
/*echo "<form class='incform' action='<?php echo ".$special."?>' method='post'>" ;*/
echo "<div>";
echo "<input type='text' name='medcheck number' value='".$row['number']."' placeholder='Medcheck Number' class='input1' maxlength='10'><br><br>";
echo "<input type='text' name='expirationdate' value='".$row['expiration_date']."' placeholder='Medical Expiration Date' class='input1' maxlength='20'>  ";
echo "<input type='text' name='expirationdate' value='".$row['allergies']."' placeholder='Allergies' class='input1' maxlength='20'>  ";
echo "<input type='text' name='blodtype' value='".$row['blood_type']."' placeholder='Blood Type' class='input1' maxlength='20'>  ";
echo "<input type='submit' class='include' name='modifyl' value='Modify'>";
echo "</div></form> ";
}}
}
?>
</div>
</div>
</div>
<script src="photo.js" ></script>
</body>