Fixed some bugs and added a cookies disclaimer

This commit is contained in:
Givou 2022-11-10 21:56:38 +01:00
commit d39b7214b8
27 changed files with 9158 additions and 0 deletions

624
admin.php Normal file
View File

@ -0,0 +1,624 @@
<?php
session_start();
if(!file_exists("config.php")) {
header("Location: install/index.php");
die();
}
if(!isset($_SESSION['loggedin']) && $_SESSION['loggedin'] !== true) {
header("Location: login.php");
die;
}
include('worker.php');
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link type="text/css" rel="stylesheet" href="css/admin/style.css" />
<link type="text/css" rel="stylesheet" href="css/admin/mobile.css" />
<link rel="stylesheet" href="css/font-awesome/css/font-awesome.css">
<?php
echo '<title>'.$instancename.' - Administration</title>';
?>
</head>
<body>
<a id="opener" class="open" onclick="openNav()"></a>
<!--SIDEBAR-->
<div id="sidebar" class="sidebar">
<h1><?=$_SESSION['name']?></h1>
<a href="#dashboard">Dashboard</a>
<a href="#account">Account</a>
<?php
if($role == "administrator") {
echo '<a href="#users">Users</a>';
}
?>
<a href="#services">Services</a>
<a href="#incidents">Incidents</a>
<?php
if($role == "administrator") {
echo '<a href="#settings">Settings</a>';
}
?>
<a class="bottom close" onClick="closeNav()">Close</a>
<a class="bottom" href="admin.php?logout">Logout</a>
</div>
<!--DASHBOARD-->
<div id="dashboard" class="more-overlay">
<div class="more-popup">
<h2>Dashboard</h2>
<div class="content">Welcome back, <font color="green"><?=$_SESSION['name']?></font></div>
<?php
if(sOffline()) {
echo '<div class="content troubles">Some Systems may not work correctly!</div>';
} else if(sMaintenance()) {
echo '<div class="content maintenance">Systems currently under maintenance!</div>';
} else {
echo '<div class="content up">All Systems operational!</div>';
}
?>
</div>
</div>
<!--ACCOUNT-->
<div id="account" class="more-overlay">
<div class="more-popup">
<h2>Account</h2>
<div class="content">Account name: <font color="green"><?=$_SESSION['name']?></font></div>
<?php
if(isset($_GET["userexist"])) {
echo '<p class="wpassword">User already exists!</p>';
}
?>
<form action="admin.php?updateusername" method="post">
<input type="text" class="username-field" value="" placeholder="New Username" id="username" name="username" required>
<input style="display: none;" type="submit"><button class="button-green button-up">Submit</button></input>
</form>
<div class="placeholder"></div>
<div class="content">Password</div>
<?php
if(isset($_GET["pwnotmatch"])) {
echo '<p class="wpassword">The passwords do not match</p>';
}
if(isset($_GET["pwupdated"])) {
echo '<p class="upassword">Passwort updated successfully!</p>';
}
if(isset($_GET["pwrong"])) {
echo '<p class="wpassword">Old password is not correct!</p>';
}
?>
<form action="admin.php?updatepassword" method="post">
<input type="password" class="username-field field-newline" value="" placeholder="Old password" id="oldpassword" name="oldpassword" required>
<div class="placeholder"></div>
<input type="password" class="username-field field-newline" value="" placeholder="Password" id="password1" name="password1" required>
<input type="password" class="username-field" value="" placeholder="Retype password" id="password2" name="password2" required>
<input style="display: none;" type="submit"><button class="button-green">Submit</button></input>
</form>
</div>
</div>
<!--USERS WHEN ADMIN PRIVILEGES ARE SET-->
<?php
if($role == "administrator") {
echo '
<div id="users" class="more-overlay">
<div class="more-popup">
<h2>Users</h2>
<div class="content">Create Account</div>
<form action="admin.php?newuser" method="post">
<input type="text" class="username-field" value="" placeholder="Username" id="username" name="username" required>
<input type="password" class="username-field" value="" placeholder="Password" id="password" name="password" required>
<select name = "role">
<option value = "administrator" selected>Administrator</option>
<option value = "moderator">Moderator</option>
</select>
<input style="display: none;" type="submit"><button class="button-green button-up">Submit</button></input>
</form>
<div class="placeholder"></div>
<div class="content">Users</div>
';
if(isset($_GET["userdeleted"])) {
echo '<p class="wpassword">User deleted successfully!</p>';
}
if(isset($_GET["userexist"])) {
echo '<p class="wpassword">User already exists!</p>';
}
if(isset($_GET["usercreated"])) {
echo '<p class="upassword">User created successfully!</p>';
}
}
if($role == "administrator") {
while($userlist = mysqli_fetch_array($users)){
if($userlist['username'] != $_SESSION['name']) {
echo '
<input type="text" id="username" name="username" class="username-field" value="'.$userlist['username'].'" readonly>
<input type="text" class="username-field" value="ID='.$userlist['id'].'" readonly>
<input type="text" class="username-field" value="'.$userlist['role'].'" readonly>
<a href="?edit='.$userlist['username'].'#edit"><button class="button-green">Edit</button></a>
<a href="?deluser='.$userlist['username'].'#users"><button class="button-red">Delete</button></a>
<div class="userlist-newline"></div>';
}
}
}
if($role == "administrator") {
echo '</div></div>';
}
?>
<!--USERS EDIT-->
<?php
if(isset($_GET["edit"]) && $role == "administrator") {
$username = $_GET["edit"];
echo '
<div id="edit" class="more-overlay">
<div class="more-popup">
<h2>'.$username.'</h2>
<form action="admin.php?updateunfor='.$username.'#edit" method="post">
<div class="content">Username</div>';
if(isset($_GET["unupdated"])) {
echo '<p class="upassword">Username updated sucessfully</p>';
}
echo '
<input type="text" class="username-field" value="" placeholder="'.$username.'" id="username" name="username" required>
<input style="display: none;" type="submit"><button class="button-green button-up">Submit</button></input>
</form>
<div class="placeholder"></div>
<form action="admin.php?updatepwfor='.$username.'#edit" method="post">
<div class="content">Password</div>';
if(isset($_GET["pwnotmatch"])) {
echo '<p class="wpassword">The passwords do not match</p>';
}
if(isset($_GET["pwupdated"])) {
echo '<p class="upassword">Passwort updated successfully!</p>';
}
echo '
<input type="password" class="username-field field-newline" value="" placeholder="Password" id="password1" name="password1" required>
<input type="password" class="username-field" value="" placeholder="Retype password" id="password2" name="password2" required>
<input style="display: none;" type="submit"><button class="button-green">Submit</button></input>
</form>
<div class="placeholder"></div>
<form action="admin.php?updaterole='.$username.'#edit" method="post">
<div class="content">Role</div>';
if(isset($_GET["roleupdated"])) {
echo '<p class="upassword">Role updated successfully!</p>';
}
echo '
<select name = "role">
<option value = "administrator" selected>Administrator</option>
<option value = "moderator">Moderator</option>
</select>
<input style="display: none;" type="submit"><button class="button-green">Submit</button></input>
</form>
</div>
</div>
';
}
?>
<!--Manage Service-->
<?php
if(isset($_GET["manageservice"])) {
$id = $_GET["manageservice"];
$servicename = getServiceName($_GET["manageservice"]);
$incidentid = 0;
echo '
<div id="mservice" class="more-overlay">
<div class="more-popup">
<h2>'.$servicename.'</h2>
<div class="content">Edit service settings</div>
';
if(isset($_GET["statusupdated"])) {
echo '<p class="upassword">Status updated successfully!</p>';
}
if(isset($_GET["priorityupdated"])) {
echo '<p class="upassword">Priority updated successfully!</p>';
}
if(isset($_GET["nameupdated"])) {
echo '<p class="upassword">Name updated successfully!</p>';
}
echo '
<form action="admin.php">
<input type="hidden" name="updatest" value="' . $id . '">
<input type="text" class="username-field" value="'.getStatus($id).'" readonly>
<select name = "status">
<option value = "Online" selected>Online</option>
<option value = "Maintenance">Maintenance</option>
<option value = "Offline">Offline</option>
</select>
<input style="display: none;" type="submit"><button class="button-green button-up">Submit</button></input>
</form>
<form action="admin.php?upservicename='.$id.'" method="post">
<input type="text" class="username-field" value="'.$servicename.'" readonly>
<input type="text" class="username-field" placeholder="New Name" id="name" name="name" required>
<input style="display: none;" type="submit"><button class="button-green button-up">Submit</button></input>
</form>
<form action="admin.php?upservicepriority='.$id.'" method="post">
<input type="text" class="username-field" value="'.getServicePriority($id).'" readonly>
<input type="number" class="username-field" placeholder="Number" placeholder="Priority" id="priority" name="priority" required>
<input style="display: none;" type="submit"><button class="button-green button-up">Submit</button></input>
</form>
<div class="placeholder"></div>
<div class="content">Recent Incidents</div>
';
mysqli_data_seek($incidents, 0);
$count = 3;
if(isset($_GET['lmore'])) {
$add = (int) $_GET['lmore'];
$count += $add;
}
while($incidentlist = mysqli_fetch_array($incidents)){
if($count != 0) {
if(strpos($incidentlist['services'], $id) !== false) {
if(strpos($incidentlist['childof'], "-1") !== false) {
$count--;
echo '
<div class="placeholder"></div>
<div class="content">'.$incidentlist['date'].':
<a href="?rmincident='.$incidentlist['id'].'&manageservice='.$id.'&sname='.$servicename.'#mservice"><button class="button-red-mini button-mini-bigger">Delete</button></a>
</div>
<div class="incident">';
if($incidentlist['status'] == "new") {
echo '<div class="timeline-icon timeline-new"></div>';
} else if($incidentlist['status'] == "working") {
echo '<div class="timeline-icon timeline-working"></div>';
} else if($incidentlist['status'] == "update") {
echo '<div class="timeline-icon timeline-update"></div>';
} else if($incidentlist['status'] == "finished") {
echo '<div class="timeline-icon timeline-finished"></div>';
}
echo ''.$incidentlist['text'].'
</div>
';
mysqli_data_seek($incidents2, 0);
while($incidentlist2 = mysqli_fetch_array($incidents2)){
if(strpos($incidentlist['id'], $incidentlist2['childof']) !== false) {
echo '
<div class="incident">';
if($incidentlist2['status'] == "new") {
echo '<div class="timeline-icon timeline-new"></div>';
} else if($incidentlist2['status'] == "working") {
echo '<div class="timeline-icon timeline-working"></div>';
} else if($incidentlist2['status'] == "update") {
echo '<div class="timeline-icon timeline-update"></div>';
} else if($incidentlist2['status'] == "finished") {
echo '<div class="timeline-icon timeline-finished"></div>';
}
echo ''.$incidentlist2['text'].'
<a href="?rmincident='.$incidentlist2['id'].'&manageservice='.$id.'&sname='.$servicename.'#mservice"><button style="margin-top: 1px;" class="button-red-mini">Delete</button></a>
</div>
';
}
}
}
}
} else {
break;
}
}
if($count == 0) {
if(isset($_GET['lmore'])) {
$more = (int) $_GET['lmore'];
$more += 3;
} else {
$more = 3;
}
echo '<a href="?manageservice='.$id.'&sname='.$servicename.'&lmore='.$more.'#mservice"><button class="button-center button-green button-bigger">Load more</button></a';
}
echo '
</div>
</div>
';
}
?>
<!--Manage Group-->
<div id="groupedit" class="more-overlay">
<div class="more-popup">
<h2><?php echo getGroupName($_GET['editgroup']); ?></h2>
<div class="content">Edit Group</div>
<?php
if(isset($_GET["messagecreated"])) {
echo '<p class="upassword">Name updated successfully!</p>';
}
if(isset($_GET["priorityupdated"])) {
echo '<p class="upassword">Priority updated successfully!</p>';
}
?>
<?php echo '<form action="admin.php?upgroupname='.$_GET['editgroup'].'" method="post">' ?>
<input type="text" class="username-field" value="<?php echo getGroupName($_GET['editgroup']); ?>" readonly>
<input type="text" class="username-field" placeholder="New Name" id="name" name="name" required>
<input style="display: none;" type="submit"><button class="button-green button-up">Submit</button></input>
</form>
<?php echo '<form action="admin.php?upgrouppriority='.$_GET['editgroup'].'" method="post">' ?>
<input type="text" class="username-field" value="<?php echo getGroupPriority($_GET['editgroup']); ?>" readonly>
<input type="number" class="username-field" placeholder="Number" placeholder="Priority" id="priority" name="priority" required>
<input style="display: none;" type="submit"><button class="button-green button-up">Submit</button></input>
</form>
</div>
</div>
<!--Create Incidents-->
<div id="incidents" class="more-overlay">
<div class="more-popup">
<h2>Incidents</h2>
<?php
echo '
<div class="content">Create Incident</div>
';
if(isset($_GET["incidentcreated"])) {
echo '<p class="upassword">Incident created successfully!</p>';
}
echo '
<form action="admin.php?createincident" method="post">
<textarea class="field-newline" rows="5" cols="52" name="text" placeholder="Enter incident text" maxlength="500" required></textarea>
<select style="margin-top: -3px;" name = "services[]" multiple required>
';
mysqli_data_seek($services, 0);
while($servicelist = mysqli_fetch_array($services)){
echo '
<option value = "'.$servicelist['id'].'">'.$servicelist['name'].'</option>
';
}
echo '
</select>
<input type="date" class="username-field incident-date" placeholder="DD.MM.YYYY" value="" id="date" name="date" required>
<button style="" class="button-green incident-submit">Submit</button>
</form>
<div class="placeholder"></div>
<div class="content">Add Message</div>
';
if(isset($_GET["messagecreated"])) {
echo '<p class="upassword">Message created successfully!</p>';
}
echo '
<form action="admin.php?addmessage" method="post">
<textarea class="field-newline" rows="5" cols="52" name="text" placeholder="Enter incident message text" maxlength="500" required></textarea>
<select style="position: relative; top: -5px;" id="childof" name="childof" required>
';
mysqli_data_seek($incidents, 0);
while($incidentlist = mysqli_fetch_array($incidents)){
if(strpos($incidentlist['childof'], "-1") !== false) {
echo '
<option value = "'.$incidentlist['id'].'">'.$incidentlist['date'].'</option>
';
}
}
echo '
</select>
<select style="position: relative; top: -5px;" id="state" name="state" required>
<option value = "new">New</option>
<option value = "working">Working</option>
<option value = "update">Update</option>
<option value = "finished">Finished</option>
</select>
<button style="left: -3px; top: -5px;" class="button-green">Submit</button>
</form>
<div class="placeholder"></div>
<div class="content content-danger">Danger Zone</div>
';
if(isset($_GET["incidentsflushed"])) {
echo '<p class="wpassword">All Incidents flushed!!</p>';
}
echo '
<a href="?flushincidents"><button style="top: 5px;" class="button-red button-bigger">Clear all Incidents</button></a>
';
?>
</div>
</div>
<!--SETTINGS WHEN ADMIN PRIVILEGES ARE SET-->
<?php
if($role == "administrator") {
echo '
<div id="settings" class="more-overlay">
<div class="more-popup">
<h2>Settings</h2>
<div class="content">Instance name</div>';
if(isset($_GET["nameupdated"])) {
echo '<p class="upassword">Instance name successfully updated!</p>';
}
echo '
<form action="admin.php?upname" method="post">
<div><input type="text" class="username-field" value="'.$instancename.'" readonly>
<input type="text" class="username-field" placeholder="New name" value="" id="iname" name="iname" required>
<input style="display: none;" type="submit"><button class="button-green button-up">Submit</button></input></div>
</form>
<div class="placeholder"></div>
<div class="content">Autoreload Status</div>';
if(isset($_GET["reloadupdated"])) {
if($_GET['reloadupdated'] == "enabled") {
echo '<p class="upassword">Autoreload value set to: '.$_GET['reloadupdated'].'!</p>';
} else {
echo '<p class="wpassword">Autoreload value set to: '.$_GET['reloadupdated'].'!</p>';
}
}
echo '
<form action="admin.php?upautoreload" method="post">
<input type="text" class="username-field" value="'.$autoreload_setting.'" readonly>
<select name = "autoreload">
<option value = "enabled" selected>Enabled</option>
<option value = "disabled">Disabled</option>
</select>
<input style="display: none;" type="submit"><button class="button-green button-up">Submit</button></input>
</form>
<div class="placeholder"></div>
<div class="content">Impressum & Privacy Policity</div>';
if($_GET['impressumset']) {
echo '<p class="upassword">Impressum link set to: '.$_GET['impressumset'].'!</p>';
} else if($_GET['privacyset']) {
echo '<p class="upassword">Privacy policity link set to: '.$_GET['privacyset'].'!</p>';
} else if(isset($_GET['newtabset'])) {
echo '<p class="upassword">Open new tab policy updated!</p>';
}
echo '
<form action="admin.php?upimpressum" method="post">
<input type="text" class="username-field" value="'.$impressum.'" readonly>
<input type="text" class="username-field" placeholder="Impressum link" name="impressum">
<input style="display: none;" type="submit"><button class="button-green button-up">Submit</button></input>
</form>
<form action="admin.php?upprivacy" method="post">
<input type="text" class="username-field" value="'.$privacy.'" readonly>
<input type="text" class="username-field" placeholder="Privacy policity link" name="privacy">
<input style="display: none;" type="submit"><button class="button-green button-up">Submit</button></input>
</form>
<form action="admin.php?uptabpolicy" method="post">
<input type="text" class="username-field" value="'.$newtab.'" readonly>
<select name = "newtab">
<option value = "new tab" selected>new tab</option>
<option value = "same tab">same tab</option>
</select>
<input style="display: none;" type="submit"><button class="button-green button-up">Submit</button></input>
</form>
</div>
</div>';
}
?>
<!--SERVICES EDIT-->
<div id="services" class="more-overlay">
<div class="more-popup">
<h2>Services</h2>
<div class="content">Create group/service</div>
<?php
if(isset($_GET["groupadded"])) {
echo '<p class="upassword">Group successfully added!</p>';
}
if(isset($_GET["serviceadded"])) {
echo '<p class="upassword">Service successfully added!</p>';
}
?>
<form action="admin.php?creategroup" method="post">
<div><input type="text" class="username-field" value="" placeholder="New group" id="name" name="name" required>
<input type="number" class="username-field" value="" placeholder="Priority" id="priority" name="priority" required>
<input style="display: none;" type="submit"><button class="button-green button-up">Submit</button></input></div>
</form>
<form action="admin.php?createservice" method="post">
<div><input type="text" class="username-field" value="" placeholder="New service" id="name" name="name" required>
<input type="text" class="username-field" value="" placeholder="short name" id="sname" name="sname" maxlength="7" required>
<select name = "group">
<?php
while($grouplist = mysqli_fetch_array($groups)){
echo '<option value = '.$grouplist['id'].' selected>'.$grouplist['name'].'</option>';
}
?>
</select>
<input type="number" class="username-field" value="" placeholder="Priority" id="priority" name="priority" required>
<input style="display: none;" type="submit"><button class="button-green">Submit</button></div></input>
</form>
<div class="placeholder"></div>
<?php
if(isset($_GET["servicedeleted"])) {
echo '<p class="wpassword">Service successfully deleted!</p>';
}
if(isset($_GET["groupdeleted"])) {
echo '<p class="wpassword">Group successfully deleted!</p>';
}
?>
<?php
mysqli_data_seek($groups, 0);
while($grouplist = mysqli_fetch_array($groups)){
echo '<div class="content">'.$grouplist['name'].'
<a href="?editgroup='.$grouplist['id'].'#groupedit"><button class="button-green-mini">Edit</button></a>
<a href="?delgroup='.$grouplist['id'].'#services"><button class="button-red-mini">Delete</button></a></div>';
mysqli_data_seek($services, 0);
while($servicelist = mysqli_fetch_array($services)){
if($grouplist['id'] == $servicelist['groupid']) {
echo '
<div class="block"><input type="text" class="username-field" value="" placeholder="'.$servicelist['name'].'" id="servicename" name="servicename" readonly>
<input type="text" class="username-field" value="" placeholder="'.$servicelist['status'].'" id="status" name="status" size="500" readonly>
<input type="text" class="username-field" value="" placeholder="'.$servicelist['priority'].'" id="priority" name="priority" readonly>
<a href="?manageservice='.$servicelist['id'].'#mservice"><button class="button-orange">Manage</button></a>
';
if($role != "administrator") {
echo'</div>';
} else {
echo '<a href="?delservice='.$servicelist['id'].'#services"><button class="button-red">Delete</button></a>';
}
}
}
echo'<div class="placeholder"></div>';
}
?>
</body>
<script type="text/javascript" src="js/sidebar.js"></script>
<script type="text/javascript" src="js/redirect.js"></script>
</html>

50
auth.php Normal file
View File

@ -0,0 +1,50 @@
<?php
session_start();
$DATABASE_HOST = 'nerdcity.at';
$DATABASE_USER = 'webstatus';
$DATABASE_PASS = 'wPsCi548z6fKJB2u';
$DATABASE_NAME = 'webstatus';
$con = mysqli_connect($DATABASE_HOST, $DATABASE_USER, $DATABASE_PASS, $DATABASE_NAME);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
if ( !isset($_POST['username'], $_POST['password']) ) {
exit('Please fill both the username and password fields!');
}
if ($stmt = $con->prepare('SELECT id, password FROM accounts WHERE username = ?')) {
$stmt->bind_param('s', $_POST['username']);
$stmt->execute();
$stmt->store_result();
if ($stmt->num_rows > 0) {
$stmt->bind_result($id, $password);
$stmt->fetch();
if (password_verify($_POST['password'], $password)) {
session_regenerate_id();
$_SESSION['loggedin'] = TRUE;
$_SESSION['name'] = $_POST['username'];
$_SESSION['id'] = $id;
header("Location: admin.php");
} else {
//Incorrect Data
echo 'Incorrect username and/or password!';
}
} else {
//Incorrect Data
echo 'Incorrect username and/or password!';
}
$stmt->close();
}
?>

8
config.php Normal file
View File

@ -0,0 +1,8 @@
<?php
$config=array(
"DBHOST"=>"data2.thiemoo.at",
"DBNAME"=>"webstatus",
"DBPWD"=>"X5G3njgZ4s@E4S9J",
"DBUSER"=>"webstatus"
);
?>

135
css/admin/mobile.css Normal file
View File

@ -0,0 +1,135 @@
@media only screen and (max-width: 467px){
.open {
position: absolute;
top: -1%;
left: 3%;
font-size: 3em;
visibility: visible;
display: block;
}
.sidebar{
position: fixed;
width: 35%;
top:0;
left: 0;
bottom: 0;
background: #121921;
padding-top: 50px;
transition: 0.5s;
}
.bottom {
position: absolute;
bottom: 8%;
}
.close {
bottom: 14%;
visibility: visible;
}
.sidebar h1{
display: block;
padding: 10px 20px;
color: #fff;
text-decoration: none;
font-family: 'Trebuchet MS', sans-serif;
letter-spacing: 2px;
font-weight: 400;
margin: 0;
font-size: 2em;
text-transform: uppercase;
margin-top: 0;
transition: 0.3s;
}
.sidebar a{
display: block;
padding: 10px 20px;
color: #bbb;
text-decoration: none;
font-family: 'Trebuchet MS', sans-serif;
font-size: 1em;
letter-spacing: 2px;
transition: 0.3s;
}
.incident-date {
top: 0px !important;
}
.incident-submit {
top: -17% !important;
}
}
@media only screen and (max-height: 467px){
.open {
position: absolute;
top: -1%;
left: 3%;
font-size: 7em;
visibility: visible;
display: block;
}
.sidebar{
position: fixed;
width: 35%;
top:0;
left: 0;
bottom: 0;
background: #121921;
padding-top: 50px;
}
.sidebar h1{
display: block;
padding: 10px 20px;
color: #fff;
text-decoration: none;
font-family: 'Trebuchet MS', sans-serif;
letter-spacing: 2px;
font-weight: 400;
margin: 0;
font-size: 3em;
text-transform: uppercase;
margin-top: 50px;
}
.sidebar a{
display: block;
padding: 10px 20px;
color: #bbb;
text-decoration: none;
font-family: 'Trebuchet MS', sans-serif;
font-size: 2em;
letter-spacing: 2px;
}
.close {
display: block;
position: absolute;
bottom: 7%;
}
.more-popup {
margin: 15% auto 15% -30% !important;
padding: 20px;
background: #233142;
border-radius: 5px;
width: 70%;
position: relative;
}
.incident-date {
top: 0px !important;
}
.incident-submit {
top: -17% !important;
}
}

420
css/admin/style.css Normal file
View File

@ -0,0 +1,420 @@
body {
margin: 0;
background: #233142;
font-family: "Lato", sans-serif;
overflow-x: hidden;
}
.sidebar{
position: fixed;
width: 13%;
top:0;
left: 0;
bottom: 0;
background: #121921;
padding-top: 50px;
z-index: 1;
}
.sidebar h1{
display: block;
padding: 10px 20px;
color: #fff;
text-decoration: none;
font-family: "Rubik";
letter-spacing: 2px;
font-weight: 400;
margin: 0;
font-size: 25px;
text-transform: uppercase;
}
.sidebar a {
display: block;
padding: 10px 20px;
color: #bbb;
text-decoration: none;
font-family: "Rubik";
letter-spacing: 2px;
}
.sidebar a:hover:not(close){
color: #fff;
margin-left: 20px;
transition: 0.4s;
}
.bottom {
position: absolute;
bottom: 2%;
}
.close {
visibility: hidden;
}
.open {
color: green;
display: none;
visibility: hidden;
}
.more-box {
width: 20%;
margin: 0 auto;
background: rgba(255,255,255,0.2);
padding: 35px;
border: 2px solid #233142;
border-radius: 20px/50px;
text-align: center;
}
.more-overlay {
transition: opacity 300ms;
visibility: hidden;
opacity: 0;
padding-top: -1%;
margin: -10% auto;
margin-bottom: -2000px;
display: none;
}
.more-overlay:target {
visibility: visible;
opacity: 1;
display: block;
}
.more-popup {
margin: 15% auto 15% 30%;
padding: 20px;
background: #233142;
border-radius: 5px;
width: 70%;
position: relative;
}
.more-popup h2 {
margin-top: 0;
color: #a6a6a6;
font-family: Tahoma, Arial, sans-serif;
font-size: 80px;
margin-bottom: 0;
}
.more-popup .content {
max-height: 30%;
overflow: auto;
color: #d9d9d9;
font-size: 20px;
}
.content-danger {
color: #ff4d4d !important;
}
.more-box-caller {
text-decoration: none;
}
.up {
color: #009900 !important;
}
.maintenance {
color: #ff9933 !important;
}
.troubles {
color: #ff1a1a !important;
}
input {
text-align: center;
background-color: #ECF0F1;
border: 2px solid transparent;
border-radius: 3px;
font-size: 15px;
font-weight: 200;
padding: 10px 0;
width: 200px;
transition: border .5s;
margin-left: -2px;
margin-top: 2px;
}
input:focus {
border: 2px solid #3498DB;
box-shadow: none;
}
textarea {
text-align: center;
background-color: #2c3e54;
color: #7996b9;
border: 2px solid transparent;
border-radius: 3px;
font-size: 15px;
font-weight: 200;
padding: 10px 0;
transition: border .5s;
margin-left: -2px;
margin-top: 2px;
margin-bottom: 5px;
}
select {
text-align: center;
background-color: #2c3e54 !important;
color: #7996b9;
border: 2px solid transparent;
border-radius: 3px;
font-size: 15px;
font-weight: 200;
padding: 10px 0;
width: 200px;
transition: border .5s;
margin-left: -2px;
margin-top: 2px;
}
select:focus {
border: 2px solid #3498DB;
box-shadow: none;
}
button {
position: relative;
margin-bottom: 2px;
font-size: 15px !important;
font-weight: 200 !important;
color: #7996b9 !important;
}
button:focus {
outline: 0;
}
button:before {
content: "";
display: block;
position: absolute;
background: rgba(255, 255, 255, 0.5);
width: 60px;
height: 100%;
left: 0;
top: 0;
opacity: 0.5;
filter: blur(30px);
transform: translateX(-100px) skewX(-15deg);
}
button:after {
content: "";
display: block;
position: absolute;
background: rgba(255, 255, 255, 0.2);
width: 30px;
height: 100%;
left: 30px;
top: 0;
opacity: 0;
filter: blur(5px);
transform: translateX(-100px) skewX(-15deg);
}
button:hover:before {
transform: translateX(300px) skewX(-15deg);
opacity: 0.6;
transition: 0.7s;
}
button:hover:after {
transform: translateX(300px) skewX(-15deg);
opacity: 1;
transition: 0.7s;
}
.button-green {
background: #2c3e54;
color: #ccc;
width: 80px;
height: 42px;
border: 0;
font-size: 18px;
border-radius: 4px;
font-family: "Raleway", sans-serif;
transition: 0.6s;
overflow: hidden;
}
.button-green:hover {
background: #338033;
cursor: pointer;
}
.button-red {
background: #2c3e54;
color: #ccc;
width: 80px;
height: 42px;
border: 0;
font-size: 18px;
border-radius: 4px;
font-family: "Raleway", sans-serif;
transition: 0.6s;
overflow: hidden;
}
.button-red:hover {
background: #990000;
cursor: pointer;
}
.button-orange {
background: #2c3e54;
color: #ccc;
width: 80px;
height: 42px;
border: 0;
font-size: 18px;
border-radius: 4px;
font-family: "Raleway", sans-serif;
transition: 0.6s;
overflow: hidden;
}
.button-orange:hover {
background: #cc6600;
cursor: pointer;
}
.button-green-mini {
background: #2c3e54;
color: #ccc;
width: 50px;
height: 23px;
top: -2px;
border: 0;
font-size: 18px;
border-radius: 4px;
font-family: "Raleway", sans-serif;
transition: 0.6s;
overflow: hidden;
}
.button-green-mini:hover {
background: #338033;
cursor: pointer;
}
.button-red-mini {
background: #2c3e54;
color: #ccc;
width: 55px;
height: 23px;
top: -2px;
border: 0;
font-size: 18px;
border-radius: 4px;
font-family: "Raleway", sans-serif;
transition: 0.6s;
overflow: hidden;
}
.button-mini-bigger {
width: 75px !important;
}
.button-bigger {
width: 140px !important;
}
.button-center {
position: absolute;
left: 30%;
}
.button-up {
top: -1px;
}
.button-red-mini:hover {
background: #990000;
cursor: pointer;
}
.username-field {
color: #7996b9;
background-color: #2c3e54;
}
.field-newline {
display: block !important;
}
.userlist-newline {
margin-top: 1px;
}
.placeholder {
margin-top: 30px;
}
.wpassword {
font-size: 12px;
color: #ff0000;
margin: center;
}
.upassword {
font-size: 12px;
color: #009900;
margin: center;
}
.block {
}
.incident {
margin-top: 1%;
color: #7996b9;
width: 50%;
}
.timeline-icon {
display:flex;
float:left;
padding-right: 15px;
}
.timeline-new:before {
font-family:FontAwesome;
content: "\f0a1";
color: #cc6600;
}
.timeline-working:before {
font-family:FontAwesome;
content: "\f013";
color: #0052cc;
}
.timeline-update:before {
font-family:FontAwesome;
content: "\f0e5";
color: #4d9900;
}
.timeline-finished:before {
font-family:FontAwesome;
content: "\f00c";
color: #8bc34a;
}
.incident-date {
position: relative;
top: -85px;
}
.incident-submit {
left: -2px;
top: -83px;
}

2337
css/font-awesome/css/font-awesome.css vendored Normal file

File diff suppressed because it is too large Load Diff

File diff suppressed because one or more lines are too long

Binary file not shown.

Binary file not shown.

File diff suppressed because it is too large Load Diff

After

Width:  |  Height:  |  Size: 434 KiB

Binary file not shown.

Binary file not shown.

Binary file not shown.

296
css/login/style.css Normal file
View File

@ -0,0 +1,296 @@
html {
height: 100%;
background: radial-gradient(ellipse, #1b2735 0%, #090a0f 100%);
overflow: hidden;
}
/**Parallax Stars from Codepen**/
/**https://codepen.io/maadc/pen/oarbEM**/
#stars {
width: 2px;
height: 2px;
animation: animStar 40s linear infinite;
box-shadow: 1099px 204px #fff, 1708px 1116px #fff, 1147px 1309px #fff,
25px 1804px #fff, 1690px 1154px #fff, 1731px 747px #fff, 675px 1401px #fff,
944px 1148px #fff, 1302px 1465px #fff, 1023px 1535px #fff, 1032px 549px #fff,
1794px 731px #fff, 565px 1301px #fff, 1332px 1562px #fff, 314px 734px #fff,
955px 463px #fff, 1899px 882px #fff, 1397px 1692px #fff, 572px 599px #fff,
460px 960px #fff, 60px 260px #fff, 1684px 1780px #fff, 310px 1318px #fff,
1789px 1632px #fff, 1871px 1705px #fff, 791px 1245px #fff, 944px 1042px #fff,
1191px 1847px #fff, 1961px 269px #fff, 723px 720px #fff, 1534px 698px #fff,
301px 957px #fff, 1087px 1577px #fff, 734px 278px #fff, 647px 1477px #fff,
529px 1904px #fff, 15px 46px #fff, 805px 382px #fff, 1933px 1427px #fff,
1526px 1929px #fff, 871px 966px #fff, 829px 15px #fff, 1619px 1137px #fff,
1397px 1681px #fff, 654px 1984px #fff, 1397px 556px #fff, 850px 1739px #fff,
620px 1725px #fff, 1845px 1934px #fff, 1158px 875px #fff, 945px 341px #fff,
427px 1679px #fff, 191px 105px #fff, 1396px 1957px #fff, 1808px 1493px #fff,
1133px 460px #fff, 13px 1741px #fff, 140px 1053px #fff, 496px 1416px #fff,
1313px 739px #fff, 1461px 288px #fff, 933px 1008px #fff, 1532px 777px #fff,
1586px 169px #fff, 985px 1202px #fff, 1249px 1749px #fff, 629px 829px #fff,
963px 1075px #fff, 701px 743px #fff, 1284px 30px #fff, 662px 1867px #fff,
101px 691px #fff, 1667px 1490px #fff, 1443px 1166px #fff, 1618px 651px #fff,
1843px 119px #fff, 736px 494px #fff, 1266px 680px #fff, 606px 1339px #fff,
1046px 1926px #fff, 642px 522px #fff, 1786px 1668px #fff, 1681px 862px #fff,
1012px 1181px #fff, 1279px 1271px #fff, 806px 557px #fff, 401px 208px #fff,
730px 789px #fff, 1421px 488px #fff, 1549px 1937px #fff, 150px 1627px #fff,
1693px 787px #fff, 324px 1984px #fff, 1084px 310px #fff, 696px 1255px #fff,
1908px 48px #fff, 614px 1863px #fff, 348px 1724px #fff, 1457px 254px #fff,
1506px 150px #fff, 875px 1506px #fff, 988px 1020px #fff, 1524px 1492px #fff,
1722px 1681px #fff, 1102px 1669px #fff, 860px 768px #fff, 1369px 336px #fff,
1432px 19px #fff, 748px 988px #fff, 635px 1578px #fff, 1943px 397px #fff,
1944px 1615px #fff, 696px 225px #fff, 1922px 196px #fff, 1601px 1779px #fff,
1363px 1541px #fff, 14px 1554px #fff, 618px 917px #fff, 336px 992px #fff,
1208px 1788px #fff, 1617px 764px #fff, 1769px 1294px #fff, 1222px 9px #fff,
1386px 1796px #fff, 533px 575px #fff, 596px 923px #fff, 1847px 431px #fff,
1426px 160px #fff, 1128px 1833px #fff, 316px 233px #fff, 1293px 13px #fff,
987px 356px #fff, 1396px 1073px #fff, 1763px 1076px #fff, 1655px 547px #fff,
1923px 1286px #fff, 814px 1567px #fff, 856px 71px #fff, 1766px 886px #fff,
1764px 70px #fff, 1557px 279px #fff, 317px 660px #fff, 1828px 732px #fff,
327px 137px #fff, 307px 1363px #fff, 1355px 1970px #fff, 1559px 614px #fff,
1500px 467px #fff, 1460px 1827px #fff, 570px 560px #fff, 918px 544px #fff,
1816px 806px #fff, 646px 1641px #fff, 415px 199px #fff, 1621px 917px #fff,
1080px 893px #fff, 1537px 838px #fff, 1089px 539px #fff, 291px 711px #fff,
1654px 1537px #fff, 1065px 1843px #fff, 522px 1073px #fff, 813px 1724px #fff,
1005px 1984px #fff, 1807px 1783px #fff, 357px 1186px #fff, 757px 523px #fff,
1182px 248px #fff, 1232px 1491px #fff, 1391px 796px #fff, 1578px 54px #fff,
912px 1178px #fff, 1988px 1421px #fff, 500px 1545px #fff, 1266px 890px #fff,
1108px 897px #fff, 727px 111px #fff, 673px 1184px #fff, 561px 906px #fff,
1957px 1993px #fff, 698px 1419px #fff, 328px 1484px #fff, 710px 772px #fff,
14px 1102px #fff, 160px 1068px #fff, 1896px 595px #fff, 213px 775px #fff,
1184px 1495px #fff, 883px 239px #fff, 1092px 1733px #fff, 1041px 570px #fff,
189px 1295px #fff, 1343px 1128px #fff, 127px 1581px #fff, 1706px 288px #fff,
218px 919px #fff, 1333px 1223px #fff, 1958px 1385px #fff, 600px 575px #fff,
1542px 952px #fff, 1894px 1212px #fff, 810px 492px #fff, 722px 1119px #fff,
746px 298px #fff, 770px 392px #fff, 922px 355px #fff, 1651px 934px #fff,
566px 415px #fff, 675px 1922px #fff, 488px 5px #fff, 918px 809px #fff,
1510px 1827px #fff, 511px 165px #fff, 382px 1684px #fff, 1934px 1992px #fff,
993px 1730px #fff, 1603px 1836px #fff, 63px 234px #fff, 250px 1178px #fff,
467px 1201px #fff, 1883px 7px #fff, 1868px 1487px #fff, 868px 1971px #fff,
613px 1272px #fff, 664px 756px #fff, 1781px 1327px #fff, 165px 544px #fff,
319px 45px #fff, 1870px 629px #fff, 556px 1502px #fff, 975px 807px #fff,
1869px 313px #fff, 156px 1968px #fff, 1647px 555px #fff, 1589px 864px #fff,
85px 1634px #fff, 943px 202px #fff, 1270px 1850px #fff, 1910px 307px #fff,
1163px 1002px #fff, 1571px 1892px #fff, 835px 1929px #fff, 322px 1527px #fff,
1706px 1371px #fff, 1498px 967px #fff, 466px 1566px #fff, 1330px 542px #fff,
1651px 1955px #fff, 1416px 685px #fff, 1484px 1447px #fff, 161px 1975px #fff,
866px 1581px #fff, 252px 416px #fff, 1693px 1326px #fff, 1810px 43px #fff,
653px 650px #fff, 744px 654px #fff, 1573px 590px #fff, 1430px 1962px #fff,
52px 312px #fff, 710px 1805px #fff, 1910px 87px #fff, 1767px 1641px #fff,
281px 608px #fff, 191px 95px #fff, 861px 717px #fff, 1890px 1608px #fff,
495px 1847px #fff, 459px 1932px #fff, 206px 1262px #fff, 950px 1761px #fff,
213px 110px #fff, 1051px 1830px #fff, 1550px 55px #fff, 240px 170px #fff,
629px 1986px #fff, 816px 1520px #fff, 1615px 1032px #fff, 995px 1963px #fff,
272px 180px #fff, 916px 1876px #fff, 176px 793px #fff, 517px 1886px #fff,
1907px 1182px #fff, 161px 951px #fff, 1395px 1642px #fff, 278px 1828px #fff,
733px 1605px #fff, 268px 504px #fff, 447px 631px #fff, 773px 232px #fff,
1978px 1272px #fff, 1902px 1673px #fff, 1398px 544px #fff, 1369px 464px #fff,
1902px 1018px #fff, 1864px 558px #fff, 1194px 1182px #fff, 1813px 95px #fff,
1465px 318px #fff, 1929px 1685px #fff, 228px 692px #fff, 1179px 1618px #fff,
1419px 517px #fff, 459px 748px #fff, 1202px 629px #fff, 1456px 1115px #fff,
803px 307px #fff, 380px 466px #fff, 294px 467px #fff, 301px 1257px #fff,
425px 184px #fff, 383px 1178px #fff, 458px 716px #fff, 1766px 495px #fff,
159px 1325px #fff, 12px 1395px #fff, 1024px 104px #fff, 1609px 1955px #fff,
824px 304px #fff, 1338px 1144px #fff, 250px 45px #fff, 1100px 1464px #fff,
1948px 811px #fff, 942px 624px #fff, 39px 356px #fff, 566px 1666px #fff,
901px 517px #fff, 1904px 1230px #fff, 1195px 123px #fff, 200px 187px #fff,
1538px 463px #fff, 518px 1670px #fff, 1680px 183px #fff, 1051px 608px #fff,
51px 70px #fff, 21px 1896px #fff, 863px 583px #fff, 375px 206px #fff,
802px 75px #fff, 152px 1920px #fff, 308px 1255px #fff, 836px 329px #fff,
952px 193px #fff, 515px 800px #fff, 1236px 1406px #fff, 1606px 871px #fff,
1882px 1016px #fff, 825px 931px #fff, 562px 552px #fff, 1699px 1585px #fff,
1643px 1161px #fff, 1796px 1371px #fff, 301px 1056px #fff,
1893px 1668px #fff, 1739px 1660px #fff, 914px 612px #fff, 307px 1px #fff,
88px 315px #fff, 1186px 1326px #fff, 1086px 1646px #fff, 368px 1944px #fff,
1422px 882px #fff, 858px 1844px #fff, 1554px 817px #fff, 1224px 1606px #fff,
1901px 406px #fff, 447px 807px #fff, 1364px 461px #fff, 635px 1541px #fff,
506px 294px #fff, 2000px 1960px #fff, 498px 900px #fff, 1374px 154px #fff,
264px 480px #fff, 1561px 471px #fff, 1381px 1692px #fff, 1954px 1513px #fff,
701px 76px #fff, 1730px 1587px #fff, 1002px 279px #fff, 524px 1620px #fff,
282px 1248px #fff, 686px 1528px #fff, 755px 719px #fff, 789px 1218px #fff,
205px 533px #fff, 330px 1649px #fff, 1089px 1357px #fff, 1116px 975px #fff,
281px 394px #fff, 1635px 1678px #fff, 529px 1008px #fff, 1465px 798px #fff,
1968px 771px #fff, 129px 214px #fff, 733px 10px #fff, 847px 622px #fff,
1114px 8px #fff, 1714px 1396px #fff, 861px 1787px #fff, 480px 1624px #fff,
1026px 741px #fff, 1436px 167px #fff, 1642px 54px #fff, 1228px 141px #fff,
1282px 1416px #fff, 1703px 1192px #fff, 1885px 33px #fff, 1663px 221px #fff,
807px 283px #fff, 67px 1949px #fff, 961px 1480px #fff, 1709px 1359px #fff,
591px 1867px #fff, 1481px 1938px #fff, 189px 244px #fff, 1825px 1499px #fff,
816px 1190px #fff, 1679px 1521px #fff, 1376px 1324px #fff, 951px 1782px #fff,
953px 556px #fff, 1710px 1706px #fff, 1826px 608px #fff, 1326px 1095px #fff,
1467px 1709px #fff, 697px 731px #fff, 1323px 1097px #fff, 1192px 888px #fff,
732px 443px #fff, 431px 1225px #fff, 851px 1716px #fff, 30px 289px #fff,
47px 1807px #fff, 411px 1084px #fff, 881px 1385px #fff, 1347px 1646px #fff,
1577px 448px #fff, 1459px 229px #fff, 1178px 1305px #fff, 1467px 1527px #fff,
538px 807px #fff, 1377px 1531px #fff, 1398px 78px #fff, 1573px 422px #fff,
10px 1896px #fff, 435px 544px #fff, 224px 406px #fff, 7px 609px #fff,
752px 1956px #fff, 268px 964px #fff, 1395px 1358px #fff, 38px 492px #fff,
1819px 705px #fff, 56px 249px #fff, 1337px 1983px #fff, 151px 5px #fff,
533px 102px #fff, 1849px 678px #fff, 1393px 1483px #fff, 1166px 735px #fff,
425px 98px #fff, 907px 1764px #fff, 1628px 379px #fff, 1356px 1566px #fff,
1917px 1476px #fff, 162px 1815px #fff, 1518px 1495px #fff, 1889px 259px #fff,
342px 100px #fff, 1520px 248px #fff, 606px 1010px #fff, 553px 1713px #fff,
134px 1898px #fff, 721px 1342px #fff, 2px 1437px #fff, 1563px 890px #fff,
888px 1370px #fff, 1606px 1304px #fff, 786px 1421px #fff, 1426px 1692px #fff,
1693px 135px #fff, 1695px 49px #fff, 1145px 222px #fff, 65px 1376px #fff,
1027px 1788px #fff, 1007px 873px #fff, 1380px 67px #fff, 341px 1319px #fff,
34px 583px #fff, 1066px 921px #fff, 113px 689px #fff, 412px 1925px #fff,
1268px 67px #fff, 1535px 1358px #fff, 530px 317px #fff, 425px 349px #fff,
1435px 572px #fff, 1118px 1285px #fff, 875px 1186px #fff, 472px 520px #fff,
603px 463px #fff, 1578px 1649px #fff, 1659px 1046px #fff, 895px 1602px #fff,
1486px 1084px #fff, 1683px 1294px #fff, 290px 1862px #fff, 739px 1192px #fff,
615px 301px #fff, 696px 1592px #fff, 530px 79px #fff, 1718px 1266px #fff,
151px 1700px #fff, 1989px 1824px #fff, 1237px 1613px #fff, 964px 1299px #fff,
335px 341px #fff, 1133px 975px #fff, 996px 438px #fff, 281px 1552px #fff,
1352px 1071px #fff, 1057px 1379px #fff, 342px 14px #fff, 1154px 1563px #fff,
1802px 705px #fff, 737px 1790px #fff, 657px 1487px #fff, 1533px 1166px #fff,
1195px 704px #fff, 1448px 216px #fff, 1606px 1480px #fff, 1783px 1450px #fff,
626px 1292px #fff, 522px 258px #fff, 724px 1347px #fff, 55px 106px #fff,
948px 1791px #fff, 1672px 1688px #fff, 1094px 1534px #fff, 464px 1681px #fff,
666px 1081px #fff, 1413px 785px #fff, 74px 122px #fff, 1023px 1171px #fff,
407px 1852px #fff, 1254px 1667px #fff, 662px 256px #fff, 1969px 1163px #fff,
905px 939px #fff, 514px 120px #fff, 306px 365px #fff, 287px 1828px #fff,
881px 149px #fff, 1859px 403px #fff, 1008px 1725px #fff, 305px 564px #fff,
543px 1109px #fff, 1040px 337px #fff, 957px 62px #fff, 1039px 1250px #fff,
869px 267px #fff, 1450px 229px #fff, 1910px 686px #fff, 1373px 1913px #fff,
1202px 1617px #fff, 911px 545px #fff, 1537px 1311px #fff, 124px 1609px #fff,
1717px 1591px #fff, 1916px 1588px #fff, 550px 771px #fff, 596px 1107px #fff,
12px 1229px #fff, 984px 225px #fff, 981px 962px #fff, 1995px 1998px #fff,
822px 375px #fff, 542px 88px #fff, 277px 1327px #fff, 1028px 404px #fff,
1294px 195px #fff, 1456px 240px #fff, 333px 1451px #fff, 239px 1480px #fff,
53px 1845px #fff, 1239px 1585px #fff, 1826px 694px #fff, 1995px 682px #fff,
1804px 935px #fff, 1926px 1321px #fff, 1545px 850px #fff, 1957px 1071px #fff,
458px 977px #fff, 252px 1383px #fff, 616px 65px #fff, 192px 674px #fff,
547px 1603px #fff, 802px 1291px #fff, 1182px 1847px #fff, 303px 1498px #fff,
591px 952px #fff, 1539px 1472px #fff, 1997px 1270px #fff, 1707px 1895px #fff,
839px 252px #fff, 51px 1666px #fff, 1863px 1945px #fff, 1485px 1971px #fff,
59px 1569px #fff, 1486px 840px #fff, 852px 1370px #fff, 752px 1066px #fff,
1639px 947px #fff, 1213px 594px #fff, 1937px 390px #fff, 827px 1693px #fff,
1883px 1645px #fff, 1220px 1886px #fff, 499px 760px #fff, 1813px 722px #fff,
100px 223px #fff, 1270px 540px #fff, 1165px 894px #fff, 1846px 833px #fff,
172px 19px #fff, 109px 1228px #fff, 1431px 1565px #fff, 1565px 737px #fff,
326px 1377px #fff, 815px 1983px #fff, 1181px 1790px #fff, 79px 597px #fff,
264px 1777px #fff, 972px 864px #fff, 45px 1063px #fff, 797px 1905px #fff,
950px 1326px #fff, 1199px 488px #fff, 1921px 32px #fff, 894px 518px #fff,
1482px 1405px #fff, 660px 471px #fff, 171px 1537px #fff, 699px 1832px #fff,
725px 1988px #fff, 1496px 757px #fff, 1243px 310px #fff, 1274px 262px #fff,
790px 732px #fff, 1704px 1810px #fff, 959px 1327px #fff, 459px 161px #fff,
1629px 303px #fff, 1390px 699px #fff, 1973px 1799px #fff, 841px 963px #fff,
1985px 1621px #fff, 1267px 452px #fff, 1537px 1757px #fff, 251px 814px #fff,
1855px 987px #fff, 777px 26px #fff, 1837px 284px #fff, 1799px 1075px #fff,
1622px 337px #fff, 1283px 91px #fff, 1760px 585px #fff, 1669px 1911px #fff,
1397px 1669px #fff, 866px 1163px #fff, 281px 1425px #fff, 1455px 1643px #fff,
141px 402px #fff, 979px 1566px #fff, 1723px 589px #fff, 146px 424px #fff,
559px 1477px #fff, 779px 1999px #fff, 908px 674px #fff, 355px 570px #fff,
1760px 1654px #fff, 958px 1880px #fff, 604px 926px #fff, 291px 1165px #fff,
1856px 1003px #fff, 1104px 1161px #fff, 1296px 1341px #fff, 225px 406px #fff,
1180px 351px #fff, 1037px 372px #fff, 1439px 1669px #fff, 1110px 743px #fff,
1255px 419px #fff, 551px 1213px #fff, 490px 790px #fff, 1822px 1899px #fff,
100px 1283px #fff, 1119px 81px #fff;
}
#stars:after {
content: " ";
position: absolute;
bottom: 0px;
width: 1px;
height: 1px;
background: transparent;
}
@keyframes animStar {
from {
transform: translateY(-1400px);
}
to {
transform: translateY(-0px);
}
}
/**Own Code**/
.login {
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
width: 300px;
}
.login-screen {
background-color: #233142;
padding: 20px;
border-radius: 5px
}
.login-title {
text-align: center;
color: #587ca7;
}
.login-form {
text-align: center;
}
.login-box {
margin-bottom: 10px;
}
.login-field {
color: #7996b9;
background-color: #2c3e54;
}
input {
text-align: center;
background-color: #ECF0F1;
border: 2px solid transparent;
border-radius: 3px;
font-size: 16px;
font-weight: 200;
padding: 10px 0;
width: 250px;
transition: border .5s;
}
input:focus {
border: 2px solid #3498DB;
box-shadow: none;
}
.btn {
border: 2px solid transparent;
background: #3498DB;
color: #ffffff;
font-size: 16px;
line-height: 25px;
padding: 10px 0;
text-decoration: none;
text-shadow: none;
border-radius: 3px;
box-shadow: none;
transition: 0.25s;
display: block;
width: 250px;
margin: 0 auto;
}
.btn:hover {
background-color: #2980B9;
}
.login-link {
font-size: 12px;
color: #7996b9;
display: block;
margin-top: 12px;
}
.wpassword {
font-size: 12px;
color: #ff0000;
margin: center;
padding-left: 15%;
}

195
css/mobile.css Normal file
View File

@ -0,0 +1,195 @@
/* LOGO-WEBSTATUS */
@media only screen and (max-width: 967px) {
h1{
font-size: 6vw;
}
}
@media only screen and (max-width: 467px) {
h1{
font-size: 10vw;
}
}
/* GLOBAL-STATUS RESPONSIVE SHRINKING AND TEXT SHRINKING */
@media only screen and (max-width: 1067px) {
.status {
max-width: 93%;
}
}
@media only screen and (max-width: 967px) {
.status {
max-width: 92%;
}
}
@media only screen and (max-width: 867px) {
.status {
max-width: 90%;
}
}
@media only screen and (max-width: 767px) {
.status {
max-width: 87%;
}
}
@media only screen and (max-width: 517px) {
.status {
max-width: 80%;
}
}
@media only screen and (max-width: 457px) {
.status {
max-width: 75%;
}
.status-text {
font-size: 0.8em;
}
.status-time {
margin-top: 2.5px;
font-size: 0.8em;
}
}
/* TIMELINE RESPONSIVE SHRINKING */
@media only screen and (max-width: 1439px) {
.timeline .item .message {
width: 95%;
}
}
@media only screen and (max-width: 1200px) {
.timeline .item .message {
width: 94%;
}
}
@media only screen and (max-width: 1000px) {
.timeline .item .message {
width: 93%;
}
}
@media only screen and (max-width: 900px) {
.timeline .item .message {
width: 92%;
}
}
@media only screen and (max-width: 700px) {
.timeline .item .message {
width: 89%;
}
}
@media only screen and (max-width: 550px) {
.timeline .item .message {
width: 86%;
}
}
@media only screen and (max-width: 450px) {
.timeline .item .message {
width: 81%;
}
}
@media only screen and (max-width: 400px) {
.timeline .item .message {
width: 76%;
}
}
@media only screen and (max-width: 350px) {
.timeline .item .message {
width: 71%;
}
}
@media only screen and (max-width: 300px) {
.timeline .item .message {
width: 64%;
}
}
/* TIMELINE DATE AND SERVICE INFO MOVE */
@media only screen and (max-width: 1750px) {
.timeline-date {
margin-left: -60px;
margin-top: -130px;
}
.timeline {
margin-top: 150px;
}
.timeline-info {
position: absolute;
margin-left: -33px;
margin-top: -90px;
}
.timeline-services {
margin-left: -69px;
margin-top: -76px;
}
.vertical {
grid-gap: 3px;
grid-template-columns: 33% 33% 33% 33% 33% 33% 33%;
}
}
@media only screen and (max-width: 430px) {
.vertical {
grid-gap: 3px;
grid-template-columns: 33% 33% 33% 33% 33%;
}
}
@media only screen and (max-width: 650px) {
.status-annoucement {
visibility:hidden
}
}
/* MORE BOX RESIZING */
@media screen and (max-width: 700px){
.more-box{
width: 70%;
}
.more-popup{
width: 70%;
}
}
@media screen and (max-height: 700px){
.more-popup {
margin: 9% auto;
}
}
@media screen and (max-height: 600px){
.more-popup {
margin: 2% auto;
}
}
@media screen and (max-width: 400px){
.more-popup {
margin: 2% auto;
}
}

714
css/style.css Normal file
View File

@ -0,0 +1,714 @@
body{
background: #233142;
overflow-x: hidden;
max-width: 1400px;
margin: 0 auto;
padding:15px;
}
h1{
vertical-align: top;
text-align: left;
font-family: "Lato", sans-serif;
font-size: 3vw;
color: #009900;
position: relative;
left: 25px;
}
h4{
font-family: 'Brush Script MT', cursive;
font-size: 0.2vw;
color: #009900;
}
@-webkit-keyframes dual-ring {
0% {
-webkit-transform: rotate(0);
transform: rotate(0);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes dual-ring {
0% {
-webkit-transform: rotate(0);
transform: rotate(0);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
.dual-ring div {
width: 20px;
height: 20px;
border-radius: 50%;
border: 2px solid #000;
border-color: #039be5 transparent #039be5 transparent;
-webkit-animation: dual-ring 1.3s linear infinite;
animation: dual-ring 1.3s linear infinite;
}
.status {
border-radius: 4px;
display: -webkit-box;
display: flex;
-webkit-box-align: center;
align-items: center;
border: 2px solid transparent;
-webkit-transition: 0.5es;
transition: 0.5s;
padding: 15px;
margin: 0 auto;
max-width: 94%;
}
.status > div {
width:100%;
}
.status.status-checking {
background-color: #233142;
border-color: #90CAF9;
color: #90CAF9;
}
.status.status-okay {
background-color: #233142;
color: #8bc34a;
border-color: #8bc34a;
}
.status.status-maintenance {
background-color: #233142;
color: #ff9933;
border-color: #ff9933;
}
.status.status-problems {
background-color: #233142;
color: #ff1a1a;
border-color: #ff1a1a;
}
.status-text {
font-weight: bold;
display: inline;
font-family: 'Trebuchet MS', sans-serif;
}
.status-time {
float: right;
font-weight: bold;
font-family: 'Trebuchet MS', sans-serif;
}
.status .loading {
width: 25px;
height: 25px;
margin-right: 10px;
}
.status .loading.fa {
font-size: 1.6em;
}
input[type="checkbox"] {
position: absolute;
opacity: 0;
z-index: -1;
}
label {
position: relative;
display: inline-block;
padding: 1px 0 0 1.5em;
height: 1.5em;
line-height: 1.0;
cursor: pointer;
font-family: 'Trebuchet MS', sans-serif;
color: #7996b9;
float: right;
right: 24px;
}
label::before,
label::after {
position: absolute;
top: 0;
left: 0;
display: block;
width: 1.0em;
height: 1.0em;
}
label::before {
content: " ";
border: 2px solid #7996b9;
border-radius: 20%;
}
input[type="checkbox"] + label::after {
font-family:FontAwesome;
content: "\f00c";
color: #7996b9;
line-height: 1.3;
text-align: center;
margin-left:2px;
}
input[type="checkbox"]:checked + label::before {
/*background: #587ca7;
border-color: #587ca7;*/
}
input[type="checkbox"] + label::after {
-webkit-transform: scale(0);
-ms-transform: scale(0);
-o-transform: scale(0);
transform: scale(0);
}
input[type="checkbox"]:checked + label::after {
-webkit-transform: scale(1);
-ms-transform: scale(1);
-o-transform: scale(1);
transform: scale(1);
}
label::before,
label::after {
-webkit-transition: .25s all ease;
-o-transition: .25s all ease;
transition: .25s all ease;
}
.service-block {
padding: 13px;
font-family: "Lato", sans-serif;
margin-bottom: -30px;
}
.service-title {
color: #8bc34a;
}
.services {
border: 1px solid #E3E3E3;
border-radius: 4px;
list-style-type: none;
padding: 1rem 0.75rem 0.25rem;
border: 2px solid #000;
border-color: #233142 transparent #233142 transparent;
}
.services-okay {
background-color: #233142;
color: #8bc34a;
}
.services-maintenance {
background-color: #233142;
color: #ff9933;
}
.services-troubles {
background-color: #233142;
color: #ff1a1a;
}
.services-header {
margin-top: 0;
}
.service {
border: 1px solid #E3E3E3;
border-color: #354a64;
border-radius: 2px;
cursor: pointer;
margin-bottom: 0.5rem;
padding: 0.75rem 0;
position: relative;
}
.service-name {
display:flex;
border-left-width:2px;
border-left-style:solid;
padding-left: 1rem;
}
.service-icon {
display:flex;
float:left;
}
.service-icon:before {
font-family:FontAwesome;
display: inline-block;
height: 1.4rem;
line-height: 1.4rem;
text-align: center;
width: 2.8rem;
}
.service-okay > .service-name {
border-left-color: #42996D;
}
.service-okay > .service-icon:before {
color: #42996D;
content: "\f00c";
}
.service-maintenance > .service-name {
border-left-color: #ff9933;
}
.service-maintenance > .service-icon:before {
color: #ff9933;
content: "\f017";
}
.service-troubles > .service-name {
border-left-color: #ff1a1a;
}
.service-troubles > .service-icon:before {
color: #ff1a1a;
content: "\f00d";
}
.status-annoucement {
float: right;
margin-top: -20px;
padding-right: 20px;
font-family: 'Trebuchet MS', sans-serif;
position: relative;
}
.status-annoucement:before {
font-family:FontAwesome;
content: "\f12a";
color: #ff9933;
}
.timeline {
position: relative;
padding-left: 70px;
margin-top: 100px;
}
.timeline:before {
position: absolute;
width: 2px;
height: 100%;
left: 30px;
content: "";
background: #354a64;
}
.timeline .item {
position: relative;
}
.timeline .item .circle {
position: absolute;
top: 18px;
left: -46px;
background: #acbbc7;
border: 4px solid #354a64;
width: 6px;
height: 6px;
border-radius: 50%;
}
.timeline .item .message {
width: 1264px;
position: relative;
padding: 15px 20px;
margin-bottom: 15px;
background: #2c3e54;
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
border-radius: 5px;
font-family: 'Trebuchet MS', sans-serif;
color: #a6a6a6;
}
.timeline-icon {
display:flex;
float:left;
padding-right: 15px;
}
.timeline-new:before {
font-family:FontAwesome;
content: "\f0a1";
color: #cc6600;
}
.timeline-working:before {
font-family:FontAwesome;
content: "\f013";
color: #0052cc;
}
.timeline-update:before {
font-family:FontAwesome;
content: "\f0e5";
color: #4d9900;
}
.timeline-finished:before {
font-family:FontAwesome;
content: "\f00c";
color: #8bc34a;
}
.timeline .item .message:before {
position: absolute;
z-index: 0;
content: "";
top: 25px;
left: -6px;
box-sizing: border-box;
border: 5px solid transparent;
border-top-color: #2c3e54;
border-bottom-color: transparent;
border-left-color: #2c3e54;
border-right-color: transparent;
filter: drop-shadow(-1px 0 1px rgba(0, 0, 0, 0.08));
transform-origin: 0 0;
transform: rotate(-45deg);
}
.timeline-date {
position: absolute;
margin-left: -260px;
margin-top: 10px;
}
.timeline-date h1 {
font-size: 1.8em;
font-family: "Lato", sans-serif;
color: #3e5675;
}
.timeline-info {
position: absolute;
margin-left: -232px;
margin-top: 50px;
}
.timeline-info h2 {
font-size: 0.8em;
font-family: "Lato", sans-serif;
color: #3e5675;
}
.timeline-services {
position: absolute;
margin-left: -270px;
margin-top: 63px;
max-width: 180px;
text-align: center;
}
.timeline-services li {
font-size: 0.8em;
font-family: "Lato", sans-serif;
color: #3e5675;
}
.timeline-services li {
list-style-type: none;
}
.vertical {
display: grid;
grid-gap: 5px;
grid-template-columns: 33% 33% 33%;
}
.footer {
margin-top: 50px;
color: #868c96;
}
.footer-heart {
color: #f42;
font-size: 0.8em;
}
.footer-subtext {
color: #868c96;
margin-top: -94px;
}
.footer p {
padding: 40px 0;
text-align: center;
}
.footer img {
width: 44px;
}
.footer a {
text-decoration: none;
color: #868c96;
}
.footer a:hover {
text-decoration: underline;
color: #868c96;
}
.legend {
position: absolute;
margin-top: -40px;
display: inline-block;
left: 30px;
}
.legend-text {
color: #a6a6a6;
font-family: "Lato", sans-serif;
font-size: 0.8em;
padding-right: 5px;
}
.legend-maintenance:before {
font-family:FontAwesome;
content: "\f017";
color: #ff9933;
}
.legend-problems:before {
font-family:FontAwesome;
content: "\f00d";
color: #ff1a1a;
}
.legend-lastdown:before {
font-family:FontAwesome;
color: #cc6600;
content: "\f05c";
}
.more-box {
width: 40%;
margin: 0 auto;
background: rgba(255,255,255,0.2);
padding: 35px;
border: 2px solid #233142;
border-radius: 20px/50px;
background-clip: padding-box;
text-align: center;
}
.more-overlay {
position: fixed;
top: 0;
bottom: 0;
left: 0;
right: 0;
background: rgba(0, 0, 0, 0.7);
transition: opacity 500ms;
visibility: hidden;
opacity: 0;
}
.more-overlay:target {
visibility: visible;
opacity: 1;
}
.more-popup {
margin: 15% auto;
padding: 20px;
background: #233142;
border-radius: 5px;
width: 30%;
position: relative;
transition: all 5s ease-in-out;
}
.more-popup h2 {
margin-top: 0;
color: #a6a6a6;
font-family: Tahoma, Arial, sans-serif;
}
.more-popup .close {
position: absolute;
top: 20px;
right: 30px;
transition: all 200ms;
font-size: 30px;
font-weight: bold;
text-decoration: none;
color: #a6a6a6;
}
.more-popup .close:hover {
color: #009900;
}
.more-popup .content {
max-height: 30%;
overflow: auto;
}
.more-box-caller {
text-decoration: none;
}
.more-up {
margin-top: -12px;
padding-left: 1px;
color: #42996D;
font-family: Tahoma, Arial, sans-serif;
}
.more-up:before {
color: #42996D;
content: "\f00c";
font-family:FontAwesome;
}
.more-working {
margin-top: -12px;
padding-left: 1px;
color: #0052cc;
font-family: Tahoma, Arial, sans-serif;
}
.more-working:before {
color: #0052cc;
content: "\f013";
font-family:FontAwesome;
}
.more-maintenance {
margin-top: -12px;
padding-left: 1px;
color: #ff9933;
font-family: Tahoma, Arial, sans-serif;
}
.more-maintenance:before {
color: #ff9933;
content: "\f017";
font-family:FontAwesome;
}
.more-troubles {
margin-top: -12px;
padding-left: 1px;
color: #ff1a1a;
font-family: Tahoma, Arial, sans-serif;
}
.more-troubles:before {
color: #ff1a1a;
content: "\f00d";
font-family:FontAwesome;
}
.more-lastdown {
margin-top: 2px;
padding-left: 2px;
color: #cc6600;
font-family: Tahoma, Arial, sans-serif;
}
.more-lastdown:before {
color: #cc6600;
content: "\f05c";
font-family:FontAwesome;
}
.more-maintenance-info {
margin-top: 4px;
margin-top: 4px;
padding-left: 2px;
color: #a6a6a6;
font-family: Tahoma, Arial, sans-serif;
}
.more-maintenance-info:before {
color: #ff9933;
content: "\f017";
font-family:FontAwesome;
}
.more-hide-maintenance {
display: none;
}
.hidden {
display: none;
visibility: hidden;
}
.underline {
text-decoration: underline;
text-decoration-color: #a6a6a6;
}
.cookies {
position: fixed;
width: 99.7%;
height: 100px;
border-color: #3f9066;
border-style: solid;
background-color: #222c3b;
bottom: 0;
left: 0;
}
.cookies .cogs {
position: absolute;
top: 35%;
left: 15px;
font-size: 2em;
color: white;
}
.cookies h1 {
left: 0px;
font-size: 1vw;
color: white;
margin-top: 25px;
}
.cookies p {
margin-top: -10px;
color: #a6a6a6;
}
.cookies .text {
position: absolute;
left: 5%;
}
.cookies button {
position: fixed;
right: 15px;
bottom: 35px;
cursor: pointer;
border-radius: 5px;
border: none;
outline: none;
transition: 0.7s;
width: 100px;
height: 40px;
font-size: 20px;
color: white;
box-shadow: 0 0 5px rgba(0, 0, 0, 0);
background-color: #83be4e;
}
.cookies button:hover {
background-color: #578230;
}
.cookies .handshake {
margin-left: 10px;
}

52
functions.php Normal file
View File

@ -0,0 +1,52 @@
<?php
function sMaintenance() {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$services = mysqli_query($con, "SELECT priority, groupid, name, id, status FROM services ORDER BY priority DESC");
$find = False;
while($servicelist = mysqli_fetch_array($services)){
if(strpos($servicelist['status'], "Maintenance") !== false) {
$find = True;
}
}
return $find;
}
function sOffline() {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$services = mysqli_query($con, "SELECT priority, groupid, name, id, status FROM services ORDER BY priority DESC");
$find = False;
while($servicelist = mysqli_fetch_array($services)){
if(strpos($servicelist['status'], "Offline") !== false) {
$find = True;
}
}
return $find;
}
function getName($id) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
return mysqli_fetch_assoc(mysqli_query($con, "SELECT sname FROM services WHERE id='".mysqli_real_escape_string($con, $id)."'"))["sname"];
}
?>

313
index.php Normal file
View File

@ -0,0 +1,313 @@
<?php
//Fetch data from database;
include('config.php');
include('functions.php');
//Checking if setup is complete
if(!file_exists("config.php")) {
header("Location: install/index.php");
die();
}
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$instancename = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='instancename'"))["value"];
$autoreload_setting = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='autoreload'"))["value"];
$privacy = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='privacy'"))["value"];
$impressum = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='impressum'"))["value"];
$newtab = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='newtab'"))["value"];
$groups = mysqli_query($con, "SELECT priority, name, id FROM groups ORDER BY priority DESC");
$services = mysqli_query($con, "SELECT priority, groupid, name, id, status FROM services ORDER BY priority DESC");
$incidents = mysqli_query($con, "SELECT id, status, services, text, date, childof FROM incidents ORDER BY id ASC");
$incidents2 = mysqli_query($con, "SELECT id, status, services, text, date, childof FROM incidents ORDER BY id ASC");
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link type="text/css" rel="stylesheet" href="css/style.css" />
<link type="text/css" rel="stylesheet" href="css/mobile.css" />
<link rel="stylesheet" href="css/font-awesome/css/font-awesome.css">
<?php
echo '<title>'.$instancename.' - Home</title>';
?>
</head>
<body>
<?php
echo '<h1>'.$instancename.'</h1>';
?>
<!-- GLOBAL STATUS-->
<?php
if(sOffline()) {
echo '
<div class="global-status">
<div id="status" class="status status-problems">
<div class="loading fa fa-times">
</div>
<div>
<div class="status-text">Some Systems may not work at the moment</div>
<div id="timer" class="status-time"></div>
</div>
</div>';
} else if(sMaintenance()) {
echo '
<div class="global-status">
<div id="status" class="status status-maintenance">
<div class="loading fa fa-times">
</div>
<div>
<div class="status-text">Systems currently under maintenance</div>
<div id="timer" class="status-time"></div>
</div>
</div>';
} else {
echo '
<div class="global-status">
<div id="status" class="status status-okay">
<div class="loading fa fa-times">
</div>
<div>
<div class="status-text">All Systems operational!</div>
<div id="timer" class="status-time"></div>
</div>
</div>';
}
?>
<!-- AUTORELOAD CHECKBOX-->
<?php
if($autoreload_setting == "enabled") {
echo '
<p>
<input type="checkbox" id="cb1" checked>
<label for="cb1">Autoreload</label>
</p>';
}
?>
</div>
<?php
mysqli_data_seek($groups, 0);
while($grouplist = mysqli_fetch_array($groups)){
echo '
<div class="service-block">
<ul class="services">
<h3 class="services-header service-title">'.$grouplist['name'].'</h3>
';
mysqli_data_seek($services, 0);
while($servicelist = mysqli_fetch_array($services)){
if($grouplist['id'] == $servicelist['groupid']) {
if($servicelist['status'] == "Online") {
echo '
<li id="status-'.$servicelist['id'].'" class="service service-okay services-okay">
<div class="service-icon"></div>
<div class="service-name">'.$servicelist['name'].'</div>
</li></a>
';
} else if($servicelist['status'] == "Maintenance") {
echo '
<li id="status-'.$servicelist['id'].'" class="service service-maintenance services-maintenance">
<div class="service-icon"></div>
<div class="service-name">'.$servicelist['name'].'</div>
<div id="alert-'.$servicelist['id'].'" class="status-annoucement"></div>
</li></a>
';
} else if($servicelist['status'] == "Offline") {
echo '
<li id="status-'.$servicelist['id'].'" class="service service-troubles services-troubles">
<div class="service-icon"></div>
<div class="service-name">'.$servicelist['name'].'</div>
<div id="alert-'.$servicelist['id'].'" class="status-annoucement"></div>
</li></a>
';
}
}
}
echo '
</ul>
</div>
';
}
?>
<!-- TIMELINE REPORT NEW -->
<?php
mysqli_data_seek($incidents, 0);
$count = 3;
if(isset($_GET['lmore'])) {
$add = (int) $_GET['lmore'];
$count += $add;
}
while($incidentlist = mysqli_fetch_array($incidents)){
if($count != 0) {
if(strpos($incidentlist['childof'], "-1") !== false) {
$count--;
echo '
<div class="timeline">
<div class="timeline-date">
<h1>'.str_replace("-", ".", $incidentlist['date']).'</h1>
</div>
<div class="timeline-info">
<h2>Affected Services:</h2>
</div>
<div class="timeline-services">
<ul class="vertical">';
$servicearray = explode(",", $incidentlist['services']);
foreach ($servicearray as $index) {
echo '<li>'.getName($index).'</li>';
}
echo '
</ul>
</div>
<div class="item">
<div class="circle"></div>
<div class="message">';
if(strpos($incidentlist['status'], "new") !== false) {
echo '
<div class="timeline-icon timeline-new"></div>
'.$incidentlist['text'].'
</div>
</div>';
} else if(strpos($incidentlist['status'], "working") !== false) {
echo '
<div class="timeline-icon timeline-working"></div>
'.$incidentlist['text'].'
</div>
</div>';
} else if(strpos($incidentlist['status'], "update") !== false) {
echo '
<div class="timeline-icon timeline-update"></div>
'.$incidentlist['text'].'
</div>
</div>';
} else if(strpos($incidentlist['status'], "finished") !== false) {
echo '
<div class="timeline-icon timeline-finished"></div>
'.$incidentlist['text'].'
</div>
</div>';
}
mysqli_data_seek($incidents2, 0);
while($incidentlist2 = mysqli_fetch_array($incidents2)){
if(strpos($incidentlist['id'], $incidentlist2['childof']) !== false) {
echo '
<div class="item">
<div class="circle"></div>
<div class="message">';
if(strpos($incidentlist2['status'], "new") !== false) {
echo '
<div class="timeline-icon timeline-new"></div>
'.$incidentlist2['text'].'
</div>
</div>';
} else if(strpos($incidentlist2['status'], "working") !== false) {
echo '
<div class="timeline-icon timeline-working"></div>
'.$incidentlist2['text'].'
</div>
</div>';
} else if(strpos($incidentlist2['status'], "update") !== false) {
echo '
<div class="timeline-icon timeline-update"></div>
'.$incidentlist2['text'].'
</div>
</div>';
} else if(strpos($incidentlist2['status'], "finished") !== false) {
echo '
<div class="timeline-icon timeline-finished"></div>
'.$incidentlist2['text'].'
</div>
</div>
';
}
}
}
echo '</div>';
}
}
}
?>
<!-- FOOTER -->
<footer class="footer">
<p class="footer">Powered by <a class="underline" href="http://git.thiemoo.at/Givou/WebStatus.git" target="_blank">WebStatus</a></p>
<?php
if($newtab === "new tab") {
echo '<p class="footer-subtext"><a target="_blank" href="'.$impressum.'">Impressum</a> | <a target="_blank" href="'.$privacy.'">Privacy policity</a></p>';
} else {
echo '<p class="footer-subtext"><a href="'.$impressum.'">Impressum</a> | <a href="'.$privacy.'">Privacy policity</a></p>';
}
?>
<p class="footer-subtext">Made with <span class="footer-heart"><i class="fa fa-heart"></i></span> by <a target="_blank" href="https://thiemoo.at">Givou</a></p>
</footer>
<div class="legend">
<span class="timeline-new legend-text"> Annoucement</span>
<span class="timeline-update legend-text"> Update</span>
<span class="timeline-working legend-text"> Working on a fix</span>
<span class="timeline-finished legend-text"> Finished / No Problems</span>
<span class="legend-maintenance legend-text"> Maintenance</span>
<span class="legend-lastdown legend-text"> Last time down</span>
<span class="legend-problems legend-text"> Offline / Problems</span>
</div>
<?php
if(isset($_GET["disclaimcookie"])) {
setcookie('disclaimed', 'true');
}
if(!isset($_COOKIE['disclaimed']) && !isset($_GET["disclaimcookie"])) {
echo '
<div class="cookies">
<i class="cogs fa fa-cogs" aria-hidden="true"></i>
<div class="text">
<h1>Cookie disclaimer</h1>
<p>This website only uses technical cookies to store session information or to hide this disclaimer!</p>
<a href="index.php?disclaimcookie"><button class="button-green button-up">Got it<i class="handshake fa fa-handshake-o" aria-hidden="true"></i></button></a>
</div>
</div>
';
}
?>
</body>
<?php
if($autoreload_setting == "enabled") {
echo '<script type="text/javascript" src="js/checking.js"></script>';
}
?>
</html>

120
install/index.php Normal file
View File

@ -0,0 +1,120 @@
<?php
session_start();
if(file_exists("../config.php")) {
header("Location: ../index.php");
die();
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link type="text/css" rel="stylesheet" href="style.css" />
<title>WebStatus - Simplesetup</title>
</head>
<body>
<div class="center">
<form method="POST" action="index.php">
<h2 class="text">Setup</h2>
<?php
if(isset($_GET['mysqlerror'])) {
echo '<p class="error">MySQL Connection failed, please check your inputs!</p>';
}
if(isset($_GET['passwordnotmatch'])) {
echo '<p class="error">Passwords do not match!</p>';
}
?>
<p class="subtext">Website Settings:</p>
<input type="text" class="" placeholder="Websitetitle" name="websitename" required>
<p class="subtext">Database Setup:</p>
<input type="text" placeholder="Host" name="dbhost" required>
<input type="text" placeholder="Databasename" name="dbname" required>
<input type="text" placeholder="User" name="dbuser" required>
<input type="password" placeholder="Password" name="dbpwd" required>
<p class="subtext">Administrative User:</p>
<input type="text" placeholder="Username" name="username" required>
<input type="password" placeholder="Password" name="password" required>
<input type="password" placeholder="repeat password" name="password2" required>
<input class="button-green" value="Submit" type="submit">
</form>
</div>
</body>
</html>
<?php
if(isset($_POST['dbhost']) && isset($_POST['dbname']) && isset($_POST['dbpwd']) && isset($_POST['dbuser'])
&& isset($_POST['websitename']) && isset($_POST['username']) && isset($_POST['password']) && isset($_POST['password2'])) {
if(!file_exists("../config.php")) {
//Inputs read in, check inputs, start infliating database
$instancename = $_POST['websitename'];
$dbhost = $_POST['dbhost'];
$dbname = $_POST['dbname'];
$dbpwd = $_POST['dbpwd'];
$dbuser = $_POST['dbuser'];
$admin_username = $_POST['username'];
$admin_password = $_POST['password'];
$admin_password2 = $_POST['password2'];
$admin_password_hash = password_hash($_POST['password'], PASSWORD_DEFAULT);
//Check if passwords of the administrative user match
if(strcmp($admin_password, $admin_password2)) {
header("Location: index.php?passwordnotmatch");
die();
}
$con = mysqli_connect($dbhost, $dbuser, $dbpwd, $dbname) OR header("Location: index.php?mysqlerror") && die();
//Creating Tables
mysqli_query($con, "CREATE TABLE IF NOT EXISTS accounts(id int(255) PRIMARY KEY AUTO_INCREMENT, username varchar(255), password varchar(255), role varchar(255));");
mysqli_query($con, "CREATE TABLE IF NOT EXISTS groups(id int(255) PRIMARY KEY AUTO_INCREMENT, priority int(255), name varchar(255));");
mysqli_query($con, "CREATE TABLE IF NOT EXISTS incidents(id int(255) PRIMARY KEY AUTO_INCREMENT, status varchar(255), services varchar(255), text varchar(255), date varchar(255), childof int(255));");
mysqli_query($con, "CREATE TABLE IF NOT EXISTS services(id int(255) PRIMARY KEY AUTO_INCREMENT, priority int(255), groupid int(255), name varchar(255), status varchar(255), cmaintenance int(255), sname varchar(255));");
mysqli_query($con, "CREATE TABLE IF NOT EXISTS settings(type varchar(255), value varchar(255));");
//Infliating Settings
mysqli_query($con, "INSERT INTO settings(type, value) VALUES ('instancename', '".mysqli_real_escape_string($con,$instancename)."')");
mysqli_query($con, "INSERT INTO settings(type, value) VALUES ('autoreload', 'enabled')");
mysqli_query($con, "INSERT INTO settings(type, value) VALUES ('impressum', '#')");
mysqli_query($con, "INSERT INTO settings(type, value) VALUES ('privacy', '#')");
mysqli_query($con, "INSERT INTO settings(type, value) VALUES ('newtab', 'same tab')");
//Creating Administrative User
mysqli_query($con, "INSERT INTO accounts (username, password, role) VALUES ('".mysqli_real_escape_string($con,$admin_username)."',
'".mysqli_real_escape_string($con,$admin_password_hash)."', 'administrator')");
//Create Config
if($con != null) {
$config = ('<?php
$config=array(
"DBHOST"=>"'.$dbhost.'",
"DBNAME"=>"'.$dbname.'",
"DBPWD"=>"'.$dbpwd.'",
"DBUSER"=>"'.$dbuser.'"
);
?>');
file_put_contents("../config.php",$config);
header("Location: ../admin.php");
}
//Setup File already exists
} else {
header("Location: ../index.php");
die();
}
}
?>

114
install/style.css Normal file
View File

@ -0,0 +1,114 @@
body {
background: #233142;
}
input {
text-align: center;
background-color: #ECF0F1;
border: 2px solid transparent;
border-radius: 3px;
font-size: 15px;
font-weight: 200;
padding: 10px 0;
width: 200px;
transition: border .5s;
margin-left: -2px;
margin-top: 2px;
color: #7996b9;
background-color: #2c3e54;
display: block !important;
}
input:focus {
border: 2px solid #3498DB;
box-shadow: none;
}
.center {
transform: translate(440%, 10%);
width: 10%;
}
.text {
font-family: "Lato", sans-serif;
color: #a6a6a6;
}
.subtext {
font-family: "Lato", sans-serif;
color: #a6a6a6;
}
.error {
font-family: "Lato", sans-serif;
size: 1em;
color: #800000;
}
button {
position: relative;
margin-bottom: 2px;
font-size: 15px !important;
font-weight: 200 !important;
color: #7996b9 !important;
}
button:focus {
outline: 0;
}
button:before {
content: "";
display: block;
position: absolute;
background: rgba(255, 255, 255, 0.5);
width: 60px;
height: 100%;
left: 0;
top: 0;
opacity: 0.5;
filter: blur(30px);
transform: translateX(-100px) skewX(-15deg);
}
button:after {
content: "";
display: block;
position: absolute;
background: rgba(255, 255, 255, 0.2);
width: 30px;
height: 100%;
left: 30px;
top: 0;
opacity: 0;
filter: blur(5px);
transform: translateX(-100px) skewX(-15deg);
}
button:hover:before {
transform: translateX(300px) skewX(-15deg);
opacity: 0.6;
transition: 0.7s;
}
button:hover:after {
transform: translateX(300px) skewX(-15deg);
opacity: 1;
transition: 0.7s;
}
.button-green {
background: #2c3e54;
color: #ccc;
width: 80px;
height: 42px;
border: 0;
font-size: 18px;
border-radius: 4px;
font-family: "Raleway", sans-serif;
transition: 0.6s;
overflow: hidden;
}
.button-green:hover {
background: #338033;
cursor: pointer;
}

104
js/checking.js Normal file
View File

@ -0,0 +1,104 @@
timer();
var checkbox = document.getElementById("cb1");
function timer() {
var timeleft = 300;
var downloadTimer = setInterval(function(){
if (checkbox.checked) {
if(timeleft <= 0){
clearInterval(downloadTimer);
document.getElementById("timer").innerHTML = "checking";
reload();
} else {
document.getElementById("timer").innerHTML = timeleft + "s";
}
timeleft -= 1;
} else {
if(document.getElementById("timer").innerHTML.includes("s")) {
document.getElementById("timer").innerHTML = "";
}
}
}, 1000);
}
function reload() {
if(checkbox.checked) {
var xmlhttp = new XMLHttpRequest();
xmlhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var json = JSON.parse(this.responseText);
var current = json.overall;
var status = document.getElementById("status");
var loading = document.querySelector('#status .loading');
var text = document.querySelector('#status .status-text');
loading.innerHTML = '<div style="width:100%;height:100%" class="dual-ring"><div></div></div>';
loading.className = 'loading';
status.className = "status status-checking";
text.innerHTML = 'Checking...';
setTimeout(function () {
document.getElementById("timer").innerHTML = "300s";
switch(current) {
case "Online":
loading.innerHTML = '';
loading.className = 'loading fa fa-check';
status.className = "status status-okay";
text.innerHTML = 'All systems operational';
break;
case "Maintenance":
loading.innerHTML = '';
loading.className = 'loading fa fa-clock-o';
status.className = "status status-maintenance";
text.innerHTML = 'Systems currently under maintenance';
break;
case "Offline":
loading.innerHTML = '';
loading.className = 'loading fa fa-times';
status.className = "status status-problems";
text.innerHTML = 'Some Systems may not work correctly';
break;
}
for( let prop in json ){
if(!(prop === "overall")) {
var cbox = document.getElementById("status-"+prop);
var cstatus = json[prop];
switch(cstatus) {
case "Online":
cbox.className = "service service-okay services-okay";
if(document.getElementById("alert-"+prop) != null) {
document.getElementById("alert-"+prop).className = 'hidden';
}
break;
case "Maintenance":
cbox.className = "service service-maintenance services-maintenance";
document.getElementById("alert-"+prop).className = 'status-annoucement';
break;
case "Offline":
cbox.className = "service service-troubles services-troubles";
document.getElementById("alert-"+prop).className = 'status-annoucement';
break;
}
}
}
timer();
}, 1000)
}
};
xmlhttp.open("GET", "json.php", true);
xmlhttp.send();
}
}

7
js/redirect.js Normal file
View File

@ -0,0 +1,7 @@
var url = window.location.href;
var hash = url.substring(url.indexOf('#'));
var check = hash.includes("#");
if(check == false) {
window.location.replace(url+"#dashboard");
}

17
js/sidebar.js Normal file
View File

@ -0,0 +1,17 @@
var inner = document.getElementById("sidebar").innerHTML;
function closeNav() {
document.getElementById("sidebar").style.width = "0";
document.getElementById("sidebar").innerHTML = "";
document.getElementById("opener").style.visibility = "visible";
}
function openNav() {
document.getElementById("sidebar").style.width = "35%";
document.getElementById("sidebar").innerHTML = inner;
document.getElementById("opener").style.visibility = "hidden";
}
if( /Android|webOS|iPhone|iPad|Mac|Macintosh|iPod|BlackBerry|IEMobile|Opera Mini/i.test(navigator.userAgent) ) {
closeNav();
}

45
json.php Normal file
View File

@ -0,0 +1,45 @@
<?php
session_start();
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$status = mysqli_query($con, "SELECT id,status FROM services ORDER BY priority DESC");
$overall;
$jsonObj = new stdClass();
while($statuses = mysqli_fetch_array($status)){
if(strcmp($statuses['status'], "Offline") == 0) {
$overall = "offline";
} else if((strcmp($statuses['status'], "Maintenance") == 0) && !$overall == "offline"){
$overall = "maintenance";
}
$id = $statuses['id'];
$jsonObj->$id = $statuses['status'];
}
switch($overall) {
case "online":
$jsonObj->overall = "Online";
break;
case "maintenance":
$jsonObj->overall = "Maintenance";
break;
case "offline":
$jsonObj->overall = "Offline";
break;
default:
$jsonObj->overall = "Online";
break;
}
$json = json_encode($jsonObj);
echo $json;
?>

107
login.php Normal file
View File

@ -0,0 +1,107 @@
<?php
session_start();
if(!file_exists("config.php")) {
header("Location: install/index.php");
die();
}
if(isset($_SESSION['loggedin']) && $_SESSION['loggedin'] == true) {
header("Location: admin.php");
}
?>
<?php
$wrong=FALSE;
if(isset($_POST['username']) && isset($_POST['password'])) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
if (empty($_POST['username']) || empty($_POST['password'])) {
header("Location: login.php");
}
if ($stmt = $con->prepare('SELECT id, password FROM accounts WHERE username = ?')) {
$stmt->bind_param('s', $_POST['username']);
$stmt->execute();
$stmt->store_result();
if ($stmt->num_rows > 0) {
$stmt->bind_result($id, $password);
$stmt->fetch();
if (password_verify($_POST['password'], $password)) {
session_regenerate_id();
$_SESSION['loggedin'] = TRUE;
$_SESSION['name'] = $_POST['username'];
$_SESSION['id'] = $id;
$wrong=FALSE;
header("Location: admin.php");
} else {
$wrong=TRUE;
}
} else {
$wrong=TRUE;
}
$stmt->close();
}
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<link type="text/css" rel="stylesheet" href="css/login/style.css" />
<link rel="stylesheet" href="css/font-awesome/css/font-awesome.css">
<title>WebStatus - Adminlogin</title>
</head>
<body>
<div id="stars"></div>
<div class="login">
<div class="login-screen">
<div class="login-title">
<h1>Login</h1>
</div>
<?php
if($wrong == true) {
echo '<p class="wpassword">Wrong password or username!</p>';
}
?>
<form action="login.php" method="post">
<div class="login-form">
<div class="login-box">
<input type="text" class="login-field" value="" placeholder="Username" id="username" name="username" required>
<label class="login-field-icon fui-user" for="username"></label>
</div>
<div class="login-box">
<input type="password" class="login-field" value="" placeholder="Password" id="password" name="password" required>
<label for="password"></label>
</div>
<input type="submit" value="Login" class="btn btn-primary btn-large btn-block" href="#"></input>
<a class="login-link" href="index.php">Back to Statuspage</a>
</div>
</form>
</div>
</div>
</body>
</html>

96
readme.txt Normal file
View File

@ -0,0 +1,96 @@
__ __ ___. _________ __ __
/ \ / \ ____\_ |__ / _____// |______ _/ |_ __ __ ______
\ \/\/ // __ \| __ \ \_____ \\ __\__ \\ __\ | \/ ___/
\ /\ ___/| \_\ \/ \| | / __ \| | | | /\___ \
\__/\ / \___ >___ /_______ /|__| (____ /__| |____//____ >
\/ \/ \/ \/ \/ \/
Made with love by Givou
#Demo
https://status.nerdcity.at
#License
This Project is Licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) License
View your rights here: https://creativecommons.org/licenses/by-sa/4.0/
#setup
This is a sample setup! You can modify folder names as you wish.
#1:
cd /var/www
#2:
git clone http://git.thiemoo.at/Givou/WebStatus.git
#3:
chown -R www-data:www-data
#4:
cd /etc/nginx/sites-available
#5:
nano status.conf
6#
You can now paste this Nginx Sample Configuration.
Its made very simple, and should work for php7.4 nginx webservers.
server {
listen 80;
server_name status.example.com;
location / {
rewrite ^/?(.*) https://$server_name/$1 redirect;
}
}
server {
listen 443;
root /var/www/webstatus;
index index.php;
location / {
index index.php;
}
server_name status.example.com;
location ~ \.php$ {
fastcgi_split_path_info ^(.+\.php)(/.+)$;
fastcgi_pass unix:/run/php/php7.4-fpm.sock;
fastcgi_index index.php;
include fastcgi_params;
fastcgi_param PHP_VALUE "upload_max_filesize = 100M \n post_max_size=100M";
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
fastcgi_param HTTP_PROXY "";
fastcgi_intercept_errors off;
fastcgi_buffer_size 16k;
fastcgi_buffers 4 16k;
fastcgi_connect_timeout 300;
fastcgi_send_timeout 300;
fastcgi_read_timeout 300;
include /etc/nginx/fastcgi_params;
}
}
#7:
ln -s /etc/nginx/sites-available/status.conf /etc/nginx/sites-enabled
#8:
(If you have installed cerbot! The Configuration above needs a SSL Certificate to work properly)
cerbot --nginx
#9:
Select "status.example.com" and follow the introductions as you wish
#10:
Open "status.example.com" in your browser and fill out the Setup field
#11:
ENJOY Webstatus, if you have any questions, requests or something write me at thiemo.tiziani@nerdcity.at or make a issue at git.thiemoo.at

729
worker.php Normal file
View File

@ -0,0 +1,729 @@
<?php
//Check if user is logged in
session_start();
if(!isset($_SESSION['loggedin']) && $_SESSION['loggedin'] !== true) {
header("Location: login.php");
die;
}
if(isset($_GET["logout"])) {
session_destroy();
header('Location: login.php');
}
?>
<?php
//Get datas from database
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$role = mysqli_fetch_assoc(mysqli_query($con, "SELECT role FROM accounts WHERE id='".mysqli_real_escape_string($con, $_SESSION['id'])."'"))["role"];
$instancename = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='instancename'"))["value"];
$privacy = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='privacy'"))["value"];
$impressum = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='impressum'"))["value"];
$newtab = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='newtab'"))["value"];
if($role == "administrator") {
$autoreload_setting = mysqli_fetch_assoc(mysqli_query($con, "SELECT value FROM settings WHERE type='autoreload'"))["value"];
}
?>
<?php
//Define all users in a $users variable
if($role == "administrator") {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$users = mysqli_query($con, "SELECT username,id,role FROM accounts");
}
?>
<?php
//Define all groups and services in a $groups and $services variable
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$groups = mysqli_query($con, "SELECT priority, name, id FROM groups ORDER BY priority DESC");
$services = mysqli_query($con, "SELECT priority, groupid, name, id, status FROM services ORDER BY priority DESC");
$incidents = mysqli_query($con, "SELECT id, status, services, text, date, childof FROM incidents ORDER BY id ASC");
$incidents2 = mysqli_query($con, "SELECT id, status, services, text, date, childof FROM incidents ORDER BY id ASC");
?>
<?php
//Update Username for user
if(isset($_GET["updateusername"]) && isset($_POST['username'])) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$query="SELECT * FROM accounts WHERE username='".mysqli_real_escape_string($con,$_POST['username'])."'";
if($result=mysqli_query($con,$query)){
if(mysqli_num_rows($result)>0){
header("Location: admin.php?userexist#account");
}else{
$statement = mysqli_query($con,"UPDATE accounts SET username='".mysqli_real_escape_string($con,$_POST['username'])."' WHERE ID='".$_SESSION['id']."'");
header('Location: worker.php?logout');
}
}
}
?>
<?php
//Update Password for user
if(isset($_GET["updatepassword"]) && isset($_POST['password1']) && isset($_POST['password2'])) {
include('config.php');
if($_POST['password1'] == $_POST['password2']) {
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
if ($stmt = $con->prepare('SELECT id, password FROM accounts WHERE username = ?')) {
$stmt->bind_param('s', $_SESSION['name']);
$stmt->execute();
$stmt->store_result();
if ($stmt->num_rows > 0) {
$stmt->bind_result($id, $password);
$stmt->fetch();
if (password_verify($_POST['oldpassword'], $password)) {
$npassword = password_hash($_POST['password1'], PASSWORD_DEFAULT);
$statement = mysqli_query($con,"UPDATE accounts SET password='".mysqli_real_escape_string($con,$npassword)."' WHERE ID='".$_SESSION['id']."'");
if($statement) {
header("Location: admin.php?pwupdated#account");
}
} else {
header("Location: admin.php?pwrong#account");
}
} else {
header("Location: admin.php?pwrong#account");
}
$stmt->close();
}
} else {
header("Location: admin.php?pwnotmatch#account");
}
}
?>
<?php
//Create a new user
if($role == "administrator") {
if(isset($_GET["newuser"]) && isset($_POST['username']) && isset($_POST['password'])) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$query="SELECT * FROM accounts WHERE username='".mysqli_real_escape_string($con,$_POST['username'])."'";
if($result=mysqli_query($con,$query)){
if(mysqli_num_rows($result)>0){
header("Location: admin.php?userexist#users");
}else{
$newpw = password_hash($_POST['password'], PASSWORD_DEFAULT);
$statement = mysqli_query($con, "INSERT INTO accounts (username, password, role) VALUES ('".mysqli_real_escape_string($con,$_POST['username'])."',
'".mysqli_real_escape_string($con,$newpw)."', '".mysqli_real_escape_string($con, $_POST['role'])."')");
if($statement) {
header("Location: admin.php?usercreated#users");
}
}
}
}
}
?>
<?php
//Update password for another user
if($role == "administrator") {
if(isset($_GET["updatepwfor"]) && isset($_POST['password1']) && isset($_POST['password2'])) {
include('config.php');
if($_POST['password1'] == $_POST['password2']) {
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$npassword = password_hash($_POST['password1'], PASSWORD_DEFAULT);
$statement = mysqli_query($con,"UPDATE accounts SET password='".mysqli_real_escape_string($con,$npassword)."'
WHERE username='".mysqli_real_escape_string($con,$_GET["updatepwfor"])."'");
if($statement) {
header("Location: admin.php?edit=".$_GET["updatepwfor"]."&pwupdated#edit");
}
} else {
header("Location: admin.php?edit=".$_GET["updatepwfor"]."&pwnotmatch#edit");
}
}
}
?>
<?php
//Update username for another user
if($role == "administrator") {
if(isset($_GET["updateunfor"]) && isset($_POST['username'])) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con,"UPDATE accounts SET username='".mysqli_real_escape_string($con,$_POST['username'])."'
WHERE username='".mysqli_real_escape_string($con, $_GET["updateunfor"])."'");
if($statement) {
header("Location: admin.php?edit=".$_POST['username']."&unupdated#edit");
}
}
}
?>
<?php
//Update role for some user
if($role == "administrator") {
if(isset($_GET["updaterole"])) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
if($_POST['role'] == "administrator") {
$statement = mysqli_query($con,"UPDATE accounts SET role='".mysqli_real_escape_string($con, $_POST['role'])."'
WHERE username='".mysqli_real_escape_string($con, $_GET["updaterole"])."'");
if($statement) {
header("Location: admin.php?edit=".$_GET["updaterole"]."&roleupdated#edit");
}
} else if($_POST['role'] == "moderator") {
$statement = mysqli_query($con,"UPDATE accounts SET role='".mysqli_real_escape_string($con, $_POST['role'])."'
WHERE username='".mysqli_real_escape_string($con, $_GET["updaterole"])."'");
if($statement) {
header("Location: admin.php?edit=".$_GET["updaterole"]."&roleupdated#edit");
}
}
}
}
?>
<?php
//Deleter user
if($role == "administrator") {
if(isset($_GET["deluser"])) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con, "DELETE FROM accounts WHERE username='".mysqli_real_escape_string($con, $_GET["deluser"])."'");
if($statement) {
header("Location: admin.php?userdeleted#users");
}
}
}
?>
<?php
//Change instance name
if($role == "administrator") {
if(isset($_GET["upname"]) && isset($_POST['iname'])) {
include ('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con,"UPDATE settings SET value='".mysqli_real_escape_string($con, $_POST['iname'])."'
WHERE type='instancename'");
if($statement) {
header("Location: admin.php?nameupdated#settings");
}
}
}
?>
<?php
//Change autoreload setting
if($role == "administrator") {
if(isset($_GET["upautoreload"]) && isset($_POST['autoreload'])) {
include ('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con,"UPDATE settings SET value='".mysqli_real_escape_string($con, $_POST['autoreload'])."'
WHERE type='autoreload'");
if($statement) {
header("Location: admin.php?reloadupdated=".$_POST['autoreload']."#settings");
}
}
}
?>
<?php
//Set Impressum link
if($role == "administrator") {
if(isset($_GET["upimpressum"]) && isset($_POST['impressum'])) {
include ('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con,"UPDATE settings SET value='".mysqli_real_escape_string($con, $_POST['impressum'])."'
WHERE type='impressum'");
if($statement) {
header("Location: admin.php?impressumset=".$_POST['impressum']."#settings");
}
}
}
?>
<?php
//Set Privacy policity link
if($role == "administrator") {
if(isset($_GET["upprivacy"]) && isset($_POST['privacy'])) {
include ('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con,"UPDATE settings SET value='".mysqli_real_escape_string($con, $_POST['privacy'])."'
WHERE type='privacy'");
if($statement) {
header("Location: admin.php?privacyset=".$_POST['privacy']."#settings");
}
}
}
?>
<?php
//Set new tab policy
if($role == "administrator") {
if(isset($_GET["uptabpolicy"]) && isset($_POST['newtab'])) {
include ('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con,"UPDATE settings SET value='".mysqli_real_escape_string($con, $_POST['newtab'])."'
WHERE type='newtab'");
if($statement) {
header("Location: admin.php?newtabset#settings");
}
}
}
?>
<?php
//Create new service
if(isset($_GET["createservice"]) && isset($_POST['priority']) && isset($_POST['group']) && isset($_POST['name'])) {
include ('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con, "INSERT INTO services (priority, groupid, name, status, cmaintenance, sname) VALUES ('".mysqli_real_escape_string($con,$_POST['priority'])."',
'".mysqli_real_escape_string($con,$_POST['group'])."', '".mysqli_real_escape_string($con, $_POST['name'])."', 'Online', '0',
'".mysqli_real_escape_string($con, $_POST['sname'])."')");
if($statement) {
header("Location: admin.php?serviceadded#services");
}
}
?>
<?php
//Create new group
if(isset($_GET["creategroup"]) && isset($_POST['priority']) && isset($_POST['name'])) {
include ('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con, "INSERT INTO groups (priority, name) VALUES ('".mysqli_real_escape_string($con,$_POST['priority'])."',
'".mysqli_real_escape_string($con, $_POST['name'])."')");
if($statement) {
header("Location: admin.php?groupadded#services");
}
}
?>
<?php
//Delete service
if(isset($_GET["delservice"])) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con, "DELETE FROM services WHERE id='".mysqli_real_escape_string($con, $_GET["delservice"])."'");
if($statement) {
header("Location: admin.php?servicedeleted#services");
}
}
?>
<?php
//Delete group
if(isset($_GET["delgroup"])) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con, "DELETE FROM groups WHERE id='".mysqli_real_escape_string($con, $_GET['delgroup'])."'");
$statement2 = mysqli_query($con, "DELETE FROM services WHERE groupid='".mysqli_real_escape_string($con, $_GET['delgroup'])."'");
if($statement) {
header("Location: admin.php?groupdeleted#services");
}
}
?>
<?php
//Update Service Status
if(isset($_GET["updatest"])) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con, "UPDATE services SET status = '".mysqli_real_escape_string($con, $_GET['status'])."'
WHERE id = '".mysqli_real_escape_string($con, $_GET['updatest'])."'");
if($statement) {
header("Location: admin.php?manageservice=".$_GET['updatest']."&statusupdated#mservice");
}
}
?>
<?php
//Create Incident
if(isset($_GET["createincident"])) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$services = "".implode(",",$_POST['services'])."";
$statement = mysqli_query($con, "INSERT INTO incidents (status, services, text, date, childof) VALUES ('new',
'".mysqli_real_escape_string($con, $services)."', '".mysqli_real_escape_string($con, $_POST['text'])."', '".mysqli_real_escape_string($con, $_POST['date'])."'
, '-1')");
if($statement) {
header("Location: admin.php?incidentcreated#incidents");
} else {
}
}
?>
<?php
//Create Incident Message
if(isset($_GET["addmessage"])) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con, "INSERT INTO incidents (status, services, text, date, childof) VALUES ('".mysqli_real_escape_string($con, $_POST['state'])."',
'-1', '".mysqli_real_escape_string($con, $_POST['text'])."', '2021-02-02'
, '".mysqli_real_escape_string($con, $_POST['childof'])."')");
if($statement) {
header("Location: admin.php?messagecreated#incidents");
}
}
?>
<?php
//Delete Incident
if(isset($_GET["rmincident"])) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con, "DELETE FROM incidents WHERE id='".mysqli_real_escape_string($con, $_GET['rmincident'])."'");
$statement2 = mysqli_query($con, "DELETE FROM incidents WHERE childof='".mysqli_real_escape_string($con, $_GET['rmincident'])."'");
if($statement) {
header("Location: admin.php?incidentdeleted#incidents");
}
}
?>
<?php
//Flush Incidents
if(isset($_GET["flushincidents"])) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con, "DELETE FROM incidents");
if($statement) {
header("Location: admin.php?incidentsflushed#incidents");
} else {
die("no!");
}
}
?>
<?php
//Update Group Name
if(isset($_GET["upgroupname"])) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con, "UPDATE groups SET name = '".mysqli_real_escape_string($con, $_POST['name'])."'
WHERE id = '".mysqli_real_escape_string($con, $_GET['upgroupname'])."'");
if($statement) {
header("Location: admin.php?editgroup=".$_GET['upgroupname']."&nameupdated#groupedit");
}
}
?>
<?php
//Update Group Priority
if(isset($_GET["upgrouppriority"])) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con, "UPDATE groups SET priority = '".mysqli_real_escape_string($con, $_POST['priority'])."'
WHERE id = '".mysqli_real_escape_string($con, $_GET['upgrouppriority'])."'");
if($statement) {
header("Location: admin.php?editgroup=".$_GET['upgrouppriority']."&priorityupdated#groupedit");
}
}
?>
<?php
//Update Service Priority
if(isset($_GET["upservicepriority"])) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con, "UPDATE services SET priority = '".mysqli_real_escape_string($con, $_POST['priority'])."'
WHERE id = '".mysqli_real_escape_string($con, $_GET['upservicepriority'])."'");
if($statement) {
header("Location: admin.php?manageservice=".$_GET['upservicepriority']."&priorityupdated#mservice");
}
}
?>
<?php
//Update Service Name
if(isset($_GET["upservicename"])) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$statement = mysqli_query($con, "UPDATE services SET name = '".mysqli_real_escape_string($con, $_POST['name'])."'
WHERE id = '".mysqli_real_escape_string($con, $_GET['upservicename'])."'");
if($statement) {
header("Location: admin.php?manageservice=".$_GET['upservicename']."&nameupdated#mservice");
}
}
?>
<?php
//Functions
function getStatus($id) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
return mysqli_fetch_assoc(mysqli_query($con, "SELECT status FROM services WHERE id='".mysqli_real_escape_string($con, $id)."'"))["status"];
}
function getGroupName($id) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
return mysqli_fetch_assoc(mysqli_query($con, "SELECT name FROM groups WHERE id='".mysqli_real_escape_string($con, $id)."'"))["name"];
}
function getGroupPriority($id) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
return mysqli_fetch_assoc(mysqli_query($con, "SELECT priority FROM groups WHERE id='".mysqli_real_escape_string($con, $id)."'"))["priority"];
}
function getServiceName($id) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
return mysqli_fetch_assoc(mysqli_query($con, "SELECT name FROM services WHERE id='".mysqli_real_escape_string($con, $id)."'"))["name"];
}
function getServicePriority($id) {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
return mysqli_fetch_assoc(mysqli_query($con, "SELECT priority FROM services WHERE id='".mysqli_real_escape_string($con, $id)."'"))["priority"];
}
function debug_to_console($data) {
$output = $data;
if (is_array($output))
$output = implode(',', $output);
echo "<script>console.log('Debug Objects: " . $output . "' );</script>";
}
function sMaintenance() {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$services = mysqli_query($con, "SELECT priority, groupid, name, id, status FROM services ORDER BY priority DESC");
$find = False;
while($servicelist = mysqli_fetch_array($services)){
if(strpos($servicelist['status'], "Maintenance") !== false) {
$find = True;
}
}
return $find;
}
function sOffline() {
include('config.php');
$con = mysqli_connect($config['DBHOST'], $config['DBUSER'], $config['DBPWD'], $config['DBNAME']);
if ( mysqli_connect_errno() ) {
exit('MySQl Connection failed with error: ' . mysqli_connect_error());
}
$services = mysqli_query($con, "SELECT priority, groupid, name, id, status FROM services ORDER BY priority DESC");
$find = False;
while($servicelist = mysqli_fetch_array($services)){
if(strpos($servicelist['status'], "Offline") !== false) {
$find = True;
}
}
return $find;
}
?>