diff --git a/action.php b/action.php
index e69f03e..b333503 100644
--- a/action.php
+++ b/action.php
@@ -84,6 +84,7 @@ function opCancel() {
$sql = "UPDATE submitted SET status = 'CANCELED' where id = " . $_GET['id'];
$result = $conn->query($sql);
logJournal($conn, $_GET['id'], "Marked Canceled");
+ $conn->close();
}
function opLanded() {
@@ -91,6 +92,15 @@ function opLanded() {
$sql = "UPDATE submitted SET status = 'LANDED', landed_dt = NOW() where id = " . $_GET['id'];
$result = $conn->query($sql);
logJournal($conn, $_GET['id'], "Marked Landed");
+ $conn->close();
+}
+
+function opDelete() {
+ $conn = connectDb();
+ $sql = "UPDATE submitted SET status = 'DELETED' where id = " . $_GET['id'];
+ $result = $conn->query($sql);
+ logJournal($conn, $_GET['id'], "Marked Deleted");
+ $conn->close();
}
function opDetail() {
@@ -128,6 +138,7 @@ function opDetail() {
echo "No details found for the given ID.";
}
+ $conn->close();
}
switch($_GET['op']) {
@@ -137,6 +148,9 @@ switch($_GET['op']) {
case "landed":
opLanded();
break;
+ case "delete":
+ opDelete();
+ break;
case "detail":
opDetail();
break;
diff --git a/admin.php b/admin.php
new file mode 100644
index 0000000..c641724
--- /dev/null
+++ b/admin.php
@@ -0,0 +1,246 @@
+
+
+
+
+
+
+
+
+
+ Swansea Daily PPR
+
+
+
+
+
+
Swansea Inbound PPR ADMIN
+
+
+
Select a Month
+
+
+
+
+
+
+
+
+connect_error) {
+ die("Connection failed: " . $conn->connect_error);
+}
+
+$sql = "SELECT * FROM submitted WHERE status != 'DELETED' ORDER BY eta ASC;"; // Replace with your table name
+$result = $conn->query($sql);
+
+// Check if there are results
+if ($result->num_rows > 0) {
+ // Start HTML table
+ echo '