Change how event updates are handled

This commit is contained in:
2015-04-20 18:58:10 -04:00
parent f3c866481c
commit adf296588d
2 changed files with 100 additions and 66 deletions

View File

@ -21,8 +21,8 @@ if( $_SESSION['access'] != 1 ) {
echo "Hello, ";
print_r($_SESSION['uname']);
}
echo "<h2>View Event</h2>";
include("includes/menu.php"); ?>
echo "<h2>View Event</h2>";
include("includes/menu.php"); ?>
</div>
<div class=content>
<?php include "includes/db_config.php";
@ -35,41 +35,66 @@ $eventid=$_GET['eventid'];
$result1 = $conn1->query($sql1);
if ($result1->num_rows >0){
while ($row1 = $result1->fetch_assoc()) {
echo "<br />";
echo "<table align='center'><tr><td>";
echo "Unit: ";
echo "</td><td>";
print_r($row1['unit_name']);
echo "<br />";
echo "<table align='center'><tr><td>";
echo "Unit: ";
echo "</td><td>";
print_r($row1['unit_name']);
echo "</td></tr><tr><td>";
echo "Alert: ";
echo "</td><td>";
print_r($row1['alert_name']);
echo "Alert: ";
echo "</td><td>";
print_r($row1['alert_name']);
echo "</td></tr><tr><td>";
echo "Description: ";
echo "</td><td>";
echo nl2br($row1['description']);
echo "</td></tr><tr><td>";
echo "Start Date and Time: ";
echo "</td><td>";
print_r($row1['date_time_start']);
echo "</td></tr><tr><td>";
echo "Description: ";
echo "</td><td>";
echo nl2br($row1['description']);
echo "Currently Ongoing? ";
echo "</td><td>";
if($row1['is_ongoing'] ==1) {
echo "Yes";
} else {
echo "No";
}
echo "</td></tr><tr><td>";
echo "Start Date and Time: ";
echo "</td><td>";
print_r($row1['date_time_start']);
echo "</td></tr><tr><td>";
echo "Currently Ongoing? ";
echo "</td><td>";
if($row1['is_ongoing'] ==1) {
echo "Yes";
} else {
echo "No";
}
echo "</td></tr><tr><td>";
echo "End Date and Time: ";
echo "</td><td>";
print_r($row1['date_time_end']);
echo "</td></tr>";
echo "<tr><td colspan='2' class='ui-helper-center'>";
echo "<a href=editevent.php?event_id=".$row1['event_id'].">Edit Event</a>";
echo "</td></tr></table>";
}
} else {
echo "End Date and Time: ";
echo "</td><td>";
print_r($row1['date_time_end']);
echo "</td></tr>";
echo "<tr><td>";
echo "Event Updates";
echo "</td><td>";
$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 "<table align='center'><tr><td>";
echo "Update Desc: ";
echo "</td><td>";
echo nl2br($update_row['update_desc']);
echo "</td></tr><tr><td>";
echo "Update User: ";
echo "</td><td>";
print_r($update_row['update_user']);
echo "</td></tr><tr><td>";
echo "Update Date and Time: ";
echo "</td><td>";
print_r($update_row['update_date_time']);
echo "</td></tr></table>";
}
} else {
echo "No updates to this event";
}
echo "</td></tr>";
echo "<tr><td colspan='2' class='ui-helper-center'>";
echo "<a href=editevent.php?event_id=".$row1['event_id'].">Edit Event</a>";
echo "</td></tr></table>";
}
} else {
echo "<h4>ERROR Event ID Not Found</h4>";
}
if ($conn1->connect_error) {