BMS Events

View Event"; include("includes/menu.php"); ?>
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 events.event_id=".$eventid.";"; $result1 = $conn1->query($sql1); if ($result1->num_rows >0){ while ($row1 = $result1->fetch_assoc()) { echo "
"; echo ""; echo ""; if(empty($row1['event_image'])) { echo "
"; echo "Unit: "; echo ""; print_r($row1['unit_name']); echo "
"; echo "Alert: "; echo ""; print_r($row1['alert_name']); echo "
"; echo "Description: "; echo ""; echo nl2br($row1['description']); echo "
"; echo "Start Date and Time: "; echo ""; print_r($row1['date_time_start']); echo "
"; echo "Currently Ongoing? "; echo ""; if($row1['is_ongoing'] ==1) { echo "Yes"; } else { echo "No"; } echo "
"; echo "End Date and Time: "; echo ""; print_r($row1['date_time_end']); echo "
"; echo "Event Updates:"; echo ""; $update_query = "SELECT update_desc, update_date_time, update_user FROM event_updates WHERE event_updates.event_id=".$eventid.";"; $update_result = $conn1->query($update_query); if ($update_result->num_rows >0){ while ($update_row = $update_result->fetch_assoc()) { echo "
"; echo "Update Desc: "; echo ""; echo nl2br($update_row['update_desc']); echo "
"; echo "Update User: "; echo ""; print_r($update_row['update_user']); echo "
"; echo "Update Date and Time: "; echo ""; print_r($update_row['update_date_time']); if(empty($update_row['update_image'])) { echo "
"; } else { echo "
"; echo "Image: "; echo ""; echo "Attachment"; } } } else { echo "No updates to this event"; } echo "
"; echo "Edit Event"; echo "
"; } else { echo ""; echo "Attachments:"; echo ""; echo "Attachment"; echo ""; echo "Edit Event"; echo ""; } } } else { echo "

ERROR Event ID Not Found

"; } if ($conn1->connect_error) { die("Connection Failed: " . $conn1->connect_error); } ?>