Added edit button to viewevent.php, cleaned up other misc files.

This commit is contained in:
Russ 2015-04-05 18:50:19 -04:00
parent c8a062926a
commit 0d08ae04cd
3 changed files with 41 additions and 34 deletions

View File

@ -36,7 +36,7 @@ if( $_SESSION['access'] != 1 ) {
if ($result1->num_rows >0){ if ($result1->num_rows >0){
echo "<table align='center'><tr><th>Event ID</th><th>Unit</th><th>Alert</th><th>Start Date and Time</th><th>Description</th><th>End Date and Time</th><th>User</th><th>Edit</th></tr>"; echo "<table align='center'><tr><th>Event ID</th><th>Unit</th><th>Alert</th><th>Start Date and Time</th><th>Description</th><th>End Date and Time</th><th>User</th><th>Edit</th></tr>";
while ($row1 = $result1->fetch_assoc()) { while ($row1 = $result1->fetch_assoc()) {
echo "<tr><td><a href=https://utilities.mon.liquidweb.com/bms/viewevent.php?eventid=".$row1["event_id"]." target=_blank>".$row1["event_id"]."</a></td><td>".$row1["unit_name"]."</td><td>".$row1["alert_name"]."</td><td>".$row1["date_time_start"]."</td><td>".$row1["description"]."</td><td>".$row1["date_time_end"]."</td><td>".$row1["user"]."</td><td><a href=http://utilities.mon.liquidweb.com/bms/editevent.php?event_id=".$row1["event_id"]." target=blank>Edit</a></td></tr> "; echo "<tr><td><a href=https://DOMAIN.com/bms/viewevent.php?eventid=".$row1["event_id"]." target=_blank>".$row1["event_id"]."</a></td><td>".$row1["unit_name"]."</td><td>".$row1["alert_name"]."</td><td>".$row1["date_time_start"]."</td><td>".$row1["description"]."</td><td>".$row1["date_time_end"]."</td><td>".$row1["user"]."</td><td><a href=http://DOMAIN.com/bms/editevent.php?event_id=".$row1["event_id"]." target=blank>Edit</a></td></tr> ";
} }
echo "</table>"; echo "</table>";
} else { } else {
@ -52,7 +52,7 @@ if( $_SESSION['access'] != 1 ) {
echo "This does not include ongoing events."; echo "This does not include ongoing events.";
echo "<table align='center'><tr><th>Event ID</th><th>Unit</th><th>Alert</th><th>Start Date and Time</th><th>Description</th><th>End Date and Time</th><th>User</th><th>Edit</th></tr>"; echo "<table align='center'><tr><th>Event ID</th><th>Unit</th><th>Alert</th><th>Start Date and Time</th><th>Description</th><th>End Date and Time</th><th>User</th><th>Edit</th></tr>";
while ($row2 = $result2->fetch_assoc()) { while ($row2 = $result2->fetch_assoc()) {
echo "<tr><td><a href=https://utilities.mon.liquidweb.com/bms/viewevent.php?eventid=".$row2["event_id"]." target=_blank>".$row2["event_id"]."</a></td><td>".$row2["unit_name"]."</td><td>".$row2["alert_name"]."</td><td>".$row2["date_time_start"]."</td><td>".$row2["description"]."</td><td>".$row2["date_time_end"]."</td><td>".$row2["user"]."</td><td><a href=http://utilities.mon.liquidweb.com/bms/editevent.php?event_id=".$row2["event_id"]." target=blank>Edit</a></td></tr> "; echo "<tr><td><a href=https://DOMAIN.com/bms/viewevent.php?eventid=".$row2["event_id"]." target=_blank>".$row2["event_id"]."</a></td><td>".$row2["unit_name"]."</td><td>".$row2["alert_name"]."</td><td>".$row2["date_time_start"]."</td><td>".$row2["description"]."</td><td>".$row2["date_time_end"]."</td><td>".$row2["user"]."</td><td><a href=http://DOMAIN.com/bms/editevent.php?event_id=".$row2["event_id"]." target=blank>Edit</a></td></tr> ";
} }
echo "</table>"; echo "</table>";
} else { } else {

View File

@ -58,7 +58,7 @@ if($result->num_rows >0){
if ($result->num_rows >0){ if ($result->num_rows >0){
echo "<table align='center'><tr><th>Event ID</th><th>Unit</th><th>Alert</th><th>Start Date and Time</th><th>Description</th><th>End Date and Time</th><th>User</th><th>Edit</th></tr>"; echo "<table align='center'><tr><th>Event ID</th><th>Unit</th><th>Alert</th><th>Start Date and Time</th><th>Description</th><th>End Date and Time</th><th>User</th><th>Edit</th></tr>";
while ($row1 = $result->fetch_assoc()) { while ($row1 = $result->fetch_assoc()) {
echo "<tr><td><a href=https://utilities.mon.liquidweb.com/bms/viewevent.php?eventid=".$row1["event_id"]." target=_blank>".$row1["event_id"]."</a></td><td>".$row1["unit_name"]."</td><td>".$row1["alert_name"]."</td><td>".$row1["date_time_start"]."</td><td>".$row1["description"]."</td><td>".$row1["date_time_end"]."</td><td>".$row1["user"]."</td><td><a href=http://utilities.mon.liquidweb.com/bms/editevent.php?event_id=".$row1["event_id"]." target=blank>Edit</a></td></tr> "; echo "<tr><td><a href=https://DOMAIN.com/bms/viewevent.php?eventid=".$row1["event_id"]." target=_blank>".$row1["event_id"]."</a></td><td>".$row1["unit_name"]."</td><td>".$row1["alert_name"]."</td><td>".$row1["date_time_start"]."</td><td>".$row1["description"]."</td><td>".$row1["date_time_end"]."</td><td>".$row1["user"]."</td><td><a href=http://DOMAIN.com/bms/editevent.php?event_id=".$row1["event_id"]." target=blank>Edit</a></td></tr> ";
} }
echo "</table>"; echo "</table>";
} }

View File

@ -9,7 +9,7 @@ if( $_SESSION['access'] != 1 ) {
?> ?>
<html> <html>
<head> <head>
<link rel="stylesheet" type="text/css" href="css/style.css"> <link rel="stylesheet" type="text/css" href="css/sestyle.css">
<link rel="shortcut icon" href="favicon.ico" /> <link rel="shortcut icon" href="favicon.ico" />
<title>BMS Events</title> <title>BMS Events</title>
</head> </head>
@ -21,8 +21,8 @@ if( $_SESSION['access'] != 1 ) {
echo "Hello, "; echo "Hello, ";
print_r($_SESSION['uname']); print_r($_SESSION['uname']);
} }
echo "<h2>View Event</h2>"; echo "<h2>View Event</h2>";
include("includes/menu.php"); ?> include("includes/menu.php"); ?>
</div> </div>
<div class=content> <div class=content>
<?php include "includes/db_config.php"; <?php include "includes/db_config.php";
@ -35,34 +35,41 @@ $eventid=$_GET['eventid'];
$result1 = $conn1->query($sql1); $result1 = $conn1->query($sql1);
if ($result1->num_rows >0){ if ($result1->num_rows >0){
while ($row1 = $result1->fetch_assoc()) { while ($row1 = $result1->fetch_assoc()) {
echo "<br />"; echo "<br />";
echo "<table align='center'><tr><td>"; echo "<table align='center'><tr><td>";
echo "Unit: "; echo "Unit: ";
echo "</td><td>"; echo "</td><td>";
print_r($row1['unit_name']); print_r($row1['unit_name']);
echo "</td></tr><tr><td>"; echo "</td></tr><tr><td>";
echo "Alert: "; echo "Alert: ";
echo "</td><td>"; echo "</td><td>";
print_r($row1['alert_name']); print_r($row1['alert_name']);
echo "</td></tr><tr><td>"; echo "</td></tr><tr><td>";
echo "Start Date and Time: "; echo "Description: ";
echo "</td><td>"; echo "</td><td>";
print_r($row1['date_time_start']); echo nl2br($row1['description']);
echo "</td></tr><tr><td>"; echo "</td></tr><tr><td>";
echo "Currently Ongoing? "; echo "Start Date and Time: ";
echo "</td><td>"; echo "</td><td>";
if($row1['is_ongoing'] ==1) { print_r($row1['date_time_start']);
echo "Yes"; echo "</td></tr><tr><td>";
} else { echo "Currently Ongoing? ";
echo "No"; echo "</td><td>";
} if($row1['is_ongoing'] ==1) {
echo "</td></tr><tr><td>"; echo "Yes";
echo "End Date and Time: "; } else {
echo "</td><td>"; echo "No";
print_r($row1['date_time_end']); }
echo "</td></tr></table>"; echo "</td></tr><tr><td>";
} echo "End Date and Time: ";
} else { 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 "<h4>ERROR Event ID Not Found</h4>"; echo "<h4>ERROR Event ID Not Found</h4>";
} }
if ($conn1->connect_error) { if ($conn1->connect_error) {