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.Spotter.php'); |
||
4 | require_once('require/class.NOTAM.php'); |
||
5 | require_once('require/class.Language.php'); |
||
6 | $Spotter = new Spotter(); |
||
7 | $NOTAM = new NOTAM(); |
||
8 | $title = _("Parse NOTAM messages"); |
||
9 | require_once('header.php'); |
||
10 | |||
11 | $page_url = $globalURL.'/tools-notam'; |
||
12 | |||
13 | $message = filter_input(INPUT_POST,'notam_message',FILTER_SANITIZE_STRING); |
||
14 | |||
15 | print '<div class="info column">'; |
||
16 | print '<h1>'._("Parse NOTAM messages").'</h1>'; |
||
17 | print '</div>'; |
||
18 | |||
19 | print '<div class="table column">'; |
||
20 | print '<p>'._("Parse NOTAM messages and translate them in human readable format.").'</p>'; |
||
21 | print '<div class="pagination">'; |
||
22 | print '<form method="post">'; |
||
23 | print '<fieldset class="form-group">'; |
||
24 | print '<label for="notam_message">'._("NOTAM Message").'</label>'; |
||
25 | print '<textarea class="form-control" name="notam_message" id="notam_message" rows="5">'; |
||
26 | if ($message != '') print $message; |
||
27 | print '</textarea>'; |
||
28 | print '</fieldset>'; |
||
29 | print '<button type="submit" class="btn btn-primary">Submit</button>'; |
||
30 | print '</form>'; |
||
31 | if ($message != '') { |
||
32 | $globalDebug = FALSE; |
||
33 | $notam_parse = $NOTAM->parse($message); |
||
34 | if (!empty($notam_parse)) { |
||
35 | print '<p>'._("NOTAM message in human readable format:").'</p>'; |
||
36 | foreach ($notam_parse as $key => $value) { |
||
37 | print '<b>'.strtoupper(str_replace('_',' ',$key)).'</b>: '.$value.'<br />'; |
||
38 | } |
||
39 | } else { |
||
40 | print '<p>'._("This NOTAM message can't be translated in human readable format :(").'</p>'; |
||
41 | } |
||
42 | //var_dump($parsed_msg); |
||
43 | } |
||
44 | |||
45 | print '</div>'; |
||
46 | print '</div>'; |
||
47 | |||
48 | require_once('footer.php'); |
||
49 | ?> |
||
1 ignored issue
–
show
|
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.