mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 01:34:55 +02:00
Admin Panel (#61)
Thank you Lee for this awesome, Bootstrap Admin Panel!
This commit is contained in:
@@ -1,147 +1,43 @@
|
||||
*{
|
||||
margin:0;
|
||||
padding:0;
|
||||
}
|
||||
body {
|
||||
font-family: Helvetica;
|
||||
color: #313334;
|
||||
background: /*#f9f9f9 #EEEEEE*/#F7F6F1;
|
||||
.slidecontainer {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
img {border: none;}
|
||||
.slider {
|
||||
-webkit-appearance: none;
|
||||
width: 100%;
|
||||
|
||||
a:link {color: #000; text-decoration: none;}
|
||||
a:visited {color: #000; text-decoration: none;}
|
||||
a:focus {color: #000; text-decoration: none;}
|
||||
a:active {color: #000; text-decoration: underline;}
|
||||
a:hover {color: #000; text-decoration: underline;}
|
||||
a.current {font-weight: bold;}
|
||||
|
||||
h5.blue {color: #6b7b95;}
|
||||
h5.red {color: #c17878;}
|
||||
h5.green {color: #78ba91;}
|
||||
h5.purple {color: #a87aad;}
|
||||
|
||||
h1, h2, h3, h4, h5, h6 {color: #313334; font-weight: bold;}
|
||||
.separator {color:#BCE}
|
||||
.margin-left{
|
||||
margin-left:5px;
|
||||
outline: none;
|
||||
opacity: 0.7;
|
||||
-webkit-transition: .2s;
|
||||
transition: opacity .2s;
|
||||
}
|
||||
|
||||
.button { background:#eee repeat-x 0 0; border:solid 1px #b1a874; color:#7f7f7f; font-size:11px; padding:2px 6px 2px 6px; cursor:pointer; line-height:14px !important; }
|
||||
.button:hover { color:#333; border-color:#857b42; }
|
||||
|
||||
.field, .button { -moz-border-radius:4px; -webkit-border-radius:4px; }
|
||||
.small-field, .button, .pagging a { -moz-border-radius:3px; -webkit-border-radius:3px; }
|
||||
|
||||
.table th {
|
||||
background-color: #4CAF50;
|
||||
color: white;
|
||||
text-align: left;
|
||||
.slider:hover {
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.table, .table td, .table th{
|
||||
border: 1px solid #ddd;
|
||||
.slider::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
width: 15px;
|
||||
height: 25px;
|
||||
background: #3c8dbc;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.table th a:link {color: white; text-decoration: none;}
|
||||
.table th a:link {color: white; text-decoration: none;}
|
||||
.table th a:visited {color: white; text-decoration: none;}
|
||||
.table th a:focus {color: white; text-decoration: none;}
|
||||
.table th a:active {color: white; text-decoration: underline;}
|
||||
.table th a:hover {color: white; text-decoration: underline;}
|
||||
.slider::-moz-range-thumb {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
background: #3c8dbc;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.table tr:nth-child(odd) {background-color: #d1d1d1}
|
||||
|
||||
a.ico { color:#9d9c9a; font-size:10px; text-decoration: none; padding:0 0 0 14px; background-repeat:no-repeat; background-position:0 0; }
|
||||
a.ico:hover { color:#333;}
|
||||
|
||||
#container{
|
||||
width:960px;
|
||||
margin-left:auto;
|
||||
margin-right:auto;
|
||||
td.details-control {
|
||||
text-align:center;
|
||||
color:forestgreen;
|
||||
cursor: pointer;
|
||||
}
|
||||
#header {
|
||||
/*width: 960px;*/
|
||||
padding-left: auto;
|
||||
padding-right: auto;
|
||||
border-bottom: 1px dotted black;
|
||||
margin-top: 40px;
|
||||
}
|
||||
#header h1 {
|
||||
margin: 0;
|
||||
padding-top: 20px;
|
||||
text-align: center;
|
||||
}
|
||||
#sidebar{
|
||||
background: #FFF;
|
||||
width: 170px;
|
||||
float: left;
|
||||
margin: 10px 0 10px 0;
|
||||
padding: 10px;
|
||||
border: 1px solid #CCC;
|
||||
}
|
||||
#content {
|
||||
width: 740px;
|
||||
float: right;
|
||||
margin: 20px 0 10px 0;
|
||||
padding: 10px;
|
||||
}
|
||||
#footer {
|
||||
margin-top: 20px;
|
||||
border-top: 1px dotted black;
|
||||
text-align: center;
|
||||
clear: both;
|
||||
}
|
||||
/*********************
|
||||
Sidebar
|
||||
*********************/
|
||||
#sidebar ul{
|
||||
list-style:none;
|
||||
line-height:22px;
|
||||
}
|
||||
#sidebar ul li a,#sidebar ul li a:visited{
|
||||
padding-left:19px;
|
||||
text-decoration:none;
|
||||
margin:0 3px;
|
||||
display:block;
|
||||
}
|
||||
#sidebar ul li a:hover{
|
||||
text-decoration:underline;
|
||||
}
|
||||
#sidebar ul li ul{
|
||||
margin-left:10px;
|
||||
}
|
||||
#sidebar h3{
|
||||
padding:2px;
|
||||
font-size:14px;
|
||||
}
|
||||
/*********************
|
||||
Status & version boxes
|
||||
*********************/
|
||||
#status {
|
||||
position: absolute; top: 10px; left: 10px;
|
||||
margin: 0px;
|
||||
float: right;
|
||||
font-size: 12px;
|
||||
}
|
||||
#status .success {
|
||||
margin: 0px;
|
||||
}
|
||||
#version {
|
||||
position: absolute; top: 10px; right: 10px;
|
||||
float: right;
|
||||
text-align: right;
|
||||
font-size: 12px;
|
||||
}
|
||||
/*********************
|
||||
Infobox
|
||||
*********************/
|
||||
#infobox{
|
||||
border:1px solid #e9e8e3;
|
||||
}
|
||||
#infobox h3{
|
||||
background:#f7f6f1;
|
||||
border-bottom:1px solid #e9e8e3;
|
||||
color:#654322;
|
||||
tr.shown td.details-control {
|
||||
text-align:center;
|
||||
color:red;
|
||||
}
|
@@ -1,52 +1,78 @@
|
||||
<?php defined('MYAAC') or die('Direct access not allowed!'); ?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
|
||||
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<?php echo template_header(true); ?>
|
||||
<title><?php echo $title . $config['title_separator'] . $config['lua']['serverName']; ?> - Powered by MyAAC</title>
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo $template_path; ?>style.css" />
|
||||
<?php echo template_header(true); ?>
|
||||
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
|
||||
<link rel="stylesheet" href="dist/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="dist/css/AdminLTE.min.css">
|
||||
<link rel="stylesheet" href="dist/css/skins/skin-blue.min.css">
|
||||
|
||||
<link rel="stylesheet" href="dist/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="dist/css/ionicons.min.css">
|
||||
<link rel="stylesheet" href="dist/css/dataTables.bootstrap.min.css">
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo $template_path; ?>style.css" />
|
||||
<!--[if lt IE 9]>
|
||||
<script src="https://oss.maxcdn.com/html5shiv/3.7.3/html5shiv.min.js"></script>
|
||||
<script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
|
||||
<![endif]-->
|
||||
|
||||
<link rel="stylesheet"
|
||||
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
|
||||
</head>
|
||||
<body>
|
||||
<?php if($page != 'tools'): ?>
|
||||
<div id="container">
|
||||
<div id="header">
|
||||
<?php if($logged && admin()): ?>
|
||||
<div id="status">
|
||||
<?php if($status['online']): ?>
|
||||
<p class="success" style="width: 120px; text-align: center;">Status: Online<br/>
|
||||
<?php echo $status['uptimeReadable'] . ', ' . $status['players'] . '/' . $status['playersMax']; ?><br/>
|
||||
<?php echo $config['lua']['ip'] . ' : ' . $config['lua']['loginPort']; ?>
|
||||
</p>
|
||||
<?php else: ?>
|
||||
<p class="error" style="width: 120px; text-align: center;">Status: Offline</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div id="version">Version: <?php echo MYAAC_VERSION; ?> (<a id="update" href="?p=version">Check for updates</a>)<br/>
|
||||
Logged in as: <b><?php echo (USE_ACCOUNT_NAME ? $account_logged->getName() : $account_logged->getId()); ?></b><br/>
|
||||
<a href="<?php echo BASE_URL; ?>" target="_blank">Preview</a> <span class="separator">|</span> <a href="?action=logout">Log out<img src="<?php echo BASE_URL; ?>images/icons/logout.png" alt="" title="Log out" /></a>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<h1><?php echo $config['lua']['serverName'] . (isset($title) ? ' - ' . $title : ''); ?> - Admin Panel</h1>
|
||||
</div>
|
||||
<div id="wrapper">
|
||||
<?php
|
||||
if($logged && admin()) {
|
||||
?>
|
||||
<div id="sidebar">
|
||||
<ul>
|
||||
<?php
|
||||
<body class="hold-transition skin-blue sidebar-mini">
|
||||
<div class="wrapper">
|
||||
<?php if($page != 'tools'): ?>
|
||||
<?php
|
||||
if($logged && admin()) {
|
||||
?>
|
||||
<header class="main-header">
|
||||
<a href="." class="logo">
|
||||
<span class="logo-mini"><b>M</b>A</span>
|
||||
<span class="logo-lg"><b>My</b>ACC</span>
|
||||
</a>
|
||||
|
||||
<nav class="navbar navbar-static-top" role="navigation">
|
||||
<a href="#" class="sidebar-toggle" data-toggle="push-menu" role="button">
|
||||
<span class="sr-only">Toggle navigation</span>
|
||||
</a>
|
||||
<div class="navbar-custom-menu">
|
||||
<ul class="nav navbar-nav">
|
||||
<li>
|
||||
<a href="#" data-toggle="control-sidebar"><i class="fa fa-gears"></i></a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</nav>
|
||||
</header>
|
||||
<aside class="main-sidebar">
|
||||
<section class="sidebar">
|
||||
<ul class="sidebar-menu" data-widget="tree">
|
||||
<li class="header">MyACC</li>
|
||||
|
||||
<?php
|
||||
$icons_a = array(
|
||||
'dashboard', 'envelope',
|
||||
'book', 'list',
|
||||
'plug', 'user',
|
||||
'edit', 'gavel',
|
||||
'book', 'edit', 'book',
|
||||
);
|
||||
|
||||
$menus = array(
|
||||
'Dashboard' => 'dashboard',
|
||||
'Mailer' => 'mailer',
|
||||
'Pages' => 'pages',
|
||||
'Menus' => 'menus',
|
||||
'Plugins' => 'plugins',
|
||||
'Statistics' => 'statistics',
|
||||
'Visitors' => 'visitors',
|
||||
'Players' => 'players',
|
||||
'Editor' => array(
|
||||
'Accounts' => 'accounts',
|
||||
'Players' => 'players',
|
||||
),
|
||||
'Items' => 'items',
|
||||
'Tools' => array(
|
||||
'phpinfo' => 'phpinfo'
|
||||
'phpinfo' => 'phpinfo',
|
||||
),
|
||||
'Notepad' => 'notepad',
|
||||
'Logs' => 'logs'
|
||||
@@ -54,57 +80,142 @@
|
||||
|
||||
$i = 0;
|
||||
foreach($menus as $_name => $_page) {
|
||||
//echo '<a ' . ($page == $_page ? ' class="current"' : '') . 'href="?p=' . $_page . '">' . $_name . '</a>';
|
||||
echo '<li><h3>';
|
||||
$has_child = is_array($_page);
|
||||
if(!$has_child) {
|
||||
echo '<a href="?p=' . $_page . '">';
|
||||
if($page == $_page) echo '<u>';
|
||||
echo $_name;
|
||||
if($page == $_page) echo '</u>';
|
||||
echo '</a>';
|
||||
echo '<li ';
|
||||
if($page == $_page) echo ' class="active"';
|
||||
echo">";
|
||||
echo '<a href="?p=' . $_page . '"><i class="fa fa-' . (isset($icons_a[$i]) ? $icons_a[$i] : 'link') . '"></i> <span>'. $_name .'</span></a></li>';
|
||||
}
|
||||
else
|
||||
echo $_name;
|
||||
|
||||
echo '</h3>';
|
||||
if($has_child) {
|
||||
echo '<ul>';
|
||||
foreach($_page as $__name => $__page)
|
||||
echo '<li><a href="?p=' . $__page . '">';
|
||||
if($page == $__page) echo '<u>';
|
||||
echo $__name;
|
||||
if($page == $__page) echo '</u>';
|
||||
echo '</a></li>';
|
||||
echo '</ul>';
|
||||
$used_menu = "";
|
||||
$nav_construct = '';
|
||||
foreach($_page as $__name => $__page) {
|
||||
$nav_construct = $nav_construct . '<li';
|
||||
|
||||
if ($page == $__page) {
|
||||
$nav_construct = $nav_construct. ' class="active"';
|
||||
$used_menu = true;
|
||||
}
|
||||
$nav_construct = $nav_construct. '><a href="?p=' . $__page . '"><i class="fa fa-circle-o"></i> ' . $__name . '</a></li>';
|
||||
}
|
||||
|
||||
echo '<li class="treeview'. (($used_menu) ? ' menu-open': '') .'">
|
||||
<a href="#"><i class="fa fa-'.(isset($icons_a[$i]) ? $icons_a[$i] : 'link').'"></i> <span>'.$_name.'</span>
|
||||
<span class="pull-right-container"><i class="fa fa-angle-left pull-right"></i></span></a>
|
||||
<ul class="treeview-menu" style="'. (($used_menu) ? ' display: block': ' display: none') .'">';
|
||||
echo $nav_construct;
|
||||
echo '</ul>
|
||||
</li>';
|
||||
}
|
||||
echo '</li>';
|
||||
$i++;
|
||||
}
|
||||
|
||||
$query = $db->query('SELECT `name`, `page`, `flags` FROM `' . TABLE_PREFIX . 'admin_menu` ORDER BY `ordering`');
|
||||
$menu_db = $query->fetchAll();
|
||||
foreach($menu_db as $item) {
|
||||
if($item['flags'] == 0 || hasFlag($item['flags'])) {
|
||||
echo '<li><h3>
|
||||
<a href="?p=' . $item['page'] . '">';
|
||||
if($page == $item['page']) echo '<u>';
|
||||
echo $item['name'];
|
||||
if($page == $item['page']) echo '</u>';
|
||||
echo '</a></h3></li>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</div>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
<div id="content"><?php echo $content; ?></div>
|
||||
</div>
|
||||
<div id="footer">
|
||||
<?php echo base64_decode('UG93ZXJlZCBieSA8YSBocmVmPSJodHRwOi8vbXktYWFjLm9yZyIgdGFyZ2V0PSJfYmxhbmsiPk15QUFDLjwvYT4='); ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
|
||||
$query = $db->query('SELECT `name`, `page`, `flags` FROM `' . TABLE_PREFIX . 'admin_menu` ORDER BY `ordering`');
|
||||
$menu_db = $query->fetchAll();
|
||||
foreach($menu_db as $item) {
|
||||
if($item['flags'] == 0 || hasFlag($item['flags'])) {
|
||||
echo '<li ';
|
||||
if($page == $item['page']) echo ' class="active"';
|
||||
echo">";
|
||||
echo '<a href="?p=' . $item['page'] . '"><i class="fa fa-link"></i> <span>'. $item['name'] .'</span></a></li>';
|
||||
}
|
||||
}
|
||||
?>
|
||||
</ul>
|
||||
</section>
|
||||
</aside>
|
||||
|
||||
<div class="content-wrapper">
|
||||
<section class="content-header">
|
||||
<h1><?php echo (isset($title) ? $title : ''); ?><small> - Admin Panel</small>
|
||||
<div class="pull-right">
|
||||
<span class="label label-<?php echo (($status['online']) ? 'success' : 'danger'); ?>"><?php echo $config['lua']['serverName'] ?></span>
|
||||
</div>
|
||||
</h1>
|
||||
</section>
|
||||
<section class="content">
|
||||
<?php echo $content; ?>
|
||||
</section>
|
||||
|
||||
</div>
|
||||
|
||||
<footer class="main-footer">
|
||||
|
||||
<div class="pull-right hidden-xs">
|
||||
<div id="status">
|
||||
<?php if($status['online']): ?>
|
||||
<p class="success" style="width: 120px; text-align: center;">Server Online</p>
|
||||
<?php else: ?>
|
||||
<p class="error" style="width: 120px; text-align: center;">Server Offline</p>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
<?php echo base64_decode('UG93ZXJlZCBieSA8YSBocmVmPSJodHRwOi8vbXktYWFjLm9yZyIgdGFyZ2V0PSJfYmxhbmsiPk15QUFDLjwvYT4='); ?>
|
||||
</footer>
|
||||
|
||||
<aside class="control-sidebar control-sidebar-dark">
|
||||
<ul class="nav nav-tabs nav-justified control-sidebar-tabs">
|
||||
<li class="active"><a href="#control-sidebar-home-tab" data-toggle="tab"><i class="fa fa-home"></i></a></li>
|
||||
<li><a href="#control-sidebar-settings-tab" data-toggle="tab"><i class="fa fa-gears"></i></a></li>
|
||||
</ul>
|
||||
<div class="tab-content">
|
||||
<div class="tab-pane active" id="control-sidebar-home-tab">
|
||||
<h3 class="control-sidebar-heading">Account</h3>
|
||||
<ul class="control-sidebar-menu">
|
||||
<li>
|
||||
<a href="?action=logout">
|
||||
<i class="menu-icon fa fa-sign-out bg-red"></i>
|
||||
<div class="menu-info">
|
||||
<h4 class="control-sidebar-subheading">Log out</h4>
|
||||
<p>This will log you out of <?php echo (USE_ACCOUNT_NAME ? $account_logged->getName() : $account_logged->getId()); ?></p>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
<h3 class="control-sidebar-heading">Site</h3>
|
||||
<ul class="control-sidebar-menu">
|
||||
<li>
|
||||
<a href="<?php echo BASE_URL; ?>" target="_blank">
|
||||
<i class="menu-icon fa fa-eye bg-blue"></i>
|
||||
<div class="menu-info">
|
||||
<h4 class="control-sidebar-subheading">Preview</h4>
|
||||
<p>This will open a new tab</p>
|
||||
</div>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<div class="tab-pane" id="control-sidebar-settings-tab">
|
||||
<form method="post">
|
||||
<h3 class="control-sidebar-heading">Version</h3>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="control-sidebar-subheading">
|
||||
<?php echo MYAAC_VERSION; ?> (<a href="?p=version">Check for updates</a>)<br/>
|
||||
</label>
|
||||
<label class="control-sidebar-subheading">
|
||||
<p><a href="https://github.com/slawkens/myaac" target="_blank">Github</a></p>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</aside>
|
||||
<div class="control-sidebar-bg"></div>
|
||||
</div>
|
||||
|
||||
<?php } endif;
|
||||
if(!$logged && !admin()) {
|
||||
echo $content;
|
||||
}
|
||||
?>
|
||||
|
||||
<script src="dist/js/bootstrap.min.js"></script>
|
||||
<script src="dist/js/jquery.min.js"></script>
|
||||
<script src="dist/js/jquery-ui.min.js"></script>
|
||||
<script src="dist/js/jquery.dataTables.min.js"></script>
|
||||
<script src="dist/js/dataTables.bootstrap.min.js"></script>
|
||||
<script src="dist/js/adminlte.min.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
</html>
|
Reference in New Issue
Block a user