dispatch.php
8.7 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
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
<?php
session_start();
require_once 'classes/realops.php';
$get = new Get();
$stats = new Stats();
$flight = $get->extendedBooking($_GET['booking']);
$dispatch = new Dispatch();
date_default_timezone_set('Australia/Sydney');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<?php include 'sections/header.php'; ?>
</head>
<body>
<div class="wrapper">
<?php include 'sections/navbar.php' ?>
<div class="container" id="realops-container">
<div class="row">
<article class="col-sm-12 panel panel-default" id="realops-body">
<h2 class="sub-header"><?php echo $flight['airline'] . $flight['flightnum'] ?> Flight Dispatch</h2>
<div class="alert alert-info" role="alert">
<strong>Some routes not available for international flights.</strong> We apologise for any inconvenience. Real world flown routes into Sydney <a href="http://flightaware.com/statistics/ifr-route/" target="_blank">can be found here</a>.
</div>
<div class="alert alert-info" role="alert">
<strong>Some load data may be missing.</strong> Please double check your loadsheet. If it appears incomplete, please use an alternate fuel planning service as aicraft data is limited.
</div>
<div class="row">
<div class="well" style="min-height:190px">
<div class="col-md-6">
<img src="logos/<?php echo $flight['airline'] ?>.png" /> <br />
<span style="font-size:24px;"><?php echo $flight['airline']; // echo $get->airline($flight['airline']) ?> flight <?php echo $flight['flightnum']; ?></span><br />
<strong style="font-size:22px;">Slot Time: <?php echo $flight['time'] ?> Local</strong><br />
<span style="font-size:17px;">
<?php if($flight['deparr'] == 0) echo "Sydney - " . $get->airport($flight['icao'])['name']; else echo $get->airport($flight['icao'])['name'] . "-Sydney"; ?><br />
<?php if($flight['deparr'] == 0) echo "YSSY-" . $flight['icao']; else echo $flight['icao'] . "-YSSY"; ?>
</span>
</div>
<div class="col-md-6">
Recorded Block Out: <?php if(empty($flight['blockOut']))
echo "----Z";
else echo $flight['blockOut'] . "Z"; ?><br />
Recorded Block Off:
<?php if(empty($flight['blockOff']))
echo "----Z";
else echo $flight['blockOff'] . "Z"; ?><br />
Recorded Block On:
<?php if(empty($flight['blockOn']))
echo "----Z";
else echo $flight['blockOn'] . "Z"; ?><br />
Recorded Block In:
<?php if(empty($flight['blockIn']))
echo "----Z";
else echo $flight['blockIn'] . "Z"; ?>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="well">
<h4>ATS Plan:</h4>
<div class="well-sm" style="background-color:white; border:1px solid grey; font-family:Courier New;">
<?php
if($flight['deparr'] == 0)
{
$depairport = "YSSY";
$arrairport = $flight['icao'];
}
else
{
$depairport = $flight['icao'];
$arrairport = "YSSY";
}
$route = $dispatch->getRoute($flight['aircraft'], $depairport, $arrairport);
$remarks = $dispatch->getRemarks($flight['airline'], $flight['va']['name'], $_GET['registration'], $flight['aircraft'], $_GET['selcal']);
echo "(FPL-" . $flight['airline'] . $flight['flightnum'] . "-IS <br />
-" . $flight['aircraft'] . "/" . $dispatch->getWeightCategory($flight['aircraft']) . "-SDE3FGHIRWYZ/LB1 <br />
-" . $depairport . date('Hi', strtotime($flight['time']) - 60 * 60 * 10) . " <br />
-" . $route . " <br />
-" . $arrairport . "0" . $flight['flightTime'] . " <br />
-" . $remarks . ") ";
?>
</div>
</div>
</div>
<div class="col-md-6">
<div class="well">
<h4>Fuel Data:</h4>
<div class="well-sm" style="background-color:white; border:1px solid grey; font-family:Courier New;">
<?php
$load = $get->load($flight['aircraft'], $depairport, $arrairport); ?>
<?php echo $flight['airline'] . $flight['flightnum'] . " " ."LOADSHEET (PREPARED FOR " . strtoupper($_SESSION['firstName']) . " " . strtoupper($_SESSION['lastName']) . ")"; ?>
<br />ALL WEIGHTS IN KILOGRAMS (KG)
<br />
AS CALCULATED FOR: <?php echo strtoupper($load->aircraft); ?><br /><br />
-----------------------<br />
<table style="width:100%;">
<thead>
<tr>
<th></th>
<th>WEIGHT</th>
<th>ENDURANCE</th>
</tr>
</thead>
<tr>
<td> </td>
</tr>
<tr>
<td>FLIGHT FUEL:</td>
<td><?php echo $load->estimatedFuelUsage; ?></td>
<td><?php echo str_replace(".", ":", $load->flightFuel); ?></td>
</tr>
<tr>
<td>RESERVE FUEL:</td>
<td><?php echo $load->reserveFuel; ?></td>
<td><?php echo $load->reserveTime; ?></td>
</tr>
<tr>
<td>RELEASE FUEL:</td>
<td><?php echo $load->takeOffFuel; ?></td>
<td><?php echo $load->totalEndurance; ?></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td>OPERATING EMPTY WEIGHT:</td>
<td><?php echo $load->operatingEmptyWeight; ?></td>
</tr>
<tr>
<td>ZERO FUEL WEIGHT:</td>
<td><?php echo $load->zeroFuelWeight; ?></td>
</tr>
<tr>
<td>TAKEOFF WEIGHT:</td>
<td><?php echo $load->takeOffWeight; ?></td>
</tr>
<tr>
<td>LANDING WEIGHT:</td>
<td><?php echo $load->landingWeight; ?></td>
</tr>
</table>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-6">
<div class="well">
<h4>Weather Data:</h4>
<strong>Sydney (YSSY) Metar:</strong>
<div class="well-sm" style="background-color:white; border:1px solid grey; font-family:Courier New;">
<?php echo $get->metar("YSSY"); ?>
</div>
<strong><?php echo $get->airport($flight['icao'])['name']; ?> (<?php echo $flight['icao'] ?>) Metar:</strong>
<div class="well-sm" style="background-color:white; border:1px solid grey; font-family:Courier New;">
<?php echo $get->metar($flight['icao']); ?>
</div>
</div>
</div>
<div class="col-md-6">
<div class="well">
<h4>Dispatch Options:</h4><br />
<?php $flight['time'] = date('Hi', strtotime($flight['time'])- 60 * 60 * 10); ?>
<a class="btn-primary btn-lg" target="_blank" href="http://www.vatsim.net/fp/index.php?2=<?php echo $flight['airline'] . $flight['flightnum']; ?>&3=<?php echo $flight['aircraft']; ?>/L&5=<?php echo $depairport ?>&6=<?php echo $flight['time'] ?>&9=<?php echo $arrairport ?>&8=<?php echo str_replace(" ", "+", $route); ?>&10a=<?php echo substr($flight['flightTime'], 0, 1); ?>&10b=<?php echo substr($flight['flightTime'], 1, 3); ?>&voice=/V/&11=<?php echo $remarks; ?>&12a=<?php echo substr($load->totalEndurance, 0, 2); ?>&12b=<?php echo substr($load->totalEndurance, 3, 4); ?>&14=<?php echo $_SESSION['firstName']. "+" . $_SESSION['lastName']; ?>">File on VATSIM</a>
<br />
</div>
</div>
</div>
</div>
</div>
</article>
</div><!-- /.row -->
</div><!-- /.container -->
</div><!-- /.wrapper -->
<?php include 'sections/footer.php'; ?>