Liquidweb BMS Events

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 ""; while ($row1 = $result1->fetch_assoc()) { echo " "; } echo "
Event IDUnitAlertStart Date and TimeDescriptionEnd Date and TimeUserEdit
".$row1["event_id"]."".$row1["unit_name"]."".$row1["alert_name"]."".$row1["date_time_start"]."".$row1["description"]."".$row1["date_time_end"]."".$row1["user"]."Edit
"; } 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 ""; while ($row2 = $result2->fetch_assoc()) { echo " "; } echo "
Event IDUnitAlertStart Date and TimeDescriptionEnd Date and TimeUserEdit
".$row2["event_id"]."".$row2["unit_name"]."".$row2["alert_name"]."".$row2["date_time_start"]."".$row2["description"]."".$row2["date_time_end"]."".$row2["user"]."Edit
"; } else { echo "

Previous 10 Events

"; echo "
No Previous Events
"; } $conn1->close(); ?>