-
Notifications
You must be signed in to change notification settings - Fork 158
/
acars-archive.php
45 lines (41 loc) · 1.53 KB
/
acars-archive.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
<?php
require_once('require/class.Connection.php');
require_once('require/class.ACARS.php');
require_once('require/class.Language.php');
$ACARS = new ACARS();
$title = _("Archived ACARS messages");
require_once('header.php');
$page_url = $globalURL.'/acars-archive';
if(!isset($_GET['limit']))
{
$limit_start = 0;
$limit_end = 25;
} else {
$limit_explode = explode(",", $_GET['limit']);
$limit_start = $limit_explode[0];
$limit_end = $limit_explode[1];
if (!ctype_digit(strval($limit_start)) || !ctype_digit(strval($limit_end))) {
$limit_start = 0;
$limit_end = 25;
}
}
$absolute_difference = abs($limit_start - $limit_end);
$limit_next = $limit_end + $absolute_difference;
$limit_previous_1 = $limit_start - $absolute_difference;
$limit_previous_2 = $limit_end - $absolute_difference;
print '<div class="info column">';
print '<h1>'._("Archived ACARS messages").'</h1>';
print '</div>';
print '<div class="table column">';
print '<p>'._("The table below shows the archived ACARS messages.").'</p>';
$spotter_array = $ACARS->getArchiveAcarsData($limit_start.",".$absolute_difference);
if (!empty($spotter_array)) {
include('table-output.php');
print '<div class="pagination">';
if ($limit_previous_1 >= 0) print '<a href="'.$page_url.'/'.$limit_previous_1.','.$limit_previous_2.'">«'._("Previous Page").'</a>';
if ($spotter_array[0]['query_number_rows'] == $absolute_difference) print '<a href="'.$page_url.'/'.$limit_end.','.$limit_next.'">'._("Next Page").'»</a>';
print '</div>';
}
print '</div>';
require_once('footer.php');
?>