Current Ongoing Events
connect_error) {
die("Connection Failed: " . $conn1->connect_error);
}
$sql1 = "SELECT * FROM events AS events INNER JOIN units AS units ON events.unit_id=units.unit_id INNER JOIN alerts as alerts ON events.alert_id=alerts.alert_id where is_ongoing=1;";
$result1 = $conn1->query($sql1);
if ($result1->num_rows >0){
echo "
Event ID | Unit | Alert | Start Date and Time | Description | End Date and Time | User | Edit |
";
while ($row1 = $result1->fetch_assoc()) {
echo "".$row1["event_id"]." | ".$row1["unit_name"]." | ".$row1["alert_name"]." | ".$row1["date_time_start"]." | ".$row1["description"]." | ".$row1["date_time_end"]." | ".$row1["user"]." | Edit |
";
}
echo "
";
} else {
echo "
No Ongoing Events at This Time
";
}
if ($conn1->connect_error) {
die("Connection Failed: " . $conn2->connect_error);
}
$sql2 = "SELECT * FROM events AS events INNER JOIN units AS units ON events.unit_id=units.unit_id INNER JOIN alerts as alerts ON events.alert_id=alerts.alert_id where is_ongoing=0 ORDER BY date_time_end DESC LIMIT 10;";
$result2 = $conn1->query($sql2);
if ($result2->num_rows >0){
echo "
Previous 10 Events
";
echo "This does not include ongoing events.";
echo "
Event ID | Unit | Alert | Start Date and Time | Description | End Date and Time | User | Edit |
";
while ($row2 = $result2->fetch_assoc()) {
echo "".$row2["event_id"]." | ".$row2["unit_name"]." | ".$row2["alert_name"]." | ".$row2["date_time_start"]." | ".$row2["description"]." | ".$row2["date_time_end"]." | ".$row2["user"]." | Edit |
";
}
echo "
";
} else {
echo "
Previous 10 Events
";
echo "
No Previous Events
";
}
$conn1->close();
?>