Compare commits

...

4 Commits

Author SHA1 Message Date
55b3fbfc63 TZ changes from prod 2025-06-01 07:18:11 +00:00
c4cfb43edc ICAO and IATA code lookup 2025-04-15 17:13:47 +00:00
31c1172e08 Add bookout system POC 2025-04-15 16:21:23 +00:00
94010fec01 Dave's public board 2025-04-07 16:27:01 +00:00
13 changed files with 555 additions and 40 deletions

View File

@@ -297,7 +297,7 @@ function opDetail() {
echo '<tr><th>Captain</th><td><button class="edit-button" onclick="editField(this)"><img src="assets/edit.png" alt="Edit"></button></td><td><input type="text" class="editable" data-column="captain" value="' . $row['captain'] . '" readonly></td></tr>'; echo '<tr><th>Captain</th><td><button class="edit-button" onclick="editField(this)"><img src="assets/edit.png" alt="Edit"></button></td><td><input type="text" class="editable" data-column="captain" value="' . $row['captain'] . '" readonly></td></tr>';
echo '<tr><th>Arriving From:</th><td><button class="edit-button" onclick="editField(this)"><img src="assets/edit.png" alt="Edit"></button></td><td><span class="editable" data-column="in_from">' . $row['in_from'] . '</span></td></tr>'; echo '<tr><th>Arriving From:</th><td><button class="edit-button" onclick="editField(this)"><img src="assets/edit.png" alt="Edit"></button></td><td><span class="editable" data-column="in_from">' . $row['in_from'] . '</span></td></tr>';
echo '<tr><th>POB IN</th><td><button class="edit-button" onclick="editField(this)"><img src="assets/edit.png" alt="Edit"></button></td><td><input type="number" class="editable" data-column="pob_in" value="' . $row['pob_in'] . '" readonly></td></tr>'; echo '<tr><th>POB IN</th><td><button class="edit-button" onclick="editField(this)"><img src="assets/edit.png" alt="Edit"></button></td><td><input type="number" class="editable" data-column="pob_in" value="' . $row['pob_in'] . '" readonly></td></tr>';
echo '<tr><th>ETA</th><td><button class="edit-button" onclick="editField(this)"><img src="assets/edit.png" alt="Edit"></button></td><td><input type="datetime-local" class="editable" data-column="eta" value="' . ($row['eta'] ? date('Y-m-d\TH:i', strtotime($row['eta'])) : '') . '" readonly></td></tr>'; echo '<tr><th>ETA Z</th><td><button class="edit-button" onclick="editField(this)"><img src="assets/edit.png" alt="Edit"></button></td><td><input type="datetime-local" class="editable" data-column="eta" value="' . ($row['eta'] ? date('Y-m-d\TH:i', strtotime($row['eta'])) : '') . '" readonly></td></tr>';
echo '<tr><th>Fuel</th><td><button class="edit-button" onclick="editField(this)"><img src="assets/edit.png" alt="Edit"></button></td><td><select class="editable" data-column="fuel" onchange="this.blur()" disabled>'; echo '<tr><th>Fuel</th><td><button class="edit-button" onclick="editField(this)"><img src="assets/edit.png" alt="Edit"></button></td><td><select class="editable" data-column="fuel" onchange="this.blur()" disabled>';
echo '<option value="None"' . ($row['fuel'] === 'None' ? ' selected' : '') . '>None</option>'; echo '<option value="None"' . ($row['fuel'] === 'None' ? ' selected' : '') . '>None</option>';
echo '<option value="100LL"' . ($row['fuel'] === '100LL' ? ' selected' : '') . '>100LL</option>'; echo '<option value="100LL"' . ($row['fuel'] === '100LL' ? ' selected' : '') . '>100LL</option>';
@@ -305,7 +305,7 @@ function opDetail() {
echo '</select></td></tr>'; echo '</select></td></tr>';
echo '<tr><th>POB OUT</th><td><button class="edit-button" onclick="editField(this)"><img src="assets/edit.png" alt="Edit"></button></td><td><input type="number" class="editable" data-column="pob_out" value="' . $row['pob_out'] . '" readonly></td></tr>'; echo '<tr><th>POB OUT</th><td><button class="edit-button" onclick="editField(this)"><img src="assets/edit.png" alt="Edit"></button></td><td><input type="number" class="editable" data-column="pob_out" value="' . $row['pob_out'] . '" readonly></td></tr>';
echo '<tr><th>Outbound To</th><td><button class="edit-button" onclick="editField(this)"><img src="assets/edit.png" alt="Edit"></button></td><td><span class="editable" data-column="out_to">' . $row['out_to'] . '</span></td></tr>'; echo '<tr><th>Outbound To</th><td><button class="edit-button" onclick="editField(this)"><img src="assets/edit.png" alt="Edit"></button></td><td><span class="editable" data-column="out_to">' . $row['out_to'] . '</span></td></tr>';
echo '<tr><th>ETD</th><td><button class="edit-button" onclick="editField(this)"><img src="assets/edit.png" alt="Edit"></button></td><td><input type="datetime-local" class="editable" data-column="etd" value="' . ($row['etd'] ? date('Y-m-d\TH:i', strtotime($row['etd'])) : '') . '" readonly></td></tr>'; echo '<tr><th>ETD Z</th><td><button class="edit-button" onclick="editField(this)"><img src="assets/edit.png" alt="Edit"></button></td><td><input type="datetime-local" class="editable" data-column="etd" value="' . ($row['etd'] ? date('Y-m-d\TH:i', strtotime($row['etd'])) : '') . '" readonly></td></tr>';
echo '<tr><th>Email Address</th><td><button class="edit-button" onclick="editField(this)"><img src="assets/edit.png" alt="Edit"></button></td><td><input type="email" class="editable" data-column="email" value="' . $row['email'] . '" readonly></td></tr>'; echo '<tr><th>Email Address</th><td><button class="edit-button" onclick="editField(this)"><img src="assets/edit.png" alt="Edit"></button></td><td><input type="email" class="editable" data-column="email" value="' . $row['email'] . '" readonly></td></tr>';
echo '<tr><th>Phone</th><td><button class="edit-button" onclick="editField(this)"><img src="assets/edit.png" alt="Edit"></button></td><td><input type="tel" class="editable" data-column="phone" value="' . $row['phone'] . '" readonly></td></tr>'; echo '<tr><th>Phone</th><td><button class="edit-button" onclick="editField(this)"><img src="assets/edit.png" alt="Edit"></button></td><td><input type="tel" class="editable" data-column="phone" value="' . $row['phone'] . '" readonly></td></tr>';
echo '<tr><th>Notes</th><td></td><td>' . $row['notes'] . '</td></tr>'; echo '<tr><th>Notes</th><td></td><td>' . $row['notes'] . '</td></tr>';

View File

@@ -25,56 +25,53 @@ include("functions.php");
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Swansea Daily PPR</title> <title>Swansea Daily PPR</title>
<style> <style>
/* Styling for the table */ /* Styling for the table */
table { table {
width: 80%; width: 90%;
border-collapse: collapse; border-collapse: collapse;
margin: 20px 0; margin: 20px auto;
margin-left: auto; /* Automatically adjusts left margin */ background-color: #000; /* Black background for digital display effect */
margin-right: auto; /* Automatically adjusts right margin */ color: #0f0; /* Bright green text for digital display effect */
font-family: 'Courier New', Courier, monospace; /* Monospace font for digital look */
font-size: 18px;
text-align: center;
} }
table, th, td { table, th, td {
border: 1px solid #ddd; border: 1px solid #444; /* Subtle border for table cells */
} }
th { th {
padding: 8px; padding: 10px;
text-align: center; background-color: #222; /* Darker background for headers */
color: #fff; /* White text for headers */
font-weight: bold;
text-transform: uppercase;
} }
td { td {
padding: 8px; padding: 10px;
text-align: center;
font-family: Arial, sans-serif;
font-size: 16pt;
}
th {
background-color: #f2f2f2;
} }
tr:nth-child(even) { tr:nth-child(even) {
background-color: #f9f9f9; background-color: #111; /* Slightly lighter background for even rows */
} }
tr:hover { tr:hover {
background-color: #f1f1f1; background-color: #333; /* Highlight row on hover */
} }
/* Highlight styles for fuel types */
.highlight100LL { .highlight100LL {
background-color: #ADD8E6 !important; background-color: #0044cc !important; /* Blue for 100LL */
#font-weight: bold; color: #fff !important; /* White text */
} }
.highlightJET { .highlightJET {
background-color: yellow !important; /* Allow it to override the odd/even shading */ background-color: #ffcc00 !important; /* Yellow for JET A1 */
#font-weight: bold; color: #000 !important; /* Black text */
}
.acreg {
padding: 4px;
text-align: center;
font-family: Arial, sans-serif;
font-size: 10pt;
font-style: italic;
} }
/* Styling for aircraft registration */
.acreg {
font-size: 14px;
font-style: italic;
color: #ccc; /* Light gray for subtle emphasis */
}
</style> </style>
</head> </head>
<body> <body>

BIN
assets/WBCAFE.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 31 KiB

BIN
assets/flightImg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 56 KiB

BIN
assets/logo.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 22 KiB

259
bookout.html Normal file
View File

@@ -0,0 +1,259 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Book Out</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
background-color: #f4f4f4;
}
.form-container {
max-width: 500px;
margin: 20px auto;
padding: 20px;
background: #fff;
border-radius: 8px;
box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}
.form-container h2 {
text-align: center;
margin-bottom: 20px;
}
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
margin-bottom: 5px;
font-weight: bold;
}
.form-group input, .form-group select {
width: 100%;
padding: 10px;
font-size: 1rem;
border: 1px solid #ccc;
border-radius: 5px;
}
.form-group input:focus, .form-group select:focus {
border-color: #007bff;
outline: none;
box-shadow: 0 0 5px rgba(0, 123, 255, 0.5);
}
.hidden {
display: none;
}
button {
width: 100%;
padding: 10px;
font-size: 1rem;
color: #fff;
background-color: #007bff;
border: none;
border-radius: 5px;
cursor: pointer;
}
button:hover {
background-color: #0056b3;
}
@media (max-width: 768px) {
.form-container {
width: 100%; /* Ensure it fits the screen */
margin: 20px auto;
padding: 15px;
box-sizing: border-box; /* Include padding in width calculation */
}
.form-group input, .form-group select, button {
font-size: 0.9rem;
padding: 8px;
}
h2 {
font-size: 1.5rem;
}
}
@media (max-width: 480px) {
.form-container {
width: 100%; /* Ensure it fits the screen */
margin: 10px auto;
padding: 10px;
box-sizing: border-box; /* Include padding in width calculation */
}
.form-group input, .form-group select, button {
font-size: 0.8rem;
padding: 6px;
}
h2 {
font-size: 1.2rem;
}
}
.nature-button {
flex: 1;
padding: 10px;
font-size: 1rem;
color: #fff;
background-color: #007bff;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
.nature-button:hover {
background-color: #0056b3;
}
.nature-button.selected {
background-color: #28a745; /* Green for selected */
}
.pob-button {
flex: 1;
padding: 10px;
font-size: 1rem;
color: #fff;
background-color: #007bff;
border: none;
border-radius: 5px;
cursor: pointer;
transition: background-color 0.3s;
}
.pob-button:hover {
background-color: #0056b3;
}
.pob-button.selected {
background-color: #28a745; /* Green for selected */
}
</style>
<script>
function toggleLandawayFields(natureOfFlight) {
const landawayFields = document.getElementById("landaway-fields");
document.getElementById("nature_of_flight").value = natureOfFlight;
// Update button styles
document.querySelectorAll(".nature-button").forEach(button => {
button.classList.remove("selected");
});
document.getElementById(`nature_${natureOfFlight}`).classList.add("selected");
if (natureOfFlight === "Landaway") {
landawayFields.classList.remove("hidden");
} else {
landawayFields.classList.add("hidden");
}
}
function selectPOB(pob) {
document.getElementById("pob").value = pob;
// Update button styles
document.querySelectorAll(".pob-button").forEach(button => {
button.classList.remove("selected");
});
document.getElementById(`pob_${pob}`).classList.add("selected");
}
function setCookie(name, value, days) {
const date = new Date();
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
document.cookie = `${name}=${value};expires=${date.toUTCString()};path=/`;
}
function getCookie(name) {
const cookies = document.cookie.split(';');
for (let i = 0; i < cookies.length; i++) {
const cookie = cookies[i].trim();
if (cookie.startsWith(name + '=')) {
return cookie.substring(name.length + 1);
}
}
return '';
}
function handleAircraftRegInput() {
const acRegInput = document.getElementById("ac_reg");
const acTypeInput = document.getElementById("ac_type");
const captainNameInput = document.getElementById("captain_name");
acRegInput.value = acRegInput.value.toUpperCase();
setCookie("ac_reg", acRegInput.value, 30);
setCookie("ac_type", acTypeInput.value, 30);
setCookie("captain_name", captainNameInput.value, 30);
}
function populateAircraftFields() {
const savedReg = getCookie("ac_reg");
const savedType = getCookie("ac_type");
const savedCaptainName = getCookie("captain_name");
if (savedReg) {
document.getElementById("ac_reg").value = savedReg;
}
if (savedType) {
document.getElementById("ac_type").value = savedType;
}
if (savedCaptainName) {
document.getElementById("captain_name").value = savedCaptainName;
}
}
document.addEventListener("DOMContentLoaded", populateAircraftFields);
</script>
</head>
<body>
<div class="form-container">
<h2>Log Outgoing Flight</h2>
<form action="submit_outgoing.php" method="POST">
<div class="form-group">
<label for="ac_reg">Aircraft Registration</label>
<input type="text" id="ac_reg" name="ac_reg" required maxlength="16" oninput="handleAircraftRegInput()">
</div>
<div class="form-group">
<label for="ac_type">Aircraft Type</label>
<input type="text" id="ac_type" name="ac_type" required maxlength="32" oninput="handleAircraftRegInput()">
</div>
<div class="form-group">
<label for="captain_name">Captain's Name</label>
<input type="text" id="captain_name" name="captain_name" required maxlength="64" oninput="handleAircraftRegInput()">
</div>
<div class="form-group">
<label>POB (Persons on Board)</label>
<input type="hidden" id="pob" name="pob" required>
<div style="display: flex; gap: 10px;">
<button type="button" id="pob_1" class="pob-button" onclick="selectPOB(1)">1</button>
<button type="button" id="pob_2" class="pob-button" onclick="selectPOB(2)">2</button>
<button type="button" id="pob_3" class="pob-button" onclick="selectPOB(3)">3</button>
<button type="button" id="pob_4" class="pob-button" onclick="selectPOB(4)">4</button>
<button type="button" id="pob_5" class="pob-button" onclick="selectPOB(5)">5</button>
<button type="button" id="pob_6" class="pob-button" onclick="selectPOB(6)">6</button>
</div>
</div>
<div class="form-group">
<label>Nature of Flight</label>
<input type="hidden" id="nature_of_flight" name="nature_of_flight" required>
<div style="display: flex; gap: 10px;">
<button type="button" id="nature_Local" class="nature-button" onclick="toggleLandawayFields('Local')">Local</button>
<button type="button" id="nature_Circuits" class="nature-button" onclick="toggleLandawayFields('Circuits')">Circuits</button>
<button type="button" id="nature_Landaway" class="nature-button" onclick="toggleLandawayFields('Landaway')">Landaway</button>
</div>
</div>
<div class="form-group">
<label for="departure_time">Time of Departure</label>
<input type="datetime-local" id="etd" name="etd" required>
</div>
<div id="landaway-fields" class="hidden">
<div class="form-group">
<label for="destination">Destination</label>
<input type="text" id="destination" name="destination" maxlength="64">
</div>
<div class="form-group">
<label for="return_time">Estimated Time of Return</label>
<input type="datetime-local" id="eta" name="eta">
</div>
</div>
<button type="submit">Submit</button>
</form>
</div>
</body>
</html>

View File

@@ -16,7 +16,7 @@ $mailPort = 465;
$mailFromAddress = 'noreply@swansea-airport.wales'; $mailFromAddress = 'noreply@swansea-airport.wales';
$mailFromName = 'Swansea Airport'; $mailFromName = 'Swansea Airport';
$baseUrl = "https://ppr.swansea-airport.wales/dev"; $baseUrl = "https://pprdev.swansea-airport.wales";
use PHPMailer\PHPMailer\PHPMailer; use PHPMailer\PHPMailer\PHPMailer;
use PHPMailer\PHPMailer\Exception; use PHPMailer\PHPMailer\Exception;
@@ -188,4 +188,24 @@ function generatePprEmail($entryId, $email, $ac_reg) {
logJournal($conn, $entryId, "Confirm email FAILED"); logJournal($conn, $entryId, "Confirm email FAILED");
} }
} }
function getAirport($conn, $code) {
$query = "";
if (strlen($code) === 4) {
$query = "SELECT name FROM airports WHERE icao = ?";
} elseif (strlen($code) === 3) {
$query = "SELECT name FROM airports WHERE iata = ?";
} else {
return null; // Invalid code length
}
$stmt = $conn->prepare($query);
$stmt->bind_param("s", $code);
$stmt->execute();
$stmt->bind_result($name);
$stmt->fetch();
$stmt->close();
return $name;
}
?> ?>

View File

@@ -161,7 +161,7 @@
<input type="number" id="pob_in" name="pob_in" required> <input type="number" id="pob_in" name="pob_in" required>
</div> </div>
<div class="form-group"></div> <div class="form-group"></div>
<label for="eta">ETA</label> <label for="eta">ETA (Local)</label>
<input type="datetime-local" id="eta" name="eta"> <input type="datetime-local" id="eta" name="eta">
</div> </div>
<div class="form-group"> <div class="form-group">
@@ -173,7 +173,7 @@
<input type="number" id="pob_out" name="pob_out" > <input type="number" id="pob_out" name="pob_out" >
</div> </div>
<div class="form-group"></div> <div class="form-group"></div>
<label for="eta">Departing At</label> <label for="eta">Departing At (Local)</label>
<input type="datetime-local" id="etd" name="etd"> <input type="datetime-local" id="etd" name="etd">
</div> </div>

106
public.css Normal file
View File

@@ -0,0 +1,106 @@
/* Overall page styling */
body {
margin: 0;
font-family: Arial, sans-serif;
display: grid;
grid-template-rows: auto 1fr auto;
grid-template-columns: 1fr;
height: 100vh;
font-size: 30px; /* Increased font size */
}
/* Header styles */
header {
background-color: #333;
color: white;
padding: 20px;
text-align: center;
img.left-image {
position: absolute;
top: 0;
left: 0;
height: auto;
}
img.right-image {
position: absolute;
top: 0;
right: 0;
width: 9%;
height: auto;
}
}
/* Main section styles */
main {
display: grid;
grid-template-columns: 1fr 1fr; /* Two equal-width columns */
gap: 20px;
padding: 20px;
overflow-y: auto;
}
/* Table styles */
table {
width: 100%;
border-collapse: collapse;
margin: 0;
border: 1px solid #ccc;
}
th, td {
padding: 12px;
text-align: left;
border: 1px solid #ccc;
}
th {
background-color: #f4f4f4;
}
tr:nth-child(even) {
background-color: #d3d3d3;
}
/* Footer styles */
footer {
background-color: #333;
color: white;
text-align: center;
padding: 10px 0;
position: relative;
overflow: hidden;
}
/* Marquee container */
.marquee {
display: inline-block;
white-space: nowrap;
padding-right: 100%; /* This makes the text start out of view */
animation: scroll-left 20s linear infinte;
}
/* Keyframes for scrolling animation */
@keyframes scroll-left {
from {
transform: translateX(100%);
}
to {
transform: translateX(-100%);
}
}
/* Marquee text styling */
.marquee-text {
font-size: 18px;
font-weight: bold;
color: #f4f4f4;
padding-left: 50px;
text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.2);
}
/* Responsive adjustments */
@media (max-width: 768px) {
main {
grid-template-columns: 1fr; /* Stack columns on smaller screens */
}
}

116
public.php Normal file
View File

@@ -0,0 +1,116 @@
<?php
include("functions.php");
// Create connection
$conn = connectDb();
// Fetch arrivals for today's date with status 'NEW'
$arrivalsSql = "SELECT ac_reg, ac_type, in_from, TIME_FORMAT(eta, '%H:%i') AS due
FROM submitted
WHERE DATE(eta) = CURDATE() AND status = 'NEW'
ORDER BY eta ASC";
$arrivalsResult = $conn->query($arrivalsSql);
// Fetch departures for today's date with status 'LANDED'
$departuresSql = "SELECT ac_reg, ac_type, out_to, TIME_FORMAT(etd, '%H:%i') AS due
FROM submitted
WHERE DATE(etd) = CURDATE() AND status = 'LANDED'
ORDER BY etd ASC";
$departuresResult = $conn->query($departuresSql);
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="refresh" content="300">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Swansea Airport - Arrivals & Departures</title>
<link rel="stylesheet" href="public.css">
</head>
<body>
<header>
<img src="assets/logo.png" alt="EGFH Logo" class="left-image">
<h1>Arrivals/Departures Information</h1>
<img src="assets/flightImg.png" alt="EGFH Logo" class="right-image">
</header>
<main>
<!-- Left column with arrivals table -->
<div>
<h2><center>Arrivals</center></h2>
<table>
<thead>
<tr>
<th>Registration</th>
<th>Aircraft Type</th>
<th>From</th>
<th>Due</th>
</tr>
</thead>
<tbody>
<?php if ($arrivalsResult->num_rows > 0): ?>
<?php while ($row = $arrivalsResult->fetch_assoc()): ?>
<tr>
<td><?= htmlspecialchars($row['ac_reg']) ?></td>
<td><?= htmlspecialchars($row['ac_type']) ?></td>
<td><?= htmlspecialchars($row['in_from']) ?></td>
<td><?= htmlspecialchars($row['due']) ?></td>
</tr>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="4">No arrivals found.</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
<!-- Right column with departures table -->
<div>
<h2><center>Departures</center></h2>
<table>
<thead>
<tr>
<th>Registration</th>
<th>Aircraft Type</th>
<th>To</th>
<th>Due</th>
</tr>
</thead>
<tbody>
<?php if ($departuresResult->num_rows > 0): ?>
<?php while ($row = $departuresResult->fetch_assoc()): ?>
<tr>
<td><?= htmlspecialchars($row['ac_reg']) ?></td>
<td><?= htmlspecialchars($row['ac_type']) ?></td>
<td><?= htmlspecialchars($row['out_to']) ?></td>
<td><?= htmlspecialchars($row['due']) ?></td>
</tr>
<?php endwhile; ?>
<?php else: ?>
<tr>
<td colspan="4">No departures found.</td>
</tr>
<?php endif; ?>
</tbody>
</table>
</div>
</main>
<footer>
<!-- Footer content -->
<div class="iso-marquee-linkwrap">
<div class="iso-marquee--long iso-marquee">
<!-- Add marquee content here -->
</div>
</div>
</footer>
</body>
</html>
<?php
// Close the database connection
$conn->close();
?>

View File

@@ -275,6 +275,14 @@ function renderTableCell($key, $value, $row) {
$notes = htmlspecialchars($row['notes'] ?? ''); $notes = htmlspecialchars($row['notes'] ?? '');
$acReg = htmlspecialchars($value ?? ''); $acReg = htmlspecialchars($value ?? '');
return "<td class='red-triangle' data-notes='$notes'>$acReg</td>"; return "<td class='red-triangle' data-notes='$notes'>$acReg</td>";
} elseif ($key == 'in_from' || $key == 'out_to') {
if (!empty($value) && (strlen($value) === 3 || strlen($value) === 4)) {
$airportName = getAirport(connectDb(), $value);
if ($airportName) {
return "<td>" . htmlspecialchars($value) . "<br><span style='font-size: smaller; font-style: italic;'>" . htmlspecialchars($airportName) . "</span></td>";
}
}
return "<td>" . htmlspecialchars($value ?? '') . "</td>";
} else { } else {
return "<td>" . htmlspecialchars($value ?? '') . "</td>"; return "<td>" . htmlspecialchars($value ?? '') . "</td>";
} }

View File

@@ -230,6 +230,14 @@ function renderTableCell($key, $value, $row) {
$notes = htmlspecialchars($row['notes'] ?? ''); $notes = htmlspecialchars($row['notes'] ?? '');
$acReg = htmlspecialchars($value ?? ''); $acReg = htmlspecialchars($value ?? '');
return "<td class='red-triangle' data-notes='$notes'>$acReg</td>"; return "<td class='red-triangle' data-notes='$notes'>$acReg</td>";
} elseif ($key == 'in_from' || $key == 'out_to') {
if (!empty($value) && (strlen($value) === 3 || strlen($value) === 4)) {
$airportName = getAirport(connectDb(), $value);
if ($airportName) {
return "<td>" . htmlspecialchars($value) . "<br><span style='font-size: smaller; font-style: italic;'>" . htmlspecialchars($airportName) . "</span></td>";
}
}
return "<td>" . htmlspecialchars($value ?? '') . "</td>";
} else { } else {
return "<td>" . htmlspecialchars($value ?? '') . "</td>"; return "<td>" . htmlspecialchars($value ?? '') . "</td>";
} }

View File

@@ -26,11 +26,12 @@ if (!in_array($column, $allowed_columns)) {
} }
// Convert eta or etd to UTC if supplied // Convert eta or etd to UTC if supplied
if (in_array($column, ['eta', 'etd'])) { // 1st June 2025 JP - NO - when editing just use Zulu time
$date = new DateTime($new_value, new DateTimeZone('Europe/London')); //if (in_array($column, ['eta', 'etd'])) {
$date->setTimezone(new DateTimeZone('UTC')); // $date = new DateTime($new_value, new DateTimeZone('Europe/London'));
$new_value = $date->format('Y-m-d H:i:s'); // $date->setTimezone(new DateTimeZone('UTC'));
} // $new_value = $date->format('Y-m-d H:i:s');
//}
$stmt = $conn->prepare("UPDATE submitted SET `$column` = ? WHERE id = ?"); $stmt = $conn->prepare("UPDATE submitted SET `$column` = ? WHERE id = ?");
if (!$stmt) { if (!$stmt) {