Notes on main screen

This commit is contained in:
2025-03-17 20:37:43 +00:00
parent 9e25f0023c
commit 15b2d36bf6

View File

@@ -140,35 +140,6 @@ require_db_auth();
cursor: pointer;
}
/* Add this CSS for the red triangle */
.red-triangle {
position: relative;
}
.red-triangle::before {
content: "";
position: absolute;
top: 0;
left: 0;
width: 0;
height: 0;
border-left: 10px solid red;
border-bottom: 10px solid transparent;
}
.red-triangle:hover::after {
content: attr(data-notes);
position: absolute;
top: 20px;
left: 0;
background: #fff;
border: 1px solid #ddd;
padding: 5px;
border-radius: 5px;
white-space: nowrap;
z-index: 10;
}
</style>
</head>
<body>
@@ -240,7 +211,7 @@ function openDetail(id) {
</div>
-->
<div class="heading">Inbound Aircraft</div>
<div class="heading">Inbound PPR</div>
<?php
@@ -253,7 +224,7 @@ if ($conn->connect_error) {
}
// Define your SQL query
$sql = "SELECT id, status, ac_reg, ac_type, ac_call, TIME_FORMAT(eta,'%H:%i') AS ETA, fuel, in_from, pob_in, notes FROM submitted WHERE DATE(eta) = CURDATE() AND (status = 'NEW' OR status = 'CANCELED') ORDER BY eta ASC;"; // Replace with your table name
$sql = "SELECT id, status, ac_reg, ac_type, ac_call, TIME_FORMAT(eta,'%H:%i') AS ETA, fuel, in_from, pob_in FROM submitted WHERE DATE(eta) = CURDATE() AND (status = 'NEW' OR status = 'CANCELED') ORDER BY eta ASC;"; // Replace with your table name
// Execute the query
$result = $conn->query($sql);
@@ -268,7 +239,7 @@ if ($result->num_rows > 0) {
// Output table headers (assuming column names are known)
$fields = $result->fetch_fields();
foreach ($fields as $field) {
if ($field->name != 'notes' && $field->name != 'status' && $field->name != 'id' && $field->name != 'ac_call') {
if ($field->name != 'status' && $field->name != 'id' && $field->name != 'ac_call') {
echo '<th>' . htmlspecialchars($field->name ?? '') . '</th>';
}
@@ -283,14 +254,12 @@ if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
echo '<tr class="state-' . $row['status'] . '" data-id=' . $row['id'] . '>';
foreach ($row as $key => $value) {
if ($key != 'notes' && $key != 'status' && $key != 'id' && $key != 'ac_call') {
if ($key != 'status' && $key != 'id' && $key != 'ac_call') {
if ($key == 'ac_reg' && $row['ac_call'] != NULL) {
echo '<td>' . htmlspecialchars($row['ac_call'] ?? '') . "<br><span class=acreg>" . $value . '</span></td>';
} else if ($key == 'ac_reg' && !empty($row['notes'])) {
echo '<td class="red-triangle" data-notes="' . htmlspecialchars($row['notes'] ?? '') . '">' . htmlspecialchars($value ?? '') . '</td>';
} else {
echo '<td>' . htmlspecialchars($value ?? '') . '</td>';
}
}
}
}
echo '<td><img src="assets/cancel-icon.webp" title="Cancel PPR" style="width: 25px; height: auto;" onclick="markCancel(' . $row['id'] . ')"><img src="assets/arrive.png" title="Land" style="width: 30px; height: auto;" onclick="markLanded(' . $row['id'] . ')"></td>';
@@ -304,14 +273,14 @@ if ($result->num_rows > 0) {
?>
<div class="heading">Visiting Aircraft</div>
<div class="heading">Booking Out</div>
<div id="landed">
<?php
// Define your SQL query
$sql = "SELECT id, status, ac_reg, ac_type, ac_call, TIME_FORMAT(etd,'%H:%i') AS ETD, fuel, out_to, pob_out, notes FROM submitted WHERE DATE(eta) = CURDATE() AND status = 'LANDED' ORDER BY eta ASC;"; // Replace with your table name
$sql = "SELECT id, status, ac_reg, ac_type, ac_call, TIME_FORMAT(etd,'%H:%i') AS ETD, fuel, out_to, pob_out FROM submitted WHERE DATE(eta) = CURDATE() AND status = 'LANDED' ORDER BY eta ASC;"; // Replace with your table name
// Execute the query
$result = $conn->query($sql);
@@ -326,7 +295,7 @@ if ($result->num_rows > 0) {
// Output table headers (assuming column names are known)
$fields = $result->fetch_fields();
foreach ($fields as $field) {
if ($field->name != 'notes' && $field->name != 'status' && $field->name != 'id' && $field->name != 'ac_call') {
if ($field->name != 'status' && $field->name != 'id' && $field->name != 'ac_call') {
echo '<th>' . htmlspecialchars($field->name ?? '') . '</th>';
}
@@ -341,14 +310,12 @@ if ($result->num_rows > 0) {
while ($row = $result->fetch_assoc()) {
echo '<tr class="state-' . $row['status'] . '" data-id=' . $row['id'] . '>';
foreach ($row as $key => $value) {
if ($key != 'notes' && $key != 'status' && $key != 'id' && $key != 'ac_call') {
if ($key != 'status' && $key != 'id' && $key != 'ac_call') {
if ($key == 'ac_reg' && $row['ac_call'] != NULL) {
echo '<td>' . htmlspecialchars($row['ac_call'] ?? '') . "<br><span class=acreg>" . $value . '</span></td>';
} else if ($key == 'ac_reg' && !empty($row['notes'])) {
echo '<td class="red-triangle" data-notes="' . htmlspecialchars($row['notes'] ?? '') . '">' . htmlspecialchars($value ?? '') . '</td>';
} else {
echo '<td>' . htmlspecialchars($value ?? '') . '</td>';
}
}
}
}
echo '<td><img src="assets/cancel-icon.webp" title="Cancel PPR" style="width: 25px; height: auto;" onclick="markCancel(' . $row['id'] . ')"><img src="assets/depart.png" title="Depart" style="width: 30px; height: auto;" onclick="markDeparted(' . $row['id'] . ')"></td>';