-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdto.flights.php
More file actions
80 lines (69 loc) · 3.01 KB
/
dto.flights.php
File metadata and controls
80 lines (69 loc) · 3.01 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
/*
Copyright 2023 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 "dbi.php" ;
if ($userId == 0) {
header("Location: https://www.spa-aviation.be/resa/mobile_login.php?cb=" . urlencode($_SERVER['PHP_SELF'] . '?' . $_SERVER['QUERY_STRING']) , TRUE, 307) ;
exit ;
}
require_once 'mobile_header5.php' ;
require_once 'dto.class.php' ;
if (! ($userIsAdmin or $userIsBoardMember or $userIsInstructor))
journalise($userId, "F", "Vous devez être administrateur ou instructeur pour voir cette page.") ;
if (isset($_REQUEST['fi']) and $_REQUEST['fi'] != '')
$fi = $_REQUEST['fi'] ;
else
$fi = $userId ;
?>
<h2>My last uncompleted flights</h2>
<p>This is the list of flights that were not modified/completed by the FI.</p>
<div class="row">
<div class="col-sm-12 col-md-9 col-lg-7">
<div class="table-responsive">
<table class="table table-striped table-hover">
<thead>
<th>Flight#</th><th>Date</th><th>Duration</th><th>Type</th><th>Plane</th><th>Student</th>
</thead>
<tbody class="table-group-divider">
<?php
$flights = new Flights() ;
$flights->getUnprocessedByFI($fi) ;
$dc_minutes = 0 ;
$solo_minutes = 0 ;
$xcountry_minutes = 0 ;
$total_minutes = 0 ;
foreach($flights as $flight) {
switch ($flight->sessionGrade) {
case 'unsatisfactory': $session_grade_message = '<i class="bi bi-hand-thumbs-down-fill text-danger" title="Unsatisfactory flight"></i>' ; break ;
case 'verygood': $session_grade_message = '<i class="bi bi-hand-thumbs-up-fill text-success" title="Very good flight"></i>' ; break ;
default: $session_grade_message = '' ;
}
print("<tr><td>#$flight->id $session_grade_message <a href=\"dto.flight.php?flight=$flight->id\">
<i class=\"bi bi-pencil-fill\" data-bs-toggle=\"tooltip\" title=\"See/edit the student flight report\"></i></a></td><td>$flight->date</td>
<td>$flight->flightDuration</td><td>$flight->flightType</td><td>$flight->plane</td><td><b>$flight->studentLastName</b> $flight->studentFirstName</td></tr>\n") ;
// Sum up the duration
switch ($flight->flightType) {
case 'DC': $dc_minutes += $flight->flightDuration ; break ;
case 'solo': $solo_minutes += $flight->flightDuration ; break ;
case 'XCountry': $xcountry_minutes += $flight->flightDuration ; break ;
}
$total_minutes += $flight->flightDuration ;
}
?>
</tbody>
</table>
</div><!-- table responsive -->
</div><!-- col -->
</div><!-- row -->
</body>
</html>