Cleaned up code
This commit is contained in:
parent
ec16a1086b
commit
4fe4ed568a
@ -95,8 +95,8 @@ if( $_SESSION['access'] != 1 ) {
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class=header>
|
<div class=header>
|
||||||
<h1>Liquidweb BMS Events</h1>
|
<h1> BMS Events</h1>
|
||||||
<?php
|
<?php
|
||||||
if(isset($_SESSION['uname'])) {
|
if(isset($_SESSION['uname'])) {
|
||||||
echo "Hello, ";
|
echo "Hello, ";
|
||||||
print_r($_SESSION['uname']);
|
print_r($_SESSION['uname']);
|
||||||
|
@ -26,7 +26,7 @@ if( $_SESSION['access'] != 1 ) {
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class=header>
|
<div class=header>
|
||||||
<h1>Liquidweb BMS Events</h1>
|
<h1>BMS Events</h1>
|
||||||
<?php
|
<?php
|
||||||
if(isset($_SESSION['uname'])) {
|
if(isset($_SESSION['uname'])) {
|
||||||
echo "Hello, ";
|
echo "Hello, ";
|
||||||
@ -83,7 +83,7 @@ if( $_SESSION['access'] != 1 ) {
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo "Database Error";
|
echo "Database Error";
|
||||||
}
|
}
|
||||||
echo $unitname;
|
echo $unitname;
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
@ -126,7 +126,7 @@ if( $_SESSION['access'] != 1 ) {
|
|||||||
<td>
|
<td>
|
||||||
Issue Description:
|
Issue Description:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="description" id="description" required value="<?=$desc;?>" />
|
<input type="text" name="description" id="description" required value="<?=$desc;?>" />
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
@ -137,7 +137,7 @@ if( $_SESSION['access'] != 1 ) {
|
|||||||
<td>
|
<td>
|
||||||
<?php
|
<?php
|
||||||
if ($ongoing == 1) $checked= ' checked="true"';
|
if ($ongoing == 1) $checked= ' checked="true"';
|
||||||
|
|
||||||
echo '<input type="checkbox" name="is_ongoing" id="is_ongoing" value="1"' . $checked .' />';
|
echo '<input type="checkbox" name="is_ongoing" id="is_ongoing" value="1"' . $checked .' />';
|
||||||
?>
|
?>
|
||||||
</td>
|
</td>
|
||||||
@ -156,7 +156,7 @@ if( $_SESSION['access'] != 1 ) {
|
|||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</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="event" id="event" value="<?=$eventid;?>"/>
|
||||||
<input type="hidden" name="user" id="user" value="<?=$uname;?>"/>
|
<input type="hidden" name="user" id="user" value="<?=$uname;?>"/>
|
||||||
</form>
|
</form>
|
||||||
|
@ -8,7 +8,6 @@
|
|||||||
<li><a href="index.php">Home</a></li>
|
<li><a href="index.php">Home</a></li>
|
||||||
<li><a href="addevent.php">Add an Event</a></li>
|
<li><a href="addevent.php">Add an Event</a></li>
|
||||||
<li><a href="search.php">Search</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>
|
<li><a href="logout.php">Logout</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
</nav>
|
</nav>
|
||||||
|
@ -16,7 +16,7 @@ if( $_SESSION['access'] != 1 ) {
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class=header>
|
<div class=header>
|
||||||
<h1>Liquidweb BMS Events</h1>
|
<h1>BMS Events</h1>
|
||||||
<?php
|
<?php
|
||||||
if(isset($_SESSION['uname'])) {
|
if(isset($_SESSION['uname'])) {
|
||||||
echo "Hello, ";
|
echo "Hello, ";
|
||||||
|
20
login.php
20
login.php
@ -1,6 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
include("includes/login-post.php");
|
include("includes/login-post.php");
|
||||||
|
|
||||||
// check to see if user is logging out
|
// check to see if user is logging out
|
||||||
if(isset($_GET['out'])) {
|
if(isset($_GET['out'])) {
|
||||||
// destroy session
|
// destroy session
|
||||||
@ -9,7 +9,7 @@ if(isset($_GET['out'])) {
|
|||||||
unset($_SESSION['uname'],$_SESSION['access']);
|
unset($_SESSION['uname'],$_SESSION['access']);
|
||||||
session_destroy();
|
session_destroy();
|
||||||
}
|
}
|
||||||
|
|
||||||
// check to see if login form has been submitted
|
// check to see if login form has been submitted
|
||||||
if(isset($_POST['userLogin'])){
|
if(isset($_POST['userLogin'])){
|
||||||
// run information through authenticator
|
// run information through authenticator
|
||||||
@ -23,10 +23,10 @@ if(isset($_POST['userLogin'])){
|
|||||||
$error = 1;
|
$error = 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// output error to user
|
// output error to user
|
||||||
if (isset($error)) echo "Login failed: Incorrect user name, password, or rights<br /-->";
|
if (isset($error)) echo "Login failed: Incorrect user name, password, or rights<br /-->";
|
||||||
|
|
||||||
// output logout success
|
// output logout success
|
||||||
if (isset($_GET['out'])) echo "Logout successful";
|
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" />
|
<link rel="shortcut icon" href="favicon.ico" />
|
||||||
<title>BMS Event Login</title>
|
<title>BMS Event Login</title>
|
||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class=header>
|
<div class=header>
|
||||||
<h1>Liquidweb BMS Events</h1>
|
<h1>BMS Events</h1>
|
||||||
<?php include("includes/menu.php"); ?>
|
<?php include("includes/menu.php"); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class=content>
|
<div class=content>
|
||||||
<h2>Please Login with LDAP</h2>
|
<h2>Please Login with LDAP</h2>
|
||||||
<form action="login.php" method="post">
|
<form action="login.php" method="post">
|
||||||
<table align='center'>
|
<table align='center'>
|
||||||
<tr>
|
<tr>
|
||||||
@ -52,7 +52,7 @@ if (isset($_GET['out'])) echo "Logout successful";
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
Username:
|
Username:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="text" name="userLogin" />
|
<input type="text" name="userLogin" />
|
||||||
@ -60,7 +60,7 @@ if (isset($_GET['out'])) echo "Logout successful";
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
Password:
|
Password:
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
<input type="password" name="userPassword" />
|
<input type="password" name="userPassword" />
|
||||||
@ -74,6 +74,6 @@ if (isset($_GET['out'])) echo "Logout successful";
|
|||||||
</table>
|
</table>
|
||||||
</form>
|
</form>
|
||||||
You will be returned to the main BMS status page after login.
|
You will be returned to the main BMS status page after login.
|
||||||
</div>
|
</div>
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
@ -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" 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"/ >
|
<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.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>
|
<title>BMS Event Search</title>
|
||||||
<script>
|
<script>
|
||||||
$(function() {
|
$(function() {
|
||||||
@ -86,8 +86,8 @@ if( $_SESSION['access'] != 1 ) {
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class=header>
|
<div class=header>
|
||||||
<h1>Liquidweb BMS Events</h1>
|
<h1>BMS Events</h1>
|
||||||
<?php
|
<?php
|
||||||
if(isset($_SESSION['uname'])) {
|
if(isset($_SESSION['uname'])) {
|
||||||
echo "Hello, ";
|
echo "Hello, ";
|
||||||
print_r($_SESSION['uname']);
|
print_r($_SESSION['uname']);
|
||||||
@ -152,7 +152,7 @@ if( $_SESSION['access'] != 1 ) {
|
|||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
</form>
|
</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 />
|
<br />
|
||||||
When entering start or end date, enter any portion of the value, and the search should return relevant data.
|
When entering start or end date, enter any portion of the value, and the search should return relevant data.
|
||||||
</body>
|
</body>
|
||||||
|
@ -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%'";
|
$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 {
|
} 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 {
|
} else {
|
||||||
if(!empty($start_date_time)) {
|
if(!empty($start_date_time)) {
|
||||||
if(!empty($end_date_time)) {
|
if(!empty($end_date_time)) {
|
||||||
@ -43,8 +43,8 @@ if($result->num_rows >0){
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class=header>
|
<div class=header>
|
||||||
<h1>Liquidweb BMS Events</h1>
|
<h1>BMS Events</h1>
|
||||||
<?php
|
<?php
|
||||||
if(isset($_SESSION['uname'])) {
|
if(isset($_SESSION['uname'])) {
|
||||||
echo "Hello, ";
|
echo "Hello, ";
|
||||||
print_r($_SESSION['uname']);
|
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 "<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>";
|
echo "</table>";
|
||||||
}
|
}
|
||||||
|
|
||||||
} else{
|
} else{
|
||||||
echo('No Results Found! Please <a href="javascript:history.back()">Go back</a> and try again');
|
echo('No Results Found! Please <a href="javascript:history.back()">Go back</a> and try again');
|
||||||
|
@ -15,8 +15,8 @@ if( $_SESSION['access'] != 1 ) {
|
|||||||
</head>
|
</head>
|
||||||
<body>
|
<body>
|
||||||
<div class=header>
|
<div class=header>
|
||||||
<h1>Liquidweb BMS Events</h1>
|
<h1>BMS Events</h1>
|
||||||
<?php
|
<?php
|
||||||
if(isset($_SESSION['uname'])) {
|
if(isset($_SESSION['uname'])) {
|
||||||
echo "Hello, ";
|
echo "Hello, ";
|
||||||
print_r($_SESSION['uname']);
|
print_r($_SESSION['uname']);
|
||||||
@ -47,7 +47,7 @@ $eventid=$_GET['eventid'];
|
|||||||
echo "Start Date and Time: ";
|
echo "Start Date and Time: ";
|
||||||
print_r($row1['date_time_start']);
|
print_r($row1['date_time_start']);
|
||||||
echo "<br />";
|
echo "<br />";
|
||||||
echo "Currently Ongoing? ";
|
echo "Currently Ongoing? ";
|
||||||
if($row1['is_ongoing'] ==1) {
|
if($row1['is_ongoing'] ==1) {
|
||||||
echo "Yes";
|
echo "Yes";
|
||||||
} else {
|
} else {
|
||||||
@ -55,7 +55,7 @@ $eventid=$_GET['eventid'];
|
|||||||
}
|
}
|
||||||
echo "<br />";
|
echo "<br />";
|
||||||
echo "End Date and Time: ";
|
echo "End Date and Time: ";
|
||||||
print_r($row1['date_time_end']);
|
print_r($row1['date_time_end']);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo "<h4>ERROR Event ID Not Found</h4>";
|
echo "<h4>ERROR Event ID Not Found</h4>";
|
||||||
|
Loading…
Reference in New Issue
Block a user