Completed
Push — master ( d8c574...a11679 )
by Yannick
07:12
created

tools-acars.php (1 issue)

Severity

Upgrade to new PHP Analysis Engine

These results are based on our legacy PHP analysis, consider migrating to our new PHP analysis engine instead. Learn more

1
<?php
2
require_once('require/class.Connection.php');
3
require_once('require/class.ACARS.php');
4
require_once('require/class.Language.php');
5
$ACARS = new ACARS();
6
$title = _("Parse ACARS messages");
7
require_once('header.php');
8
9
$page_url = $globalURL.'/tools-acars';
10
11
$message = filter_input(INPUT_POST,'acars_message',FILTER_SANITIZE_STRING);
12
13
print '<div class="info column">';
14
print '<h1>'._("Parse ACARS messages").'</h1>';
15
print '</div>';
16
17
print '<div class="table column">';	
18
print '<p>'._("Parse ACARS messages and translate them in human readable format.").'</p>';
19
print '<div class="pagination">';
20
print '<form method="post">';
21
print '<fieldset class="form-group">';
22
print '<label for="acars_message">'._("ACARS Message").'</label>';
23
print '<textarea class="form-control" name="acars_message" id="acars_message" rows="5">';
24
if ($message != '') print $message;
25
print '</textarea>';
26
print '</fieldset>';
27
print '<button type="submit" class="btn btn-primary">Submit</button>';
28
print '</form>';
29
if ($message != '') {
30
	$globalDebug = FALSE;
31
	$parsed_msg = $ACARS->parse($message);
32
	if (isset($parsed_msg['decode'])) {
33
		print '<p>'._("ACARS message in human readable format:").'</p>';
34
		foreach ($parsed_msg['decode'] as $value => $data) {
35
			print '<b>'.$value.'</b>: '.$data.' ';
36
		}
37
	} else {
38
		print '<p>'._("This ACARS message can't be translated in human readable format :(").'</p>';
39
	}
40
	//var_dump($parsed_msg);
41
}
42
43
print '</div>';
44
print '</div>';
45
46
require_once('footer.php');
47
?>
1 ignored issue
show
It is not recommended to use PHP's closing tag ?> in files other than templates.

Using a closing tag in PHP files that only contain PHP code is not recommended as you might accidentally add whitespace after the closing tag which would then be output by PHP. This can cause severe problems, for example headers cannot be sent anymore.

A simple precaution is to leave off the closing tag as it is not required, and it also has no negative effects whatsoever.

Loading history...