diff --git a/action.php b/action.php index b333503..9596856 100644 --- a/action.php +++ b/action.php @@ -88,11 +88,45 @@ function opCancel() { } function opLanded() { + + $date = date('Y-m-d'); + $time = urldecode($_GET['time']); + $landed_dt = $date . ' ' . $time; + $conn = connectDb(); - $sql = "UPDATE submitted SET status = 'LANDED', landed_dt = NOW() where id = " . $_GET['id']; - $result = $conn->query($sql); - logJournal($conn, $_GET['id'], "Marked Landed"); + $sql = "UPDATE submitted SET status = 'LANDED', landed_dt = ? WHERE id = ?"; + + $stmt = $conn->prepare($sql); + $stmt->bind_param("si", $landed_dt, $_GET['id']); + + $stmt->execute(); + $stmt->close(); + + logJournal($conn, $_GET['id'], "Marked Landed at time " . $time); + $conn->close(); + +} + +function opDeparted() { + + $date = date('Y-m-d'); + $time = urldecode($_GET['time']); + $departed_dt = $date . ' ' . $time; + + $conn = connectDb(); + $sql = "UPDATE submitted SET status = 'DEPARTED', departed_dt = ? WHERE id = ?"; + + $stmt = $conn->prepare($sql); + $stmt->bind_param("si", $departed_dt, $_GET['id']); + + $stmt->execute(); + $stmt->close(); + + logJournal($conn, $_GET['id'], "Marked Departed at time " . $time); + + $conn->close(); + } function opDelete() { @@ -148,6 +182,9 @@ switch($_GET['op']) { case "landed": opLanded(); break; + case "departed": + opDeparted(); + break; case "delete": opDelete(); break; diff --git a/arrive.png b/arrive.png new file mode 100644 index 0000000..5848b54 Binary files /dev/null and b/arrive.png differ diff --git a/depart.png b/depart.png new file mode 100644 index 0000000..456a16e Binary files /dev/null and b/depart.png differ diff --git a/functions.php b/functions.php index 295757e..788155e 100644 --- a/functions.php +++ b/functions.php @@ -128,9 +128,9 @@ function validateSecureToken($token) { list($email, $entryId, $timestamp, $hash) = explode('|', $decoded); // Check expiration (e.g., valid for 1 hour) - if (time() - $timestamp > 3600) { - return false; - } + //if (time() - $timestamp > 3600) { + // return false; + //} // Verify hash $data = "$email|$entryId|$timestamp"; diff --git a/newppr.php b/newppr.php index 88fc058..4212e18 100644 --- a/newppr.php +++ b/newppr.php @@ -36,7 +36,7 @@ if ($_SERVER["REQUEST_METHOD"] == "POST") { echo "Username is not set."; } - //echo ''; + echo ''; } else { echo "
Error inserting data: " . $conn->error . "
"; } diff --git a/tower.php b/tower.php index 1950a8d..765cf0f 100644 --- a/tower.php +++ b/tower.php @@ -7,6 +7,8 @@ require_db_auth(); + + -' . $row['status'] .'![]() | ';
+ echo '![]() | ';
+ echo '
| ' . htmlspecialchars($field->name ?? '') . ' | '; + } + + } + echo 'actions | '; + + echo '|
|---|---|---|
| ' . htmlspecialchars($row['ac_call'] ?? '') . " " . $value . ' | ';
+ } else {
+ echo '' . htmlspecialchars($value ?? '') . ' | '; + } + } + } + echo '![]() | ';
echo '