-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata.php
More file actions
633 lines (542 loc) · 35.5 KB
/
data.php
File metadata and controls
633 lines (542 loc) · 35.5 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
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
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
<?php
include("sessions/handler.php");
// Session Start (S)
if (session_status() == PHP_SESSION_NONE) {
session_start();
ob_start();
}
// Session Start (E)
include("load/config.php");
define('PERTI_MYSQL_ONLY', true);
include("load/connect.php");
$uri = explode('?', $_SERVER['REQUEST_URI']);
$id = $uri[1];
// NOTE: data.php is PUBLIC - no authentication required
// This differs from sheet.php which requires login
$perm = true;
// For logged-in users, set session data
if (isset($_SESSION['VATSIM_CID'])) {
$cid = session_get('VATSIM_CID', '');
$p_check = $conn_sqli->query("SELECT * FROM users WHERE cid='$cid'");
} else {
// Public access - set placeholder values
$_SESSION['VATSIM_FIRST_NAME'] = 'Guest';
$_SESSION['VATSIM_LAST_NAME'] = '';
$_SESSION['VATSIM_CID'] = 0;
}
$plan_info = $conn_sqli->query("SELECT * FROM p_plans WHERE id=$id")->fetch_assoc();
// Org scope: make all active orgs available so the switcher shows for public users
$plan_org_code = $plan_info['org_code'] ?? null;
if (!isset($_SESSION['VATSIM_CID']) || empty($_SESSION['VATSIM_CID'])) {
// Load all active orgs for the switcher
$all_active_orgs = [];
$org_result = $conn_sqli->query("SELECT org_code FROM organizations WHERE is_active = 1 AND org_code != 'global' ORDER BY org_code");
if ($org_result) {
while ($r = $org_result->fetch_assoc()) {
$all_active_orgs[] = $r['org_code'];
}
}
if (!empty($all_active_orgs)) {
$_SESSION['ORG_ALL'] = $all_active_orgs;
}
// Auto-detect org from plan if not already set by user
if ($plan_org_code && (!isset($_SESSION['ORG_CODE']) || $_SESSION['ORG_CODE'] === 'vatcscc')) {
$_SESSION['ORG_CODE'] = $plan_org_code;
// Cache org display info
require_once 'load/org_context.php';
if ($conn_sqli) { get_org_info($conn_sqli); }
}
}
require_once 'load/org_context.php';
$is_global_scope = (get_org_code() === 'global');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<!-- Import CSS -->
<?php
$page_title = __('data.pageTitle');
include("load/header.php");
?>
<link href="https://unpkg.com/maplibre-gl@3.6.2/dist/maplibre-gl.css" rel="stylesheet" />
<script src="https://unpkg.com/maplibre-gl@3.6.2/dist/maplibre-gl.js"></script>
<script>
var plan_id = <?= $id ?>;
var PERTI_EVENT_DATE = <?= json_encode($plan_info['event_date']); ?>;
var PERTI_EVENT_START = <?= json_encode($plan_info['event_start']); ?>;
var PERTI_EVENT_END_DATE = <?= json_encode($plan_info['event_end_date'] ?? ''); ?>;
var PERTI_EVENT_END_TIME = <?= json_encode($plan_info['event_end_time'] ?? ''); ?>;
var PERTI_EVENT_START_ISO = null;
var PERTI_EVENT_END_ISO = null;
(function() {
if (PERTI_EVENT_DATE && PERTI_EVENT_START) {
var startTime = PERTI_EVENT_START.padStart(4, '0');
PERTI_EVENT_START_ISO = PERTI_EVENT_DATE + 'T' + startTime.substring(0,2) + ':' + startTime.substring(2,4) + ':00Z';
}
var endDate = PERTI_EVENT_END_DATE || PERTI_EVENT_DATE;
var endTime = PERTI_EVENT_END_TIME || '';
if (endDate && endTime.length >= 4) {
endTime = endTime.padStart(4, '0');
PERTI_EVENT_END_ISO = endDate + 'T' + endTime.substring(0,2) + ':' + endTime.substring(2,4) + ':00Z';
} else if (PERTI_EVENT_START_ISO) {
var startDt = new Date(PERTI_EVENT_START_ISO);
var endDt = new Date(startDt.getTime() + 6 * 60 * 60 * 1000);
PERTI_EVENT_END_ISO = endDt.toISOString();
}
})();
</script>
<link rel="stylesheet" href="assets/css/initiative_timeline.css<?= _v('assets/css/initiative_timeline.css') ?>">
<script>
function tooltips() {
$('[data-toggle="tooltip"]').tooltip('dispose');
$(function () {
$('[data-toggle="tooltip"]').tooltip()
});
}
</script>
</head>
<body>
<?php
include('load/nav_public.php');
?>
<section class="perti-hero perti-hero--standard bg-position-center jarallax bg-dark text-light" data-jarallax data-speed="0.3">
<div class="container-fluid pt-2 pb-5 py-lg-6">
<img class="jarallax-img" src="assets/img/jumbotron/main.png" alt="" style="opacity: 50%; height: 100vh;">
<center>
<h1><b><span class="text-success"><?= $plan_info['event_name']; ?></span> Planning Data</b></h1>
<h5><a class="text-light" href="plan?<?= $plan_info['id']; ?>"><i class="fas fa-eye text-danger"></i> View Full PERTI Plan</a></h5>
</center>
</div>
</section>
<div class="container-fluid mt-3 mb-3">
<div class="row">
<div class="col-2 d-none d-lg-block" id="data-sidebar">
<ul class="nav flex-column nav-pills" aria-orientation="vertical">
<li><a class="nav-link active rounded" data-toggle="tab" href="#overview">Overview</a></li>
<hr>
<li><a class="nav-link rounded" data-toggle="tab" href="#dcc_staffing"><?= __($is_global_scope ? 'plan.tabs.tmuStaffing' : 'plan.tabs.dccStaffing') ?></a></li>
<li><a class="nav-link rounded" data-toggle="tab" href="#t_staffing">Terminal Staffing</a></li>
<li><a class="nav-link rounded" data-toggle="tab" href="#configs">Field Configurations</a></li>
<li><a class="nav-link rounded" data-toggle="tab" href="#e_staffing">En-Route Staffing</a></li>
<li><a class="nav-link rounded" data-toggle="tab" href="#e_splits"><?= __('plan.tabs.enrouteSplits') ?></a></li>
</ul>
</div>
<div class="col-12 col-lg-10">
<div class="tab-content">
<!-- Tab: Overview -->
<div class="tab-pane fade show active" id="overview">
<div class="row">
<div class="col-12 col-md-6">
<img src="<?= $plan_info['event_banner']; ?>" class="rounded" style="width: 100%;" alt="<?= $plan_info['event_name']; ?> Event Banner">
<hr>
<h4><b>Operational Goals</b></h4>
<table class="table table-bordered">
<tbody id="goals_table"></tbody>
</table>
</div>
<div class="col-12 col-md-6">
<h4><b>Event Information</b></h4>
<table class="table table-striped table-bordered">
<tbody>
<tr>
<td><b>Event Name</b></td>
<td><?= $plan_info['event_name']; ?></td>
</tr>
<tr>
<td><b>Event Start Date</b></td>
<td><?= $plan_info['event_date']; ?></td>
</tr>
<tr>
<td><b>Event Start Time</b></td>
<td><?= $plan_info['event_start']; ?>Z</td>
</tr>
<?php if (!empty($plan_info['event_end_date'])): ?>
<tr>
<td><b>Event End Date</b></td>
<td><?= $plan_info['event_end_date']; ?></td>
</tr>
<?php endif; ?>
<?php if (!empty($plan_info['event_end_time'])): ?>
<tr>
<td><b>Event End Time</b></td>
<td><?= $plan_info['event_end_time']; ?>Z</td>
</tr>
<?php endif; ?>
<tr>
<td><b>TMU OpLevel</b></td>
<?php
if ($plan_info['oplevel'] == 1) {
echo '<td class="text-dark">'.$plan_info['oplevel'].' - Steady State</td>';
}
elseif ($plan_info['oplevel'] == 2) {
echo '<td class="text-success">'.$plan_info['oplevel'].' - Localized Impact</td>';
}
elseif ($plan_info['oplevel'] == 3) {
echo '<td class="text-warning">'.$plan_info['oplevel'].' - Regional Impact</td>';
}
elseif ($plan_info['oplevel'] == 4) {
echo '<td class="text-danger">'.$plan_info['oplevel'].' - NAS-Wide Impact</td>';
}
?>
</tr>
</tbody>
</table>
<hr>
<h4><b><?= __('plan.overview.resources') ?></b></h4>
<ul>
<li><a href="https://perti.vatcscc.org/nod" target="_blank"><?= __('plan.overview.resourceNod') ?></a> <?= __('plan.overview.resourceNodDesc') ?></li>
<li><a href="https://perti.vatcscc.org/playbook" target="_blank"><?= __('plan.overview.resourcePlaybook') ?></a> <?= __('plan.overview.resourcePlaybookDesc') ?></li>
<li><a href="https://perti.vatcscc.org/route" target="_blank"><?= __('plan.overview.resourceRoute') ?></a> <?= __('plan.overview.resourceRouteDesc') ?></li>
<li><a href="https://perti.vatcscc.org/airport_config" target="_blank"><?= __('plan.overview.resourceAirportConfig') ?></a> <?= __('plan.overview.resourceAirportConfigDesc') ?></li>
<li><a href="https://perti.vatcscc.org/splits" target="_blank"><?= __('plan.overview.resourceSplits') ?></a> <?= __('plan.overview.resourceSplitsDesc') ?></li>
<li><a href="https://perti.vatcscc.org/gdt" target="_blank"><?= __('plan.overview.resourceGdt') ?></a> <?= __('plan.overview.resourceGdtDesc') ?></li>
<li><a href="https://perti.vatcscc.org/jatoc" target="_blank"><?= __('plan.overview.resourceJatoc') ?></a> <?= __('plan.overview.resourceJatocDesc') ?></li>
<li>vATCSCC Discord <a href="https://discord.com/channels/358264961233059843/358295136398082048/" target="_blank">#ntml</a> and <a href="https://discord.com/channels/358264961233059843/358300240236773376/" target="_blank">#advisories</a> <?= __('plan.overview.resourceDiscord') ?></li>
<?php if (stripos($plan_info['hotline'] ?? '', 'Canada') !== false): ?>
<li>VATCAN <a href="ts3server://ts.vatcan.ca" target="_blank">TeamSpeak</a>, <span class="text-danger"><b>TMU Hang</b></span> <?= __('plan.overview.resourceHotlineVatcan') ?>
<ul><li><?= __('plan.overview.resourceCredentials') ?></li>
<li>The VATUSA <a href="ts3server://ts.vatusa.net" target="_blank">TeamSpeak</a>, <?= $plan_info['hotline'] ?? ''; ?> <?= __('plan.overview.resourcePrimaryBackupVatusa') ?></li>
<li>The vATCSCC Discord, <?= $plan_info['hotline'] ?? ''; ?> <?= __('plan.overview.resourceSecondaryBackup') ?></li></ul></li>
<?php else: ?>
<li>VATUSA <a href="ts3server://ts.vatusa.net" target="_blank">TeamSpeak</a>, <span class="text-danger"><b><?= $plan_info['hotline'] ?? ''; ?></b></span> <?= __('plan.overview.resourceHotlineVatusa') ?>
<ul><li><?= __('plan.overview.resourceCredentials') ?></li>
<li>The VATCAN <a href="ts3server://ts.vatcan.ca" target="_blank">TeamSpeak</a>, TMU Hang <?= __('plan.overview.resourcePrimaryBackupVatcan') ?></li>
<li>The vATCSCC Discord, <?= $plan_info['hotline'] ?? ''; ?> <?= __('plan.overview.resourceSecondaryBackup') ?></li></ul></li>
<?php endif; ?>
<li><?= __('plan.overview.resourceGroupFlights') ?> <a href="https://bit.ly/NTML_Entry" target="_blank"><?= __('plan.overview.resourceGroupFlightsLink') ?></a>.</li>
<li><?= __('plan.overview.resourceCallsigns') ?> <a href="https://www.vatusa.net/info/policies/authorized-tmu-callsigns" target="_blank"><?= __('plan.overview.resourceCallsignsLink') ?></a>.</li>
<li><a href="https://bit.l/vATCSCC_Transgression_Reporting_Form" target="_blank"><?= __('plan.overview.resourceTransgression') ?></a> <?= __('plan.overview.resourceTransgressionDesc') ?></li>
</ul>
</div>
</div>
</div>
<!-- Tab: DCC/TMU Staffing -->
<div class="tab-pane fade" id="dcc_staffing">
<button class="btn btn-sm btn-outline-secondary plan-group-toggle mb-2" data-table="dccFacility"><i class="fas fa-list"></i> <?= __('plan.tables.flatView') ?></button>
<center><table class="table table-striped table-bordered w-75">
<thead>
<th class="text-center sortable" data-sort="position_facility" data-table="dccFacility" style="width:12%;"><b><?= __('plan.dcc.facility') ?></b> <i class="fas fa-sort sort-icon"></i></th>
<th class="sortable" data-sort="position_name" data-table="dccFacility" style="width:22%;"><b><?= __('plan.dcc.positionName') ?></b> <i class="fas fa-sort sort-icon"></i></th>
<th class="text-center sortable" data-sort="personnel_ois" data-table="dccFacility" style="width:8%;"><b><?= __('plan.dcc.ois') ?></b> <i class="fas fa-sort sort-icon"></i></th>
<th class="sortable" data-sort="personnel_name" data-table="dccFacility"><b><?= __('plan.dcc.personnelName') ?></b> <i class="fas fa-sort sort-icon"></i></th>
<th></th>
</thead>
<tbody id="dcc_staffing_table"></tbody>
</table></center>
</div>
<!-- Tab: Terminal Staffing -->
<div class="tab-pane fade" id="t_staffing">
<button class="btn btn-sm btn-outline-secondary plan-group-toggle mb-2" data-table="termStaffing"><i class="fas fa-list"></i> <?= __('plan.tables.flatView') ?></button>
<center><table class="table table-sm table-striped table-bordered w-75">
<thead>
<th class="text-center sortable" data-sort="facility_name" data-table="termStaffing"><b><?= __('plan.staffing.facilityName') ?></b> <i class="fas fa-sort sort-icon"></i></th>
<th class="text-center sortable" data-sort="staffing_status" data-table="termStaffing"><b><?= __('plan.staffing.status') ?></b> <i class="fas fa-sort sort-icon"></i></th>
<th class="text-center sortable" data-sort="staffing_quantity" data-table="termStaffing"><b><?= __('plan.staffing.quantity') ?></b> <i class="fas fa-sort sort-icon"></i></th>
<th class="text-center"><b><?= __('plan.staffing.comments') ?></b></th>
<th></th>
</thead>
<tbody id="term_staffing_table"></tbody>
</table></center>
</div>
<!-- Tab: Field Configs -->
<div class="tab-pane fade" id="configs">
<button class="btn btn-sm btn-outline-secondary plan-group-toggle mb-2" data-table="configs"><i class="fas fa-list"></i> <?= __('plan.tables.flatView') ?></button>
<center><table class="table table-sm table-striped table-bordered w-75">
<thead>
<th class="text-center sortable" data-sort="airport" data-table="configs"><b><?= __('plan.configTab.field') ?></b> <i class="fas fa-sort sort-icon"></i></th>
<th class="text-center sortable" data-sort="weather" data-table="configs"><b><?= __('plan.configTab.conditions') ?></b> <i class="fas fa-sort sort-icon"></i></th>
<th class="text-center sortable" data-sort="arrive" data-table="configs"><b><?= __('plan.configTab.arriving') ?></b> <i class="fas fa-sort sort-icon"></i></th>
<th class="text-center sortable" data-sort="depart" data-table="configs"><b><?= __('plan.configTab.departing') ?></b> <i class="fas fa-sort sort-icon"></i></th>
<th class="text-center sortable" data-sort="aar" data-table="configs"><b>AAR</b> <i class="fas fa-sort sort-icon"></i></th>
<th class="text-center sortable" data-sort="adr" data-table="configs"><b>ADR</b> <i class="fas fa-sort sort-icon"></i></th>
<th class="text-center"><b><?= __('plan.staffing.comments') ?></b></th>
<th></th>
</thead>
<tbody id="configs_table"></tbody>
</table></center>
</div>
<!-- Tab: Enroute Staffing -->
<div class="tab-pane fade" id="e_staffing">
<button class="btn btn-sm btn-outline-secondary plan-group-toggle mb-2" data-table="enrouteStaffing"><i class="fas fa-list"></i> <?= __('plan.tables.flatView') ?></button>
<center><table class="table table-sm table-striped table-bordered w-75">
<thead>
<th class="text-center sortable" data-sort="facility_name" data-table="enrouteStaffing"><b><?= __('plan.staffing.facilityName') ?></b> <i class="fas fa-sort sort-icon"></i></th>
<th class="text-center sortable" data-sort="staffing_status" data-table="enrouteStaffing"><b><?= __('plan.staffing.status') ?></b> <i class="fas fa-sort sort-icon"></i></th>
<th class="text-center sortable" data-sort="staffing_quantity" data-table="enrouteStaffing"><b><?= __('plan.staffing.quantity') ?></b> <i class="fas fa-sort sort-icon"></i></th>
<th class="text-center"><b><?= __('plan.staffing.comments') ?></b></th>
<th></th>
</thead>
<tbody id="enroute_staffing_table"></tbody>
</table></center>
</div>
<!-- Tab: Enroute Splits -->
<div class="tab-pane fade" id="e_splits">
<div class="d-flex justify-content-between align-items-center mb-3">
<h5 class="mb-0"><?= __('plan.splits.title') ?></h5>
<div>
<button class="btn btn-sm btn-outline-secondary mr-1" id="btn_refresh_splits" title="<?= __('common.refresh') ?>">
<i class="fas fa-sync-alt"></i>
</button>
<a href="./splits" class="btn btn-sm btn-outline-primary" target="_blank">
<i class="fas fa-external-link-alt mr-1"></i><?= __('plan.splits.configureSplits') ?>
</a>
</div>
</div>
<div id="plan_splits_map" style="width:100%;height:450px;border-radius:6px;margin-bottom:12px;display:none;"></div>
<div id="plan_splits_map_controls" class="mb-3" style="display:none;">
<div class="d-flex align-items-center flex-wrap small">
<span class="mr-2 font-weight-bold"><?= __('plan.splits.mapLayers') ?>:</span>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" class="custom-control-input" id="splits_layer_active" checked>
<label class="custom-control-label" for="splits_layer_active">
<span class="badge badge-success"><?= __('plan.splits.active') ?></span>
</label>
</div>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" class="custom-control-input" id="splits_layer_scheduled" checked>
<label class="custom-control-label" for="splits_layer_scheduled">
<span class="badge badge-info"><?= __('plan.splits.scheduled') ?></span>
</label>
</div>
<span class="mx-2 text-muted">|</span>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" class="custom-control-input" id="splits_layer_artcc" checked>
<label class="custom-control-label" for="splits_layer_artcc">
<span class="badge" style="background:#4682B4;color:#fff"><?= __('plan.splits.layerArtcc') ?></span>
</label>
</div>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" class="custom-control-input" id="splits_layer_superhigh">
<label class="custom-control-label" for="splits_layer_superhigh">
<span class="badge" style="background:#9932CC;color:#fff"><?= __('plan.splits.layerSuperhigh') ?></span>
</label>
</div>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" class="custom-control-input" id="splits_layer_high">
<label class="custom-control-label" for="splits_layer_high">
<span class="badge" style="background:#FF6347;color:#fff"><?= __('plan.splits.layerHigh') ?></span>
</label>
</div>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" class="custom-control-input" id="splits_layer_low">
<label class="custom-control-label" for="splits_layer_low">
<span class="badge" style="background:#228B22;color:#fff"><?= __('plan.splits.layerLow') ?></span>
</label>
</div>
<div class="custom-control custom-checkbox custom-control-inline">
<input type="checkbox" class="custom-control-input" id="splits_layer_tracon">
<label class="custom-control-label" for="splits_layer_tracon">
<span class="badge" style="background:#20B2AA;color:#fff"><?= __('plan.splits.layerTracon') ?></span>
</label>
</div>
</div>
<div id="plan_splits_config_toggles" class="d-flex align-items-center flex-wrap small mt-1"></div>
</div>
<div id="plan_splits_container">
<div class="text-center text-muted py-4">
<i class="fas fa-spinner fa-spin"></i> <?= __('common.loading') ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<?php
include("load/footer.php");
?>
</body>
<!-- Edit DCC Personnel Modal -->
<div class="modal fade" id="edit_dccstaffingModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Edit Personnel</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<form method="post" id="edit_dccstaffing">
<div class="modal-body">
<input type="hidden" name="id" id="id">
Facility:
<input type="text" class="form-control" name="position_facility" id="position_facility" readonly required>
<hr>
Personnel Name:
<input type="text" class="form-control" name="personnel_name" id="personnel_name" maxlength="128" placeholder="Leave Blank for Vacancy">
Personnel OIs:
<input type="text" class="form-control" name="personnel_ois" id="personnel_ois" maxlength="2" placeholder="Leave Blank for Vacancy">
</div>
<div class="modal-footer">
<input type="submit" class="btn btn-sm btn-warning" value="Edit">
<button type="button" class="btn btn-sm btn-danger" data-dismiss="modal">Close</button>
</div>
</div>
</form>
</div>
</div>
<!-- Edit Terminal Staffing Modal -->
<div class="modal fade" id="edittermstaffingModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Edit Terminal Staffing Entry</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<form method="post" id="edittermstaffing">
<div class="modal-body">
<input type="hidden" name="id" id="id">
Facility Name:
<input type="text" class="form-control" name="facility_name" id="facility_name" placeholder="SCT - SoCal TRACON" readonly required>
Staffing Status:
<select class="form-control" name="staffing_status" id="staffing_status">
<option value="0">Unknown</option>
<option value="3">Understaffed</option>
<option value="1">Top Down</option>
<option value="2">Yes</option>
<option value="4">No</option>
</select>
Staffing Quantity:
<input type="text" class="form-control" name="staffing_quantity" id="staffing_quantity" maxlength="2" required>
Comments:
<input type="text" class="form-control" name="comments" id="comments">
</div>
<div class="modal-footer">
<input type="submit" class="btn btn-sm btn-warning" value="Edit">
<button type="button" class="btn btn-sm btn-danger" data-dismiss="modal">Close</button>
</div>
</div>
</form>
</div>
</div>
<!-- Edit Config Modal -->
<div class="modal fade" id="editconfigModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Edit Config Entry</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<form method="post" id="editconfig">
<div class="modal-body">
<input type="hidden" name="id" id="sheet_editconfig_id">
Field:
<input type="text" class="form-control" name="airport" id="sheet_editconfig_airport" placeholder="BWI" maxlength="4" readonly required>
<!-- ADL Config Picker (auto-populates when airport entered) -->
<div class="form-group mt-2">
<small class="text-muted">ADL Configuration</small>
<select class="form-control form-control-sm" id="sheet_editconfig_select" disabled>
<option value="">-- Select configuration --</option>
</select>
</div>
Meteorological Condition:
<select class="form-control" name="weather" id="sheet_editconfig_weather">
<option value="0">Unknown</option>
<option value="1">VMC</option>
<option value="2">LVMC</option>
<option value="3">IMC</option>
<option value="4">LIMC</option>
</select>
Arrival Runways:
<input type="text" class="form-control" name="arrive" id="sheet_editconfig_arrive" placeholder="33L/33R">
Departure Runways:
<input type="text" class="form-control" name="depart" id="sheet_editconfig_depart" placeholder="33R/28">
AAR:
<input type="text" class="form-control" name="aar" id="sheet_editconfig_aar" placeholder="60">
ADR:
<input type="text" class="form-control" name="adr" id="sheet_editconfig_adr" placeholder="60">
Comments:
<input type="text" class="form-control" name="comments" id="sheet_editconfig_comments">
</div>
<div class="modal-footer">
<input type="submit" class="btn btn-sm btn-warning" value="Edit">
<button type="button" class="btn btn-sm btn-danger" data-dismiss="modal">Close</button>
</div>
</div>
</form>
</div>
</div>
<!-- Edit Enroute Staffing Modal -->
<div class="modal fade" id="editenroutestaffingModal" tabindex="-1" role="dialog" aria-hidden="true">
<div class="modal-dialog" role="document">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Edit Enroute Staffing Entry</h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">×</span>
</button>
</div>
<form method="post" id="editenroutestaffing">
<div class="modal-body">
<input type="hidden" name="id" id="id">
Facility Name:
<input type="text" class="form-control" name="facility_name" id="facility_name" readonly required>
Staffing Status:
<select class="form-control" name="staffing_status" id="staffing_status">
<option value="0">Unknown</option>
<option value="2">Understaffed</option>
<option value="1">Yes</option>
<option value="3">No</option>
</select>
Staffing Quantity:
<input type="text" class="form-control" name="staffing_quantity" id="staffing_quantity" maxlength="2" required>
Comments:
<input type="text" class="form-control" name="comments" id="comments">
</div>
<div class="modal-footer">
<input type="submit" class="btn btn-sm btn-warning" value="Edit">
<button type="button" class="btn btn-sm btn-danger" data-dismiss="modal">Close</button>
</div>
</div>
</form>
</div>
</div>
<!-- Insert plan-tables.js + plan-splits-map.js + sheet.js Scripts -->
<script src="assets/js/plan-tables.js<?= _v('assets/js/plan-tables.js') ?>"></script>
<script src="assets/js/plan-splits-map.js<?= _v('assets/js/plan-splits-map.js') ?>"></script>
<script src="assets/js/sheet.js<?= _v('assets/js/sheet.js') ?>"></script>
<script>
// Lazy-load splits overview on first tab visit
var _splitsTabLoaded = false;
$('a[data-toggle="tab"][href="#e_splits"]').on('shown.bs.tab', function() {
if (!_splitsTabLoaded) {
_splitsTabLoaded = true;
if (typeof PlanSplitsMap !== 'undefined') PlanSplitsMap.init();
PlanTables.loadSplitsOverview();
}
});
$('#btn_refresh_splits').on('click', function() {
PlanTables.loadSplitsOverview();
});
$('#splits_layer_active').on('change', function() {
if (typeof PlanSplitsMap !== 'undefined') PlanSplitsMap.setLayerVisible('active', this.checked);
});
$('#splits_layer_scheduled').on('change', function() {
if (typeof PlanSplitsMap !== 'undefined') PlanSplitsMap.setLayerVisible('scheduled', this.checked);
});
['artcc', 'superhigh', 'high', 'low', 'tracon'].forEach(function(layer) {
$('#splits_layer_' + layer).on('change', function() {
if (typeof PlanSplitsMap !== 'undefined') PlanSplitsMap.setLayerVisible(layer, this.checked);
});
});
</script>
<script src="assets/js/mobile-nav.js<?= _v('assets/js/mobile-nav.js') ?>"></script>
<script>
$(function() {
MobileNav.init({
groups: [
{ id: 'overview', icon: 'fa-info-circle', tabs: ['#overview', '#dcc_staffing'] },
{ id: 'terminal', icon: 'fa-plane', tabs: ['#t_staffing', '#configs'] },
{ id: 'enroute', icon: 'fa-globe-americas', tabs: ['#e_staffing', '#e_splits'] }
],
sheetThreshold: 3,
sidebarSelector: '#data-sidebar',
contentSelector: '#data-sidebar + div'
});
});
</script>
</html>