-
Notifications
You must be signed in to change notification settings - Fork 0
/
ids_grid_template.php
312 lines (306 loc) · 17.4 KB
/
ids_grid_template.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
<?php
/*
vIDS (virtual Information Display System) for VATSIM
Filename: ids_grid_template.php
Function: GUI definitions for various IDS user grids
Created: 6/1/21
Edited:
Changes:
*/
?>
<!-- LOADING OVERLAY -->
<div id="loading" class="hideLoad">
<div>
<h2>Please wait... vIDS can take up to 15 seconds to initialize</h2>
<div class="progress">
<div id="loadingProgress" class="progress-bar progress-bar-striped progress-bar-animated" role="progressbar" aria-valuenow="0" aria-valuemin="0" aria-valuemax="100" style="width:0%"></div>
</div>
</div>
</div>
<!-- LOCAL IDS DISPLAY -->
<div id="local_ids" class="container" style="border:1px solid white;display:none;">
<form><input type="hidden" id="display_template" value="local" /></form>
<div id="header" class="row" style="border:2px solid white">
<div class="col-sm-2" style="text-align:left; vertical-align:middle">
<img src="img/logo.png" height="70px" style="margin-top:15px"/>
</div>
<div class="col-sm-8 ids-header template_local"><?php echo DEFAULT_AFLD_ID; ?> ATCT</div>
<div class="col-sm-8 ids-header template_a80"><?php echo TRACON_LONG_NAME; ?></div>
<div class="col-sm-2" style="text-align:right;">
<a href="#" id="acknowledge" onclick="acknowledgeChanges();" class="btn btn-lg btn-primary" style="margin-top:15px">Acknowledge</a>
<br/>
<span id="refresh_countdown" style="color:white">Loading... </span>
<img src="img/gear-loading.gif" height="25px"/>
</div>
</div>
<div class="row" style="border-right:2px solid white">
<div id="atis_container" class="col-sm-1 atis_container h-100"><div id="atis_label_arrival" class="atis_label">Arrival</div><div class="atis_code h-100" id="atis_code"></div></div>
<div id="atis_container_departure" class="col-sm-1 atis_container h-100"><div class="atis_label">Departure</div><div class="atis_code h-100" id="atis_code_d"></div></div>
<div id="second_row" class="col-sm-10">
<div class="row">
<div class="col-sm-12 text_grid" id="metar"></div>
</div>
<div id="row2" class="row rem-bor">
<div class="col-sm-3 traffic_flow" id="traffic_flow"></div>
<div class="col-sm-2 text_grid">
<span class="cell_header">Departure Rwys</span>
<div id="local_dep_rwys">
</div>
</div>
<div class="col-sm-2 text_grid">
<span class="cell_header">Arrival Rwys</span>
<div id="local_arr_rwys">
</div>
</div>
<!-- Removed TRIPS config from this area to 1) free up real-estate for other features, 2) make the IDS more universally-configurable
<div class="col-sm-2 text_grid">
<span class="cell_header">Trips Config</span>
<div id="TRIPS_info" onclick="clearStyle(this);" class=""></div>
</div>
<div class="col-sm-3">
-->
<div class="col-sm-5">
<span class="cell_header" onclick="configDepSplit();">Departure Split</span>
<div id="split_dep_rwys" onclick="configDepSplit();"></div>
</div>
</div>
</div>
</div>
<div class="row info_grid">
<div class="col-sm-4">
<div class="row">
<div class="col-sm-12 cntlPos">
<?php //controller_display("Local Control",array('LC-1'=>'LC-1','LC-2'=>'LC-2','LC-3'=>'LC-3','LC-4'=>'LC-4','LC-5'=>'LC-5'),array('N'=>'N','C43'=>'C43'),true);
controller_display($positions[0][0],$positions[0][1],$positions[0][2],true);
?>
<br/>
<div class="scroll_content allblack"></div>
</div>
</div>
<!-- Reworked this area of the IDS to give TMU info more real estate -->
<!-- <div class="row template_local">
<div class="col-sm-12 cntlPos">
<?php //controller_display("Ground Control",array('GC-N'=>'GC-N','GC-C'=>'GC-C','GC-S'=>'GC-S','GM'=>'GM'),array('LC-1'=>'LC-1','LC-2'=>'LC-2','LC-3'=>'LC-3','LC-4'=>'LC-4','LC-5'=>'LC-5','N'=>'N','C43'=>'C43')); ?>
</div>
</div>
<div class="row template_a80">
<div class="col-sm-12">
<?php //controller_display(TRACON_ID . " TAR",array('H'=>'H','D'=>'D','L'=>'L','Y'=>'Y'),array('N'=>'N','S'=>'S','C43'=>'C43')); ?>
</div>
</div>
-->
</div>
<div class="col-sm-4">
<div class="row info_grid">
<div class="col-sm-12">
<?php //controller_display(TRACON_ID . " Departure",array('N'=>'N','S'=>'S','I'=>'I'),array('C43'=>'C43'));
controller_display($positions[3][0],$positions[3][1],$positions[3][2]);
?>
<div class="row rem-bor"><div class="col-sm-10">Gates assigned:</div></div>
<div class="row combines rem-bor">
<!-- Scrolling marquee design... removed 9/22 at Joe's request -->
<!--
<div class="col-sm-4 scroll_content" id="dep_gate_n_container" onclick="setDepartureGates();"><p class="marquee_container"><span id="dep_gate_n"> </span></p></div>
<div class="col-sm-4 scroll_content" id="dep_gate_s_container" onclick="setDepartureGates();"><p class="marquee_container"><span id="dep_gate_s"> </span></p></div>
<div class="col-sm-4 scroll_content" id="dep_gate_i_container" onclick="setDepartureGates();"><p class="marquee_container"><span id="dep_gate_i"> </span></p></div>
-->
<?php
global $departure_positions;
$disp_size = 12/count($departure_positions);
foreach($departure_positions as $departure_position) {
print "<div class=\"col-sm-" . $disp_size . " scroll_content\" id=\"dep_gate_" . $departure_position . "_container\" onclick=\"setDepartureGates();\"><span id=\"dep_gate_" . $departure_position . "\"> </span></div>";
}
?>
<!--
<div class="col-sm-4 scroll_content" id="dep_gate_n_container" onclick="setDepartureGates();"><span id="dep_gate_n"> </span></div>
<div class="col-sm-4 scroll_content" id="dep_gate_s_container" onclick="setDepartureGates();"><span id="dep_gate_s"> </span></div>
<div class="col-sm-4 scroll_content" id="dep_gate_i_container" onclick="setDepartureGates();"><span id="dep_gate_i"> </span></div>
-->
</div>
</div>
</div>
<!-- <div class="row info_grid">
<div class="col-sm-12 cntlPos">
<?php //controller_display(TRACON_ID . " Satellite",array('P'=>'P','F'=>'F','X'=>'X','G'=>'G','Q'=>'Q'),array('N'=>'N','C43'=>'C43')); ?>
</div>
</div>
-->
</div>
<div class="col-sm-4"><span class="cell_header">Afld Config</span><div id="AFLD_info" onclick="clearStyle(this);" class=""><br/></div></div>
</div>
<div class="row info_grid dynMargin" style="overflow:hidden; position: relative;">
<div class="col-sm-4">
<div class="row template_local">
<div class="col-sm-12 cntlPos">
<?php //controller_display("Ground Control",array('GC-N'=>'GC-N','GC-C'=>'GC-C','GC-S'=>'GC-S','GM'=>'GM'),array('LC-1'=>'LC-1','LC-2'=>'LC-2','LC-3'=>'LC-3','LC-4'=>'LC-4','LC-5'=>'LC-5','N'=>'N','C43'=>'C43'));
controller_display($positions[1][0],$positions[1][1],$positions[1][2]);
?>
</div>
</div>
<div class="row template_a80">
<div class="col-sm-12 cntlPos">
<?php //controller_display(TRACON_ID . " TAR",array('H'=>'H','D'=>'D','L'=>'L','Y'=>'Y'),array('N'=>'N','S'=>'S','C43'=>'C43'));
controller_display($positions[6][0],$positions[6][1],$positions[6][2]);
?>
</div>
</div>
<div class="row rem-bor-tp">
<div class="col-sm-12 template_local cntlPos">
<?php //controller_display("Clearance Delivery",array('CD-1'=>'CD-1','CD-2'=>'CD-2','FD'=>'FD'),array('GC-N'=>'GC-N','LC-1'=>'LC-1','LC-2'=>'LC-2','N'=>'N','C43'=>'C43'));
controller_display($positions[2][0],$positions[2][1],$positions[2][2]);
?>
</div>
<!--<div class="col-sm-12 template_a80 cntlPos" id="grid5x1">
<?php //controller_display(TRACON_ID . " Outer",array('M'=>'M','W'=>'W','Z'=>'Z','R'=>'R','E'=>'E','3E'=>'3E'),array('N'=>'N','P'=>'P','F'=>'F','X'=>'X','G'=>'G','C43'=>'C43'));
controller_display($positions[7][0],$positions[7][1],$positions[7][2]);
?>
</div>-->
</div>
<div class="row" style="border-bottom:0px">
<div class="col-sm-12"><span class="cell_header">PIREPs</span><div onclick="clearStyle(this);""><textarea id="PIREP_info" class="txt_low" rows="3" readonly></textarea></div></div>
</div>
</div>
<div class="col-sm-4">
<div class="row info_grid">
<div class="col-sm-12 cntlPos">
<?php //controller_display(TRACON_ID . " Satellite",array('P'=>'P','F'=>'F','X'=>'X','G'=>'G','Q'=>'Q'),array('N'=>'N','C43'=>'C43'));
controller_display($positions[4][0],$positions[4][1],$positions[4][2]);
?>
</div>
</div>
<div class="row rem-bor-tp">
<div class="col-sm-12 cntlPos" id="grid5x2">
<?php //controller_display(TRACON_ID . " AR",array('O'=>'O','V'=>'V','A'=>'A'),array('N'=>'N','H'=>'H','D'=>'D','C43'=>'C43'));
controller_display($positions[5][0],$positions[5][1],$positions[5][2]);
?>
</div>
</div>
<div class="row" style="border-bottom:0px;">
<div class="col-sm-12"><span class="cell_header">CIC Notices</span>
<!--
<div id="CIC_info" class="template_local scroller"></div>
<div id="A80_CIC_info" class="template_a80 scroller"></div>
-->
<div class="template_local"><textarea id="CIC_info" class="txt_low" rows="3" readonly></textarea></div>
<div class="template_a80"><textarea id="A80_CIC_info" class="txt_low" rows="3" readonly></textarea></div>
</div>
</div>
</div>
<div class="col-sm-4 scroll_wrapper"><span class="cell_header">TMU Information</span>
<!--<div onclick="clearStyle(this);" class="">-->
<!--<div class="scroll_wrapper">-->
<div id="TMU_info" class="scroller"></div>
<!--</div>-->
<!--<textarea id="TMU_info" class="txt_low" rows="7" readonly></textarea>-->
<!--</div>-->
</div>
</div>
<!-- START A80 SATELLITE & OUTER AIRFIELD DISPLAY -->
<div class="row template_a80 dynMargin">
<div class="col-sm-12">
<?php
$newrow = true;
$a80sat = $satellite_fields; // Legacy compatibility... I need to replaced references to the $a80sat variable
for($x=0;$x<count($a80sat);$x++) {
$str = "";
if($newrow) {
$str .= "<div class=\"row\">";
$newrow = false;
}
$str .= "<div class=\"col-sm-4 moveable\" draggable=\"true\" ondragstart=\"dragStarted(event);\" ondragover=\"draggingOver(event);\" ondrop=\"dropped(event);\">
<input type=\"hidden\" id=\"" . $a80sat[$x]['id'] . "_override\" value=\"false\" />
<div class=\"dropdown noclear\">
<a href=\"#\" class=\"dropdown-toggle\" data-toggle=\"dropdown\"><i class=\"fas fa-caret-square-down\"></i></a>
<ul class=\"dropdown-menu\" role=\"menu\" aria-labelledby=\"dLabel\">
<li class=\"dropdown-header\">" . $a80sat[$x]['id'] . "</li>
<li class=\"divider\"></li>
<li><a href=\"#\" onclick=\"airfieldConfig('" . $a80sat[$x]['id'] . "');\">Airfield Config</a></li>
<li><a href=\"#PROC\" onclick=\"loadProc('" . $a80sat[$x]['id'] . "');\" data-toggle=\"modal\">Instrument Procedures</a></li>
</ul>
</div>
<span class=\"cell_header\">" . $a80sat[$x]['name'] . "</span><span class=\"cab_status\"> <span id=\"" . $a80sat[$x]['id'] . "_online_del\" class=\"badge badge-secondary\">D</span> <span id=\"" . $a80sat[$x]['id'] . "_online_gnd\" class=\"badge badge-secondary\">G</span> <span id=\"" . $a80sat[$x]['id'] . "_online_twr\" class=\"badge badge-secondary\">T</span></span>
<div class=\"op_hours\">" . $a80sat[$x]['hours'] . "</div>
<div class=\"row rem-bor\">
<div id=\"" . $a80sat[$x]['id'] . "_atis_code\" class=\"col-sm-3 rem-bor atis_code\"></div>
<div class=\"col-sm-6\">
<div id=\"" . $a80sat[$x]['id'] . "_open_closed\" class=\"row rem-bor arrival_info\">
</div>
<input type=\"hidden\" id=\"" . $a80sat[$x]['id'] . "_hours_mf\" value=\"" . $a80sat[$x]['MF'] . "\" />
<input type=\"hidden\" id=\"" . $a80sat[$x]['id'] . "_hours_ss\" value=\"" . $a80sat[$x]['SS'] . "\" />
<input type=\"hidden\" id=\"" . $a80sat[$x]['id'] . "_hours_dstAdjust\" value=\"" . $a80sat[$x]['DST_Adjust'] . "\" />
<div id=\"" . $a80sat[$x]['id'] . "_metar\" class=\"row rem-bor\">
</div>
</div>
<div id=\"" . $a80sat[$x]['id'] . "_runway\" class=\"col-sm-3 apch_type\"></div>
</div>
</div> ";
if(($x+1) % 3 == 0) {
$str .= "</div>";
$newrow = true;
}
print $str;
}
?>
</div>
</div>
<div id="buttons" class="row">
<div class="col">
<div class="btn-group dropup">
<a href="#" class="btn btn-lg btn-primary dropdown-toggle" data-toggle="dropdown" data-bs-toggle="dropdown" href="#"><i class="fas fa-home fa-lg"></i><br/>HOME</a>
<ul class="dropdown-menu" role="menu" aria-labelledby="dLabel">
<li><a href="#" onclick="returnToLanding('local_ids');">Return to menu</a></li>
<?php if(BUG_REPORTING) {
print "<li><a href=\"#BUG\" data-toggle=\"modal\">Report a bug</li></li>";
}?>
</ul>
</div>
<a href="#WX" data-remote="https://www.aviationweather.gov/taf/data?ids=kord&format=decoded&metars=on&date=&submit=Get+TAF+data" class="btn btn-lg btn-primary" data-toggle="modal" data-bs-toggle="modal" data-target="#WX" onClick="fetchWeather('K<?php echo DEFAULT_AFLD_ID; ?>');"><i class="fas fa-cloud fa-lg"></i><br/>WX</a>
<a href="#RECAT" class="btn btn-lg btn-primary" data-toggle="modal" data-bs-toggle="modal"><i class="fas fa-plane-arrival fa-lg"></i><br/>RECAT</a>
<a href="#FREQS" class="btn btn-lg btn-primary template_local" data-toggle="modal" data-bs-toggle="modal"><i class="fas fa-broadcast-tower fa-lg"></i><br/>FREQS</a>
<a href="#aFREQS" class="btn btn-lg btn-primary template_a80" data-toggle="modal" data-bs-toggle="modal"><i class="fas fa-broadcast-tower fa-lg"></i><br/>FREQS</a>
<a href="#ARSPC" class="btn btn-lg btn-primary template_local" data-toggle="modal" data-bs-toggle="modal"><i class="fas fa-map-marked-alt fa-lg"></i><br/>ARSPC</a>
<a href="#aARSPC" class="btn btn-lg btn-primary template_a80" data-toggle="modal" data-bs-toggle="modal"><i class="fas fa-map-marked-alt fa-lg"></i><br/>ARSPC</a>
<a href="#PROC" class="btn btn-lg btn-primary" data-toggle="modal" data-bs-toggle="modal" onclick="loadProc('K<?php echo DEFAULT_AFLD_ID; ?>');"><i class="fas fa-file-invoice fa-lg"></i><br/>PROC</a>
<!--<a href="#ROTG" class="btn btn-lg btn-primary" data-toggle="modal" data-bs-toggle="modal"><i class="fas fa-plane-departure fa-lg"></i><br/>ROTG</a>-->
<a href="#SOP" class="btn btn-lg btn-primary template_local" data-toggle="modal" data-bs-toggle="modal"><i class="fas fa-book fa-lg"></i><br/>SOP</a>
<a href="#aSOP" class="btn btn-lg btn-primary template_a80" data-toggle="modal" data-bs-toggle="modal"><i class="fas fa-book fa-lg"></i><br/>SOP</a>
<a href="#LOA" class="btn btn-lg btn-primary template_local" data-toggle="modal" data-bs-toggle="modal"><i class="fas fa-handshake fa-lg"></i><br/>LOA</a>
<a href="#aLOA" class="btn btn-lg btn-primary template_a80" data-toggle="modal" data-bs-toggle="modal"><i class="fas fa-handshake fa-lg"></i><br/>LOA</a>
<a href="#PIREP" class="btn btn-lg btn-primary" data-toggle="modal" data-bs-toggle="modal"><i class="fas fa-headset fa-lg"></i><br/>PIREP</a>
<a href="#ACFT" class="btn btn-lg btn-primary" data-toggle="modal" data-bs-toggle="modal"><i class="fas fa-plane fa-lg"></i><br/>ACFT</a>
<a href="#RELIEF" class="btn btn-lg btn-primary template_local" data-toggle="modal" data-bs-toggle="modal"><i class="fas fa-couch fa-lg"></i><br/>RELIEF</a>
<a href="#aRELIEF" class="btn btn-lg btn-primary template_a80" data-toggle="modal" data-bs-toggle="modal"><i class="fas fa-couch fa-lg"></i><br/>RELIEF</a>
<a href="#AFLD" class="btn btn-lg btn-primary" data-toggle="modal" data-bs-toggle="modal"><i class="fas fa-cogs fa-lg"></i><br/>AFLD</a>
<a href="#CIC" class="btn btn-lg btn-primary template_a80" data-toggle="modal" data-bs-toggle="modal"><i class="fas fa-user-tie fa-lg"></i><br/>CIC</a>
<a href="#TMU" class="btn btn-lg btn-primary" data-toggle="modal" data-bs-toggle="modal"><i class="fas fa-traffic-light fa-lg"></i><br/>TMU</a>
<a href="#EMER" class="btn btn-lg btn-primary" data-toggle="modal" data-bs-toggle="modal"><i class="fas fa-asterisk fa-lg icon-emergency"></i><br/>EMRG</a>
<a href="#HELP" class="btn btn-lg btn-primary template_local" data-toggle="modal" data-bs-toggle="modal"><i class="far fa-question-circle"></i><br/>HELP</a>
<a href="#aHELP" class="btn btn-lg btn-primary template_a80" data-toggle="modal" data-bs-toggle="modal"><i class="far fa-question-circle"></i><br/>HELP</a>
</div>
</div>
</div>
<?php
function controller_display($heading,$cntlPositions,$selOptions,$edit_toggle=0) { // Creates the controller position display grid
$edit_link = "";
$col_size = floor(12 / count($cntlPositions)); // Bootstrap columns always total 12
$selOptions = array_unique(array_merge($cntlPositions,$selOptions)); // Selections include the facility's control positions
if($edit_toggle) {
$edit_link = " <a href=\"#ControllerEdit\" data-toggle=\"modal\"><i class=\"fas fa-edit\"></i></a>";
}
$output_str = "<span class=\"cell_header\">$heading</span>$edit_link<div class=\"row rem-bor controllerPositions\">";
foreach($cntlPositions as $cntlPosition) {
$output_str .= "<div class=\"col-sm-" . $col_size . "\">$cntlPosition</div>";
}
$output_str .= "</div><div class=\"row rem-bor\"><div class=\"col-sm-10\">Combined to:</div></div><div class=\"row combines rem-bor\">";
$select_options = "<option value=\".\" selected>...</option>";
foreach($selOptions as $key => $value) {
$select_options .= "<option value=\"" . $key . "\">" . $value . "</option>";
}
foreach($cntlPositions as $cntlPosition => $value) {
$output_str .= "<div class=\"col-sm-" . $col_size. "\"><select class=\"custom-select mr-sm-2 controllerEdit hideControl\" id=\"" . $cntlPosition . "\" onchange=\"updateCtrlPos();\">
" . $select_options . "</select><input type=\"text\" class=\"controllerDisplay\" id=\"" . $cntlPosition . "_disp\" size=\"3\" readonly></div>";
}
$output_str .= "</div>";
echo $output_str;
}
?>