-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflight_pilot_assign.php
More file actions
58 lines (50 loc) · 2.29 KB
/
flight_pilot_assign.php
File metadata and controls
58 lines (50 loc) · 2.29 KB
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
<?php
/*
Copyright 2014-2019 Eric Vyncke
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
require_once 'flight_header.php' ;
?>
<script src="data/pilots.js"></script>
<div class="page-header hidden-xs">
<h3>Assignation des pilotes ces 90 derniers jours</h3>
</div><!-- page header -->
<table class="table table-striped table-responsive col-md-6 col-xs-12">
<thead>
<tr><th>Assigné le</th><th>Date vol (LT)</th><th>Pilote</th><th>Type</th><th>Client</th><th>Date demande</th></tr>
</thead>
<tbody>
<?php
// TODO partial list only and only the most recent
$result = mysqli_query($mysqli_link, "SELECT *
FROM $table_flight JOIN $table_pax_role ON pr_flight = f_id AND pr_role='C' JOIN $table_pax AS x ON pr_pax = x.p_id
LEFT JOIN $table_flights_pilots AS p ON f_pilot = p.p_id JOIN $table_person ON p.p_id = jom_id
LEFT JOIN $table_bookings AS b ON f_booking = b.r_id
ORDER BY f_date_assigned DESC")
or die("Impossible de lister les assignations: " . mysqli_error($mysqli_link));
while ($row = mysqli_fetch_array($result)) {
if ($row['f_date_flown'])
$date_vol = "<abbr title=\"Actual Time of Departure\">ATD</abbr> $row[f_date_flown] ($row[r_plane])" ;
else if ($row['r_start'])
$date_vol = "<abbr title=\"Estimated Time of Departure\">ETD</abbr> $row[r_start] ($row[r_plane])" ;
else
$date_vol = "à déterminer" ;
$edit = " <a href=\"flight_create.php?flight_id=$row[f_id]\"><span class=\"glyphicon glyphicon-pencil\"></span></a> " ;
print("<tr><td>$edit$row[f_date_assigned]</td><td>$date_vol</td><td><b>" . db2web($row['last_name']) . '</b> ' . db2web($row['first_name']) .
"</td><td>$row[f_type]</td><td>" . db2web($row['p_fname']) . " <b>" . db2web($row['p_lname']) . "</b></td>
<td>$row[f_date_created]</td></tr></form>\n") ;
}
?>
</tbody>
</table>
<?php
require_once 'flight_trailer.php' ;
?>