-
Notifications
You must be signed in to change notification settings - Fork 161
/
Copy pathtools-acars.php
47 lines (41 loc) · 1.45 KB
/
tools-acars.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
<?php
require_once('require/class.Connection.php');
require_once('require/class.ACARS.php');
require_once('require/class.Language.php');
$ACARS = new ACARS();
$title = _("Parse ACARS messages");
require_once('header.php');
$page_url = $globalURL.'/tools-acars';
$message = filter_input(INPUT_POST,'acars_message',FILTER_SANITIZE_STRING);
print '<div class="info column">';
print '<h1>'._("Parse ACARS messages").'</h1>';
print '</div>';
print '<div class="table column">';
print '<p>'._("Parse ACARS messages and translate them in human readable format.").'</p>';
print '<div class="pagination">';
print '<form method="post">';
print '<fieldset class="form-group">';
print '<label for="acars_message">'._("ACARS Message").'</label>';
print '<textarea class="form-control" name="acars_message" id="acars_message" rows="5">';
if ($message != '') print $message;
print '</textarea>';
print '</fieldset>';
print '<button type="submit" class="btn btn-primary">Submit</button>';
print '</form>';
if ($message != '') {
$globalDebug = FALSE;
$parsed_msg = $ACARS->parse($message);
if (isset($parsed_msg['decode'])) {
print '<p>'._("ACARS message in human readable format:").'</p>';
foreach ($parsed_msg['decode'] as $value => $data) {
print '<b>'.$value.'</b>: '.$data.' ';
}
} else {
print '<p>'._("This ACARS message can't be translated in human readable format :(").'</p>';
}
//var_dump($parsed_msg);
}
print '</div>';
print '</div>';
require_once('footer.php');
?>