Swansea Inbound PPR ADMIN

Select a Month

connect_error) { die("Connection failed: " . $conn->connect_error); } $year = $_GET['year'] ?? date('Y'); $month = $_GET['month'] ?? date('n'); $sql = "SELECT * FROM submitted WHERE status != 'DELETED' and MONTH(eta) = $month and YEAR(eta) = $year 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 ''; // Output table headers (assuming column names are known) $fields = $result->fetch_fields(); foreach ($fields as $field) { if ($field->name != 'id') { echo ''; } } // echo ''; echo ' '; // Output table rows while ($row = $result->fetch_assoc()) { echo ''; foreach ($row as $key => $value) { if ($key != 'id') { echo ''; } } // echo ''; echo ''; } echo '
' . htmlspecialchars($field->name ?? '') . 'actions
' . htmlspecialchars($value ?? '') . '
'; } else { echo "No results found."; } // Close the database connection $conn->close(); ?>