Removed old portal files.

portal
jprochazka 2024-08-22 10:50:26 -04:00
rodzic d17a6bca0c
commit 554ce74784
5 zmienionych plików z 0 dodań i 250 usunięć

Wyświetl plik

@ -1,32 +0,0 @@
<?php
// Start session
session_start();
// Load the common PHP classes.
require_once('classes/common.class.php');
require_once('classes/template.class.php');
require_once('classes/acars.class.php');
$common = new common();
$template = new template();
$acars = new acars();
$pageData = array();
// The title of this page.
$pageData['title'] = "ACARS Messages";
// Pagination.
$items_per_page = 15;
$page = (isset($_GET['page']) ? $_GET['page'] : 1);
$message_count = $acars->getAcarsMessageCount();
// Get most recent ACARS messages.
$messages = $acars->getAcarsMessages($items_per_page, ($items_per_page * $page));
$pageData['acarsMessages'] = $messages;
// Calculate the number of pagination links to show.
$pageData['pageLinks'] = ceil($message_count / $items_per_page);
$template->display($pageData);
?>

Wyświetl plik

@ -1,40 +0,0 @@
<?php
class acars {
function getAcarsMessages($limit = 100, $offset = 0) {
require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."common.class.php");
$common = new common();
$dsn = "sqlite:".$common->getSetting('acarsserv_database');
$dbh = new PDO($dsn, null, null, [PDO::SQLITE_ATTR_OPEN_FLAGS => PDO::SQLITE_OPEN_READONLY]);
$sql = "SELECT * FROM Messages JOIN Flights USING(FlightID) JOIN Stations USING(StID) ORDER BY LastTime DESC LIMIT :limit OFFSET :offset";
$sth = $dbh->prepare($sql);
$sth->bindValue(':limit', $limit);
$sth->bindValue(':offset', $offset);
$sth->execute();
$acarsMessages = $sth->fetchAll(PDO::FETCH_ASSOC);
$sth = NULL;
$dbh = NULL;
$dsn = NULL;
return $acarsMessages;
}
function getAcarsMessageCount() {
require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."common.class.php");
$common = new common();
$dsn = "sqlite:".$common->getSetting('acarsserv_database');
$dbh = new PDO($dsn, null, null, [PDO::SQLITE_ATTR_OPEN_FLAGS => PDO::SQLITE_OPEN_READONLY]);
$sql = "SELECT COUNT(*) FROM Messages";
$sth = $dbh->prepare($sql);
$sth->execute();
$number_of_rows = $sth->fetchColumn();
$sth = NULL;
$dbh = NULL;
$dsn = NULL;
return $number_of_rows;
}
}
?>

Wyświetl plik

@ -1,68 +0,0 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015 Joseph A. Prochazka //
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy //
// of this software and associated documentation files (the "Software"), to deal //
// in the Software without restriction, including without limitation the rights //
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell //
// copies of the Software, and to permit persons to whom the Software is //
// furnished to do so, subject to the following conditions: //
// //
// The above copyright notice and this permission notice shall be included in all //
// copies or substantial portions of the Software. //
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR //
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, //
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE //
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER //
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, //
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE //
// SOFTWARE. //
/////////////////////////////////////////////////////////////////////////////////////
///////////////////////
// UPGRADE TO V2.8.5
///////////////////////
// --------------------------------------------------------
// Updates the version setting to 2.8.5.
// --------------------------------------------------------
$results = upgrade();
exit(json_encode($results));
function upgrade() {
require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."common.class.php");
require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."settings.class.php");
$common = new common();
$settings = new settings();
try {
// Update the version and patch settings..
$common->updateSetting("version", "2.8.5");
$common->updateSetting("patch", "");
// The upgrade process completed successfully.
$results['success'] = TRUE;
$results['message'] = "Upgrade to v2.8.5 successful.";
return $results;
} catch(Exception $e) {
// Something went wrong during this upgrade process.
$results['success'] = FALSE;
$results['message'] = $e->getMessage();
return $results;
}
}
?>

Wyświetl plik

@ -1,72 +0,0 @@
<?php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015 Joseph A. Prochazka //
// //
// Permission is hereby granted, free of charge, to any person obtaining a copy //
// of this software and associated documentation files (the "Software"), to deal //
// in the Software without restriction, including without limitation the rights //
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell //
// copies of the Software, and to permit persons to whom the Software is //
// furnished to do so, subject to the following conditions: //
// //
// The above copyright notice and this permission notice shall be included in all //
// copies or substantial portions of the Software. //
// //
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR //
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, //
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE //
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER //
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, //
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE //
// SOFTWARE. //
/////////////////////////////////////////////////////////////////////////////////////
///////////////////////
// UPGRADE TO V2.8.6
///////////////////////
// --------------------------------------------------------
// Updates the version setting to 2.8.6
// --------------------------------------------------------
$results = upgrade();
exit(json_encode($results));
function upgrade() {
require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."common.class.php");
require_once($_SERVER['DOCUMENT_ROOT'].DIRECTORY_SEPARATOR."classes".DIRECTORY_SEPARATOR."settings.class.php");
$common = new common();
$settings = new settings();
try {
// Add enable ACARS setting
$common->addSetting('enableAcars', FALSE);
$common->addSetting('acarsserv_database', "");
// Update the version and patch settings
$common->updateSetting("version", "2.8.6");
$common->updateSetting("patch", "");
// The upgrade process completed successfully
$results['success'] = TRUE;
$results['message'] = "Upgrade to v2.8.6 successful.";
return $results;
} catch(Exception $e) {
// Something went wrong during this upgrade process
$results['success'] = FALSE;
$results['message'] = $e->getMessage();
return $results;
}
}
?>

Wyświetl plik

@ -1,38 +0,0 @@
{area:head/}
{area:contents}
<div class="container">
<h1>ACARS Messages</h1>
<hr />
{foreach page:acarsMessages as message}
<h2>{message->FlightNumber}</h2>
<p>
Aircarft Registration: {message->Registration}<br/>
The first message was received on {message->StartTime} with the last seen {message->LastTime}.<br/>
A total of {message->NbMessages} messages have been received by this flight.
</p>
<div>
<ul>
<li>Time: {message->Time}</li>
<li>Station ID: {message->IdStation}</li>
<li>Channel: {message->Channel}</li>
<li>Error: {message->Error}</li>
<li>Signal Level: {message->SignalLvl}</li>
<li>Mode: {message->Mode}</li>
<li>Ack: {message->Ack}</li>
<li>Label: {message->Label}</li>
<li>Block Number: {message->BlockNo}</li>
<li>Mesage Number: {message->MessNo}</li>
<li>Text: {message->Txt}</li>
</ul>
</div>
{/foreach}
<ul class="pagination">
{for pageNumber eq 1 to page:pageLinks}
<li><a href="acars.php?page={pageNumber}">{pageNumber}</a></li>
{/for}
</ul>
</div>
{/area}
{area:scripts}
<script type="text/javascript" src="https://www.gstatic.com/charts/loader.js"></script>
{/area}