2016-04-02 09:31:15 +00:00
< ? php
/////////////////////////////////////////////////////////////////////////////////////
// ADS-B RECEIVER PORTAL //
// =============================================================================== //
// Copyright and Licensing Information: //
// //
// The MIT License (MIT) //
// //
// Copyright (c) 2015-2016 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. //
/////////////////////////////////////////////////////////////////////////////////////
session_start ();
// Load the require PHP classes.
require_once ( $_SERVER [ 'DOCUMENT_ROOT' ] . DIRECTORY_SEPARATOR . " classes " . DIRECTORY_SEPARATOR . " settings.class.php " );
require_once ( $_SERVER [ 'DOCUMENT_ROOT' ] . DIRECTORY_SEPARATOR . " classes " . DIRECTORY_SEPARATOR . " common.class.php " );
require_once ( $_SERVER [ 'DOCUMENT_ROOT' ] . DIRECTORY_SEPARATOR . " classes " . DIRECTORY_SEPARATOR . " account.class.php " );
$settings = new settings ();
$common = new common ();
$account = new account ();
// Check if the user is logged in.
if ( ! $account -> isAuthenticated ()) {
// The user is not logged in so forward them to the login page.
header ( " Location: login.php " );
}
// Set updated variable to FALSE.
$updated = FALSE ;
if ( $common -> postBack ()) {
// Flight notifications
2016-12-05 19:37:59 +00:00
$flightNotificationArray = explode ( ',' , $_POST [ 'flightNotifications' ]);
2016-04-02 09:31:15 +00:00
if ( $settings :: db_driver == " xml " ) {
// XML
2016-12-05 19:37:59 +00:00
$flightNotifications = simplexml_load_file ( $_SERVER [ 'DOCUMENT_ROOT' ] . DIRECTORY_SEPARATOR . " data " . DIRECTORY_SEPARATOR . " flightNotifications.xml " );
unset ( $flightNotifications -> flight );
foreach ( $flightNotificationArray as $flightNotification ) {
$newFlightNotification = $flightNotifications -> addChild ( 'flight' , $flightNotification );
$dom = dom_import_simplexml ( $flightNotifications ) -> ownerDocument ;
2016-04-02 09:31:15 +00:00
$dom -> formatOutput = TRUE ;
2016-12-01 18:42:34 +00:00
file_put_contents ( $_SERVER [ 'DOCUMENT_ROOT' ] . DIRECTORY_SEPARATOR . " data " . DIRECTORY_SEPARATOR . " flightNotifications.xml " , $dom -> saveXML ());
2016-04-02 09:31:15 +00:00
}
} else {
// PDO
$dbh = $common -> pdoOpen ();
2016-12-01 18:42:34 +00:00
$sql = " SELECT * FROM " . $settings :: db_prefix . " flightNotifications " ;
2016-04-02 09:31:15 +00:00
$sth = $dbh -> prepare ( $sql );
$sth -> execute ();
$savedFlights = $sth -> fetchAll ();
$sth = NULL ;
$dbh = NULL ;
foreach ( $savedFlights as $flight ) {
// Remove flight if not in list.
if ( ! in_array ( $flight , $notificationArray )) {
$dbh = $common -> pdoOpen ();
2016-12-01 18:42:34 +00:00
$sql = " DELETE FROM " . $settings :: db_prefix . " flightNotifications WHERE flight = :flight " ;
2016-04-02 09:31:15 +00:00
$sth = $dbh -> prepare ( $sql );
$sth -> bindParam ( ':flight' , $flight [ 'flight' ], PDO :: PARAM_STR , 10 );
$sth -> execute ();
$sth = NULL ;
$dbh = NULL ;
}
}
2016-12-05 19:37:59 +00:00
foreach ( $flightNotificationArray as $flight ) {
2016-04-02 09:31:15 +00:00
// Add flight if not saved already.
if ( ! in_array ( $flight , $savedFlights )) {
$dbh = $common -> pdoOpen ();
2016-12-01 18:42:34 +00:00
$sql = " INSERT INTO " . $settings :: db_prefix . " flightNotifications (flight) VALUES (:flight) " ;
2016-04-02 09:31:15 +00:00
$sth = $dbh -> prepare ( $sql );
$sth -> bindParam ( ':flight' , $flight , PDO :: PARAM_STR , 10 );
$sth -> execute ();
$sth = NULL ;
$dbh = NULL ;
}
}
}
// Set TRUE or FALSE for checkbox items.
$enableFlights = FALSE ;
if ( isset ( $_POST [ 'enableFlights' ]) && $_POST [ 'enableFlights' ] == " TRUE " )
$enableFlights = TRUE ;
$enableBlog = FALSE ;
if ( isset ( $_POST [ 'enableBlog' ]) && $_POST [ 'enableBlog' ] == " TRUE " )
$enableBlog = TRUE ;
$enableInfo = FALSE ;
if ( isset ( $_POST [ 'enableInfo' ]) && $_POST [ 'enableInfo' ] == " TRUE " )
$enableInfo = TRUE ;
$enableGraphs = FALSE ;
if ( isset ( $_POST [ 'enableGraphs' ]) && $_POST [ 'enableGraphs' ] == " TRUE " )
$enableGraphs = TRUE ;
2016-10-11 18:47:45 +00:00
$enableLinks = FALSE ;
if ( isset ( $_POST [ 'enableLinks' ]) && $_POST [ 'enableLinks' ] == " TRUE " )
$enableLinks = TRUE ;
2016-04-02 09:31:15 +00:00
$enableDump1090 = FALSE ;
if ( isset ( $_POST [ 'enableDump1090' ]) && $_POST [ 'enableDump1090' ] == " TRUE " )
$enableDump1090 = TRUE ;
$enableDump978 = FALSE ;
if ( isset ( $_POST [ 'enableDump978' ]) && $_POST [ 'enableDump978' ] == " TRUE " )
$enableDump978 = TRUE ;
$enablePfclient = FALSE ;
if ( isset ( $_POST [ 'enablePfclient' ]) && $_POST [ 'enablePfclient' ] == " TRUE " )
$enablePfclient = TRUE ;
$enableFlightAwareLink = FALSE ;
if ( isset ( $_POST [ 'enableFlightAwareLink' ]) && $_POST [ 'enableFlightAwareLink' ] == " TRUE " )
$enableFlightAwareLink = TRUE ;
$enablePlaneFinderLink = FALSE ;
if ( isset ( $_POST [ 'enablePlaneFinderLink' ]) && $_POST [ 'enablePlaneFinderLink' ] == " TRUE " )
$enablePlaneFinderLink = TRUE ;
$enableFlightRadar24Link = FALSE ;
if ( isset ( $_POST [ 'enableFlightRadar24Link' ]) && $_POST [ 'enableFlightRadar24Link' ] == " TRUE " )
$enableFlightRadar24Link = TRUE ;
$enableAdsbExchangeLink = FALSE ;
if ( isset ( $_POST [ 'enableAdsbExchangeLink' ]) && $_POST [ 'enableAdsbExchangeLink' ] == " TRUE " )
$enableAdsbExchangeLink = TRUE ;
2016-09-23 19:15:54 +00:00
$enableWebNotifications = FALSE ;
if ( isset ( $_POST [ 'enableWebNotifications' ]) && $_POST [ 'enableWebNotifications' ] == " TRUE " )
$enableWebNotifications = TRUE ;
2018-03-22 18:31:02 +00:00
$hideNavbarAndFooter = FALSE ;
if ( isset ( $_POST [ 'hideNavbarAndFooter' ]) && $_POST [ 'hideNavbarAndFooter' ] == " TRUE " )
$hideNavbarAndFooter = TRUE ;
2016-04-02 09:31:15 +00:00
// Update settings using those supplied by the form.
$common -> updateSetting ( " siteName " , $_POST [ 'siteName' ]);
$common -> updateSetting ( " template " , $_POST [ 'template' ]);
$common -> updateSetting ( " defaultPage " , $_POST [ 'defaultPage' ]);
$common -> updateSetting ( " dateFormat " , $_POST [ 'dateFormat' ]);
2016-04-12 10:59:05 +00:00
$common -> updateSetting ( " enableFlights " , $enableFlights );
2016-04-02 09:31:15 +00:00
$common -> updateSetting ( " enableBlog " , $enableBlog );
$common -> updateSetting ( " enableInfo " , $enableInfo );
$common -> updateSetting ( " enableGraphs " , $enableGraphs );
2016-10-11 18:47:45 +00:00
$common -> updateSetting ( " enableLinks " , $enableLinks );
2016-04-02 09:31:15 +00:00
$common -> updateSetting ( " enableDump1090 " , $enableDump1090 );
$common -> updateSetting ( " enableDump978 " , $enableDump978 );
$common -> updateSetting ( " enablePfclient " , $enablePfclient );
$common -> updateSetting ( " enableFlightAwareLink " , $enableFlightAwareLink );
$common -> updateSetting ( " flightAwareLogin " , $_POST [ 'flightAwareLogin' ]);
$common -> updateSetting ( " flightAwareSite " , $_POST [ 'flightAwareSite' ]);
$common -> updateSetting ( " enablePlaneFinderLink " , $enablePlaneFinderLink );
$common -> updateSetting ( " planeFinderReceiver " , $_POST [ 'planeFinderReceiver' ]);
$common -> updateSetting ( " enableFlightRadar24Link " , $enableFlightRadar24Link );
$common -> updateSetting ( " flightRadar24Id " , $_POST [ 'flightRadar24Id' ]);
$common -> updateSetting ( " enableAdsbExchangeLink " , $enableAdsbExchangeLink );
$common -> updateSetting ( " measurementRange " , $_POST [ 'measurementRange' ]);
$common -> updateSetting ( " measurementTemperature " , $_POST [ 'measurementTemperature' ]);
2016-04-02 10:02:20 +00:00
$common -> updateSetting ( " measurementBandwidth " , $_POST [ 'measurementBandwidth' ]);
2016-04-02 09:31:15 +00:00
$common -> updateSetting ( " networkInterface " , $_POST [ 'networkInterface' ]);
2016-04-27 21:01:54 +00:00
$common -> updateSetting ( " timeZone " , $_POST [ 'timeZone' ]);
2016-09-23 19:15:54 +00:00
$common -> updateSetting ( " enableWebNotifications " , $enableWebNotifications );
2016-10-11 15:29:32 +00:00
$common -> updateSetting ( " googleMapsApiKey " , $_POST [ 'googleMapsApiKey' ]);
2018-03-22 18:31:02 +00:00
$common -> updateSetting ( " hideNavbarAndFooter " , $hideNavbarAndFooter );
2016-04-02 09:31:15 +00:00
2016-04-03 00:08:23 +00:00
// Purge older flight positions.
if ( isset ( $_POST [ 'purgepositions' ])) {
$dbh = $common -> pdoOpen ();
$sql = " DELETE FROM " . $settings :: db_prefix . " positions WHERE time < :purgeDate " ;
$sth = $dbh -> prepare ( $sql );
$sth -> bindParam ( ':purgeDate' , $_POST [ 'purgepositionspicker' ], PDO :: PARAM_STR , 100 );
$sth -> execute ();
$sth = NULL ;
$dbh = NULL ;
}
2016-04-02 09:31:15 +00:00
// Set updated to TRUE since settings were updated.
$updated = TRUE ;
}
2016-09-20 18:28:41 +00:00
// Get notification settings.
2016-12-05 19:37:59 +00:00
$flightNotifications = NULL ;
2016-04-02 09:31:15 +00:00
$savedFlights = array ();
if ( $settings :: db_driver == " xml " ) {
// XML
2016-12-05 19:37:59 +00:00
$savedFlights = simplexml_load_file ( $_SERVER [ 'DOCUMENT_ROOT' ] . DIRECTORY_SEPARATOR . " data " . DIRECTORY_SEPARATOR . " flightNotifications.xml " );
2016-04-02 09:31:15 +00:00
foreach ( $savedFlights as $savedFlight ) {
2016-12-05 20:46:25 +00:00
$flightNotifications = ltrim ( $flightNotifications . " , " . $savedFlight , ',' );
2016-04-02 09:31:15 +00:00
}
} else {
//PDO
$dbh = $common -> pdoOpen ();
2016-12-05 19:37:59 +00:00
$sql = " SELECT * FROM " . $settings :: db_prefix . " flightNotifications " ;
2016-04-02 09:31:15 +00:00
$sth = $dbh -> prepare ( $sql );
$sth -> execute ();
$savedFlights = $sth -> fetchAll ();
$sth = NULL ;
$dbh = NULL ;
foreach ( $savedFlights as $savedFlight ) {
2016-12-05 19:37:59 +00:00
$flightNotifications = ltrim ( $flightNotifications . " , " . $savedFlight [ 'flight' ], ',' );
2016-04-02 09:31:15 +00:00
}
}
2016-09-23 19:15:54 +00:00
$enableWebNotifications = $common -> getSetting ( " enableWebNotifications " );
2016-04-02 09:31:15 +00:00
// Get general settings from settings.xml.
$siteName = $common -> getSetting ( " siteName " );
$currentTemplate = $common -> getSetting ( " template " );
$defaultPage = $common -> getSetting ( " defaultPage " );
$dateFormat = $common -> getSetting ( " dateFormat " );
2016-04-27 21:01:54 +00:00
$timeZone = $common -> getSetting ( " timeZone " );
2016-10-11 15:29:32 +00:00
$googleMapsApiKey = $common -> getSetting ( " googleMapsApiKey " );
2016-04-02 09:31:15 +00:00
// Get navigation settings from settings.xml.
$enableFlights = $common -> getSetting ( " enableFlights " );
$enableBlog = $common -> getSetting ( " enableBlog " );
$enableInfo = $common -> getSetting ( " enableInfo " );
$enableGraphs = $common -> getSetting ( " enableGraphs " );
2016-10-11 18:47:45 +00:00
$enableLinks = $common -> getSetting ( " enableLinks " );
2016-04-02 09:31:15 +00:00
$enableDump1090 = $common -> getSetting ( " enableDump1090 " );
$enableDump978 = $common -> getSetting ( " enableDump978 " );
$enablePfclient = $common -> getSetting ( " enablePfclient " );
2018-03-22 18:31:02 +00:00
$hideNavbarAndFooter = $common -> getSetting ( " hideNavbarAndFooter " );
2016-04-02 09:31:15 +00:00
// Get aggregate site settings from settings.xml.
$enableFlightAwareLink = $common -> getSetting ( " enableFlightAwareLink " );
$flightAwareLogin = $common -> getSetting ( " flightAwareLogin " );
$flightAwareSite = $common -> getSetting ( " flightAwareSite " );
$enablePlaneFinderLink = $common -> getSetting ( " enablePlaneFinderLink " );
$planeFinderReceiver = $common -> getSetting ( " planeFinderReceiver " );
$enableFlightRadar24Link = $common -> getSetting ( " enableFlightRadar24Link " );
$flightRadar24Id = $common -> getSetting ( " flightRadar24Id " );
$enableAdsbExchangeLink = $common -> getSetting ( " enableAdsbExchangeLink " );
// Get units of measurement setting from settings.xml.
$measurementRange = $common -> getSetting ( " measurementRange " );
$measurementTemperature = $common -> getSetting ( " measurementTemperature " );
2016-04-02 10:02:20 +00:00
$measurementBandwidth = $common -> getSetting ( " measurementBandwidth " );
2016-04-02 09:31:15 +00:00
// Get the network interface from settings.xml.
$networkInterface = $common -> getSetting ( " networkInterface " );
// Create an array of all directories in the template folder.
$templates = array ();
$path = " ../templates/ " ;
$directoryHandle = @ opendir ( $path ) or die ( 'Unable to open directory "' . $path . '".' );
while ( $templateDirectory = readdir ( $directoryHandle )) {
if ( is_dir ( $path . " / " . $templateDirectory )) {
if ( $templateDirectory != " . " && $templateDirectory != " .. " ) {
array_push ( $templates , $templateDirectory );
}
}
}
closedir ( $directoryHandle );
2016-04-25 20:55:22 +00:00
// Function used to format offsets of timezones.
function formatOffset ( $offset ) {
return sprintf ( '%+03d:%02u' , floor ( $offset / 3600 ), floor ( abs ( $offset ) % 3600 / 60 ));
}
$utc = new DateTimeZone ( 'UTC' );
$dt = new DateTime ( 'now' , $utc );
2016-04-02 09:31:15 +00:00
////////////////
// BEGIN HTML
2016-12-05 18:08:58 +00:00
require_once ( $_SERVER [ 'DOCUMENT_ROOT' ] . DIRECTORY_SEPARATOR . " admin " . DIRECTORY_SEPARATOR . " includes " . DIRECTORY_SEPARATOR . " header.inc.php " );
2016-04-02 09:31:15 +00:00
// Display the updated message if settings were updated.
if ( $updated ) {
?>
< div id = " settings-saved " class = " alert alert-success fade in " role = " alert " >
< button type = " button " class = " close " data - dismiss = " alert " aria - label = " Close " >
< span aria - hidden = " true " >& times ; </ span >
</ button >
Settings have been updated .
</ div >
< ? php
}
?>
< form method = " post " action = " index.php " >
< ul class = " nav nav-tabs " role = " tablist " >
< li role = " presentation " class = " active " >< a href = " #general " aria - controls = " general " role = " tab " data - toggle = " tab " > General </ a ></ li >
< li role = " presentation " >< a href = " #notifications " aria - controls = " notifications " role = " tab " data - toggle = " tab " > Notifications </ a ></ li >
< li role = " presentation " >< a href = " #navigation " aria - controls = " navigation " role = " tab " data - toggle = " tab " > Navigation </ a ></ li >
2017-10-02 19:36:29 +00:00
< li role = " presentation " >< a href = " #measurements " aria - controls = " measurements " role = " tab " data - toggle = " tab " > Measurements </ a ></ li >
2016-04-02 09:31:15 +00:00
< li role = " presentation " >< a href = " #system " aria - controls = " system " role = " tab " data - toggle = " tab " > System </ a ></ li >
2016-04-03 00:08:23 +00:00
< li role = " presentation " >< a href = " #maintenance " aria - controls = " maintenance " role = " tab " data - toggle = " tab " > Maintenance </ a ></ li >
2016-04-02 09:31:15 +00:00
</ ul >
< div class = " padding " ></ div >
< div class = " tab-content " >
< div role = " tabpanel " class = " tab-pane fade in active " id = " general " >
< div class = " panel panel-default " >
< div class = " panel-heading " > Site Layout </ div >
< div class = " panel-body " >
< div class = " form-group " >
< label for = " siteName " > Site Name </ label >
< input type = " text " class = " form-control " id = " siteName " name = " siteName " value = " <?php echo $siteName ; ?> " >
</ div >
< div class = " form-group " >
< label for = " template " > Template </ label >
< select class = " form-control " id = " template " name = " template " >
< ? php
foreach ( $templates as $template ) {
2016-04-03 00:08:23 +00:00
echo ' <option value="' . $template . '"' . ( $template == $currentTemplate ? ' selected' : '' ) . '>' . $template . '</option>' . " \n " ;
2016-04-02 09:31:15 +00:00
}
?>
</ select >
</ div >
< div class = " form-group " >
< label for = " defaultPage " > Default Page </ label >
< select class = " form-control " id = " defaultPage " name = " defaultPage " >
< option value = " blog.php " < ? php ( $defaultPage == " blog.php " ? print ' selected' : '' ); ?> >Blog</option>
< option value = " system.php " < ? php ( $defaultPage == " system.php " ? print ' selected' : '' ); ?> >System Information</option>
< option value = " graphs.php " < ? php ( $defaultPage == " graphs.php " ? print ' selected' : '' ); ?> >Performance Graphs</option>
< option value = " dump1090.php " < ? php ( $defaultPage == " dump1090.php " ? print ' selected' : '' ); ?> >Live Dump1090 Map</option>
< option value = " dump978.php " < ? php ( $defaultPage == " dump978.php " ? print ' selected' : '' ); ?> >Live Dump978 Map</option>
</ select >
</ div >
2016-10-28 19:26:05 +00:00
< div class = " form-group " >
< label for = " googleMapsApiKey " > Google Maps API Key </ label >
< input type = " text " class = " form-control " id = " googleMapsApiKey " name = " googleMapsApiKey " value = " <?php echo $googleMapsApiKey ; ?> " >
</ div >
</ div >
</ div >
< div class = " panel panel-default " >
< div class = " panel-heading " > Time Format </ div >
< div class = " panel-body " >
< div class = " form-group " >
< label for = " timeZone " > Time Zone </ label >
< select class = " form-control " id = " timeZone " name = " timeZone " >
< ? php
foreach ( DateTimeZone :: listIdentifiers () as $tz ) {
$currentTimeZone = new DateTimeZone ( $tz );
$offSet = $currentTimeZone -> getOffset ( $dt );
$transition = $currentTimeZone -> getTransitions ( $dt -> getTimestamp (), $dt -> getTimeStamp ());
$abbr = $transition [ 0 ][ 'abbr' ];
?>
< option name = " timeZone " value = " <?php echo $tz ; ?> " < ? php ( $tz == $timeZone ? print " selected " : " " ); ?> ><?php echo $tz; ?> [<?php echo $abbr; ?> <?php echo formatOffset($offSet);?>]</option>
< ? php
}
?>
</ select >
</ div >
2016-04-02 09:31:15 +00:00
< div class = " form-group " >
2016-10-27 16:42:53 +00:00
< label for = " defaultPage " > Date Format - 12 Hour Format </ label >
2016-04-02 09:31:15 +00:00
< div class = " radio " >
2016-10-27 16:42:53 +00:00
< label >< input type = " radio " name = " dateFormatSlelection " value = " F jS, Y g:i A " < ? php ( $dateFormat == " F jS, Y g:i A " ? print ' checked' : '' ); ?> >October 16, 2015 5:00 PM</label>
2016-04-02 09:31:15 +00:00
</ div >
< div class = " radio " >
2016-10-27 16:42:53 +00:00
< label >< input type = " radio " name = " dateFormatSlelection " value = " Y-m-d g:i A " < ? php ( $dateFormat == " Y-m-d g:i A " ? print ' checked' : '' ); ?> >2015-10-16 5:00 PM</label>
2016-04-02 09:31:15 +00:00
</ div >
< div class = " radio " >
2017-09-27 21:18:13 +00:00
< label >< input type = " radio " name = " dateFormatSlelection " value = " m/d/Y g:i A " < ? php ( $dateFormat == " m/d/Y g:i A " ? print ' checked' : '' ); ?> >10/16/2015 5:00 PM</label>
2016-04-02 09:31:15 +00:00
</ div >
< div class = " radio " >
2017-09-27 21:18:13 +00:00
< label >< input type = " radio " name = " dateFormatSlelection " value = " d/m/Y g:i A " < ? php ( $dateFormat == " d/m/Y g:i A " ? print ' checked' : '' ); ?> >16/10/2015 5:00 PM</label>
2016-10-27 16:42:53 +00:00
</ div >
< label for = " defaultPage " > Date Format - 24 Hour Format </ label >
< div class = " radio " >
< label >< input type = " radio " name = " dateFormatSlelection " value = " F jS, Y G:i " < ? php ( $dateFormat == " F jS, Y G:i " ? print ' checked' : '' ); ?> >October 16, 2015 17:00</label>
</ div >
< div class = " radio " >
< label >< input type = " radio " name = " dateFormatSlelection " value = " Y-m-d G:i " < ? php ( $dateFormat == " Y-m-d G:i " ? print ' checked' : '' ); ?> >2015-10-16 17:00</label>
</ div >
< div class = " radio " >
2017-09-27 21:18:13 +00:00
< label >< input type = " radio " name = " dateFormatSlelection " value = " m/d/Y G:i " < ? php ( $dateFormat == " m/d/Y G:i " ? print ' checked' : '' ); ?> >10/16/2015 17:00</label>
2016-10-27 16:42:53 +00:00
</ div >
< div class = " radio " >
2017-09-27 21:18:13 +00:00
< label >< input type = " radio " name = " dateFormatSlelection " value = " d/m/Y G:i " < ? php ( $dateFormat == " d/m/Y G:i " ? print ' checked' : '' ); ?> >16/10/2015 17:00</label>
2016-04-02 09:31:15 +00:00
</ div >
2016-10-28 19:26:05 +00:00
< label for = " dateFormat " > Date Format </ label >
2016-04-02 09:31:15 +00:00
< input type = " text " class = " form-control " id = " dateFormat " name = " dateFormat " value = " <?php echo $dateFormat ; ?> " >
2016-10-28 19:33:13 +00:00
< p >< i > Select one of the formats above or create your own . < a href = " http://php.net/manual/en/function.date.php " target = " _blank " > PHP date function documentation .</ a ></ i ></ p >
2016-04-02 09:31:15 +00:00
</ div >
</ div >
</ div >
</ div >
< div role = " tabpanel " class = " tab-pane fade " id = " notifications " >
< div class = " panel panel-default " >
< div class = " panel-heading " > Flight Notifications </ div >
< div class = " panel-body " >
2016-09-23 19:15:54 +00:00
< div class = " form-group " >
2016-12-05 19:37:59 +00:00
< label for = " flightNotifications " " >Flight names. (coma delimited)</label>
< input type = " text " class = " form-control " id = " flightNotifications " name = " flightNotifications " value = " <?php echo $flightNotifications ; ?> " >
2016-09-23 19:15:54 +00:00
</ div >
2016-04-02 09:31:15 +00:00
< div class = " checkbox " >
< label >
2016-09-23 19:15:54 +00:00
< input type = " checkbox " name = " enableWebNotifications " value = " TRUE " < ? php ( $enableWebNotifications == 1 ? print ' checked' : '' ); ?> > Enable web based flight notifications.
</ label >
</ div >
2016-04-02 09:31:15 +00:00
</ div >
</ div >
</ div >
< div role = " tabpanel " class = " tab-pane fade " id = " navigation " >
< div class = " panel panel-default " >
2018-03-22 18:31:02 +00:00
< div class = " panel-heading " > Navigation Settings </ div >
2016-04-02 09:31:15 +00:00
< div class = " panel-body " >
2018-03-22 18:31:02 +00:00
< div class = " checkbox " >
< label >
< input type = " checkbox " name = " hideNavbarAndFooter " value = " TRUE " < ? php ( $hideNavbarAndFooter == 1 ? print ' checked' : '' ); ?> > Enable navigation and footer auto hiding.
</ label >
</ div >
2018-03-23 18:24:52 +00:00
< br />
2016-04-02 09:31:15 +00:00
< div class = " checkbox " >
< label >
2016-04-13 16:51:04 +00:00
< input type = " checkbox " name = " enableFlights " value = " TRUE " < ? php ( $enableFlights == 1 ? print ' checked' : '' ); ?> <?php ($settings::db_driver == "xml" ? print ' disabled' : ''); ?>> Enable flights link.
2016-04-02 09:31:15 +00:00
</ label >
</ div >
< div class = " checkbox " >
< label >
2016-04-13 16:51:04 +00:00
< input type = " checkbox " name = " enableBlog " value = " TRUE " < ? php ( $enableBlog == 1 ? print ' checked' : '' ); ?> > Enable blog link.
2016-04-02 09:31:15 +00:00
</ label >
</ div >
< div class = " checkbox " >
< label >
2016-04-13 16:51:04 +00:00
< input type = " checkbox " name = " enableInfo " value = " TRUE " < ? php ( $enableInfo == 1 ? print ' checked' : '' ); ?> > Enable system information link.
2016-04-02 09:31:15 +00:00
</ label >
</ div >
< div class = " checkbox " >
< label >
2016-04-13 16:51:04 +00:00
< input type = " checkbox " name = " enableGraphs " value = " TRUE " < ? php ( $enableGraphs == 1 ? print ' checked' : '' ); ?> > Enable performance graphs link.
2016-04-02 09:31:15 +00:00
</ label >
</ div >
< div class = " checkbox " >
2016-10-11 18:47:45 +00:00
< label >
< input type = " checkbox " name = " enableLinks " value = " TRUE " < ? php ( $enableLinks == 1 ? print ' checked' : '' ); ?> > Enable custom links.
</ label >
</ div >
< div class = " checkbox " >
2016-04-02 09:31:15 +00:00
< label >
2016-04-13 16:51:04 +00:00
< input type = " checkbox " name = " enableDump1090 " value = " TRUE " < ? php ( $enableDump1090 == 1 ? print ' checked' : '' ); ?> > Enable live dump1090 map link.
2016-04-02 09:31:15 +00:00
</ label >
</ div >
< div class = " checkbox " >
< label >
2016-04-13 16:51:04 +00:00
< input type = " checkbox " name = " enableDump978 " value = " TRUE " < ? php ( $enableDump978 == 1 ? print ' checked' : '' ); ?> > Enable live dump978 map link.
2016-04-02 09:31:15 +00:00
</ label >
</ div >
< div class = " checkbox " >
< label >
2016-04-25 20:27:02 +00:00
< input type = " checkbox " name = " enablePfclient " value = " TRUE " < ? php ( $enablePfclient == 1 ? print ' checked' : '' ); ?> > Enable Planefinder ADS-B Client link.
2016-04-02 09:31:15 +00:00
</ label >
</ div >
</ div >
</ div >
< div class = " panel panel-default " >
< div class = " panel-heading " > Aggregate Site Settings </ div >
< div class = " panel-body " >
< div class = " form-group " >
< label for = " flightAwareLogin " > FlightAware Login </ label >
< input type = " text " class = " form-control " id = " flightAwareLogin " name = " flightAwareLogin " value = " <?php echo $flightAwareLogin ; ?> " >
< label for = " flightAwareSite " > FlightAware ADS - B Site </ label >
< input type = " text " class = " form-control " id = " flightAwareSite " name = " flightAwareSite " value = " <?php echo $flightAwareSite ; ?> " >
< div class = " checkbox " >
< label >
< input type = " checkbox " name = " enableFlightAwareLink " value = " TRUE " < ? php ( $enableFlightAwareLink == 1 ? print ' checked' : '' ); ?> > Enable FlightAware Statistics Link.
</ label >
</ div >
</ div >
< hr />
< div class = " form-group " >
< label for = " planeFinderReceiver " > PlaneFinder Receiver Number </ label >
< input type = " text " class = " form-control " id = " planeFinderReceiver " name = " planeFinderReceiver " value = " <?php echo $planeFinderReceiver ; ?> " >
< div class = " checkbox " >
< label >
< input type = " checkbox " name = " enablePlaneFinderLink " value = " TRUE " < ? php ( $enablePlaneFinderLink == 1 ? print ' checked' : '' ); ?> > Enable PlaneFinder Statistics Link.
</ label >
</ div >
</ div >
< hr />
< div class = " form-group " >
< label for = " flightRadar24FeedStatsId " > FlightRadar24 Feed Stats ID </ label >
< input type = " text " class = " form-control " id = " flightRadar24Id " name = " flightRadar24Id " value = " <?php echo $flightRadar24Id ; ?> " >
< div class = " checkbox " >
< label >
< input type = " checkbox " name = " enableFlightRadar24Link " value = " TRUE " < ? php ( $enableFlightRadar24Link == 1 ? print ' checked' : '' ); ?> > Enable FlightRadar24 Statistics Link.
</ label >
</ div >
</ div >
< hr />
< div class = " form-group " >
< div class = " checkbox " >
< label >
< input type = " checkbox " name = " enableAdsbExchangeLink " value = " TRUE " < ? php ( $enableAdsbExchangeLink == 1 ? print ' checked' : '' ); ?> > Enable ADSB-Exchange Link.
</ label >
</ div >
</ div >
</ div >
</ div >
</ div >
2017-10-02 19:36:29 +00:00
< div role = " tabpanel " class = " tab-pane fade " id = " measurements " >
2016-04-02 09:31:15 +00:00
< div class = " panel panel-default " >
< div class = " panel-heading " > Unit of Measurement ( Range ) </ div >
< div class = " panel-body " >
< div class = " btn-group " data - toggle = " buttons " >
< label class = " btn btn-default<?php ( $measurementRange == " imperialNautical " ? print ' active' : ''); ?> " >
< input type = " radio " name = " measurementRange " id = " imperialNautical " value = " imperialNautical " autocomplete = " off " < ? php ( $measurementRange == " imperialNautical " ? print ' checked' : '' ); ?> > Imperial (Nautical Miles)
</ label >
< label class = " btn btn-default<?php ( $measurementRange == " imperialStatute " ? print ' active' : ''); ?> " >
< input type = " radio " name = " measurementRange " id = " imperialStatute " value = " imperialStatute " autocomplete = " off " < ? php ( $measurementRange == " imperialStatute " ? print ' checked' : '' ); ?> > Imperial (Statute Miles)
</ label >
< label class = " btn btn-default<?php ( $measurementRange == " metric " ? print ' active' : ''); ?> " >
< input type = " radio " name = " measurementRange " id = " metric " value = " metric " autocomplete = " off " < ? php ( $measurementRange == " metric " ? print ' checked' : '' ); ?> > Metric
</ label >
</ div >
</ div >
</ div >
< div class = " panel panel-default " >
< div class = " panel-heading " > Unit of Measurement ( Temperature ) </ div >
< div class = " panel-body " >
< div class = " btn-group " data - toggle = " buttons " >
< label class = " btn btn-default<?php ( $measurementTemperature == " imperial " ? print ' active' : ''); ?> " >
< input type = " radio " name = " measurementTemperature " id = " imperial " value = " imperial " autocomplete = " off " < ? php ( $measurementTemperature == " imperial " ? print ' checked' : '' ); ?> > Imperial
</ label >
< label class = " btn btn-default<?php ( $measurementTemperature == " metric " ? print ' active' : ''); ?> " >
< input type = " radio " name = " measurementTemperature " id = " metric " value = " metric " autocomplete = " off " < ? php ( $measurementTemperature == " metric " ? print ' checked' : '' ); ?> > Metric
</ label >
</ div >
</ div >
</ div >
2016-04-02 10:02:20 +00:00
< div class = " panel panel-default " >
< div class = " panel-heading " > Unit of Measurement ( Bandwidth ) </ div >
< div class = " panel-body " >
< div class = " btn-group " data - toggle = " buttons " >
< label class = " btn btn-default<?php ( $measurementBandwidth == " kbps " ? print ' active' : ''); ?> " >
< input type = " radio " name = " measurementBandwidth " id = " imperial " value = " kbps " autocomplete = " off " < ? php ( $measurementBandwidth == " kbps " ? print ' checked' : '' ); ?> > Kbps
</ label >
< label class = " btn btn-default<?php ( $measurementBandwidth == " mbps " ? print ' active' : ''); ?> " >
< input type = " radio " name = " measurementBandwidth " id = " metric " value = " mbps " autocomplete = " off " < ? php ( $measurementBandwidth == " mbps " ? print ' checked' : '' ); ?> > Mbps
</ label >
</ div >
</ div >
</ div >
2016-04-02 09:31:15 +00:00
</ div >
< div role = " tabpanel " class = " tab-pane fade " id = " system " >
< div class = " panel panel-default " >
< div class = " panel-heading " > Network Interface </ div >
< div class = " panel-body " >
< div class = " btn-group " data - toggle = " buttons " >
< label class = " btn btn-default<?php ( $networkInterface == " eth0 " ? print ' active' : ''); ?> " >
< input type = " radio " name = " networkInterface " id = " imperial " value = " eth0 " autocomplete = " off " < ? php ( $networkInterface == " eth0 " ? print ' checked' : '' ); ?> > eth0
</ label >
< label class = " btn btn-default<?php ( $networkInterface == " wlan0 " ? print ' active' : ''); ?> " >
< input type = " radio " name = " networkInterface " id = " metric " value = " wlan0 " autocomplete = " off " < ? php ( $networkInterface == " wlan0 " ? print ' checked' : '' ); ?> > wlan0
</ label >
</ div >
</ div >
</ div >
</ div >
2016-04-03 00:08:23 +00:00
< div role = " tabpanel " class = " tab-pane fade " id = " maintenance " >
< div class = " panel panel-default " >
< div class = " panel-heading " > Purge Positions </ div >
< div class = " panel-body " >
2016-05-03 20:50:08 +00:00
< p > Current Database Size : < ? php echo $common -> getDatabaseSize ( " mb " ); ?> MB</p>
2016-04-03 00:08:23 +00:00
< div class = " form-group " >
< label for = " purgepositionspicker " > Purge flight positions old than ...</ label >< br />
< input type = " text " class = " form-control " id = " purgepositionspicker " name = " purgepositionspicker " autocomplete = " off " < ? php ( $settings :: db_driver == " xml " ? print ' disabled' : '' ); ?> >
</ div >
< div class = " checkbox " >
< label >
< input type = " checkbox " name = " purgepositions " value = " purge " < ? php ( $settings :: db_driver == " xml " ? print ' disabled' : '' ); ?> > Check to confirm purge of data.
</ label >
</ div >
< script type = " text/javascript " >
jQuery ( '#purgepositionspicker' ) . datetimepicker ({
inline : true
});
</ script >
</ div >
</ div >
</ div >
2016-04-02 09:31:15 +00:00
</ div >
< input type = " submit " class = " btn btn-default " value = " Save Settings " >
</ form >
< ? php
2016-12-05 18:08:58 +00:00
require_once ( $_SERVER [ 'DOCUMENT_ROOT' ] . DIRECTORY_SEPARATOR . " admin " . DIRECTORY_SEPARATOR . " includes " . DIRECTORY_SEPARATOR . " footer.inc.php " );
2016-04-12 10:59:05 +00:00
?>