Cleaned up code

This commit is contained in:
Russ Long 2015-03-30 23:53:01 -04:00
parent ec16a1086b
commit 4fe4ed568a
8 changed files with 31 additions and 32 deletions

View File

@ -95,8 +95,8 @@ if( $_SESSION['access'] != 1 ) {
</head>
<body>
<div class=header>
<h1>Liquidweb BMS Events</h1>
<?php
<h1> BMS Events</h1>
<?php
if(isset($_SESSION['uname'])) {
echo "Hello, ";
print_r($_SESSION['uname']);

View File

@ -26,7 +26,7 @@ if( $_SESSION['access'] != 1 ) {
</head>
<body>
<div class=header>
<h1>Liquidweb BMS Events</h1>
<h1>BMS Events</h1>
<?php
if(isset($_SESSION['uname'])) {
echo "Hello, ";
@ -83,7 +83,7 @@ if( $_SESSION['access'] != 1 ) {
}
} else {
echo "Database Error";
}
}
echo $unitname;
?>
</td>
@ -126,7 +126,7 @@ if( $_SESSION['access'] != 1 ) {
<td>
Issue Description:
</td>
<td>
<td>
<input type="text" name="description" id="description" required value="<?=$desc;?>" />
</td>
</tr>
@ -137,7 +137,7 @@ if( $_SESSION['access'] != 1 ) {
<td>
<?php
if ($ongoing == 1) $checked= ' checked="true"';
echo '<input type="checkbox" name="is_ongoing" id="is_ongoing" value="1"' . $checked .' />';
?>
</td>
@ -156,7 +156,7 @@ if( $_SESSION['access'] != 1 ) {
</td>
</tr>
</table>
You must press "Submit" to record the update!
You must press "Submit" to record the update!
<input type="hidden" name="event" id="event" value="<?=$eventid;?>"/>
<input type="hidden" name="user" id="user" value="<?=$uname;?>"/>
</form>

View File

@ -8,7 +8,6 @@
<li><a href="index.php">Home</a></li>
<li><a href="addevent.php">Add an Event</a></li>
<li><a href="search.php">Search</a></li>
<li><a href="http://bms.int.liquidweb.com/" target=blank>BMS.int</a></li>
<li><a href="logout.php">Logout</a></li>
</ul>
</nav>

View File

@ -16,7 +16,7 @@ if( $_SESSION['access'] != 1 ) {
</head>
<body>
<div class=header>
<h1>Liquidweb BMS Events</h1>
<h1>BMS Events</h1>
<?php
if(isset($_SESSION['uname'])) {
echo "Hello, ";

View File

@ -1,6 +1,6 @@
<?php
include("includes/login-post.php");
// check to see if user is logging out
if(isset($_GET['out'])) {
// destroy session
@ -9,7 +9,7 @@ if(isset($_GET['out'])) {
unset($_SESSION['uname'],$_SESSION['access']);
session_destroy();
}
// check to see if login form has been submitted
if(isset($_POST['userLogin'])){
// run information through authenticator
@ -23,10 +23,10 @@ if(isset($_POST['userLogin'])){
$error = 1;
}
}
// output error to user
if (isset($error)) echo "Login failed: Incorrect user name, password, or rights<br /-->";
// output logout success
if (isset($_GET['out'])) echo "Logout successful";
?>
@ -36,13 +36,13 @@ if (isset($_GET['out'])) echo "Logout successful";
<link rel="shortcut icon" href="favicon.ico" />
<title>BMS Event Login</title>
</head>
<body>
<body>
<div class=header>
<h1>Liquidweb BMS Events</h1>
<h1>BMS Events</h1>
<?php include("includes/menu.php"); ?>
</div>
<div class=content>
<h2>Please Login with LDAP</h2>
<h2>Please Login with LDAP</h2>
<form action="login.php" method="post">
<table align='center'>
<tr>
@ -52,7 +52,7 @@ if (isset($_GET['out'])) echo "Logout successful";
</tr>
<tr>
<td>
Username:
Username:
</td>
<td>
<input type="text" name="userLogin" />
@ -60,7 +60,7 @@ if (isset($_GET['out'])) echo "Logout successful";
</tr>
<tr>
<td>
Password:
Password:
</td>
<td>
<input type="password" name="userPassword" />
@ -74,6 +74,6 @@ if (isset($_GET['out'])) echo "Logout successful";
</table>
</form>
You will be returned to the main BMS status page after login.
</div>
</div>
</body>
</html>

View File

@ -15,7 +15,7 @@ if( $_SESSION['access'] != 1 ) {
<link rel="stylesheet" href="//code.jquery.com/ui/1.11.4/themes/smoothness/jquery-ui.css">
<link rel="stylesheet" type="text/css" href="includes/js/dtp/jquery.datetimepicker.css"/ >
<script src="includes/js/dtp/jquery.js"></script>
<script src="includes/js/dtp/jquery.datetimepicker.js"></script>
<script src="includes/js/dtp/jquery.datetimepicker.js"></script>
<title>BMS Event Search</title>
<script>
$(function() {
@ -86,8 +86,8 @@ if( $_SESSION['access'] != 1 ) {
</head>
<body>
<div class=header>
<h1>Liquidweb BMS Events</h1>
<?php
<h1>BMS Events</h1>
<?php
if(isset($_SESSION['uname'])) {
echo "Hello, ";
print_r($_SESSION['uname']);
@ -152,7 +152,7 @@ if( $_SESSION['access'] != 1 ) {
</tr>
</table>
</form>
Search by Unit, start date, or end date of the event. The form will accept any or all of these three options.
Search by Unit, start date, or end date of the event. The form will accept any or all of these three options.
<br />
When entering start or end date, enter any portion of the value, and the search should return relevant data.
</body>

View File

@ -21,8 +21,8 @@ if(!empty($unit)) {
$query = "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.unit_id='$unit' AND date_time_start LIKE '%$start_date_time%'";
}
} else {
$query = "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.unit_id='$unit'";
}
$query = "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.unit_id='$unit'";
}
} else {
if(!empty($start_date_time)) {
if(!empty($end_date_time)) {
@ -43,8 +43,8 @@ if($result->num_rows >0){
</head>
<body>
<div class=header>
<h1>Liquidweb BMS Events</h1>
<?php
<h1>BMS Events</h1>
<?php
if(isset($_SESSION['uname'])) {
echo "Hello, ";
print_r($_SESSION['uname']);
@ -61,7 +61,7 @@ if($result->num_rows >0){
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 "</table>";
}
}
} else{
echo('No Results Found! Please <a href="javascript:history.back()">Go back</a> and try again');

View File

@ -15,8 +15,8 @@ if( $_SESSION['access'] != 1 ) {
</head>
<body>
<div class=header>
<h1>Liquidweb BMS Events</h1>
<?php
<h1>BMS Events</h1>
<?php
if(isset($_SESSION['uname'])) {
echo "Hello, ";
print_r($_SESSION['uname']);
@ -47,7 +47,7 @@ $eventid=$_GET['eventid'];
echo "Start Date and Time: ";
print_r($row1['date_time_start']);
echo "<br />";
echo "Currently Ongoing? ";
echo "Currently Ongoing? ";
if($row1['is_ongoing'] ==1) {
echo "Yes";
} else {
@ -55,7 +55,7 @@ $eventid=$_GET['eventid'];
}
echo "<br />";
echo "End Date and Time: ";
print_r($row1['date_time_end']);
print_r($row1['date_time_end']);
}
} else {
echo "<h4>ERROR Event ID Not Found</h4>";