From 07cb5d1419736ed773be8d4879c1ef44fa451290 Mon Sep 17 00:00:00 2001 From: James Pattinson Date: Mon, 31 Mar 2025 07:59:02 +0000 Subject: [PATCH] Before refactor --- testhook.json | 6 +++--- tower.php | 10 +++++++--- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/testhook.json b/testhook.json index 4a07c8e..1543433 100644 --- a/testhook.json +++ b/testhook.json @@ -6,7 +6,7 @@ "Aircraft Type": "RV-8", "Captain or PIC Name": "The Lord Rotherwick", "Arriving From": "at Lodge", - "ETA": "15\/03\/2025 17:22", + "ETA": "17\/03\/2025 17:22", "POB Inbound": "1", "Fuel Required": "None", "Departing To": "Ranger\u2019s Lodge", @@ -34,7 +34,7 @@ "name": "Arriving From" }, "ca4ac44f-0388-4a70-a072-38276ed2ac13": { - "value": "16\/03\/2025 17:22", + "value": "31\/03\/2025 17:22", "name": "ETA" }, "6fc47c54-7383-48fd-93fc-d8080f5ed8f5": { @@ -50,7 +50,7 @@ "name": "Departing To" }, "53d60abd-eb75-4b1f-92b6-5d47d26367ec": { - "value": "20\/03\/2025 00:00", + "value": "31\/03\/2025 00:00", "name": "ETD" }, "d1ac0860-31f4-4914-9d0b-cae42dfc7eda": { diff --git a/tower.php b/tower.php index 07884d9..981c7fb 100644 --- a/tower.php +++ b/tower.php @@ -205,11 +205,11 @@ function markAction(id, action, title, buttonText) { } function markDeparted(id) { - markAction(id, "departed", "Depart Aircraft at time", "Departed"); + markAction(id, "departed", "Depart Aircraft at time (UTC)", "Departed"); } function markLanded(id) { - markAction(id, "landed", "Land Aircraft at time", "Landed"); + markAction(id, "landed", "Land Aircraft at time (UTC)", "Landed"); } function markCancel(id) { @@ -285,7 +285,11 @@ if ($result->num_rows > 0) { foreach ($row as $key => $value) { if ($key != 'notes' && $key != 'status' && $key != 'id' && $key != 'ac_call') { if ($key == 'ac_reg' && $row['ac_call'] != NULL) { - echo '' . htmlspecialchars($row['ac_call'] ?? '') . "
" . $value . ''; + if (!empty($row['notes'])) { + echo '' . htmlspecialchars($row['ac_call'] ?? '') . "
" . $value . ''; + } else { + echo '' . htmlspecialchars($row['ac_call'] ?? '') . "
" . $value . ''; + } } else if ($key == 'ac_reg' && !empty($row['notes'])) { echo '' . htmlspecialchars($value ?? '') . ''; } else {