TZ changes from prod
This commit is contained in:
@@ -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>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>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 '<option value="None"' . ($row['fuel'] === 'None' ? ' selected' : '') . '>None</option>';
|
||||
echo '<option value="100LL"' . ($row['fuel'] === '100LL' ? ' selected' : '') . '>100LL</option>';
|
||||
@@ -305,7 +305,7 @@ function opDetail() {
|
||||
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>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>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>';
|
||||
|
||||
@@ -161,7 +161,7 @@
|
||||
<input type="number" id="pob_in" name="pob_in" required>
|
||||
</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">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
@@ -173,7 +173,7 @@
|
||||
<input type="number" id="pob_out" name="pob_out" >
|
||||
</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">
|
||||
</div>
|
||||
|
||||
|
||||
@@ -26,11 +26,12 @@ if (!in_array($column, $allowed_columns)) {
|
||||
}
|
||||
|
||||
// Convert eta or etd to UTC if supplied
|
||||
if (in_array($column, ['eta', 'etd'])) {
|
||||
$date = new DateTime($new_value, new DateTimeZone('Europe/London'));
|
||||
$date->setTimezone(new DateTimeZone('UTC'));
|
||||
$new_value = $date->format('Y-m-d H:i:s');
|
||||
}
|
||||
// 1st June 2025 JP - NO - when editing just use Zulu time
|
||||
//if (in_array($column, ['eta', 'etd'])) {
|
||||
// $date = new DateTime($new_value, new DateTimeZone('Europe/London'));
|
||||
// $date->setTimezone(new DateTimeZone('UTC'));
|
||||
// $new_value = $date->format('Y-m-d H:i:s');
|
||||
//}
|
||||
|
||||
$stmt = $conn->prepare("UPDATE submitted SET `$column` = ? WHERE id = ?");
|
||||
if (!$stmt) {
|
||||
|
||||
Reference in New Issue
Block a user