mirror of
https://github.com/slawkens/myaac.git
synced 2025-04-26 01:09:21 +02:00
Code clean up + datatables (#64)
* Reformat Code Reformat Code - spaces + tabs * Code cleanup removed duplicated datatables code * Datatables replace spells, monsters tables with JavaScript Sortable Tables (DataTables?)
This commit is contained in:
parent
e3bcbc4da9
commit
876b1b988a
@ -1,43 +1,44 @@
|
||||
.slidecontainer {
|
||||
width: 100%;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.slider {
|
||||
-webkit-appearance: none;
|
||||
width: 100%;
|
||||
-webkit-appearance: none;
|
||||
width: 100%;
|
||||
|
||||
outline: none;
|
||||
opacity: 0.7;
|
||||
-webkit-transition: .2s;
|
||||
transition: opacity .2s;
|
||||
outline: none;
|
||||
opacity: 0.7;
|
||||
-webkit-transition: .2s;
|
||||
transition: opacity .2s;
|
||||
}
|
||||
|
||||
.slider:hover {
|
||||
opacity: 1;
|
||||
opacity: 1;
|
||||
}
|
||||
|
||||
.slider::-webkit-slider-thumb {
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
width: 15px;
|
||||
height: 25px;
|
||||
background: #3c8dbc;
|
||||
cursor: pointer;
|
||||
-webkit-appearance: none;
|
||||
appearance: none;
|
||||
width: 15px;
|
||||
height: 25px;
|
||||
background: #3c8dbc;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.slider::-moz-range-thumb {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
background: #3c8dbc;
|
||||
cursor: pointer;
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
background: #3c8dbc;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
td.details-control {
|
||||
text-align:center;
|
||||
color:forestgreen;
|
||||
cursor: pointer;
|
||||
text-align: center;
|
||||
color: forestgreen;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
tr.shown td.details-control {
|
||||
text-align:center;
|
||||
color:red;
|
||||
text-align: center;
|
||||
color: red;
|
||||
}
|
@ -2,220 +2,221 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<?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="<?php echo BASE_URL; ?>tools/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/AdminLTE.min.css">
|
||||
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/skins/skin-blue.min.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="<?php echo BASE_URL; ?>tools/css/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/AdminLTE.min.css">
|
||||
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/skins/skin-blue.min.css">
|
||||
|
||||
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/ionicons.min.css">
|
||||
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/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="<?php echo BASE_URL; ?>tools/css/font-awesome.min.css">
|
||||
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/ionicons.min.css">
|
||||
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/jquery.dataTables.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">
|
||||
<link rel="stylesheet"
|
||||
href="https://fonts.googleapis.com/css?family=Source+Sans+Pro:300,400,600,700,300italic,400italic,600italic">
|
||||
</head>
|
||||
<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>
|
||||
<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>AAC</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">MyAAC</li>
|
||||
<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">MyAAC</li>
|
||||
|
||||
<?php
|
||||
$icons_a = array(
|
||||
'dashboard', 'envelope',
|
||||
'book', 'list',
|
||||
'plug', 'user',
|
||||
'edit', 'gavel',
|
||||
'book', 'edit', 'book',
|
||||
);
|
||||
<?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',
|
||||
'Visitors' => 'visitors',
|
||||
'Editor' => array(
|
||||
'Accounts' => 'accounts',
|
||||
'Players' => 'players',
|
||||
),
|
||||
'Items' => 'items',
|
||||
'Tools' => array(
|
||||
'phpinfo' => 'phpinfo',
|
||||
),
|
||||
'Notepad' => 'notepad',
|
||||
'Logs' => 'logs'
|
||||
);
|
||||
$menus = array(
|
||||
'Dashboard' => 'dashboard',
|
||||
'Mailer' => 'mailer',
|
||||
'Pages' => 'pages',
|
||||
'Menus' => 'menus',
|
||||
'Plugins' => 'plugins',
|
||||
'Visitors' => 'visitors',
|
||||
'Editor' => array(
|
||||
'Accounts' => 'accounts',
|
||||
'Players' => 'players',
|
||||
),
|
||||
'Items' => 'items',
|
||||
'Tools' => array(
|
||||
'phpinfo' => 'phpinfo',
|
||||
),
|
||||
'Notepad' => 'notepad',
|
||||
'Logs' => 'logs'
|
||||
);
|
||||
|
||||
$i = 0;
|
||||
foreach($menus as $_name => $_page) {
|
||||
$has_child = is_array($_page);
|
||||
if(!$has_child) {
|
||||
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>';
|
||||
}
|
||||
|
||||
if($has_child) {
|
||||
$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>';
|
||||
}
|
||||
$i++;
|
||||
$i = 0;
|
||||
foreach ($menus as $_name => $_page) {
|
||||
$has_child = is_array($_page);
|
||||
if (!$has_child) {
|
||||
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>';
|
||||
}
|
||||
|
||||
$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>
|
||||
if ($has_child) {
|
||||
$used_menu = "";
|
||||
$nav_construct = '';
|
||||
foreach ($_page as $__name => $__page) {
|
||||
$nav_construct = $nav_construct . '<li';
|
||||
|
||||
<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>
|
||||
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>';
|
||||
}
|
||||
|
||||
</div>
|
||||
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>';
|
||||
}
|
||||
$i++;
|
||||
}
|
||||
|
||||
<footer class="main-footer">
|
||||
$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="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>
|
||||
<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>
|
||||
|
||||
<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>
|
||||
|
||||
<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>
|
||||
<footer class="main-footer">
|
||||
|
||||
<?php } endif;
|
||||
if(!$logged && !admin()) {
|
||||
echo $content;
|
||||
}
|
||||
?>
|
||||
<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>
|
||||
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/bootstrap.min.js"></script>
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/jquery.min.js"></script>
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/jquery-ui.min.js"></script>
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/jquery.dataTables.min.js"></script>
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/dataTables.bootstrap.min.js"></script>
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/adminlte.min.js"></script>
|
||||
<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="<?php echo BASE_URL; ?>tools/js/bootstrap.min.js"></script>
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/jquery.min.js"></script>
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/jquery-ui.min.js"></script>
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/jquery.dataTables.min.js"></script>
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/adminlte.min.js"></script>
|
||||
</body>
|
||||
</html>
|
@ -14,24 +14,24 @@ $base = BASE_URL . 'admin/?p=accounts';
|
||||
|
||||
function echo_success($message)
|
||||
{
|
||||
echo '<p class="success">' . $message . '</p>';
|
||||
echo '<p class="success">' . $message . '</p>';
|
||||
}
|
||||
|
||||
function echo_error($message)
|
||||
{
|
||||
global $error;
|
||||
echo '<p class="error">' . $message . '</p>';
|
||||
$error = true;
|
||||
global $error;
|
||||
echo '<p class="error">' . $message . '</p>';
|
||||
$error = true;
|
||||
}
|
||||
|
||||
function verify_number($number, $name, $max_length)
|
||||
{
|
||||
if (!Validator::number($number))
|
||||
echo_error($name . ' can contain only numbers.');
|
||||
if (!Validator::number($number))
|
||||
echo_error($name . ' can contain only numbers.');
|
||||
|
||||
$number_length = strlen($number);
|
||||
if ($number_length <= 0 || $number_length > $max_length)
|
||||
echo_error($name . ' cannot be longer than ' . $max_length . ' digits.');
|
||||
$number_length = strlen($number);
|
||||
if ($number_length <= 0 || $number_length > $max_length)
|
||||
echo_error($name . ' cannot be longer than ' . $max_length . ' digits.');
|
||||
}
|
||||
|
||||
$hasCoinsColumn = $db->hasColumn('accounts', 'coins');
|
||||
@ -43,383 +43,385 @@ $hasCoinsColumn = $db->hasColumn('accounts', 'coins');
|
||||
<?php
|
||||
$id = 0;
|
||||
if (isset($_REQUEST['id']))
|
||||
$id = (int)$_REQUEST['id'];
|
||||
$id = (int)$_REQUEST['id'];
|
||||
else if (isset($_REQUEST['search_name'])) {
|
||||
if (strlen($_REQUEST['search_name']) < 3 && !Validator::number($_REQUEST['search_name'])) {
|
||||
echo 'Player name is too short.';
|
||||
} else {
|
||||
if (Validator::number($_REQUEST['search_name']))
|
||||
$id = $_REQUEST['search_name'];
|
||||
else {
|
||||
$query = $db->query('SELECT `id` FROM `accounts` WHERE `name` = ' . $db->quote($_REQUEST['search_name']));
|
||||
if ($query->rowCount() == 1) {
|
||||
$query = $query->fetch();
|
||||
$id = $query['id'];
|
||||
} else {
|
||||
$query = $db->query('SELECT `id`, `name` FROM `accounts` WHERE `name` LIKE ' . $db->quote('%' . $_REQUEST['search_name'] . '%'));
|
||||
if ($query->rowCount() > 0 && $query->rowCount() <= 10) {
|
||||
echo 'Do you mean?<ul>';
|
||||
foreach ($query as $row)
|
||||
echo '<li><a href="' . $base . '&id=' . $row['id'] . '">' . $row['name'] . '</a></li>';
|
||||
echo '</ul>';
|
||||
} else if ($query->rowCount() > 10)
|
||||
echo 'Specified name resulted with too many accounts.';
|
||||
}
|
||||
}
|
||||
}
|
||||
if (strlen($_REQUEST['search_name']) < 3 && !Validator::number($_REQUEST['search_name'])) {
|
||||
echo 'Player name is too short.';
|
||||
} else {
|
||||
if (Validator::number($_REQUEST['search_name']))
|
||||
$id = $_REQUEST['search_name'];
|
||||
else {
|
||||
$query = $db->query('SELECT `id` FROM `accounts` WHERE `name` = ' . $db->quote($_REQUEST['search_name']));
|
||||
if ($query->rowCount() == 1) {
|
||||
$query = $query->fetch();
|
||||
$id = $query['id'];
|
||||
} else {
|
||||
$query = $db->query('SELECT `id`, `name` FROM `accounts` WHERE `name` LIKE ' . $db->quote('%' . $_REQUEST['search_name'] . '%'));
|
||||
if ($query->rowCount() > 0 && $query->rowCount() <= 10) {
|
||||
echo 'Do you mean?<ul>';
|
||||
foreach ($query as $row)
|
||||
echo '<li><a href="' . $base . '&id=' . $row['id'] . '">' . $row['name'] . '</a></li>';
|
||||
echo '</ul>';
|
||||
} else if ($query->rowCount() > 10)
|
||||
echo 'Specified name resulted with too many accounts.';
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
if ($id > 0) {
|
||||
$account = new OTS_Account();
|
||||
$account->load($id);
|
||||
$account = new OTS_Account();
|
||||
$account->load($id);
|
||||
|
||||
if (isset($account) && $account->isLoaded() && isset($_POST['save'])) {// we want to save
|
||||
$error = false;
|
||||
if (isset($account) && $account->isLoaded() && isset($_POST['save'])) {// we want to save
|
||||
$error = false;
|
||||
|
||||
$name = $_POST['name'];
|
||||
$_error = '';
|
||||
$name = $_POST['name'];
|
||||
$_error = '';
|
||||
|
||||
//if (!Validator::check_account_name($name))
|
||||
// echo_error(Validator::getLastError());
|
||||
//if (!Validator::check_account_name($name))
|
||||
// echo_error(Validator::getLastError());
|
||||
|
||||
$account_db = new OTS_Account();
|
||||
$account_db->find($name);
|
||||
if ($account_db->isLoaded() && $account->getName() != $name)
|
||||
echo_error('This name is already used. Please choose another name!');
|
||||
$account_db = new OTS_Account();
|
||||
$account_db->find($name);
|
||||
if ($account_db->isLoaded() && $account->getName() != $name)
|
||||
echo_error('This name is already used. Please choose another name!');
|
||||
|
||||
$account_db->load($id);
|
||||
if (!$account_db->isLoaded())
|
||||
echo_error('Account with this id doesn\'t exist.');
|
||||
$account_db->load($id);
|
||||
if (!$account_db->isLoaded())
|
||||
echo_error('Account with this id doesn\'t exist.');
|
||||
|
||||
//type
|
||||
$group = $_POST['group'];
|
||||
//type
|
||||
$group = $_POST['group'];
|
||||
|
||||
$password = ((!empty($_POST["pass"]) ? $_POST['pass'] : null));
|
||||
if(!Validator::password($password)) {
|
||||
$errors['password'] = Validator::getLastError();
|
||||
}
|
||||
$password = ((!empty($_POST["pass"]) ? $_POST['pass'] : null));
|
||||
if (!Validator::password($password)) {
|
||||
$errors['password'] = Validator::getLastError();
|
||||
}
|
||||
|
||||
//secret
|
||||
$secret = $_POST['secret'];
|
||||
//key
|
||||
$key = $_POST['key'];
|
||||
//secret
|
||||
$secret = $_POST['secret'];
|
||||
//key
|
||||
$key = $_POST['key'];
|
||||
|
||||
$email = $_POST['email'];
|
||||
if(!Validator::email($email))
|
||||
$errors['email'] = Validator::getLastError();
|
||||
$email = $_POST['email'];
|
||||
if (!Validator::email($email))
|
||||
$errors['email'] = Validator::getLastError();
|
||||
|
||||
// prem days
|
||||
$p_days = $_POST['p_days'];
|
||||
verify_number($p_days, 'Prem days', 11);
|
||||
// prem days
|
||||
$p_days = $_POST['p_days'];
|
||||
verify_number($p_days, 'Prem days', 11);
|
||||
|
||||
//tibia coins
|
||||
if($hasCoinsColumn) {
|
||||
$t_coins = $_POST['t_coins'];
|
||||
verify_number($t_coins, 'Tibia coins', 12);
|
||||
}
|
||||
//tibia coins
|
||||
if ($hasCoinsColumn) {
|
||||
$t_coins = $_POST['t_coins'];
|
||||
verify_number($t_coins, 'Tibia coins', 12);
|
||||
}
|
||||
|
||||
//prem points
|
||||
$p_points = $_POST['p_points'];
|
||||
verify_number($p_points, 'Prem Points', 11);
|
||||
//prem points
|
||||
$p_points = $_POST['p_points'];
|
||||
verify_number($p_points, 'Prem Points', 11);
|
||||
|
||||
//rl name
|
||||
$rl_name = $_POST['rl_name'];
|
||||
//rl name
|
||||
$rl_name = $_POST['rl_name'];
|
||||
|
||||
//location
|
||||
$rl_loca = $_POST['rl_loca'];
|
||||
//location
|
||||
$rl_loca = $_POST['rl_loca'];
|
||||
|
||||
//country
|
||||
$rl_country = $_POST['rl_country'];
|
||||
//country
|
||||
$rl_country = $_POST['rl_country'];
|
||||
|
||||
//created
|
||||
$created = $_POST['created'];
|
||||
verify_number($created, 'Created', 20);
|
||||
//created
|
||||
$created = $_POST['created'];
|
||||
verify_number($created, 'Created', 20);
|
||||
|
||||
//last login
|
||||
$lastlogin = $_POST['lastlogin'];
|
||||
verify_number($lastlogin, 'Last login', 20);
|
||||
//last login
|
||||
$lastlogin = $_POST['lastlogin'];
|
||||
verify_number($lastlogin, 'Last login', 20);
|
||||
|
||||
//web last login
|
||||
$web_lastlogin = $_POST['web_lastlogin'];
|
||||
verify_number($web_lastlogin, 'Web Last logout', 20);
|
||||
//web last login
|
||||
$web_lastlogin = $_POST['web_lastlogin'];
|
||||
verify_number($web_lastlogin, 'Web Last logout', 20);
|
||||
|
||||
|
||||
if (!$error) {
|
||||
$account->setName($name);
|
||||
$account->setCustomField('type', $group);
|
||||
$account->setCustomField('secret', $secret);
|
||||
$account->setCustomField('key', $key);
|
||||
$account->setEMail($email);
|
||||
$account->setPremDays($p_days);
|
||||
if($hasCoinsColumn) {
|
||||
$account->setCustomField('coins', $t_coins);
|
||||
}
|
||||
if (!$error) {
|
||||
$account->setName($name);
|
||||
$account->setCustomField('type', $group);
|
||||
$account->setCustomField('secret', $secret);
|
||||
$account->setCustomField('key', $key);
|
||||
$account->setEMail($email);
|
||||
$account->setPremDays($p_days);
|
||||
if ($hasCoinsColumn) {
|
||||
$account->setCustomField('coins', $t_coins);
|
||||
}
|
||||
|
||||
$account->setRLName($rl_name);
|
||||
$account->setLocation($rl_loca);
|
||||
$account->setCountry($rl_country);
|
||||
$account->setRLName($rl_name);
|
||||
$account->setLocation($rl_loca);
|
||||
$account->setCountry($rl_country);
|
||||
|
||||
if ($db->hasColumn('accounts', 'premium_points')){
|
||||
$account->setCustomField('premium_points', $p_points);}
|
||||
if ($db->hasColumn('accounts', 'premium_points')) {
|
||||
$account->setCustomField('premium_points', $p_points);
|
||||
}
|
||||
|
||||
if (isset($password)) {
|
||||
$config_salt_enabled = $db->hasColumn('accounts', 'salt');
|
||||
if($config_salt_enabled)
|
||||
{
|
||||
$salt = generateRandomString(10, false, true, true);
|
||||
$password = $salt . $password;
|
||||
$account_logged->setCustomField('salt', $salt);
|
||||
}
|
||||
if (isset($password)) {
|
||||
$config_salt_enabled = $db->hasColumn('accounts', 'salt');
|
||||
if ($config_salt_enabled) {
|
||||
$salt = generateRandomString(10, false, true, true);
|
||||
$password = $salt . $password;
|
||||
$account_logged->setCustomField('salt', $salt);
|
||||
}
|
||||
|
||||
$password = encrypt($password);
|
||||
$account->setPassword($password);
|
||||
$password = encrypt($password);
|
||||
$account->setPassword($password);
|
||||
|
||||
if ($config_salt_enabled)
|
||||
$account->setCustomField('salt', $salt);
|
||||
}
|
||||
if ($config_salt_enabled)
|
||||
$account->setCustomField('salt', $salt);
|
||||
}
|
||||
|
||||
$account->setEMail($email);
|
||||
$account->setEMail($email);
|
||||
|
||||
//$account->setCustomField('created', time());
|
||||
//$account->setCustomField('created', time());
|
||||
|
||||
$account->save();
|
||||
echo_success('Account saved at: ' . date('G:i'));
|
||||
}
|
||||
}
|
||||
$account->save();
|
||||
echo_success('Account saved at: ' . date('G:i'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$search_name = '';
|
||||
$search_account = '';
|
||||
if (isset($_REQUEST['search_name']))
|
||||
$search_name = $_REQUEST['search_name'];
|
||||
$search_name = $_REQUEST['search_name'];
|
||||
else if (isset($_REQUEST['search_account']))
|
||||
$search_account = $_REQUEST['search_account'];
|
||||
$search_account = $_REQUEST['search_account'];
|
||||
else if ($id > 0 && isset($account) && $account->isLoaded())
|
||||
$search_name = $account->getName();
|
||||
$search_name = $account->getName();
|
||||
|
||||
?>
|
||||
<div class="row">
|
||||
<?php
|
||||
if (isset($account) && $account->isLoaded()) {
|
||||
?>
|
||||
<?php
|
||||
if (isset($account) && $account->isLoaded()) {
|
||||
?>
|
||||
|
||||
<?php $acc_type = array("Normal", "Tutor", "Senior Tutor", "Gamemaster", "God"); ?>
|
||||
<form action="<?php echo $base . ((isset($id) && $id > 0) ? '&id=' . $id : ''); ?>" method="post" class="form-horizontal">
|
||||
<div class="col-md-8">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<label for="name" class="control-label">Account Name</label>
|
||||
<input type="text" class="form-control" id="name" name="name"
|
||||
autocomplete="off" style="cursor: auto;"
|
||||
value="<?php echo $account->getName(); ?>"/>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<label for="account_id" class="control-label">Account id:</label>
|
||||
<input type="text" class="form-control" id="account_id" name="account_id"
|
||||
autocomplete="off" style="cursor: auto;" size="8" maxlength="11" disabled
|
||||
value="<?php echo $account->getId(); ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<label for="group" class="control-label">Type</label>
|
||||
<select name="group" id="group" class="form-control">
|
||||
<?php foreach ($acc_type as $id => $a_type): ?>
|
||||
<option value="<?php echo($id + 1); ?>" <?php echo($account->getCustomField('type') == ($id + 1) ? 'selected' : ''); ?>><?php echo $a_type; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<label for="c_pass" class="control-label">Password: (check to change)</label>
|
||||
<div class="input-group">
|
||||
<?php $acc_type = array("Normal", "Tutor", "Senior Tutor", "Gamemaster", "God"); ?>
|
||||
<form action="<?php echo $base . ((isset($id) && $id > 0) ? '&id=' . $id : ''); ?>" method="post"
|
||||
class="form-horizontal">
|
||||
<div class="col-md-8">
|
||||
<div class="box box-primary">
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<label for="name" class="control-label">Account Name</label>
|
||||
<input type="text" class="form-control" id="name" name="name"
|
||||
autocomplete="off" style="cursor: auto;"
|
||||
value="<?php echo $account->getName(); ?>"/>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<label for="account_id" class="control-label">Account id:</label>
|
||||
<input type="text" class="form-control" id="account_id" name="account_id"
|
||||
autocomplete="off" style="cursor: auto;" size="8" maxlength="11" disabled
|
||||
value="<?php echo $account->getId(); ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<label for="group" class="control-label">Type</label>
|
||||
<select name="group" id="group" class="form-control">
|
||||
<?php foreach ($acc_type as $id => $a_type): ?>
|
||||
<option value="<?php echo($id + 1); ?>" <?php echo($account->getCustomField('type') == ($id + 1) ? 'selected' : ''); ?>><?php echo $a_type; ?></option>
|
||||
<?php endforeach; ?>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<label for="c_pass" class="control-label">Password: (check to change)</label>
|
||||
<div class="input-group">
|
||||
|
||||
<span class="input-group-addon">
|
||||
<input type="checkbox"
|
||||
name="c_pass"
|
||||
id="c_pass"
|
||||
value="false"
|
||||
class="input_control"/>
|
||||
name="c_pass"
|
||||
id="c_pass"
|
||||
value="false"
|
||||
class="input_control"/>
|
||||
</span>
|
||||
<input type="text" class="form-control" id="pass" name="pass"
|
||||
autocomplete="off" maxlength="20"
|
||||
value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<label for="secret" class="control-label">Secret:</label>
|
||||
<input type="text" class="form-control" id="secret" name="secret"
|
||||
autocomplete="off" style="cursor: auto;" size="8" maxlength="11"
|
||||
value="<?php echo $account->getCustomField('secret'); ?>"/>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<label for="key" class="control-label">Key:</label>
|
||||
<input type="text" class="form-control" id="key" name="key"
|
||||
autocomplete="off" style="cursor: auto;" size="8" maxlength="11"
|
||||
value="<?php echo $account->getCustomField('key'); ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<label for="email" class="control-label">Email:</label>
|
||||
<input type="text" class="form-control" id="email" name="email"
|
||||
autocomplete="off" maxlength="20"
|
||||
value="<?php echo $account->getEMail(); ?>"/>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<label for="p_days" class="control-label">Prem Days:</label>
|
||||
<input type="text" class="form-control" id="p_days" name="p_days"
|
||||
autocomplete="off" maxlength="11"
|
||||
value="<?php echo $account->getPremDays(); ?>"/>
|
||||
</div>
|
||||
<?php if($hasCoinsColumn): ?>
|
||||
<div class="col-xs-6">
|
||||
<label for="t_coins" class="control-label">Tibia Coins:</label>
|
||||
<input type="text" class="form-control" id="t_coins" name="t_coins"
|
||||
autocomplete="off" maxlength="8"
|
||||
value="<?php echo $account->getCustomField('coins') ?>"/>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($db->hasColumn('players', 'blessings')): ?>
|
||||
<div class="col-xs-6">
|
||||
<label for="p_points" class="control-label">Prem Points:</label>
|
||||
<input type="text" class="form-control" id="p_points" name="p_points"
|
||||
autocomplete="off" maxlength="8"
|
||||
value="<?php echo $account->getCustomField('premium_points') ?>"/>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
<label for="rl_name" class="control-label">RL Name:</label>
|
||||
<input type="text" class="form-control" id="rl_name" name="rl_name"
|
||||
autocomplete="off" maxlength="20"
|
||||
value="<?php echo $account->getRLName(); ?>"/>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<label for="rl_loca" class="control-label">Location:</label>
|
||||
<input type="text" class="form-control" id="rl_loca" name="rl_loca"
|
||||
autocomplete="off" maxlength="20"
|
||||
value="<?php echo $account->getLocation(); ?>"/>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<label for="rl_country" class="control-label">Country:</label>
|
||||
<input type="text" class="form-control" id="rl_country" name="rl_country"
|
||||
autocomplete="off" maxlength="8"
|
||||
value="<?php echo $account->getCountry(); ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<input type="text" class="form-control" id="pass" name="pass"
|
||||
autocomplete="off" maxlength="20"
|
||||
value=""/>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<label for="secret" class="control-label">Secret:</label>
|
||||
<input type="text" class="form-control" id="secret" name="secret"
|
||||
autocomplete="off" style="cursor: auto;" size="8" maxlength="11"
|
||||
value="<?php echo $account->getCustomField('secret'); ?>"/>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<label for="key" class="control-label">Key:</label>
|
||||
<input type="text" class="form-control" id="key" name="key"
|
||||
autocomplete="off" style="cursor: auto;" size="8" maxlength="11"
|
||||
value="<?php echo $account->getCustomField('key'); ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<label for="email" class="control-label">Email:</label>
|
||||
<input type="text" class="form-control" id="email" name="email"
|
||||
autocomplete="off" maxlength="20"
|
||||
value="<?php echo $account->getEMail(); ?>"/>
|
||||
</div>
|
||||
<div class="col-xs-6">
|
||||
<label for="p_days" class="control-label">Prem Days:</label>
|
||||
<input type="text" class="form-control" id="p_days" name="p_days"
|
||||
autocomplete="off" maxlength="11"
|
||||
value="<?php echo $account->getPremDays(); ?>"/>
|
||||
</div>
|
||||
<?php if ($hasCoinsColumn): ?>
|
||||
<div class="col-xs-6">
|
||||
<label for="t_coins" class="control-label">Tibia Coins:</label>
|
||||
<input type="text" class="form-control" id="t_coins" name="t_coins"
|
||||
autocomplete="off" maxlength="8"
|
||||
value="<?php echo $account->getCustomField('coins') ?>"/>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
<?php if ($db->hasColumn('players', 'blessings')): ?>
|
||||
<div class="col-xs-6">
|
||||
<label for="p_points" class="control-label">Prem Points:</label>
|
||||
<input type="text" class="form-control" id="p_points" name="p_points"
|
||||
autocomplete="off" maxlength="8"
|
||||
value="<?php echo $account->getCustomField('premium_points') ?>"/>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
<label for="rl_name" class="control-label">RL Name:</label>
|
||||
<input type="text" class="form-control" id="rl_name" name="rl_name"
|
||||
autocomplete="off" maxlength="20"
|
||||
value="<?php echo $account->getRLName(); ?>"/>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<label for="rl_loca" class="control-label">Location:</label>
|
||||
<input type="text" class="form-control" id="rl_loca" name="rl_loca"
|
||||
autocomplete="off" maxlength="20"
|
||||
value="<?php echo $account->getLocation(); ?>"/>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<label for="rl_country" class="control-label">Country:</label>
|
||||
<input type="text" class="form-control" id="rl_country" name="rl_country"
|
||||
autocomplete="off" maxlength="8"
|
||||
value="<?php echo $account->getCountry(); ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
<label for="created" class="control-label">Created:</label>
|
||||
<input type="text" class="form-control" id="created" name="created"
|
||||
autocomplete="off" maxlength="20"
|
||||
value="<?php echo $account->getCustomField('created'); ?>"/>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<label for="lastlogin" class="control-label">Last Login:</label>
|
||||
<input type="text" class="form-control" id="lastlogin" name="lastlogin"
|
||||
autocomplete="off" maxlength="20"
|
||||
value="<?php echo $account->getLastLogin(); ?>"/>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<label for="web_lastlogin" class="control-label">Web Last Login:</label>
|
||||
<input type="text" class="form-control" id="web_lastlogin" name="web_lastlogin"
|
||||
autocomplete="off" maxlength="20"
|
||||
value="<?php echo $account->getCustomField('web_lastlogin'); ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
<label for="created" class="control-label">Created:</label>
|
||||
<input type="text" class="form-control" id="created" name="created"
|
||||
autocomplete="off" maxlength="20"
|
||||
value="<?php echo $account->getCustomField('created'); ?>"/>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<label for="lastlogin" class="control-label">Last Login:</label>
|
||||
<input type="text" class="form-control" id="lastlogin" name="lastlogin"
|
||||
autocomplete="off" maxlength="20"
|
||||
value="<?php echo $account->getLastLogin(); ?>"/>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<label for="web_lastlogin" class="control-label">Web Last Login:</label>
|
||||
<input type="text" class="form-control" id="web_lastlogin" name="web_lastlogin"
|
||||
autocomplete="off" maxlength="20"
|
||||
value="<?php echo $account->getCustomField('web_lastlogin'); ?>"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<input type="hidden" name="save" value="yes"/>
|
||||
<div class="box-footer">
|
||||
<a href="<?php echo ADMIN_URL; ?>?p=accounts"><span class="btn btn-danger">Cancel</span></a>
|
||||
<div class="pull-right">
|
||||
<input type="submit" class="btn btn-primary" value="Update">
|
||||
</div>
|
||||
</div>
|
||||
<input type="hidden" name="save" value="yes"/>
|
||||
<div class="box-footer">
|
||||
<a href="<?php echo ADMIN_URL; ?>?p=accounts"><span class="btn btn-danger">Cancel</span></a>
|
||||
<div class="pull-right">
|
||||
<input type="submit" class="btn btn-primary" value="Update">
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div class="col-md-4">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Search Account:</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Search Account:</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="box-body">
|
||||
<form action="<?php echo $base; ?>" method="post">
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="text" class="form-control" name="search_name" value="<?php echo $search_name; ?>"
|
||||
maxlength="32" size="32">
|
||||
<span class="input-group-btn">
|
||||
<div class="box-body">
|
||||
<form action="<?php echo $base; ?>" method="post">
|
||||
<div class="input-group input-group-sm">
|
||||
<input type="text" class="form-control" name="search_name" value="<?php echo $search_name; ?>"
|
||||
maxlength="32" size="32">
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" type="button" class="btn btn-info btn-flat">Search</button>
|
||||
</span>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if (isset($account) && $account->isLoaded()) {
|
||||
$account_players = array();
|
||||
$query = $db->query('SELECT `name`,`level`,`vocation` FROM `players` WHERE `account_id` = ' . $account->getId() . ' ORDER BY `name`')->fetchAll();
|
||||
if (isset($query)) {
|
||||
?>
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Character List:</h3>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<table class="table table-striped">
|
||||
<tbody><tr>
|
||||
<th style="width: 10px">#</th>
|
||||
<th>Name</th>
|
||||
<th>Level</th>
|
||||
<th style="width: 40px">Edit</th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 1;
|
||||
foreach ($query as $p) {
|
||||
$account_players[] = $p;
|
||||
echo '<tr>
|
||||
<td>'.$i.'.</td>
|
||||
<td>'.$p['name'] . '</td>
|
||||
<td>'.$p['level'].'</td>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if (isset($account) && $account->isLoaded()) {
|
||||
$account_players = array();
|
||||
$query = $db->query('SELECT `name`,`level`,`vocation` FROM `players` WHERE `account_id` = ' . $account->getId() . ' ORDER BY `name`')->fetchAll();
|
||||
if (isset($query)) {
|
||||
?>
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Character List:</h3>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<table class="table table-striped">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th style="width: 10px">#</th>
|
||||
<th>Name</th>
|
||||
<th>Level</th>
|
||||
<th style="width: 40px">Edit</th>
|
||||
</tr>
|
||||
<?php
|
||||
$i = 1;
|
||||
foreach ($query as $p) {
|
||||
$account_players[] = $p;
|
||||
echo '<tr>
|
||||
<td>' . $i . '.</td>
|
||||
<td>' . $p['name'] . '</td>
|
||||
<td>' . $p['level'] . '</td>
|
||||
<td><a href="?p=players&search_name=' . $p['name'] . '"><span class="btn btn-success btn-sm edit btn-flat"><i class="fa fa-edit"></i></span></a></span></td>
|
||||
</tr>';
|
||||
$i++;
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
$i++;
|
||||
} ?>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
};
|
||||
};
|
||||
?>
|
||||
<?php
|
||||
};
|
||||
};
|
||||
?>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('#lastlogin').datetimepicker({ format: 'unixtime' });
|
||||
$('#lastlogout').datetimepicker({ format: 'unixtime' });
|
||||
$('#created').datetimepicker({ format: 'unixtime' });
|
||||
$('#web_lastlogin').datetimepicker({ format: 'unixtime' });
|
||||
$(document).ready(function () {
|
||||
$('.input_control').change(function () {
|
||||
$('input[name=pass]')[0].disabled = !this.checked;
|
||||
$('input[name=pass]')[0].value = '';
|
||||
}).change();
|
||||
});
|
||||
$('#lastlogin').datetimepicker({format: 'unixtime'});
|
||||
$('#lastlogout').datetimepicker({format: 'unixtime'});
|
||||
$('#created').datetimepicker({format: 'unixtime'});
|
||||
$('#web_lastlogin').datetimepicker({format: 'unixtime'});
|
||||
$(document).ready(function () {
|
||||
$('.input_control').change(function () {
|
||||
$('input[name=pass]')[0].disabled = !this.checked;
|
||||
$('input[name=pass]')[0].value = '';
|
||||
}).change();
|
||||
});
|
||||
</script>
|
@ -10,7 +10,7 @@
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'MyAAC Changelog';
|
||||
|
||||
if(!file_exists(BASE . 'CHANGELOG')) {
|
||||
if (!file_exists(BASE . 'CHANGELOG')) {
|
||||
echo 'File CHANGELOG doesn\'t exist.';
|
||||
return;
|
||||
}
|
||||
|
@ -12,39 +12,39 @@ $title = 'Dashboard';
|
||||
|
||||
$cache = Cache::getInstance();
|
||||
if ($cache->enabled()) {
|
||||
if (isset($_GET['clear_cache'])) {
|
||||
if (clearCache())
|
||||
success('Cache cleared.');
|
||||
else
|
||||
error('Error while clearing cache.');
|
||||
}
|
||||
if (isset($_GET['clear_cache'])) {
|
||||
if (clearCache())
|
||||
success('Cache cleared.');
|
||||
else
|
||||
error('Error while clearing cache.');
|
||||
}
|
||||
}
|
||||
if (isset($_GET['maintenance'])) {
|
||||
$_status = (int)$_POST['status'];
|
||||
$message = $_POST['message'];
|
||||
if (empty($message)) {
|
||||
error('Message cannot be empty.');
|
||||
} else if (strlen($message) > 255) {
|
||||
error('Message is too long. Maximum length allowed is 255 chars.');
|
||||
} else {
|
||||
$tmp = '';
|
||||
if (fetchDatabaseConfig('site_closed', $tmp))
|
||||
updateDatabaseConfig('site_closed', $_status);
|
||||
else
|
||||
registerDatabaseConfig('site_closed', $_status);
|
||||
$_status = (int)$_POST['status'];
|
||||
$message = $_POST['message'];
|
||||
if (empty($message)) {
|
||||
error('Message cannot be empty.');
|
||||
} else if (strlen($message) > 255) {
|
||||
error('Message is too long. Maximum length allowed is 255 chars.');
|
||||
} else {
|
||||
$tmp = '';
|
||||
if (fetchDatabaseConfig('site_closed', $tmp))
|
||||
updateDatabaseConfig('site_closed', $_status);
|
||||
else
|
||||
registerDatabaseConfig('site_closed', $_status);
|
||||
|
||||
if (fetchDatabaseConfig('site_closed_message', $tmp))
|
||||
updateDatabaseConfig('site_closed_message', $message);
|
||||
else
|
||||
registerDatabaseConfig('site_closed_message', $message);
|
||||
}
|
||||
if (fetchDatabaseConfig('site_closed_message', $tmp))
|
||||
updateDatabaseConfig('site_closed_message', $message);
|
||||
else
|
||||
registerDatabaseConfig('site_closed_message', $message);
|
||||
}
|
||||
}
|
||||
$is_closed = getDatabaseConfig('site_closed') == '1';
|
||||
|
||||
$closed_message = 'Server is under maintenance, please visit later.';
|
||||
$tmp = '';
|
||||
if (fetchDatabaseConfig('site_closed_message', $tmp))
|
||||
$closed_message = $tmp;
|
||||
$closed_message = $tmp;
|
||||
|
||||
$query = $db->query('SELECT count(*) as `how_much` FROM `accounts`;');
|
||||
$query = $query->fetch();
|
||||
@ -63,73 +63,73 @@ $query = $query->fetch();
|
||||
$total_houses = $query['how_much'];
|
||||
|
||||
if ($db->hasColumn('accounts', 'premium_points')) {
|
||||
$points = $db->query('SELECT `premium_points`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `premium_points` DESC LIMIT 10;');
|
||||
$points = $db->query('SELECT `premium_points`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `premium_points` DESC LIMIT 10;');
|
||||
} else {
|
||||
$points = 0;
|
||||
$points = 0;
|
||||
}
|
||||
|
||||
if ($db->hasColumn('accounts', 'coins')) {
|
||||
$coins = $db->query('SELECT `coins`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `coins` DESC LIMIT 10;');
|
||||
$coins = $db->query('SELECT `coins`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `coins` DESC LIMIT 10;');
|
||||
} else {
|
||||
$coins = 0;
|
||||
$coins = 0;
|
||||
}
|
||||
|
||||
$twig->display('admin.statistics.html.twig', array(
|
||||
'total_accounts' => $total_accounts,
|
||||
'total_players' => $total_players,
|
||||
'total_guilds' => $total_guilds,
|
||||
'total_houses' => $total_houses
|
||||
'total_accounts' => $total_accounts,
|
||||
'total_players' => $total_players,
|
||||
'total_guilds' => $total_guilds,
|
||||
'total_houses' => $total_houses
|
||||
));
|
||||
|
||||
$twig->display('admin.dashboard.html.twig', array(
|
||||
'is_closed' => $is_closed,
|
||||
'closed_message' => $closed_message,
|
||||
'status' => $status,
|
||||
'account_type' => (USE_ACCOUNT_NAME ? 'name' : 'number'),
|
||||
'points' => $points,
|
||||
'coins' => $coins,
|
||||
'is_closed' => $is_closed,
|
||||
'closed_message' => $closed_message,
|
||||
'status' => $status,
|
||||
'account_type' => (USE_ACCOUNT_NAME ? 'name' : 'number'),
|
||||
'points' => $points,
|
||||
'coins' => $coins,
|
||||
));
|
||||
function clearCache()
|
||||
{
|
||||
global $template_name;
|
||||
$cache = Cache::getInstance();
|
||||
global $template_name;
|
||||
$cache = Cache::getInstance();
|
||||
|
||||
$tmp = '';
|
||||
if ($cache->fetch('status', $tmp))
|
||||
$cache->delete('status');
|
||||
$tmp = '';
|
||||
if ($cache->fetch('status', $tmp))
|
||||
$cache->delete('status');
|
||||
|
||||
if ($cache->fetch('templates', $tmp))
|
||||
$cache->delete('templates');
|
||||
if ($cache->fetch('templates', $tmp))
|
||||
$cache->delete('templates');
|
||||
|
||||
if ($cache->fetch('config_lua', $tmp))
|
||||
$cache->delete('config_lua');
|
||||
if ($cache->fetch('config_lua', $tmp))
|
||||
$cache->delete('config_lua');
|
||||
|
||||
if ($cache->fetch('vocations', $tmp))
|
||||
$cache->delete('vocations');
|
||||
if ($cache->fetch('vocations', $tmp))
|
||||
$cache->delete('vocations');
|
||||
|
||||
if ($cache->fetch('towns', $tmp))
|
||||
$cache->delete('towns');
|
||||
if ($cache->fetch('towns', $tmp))
|
||||
$cache->delete('towns');
|
||||
|
||||
if ($cache->fetch('groups', $tmp))
|
||||
$cache->delete('groups');
|
||||
if ($cache->fetch('groups', $tmp))
|
||||
$cache->delete('groups');
|
||||
|
||||
if ($cache->fetch('visitors', $tmp))
|
||||
$cache->delete('visitors');
|
||||
if ($cache->fetch('visitors', $tmp))
|
||||
$cache->delete('visitors');
|
||||
|
||||
if ($cache->fetch('views_counter', $tmp))
|
||||
$cache->delete('views_counter');
|
||||
if ($cache->fetch('views_counter', $tmp))
|
||||
$cache->delete('views_counter');
|
||||
|
||||
if ($cache->fetch('failed_logins', $tmp))
|
||||
$cache->delete('failed_logins');
|
||||
if ($cache->fetch('failed_logins', $tmp))
|
||||
$cache->delete('failed_logins');
|
||||
|
||||
if ($cache->fetch('news' . $template_name . '_' . NEWS, $tmp))
|
||||
$cache->delete('news' . $template_name . '_' . NEWS);
|
||||
if ($cache->fetch('news' . $template_name . '_' . NEWS, $tmp))
|
||||
$cache->delete('news' . $template_name . '_' . NEWS);
|
||||
|
||||
if ($cache->fetch('news' . $template_name . '_' . TICKER, $tmp))
|
||||
$cache->delete('news' . $template_name . '_' . TICKER);
|
||||
if ($cache->fetch('news' . $template_name . '_' . TICKER, $tmp))
|
||||
$cache->delete('news' . $template_name . '_' . TICKER);
|
||||
|
||||
if ($cache->fetch('template_ini' . $template_name, $tmp))
|
||||
$cache->delete('template_ini' . $template_name);
|
||||
if ($cache->fetch('template_ini' . $template_name, $tmp))
|
||||
$cache->delete('template_ini' . $template_name);
|
||||
|
||||
return true;
|
||||
return true;
|
||||
}
|
@ -16,13 +16,13 @@ require LIBS . 'weapons.php';
|
||||
$twig->display('admin.items.html.twig');
|
||||
|
||||
$reload = isset($_REQUEST['reload']) && (int)$_REQUEST['reload'] == 1;
|
||||
if($reload) {
|
||||
if(Items::loadFromXML(true))
|
||||
if ($reload) {
|
||||
if (Items::loadFromXML(true))
|
||||
success('Successfully loaded items.');
|
||||
else
|
||||
error(Items::getError());
|
||||
|
||||
if(Weapons::loadFromXML(true))
|
||||
if (Weapons::loadFromXML(true))
|
||||
success('Successfully loaded weapons.');
|
||||
else
|
||||
error(Weapons::getError());
|
||||
|
@ -10,23 +10,23 @@
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Login';
|
||||
$logout = '';
|
||||
if($action == 'logout') {
|
||||
$logout = "You have been logged out!";
|
||||
if ($action == 'logout') {
|
||||
$logout = "You have been logged out!";
|
||||
}
|
||||
|
||||
$search_errors[] = 'Character <b></b> does not exist or has been deleted.';
|
||||
|
||||
|
||||
if(isset($errors)) {
|
||||
foreach($errors as $error) {
|
||||
if (isset($errors)) {
|
||||
foreach ($errors as $error) {
|
||||
error($error);
|
||||
$twig->display('admin.error.html.twig', array('errors' => $error));
|
||||
$twig->display('admin.error.html.twig', array('errors' => $error));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$twig->display('admin.login.html.twig', array(
|
||||
'errors' => $search_errors,
|
||||
'logout' => $logout,
|
||||
'account' => USE_ACCOUNT_NAME ? 'Name' : 'Number',
|
||||
));
|
||||
'errors' => $search_errors,
|
||||
'logout' => $logout,
|
||||
'account' => USE_ACCOUNT_NAME ? 'Name' : 'Number',
|
||||
));
|
@ -12,113 +12,113 @@ $title = 'Logs viewer';
|
||||
?>
|
||||
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Logs:</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div id="logs_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table id="logs" class="table table-bordered table-striped dataTable" role="grid"
|
||||
aria-describedby="logs_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="sorting_asc" tabindex="0" aria-controls="logs" rowspan="1" colspan="1"
|
||||
aria-sort="ascending" aria-label="Log name: activate to sort column descending"
|
||||
style="width: 297px;">Log name
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="logs" rowspan="1" colspan="1"
|
||||
aria-label="Last updated: activate to sort column ascending" style="width: 361px;">Last
|
||||
updated
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$files = array();
|
||||
$aac_path_logs = BASE . 'system/logs/';
|
||||
foreach (scandir($aac_path_logs) as $f) {
|
||||
if ($f[0] == '.' || $f == '..' || is_dir($aac_path_logs . $f))
|
||||
continue;
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Logs:</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div id="logs_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table id="logs" class="table table-bordered table-striped dataTable" role="grid"
|
||||
aria-describedby="logs_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="sorting_asc" tabindex="0" aria-controls="logs" rowspan="1" colspan="1"
|
||||
aria-sort="ascending" aria-label="Log name: activate to sort column descending"
|
||||
style="width: 297px;">Log name
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="logs" rowspan="1" colspan="1"
|
||||
aria-label="Last updated: activate to sort column ascending" style="width: 361px;">Last
|
||||
updated
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<?php
|
||||
$files = array();
|
||||
$aac_path_logs = BASE . 'system/logs/';
|
||||
foreach (scandir($aac_path_logs) as $f) {
|
||||
if ($f[0] == '.' || $f == '..' || is_dir($aac_path_logs . $f))
|
||||
continue;
|
||||
|
||||
$files[] = array($f, $aac_path_logs);
|
||||
}
|
||||
$files[] = array($f, $aac_path_logs);
|
||||
}
|
||||
|
||||
$server_path_logs = $config['server_path'] . 'logs/';
|
||||
if (!file_exists($server_path_logs)) {
|
||||
$server_path_logs = $config['data_path'] . 'logs/';
|
||||
}
|
||||
$server_path_logs = $config['server_path'] . 'logs/';
|
||||
if (!file_exists($server_path_logs)) {
|
||||
$server_path_logs = $config['data_path'] . 'logs/';
|
||||
}
|
||||
|
||||
if (file_exists($server_path_logs)) {
|
||||
foreach (scandir($server_path_logs) as $f) {
|
||||
if ($f[0] == '.' || $f == '..')
|
||||
continue;
|
||||
if (file_exists($server_path_logs)) {
|
||||
foreach (scandir($server_path_logs) as $f) {
|
||||
if ($f[0] == '.' || $f == '..')
|
||||
continue;
|
||||
|
||||
if (is_dir($server_path_logs . $f)) {
|
||||
foreach (scandir($server_path_logs . $f) as $f2) {
|
||||
if ($f2[0] == '.' || $f2 == '..')
|
||||
continue;
|
||||
$files[] = array($f . '/' . $f2, $server_path_logs);
|
||||
}
|
||||
if (is_dir($server_path_logs . $f)) {
|
||||
foreach (scandir($server_path_logs . $f) as $f2) {
|
||||
if ($f2[0] == '.' || $f2 == '..')
|
||||
continue;
|
||||
$files[] = array($f . '/' . $f2, $server_path_logs);
|
||||
}
|
||||
|
||||
continue;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
$files[] = array($f, $server_path_logs);
|
||||
}
|
||||
}
|
||||
$files[] = array($f, $server_path_logs);
|
||||
}
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
foreach ($files as $f) {
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="<?php echo ADMIN_URL . '?p=logs&file=' . $f[0]; ?>"><?php echo $f[0]; ?></a>
|
||||
</td>
|
||||
<td><?php echo date("Y-m-d H:i:s", filemtime($f[1] . $f[0])); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<th>Log name</th>
|
||||
<th>Last updated</th>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
$i = 0;
|
||||
foreach ($files as $f) {
|
||||
?>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="<?php echo ADMIN_URL . '?p=logs&file=' . $f[0]; ?>"><?php echo $f[0]; ?></a>
|
||||
</td>
|
||||
<td><?php echo date("Y-m-d H:i:s", filemtime($f[1] . $f[0])); ?></td>
|
||||
</tr>
|
||||
<?php
|
||||
}
|
||||
?>
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<th>Log name</th>
|
||||
<th>Last updated</th>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
$file = isset($_GET['file']) ? $_GET['file'] : NULL;
|
||||
if (!empty($file)) {
|
||||
if (!preg_match('/[^A-z0-9\' _\/\-\.]/', $file)) {
|
||||
if (file_exists($aac_path_logs . $file)) {
|
||||
echo '
|
||||
if (!preg_match('/[^A-z0-9\' _\/\-\.]/', $file)) {
|
||||
if (file_exists($aac_path_logs . $file)) {
|
||||
echo '
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title"><b>' . $file . '</b></h3>
|
||||
</div>
|
||||
<div class="box-body">';
|
||||
echo nl2br(file_get_contents($aac_path_logs . $file));
|
||||
echo '</div>
|
||||
echo nl2br(file_get_contents($aac_path_logs . $file));
|
||||
echo '</div>
|
||||
</div>';
|
||||
} else if (file_exists($server_path_logs . $file)) {
|
||||
echo '<div class="box"><div class="box-header"><h3 class="box-title"><b>' . $file . '</b></h3></div><div class="box-body">';
|
||||
echo nl2br(file_get_contents($server_path_logs . $file));
|
||||
echo '</div></div>';
|
||||
} else
|
||||
echo 'Specified file does not exist.';
|
||||
} else
|
||||
echo 'Invalid file name specified.';
|
||||
} else if (file_exists($server_path_logs . $file)) {
|
||||
echo '<div class="box"><div class="box-header"><h3 class="box-title"><b>' . $file . '</b></h3></div><div class="box-body">';
|
||||
echo nl2br(file_get_contents($server_path_logs . $file));
|
||||
echo '</div></div>';
|
||||
} else
|
||||
echo 'Specified file does not exist.';
|
||||
} else
|
||||
echo 'Invalid file name specified.';
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
$(function () {
|
||||
$('#logs').DataTable()
|
||||
})
|
||||
$(function () {
|
||||
$('#logs').DataTable()
|
||||
})
|
||||
</script>
|
@ -10,14 +10,12 @@
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Mailer';
|
||||
|
||||
if(!hasFlag(FLAG_CONTENT_MAILER) && !superAdmin())
|
||||
{
|
||||
if (!hasFlag(FLAG_CONTENT_MAILER) && !superAdmin()) {
|
||||
echo 'Access denied.';
|
||||
return;
|
||||
}
|
||||
|
||||
if(!$config['mail_enabled'])
|
||||
{
|
||||
if (!$config['mail_enabled']) {
|
||||
echo 'Mail support disabled.';
|
||||
return;
|
||||
}
|
||||
@ -27,11 +25,11 @@ $mail_subject = isset($_POST['mail_subject']) ? stripslashes($_POST['mail_subjec
|
||||
$preview = isset($_REQUEST['preview']);
|
||||
|
||||
$preview_done = false;
|
||||
if($preview) {
|
||||
if(!empty($mail_content) && !empty($mail_subject)) {
|
||||
if ($preview) {
|
||||
if (!empty($mail_content) && !empty($mail_subject)) {
|
||||
$preview_done = _mail($account_logged->getCustomField('email'), $mail_subject, $mail_content);
|
||||
|
||||
if(!$preview_done)
|
||||
if (!$preview_done)
|
||||
error('Error while sending preview mail: ' . $mailer->ErrorInfo);
|
||||
}
|
||||
}
|
||||
@ -43,31 +41,29 @@ $twig->display('admin.mailer.html.twig', array(
|
||||
'preview_done' => $preview_done
|
||||
));
|
||||
|
||||
if(empty($mail_content) || empty($mail_subject) || $preview)
|
||||
if (empty($mail_content) || empty($mail_subject) || $preview)
|
||||
return;
|
||||
|
||||
$success = 0;
|
||||
$failed = 0;
|
||||
|
||||
$add = '';
|
||||
if($config['account_mail_verify']) {
|
||||
if ($config['account_mail_verify']) {
|
||||
note('Note: Sending only to users with verified E-Mail.');
|
||||
$add = ' AND ' . $db->fieldName('email_verified') . ' = 1';
|
||||
}
|
||||
|
||||
$query = $db->query('SELECT ' . $db->fieldName('email') . ' FROM ' . $db->tableName('accounts') . ' WHERE ' . $db->fieldName('email') . ' != ""' . $add);
|
||||
foreach($query as $email)
|
||||
{
|
||||
if(_mail($email['email'], $mail_subject, $mail_content))
|
||||
foreach ($query as $email) {
|
||||
if (_mail($email['email'], $mail_subject, $mail_content))
|
||||
$success++;
|
||||
else
|
||||
{
|
||||
else {
|
||||
$failed++;
|
||||
echo '<br />';
|
||||
error('An error occorred while sending email to <b>' . $email['email'] . '</b>. Error: ' . $mailer->ErrorInfo);
|
||||
}
|
||||
}
|
||||
|
||||
success('Mailing finished.');
|
||||
success("$success emails delivered.");
|
||||
warning("$failed emails failed.");
|
||||
success('Mailing finished.');
|
||||
success("$success emails delivered.");
|
||||
warning("$failed emails failed.");
|
||||
|
@ -10,84 +10,81 @@
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Menus';
|
||||
|
||||
if(!hasFlag(FLAG_CONTENT_MENUS) && !superAdmin())
|
||||
{
|
||||
echo 'Access denied.';
|
||||
return;
|
||||
if (!hasFlag(FLAG_CONTENT_MENUS) && !superAdmin()) {
|
||||
echo 'Access denied.';
|
||||
return;
|
||||
}
|
||||
|
||||
if(isset($_REQUEST['template'])) {
|
||||
$template = $_REQUEST['template'];
|
||||
if (isset($_REQUEST['template'])) {
|
||||
$template = $_REQUEST['template'];
|
||||
|
||||
if(isset($_REQUEST['menu'])) {
|
||||
$post_menu = $_REQUEST['menu'];
|
||||
$post_menu_link = $_REQUEST['menu_link'];
|
||||
$post_menu_blank = $_REQUEST['menu_blank'];
|
||||
$post_menu_color = $_REQUEST['menu_color'];
|
||||
if(count($post_menu) != count($post_menu_link)) {
|
||||
echo 'Menu count is not equal menu links. Something went wrong when sending form.';
|
||||
return;
|
||||
}
|
||||
if (isset($_REQUEST['menu'])) {
|
||||
$post_menu = $_REQUEST['menu'];
|
||||
$post_menu_link = $_REQUEST['menu_link'];
|
||||
$post_menu_blank = $_REQUEST['menu_blank'];
|
||||
$post_menu_color = $_REQUEST['menu_color'];
|
||||
if (count($post_menu) != count($post_menu_link)) {
|
||||
echo 'Menu count is not equal menu links. Something went wrong when sending form.';
|
||||
return;
|
||||
}
|
||||
|
||||
$db->query('DELETE FROM `' . TABLE_PREFIX . 'menu` WHERE `template` = ' . $db->quote($template));
|
||||
foreach($post_menu as $category => $menus) {
|
||||
foreach($menus as $i => $menu) {
|
||||
if(empty($menu)) // don't save empty menu item
|
||||
continue;
|
||||
$db->query('DELETE FROM `' . TABLE_PREFIX . 'menu` WHERE `template` = ' . $db->quote($template));
|
||||
foreach ($post_menu as $category => $menus) {
|
||||
foreach ($menus as $i => $menu) {
|
||||
if (empty($menu)) // don't save empty menu item
|
||||
continue;
|
||||
|
||||
try {
|
||||
$db->insert(TABLE_PREFIX . 'menu', array('template' => $template, 'name' => $menu, 'link' => $post_menu_link[$category][$i], 'blank' => $post_menu_blank[$category][$i] == 'on' ? 1 : 0, 'color' => str_replace('#', '', $post_menu_color[$category][$i]), 'category' => $category, 'ordering' => $i));
|
||||
}
|
||||
catch(PDOException $error) {
|
||||
warning('Error while adding menu item (' . $menu . '): ' . $error->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
try {
|
||||
$db->insert(TABLE_PREFIX . 'menu', array('template' => $template, 'name' => $menu, 'link' => $post_menu_link[$category][$i], 'blank' => $post_menu_blank[$category][$i] == 'on' ? 1 : 0, 'color' => str_replace('#', '', $post_menu_color[$category][$i]), 'category' => $category, 'ordering' => $i));
|
||||
} catch (PDOException $error) {
|
||||
warning('Error while adding menu item (' . $menu . '): ' . $error->getMessage());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
success('Saved at ' . date('H:i'));
|
||||
}
|
||||
success('Saved at ' . date('H:i'));
|
||||
}
|
||||
|
||||
$file = TEMPLATES . $template . '/config.php';
|
||||
if(file_exists($file)) {
|
||||
require_once $file;
|
||||
}
|
||||
else {
|
||||
echo 'Cannot find template config.php file.';
|
||||
return;
|
||||
}
|
||||
$file = TEMPLATES . $template . '/config.php';
|
||||
if (file_exists($file)) {
|
||||
require_once $file;
|
||||
} else {
|
||||
echo 'Cannot find template config.php file.';
|
||||
return;
|
||||
}
|
||||
|
||||
if(!isset($config['menu_categories'])) {
|
||||
echo "No menu categories set in template config.php.<br/>This template doesn't support dynamic menus.";
|
||||
return;
|
||||
}
|
||||
if (!isset($config['menu_categories'])) {
|
||||
echo "No menu categories set in template config.php.<br/>This template doesn't support dynamic menus.";
|
||||
return;
|
||||
}
|
||||
|
||||
echo 'Hint: You can drag menu items.<br/>
|
||||
echo 'Hint: You can drag menu items.<br/>
|
||||
Hint: Add links to external sites using: <b>http://</b> prefix.<br/>
|
||||
Not all templates support blank and colorful links.<br/>
|
||||
<div class="row">';
|
||||
$menus = array();
|
||||
$menus_db = $db->query('SELECT `name`, `link`, `blank`, `color`, `category`, `ordering` FROM `' . TABLE_PREFIX . 'menu` WHERE `enabled` = 1 AND `template` = ' . $db->quote($template) . ' ORDER BY `ordering` ASC;')->fetchAll();
|
||||
foreach($menus_db as $menu) {
|
||||
$menus[$menu['category']][] = array('name' => $menu['name'], 'link' => $menu['link'], 'blank' => $menu['blank'], 'color' => $menu['color'], 'ordering' => $menu['ordering']);
|
||||
}
|
||||
$menus = array();
|
||||
$menus_db = $db->query('SELECT `name`, `link`, `blank`, `color`, `category`, `ordering` FROM `' . TABLE_PREFIX . 'menu` WHERE `enabled` = 1 AND `template` = ' . $db->quote($template) . ' ORDER BY `ordering` ASC;')->fetchAll();
|
||||
foreach ($menus_db as $menu) {
|
||||
$menus[$menu['category']][] = array('name' => $menu['name'], 'link' => $menu['link'], 'blank' => $menu['blank'], 'color' => $menu['color'], 'ordering' => $menu['ordering']);
|
||||
}
|
||||
|
||||
$last_id = array();
|
||||
echo '<form method="post" id="menus-form" action="?p=menus">';
|
||||
echo '<input type="hidden" name="template" value="' . $template . '"/>';
|
||||
foreach($config['menu_categories'] as $id => $cat) {
|
||||
echo ' <div class="col-md-12 col-lg-6">
|
||||
$last_id = array();
|
||||
echo '<form method="post" id="menus-form" action="?p=menus">';
|
||||
echo '<input type="hidden" name="template" value="' . $template . '"/>';
|
||||
foreach ($config['menu_categories'] as $id => $cat) {
|
||||
echo ' <div class="col-md-12 col-lg-6">
|
||||
<div class="box box-danger">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">'. $cat['name'] . ' <img class="add-button" id="add-button-' . $id . '" src="' . BASE_URL . 'images/plus.png" width="16" height="16"/></h3>
|
||||
<h3 class="box-title">' . $cat['name'] . ' <img class="add-button" id="add-button-' . $id . '" src="' . BASE_URL . 'images/plus.png" width="16" height="16"/></h3>
|
||||
</div>
|
||||
<div class="box-body">';
|
||||
|
||||
|
||||
echo '<ul class="sortable" id="sortable-' . $id . '">';
|
||||
if(isset($menus[$id])) {
|
||||
$i = 0;
|
||||
foreach($menus[$id] as $menu) {
|
||||
echo '<li class="ui-state-default" id="list-' . $id . '-' . $i . '"><input type="text" name="menu[' . $id . '][]" value="' . $menu['name'] . '"/>
|
||||
echo '<ul class="sortable" id="sortable-' . $id . '">';
|
||||
if (isset($menus[$id])) {
|
||||
$i = 0;
|
||||
foreach ($menus[$id] as $menu) {
|
||||
echo '<li class="ui-state-default" id="list-' . $id . '-' . $i . '"><input type="text" name="menu[' . $id . '][]" value="' . $menu['name'] . '"/>
|
||||
<input type="text" name="menu_link[' . $id . '][]" value="' . $menu['link'] . '"/>
|
||||
<input type="hidden" name="menu_blank[' . $id . '][]" value="0" />
|
||||
<label><input class="blank-checkbox" type="checkbox" ' . ($menu['blank'] == 1 ? 'checked' : '') . '/><span title="Open in New Window">Blank</span></label>
|
||||
@ -96,41 +93,40 @@ if(isset($_REQUEST['template'])) {
|
||||
|
||||
<a class="remove-button" id="remove-button-' . $id . '-' . $i . '"><img src="' . BASE_URL . 'images/del.png"/></a></li>';
|
||||
|
||||
$i++;
|
||||
$last_id[$id] = $i;
|
||||
}
|
||||
}
|
||||
$i++;
|
||||
$last_id[$id] = $i;
|
||||
}
|
||||
}
|
||||
|
||||
echo '</ul>';
|
||||
echo ' </div>
|
||||
echo '</ul>';
|
||||
echo ' </div>
|
||||
</div>
|
||||
</div>
|
||||
';
|
||||
}
|
||||
echo ' </div><div class="row"><div class="col-md-6">';
|
||||
echo '<input type="submit" class="button" value="Update">';
|
||||
echo '<input type="button" class="button" value="Cancel" onclick="window.location = \'' . ADMIN_URL . '?p=menus&template=' . $template . '\';">';
|
||||
echo '</div></div>';
|
||||
echo '</form>';
|
||||
}
|
||||
echo ' </div><div class="row"><div class="col-md-6">';
|
||||
echo '<input type="submit" class="button" value="Update">';
|
||||
echo '<input type="button" class="button" value="Cancel" onclick="window.location = \'' . ADMIN_URL . '?p=menus&template=' . $template . '\';">';
|
||||
echo '</div></div>';
|
||||
echo '</form>';
|
||||
|
||||
$twig->display('admin.menus.js.html.twig', array(
|
||||
'menus' => $menus,
|
||||
'last_id' => $last_id
|
||||
));
|
||||
?>
|
||||
$twig->display('admin.menus.js.html.twig', array(
|
||||
'menus' => $menus,
|
||||
'last_id' => $last_id
|
||||
));
|
||||
?>
|
||||
|
||||
<?php
|
||||
}
|
||||
else {
|
||||
$templates = $db->query('SELECT `template` FROM `' . TABLE_PREFIX . 'menu` GROUP BY `template`;')->fetchAll();
|
||||
foreach($templates as $key => $value) {
|
||||
$file = TEMPLATES . $value['template'] . '/config.php';
|
||||
if(!file_exists($file)) {
|
||||
unset($templates[$key]);
|
||||
}
|
||||
}
|
||||
<?php
|
||||
} else {
|
||||
$templates = $db->query('SELECT `template` FROM `' . TABLE_PREFIX . 'menu` GROUP BY `template`;')->fetchAll();
|
||||
foreach ($templates as $key => $value) {
|
||||
$file = TEMPLATES . $value['template'] . '/config.php';
|
||||
if (!file_exists($file)) {
|
||||
unset($templates[$key]);
|
||||
}
|
||||
}
|
||||
|
||||
$twig->display('admin.menus.form.html.twig', array(
|
||||
'templates' => $templates
|
||||
));
|
||||
$twig->display('admin.menus.form.html.twig', array(
|
||||
'templates' => $templates
|
||||
));
|
||||
}
|
@ -11,19 +11,16 @@ defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Notepad';
|
||||
|
||||
$notepad_content = Notepad::get($account_logged->getId());
|
||||
if(isset($_POST['content']))
|
||||
{
|
||||
if (isset($_POST['content'])) {
|
||||
$_content = html_entity_decode(stripslashes($_POST['content']));
|
||||
if(!$notepad_content)
|
||||
if (!$notepad_content)
|
||||
Notepad::create($account_logged->getId(), $_content);
|
||||
else
|
||||
Notepad::update($account_logged->getId(), $_content);
|
||||
|
||||
echo '<div class="success" style="text-align: center;">Saved at ' . date('H:i') . '</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
if($notepad_content !== false)
|
||||
} else {
|
||||
if ($notepad_content !== false)
|
||||
$_content = $notepad_content;
|
||||
}
|
||||
|
||||
@ -35,7 +32,7 @@ class Notepad
|
||||
{
|
||||
global $db;
|
||||
$query = $db->select(TABLE_PREFIX . 'notepad', array('account_id' => $account_id));
|
||||
if($query !== false)
|
||||
if ($query !== false)
|
||||
return $query['content'];
|
||||
|
||||
return false;
|
||||
|
@ -10,8 +10,7 @@
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Pages';
|
||||
|
||||
if(!hasFlag(FLAG_CONTENT_PAGES) && !superAdmin())
|
||||
{
|
||||
if (!hasFlag(FLAG_CONTENT_PAGES) && !superAdmin()) {
|
||||
echo 'Access denied.';
|
||||
return;
|
||||
}
|
||||
@ -24,66 +23,59 @@ $groups = new OTS_Groups_List();
|
||||
$php = false;
|
||||
$access = 0;
|
||||
|
||||
if(!empty($action))
|
||||
{
|
||||
if($action == 'delete' || $action == 'edit' || $action == 'hide')
|
||||
if (!empty($action)) {
|
||||
if ($action == 'delete' || $action == 'edit' || $action == 'hide')
|
||||
$id = $_REQUEST['id'];
|
||||
|
||||
if(isset($_REQUEST['name']))
|
||||
if (isset($_REQUEST['name']))
|
||||
$name = $_REQUEST['name'];
|
||||
|
||||
if(isset($_REQUEST['title']))
|
||||
if (isset($_REQUEST['title']))
|
||||
$p_title = $_REQUEST['title'];
|
||||
|
||||
$php = isset($_REQUEST['php']) && $_REQUEST['php'] == 1;
|
||||
if($php)
|
||||
if ($php)
|
||||
$body = $_REQUEST['body'];
|
||||
else if(isset($_REQUEST['body'])) {
|
||||
else if (isset($_REQUEST['body'])) {
|
||||
//$body = $_REQUEST['body'];
|
||||
$body = html_entity_decode(stripslashes($_REQUEST['body']));
|
||||
}
|
||||
|
||||
if(isset($_REQUEST['access']))
|
||||
if (isset($_REQUEST['access']))
|
||||
$access = $_REQUEST['access'];
|
||||
|
||||
$errors = array();
|
||||
$player_id = 1;
|
||||
|
||||
if($action == 'add') {
|
||||
if(Pages::add($name, $p_title, $body, $player_id, $php, $access, $errors))
|
||||
{
|
||||
if ($action == 'add') {
|
||||
if (Pages::add($name, $p_title, $body, $player_id, $php, $access, $errors)) {
|
||||
$name = $p_title = $body = '';
|
||||
$player_id = $access = 0;
|
||||
$php = false;
|
||||
}
|
||||
}
|
||||
else if($action == 'delete') {
|
||||
if(Pages::delete($id, $errors))
|
||||
} else if ($action == 'delete') {
|
||||
if (Pages::delete($id, $errors))
|
||||
success('Page with id ' . $id . ' has been deleted');
|
||||
}
|
||||
else if($action == 'edit')
|
||||
{
|
||||
if(isset($id) && !isset($_REQUEST['name'])) {
|
||||
} else if ($action == 'edit') {
|
||||
if (isset($id) && !isset($_REQUEST['name'])) {
|
||||
$_page = Pages::get($id);
|
||||
$name = $_page['name'];
|
||||
$p_title = $_page['title'];
|
||||
$body = $_page['body'];
|
||||
$php = $_page['php'] == '1';
|
||||
$access = $_page['access'];
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
Pages::update($id, $name, $p_title, $body, $player_id, $php, $access);
|
||||
$action = $name = $p_title = $body = '';
|
||||
$player_id = 1;
|
||||
$access = 0;
|
||||
$php = false;
|
||||
}
|
||||
}
|
||||
else if($action == 'hide') {
|
||||
} else if ($action == 'hide') {
|
||||
Pages::toggleHidden($id, $errors);
|
||||
}
|
||||
|
||||
if(!empty($errors))
|
||||
if (!empty($errors))
|
||||
$twig->display('admin.error.html.twig', array('errors' => $errors));
|
||||
}
|
||||
|
||||
@ -91,7 +83,7 @@ $query =
|
||||
$db->query('SELECT * FROM ' . $db->tableName(TABLE_PREFIX . 'pages'));
|
||||
|
||||
$pages = array();
|
||||
foreach($query as $_page) {
|
||||
foreach ($query as $_page) {
|
||||
$pages[] = array(
|
||||
'link' => getFullLink($_page['name'], $_page['name'], true),
|
||||
'title' => substr($_page['title'], 0, 20),
|
||||
@ -121,7 +113,7 @@ class Pages
|
||||
{
|
||||
global $db;
|
||||
$query = $db->select(TABLE_PREFIX . 'pages', array('id' => $id));
|
||||
if($query !== false)
|
||||
if ($query !== false)
|
||||
return $query;
|
||||
|
||||
return false;
|
||||
@ -130,21 +122,20 @@ class Pages
|
||||
static public function add($name, $title, $body, $player_id, $php, $access, &$errors)
|
||||
{
|
||||
global $db;
|
||||
if(isset($name[0]) && isset($title[0]) && isset($body[0]) && $player_id != 0)
|
||||
{
|
||||
if (isset($name[0]) && isset($title[0]) && isset($body[0]) && $player_id != 0) {
|
||||
$query = $db->select(TABLE_PREFIX . 'pages', array('name' => $name));
|
||||
if($query === false)
|
||||
if ($query === false)
|
||||
$db->insert(TABLE_PREFIX . 'pages', array('name' => $name, 'title' => $title, 'body' => $body, 'player_id' => $player_id, 'php' => $php ? '1' : '0', 'access' => $access));
|
||||
else
|
||||
$errors[] = 'Page with this link already exists.';
|
||||
}
|
||||
else
|
||||
} else
|
||||
$errors[] = 'Please fill all inputs.';
|
||||
|
||||
return !count($errors);
|
||||
}
|
||||
|
||||
static public function update($id, $name, $title, $body, $player_id, $php, $access) {
|
||||
static public function update($id, $name, $title, $body, $player_id, $php, $access)
|
||||
{
|
||||
global $db;
|
||||
$db->update(TABLE_PREFIX . 'pages', array('name' => $name, 'title' => $title, 'body' => $body, 'player_id' => $player_id, 'php' => $php ? '1' : '0', 'access' => $access), array('id' => $id));
|
||||
}
|
||||
@ -152,14 +143,12 @@ class Pages
|
||||
static public function delete($id, &$errors)
|
||||
{
|
||||
global $db;
|
||||
if(isset($id))
|
||||
{
|
||||
if($db->select(TABLE_PREFIX . 'pages', array('id' => $id)) !== false)
|
||||
if (isset($id)) {
|
||||
if ($db->select(TABLE_PREFIX . 'pages', array('id' => $id)) !== false)
|
||||
$db->delete(TABLE_PREFIX . 'pages', array('id' => $id));
|
||||
else
|
||||
$errors[] = 'Page with id ' . $id . ' does not exists.';
|
||||
}
|
||||
else
|
||||
} else
|
||||
$errors[] = 'id not set';
|
||||
|
||||
return !count($errors);
|
||||
@ -168,18 +157,17 @@ class Pages
|
||||
static public function toggleHidden($id, &$errors)
|
||||
{
|
||||
global $db;
|
||||
if(isset($id))
|
||||
{
|
||||
if (isset($id)) {
|
||||
$query = $db->select(TABLE_PREFIX . 'pages', array('id' => $id));
|
||||
if($query !== false)
|
||||
if ($query !== false)
|
||||
$db->update(TABLE_PREFIX . 'pages', array('hidden' => ($query['hidden'] == 1 ? 0 : 1)), array('id' => $id));
|
||||
else
|
||||
$errors[] = 'Page with id ' . $id . ' does not exists.';
|
||||
}
|
||||
else
|
||||
} else
|
||||
$errors[] = 'id not set';
|
||||
|
||||
return !count($errors);
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
@ -10,10 +10,10 @@
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'PHP Info';
|
||||
|
||||
if(!function_exists('phpinfo')) { ?>
|
||||
<b>phpinfo()</b> function is disabled in your webserver config.<br/>
|
||||
You can enable it by editing <b>php.ini</b> file.
|
||||
<?php return;
|
||||
if (!function_exists('phpinfo')) { ?>
|
||||
<b>phpinfo()</b> function is disabled in your webserver config.<br/>
|
||||
You can enable it by editing <b>php.ini</b> file.
|
||||
<?php return;
|
||||
}
|
||||
?>
|
||||
<iframe src="<?php echo BASE_URL; ?>admin/tools/phpinfo.php" width="1024" height="550" />
|
||||
<iframe src="<?php echo BASE_URL; ?>admin/tools/phpinfo.php" width="1024" height="550"/>
|
||||
|
File diff suppressed because it is too large
Load Diff
@ -14,18 +14,15 @@ require LIBS . 'plugins.php';
|
||||
|
||||
$twig->display('admin.plugins.form.html.twig');
|
||||
|
||||
if(isset($_REQUEST['uninstall'])){
|
||||
if (isset($_REQUEST['uninstall'])) {
|
||||
$uninstall = $_REQUEST['uninstall'];
|
||||
|
||||
if(Plugins::uninstall($uninstall)) {
|
||||
if (Plugins::uninstall($uninstall)) {
|
||||
success('Successfully uninstalled plugin ' . $uninstall);
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
error('Error while uninstalling plugin ' . $uninstall . ': ' . Plugins::getError());
|
||||
}
|
||||
}
|
||||
else if(isset($_FILES["plugin"]["name"]))
|
||||
{
|
||||
} else if (isset($_FILES["plugin"]["name"])) {
|
||||
$file = $_FILES["plugin"];
|
||||
$filename = $file["name"];
|
||||
$tmp_name = $file["tmp_name"];
|
||||
@ -34,15 +31,15 @@ else if(isset($_FILES["plugin"]["name"]))
|
||||
$name = explode(".", $filename);
|
||||
$accepted_types = array('application/zip', 'application/x-zip-compressed', 'multipart/x-zip', 'application/x-compressed', 'application/octet-stream', 'application/zip-compressed');
|
||||
|
||||
if(isset($file['error'])) {
|
||||
if (isset($file['error'])) {
|
||||
$error = 'Error uploading file';
|
||||
switch($file['error']) {
|
||||
switch ($file['error']) {
|
||||
case UPLOAD_ERR_OK:
|
||||
$error = false;
|
||||
break;
|
||||
case UPLOAD_ERR_INI_SIZE:
|
||||
case UPLOAD_ERR_FORM_SIZE:
|
||||
$error .= ' - file too large (limit of '.ini_get('upload_max_filesize').' bytes).';
|
||||
$error .= ' - file too large (limit of ' . ini_get('upload_max_filesize') . ' bytes).';
|
||||
break;
|
||||
case UPLOAD_ERR_PARTIAL:
|
||||
$error .= ' - file upload was not completed.';
|
||||
@ -56,56 +53,49 @@ else if(isset($_FILES["plugin"]["name"]))
|
||||
}
|
||||
}
|
||||
|
||||
if(isset($error) && $error != false) {
|
||||
if (isset($error) && $error != false) {
|
||||
error($error);
|
||||
}
|
||||
else {
|
||||
if(is_uploaded_file($file['tmp_name']) ) {
|
||||
} else {
|
||||
if (is_uploaded_file($file['tmp_name'])) {
|
||||
$filetype = strtolower(pathinfo($filename, PATHINFO_EXTENSION));
|
||||
if($filetype == 'zip') // check if it is zipped/compressed file
|
||||
if ($filetype == 'zip') // check if it is zipped/compressed file
|
||||
{
|
||||
$tmp_filename = pathinfo($filename, PATHINFO_FILENAME);
|
||||
$targetzip = BASE . 'plugins/' . $tmp_filename . '.zip';
|
||||
|
||||
if(move_uploaded_file($tmp_name, $targetzip)) { // move uploaded file
|
||||
if(Plugins::install($targetzip)) {
|
||||
foreach(Plugins::getWarnings() as $warning) {
|
||||
if (move_uploaded_file($tmp_name, $targetzip)) { // move uploaded file
|
||||
if (Plugins::install($targetzip)) {
|
||||
foreach (Plugins::getWarnings() as $warning) {
|
||||
warning($warning);
|
||||
}
|
||||
|
||||
$info = Plugins::getPlugin();
|
||||
success((isset($info['name']) ? '<strong>' . $info['name'] . '</strong> p' : 'P') . 'lugin has been successfully installed.');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$error = Plugins::getError();
|
||||
error(!empty($error) ? $error : 'Unexpected error happened while installing plugin. Please try again later.');
|
||||
}
|
||||
|
||||
unlink($targetzip); // delete the Zipped file
|
||||
}
|
||||
else
|
||||
} else
|
||||
error('There was a problem with the upload. Please try again.');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
error('The file you are trying to upload is not a .zip file. Please try again.');
|
||||
}
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
error('Error uploading file - unknown error.');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$plugins = array();
|
||||
foreach(get_plugins() as $plugin)
|
||||
{
|
||||
foreach (get_plugins() as $plugin) {
|
||||
$string = file_get_contents(BASE . 'plugins/' . $plugin . '.json');
|
||||
$string = Plugins::removeComments($string);
|
||||
$plugin_info = json_decode($string, true);
|
||||
if($plugin_info == false) {
|
||||
if ($plugin_info == false) {
|
||||
warning('Cannot load plugin info ' . $plugin . '.json');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
$plugins[] = array(
|
||||
'name' => isset($plugin_info['name']) ? $plugin_info['name'] : '',
|
||||
'description' => isset($plugin_info['description']) ? $plugin_info['description'] : '',
|
||||
|
@ -11,19 +11,17 @@ defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Tools';
|
||||
|
||||
$tool = $_GET['tool'];
|
||||
if(!isset($tool))
|
||||
{
|
||||
if (!isset($tool)) {
|
||||
echo 'Tool not set.';
|
||||
return;
|
||||
}
|
||||
|
||||
if(preg_match("/[^A-z0-9_\-]/", $tool))
|
||||
{
|
||||
if (preg_match("/[^A-z0-9_\-]/", $tool)) {
|
||||
echo 'Invalid tool.';
|
||||
return;
|
||||
}
|
||||
|
||||
$file = BASE . 'admin/pages/tools/' . $tool . '.php';
|
||||
if(!@file_exists($file))
|
||||
if (!@file_exists($file))
|
||||
require $file;
|
||||
?>
|
||||
|
@ -14,7 +14,7 @@ $title = 'Version check';
|
||||
//$file = @fopen('http://my-aac.org/VERSION', 'r') or die('Error while fetching version.');
|
||||
//$myaac_version = fgets($file);
|
||||
$myaac_version = @file_get_contents('http://my-aac.org/VERSION');
|
||||
if(!$myaac_version) {
|
||||
if (!$myaac_version) {
|
||||
warning('Error while fetching version info from http://my-aac.org<br/>
|
||||
Please try again later.');
|
||||
return;
|
||||
@ -22,15 +22,13 @@ if(!$myaac_version) {
|
||||
|
||||
// compare them
|
||||
$version_compare = version_compare($myaac_version, MYAAC_VERSION);
|
||||
if($version_compare == 0) {
|
||||
if ($version_compare == 0) {
|
||||
success('MyAAC latest version is ' . $myaac_version . '. You\'re using the latest version.
|
||||
<br/>View CHANGELOG ' . generateLink(ADMIN_URL . '?p=changelog', 'here'));
|
||||
}
|
||||
else if($version_compare < 0) {
|
||||
} else if ($version_compare < 0) {
|
||||
echo success('Woah, seems you\'re using newer version as latest released one! MyAAC latest released version is ' . $myaac_version . ', and you\'re using version ' . MYAAC_VERSION . '.
|
||||
<br/>View CHANGELOG ' . generateLink(ADMIN_URL . '?p=changelog', 'here'));
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
warning('You\'re using outdated version.<br/>
|
||||
Your version: <b>' . MYAAC_VERSION . '</b><br/>
|
||||
Latest version: <b>' . $myaac_version . '</b><br/>
|
||||
|
@ -10,18 +10,19 @@
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Visitors';
|
||||
|
||||
if(!$config['visitors_counter']): ?>
|
||||
Visitors counter is disabled.<br/>
|
||||
You can enable it by editing this configurable in <b>config.local.php</b> file:<br/>
|
||||
<p style="margin-left: 3em;"><b>$config['visitors_counter'] = true;</b></p>
|
||||
<?php
|
||||
return;
|
||||
if (!$config['visitors_counter']): ?>
|
||||
Visitors counter is disabled.<br/>
|
||||
You can enable it by editing this configurable in <b>config.local.php</b> file:<br/>
|
||||
<p style="margin-left: 3em;"><b>$config['visitors_counter'] = true;</b></p>
|
||||
<?php
|
||||
return;
|
||||
endif;
|
||||
|
||||
require SYSTEM . 'libs/visitors.php';
|
||||
$visitors = new Visitors($config['visitors_counter_ttl']);
|
||||
|
||||
function compare($a, $b) {
|
||||
function compare($a, $b)
|
||||
{
|
||||
return $a['lastvisit'] > $b['lastvisit'] ? -1 : 1;
|
||||
}
|
||||
|
||||
|
@ -14,229 +14,161 @@ $title = "Creatures";
|
||||
?>
|
||||
<script type="text/javascript" src="tools/js/tipped.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="tools/css/tipped.css"/>
|
||||
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/jquery.dataTables.min.css">
|
||||
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
$(document).ready(function () {
|
||||
Tipped.create('.tooltip');
|
||||
});
|
||||
</script>
|
||||
|
||||
<?php
|
||||
$canEdit = hasFlag(FLAG_CONTENT_MONSTERS) || admin();
|
||||
if(isset($_POST['reload_monsters']) && $canEdit)
|
||||
{
|
||||
if (isset($_POST['reload_monsters']) && $canEdit) {
|
||||
require LIBS . 'creatures.php';
|
||||
if(Creatures::loadFromXML(true)) {
|
||||
if (Creatures::loadFromXML(true)) {
|
||||
if (Creatures::getMonstersList()->hasErrors())
|
||||
error('There were some problems loading your monsters.xml file. Please check system/logs/error.log for more info.');
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
error(Creatures::getLastError());
|
||||
}
|
||||
}
|
||||
|
||||
if($canEdit)
|
||||
{
|
||||
?>
|
||||
if ($canEdit) {
|
||||
?>
|
||||
<form method="post" action="<?php echo getLink('creatures'); ?>">
|
||||
<input type="hidden" name="reload_monsters" value="yes"/>
|
||||
<input type="submit" value="(admin) Reload monsters"/>
|
||||
</form>
|
||||
<?php
|
||||
<?php
|
||||
}
|
||||
|
||||
if(empty($_REQUEST['creature']))
|
||||
{
|
||||
$allowed_order_by = array('name', 'exp', 'health', 'summonable', 'convinceable', 'race');
|
||||
$order = isset($_REQUEST['order']) ? $_REQUEST['order'] : 'name';
|
||||
//generate sql query
|
||||
$desc = '';
|
||||
if(isset($_REQUEST['desc']) && $_REQUEST['desc'] == 1) {
|
||||
$desc = " DESC";
|
||||
}
|
||||
if($order == 'name') {
|
||||
$whereandorder = ' ORDER BY name'.$desc;
|
||||
}
|
||||
elseif($order == 'exp') {
|
||||
$whereandorder = ' ORDER BY exp'.$desc.', name';
|
||||
}
|
||||
elseif($order == 'health') {
|
||||
$whereandorder = ' ORDER BY health'.$desc.', name';
|
||||
}
|
||||
elseif($order == 'summonable') {
|
||||
$whereandorder = ' AND summonable = 1 ORDER BY mana'.$desc;
|
||||
}
|
||||
elseif($order == 'convinceable') {
|
||||
$whereandorder = ' AND convinceable = 1 ORDER BY mana'.$desc;
|
||||
}
|
||||
elseif($order == 'race') {
|
||||
$whereandorder = ' ORDER BY race'.$desc.', name';
|
||||
}
|
||||
else {
|
||||
$whereandorder = ' ORDER BY name';
|
||||
}
|
||||
if (empty($_REQUEST['creature'])) {
|
||||
//send query to database
|
||||
$monsters = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'monsters` WHERE `hidden` != 1'.$whereandorder);
|
||||
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><TR BGCOLOR='.$config['vdarkborder'].'>';
|
||||
if($order == 'name' && !isset($_REQUEST['desc'])) {
|
||||
echo '<TD class="white" width="200"><B><a href="?subtopic=creatures&order=name&desc=1"><span class="white">Name DESC</span></a></B></TD>';
|
||||
} else {
|
||||
echo '<TD class="white" width="200"><B><a href="?subtopic=creatures&order=name"><span class="white">Name</span></a></B></TD>';
|
||||
}
|
||||
if($order == 'health' && !isset($_REQUEST['desc'])) {
|
||||
echo '<TD class="white"><B><a href="?subtopic=creatures&order=health&desc=1"><span class="white">Health<br/>DESC</span></a></B></TD>';
|
||||
} else {
|
||||
echo '<TD class="white"><B><a href="?subtopic=creatures&order=health"><span class="white">Health</span></a></B></TD>';
|
||||
}
|
||||
if($order == 'exp' && !isset($_REQUEST['desc'])) {
|
||||
echo '<TD class="white"><B><a href="?subtopic=creatures&order=exp&desc=1"><span class="white">Experience<br/>DESC</span></a></B></TD>';
|
||||
} else {
|
||||
echo '<TD class="white"><B><a href="?subtopic=creatures&order=exp"><span class="white">Experience</span></a></B></TD>';
|
||||
}
|
||||
if($order == 'summonable' && !isset($_REQUEST['desc'])) {
|
||||
echo '<TD class="white"><B><a href="?subtopic=creatures&order=summonable&desc=1"><span class="white">Summonable<br/>Mana DESC</span></a></B></TD>';
|
||||
} else {
|
||||
echo '<TD class="white"><B><a href="?subtopic=creatures&order=summonable"><span class="white">Summonable<br/>Mana</span></a></B></TD>';
|
||||
}
|
||||
if($order == 'convinceable' && !isset($_REQUEST['desc'])) {
|
||||
echo '<TD class="white"><B><a href="?subtopic=creatures&order=convinceable&desc=1"><span class="white">Convinceable<br/>Mana DESC</span></a></B></TD>';
|
||||
} else {
|
||||
echo '<TD class="white"><B><a href="?subtopic=creatures&order=convinceable"><span class="white">Convinceable<br/>Mana</span></a></B></TD>';
|
||||
}
|
||||
if($order == 'race' && !isset($_REQUEST['desc'])) {
|
||||
echo '<TD class="white"><B><a href="?subtopic=creatures&order=race&desc=1"><span class="white">Race<br/>DESC</span></a></B></TD></TR>';
|
||||
} else {
|
||||
echo '<TD class="white"><B><a href="?subtopic=creatures&order=race"><span class="white">Race</span></a></B></TD></TR>';
|
||||
}
|
||||
$number_of_rows = 0;
|
||||
foreach($monsters as $monster) {
|
||||
echo '<TR BGCOLOR="' . getStyle($number_of_rows++) . '"><TD><a href="?subtopic=creatures&creature='.urlencode($monster['name']).'">'.$monster['name'].'</a></TD><TD>'.$monster['health'].'</TD><TD>'.$monster['exp'].'</TD>';
|
||||
$monsters = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'monsters` WHERE `hidden` != 1 ORDER BY name asc');
|
||||
echo '<table id="creaturestb" class=""><thead>
|
||||
<tr role="row"><th>Name</th><th>Health</th><th>Experience</th>
|
||||
<th>Summonable Mana</th><th>Convinceable Mana</th><th>Race</th></tr>
|
||||
</thead><tbody>';
|
||||
|
||||
if($monster['summonable']) {
|
||||
echo '<TD>'.$monster['mana'].'</TD>';
|
||||
}
|
||||
else {
|
||||
echo '<TD>---</TD>';
|
||||
foreach ($monsters as $monster) {
|
||||
echo '<tr><td><a href="?subtopic=creatures&creature=' . urlencode($monster['name']) . '">' . $monster['name'] . '</a></td>
|
||||
<td>' . $monster['health'] . '</td>
|
||||
<td>' . $monster['exp'] . '</td>
|
||||
<td>' . ($monster['summonable'] ? $monster['mana'] : "---") . '</td>
|
||||
<td>' . ($monster['convinceable'] ? $monster['mana'] : "---") . '</td>
|
||||
<td>' . ucwords($monster['race']) . '</td></tr>';
|
||||
}
|
||||
echo '</tbody></table>';
|
||||
|
||||
if($monster['convinceable']) {
|
||||
echo '<TD>'.$monster['mana'].'</TD>';
|
||||
}
|
||||
else {
|
||||
echo '<TD>---</TD>';
|
||||
}
|
||||
} else {
|
||||
$monster_name = stripslashes(trim(ucwords($_REQUEST['creature'])));
|
||||
$monster = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'monsters` WHERE `hidden` != 1 AND `name` = ' . $db->quote($monster_name) . ';')->fetch();
|
||||
if (isset($monster['name'])) {
|
||||
$title = $monster['name'] . " - Creatures";
|
||||
|
||||
echo '<td>'.ucwords($monster['race']).'</td></tr>';
|
||||
}
|
||||
|
||||
echo '</table>';
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$monster_name = stripslashes(trim(ucwords($_REQUEST['creature'])));
|
||||
$monster = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'monsters` WHERE `hidden` != 1 AND `name` = '.$db->quote($monster_name).';')->fetch();
|
||||
if(isset($monster['name']))
|
||||
{
|
||||
$title = $monster['name'] . " - Creatures";
|
||||
|
||||
echo '<div style="text-align:center"><h2>'.$monster['name'].'</h2></div>';
|
||||
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><tr><td>
|
||||
echo '<div style="text-align:center"><h2>' . $monster['name'] . '</h2></div>';
|
||||
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><tr><td>
|
||||
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=60%>';
|
||||
$number_of_rows = 0;
|
||||
echo '<tr BGCOLOR="'.getStyle($number_of_rows).'"><td width="100"><b>Health: </b></td><td>'.$monster['health'].'</td></tr>';
|
||||
$number_of_rows++;
|
||||
echo '<tr BGCOLOR="'.getStyle($number_of_rows).'"><td width="100"><b>Experience: </b></td><td>'.$monster['exp'].'</td></tr>';
|
||||
$number_of_rows++;
|
||||
echo '<tr BGCOLOR="'.getStyle($number_of_rows).'"><td width="100"><b>Speed like: </b></td><td>'.$monster['speed_lvl'].' level';
|
||||
$number_of_rows++;
|
||||
if($monster['use_haste'])
|
||||
echo ' (Can use haste)';
|
||||
$number_of_rows = 0;
|
||||
echo '<tr BGCOLOR="' . getStyle($number_of_rows) . '"><td width="100"><b>Health: </b></td><td>' . $monster['health'] . '</td></tr>';
|
||||
$number_of_rows++;
|
||||
echo '<tr BGCOLOR="' . getStyle($number_of_rows) . '"><td width="100"><b>Experience: </b></td><td>' . $monster['exp'] . '</td></tr>';
|
||||
$number_of_rows++;
|
||||
echo '<tr BGCOLOR="' . getStyle($number_of_rows) . '"><td width="100"><b>Speed like: </b></td><td>' . $monster['speed_lvl'] . ' level';
|
||||
$number_of_rows++;
|
||||
if ($monster['use_haste'])
|
||||
echo ' (Can use haste)';
|
||||
|
||||
echo '</td></tr>';
|
||||
echo '</td></tr>';
|
||||
|
||||
$number_of_rows++;
|
||||
if($monster['summonable'] == 1)
|
||||
echo '<tr BGCOLOR="'.getStyle($number_of_rows).'"><td width="100"><b>Summon: </b></td><td>'.$monster['mana'].' mana</td></tr>';
|
||||
else {
|
||||
echo '<tr BGCOLOR="'.getStyle($number_of_rows).'"><td width="100"><b>Summon: </b></td><td>Impossible</td></tr>';
|
||||
}
|
||||
$number_of_rows++;
|
||||
if ($monster['summonable'] == 1)
|
||||
echo '<tr BGCOLOR="' . getStyle($number_of_rows) . '"><td width="100"><b>Summon: </b></td><td>' . $monster['mana'] . ' mana</td></tr>';
|
||||
else {
|
||||
echo '<tr BGCOLOR="' . getStyle($number_of_rows) . '"><td width="100"><b>Summon: </b></td><td>Impossible</td></tr>';
|
||||
}
|
||||
|
||||
$number_of_rows++;
|
||||
if($monster['convinceable'] == 1)
|
||||
echo '<tr BGCOLOR="'.getStyle($number_of_rows).'"><td width="100"><b>Convince: </b></td><td>'.$monster['mana'].' mana</td></tr>';
|
||||
else
|
||||
echo '<tr BGCOLOR="'.getStyle($number_of_rows).'"><td width="100"><b>Convince: </b></td><td>Impossible</td></tr>';
|
||||
$number_of_rows++;
|
||||
if ($monster['convinceable'] == 1)
|
||||
echo '<tr BGCOLOR="' . getStyle($number_of_rows) . '"><td width="100"><b>Convince: </b></td><td>' . $monster['mana'] . ' mana</td></tr>';
|
||||
else
|
||||
echo '<tr BGCOLOR="' . getStyle($number_of_rows) . '"><td width="100"><b>Convince: </b></td><td>Impossible</td></tr>';
|
||||
|
||||
echo '</TABLE></td><td align=left>
|
||||
echo '</TABLE></td><td align=left>
|
||||
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=40%>
|
||||
<tr><td align=left>';
|
||||
$monster['gfx_name'] = trim(strtolower($monster['name'])).".gif";
|
||||
if(!file_exists('images/monsters/'.$monster['gfx_name'])) {
|
||||
$gfx_name = str_replace(" ", "", $monster['gfx_name']);
|
||||
if(file_exists('images/monsters/' . $gfx_name))
|
||||
echo '<img src="images/monsters/'.$gfx_name.'" height="128" width="128">';
|
||||
else
|
||||
echo '<img src="images/monsters/nophoto.png" height="128" width="128">';
|
||||
}
|
||||
else
|
||||
echo '<img src="images/monsters/' . $monster['gfx_name'] . '" height="128" width="128">';
|
||||
$monster['gfx_name'] = trim(strtolower($monster['name'])) . ".gif";
|
||||
if (!file_exists('images/monsters/' . $monster['gfx_name'])) {
|
||||
$gfx_name = str_replace(" ", "", $monster['gfx_name']);
|
||||
if (file_exists('images/monsters/' . $gfx_name))
|
||||
echo '<img src="images/monsters/' . $gfx_name . '" height="128" width="128">';
|
||||
else
|
||||
echo '<img src="images/monsters/nophoto.png" height="128" width="128">';
|
||||
} else
|
||||
echo '<img src="images/monsters/' . $monster['gfx_name'] . '" height="128" width="128">';
|
||||
|
||||
echo '</td></tr>
|
||||
echo '</td></tr>
|
||||
</TABLE></td></tr><tr><td>
|
||||
<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%>';
|
||||
$immunities = json_decode($monster['immunities'], true);
|
||||
if(count($immunities) > 0)
|
||||
{
|
||||
$number_of_rows++;
|
||||
echo '<tr BGCOLOR="'.getStyle($number_of_rows).'"><td width="100"><b>Immunities: </b></td><td width="100%">'.implode(', ', $immunities).'</td></tr>';
|
||||
}
|
||||
|
||||
$voices = json_decode($monster['voices'], true);
|
||||
if(count($voices) > 0)
|
||||
{
|
||||
foreach($voices as &$voice) {
|
||||
$voice = '"' . $voice . '"';
|
||||
$immunities = json_decode($monster['immunities'], true);
|
||||
if (count($immunities) > 0) {
|
||||
$number_of_rows++;
|
||||
echo '<tr BGCOLOR="' . getStyle($number_of_rows) . '"><td width="100"><b>Immunities: </b></td><td width="100%">' . implode(', ', $immunities) . '</td></tr>';
|
||||
}
|
||||
|
||||
$number_of_rows++;
|
||||
echo '<tr BGCOLOR="'.getStyle($number_of_rows).'"><td width="100"><b>Voices: </b></td><td width="100%">'.implode(', ', $voices).'</td></tr>';
|
||||
}
|
||||
echo '</TABLE></td></tr>';
|
||||
|
||||
$loot = json_decode($monster['loot'], true);
|
||||
if($loot)
|
||||
{
|
||||
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><tr><td style="display: block;">';
|
||||
function sort_by_chance($a, $b)
|
||||
{
|
||||
if($a['chance'] == $b['chance']) {
|
||||
return 0;
|
||||
$voices = json_decode($monster['voices'], true);
|
||||
if (count($voices) > 0) {
|
||||
foreach ($voices as &$voice) {
|
||||
$voice = '"' . $voice . '"';
|
||||
}
|
||||
return ($a['chance'] > $b['chance']) ? -1 : 1;
|
||||
|
||||
$number_of_rows++;
|
||||
echo '<tr BGCOLOR="' . getStyle($number_of_rows) . '"><td width="100"><b>Voices: </b></td><td width="100%">' . implode(', ', $voices) . '</td></tr>';
|
||||
}
|
||||
echo '</TABLE></td></tr>';
|
||||
|
||||
$loot = json_decode($monster['loot'], true);
|
||||
if ($loot) {
|
||||
echo '<TABLE BORDER=0 CELLSPACING=1 CELLPADDING=4 WIDTH=100%><tr><td style="display: block;">';
|
||||
function sort_by_chance($a, $b)
|
||||
{
|
||||
if ($a['chance'] == $b['chance']) {
|
||||
return 0;
|
||||
}
|
||||
return ($a['chance'] > $b['chance']) ? -1 : 1;
|
||||
}
|
||||
|
||||
usort($loot, 'sort_by_chance');
|
||||
|
||||
$i = 0;
|
||||
foreach ($loot as $item) {
|
||||
$name = getItemNameById($item['id']);
|
||||
$tooltip = $name . '<br/>Chance: ' . round($item['chance'] / 1000, 2) . '%<br/>Max count: ' . $item['count'];
|
||||
|
||||
echo '<img src="' . $config['item_images_url'] . $item['id'] . '.gif" class="tooltip" title="' . $tooltip . '" width="32" height="32" border="0" alt=" ' . $name . '" />';
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo '</td></tr></TABLE>';
|
||||
}
|
||||
|
||||
usort($loot, 'sort_by_chance');
|
||||
|
||||
$i = 0;
|
||||
foreach($loot as $item) {
|
||||
$name = getItemNameById($item['id']);
|
||||
$tooltip = $name . '<br/>Chance: ' . round($item['chance'] / 1000, 2) . '%<br/>Max count: ' . $item['count'];
|
||||
|
||||
echo '<img src="' . $config['item_images_url'] . $item['id'] . '.gif" class="tooltip" title="' . $tooltip . '" width="32" height="32" border="0" alt=" ' .$name . '" />';
|
||||
$i++;
|
||||
}
|
||||
|
||||
echo '</td></tr></TABLE>';
|
||||
echo '</td></tr>';
|
||||
echo '</TABLE>';
|
||||
} else {
|
||||
echo "Monster with name <b>" . $monster_name . "</b> doesn't exist.";
|
||||
}
|
||||
|
||||
echo '</td></tr>';
|
||||
echo '</TABLE>';
|
||||
}
|
||||
else
|
||||
{
|
||||
echo "Monster with name <b>" . $monster_name . "</b> doesn't exist.";
|
||||
}
|
||||
|
||||
//back button
|
||||
$twig->display('creatures.back_button.html.twig');
|
||||
$twig->display('creatures.back_button.html.twig');
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
$(document).ready(function () {
|
||||
$('#creaturestb').DataTable();
|
||||
});
|
||||
|
||||
</script>
|
||||
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/jquery.min.js"></script>
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/jquery.dataTables.min.js"></script>
|
@ -41,15 +41,8 @@ else {
|
||||
}
|
||||
}
|
||||
|
||||
$order = 'words';
|
||||
if(isset($_REQUEST['order']))
|
||||
$order = $_REQUEST['order'];
|
||||
|
||||
if(!in_array($order, array('words', 'type', 'mana', 'level', 'maglevel', 'soul')))
|
||||
$order = 'level';
|
||||
|
||||
$spells = array();
|
||||
$spells_db = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'spells` WHERE `hidden` != 1 AND `type` < 3 ORDER BY ' . $order . ', level');
|
||||
$spells_db = $db->query('SELECT * FROM `' . TABLE_PREFIX . 'spells` WHERE `hidden` != 1 AND `type` < 3 ORDER BY name, level');
|
||||
|
||||
if((string)$vocation_id != 'all') {
|
||||
foreach($spells_db->fetchAll() as $spell) {
|
||||
@ -76,11 +69,23 @@ else {
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
<link rel="stylesheet" href="<?php echo BASE_URL; ?>tools/css/jquery.dataTables.min.css">
|
||||
<?php
|
||||
$twig->display('spells.html.twig', array(
|
||||
'canEdit' => $canEdit,
|
||||
'post_vocation_id' => $vocation_id,
|
||||
'post_vocation' => $vocation,
|
||||
'post_order' => $order,
|
||||
'spells' => $spells,
|
||||
));
|
||||
?>
|
||||
|
||||
<script>
|
||||
$(document).ready( function () {
|
||||
$('#spellstb').DataTable();
|
||||
} );
|
||||
|
||||
</script>
|
||||
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/jquery.min.js"></script>
|
||||
<script src="<?php echo BASE_URL; ?>tools/js/jquery.dataTables.min.js"></script>
|
@ -1,102 +1,102 @@
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="box box-warning">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Maintenance</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<form action="?p=dashboard&maintenance" method="post" class="form-horizontal">
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="status" class="col-sm-2 control-label">Website:</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" id="status" name="status">
|
||||
<option value="0"{% if not is_closed %} selected{% endif %}>Open</option>
|
||||
<option value="1"{% if is_closed %} selected{% endif %}>Closed</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="message" class="col-sm-2 control-label">Message:<br>
|
||||
<small>(only if closed)</small>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<div class="col-md-6">
|
||||
<div class="box box-warning">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Maintenance</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<form action="?p=dashboard&maintenance" method="post" class="form-horizontal">
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="status" class="col-sm-2 control-label">Website:</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" id="status" name="status">
|
||||
<option value="0"{% if not is_closed %} selected{% endif %}>Open</option>
|
||||
<option value="1"{% if is_closed %} selected{% endif %}>Closed</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="message" class="col-sm-2 control-label">Message:<br>
|
||||
<small>(only if closed)</small>
|
||||
</label>
|
||||
<div class="col-sm-10">
|
||||
<textarea name="message" cols="40" class="form-control" rows="5" maxlength="255"
|
||||
placeholder="Enter ...">{{ closed_message }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<a href="?p=dashboard&clear_cache" onclick="return confirm('Are you sure?');"><span
|
||||
class="btn btn-danger">Clear cache</span></a>
|
||||
<div class="pull-right">
|
||||
<input type="submit" class="btn btn-primary" value="Update"/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if points is iterable %}
|
||||
<div class="col-md-3">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Top 10 - Most premium points</h3>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<table class="table table-condensed">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Account {{ account_type }}</th>
|
||||
<th>Premium points</th>
|
||||
</tr>
|
||||
{% set i = 0 %}
|
||||
{% for result in points %}
|
||||
{% set i = i + 1 %}
|
||||
<tr>
|
||||
<td>{{ i }}</td>
|
||||
<td>{{ result.name }}</td>
|
||||
<td>{{ result.premium_points }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if coins is iterable %}
|
||||
<div class="col-md-3">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Top 10 - Most coins</h3>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<table class="table table-condensed">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Account {{ account_type }}</th>
|
||||
<th>Tibia coins</th>
|
||||
</tr>
|
||||
{% set i = 0 %}
|
||||
{% for result in coins %}
|
||||
{% set i = i + 1 %}
|
||||
<tr>
|
||||
<td>{{ i }}</td>
|
||||
<td>{{ result.name }}</td>
|
||||
<td>{{ result.coins }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
placeholder="Enter ...">{{ closed_message }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<a href="?p=dashboard&clear_cache" onclick="return confirm('Are you sure?');"><span
|
||||
class="btn btn-danger">Clear cache</span></a>
|
||||
<div class="pull-right">
|
||||
<input type="submit" class="btn btn-primary" value="Update"/>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% if points is iterable %}
|
||||
<div class="col-md-3">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Top 10 - Most premium points</h3>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<table class="table table-condensed">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Account {{ account_type }}</th>
|
||||
<th>Premium points</th>
|
||||
</tr>
|
||||
{% set i = 0 %}
|
||||
{% for result in points %}
|
||||
{% set i = i + 1 %}
|
||||
<tr>
|
||||
<td>{{ i }}</td>
|
||||
<td>{{ result.name }}</td>
|
||||
<td>{{ result.premium_points }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if coins is iterable %}
|
||||
<div class="col-md-3">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Top 10 - Most coins</h3>
|
||||
</div>
|
||||
<div class="box-body no-padding">
|
||||
<table class="table table-condensed">
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>#</th>
|
||||
<th>Account {{ account_type }}</th>
|
||||
<th>Tibia coins</th>
|
||||
</tr>
|
||||
{% set i = 0 %}
|
||||
{% for result in coins %}
|
||||
{% set i = i + 1 %}
|
||||
<tr>
|
||||
<td>{{ i }}</td>
|
||||
<td>{{ result.name }}</td>
|
||||
<td>{{ result.coins }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
</div>
|
@ -1,4 +1,4 @@
|
||||
<form method="post" action="{{ constant('ADMIN_URL') }}?p=items">
|
||||
<input type="hidden" name="reload" value="1" />
|
||||
<input type="submit" value="Reload items and weapons (it may take some time to finish)" />
|
||||
<input type="hidden" name="reload" value="1"/>
|
||||
<input type="submit" value="Reload items and weapons (it may take some time to finish)"/>
|
||||
</form>
|
@ -1,38 +1,38 @@
|
||||
<div class="login-box">
|
||||
{% if logout %}
|
||||
<div class="alert alert-success alert-dismissible">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<h4><i class="icon fa fa-check"></i> Status</h4>
|
||||
{{ logout }}
|
||||
</div>
|
||||
{% endif %}
|
||||
{% if logout %}
|
||||
<div class="alert alert-success alert-dismissible">
|
||||
<button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button>
|
||||
<h4><i class="icon fa fa-check"></i> Status</h4>
|
||||
{{ logout }}
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<form method="post">
|
||||
<div class="box box-info">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Please login.</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<div class="form-group input-group">
|
||||
<span class="input-group-addon"><i class="fa fa-lock"></i></span>
|
||||
<input type="password" class="form-control" id="account-name-input" name="account_login"
|
||||
placeholder="Account {{ account }}" required autofocus>
|
||||
</div>
|
||||
<div class="form-group input-group">
|
||||
<span class="input-group-addon"><i class="fa fa-key"></i></span>
|
||||
<input type="password" class="form-control" placeholder="Password" name="password_login"
|
||||
placeholder="Password" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<label>
|
||||
<input type="checkbox" id="remember_me" name="remember_me" value="true"> Remember me
|
||||
</label>
|
||||
<input type="hidden" name="admin" value="1"/>
|
||||
<button type="submit" class="btn btn-info pull-right">Sign in</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<form method="post">
|
||||
<div class="box box-info">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Please login.</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<div class="form-group input-group">
|
||||
<span class="input-group-addon"><i class="fa fa-lock"></i></span>
|
||||
<input type="password" class="form-control" id="account-name-input" name="account_login"
|
||||
placeholder="Account {{ account }}" required autofocus>
|
||||
</div>
|
||||
<div class="form-group input-group">
|
||||
<span class="input-group-addon"><i class="fa fa-key"></i></span>
|
||||
<input type="password" class="form-control" placeholder="Password" name="password_login"
|
||||
placeholder="Password" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<label>
|
||||
<input type="checkbox" id="remember_me" name="remember_me" value="true"> Remember me
|
||||
</label>
|
||||
<input type="hidden" name="admin" value="1"/>
|
||||
<button type="submit" class="btn btn-info pull-right">Sign in</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
@ -1,47 +1,47 @@
|
||||
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
tinymce.init({
|
||||
selector: "textarea",
|
||||
theme: "modern",
|
||||
plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help code emoticons',
|
||||
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
|
||||
image_advtab: true,
|
||||
relative_urls: false,
|
||||
remove_script_host: false,
|
||||
document_base_url: "{{ constant('BASE_URL') }}"
|
||||
});
|
||||
tinymce.init({
|
||||
selector: "textarea",
|
||||
theme: "modern",
|
||||
plugins: 'print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help code emoticons',
|
||||
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
|
||||
image_advtab: true,
|
||||
relative_urls: false,
|
||||
remove_script_host: false,
|
||||
document_base_url: "{{ constant('BASE_URL') }}"
|
||||
});
|
||||
</script>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-8">
|
||||
<div class="box box-danger">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Mailer</h3>
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="box-body">
|
||||
<div align="center" class="row"><p class="note note-image" style="width: 80%;">Sending mails may
|
||||
take some time if there are many users in db.</p></div>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 ">
|
||||
<label for="mail_subject" class="control-label">Subject:</label>
|
||||
<input class="form-control" type="text" id="mail_subject" name="mail_subject"
|
||||
value="{{ mail_subject }}" size="30" maxlength="30"/>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-8">
|
||||
<div class="box box-danger">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Mailer</h3>
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="box-body">
|
||||
<div align="center" class="row"><p class="note note-image" style="width: 80%;">Sending mails may
|
||||
take some time if there are many users in db.</p></div>
|
||||
<div class="form-group">
|
||||
<div class="row">
|
||||
<div class="col-xs-12 ">
|
||||
<label for="mail_subject" class="control-label">Subject:</label>
|
||||
<input class="form-control" type="text" id="mail_subject" name="mail_subject"
|
||||
value="{{ mail_subject }}" size="30" maxlength="30"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<label for="mail_content" class="control-label">Content:</label>
|
||||
<textarea id="mail_content" name="mail_content" style="width: 100%"
|
||||
class="tinymce">{{ mail_content }}</textarea>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<input type="checkbox" name="preview" id="preview" value="1"/><label for="preview">Just send test
|
||||
email to me (preview)</label>{% if preview_done %} - <b>Done.</b>{% endif %}<br/>
|
||||
<button type="submit" name="submit" value="Send" class="btn btn-primary">Send</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<label for="mail_content" class="control-label">Content:</label>
|
||||
<textarea id="mail_content" name="mail_content" style="width: 100%"
|
||||
class="tinymce">{{ mail_content }}</textarea>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<input type="checkbox" name="preview" id="preview" value="1"/><label for="preview">Just send test
|
||||
email to me (preview)</label>{% if preview_done %} - <b>Done.</b>{% endif %}<br/>
|
||||
<button type="submit" name="submit" value="Send" class="btn btn-primary">Send</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -1,28 +1,28 @@
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Templates</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<form method="post" action="?p=menus">
|
||||
<p>Please choose template in which you want to edit menu items.</p>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div class="input-group input-group-sm">
|
||||
<select id="template" name="template" class="form-control">
|
||||
{% for template in templates %}
|
||||
<option value="{{ template.template }}">{{ template.template }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<span class="input-group-btn">
|
||||
<div class="col-md-6">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Templates</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<form method="post" action="?p=menus">
|
||||
<p>Please choose template in which you want to edit menu items.</p>
|
||||
<div class="row">
|
||||
<div class="col-xs-6">
|
||||
<div class="input-group input-group-sm">
|
||||
<select id="template" name="template" class="form-control">
|
||||
{% for template in templates %}
|
||||
<option value="{{ template.template }}">{{ template.template }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<span class="input-group-btn">
|
||||
<button type="submit" type="button" class="btn btn-primary btn-flat">Edit</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -5,59 +5,66 @@
|
||||
{% for cat, menu in menus %}
|
||||
last_id[{{ cat }}] = {{ last_id[cat] }};
|
||||
{% endfor %}
|
||||
$( function() {
|
||||
$(function () {
|
||||
$(".sortable").sortable();
|
||||
$(".sortable").disableSelection();
|
||||
|
||||
$(".remove-button").click(function() {
|
||||
$(".remove-button").click(function () {
|
||||
var id = $(this).attr("id");
|
||||
$('#list-' + id.replace('remove-button-', '')).remove();
|
||||
});
|
||||
|
||||
$(".add-button").click(function() {
|
||||
$(".add-button").click(function () {
|
||||
var cat = $(this).attr("id").replace('add-button-', '');
|
||||
var id = last_id[cat];
|
||||
last_id[cat]++;
|
||||
$('#sortable-' + cat).append('<li class="ui-state-default" id="list-' + cat + '-' + id + '"><input type="text" name="menu[' + cat + '][]" value=""/> <input type="text" name="menu_link[' + cat + '][]" value=""/><input type="hidden" name="menu_blank[' + cat + '][]" value="0" /> <label><input class="blank-checkbox" type="checkbox"/><span title="Open in New Window">Blank</span></label> <input class="color-picker" type="text" name="menu_color[' + cat + '][]" value="#ffffff" /><a class="remove-button" id="remove-button-' + cat + '-' + id + '"><img src="{{ constant('BASE_URL') }}images/del.png"/></a></li>'); //add input bo
|
||||
$('#remove-button-' + cat + '-' + id).click(function() {
|
||||
$('#remove-button-' + cat + '-' + id).click(function () {
|
||||
$('#list-' + $(this).attr("id").replace('remove-button-', '')).remove();
|
||||
});
|
||||
|
||||
initialiceSpectrum();
|
||||
});
|
||||
|
||||
$("#menus-form").submit(function(e) {
|
||||
$('.blank-checkbox:not(:checked)').each(function(i, obj) {
|
||||
|
||||
$("#menus-form").submit(function (e) {
|
||||
$('.blank-checkbox:not(:checked)').each(function (i, obj) {
|
||||
$(obj).parent().prev().val("off");
|
||||
});
|
||||
|
||||
$('.blank-checkbox:checked').each(function(i, obj) {
|
||||
$('.blank-checkbox:checked').each(function (i, obj) {
|
||||
$(obj).parent().prev().val("on");
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
});
|
||||
</script>
|
||||
<style type="text/css">
|
||||
.sortable { list-style-type: none; margin: 0; padding: 0; width: 100%; }
|
||||
.sortable {
|
||||
list-style-type: none;
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.remove-button, .add-button {
|
||||
cursor: pointer;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/js/spectrum.js"></script>
|
||||
<link type="text/css" rel="stylesheet" href="{{ constant('BASE_URL') }}tools/css/spectrum.css" />
|
||||
<link type="text/css" rel="stylesheet" href="{{ constant('BASE_URL') }}tools/css/spectrum.css"/>
|
||||
<script type="text/javascript">
|
||||
initialiceSpectrum();
|
||||
function initialiceSpectrum() {
|
||||
$(".color-picker").spectrum({
|
||||
preferredFormat: "hex",
|
||||
showInput: true,
|
||||
showPalette: true,
|
||||
palette: [
|
||||
['black', 'white', 'blanchedalmond',
|
||||
'rgb(255, 128, 0);', 'hsv 100 70 50'],
|
||||
['red', 'yellow', 'green', 'blue', 'violet']
|
||||
]
|
||||
});
|
||||
}
|
||||
initialiceSpectrum();
|
||||
|
||||
function initialiceSpectrum() {
|
||||
$(".color-picker").spectrum({
|
||||
preferredFormat: "hex",
|
||||
showInput: true,
|
||||
showPalette: true,
|
||||
palette: [
|
||||
['black', 'white', 'blanchedalmond',
|
||||
'rgb(255, 128, 0);', 'hsv 100 70 50'],
|
||||
['red', 'yellow', 'green', 'blue', 'violet']
|
||||
]
|
||||
});
|
||||
}
|
||||
</script>
|
@ -1,24 +1,24 @@
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="box box-danger">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Notepad</h3>
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label>This is your personal notepad. Be sure to save it each time you modify something.</label>
|
||||
<textarea class="form-control" style="text-align: left;" name="content" cols="50" rows="15"
|
||||
onchange="notepad_onchange(this);">{% if content is not null %}{{ content }}{% endif %}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<button name="submit" onclick="notepad_save(this);" value="Save" class="btn btn-primary">Save
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="box box-danger">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Notepad</h3>
|
||||
</div>
|
||||
<form method="post">
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label>This is your personal notepad. Be sure to save it each time you modify something.</label>
|
||||
<textarea class="form-control" style="text-align: left;" name="content" cols="50" rows="15"
|
||||
onchange="notepad_onchange(this);">{% if content is not null %}{{ content }}{% endif %}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<button name="submit" onclick="notepad_save(this);" value="Save" class="btn btn-primary">Save
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{# <?php echo isset($_content) ? htmlentities($_content, ENT_COMPAT, 'UTF-8') : ''; ?> #}
|
||||
@ -26,31 +26,31 @@
|
||||
{# confirm leaving current page if content of the notepad has been modified #}
|
||||
|
||||
<script type="text/javascript">
|
||||
var original_value = document.getElementsByName("content")[0].value;
|
||||
var original_value = document.getElementsByName("content")[0].value;
|
||||
|
||||
function confirm_exit(e) {
|
||||
var e = e || window.event;
|
||||
var message = 'Are you sure you want to quit? Remaining changes will be unsaved.';
|
||||
function confirm_exit(e) {
|
||||
var e = e || window.event;
|
||||
var message = 'Are you sure you want to quit? Remaining changes will be unsaved.';
|
||||
|
||||
// for IE and Firefox prior to version 4
|
||||
if (e) {
|
||||
e.returnValue = message;
|
||||
}
|
||||
// for IE and Firefox prior to version 4
|
||||
if (e) {
|
||||
e.returnValue = message;
|
||||
}
|
||||
|
||||
// for Safari
|
||||
return message;
|
||||
}
|
||||
// for Safari
|
||||
return message;
|
||||
}
|
||||
|
||||
function notepad_onchange(e) {
|
||||
if (original_value != e.value) {
|
||||
window.onbeforeunload = confirm_exit;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
function notepad_onchange(e) {
|
||||
if (original_value != e.value) {
|
||||
window.onbeforeunload = confirm_exit;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function notepad_save(e) {
|
||||
window.onbeforeunload = function (e) {
|
||||
};
|
||||
return true;
|
||||
}
|
||||
function notepad_save(e) {
|
||||
window.onbeforeunload = function (e) {
|
||||
};
|
||||
return true;
|
||||
}
|
||||
</script>
|
@ -1,111 +1,111 @@
|
||||
{% if action %}
|
||||
<div class="row">
|
||||
<form class="form-horizontal" method="post"
|
||||
action="?p=pages&action={% if action == 'edit' %}edit{% else %}add{% endif %}">
|
||||
{% if action == 'edit' %}
|
||||
<input type="hidden" name="id" value="{{ id }}"/>
|
||||
{% endif %}
|
||||
<div class="col-md-8" id="page-edit-table">
|
||||
<div class="box box-info">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{% if action == 'edit' %}Edit{% else %}Add{% endif %} page</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-2 control-label">Link/name</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" id="name" name="name" class="form-control" autocomplete="off"
|
||||
maxlength="29"
|
||||
style="cursor: auto;" value="{{ name }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="title" class="col-sm-2 control-label">Title</label>
|
||||
<div class="row">
|
||||
<form class="form-horizontal" method="post"
|
||||
action="?p=pages&action={% if action == 'edit' %}edit{% else %}add{% endif %}">
|
||||
{% if action == 'edit' %}
|
||||
<input type="hidden" name="id" value="{{ id }}"/>
|
||||
{% endif %}
|
||||
<div class="col-md-8" id="page-edit-table">
|
||||
<div class="box box-info">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">{% if action == 'edit' %}Edit{% else %}Add{% endif %} page</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="name" class="col-sm-2 control-label">Link/name</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="text" id="name" name="name" class="form-control" autocomplete="off"
|
||||
maxlength="29"
|
||||
style="cursor: auto;" value="{{ name }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="title" class="col-sm-2 control-label">Title</label>
|
||||
|
||||
<div class="col-sm-10">
|
||||
<input type="text" id="title" name="title" class="form-control" autocomplete="off"
|
||||
maxlength="29"
|
||||
style="cursor: auto;" value="{{ title }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="php" class="col-sm-2 control-label">PHP</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="checkbox" id="php" name="php"
|
||||
title="Check if page should be executed as PHP"
|
||||
value="1"{% if php %} checked="true"{% endif %}{% if action == 'edit' %} disabled{% endif %}/>
|
||||
{% if action == 'edit' %}
|
||||
<input type="hidden" name="php" value="{% if php %}1{% else %}0{% endif %}"/>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="body" class="col-sm-2 control-label">Content</label>
|
||||
<div class="col-sm-10" id="body-parent">
|
||||
<div class="col-sm-10">
|
||||
<input type="text" id="title" name="title" class="form-control" autocomplete="off"
|
||||
maxlength="29"
|
||||
style="cursor: auto;" value="{{ title }}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="php" class="col-sm-2 control-label">PHP</label>
|
||||
<div class="col-sm-10">
|
||||
<input type="checkbox" id="php" name="php"
|
||||
title="Check if page should be executed as PHP"
|
||||
value="1"{% if php %} checked="true"{% endif %}{% if action == 'edit' %} disabled{% endif %}/>
|
||||
{% if action == 'edit' %}
|
||||
<input type="hidden" name="php" value="{% if php %}1{% else %}0{% endif %}"/>
|
||||
{% endif %}
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="body" class="col-sm-2 control-label">Content</label>
|
||||
<div class="col-sm-10" id="body-parent">
|
||||
<textarea class="form-control" id="body" name="body" maxlength="65000" cols="50"
|
||||
rows="5">{{ body|raw }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="access" class="col-sm-2 control-label">Access</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" id="access" name="access">
|
||||
{% for id, group in groups %}
|
||||
<option value="{{ group.getId() }}"{% if access == group.getId() %} selected{% endif %}>{{ group.getName() }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<td align="right"><input type="submit" class="btn btn-info pull-right" value="Save"/></td>
|
||||
<td align="left">
|
||||
<input type="button" onclick="window.location = '{{ constant('ADMIN_URL') }}?p=pages';"
|
||||
class="btn btn-default" value="Cancel"/>
|
||||
</td>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
rows="5">{{ body|raw }}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label for="access" class="col-sm-2 control-label">Access</label>
|
||||
<div class="col-sm-10">
|
||||
<select class="form-control" id="access" name="access">
|
||||
{% for id, group in groups %}
|
||||
<option value="{{ group.getId() }}"{% if access == group.getId() %} selected{% endif %}>{{ group.getName() }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<td align="right"><input type="submit" class="btn btn-info pull-right" value="Save"/></td>
|
||||
<td align="left">
|
||||
<input type="button" onclick="window.location = '{{ constant('ADMIN_URL') }}?p=pages';"
|
||||
class="btn btn-default" value="Cancel"/>
|
||||
</td>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#php').on('change', function (e) {
|
||||
if (this.checked) {
|
||||
tinymce.remove('#body');
|
||||
} else {
|
||||
if (tinymce.editors.length > 0) {
|
||||
tinymce.activeEditor.show();
|
||||
}
|
||||
else {
|
||||
init_tinymce();
|
||||
}
|
||||
}
|
||||
});
|
||||
<script type="text/javascript" src="{{ constant('BASE_URL') }}tools/tinymce/tinymce.min.js"></script>
|
||||
<script type="text/javascript">
|
||||
$(function () {
|
||||
$('#php').on('change', function (e) {
|
||||
if (this.checked) {
|
||||
tinymce.remove('#body');
|
||||
} else {
|
||||
if (tinymce.editors.length > 0) {
|
||||
tinymce.activeEditor.show();
|
||||
}
|
||||
else {
|
||||
init_tinymce();
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
{% if not php %}
|
||||
init_tinymce();
|
||||
{% endif %}
|
||||
{% if not php %}
|
||||
init_tinymce();
|
||||
{% endif %}
|
||||
|
||||
function init_tinymce() {
|
||||
tinymce.init({
|
||||
selector: "#body",
|
||||
theme: "modern",
|
||||
plugins: 'code print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help emoticons',
|
||||
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
|
||||
image_advtab: true,
|
||||
relative_urls: false,
|
||||
remove_script_host: false,
|
||||
document_base_url: "{{ constant('BASE_URL') }}"
|
||||
});
|
||||
}
|
||||
function init_tinymce() {
|
||||
tinymce.init({
|
||||
selector: "#body",
|
||||
theme: "modern",
|
||||
plugins: 'code print preview searchreplace autolink directionality visualblocks visualchars fullscreen image link media template codesample table charmap hr pagebreak nonbreaking anchor toc insertdatetime advlist lists textcolor wordcount spellchecker imagetools contextmenu colorpicker textpattern help emoticons',
|
||||
toolbar1: 'formatselect | bold italic strikethrough forecolor backcolor | emoticons link | alignleft aligncenter alignright alignjustify | numlist bullist outdent indent | removeformat code',
|
||||
image_advtab: true,
|
||||
relative_urls: false,
|
||||
remove_script_host: false,
|
||||
document_base_url: "{{ constant('BASE_URL') }}"
|
||||
});
|
||||
}
|
||||
|
||||
function decodeHtml(html) {
|
||||
var txt = document.createElement("textarea");
|
||||
txt.innerHTML = html;
|
||||
return txt.value;
|
||||
}
|
||||
});
|
||||
</script> {% endif %}
|
||||
function decodeHtml(html) {
|
||||
var txt = document.createElement("textarea");
|
||||
txt.innerHTML = html;
|
||||
return txt.value;
|
||||
}
|
||||
});
|
||||
</script> {% endif %}
|
@ -1,66 +1,69 @@
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Pages:</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a href="?p=pages&action=new"><span class="btn btn-success">New</span></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div id="tb_pages_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table id="tb_pages" class="table table-bordered table-striped dataTable" role="grid"
|
||||
aria-describedby="tb_pages_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="sorting_asc" tabindex="0" aria-controls="tb_pages" rowspan="1" colspan="1"
|
||||
aria-sort="ascending" aria-label="Name: activate to sort column descending">Name
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="tb_pages" rowspan="1" colspan="1"
|
||||
aria-sort="ascending" aria-label="Title: activate to sort column descending">Title
|
||||
</th>
|
||||
<th class="" tabindex="0" aria-controls="tb_pages" rowspan="1" colspan="1" style="width: 150px;">Options
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for page in pages %}
|
||||
<tr>
|
||||
<td>{{ page.link|raw }}</td>
|
||||
<td><i>{{ page.title }}</i></td>
|
||||
<td>
|
||||
<a href="?p=pages&action=edit&id={{ page.id }}" class="ico" title="Edit"><span
|
||||
class="btn btn-success btn-sm edit btn-flat"><i class="fa fa-edit"></i></span></a>
|
||||
<a href="?p=pages&action=delete&id={{ page.id }}" class="ico"
|
||||
onclick="return confirm('Are you sure?');" title="Delete"><span
|
||||
class="btn btn-danger btn-sm delete btn-flat"><i
|
||||
class="fa fa-trash"></i></span></a>
|
||||
<a href="?p=pages&action=hide&id={{ page.id }}" class="ico"
|
||||
title="{% if page.hidden != 1 %}Hide{% else %}Show{% endif %}">
|
||||
{% if page.hidden != 1 %}
|
||||
<span class="btn btn-primary btn-sm btn-flat"><i class="fa fa-eye"></i></span>
|
||||
{% else %}
|
||||
<span class="btn btn-default btn-sm btn-flat"><i class="fa fa-eye-slash"></i></span>
|
||||
{% endif %}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Title</th>
|
||||
<th>Options</th>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Pages:</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<a href="?p=pages&action=new"><span class="btn btn-success">New</span></a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div id="tb_pages_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table id="tb_pages" class="table table-bordered table-striped dataTable" role="grid"
|
||||
aria-describedby="tb_pages_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="sorting_asc" tabindex="0" aria-controls="tb_pages" rowspan="1" colspan="1"
|
||||
aria-sort="ascending" aria-label="Name: activate to sort column descending">Name
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="tb_pages" rowspan="1" colspan="1"
|
||||
aria-sort="ascending" aria-label="Title: activate to sort column descending">Title
|
||||
</th>
|
||||
<th class="" tabindex="0" aria-controls="tb_pages" rowspan="1" colspan="1"
|
||||
style="width: 150px;">Options
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for page in pages %}
|
||||
<tr>
|
||||
<td>{{ page.link|raw }}</td>
|
||||
<td><i>{{ page.title }}</i></td>
|
||||
<td>
|
||||
<a href="?p=pages&action=edit&id={{ page.id }}" class="ico" title="Edit"><span
|
||||
class="btn btn-success btn-sm edit btn-flat"><i class="fa fa-edit"></i></span></a>
|
||||
<a href="?p=pages&action=delete&id={{ page.id }}" class="ico"
|
||||
onclick="return confirm('Are you sure?');" title="Delete"><span
|
||||
class="btn btn-danger btn-sm delete btn-flat"><i
|
||||
class="fa fa-trash"></i></span></a>
|
||||
<a href="?p=pages&action=hide&id={{ page.id }}" class="ico"
|
||||
title="{% if page.hidden != 1 %}Hide{% else %}Show{% endif %}">
|
||||
{% if page.hidden != 1 %}
|
||||
<span class="btn btn-primary btn-sm btn-flat"><i
|
||||
class="fa fa-eye"></i></span>
|
||||
{% else %}
|
||||
<span class="btn btn-default btn-sm btn-flat"><i
|
||||
class="fa fa-eye-slash"></i></span>
|
||||
{% endif %}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Title</th>
|
||||
<th>Options</th>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
$('#tb_pages').DataTable()
|
||||
})
|
||||
$(function () {
|
||||
$('#tb_pages').DataTable()
|
||||
})
|
||||
</script>
|
@ -2,10 +2,12 @@
|
||||
<a href="admin/?p=pages&action=edit&id={{ page.id }}" title="Edit in Admin Panel" target="_blank">
|
||||
<img src="images/edit.png"/>Edit
|
||||
</a>
|
||||
<a id="delete" href="admin/?p=pages&action=delete&id={{ page.id }}" onclick="return confirm('Are you sure?');" title="Delete in Admin Panel" target="_blank">
|
||||
<a id="delete" href="admin/?p=pages&action=delete&id={{ page.id }}" onclick="return confirm('Are you sure?');"
|
||||
title="Delete in Admin Panel" target="_blank">
|
||||
<img src="images/del.png"/>Delete
|
||||
</a>
|
||||
<a href="admin/?p=pages&action=hide&id={{ page.id }}" title="{% if page.hidden != 1 %}Hide{% else %}Show{% endif %} in Admin Panel" target="_blank">
|
||||
<a href="admin/?p=pages&action=hide&id={{ page.id }}"
|
||||
title="{% if page.hidden != 1 %}Hide{% else %}Show{% endif %} in Admin Panel" target="_blank">
|
||||
<img src="images/{% if page.hidden != 1 %}success{% else %}error{% endif %}.png"/>{% if page.hidden != 1 %}Hide{% else %}Show{% endif %}
|
||||
</a>
|
||||
<br/>
|
||||
|
@ -1,27 +1,27 @@
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Install plugin:</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<form enctype="multipart/form-data" method="post" action="{{ constant('ADMIN_URL') }}?p=plugins">
|
||||
<input type="hidden" name="upload_plugin"/>
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="exampleInputFile">File input</label>
|
||||
<input type="file" name="plugin">
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<button type="submit" class="btn btn-primary">Upload</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3">
|
||||
<div class="box box-primary">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Install plugin:</h3>
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn btn-box-tool" data-widget="collapse"><i class="fa fa-minus"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<form enctype="multipart/form-data" method="post" action="{{ constant('ADMIN_URL') }}?p=plugins">
|
||||
<input type="hidden" name="upload_plugin"/>
|
||||
<div class="box-body">
|
||||
<div class="form-group">
|
||||
<label for="exampleInputFile">File input</label>
|
||||
<input type="file" name="plugin">
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-footer">
|
||||
<button type="submit" class="btn btn-primary">Upload</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -1,67 +1,67 @@
|
||||
<div class="row">
|
||||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Installed plugins:</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div id="plugins_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table id="plugins" class="table table-bordered table-striped dataTable" role="grid"
|
||||
aria-describedby="plugins_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="sorting_asc" tabindex="0" aria-controls="plugins" rowspan="1"
|
||||
colspan="1" aria-sort="ascending"
|
||||
aria-label="Name: activate to sort column descending">Name
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
|
||||
aria-label="Description: activate to sort column ascending">Description
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
|
||||
aria-label="Author: activate to sort column ascending">Author
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
|
||||
aria-label="Filename: activate to sort column ascending">Filename
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
|
||||
aria-label="Options: activate to sort column ascending"
|
||||
style="width: 55px;">Options
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for plugin in plugins %}
|
||||
<tr>
|
||||
<td><b>{{ plugin.name }}</b><br>
|
||||
<small>{{ plugin.description }}</small>
|
||||
</td>
|
||||
<td>{{ plugin.version }}</td>
|
||||
<td><b>{{ plugin.author }}</b><br>
|
||||
<small>{{ plugin.contact }}</small>
|
||||
</td>
|
||||
<td>{{ plugin.file }}.json</td>
|
||||
<td>
|
||||
{% if plugin.uninstall %}
|
||||
<a href="?p=plugins&uninstall={{ plugin.file }}" title="Uninstall"
|
||||
onclick="return confirm('Are you sure?');"><span
|
||||
class="btn btn-danger btn-sm delete btn-flat"><i
|
||||
class="fa fa-trash"></i></span></a>
|
||||
{% endif %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-xs-12">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Installed plugins:</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div id="plugins_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table id="plugins" class="table table-bordered table-striped dataTable" role="grid"
|
||||
aria-describedby="plugins_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="sorting_asc" tabindex="0" aria-controls="plugins" rowspan="1"
|
||||
colspan="1" aria-sort="ascending"
|
||||
aria-label="Name: activate to sort column descending">Name
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
|
||||
aria-label="Description: activate to sort column ascending">Description
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
|
||||
aria-label="Author: activate to sort column ascending">Author
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
|
||||
aria-label="Filename: activate to sort column ascending">Filename
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="plugins" rowspan="1" colspan="1"
|
||||
aria-label="Options: activate to sort column ascending"
|
||||
style="width: 55px;">Options
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for plugin in plugins %}
|
||||
<tr>
|
||||
<td><b>{{ plugin.name }}</b><br>
|
||||
<small>{{ plugin.description }}</small>
|
||||
</td>
|
||||
<td>{{ plugin.version }}</td>
|
||||
<td><b>{{ plugin.author }}</b><br>
|
||||
<small>{{ plugin.contact }}</small>
|
||||
</td>
|
||||
<td>{{ plugin.file }}.json</td>
|
||||
<td>
|
||||
{% if plugin.uninstall %}
|
||||
<a href="?p=plugins&uninstall={{ plugin.file }}" title="Uninstall"
|
||||
onclick="return confirm('Are you sure?');"><span
|
||||
class="btn btn-danger btn-sm delete btn-flat"><i
|
||||
class="fa fa-trash"></i></span></a>
|
||||
{% endif %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
$('#plugins').DataTable()
|
||||
})
|
||||
$(function () {
|
||||
$('#plugins').DataTable()
|
||||
})
|
||||
</script>
|
@ -1,39 +1,39 @@
|
||||
<div class="row">
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-aqua"><i class="ion ion-person-add"></i></span>
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">Total accounts:</span>
|
||||
<span class="info-box-number">{{ total_accounts }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-red"><i class="fa fa-male"></i></span>
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">Total players:</span>
|
||||
<span class="info-box-number">{{ total_players }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix visible-sm-block"></div>
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-green"><i class="ion ion-pie-graph"></i></span>
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">Total guilds:</span>
|
||||
<span class="info-box-number">{{ total_guilds }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-yellow"><i class="fa fa-home"></i></span>
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">Total houses:</span>
|
||||
<span class="info-box-number">{{ total_houses }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-aqua"><i class="ion ion-person-add"></i></span>
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">Total accounts:</span>
|
||||
<span class="info-box-number">{{ total_accounts }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-red"><i class="fa fa-male"></i></span>
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">Total players:</span>
|
||||
<span class="info-box-number">{{ total_players }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="clearfix visible-sm-block"></div>
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-green"><i class="ion ion-pie-graph"></i></span>
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">Total guilds:</span>
|
||||
<span class="info-box-number">{{ total_guilds }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-3 col-sm-6 col-xs-12">
|
||||
<div class="info-box">
|
||||
<span class="info-box-icon bg-yellow"><i class="fa fa-home"></i></span>
|
||||
<div class="info-box-content">
|
||||
<span class="info-box-text">Total houses:</span>
|
||||
<span class="info-box-number">{{ total_houses }}</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@ -1,56 +1,56 @@
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Users active within last {{ config_visitors_counter_ttl }} minutes.</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div id="visitors_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table id="visitors" class="table table-bordered table-striped dataTable" role="grid"
|
||||
aria-describedby="visitors_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="sorting_asc" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
|
||||
aria-sort="ascending" aria-label="IP: activate to sort column descending"
|
||||
style="width: 297px;">IP
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
|
||||
aria-label="Last visit: activate to sort column ascending" style="width: 361px;">Last
|
||||
visit
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
|
||||
aria-label="Page: activate to sort column ascending" style="width: 322px;">Page
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% set i = 0 %}
|
||||
{% for visitor in visitors %}
|
||||
{% set i = i + 1 %}
|
||||
<tr role="row" class="odd">
|
||||
<td>{{ visitor.ip }}</td>
|
||||
<td>{{ visitor.lastvisit|date("H:i:s") }}</td>
|
||||
<td>
|
||||
<a href="{{ visitor.page }}">{{ visitor.page|slice(0, 50) }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>IP</th>
|
||||
<th>Last visit</th>
|
||||
<th>Page</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Users active within last {{ config_visitors_counter_ttl }} minutes.</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div id="visitors_wrapper" class="dataTables_wrapper form-inline dt-bootstrap">
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<table id="visitors" class="table table-bordered table-striped dataTable" role="grid"
|
||||
aria-describedby="visitors_info">
|
||||
<thead>
|
||||
<tr role="row">
|
||||
<th class="sorting_asc" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
|
||||
aria-sort="ascending" aria-label="IP: activate to sort column descending"
|
||||
style="width: 297px;">IP
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
|
||||
aria-label="Last visit: activate to sort column ascending" style="width: 361px;">Last
|
||||
visit
|
||||
</th>
|
||||
<th class="sorting" tabindex="0" aria-controls="visitors" rowspan="1" colspan="1"
|
||||
aria-label="Page: activate to sort column ascending" style="width: 322px;">Page
|
||||
</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% set i = 0 %}
|
||||
{% for visitor in visitors %}
|
||||
{% set i = i + 1 %}
|
||||
<tr role="row" class="odd">
|
||||
<td>{{ visitor.ip }}</td>
|
||||
<td>{{ visitor.lastvisit|date("H:i:s") }}</td>
|
||||
<td>
|
||||
<a href="{{ visitor.page }}">{{ visitor.page|slice(0, 50) }}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
<tfoot>
|
||||
<tr>
|
||||
<th>IP</th>
|
||||
<th>Last visit</th>
|
||||
<th>Page</th>
|
||||
</tr>
|
||||
</tfoot>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(function () {
|
||||
$('#visitors').DataTable()
|
||||
})
|
||||
$(function () {
|
||||
$('#visitors').DataTable()
|
||||
})
|
||||
</script>
|
@ -1,3 +1,4 @@
|
||||
|
||||
{% if canEdit %}
|
||||
<form method="post" action="{{ getLink('spells') }}">
|
||||
<input type="hidden" name="reload_spells" value="yes"/>
|
||||
@ -20,7 +21,6 @@
|
||||
<option value="{{ id }}"{% if id == post_vocation_id and post_vocation_id != "all" and post_vocation_id != '' %} selected{% endif %}>{{ vocation }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<input type="hidden" name="order" value="{{ post_order }}">
|
||||
</td>
|
||||
<td>
|
||||
{{ include('buttons.submit.html.twig') }}
|
||||
@ -32,40 +32,14 @@
|
||||
</table>
|
||||
</form>
|
||||
<br/>
|
||||
<table border="0" cellspacing="1" cellpadding="4" width="100%">
|
||||
<tr bgcolor="{{ config.vdarkborder }}">
|
||||
<td class="white">
|
||||
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/spell' }}"><span class="white">Name</span></a></b>
|
||||
</td>
|
||||
<td class="white">
|
||||
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/words' }}"><span class="white">Words</span></a></b>
|
||||
</td>
|
||||
<td class="white">
|
||||
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/type' }}"><span class="white">Type<br/>(count)</span></a></b>
|
||||
</td>
|
||||
<td class="white">
|
||||
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/mana' }}"><span class="white">Mana</span></a></b>
|
||||
</td>
|
||||
<td class="white">
|
||||
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/level' }}"><span class="white">Level</span></a></b>
|
||||
</td>
|
||||
<td class="white">
|
||||
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/maglevel' }}"><span class="white">Magic<br/>Level</span></a></b>
|
||||
</td>
|
||||
<td class="white">
|
||||
<b><a href="{{ getLink('spells') ~ '/' ~ post_vocation|urlencode ~ '/soul' }}"><span class="white">Soul</span></a></b>
|
||||
</td>
|
||||
<td class="white">
|
||||
<b>Premium</b>
|
||||
</td>
|
||||
<td class="white">
|
||||
<b>Vocations:</b>
|
||||
</td>
|
||||
</tr>
|
||||
<table id="spellstb" class=""><thead>
|
||||
<tr role="row"><th>Name</th><th>Words</th><th>Type<br/>(count)</th>
|
||||
<th>Mana</th><th>Level</th><th>Magic Level</th><th>Soul</th><th>Premium</th><th>Vocations</th></tr>
|
||||
</thead><tbody>
|
||||
{% set i = 0 %}
|
||||
{% for spell in spells %}
|
||||
{% set i = i + 1 %}
|
||||
<tr bgcolor="{{ getStyle(i) }}">
|
||||
<tr>
|
||||
<td>{{ spell.name }}</td>
|
||||
<td>{{ spell.words }}</td>
|
||||
<td>
|
||||
@ -93,4 +67,4 @@
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
</tbody></table>
|
1
tools/css/dataTables.bootstrap.min.css
vendored
1
tools/css/dataTables.bootstrap.min.css
vendored
@ -1 +0,0 @@
|
||||
table.dataTable{clear:both;margin-top:6px !important;margin-bottom:6px !important;max-width:none !important;border-collapse:separate !important}table.dataTable td,table.dataTable th{-webkit-box-sizing:content-box;box-sizing:content-box}table.dataTable td.dataTables_empty,table.dataTable th.dataTables_empty{text-align:center}table.dataTable.nowrap th,table.dataTable.nowrap td{white-space:nowrap}div.dataTables_wrapper div.dataTables_length label{font-weight:normal;text-align:left;white-space:nowrap}div.dataTables_wrapper div.dataTables_length select{width:75px;display:inline-block}div.dataTables_wrapper div.dataTables_filter{text-align:right}div.dataTables_wrapper div.dataTables_filter label{font-weight:normal;white-space:nowrap;text-align:left}div.dataTables_wrapper div.dataTables_filter input{margin-left:0.5em;display:inline-block;width:auto}div.dataTables_wrapper div.dataTables_info{padding-top:8px;white-space:nowrap}div.dataTables_wrapper div.dataTables_paginate{margin:0;white-space:nowrap;text-align:right}div.dataTables_wrapper div.dataTables_paginate ul.pagination{margin:2px 0;white-space:nowrap}div.dataTables_wrapper div.dataTables_processing{position:absolute;top:50%;left:50%;width:200px;margin-left:-100px;margin-top:-26px;text-align:center;padding:1em 0}table.dataTable thead>tr>th.sorting_asc,table.dataTable thead>tr>th.sorting_desc,table.dataTable thead>tr>th.sorting,table.dataTable thead>tr>td.sorting_asc,table.dataTable thead>tr>td.sorting_desc,table.dataTable thead>tr>td.sorting{padding-right:30px}table.dataTable thead>tr>th:active,table.dataTable thead>tr>td:active{outline:none}table.dataTable thead .sorting,table.dataTable thead .sorting_asc,table.dataTable thead .sorting_desc,table.dataTable thead .sorting_asc_disabled,table.dataTable thead .sorting_desc_disabled{cursor:pointer;position:relative}table.dataTable thead .sorting:after,table.dataTable thead .sorting_asc:after,table.dataTable thead .sorting_desc:after,table.dataTable thead .sorting_asc_disabled:after,table.dataTable thead .sorting_desc_disabled:after{position:absolute;bottom:8px;right:8px;display:block;font-family:'Glyphicons Halflings';opacity:0.5}table.dataTable thead .sorting:after{opacity:0.2;content:"\e150"}table.dataTable thead .sorting_asc:after{content:"\e155"}table.dataTable thead .sorting_desc:after{content:"\e156"}table.dataTable thead .sorting_asc_disabled:after,table.dataTable thead .sorting_desc_disabled:after{color:#eee}div.dataTables_scrollHead table.dataTable{margin-bottom:0 !important}div.dataTables_scrollBody table{border-top:none;margin-top:0 !important;margin-bottom:0 !important}div.dataTables_scrollBody table thead .sorting:after,div.dataTables_scrollBody table thead .sorting_asc:after,div.dataTables_scrollBody table thead .sorting_desc:after{display:none}div.dataTables_scrollBody table tbody tr:first-child th,div.dataTables_scrollBody table tbody tr:first-child td{border-top:none}div.dataTables_scrollFoot table{margin-top:0 !important;border-top:none}@media screen and (max-width: 767px){div.dataTables_wrapper div.dataTables_length,div.dataTables_wrapper div.dataTables_filter,div.dataTables_wrapper div.dataTables_info,div.dataTables_wrapper div.dataTables_paginate{text-align:center}}table.dataTable.table-condensed>thead>tr>th{padding-right:20px}table.dataTable.table-condensed .sorting:after,table.dataTable.table-condensed .sorting_asc:after,table.dataTable.table-condensed .sorting_desc:after{top:6px;right:6px}table.table-bordered.dataTable th,table.table-bordered.dataTable td{border-left-width:0}table.table-bordered.dataTable th:last-child,table.table-bordered.dataTable th:last-child,table.table-bordered.dataTable td:last-child,table.table-bordered.dataTable td:last-child{border-right-width:0}table.table-bordered.dataTable tbody th,table.table-bordered.dataTable tbody td{border-bottom-width:0}div.dataTables_scrollHead table.table-bordered{border-bottom-width:0}div.table-responsive>div.dataTables_wrapper>div.row{margin:0}div.table-responsive>div.dataTables_wrapper>div.row>div[class^="col-"]:first-child{padding-left:0}div.table-responsive>div.dataTables_wrapper>div.row>div[class^="col-"]:last-child{padding-right:0}
|
1
tools/css/jquery.dataTables.min.css
vendored
Normal file
1
tools/css/jquery.dataTables.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
8
tools/js/dataTables.bootstrap.min.js
vendored
8
tools/js/dataTables.bootstrap.min.js
vendored
@ -1,8 +0,0 @@
|
||||
/*!
|
||||
DataTables Bootstrap 3 integration
|
||||
©2011-2015 SpryMedia Ltd - datatables.net/license
|
||||
*/
|
||||
(function(b){"function"===typeof define&&define.amd?define(["jquery","datatables.net"],function(a){return b(a,window,document)}):"object"===typeof exports?module.exports=function(a,d){a||(a=window);if(!d||!d.fn.dataTable)d=require("datatables.net")(a,d).$;return b(d,a,a.document)}:b(jQuery,window,document)})(function(b,a,d,m){var f=b.fn.dataTable;b.extend(!0,f.defaults,{dom:"<'row'<'col-sm-6'l><'col-sm-6'f>><'row'<'col-sm-12'tr>><'row'<'col-sm-5'i><'col-sm-7'p>>",renderer:"bootstrap"});b.extend(f.ext.classes,
|
||||
{sWrapper:"dataTables_wrapper form-inline dt-bootstrap",sFilterInput:"form-control input-sm",sLengthSelect:"form-control input-sm",sProcessing:"dataTables_processing panel panel-default"});f.ext.renderer.pageButton.bootstrap=function(a,h,r,s,j,n){var o=new f.Api(a),t=a.oClasses,k=a.oLanguage.oPaginate,u=a.oLanguage.oAria.paginate||{},e,g,p=0,q=function(d,f){var l,h,i,c,m=function(a){a.preventDefault();!b(a.currentTarget).hasClass("disabled")&&o.page()!=a.data.action&&o.page(a.data.action).draw("page")};
|
||||
l=0;for(h=f.length;l<h;l++)if(c=f[l],b.isArray(c))q(d,c);else{g=e="";switch(c){case "ellipsis":e="…";g="disabled";break;case "first":e=k.sFirst;g=c+(0<j?"":" disabled");break;case "previous":e=k.sPrevious;g=c+(0<j?"":" disabled");break;case "next":e=k.sNext;g=c+(j<n-1?"":" disabled");break;case "last":e=k.sLast;g=c+(j<n-1?"":" disabled");break;default:e=c+1,g=j===c?"active":""}e&&(i=b("<li>",{"class":t.sPageButton+" "+g,id:0===r&&"string"===typeof c?a.sTableId+"_"+c:null}).append(b("<a>",{href:"#",
|
||||
"aria-controls":a.sTableId,"aria-label":u[c],"data-dt-idx":p,tabindex:a.iTabIndex}).html(e)).appendTo(d),a.oApi._fnBindAction(i,{action:c},m),p++)}},i;try{i=b(h).find(d.activeElement).data("dt-idx")}catch(v){}q(b(h).empty().html('<ul class="pagination"/>').children("ul"),s);i!==m&&b(h).find("[data-dt-idx="+i+"]").focus()};return f});
|
Loading…
x
Reference in New Issue
Block a user