<?php 

/**
 * Shared project header
 * 
 * @category    Webserver
 * @package     ATProcessor
 * @author      Sam Meredith <sam@aandtinstruments.com>
 * @version     0.2
 */

/**
 * Includes
 */
require_once "atp.database.php";
require_once "atp.fields.php";

/**
 * The release version and date
 */
define('VERSION_NUMBER', "2.18.4");
define('VERSION_DATE', "Thurs, 2 July 2026");

// Set the default timezone for local time conversion
date_default_timezone_set('UTC');

$recovery = false;
// If we can't read the database for any reason, redirect to the saved configurations page
if ( !databaseIsReadable() )
{
	if ( basename($_SERVER['PHP_SELF']) != 'settings.php' ) {
		header('Location: /settings.php');
		$recovery = true;
	}
}
?>

<!DOCTYPE HTML>
<html>
    <head>
        <title>A+T Processor</title>
		<meta charset="UTF-8">
		<meta name="description" content="ATP1 Webserver">
		<meta name="author" content="Sam Meredith">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">

        <link rel="stylesheet" href="/css/normalize.css?v=<?php echo VERSION_NUMBER?>">
		<link rel="stylesheet" href="/css/jquery-ui.min.css?v=<?php echo VERSION_NUMBER?>">
		<link rel="stylesheet" href="/css/jquery-ui.structure.min.css?v=<?php echo VERSION_NUMBER?>">
		<link rel="stylesheet" href="/css/jquery-ui.theme.min.css?v=<?php echo VERSION_NUMBER?>">
        <link rel="stylesheet" href="/css/all.min.css?v=<?php echo VERSION_NUMBER?>">
        <link rel="stylesheet" href="/css/atp.webserver.css?v=<?php echo VERSION_NUMBER?>">
        
        <script type="text/javascript" src="/js/jquery.min.js?v=<?php echo VERSION_NUMBER?>"></script>
        <script type="text/javascript" src="/js/jquery-ui.min.js?v=<?php VERSION_NUMBER?>"></script>
		<script type="text/javascript" src="/js/atp.database.js?v=<?php echo VERSION_NUMBER?>"></script>
        <script type="text/javascript" src="/js/atp.navigation-bar.js?v=<?php echo VERSION_NUMBER?>"></script>
		<script type="text/javascript" src="/js/atp.fields.js?v=<?php echo VERSION_NUMBER?>" defer></script>
        <script type="text/javascript" src="/js/atp.model.js?v=<?php echo VERSION_NUMBER?>" defer></script>
        <script type="text/javascript" src="/js/atp.view.js?v=<?php echo VERSION_NUMBER?>" defer></script>
		<script type="text/javascript" src="/js/atp.controller.js?v=<?php echo VERSION_NUMBER?>" defer></script>
		<script type="text/javascript" src="/js/atp.protocol.js?v=<?php echo VERSION_NUMBER?>" defer></script>
		<script type="text/javascript" src="/js/utils.validation.js?v=<?php echo VERSION_NUMBER?>" defer></script>
    </head>

    <body id="atp-webserver">
		<header id="atp-header">
            <!--Logo-->
			<div class="site-title">
				<a href="home.php" id="home">
					A+T Instruments
				</a>
			</div>
            <!--Navigation Bar-->
            <div class="nav-container">
				<nav class="nav">
					<button class="hidden"><div class="hamburger"></div></button>
					<ul class="visible-links">
						<li>
							<a href="/speedLog.php?src=0" id="speed">
								Speed/Current
							</a>
						</li>
						<li>
							<a href="/position.php" id="position">
								Position/Attitude
							</a>
						</li>
						<li>
							<a href="/depth.php?src=0" id="depth">
								Depth
							</a>
						</li>
						<li>
							<a href="/windMeasured.php?src=0" id="wind">
								Wind
							</a>
						</li>
						<li>
							<a href="/analogue.php" id="other-data">
								Other Data
							</a>
						</li>
						<li>
							<a href="/dataPages.php" id="display">
								Display
							</a>
						</li>
						<li>
							<a href="/networkAddress.php" id="settings">
								Settings/Diagnostics
							</a>
						</li>
					</ul>
					<ul class="hidden-links hidden"></ul>
				</nav>
			</div>
		</header>
        <div class="sub-bar"></div>
        
        <div class="main-wrapper" id="atp-main">

		<div id="dialog" title="">
			<div id="dialog-text"></div>
			<div class="progress-bar" id="progressBar"></div>
		</div>

		<section name="sidebar" class="sidebar shadow"></section>

    <!-- Content Follows -->
