mirror of
https://github.com/slawkens/myaac.git
synced 2025-10-14 09:44:55 +02:00
Admin Panel (#61)
Thank you Lee for this awesome, Bootstrap Admin Panel!
This commit is contained in:
@@ -11,25 +11,44 @@ defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
||||
function message($message, $type, $return)
|
||||
{
|
||||
if($return)
|
||||
return '<div class="' . $type . '">' . $message . '</div>';
|
||||
if($return)
|
||||
return '<div class="' . $type . '" style="margin-bottom:10px;">' . $message . '</div>';
|
||||
|
||||
echo '<div class="' . $type . '">' . $message . '</div>';
|
||||
return true;
|
||||
echo '<div class="' . $type . '" style="margin-bottom:10px;">' . $message . '</div>';
|
||||
return true;
|
||||
}
|
||||
function success($message, $return = false) {
|
||||
return message($message, 'success', $return);
|
||||
return message($message, 'success', $return);
|
||||
}
|
||||
function warning($message, $return = false) {
|
||||
return message($message, 'warning', $return);
|
||||
return message($message, 'warning', $return);
|
||||
}
|
||||
function note($message, $return = false) {
|
||||
return message($message, 'note', $return);
|
||||
return message($message, 'note', $return);
|
||||
}
|
||||
function error($message, $return = false) {
|
||||
return message($message, 'error', $return);
|
||||
return message($message, 'error', $return);
|
||||
}
|
||||
function message1($head, $message, $type, $icon , $return)
|
||||
{//return '<div class="' . $type . '">' . $message . '</div>';
|
||||
if($return)
|
||||
return '<div class="alert alert-'.$type.' alert-dismissible"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><h4><i class="icon fa fa-'.$icon.'"></i> '.$head.':</h4>'.$message.'</div>';
|
||||
|
||||
echo '<div class="alert alert-'.$type.' alert-dismissible"><button type="button" class="close" data-dismiss="alert" aria-hidden="true">×</button><h4><i class="icon fa fa-'.$icon.'"></i> '.$head.':</h4>'.$message.'</div>';
|
||||
return true;
|
||||
}
|
||||
function success1($message, $return = false) {
|
||||
return message('Info', $message, 'success','success', $return);
|
||||
}
|
||||
function warning1($message, $return = false) {
|
||||
return message('Warning',$message, 'warning','ban', $return);
|
||||
}
|
||||
function note1($message, $return = false) {
|
||||
return message('Info',$message, 'info','info', $return);
|
||||
}
|
||||
function error1($message, $return = false) {
|
||||
return message("Alert", $message, 'danger','check', $return);
|
||||
}
|
||||
function longToIp($ip)
|
||||
{
|
||||
$exp = explode(".", long2ip($ip));
|
||||
|
@@ -398,6 +398,35 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
|
||||
return $this->data['created'];
|
||||
}
|
||||
|
||||
/**
|
||||
* Name.
|
||||
*
|
||||
* @version 0.7.5
|
||||
* @since 0.7.5
|
||||
* @return string Name.
|
||||
* @throws E_OTS_NotLoaded If account is not loaded.
|
||||
*/
|
||||
public function setPremDays($premdays)
|
||||
{
|
||||
$this->data['premdays'] = (int) $premdays;
|
||||
}
|
||||
|
||||
public function setRLName($name)
|
||||
{
|
||||
$this->data['rlname'] = (string) $name;
|
||||
}
|
||||
|
||||
public function setLocation($location)
|
||||
{
|
||||
$this->data['location'] = (string) $location;
|
||||
}
|
||||
|
||||
public function setCountry($country)
|
||||
{
|
||||
$this->data['country'] = (string) $country;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Name.
|
||||
@@ -620,7 +649,6 @@ class OTS_Account extends OTS_Row_DAO implements IteratorAggregate, Countable
|
||||
{
|
||||
$value = $this->db->quote($value);
|
||||
}
|
||||
|
||||
$this->db->query('UPDATE ' . $this->db->tableName('accounts') . ' SET ' . $this->db->fieldName($field) . ' = ' . $value . ' WHERE ' . $this->db->fieldName('id') . ' = ' . $this->data['id']);
|
||||
}
|
||||
|
||||
|
463
system/pages/admin/accounts.php
Normal file
463
system/pages/admin/accounts.php
Normal file
@@ -0,0 +1,463 @@
|
||||
<?php
|
||||
/**
|
||||
* Account editor
|
||||
*
|
||||
* @package MyAAC
|
||||
* @author Lee
|
||||
* @copyright 2018 MyAAC
|
||||
* @link http://my-aac.org
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
|
||||
$title = 'Account editor';
|
||||
$base = BASE_URL . 'admin/?p=accounts';
|
||||
|
||||
function echo_success($message)
|
||||
{
|
||||
echo '<p class="success">' . $message . '</p>';
|
||||
}
|
||||
|
||||
function echo_error($message)
|
||||
{
|
||||
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.');
|
||||
|
||||
$number_length = strlen($number);
|
||||
if ($number_length <= 0 || $number_length > $max_length)
|
||||
echo_error($name . ' cannot be longer than ' . $max_length . ' digits.');
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="<?php echo BASE_URL; ?>tools/jquery.datetimepicker.css"/ >
|
||||
<script src="<?php echo BASE_URL; ?>tools/jquery.datetimepicker.js"></script>
|
||||
|
||||
<?php
|
||||
$id = 0;
|
||||
if (isset($_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 ($id > 0) {
|
||||
$account = new OTS_Account();
|
||||
$account->load($id);
|
||||
|
||||
if (isset($account) && $account->isLoaded() && isset($_POST['save'])) {// we want to save
|
||||
$error = false;
|
||||
|
||||
$name = $_POST['name'];
|
||||
$_error = '';
|
||||
|
||||
//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->load($id);
|
||||
if (!$account_db->isLoaded())
|
||||
echo_error('Account with this id doesn\'t exist.');
|
||||
|
||||
//type
|
||||
$group = $_POST['group'];
|
||||
|
||||
$password = ((!empty($_POST["pass"]) ? $_POST['pass'] : null));
|
||||
if(!Validator::password($password)) {
|
||||
$errors['password'] = Validator::getLastError();
|
||||
}
|
||||
|
||||
//secret
|
||||
$secret = $_POST['secret'];
|
||||
//key
|
||||
$key = $_POST['key'];
|
||||
|
||||
$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);
|
||||
|
||||
//tibia coins
|
||||
$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);
|
||||
|
||||
//rl name
|
||||
$rl_name = $_POST['rl_name'];
|
||||
|
||||
//location
|
||||
$rl_loca = $_POST['rl_loca'];
|
||||
|
||||
//country
|
||||
$rl_country = $_POST['rl_country'];
|
||||
|
||||
//created
|
||||
$created = $_POST['created'];
|
||||
verify_number($created, 'Created', 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);
|
||||
|
||||
|
||||
if (!$error) {
|
||||
$account->setName($name);
|
||||
$account->setCustomField('type', $group);
|
||||
$account->setCustomField('secret', $secret);
|
||||
$account->setCustomField('key', $key);
|
||||
$account->setEMail($email);
|
||||
$account->setPremDays($p_days);
|
||||
$account->setCustomField('coins', $t_coins);
|
||||
|
||||
$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 (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);
|
||||
|
||||
if ($config_salt_enabled)
|
||||
$account->setCustomField('salt', $salt);
|
||||
}
|
||||
|
||||
$account->setEMail($email);
|
||||
|
||||
//$account->setCustomField('created', time());
|
||||
|
||||
$account->save();
|
||||
echo_success('Account saved at: ' . date('G:i'));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$search_name = '';
|
||||
$search_account = '';
|
||||
if (isset($_REQUEST['search_name']))
|
||||
$search_name = $_REQUEST['search_name'];
|
||||
else if (isset($_REQUEST['search_account']))
|
||||
$search_account = $_REQUEST['search_account'];
|
||||
else if ($id > 0 && isset($account) && $account->isLoaded())
|
||||
$search_name = $account->getName();
|
||||
|
||||
?>
|
||||
<div class="row">
|
||||
<?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">
|
||||
|
||||
<span class="input-group-addon">
|
||||
<input type="checkbox"
|
||||
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>
|
||||
<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 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>
|
||||
<!-- nav-tabs-custom -->
|
||||
<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>
|
||||
<?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>
|
||||
<!-- /.box-tools -->
|
||||
</div>
|
||||
<!-- /.box-header -->
|
||||
|
||||
<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>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
<!-- /.box -->
|
||||
<?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>
|
||||
<!-- /.box-header -->
|
||||
<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>
|
||||
<!-- /.box-body -->
|
||||
</div>
|
||||
|
||||
<?php
|
||||
};
|
||||
};
|
||||
?>
|
||||
</div>
|
||||
<div class="row">
|
||||
<?php if (isset($accoun1t) && $account->isLoaded()) {
|
||||
?>
|
||||
<div class="col-md-4">
|
||||
<?php
|
||||
$tableToDescribe = 'accounts';
|
||||
$statement = $db->query('DESCRIBE ' . $tableToDescribe);
|
||||
$result = $statement->fetchAll(PDO::FETCH_ASSOC);
|
||||
$val = 0;
|
||||
foreach ($result as $column) {
|
||||
// IF val = 2 MAKE <TR> TODO
|
||||
($val == 2) ? "<tr>" : "";
|
||||
?>
|
||||
|
||||
<td><?php echo $column['Field'] ?></td>
|
||||
<td><input type="text" name="lastip" size="8" maxlength="10"
|
||||
value="<?php echo $account->getCustomField($column['Field']); ?>"/></td>
|
||||
<?php
|
||||
echo $column['Field'] . ' - ' . $column['Type'], '<br>';
|
||||
|
||||
if ($val == 2) {
|
||||
echo "</tr>";
|
||||
$val = 1;
|
||||
} else {
|
||||
++$val;
|
||||
}
|
||||
|
||||
} ?>
|
||||
</div>
|
||||
<?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();
|
||||
});
|
||||
</script>
|
@@ -24,4 +24,3 @@ $changelog = preg_replace('/\s(\w+:\/\/)(\S+)/', ' <a href="\\1\\2" target="_bla
|
||||
$changelog = nl2br($changelog);
|
||||
|
||||
echo '<div>' . $changelog . '</div>';
|
||||
?>
|
||||
|
@@ -48,12 +48,40 @@ $tmp = '';
|
||||
if(fetchDatabaseConfig('site_closed_message', $tmp))
|
||||
$closed_message = $tmp;
|
||||
|
||||
$twig->display('admin.dashboard.html.twig', array(
|
||||
'is_closed' => $is_closed,
|
||||
'closed_message' => $closed_message,
|
||||
'status' => $status
|
||||
$query = $db->query('SELECT count(*) as `how_much` FROM `accounts`;');
|
||||
$query = $query->fetch();
|
||||
$total_accounts = $query['how_much'];
|
||||
|
||||
$query = $db->query('SELECT count(*) as `how_much` FROM `players`;');
|
||||
$query = $query->fetch();
|
||||
$total_players = $query['how_much'];
|
||||
|
||||
$query = $db->query('SELECT count(*) as `how_much` FROM `guilds`;');
|
||||
$query = $query->fetch();
|
||||
$total_guilds = $query['how_much'];
|
||||
|
||||
$query = $db->query('SELECT count(*) as `how_much` FROM `houses`;');
|
||||
$query = $query->fetch();
|
||||
$total_houses = $query['how_much'];
|
||||
|
||||
$points = $db->query('SELECT `premium_points`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `premium_points` DESC LIMIT 10;');
|
||||
$coins = $db->query('SELECT `coins`, `' . (USE_ACCOUNT_NAME ? 'name' : 'id') . '` as `name` FROM `accounts` ORDER BY `premium_points` DESC LIMIT 10;');
|
||||
|
||||
$twig->display('admin.statistics.html.twig', array(
|
||||
'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
|
||||
));
|
||||
function clearCache()
|
||||
{
|
||||
global $template_name;
|
||||
|
@@ -9,15 +9,22 @@
|
||||
*/
|
||||
defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Login';
|
||||
$logout = '';
|
||||
if($action == 'logout') {
|
||||
$logout = "You have been logged out!";
|
||||
}
|
||||
|
||||
$search_errors[] = 'Character <b></b> does not exist or has been deleted.';
|
||||
|
||||
if($action == 'logout')
|
||||
echo 'You have been logout.<br/>';
|
||||
|
||||
if(isset($errors)) {
|
||||
foreach($errors as $error) {
|
||||
error($error);
|
||||
$twig->display('admin.error.html.twig', array('errors' => $error));
|
||||
}
|
||||
}
|
||||
|
||||
$twig->display('admin.login.html.twig');
|
||||
?>
|
||||
$twig->display('admin.login.html.twig', array(
|
||||
'errors' => $search_errors,
|
||||
'logout' => $logout
|
||||
));
|
@@ -11,73 +11,114 @@ defined('MYAAC') or die('Direct access not allowed!');
|
||||
$title = 'Logs viewer';
|
||||
?>
|
||||
|
||||
<table class="table" width="100%" border="0" cellspacing="1" cellpadding="4">
|
||||
<tr>
|
||||
<th><b>Log name</b></td>
|
||||
<th><b>Last updated</b></td>
|
||||
</tr>
|
||||
<?php
|
||||
<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;
|
||||
|
||||
$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>
|
||||
</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
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?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 str_repeat('<br/>', 3) . '<b>' . $file . ':</b><br/><br/>' . nl2br(file_get_contents($aac_path_logs . $file));
|
||||
else if(file_exists($server_path_logs . $file))
|
||||
echo str_repeat('<br/>', 3) . '<b>' . $file . ':</b><br/><br/>' . nl2br(file_get_contents($server_path_logs . $file));
|
||||
|
||||
else
|
||||
echo 'Specified file does not exist.';
|
||||
}
|
||||
else
|
||||
echo 'Invalid file name specified.';
|
||||
if (!empty($file)) {
|
||||
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>
|
||||
</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.';
|
||||
}
|
||||
?>
|
||||
<script>
|
||||
$(function () {
|
||||
$('#logs').DataTable()
|
||||
})
|
||||
</script>
|
@@ -12,75 +12,82 @@ $title = 'Menus';
|
||||
|
||||
if(!hasFlag(FLAG_CONTENT_MENUS) && !superAdmin())
|
||||
{
|
||||
echo 'Access denied.';
|
||||
return;
|
||||
echo 'Access denied.';
|
||||
return;
|
||||
}
|
||||
|
||||
if(isset($_REQUEST['template'])) {
|
||||
$template = $_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/>
|
||||
Editing: ' . $template . ' template.';
|
||||
$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']);
|
||||
}
|
||||
<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']);
|
||||
}
|
||||
|
||||
$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 '<h2>' . $cat['name'] . '<img class="add-button" id="add-button-' . $id . '" src="' . BASE_URL . 'images/plus.png" width="16" height="16"/></h2>';
|
||||
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'] . '"/>
|
||||
$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>
|
||||
</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'] . '"/>
|
||||
<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>
|
||||
@@ -89,34 +96,41 @@ 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 '</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 '<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 '</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]);
|
||||
}
|
||||
}
|
||||
$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
|
||||
));
|
||||
}
|
@@ -52,4 +52,4 @@ class Notepad
|
||||
global $db;
|
||||
$db->update(TABLE_PREFIX . 'notepad', array('content' => $content), array('account_id' => $account_id));
|
||||
}
|
||||
}
|
||||
}
|
@@ -84,7 +84,7 @@ if(!empty($action))
|
||||
}
|
||||
|
||||
if(!empty($errors))
|
||||
$twig->display('error_box.html.twig', array('errors' => $errors));
|
||||
$twig->display('admin.error.html.twig', array('errors' => $errors));
|
||||
}
|
||||
|
||||
$query =
|
||||
|
File diff suppressed because it is too large
Load Diff
@@ -1,77 +1,100 @@
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th><a href="?p=dashboard&clear_cache" onclick="return confirm('Are you sure?');">Clear cache</a></th>
|
||||
</tr>
|
||||
</table>
|
||||
<form action="?p=dashboard&maintenance" method="post">
|
||||
<table class="table">
|
||||
<tr>
|
||||
<th colspan="2">Maintenance
|
||||
</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Site status:</td>
|
||||
<td>
|
||||
<select name="status">
|
||||
<option value="0"{% if not is_closed %} selected{% endif %}>Open</option>
|
||||
<option value="1"{% if is_closed %} selected{% endif %}>Closed</option>
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Message: (only if closed)</td>
|
||||
<td>
|
||||
<textarea name="message" maxlength="255" cols="40" rows="5">{{ closed_message }}</textarea>
|
||||
<td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<input type="submit" class="button" value="Update"/>
|
||||
</td>
|
||||
</table>
|
||||
</form>
|
||||
<br/>
|
||||
<div>
|
||||
{% if status.online %}
|
||||
<p class="success" style="width: 150px; text-align: center;">Status: Online<br/>
|
||||
{{ status.uptimeReadable }}, {{ status.players }}/{{ status.playersMax }}<br/>
|
||||
{{ config.lua.ip }} : {{ config.lua.loginPort }}
|
||||
<br/><br/><u><a id="more-button" href="#"></a></u>
|
||||
<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">
|
||||
<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>
|
||||
|
||||
<span id="status-more">
|
||||
<br/>
|
||||
<b>Server</b>:<br/> {{ status.server }} {{ status.serverVersion }}<br/>
|
||||
<b>Version</b>: {{ status.clientVersion }}<br/><br/>
|
||||
|
||||
<b>Monsters</b>: {{ status.monsters }}<br/>
|
||||
<b>Map</b>: {{ status.mapName }}, <b>author</b>: {{ status.mapAuthor }}, <b>size</b>: {{ status.mapWidth }} x {{ status.mapHeight }}<br/>
|
||||
<b>MOTD</b>:<br/> {{ status.motd }}<br/><br/>
|
||||
|
||||
<b>Last updated</b>: {{ status.lastCheck|date("H:i:s") }}
|
||||
</span>
|
||||
</p>
|
||||
{% else %}
|
||||
<p class="error" style="width: 120px; text-align: center;">Status: Offline</p>
|
||||
{% endif %}
|
||||
</div>
|
||||
{% if status.online %}
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function() {
|
||||
$("#status-more").hide();
|
||||
$("#more-button").text("More");
|
||||
});
|
||||
|
||||
$("#more-button").click(function() {
|
||||
if($("#status-more").is(":hidden")) {
|
||||
$("#more-button").text("Hide");
|
||||
$("#status-more").show();
|
||||
}
|
||||
else {
|
||||
$("#more-button").text("More");
|
||||
$("#status-more").hide();
|
||||
}
|
||||
|
||||
return false;
|
||||
});
|
||||
</script>
|
||||
{% endif %}
|
||||
<div class="col-md-3">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Top 10 - Most wealthly accounts</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>
|
||||
<div class="col-md-3">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Top 10 - Most wealthly accounts</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>
|
||||
</div>
|
153
system/templates/admin.dashboardstats.html.twig
Normal file
153
system/templates/admin.dashboardstats.html.twig
Normal file
@@ -0,0 +1,153 @@
|
||||
<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">
|
||||
<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 status.online %}
|
||||
<div class="col-md-6">
|
||||
<div class="box box-success">
|
||||
<div class="box-header with-border">
|
||||
<h3 class="box-title">Server Online</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">
|
||||
<table class="table table-hover">
|
||||
<tbody>
|
||||
<tr>
|
||||
<td>Status</td>
|
||||
<td>{{ status.uptimeReadable }}, {{ status.players }}/{{ status.playersMax }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Connection</td>
|
||||
<td>{{ config.lua.ip }} : {{ config.lua.loginPort }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Server</td>
|
||||
<td>{{ status.server }} {{ status.serverVersion }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Version</td>
|
||||
<td> {{ status.clientVersion }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Monsters</td>
|
||||
<td>{{ status.monsters }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Map</td>
|
||||
<td>{{ status.mapName }}, <b>author</b>: {{ status.mapAuthor }},
|
||||
<b>size</b>: {{ status.mapWidth }} x {{ status.mapHeight }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>MOTD</td>
|
||||
<td>{{ status.motd }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Last updated</td>
|
||||
<td>{{ status.lastCheck|date("H:i:s") }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endif %}
|
||||
|
||||
<div class="col-md-3">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Top 10 - Most wealthly accounts</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>
|
||||
<div class="col-md-3">
|
||||
<div class="box">
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">Top 10 - Most wealthly accounts</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>
|
||||
</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)" />
|
||||
</form>
|
||||
</form>
|
@@ -1,9 +1,38 @@
|
||||
Please login.
|
||||
<form method="post">
|
||||
<input type="password" name="account_login" id="account-name-input" size="30" maxlength="30" autofocus/><br/>
|
||||
<input type="password" name="password_login" size="30" maxlength="29"/><br/>
|
||||
<input type="checkbox" id="remember_me" name="remember_me" value="true"/>
|
||||
<label for="remember_me"> Remember me</label><br/>
|
||||
<input type="hidden" name="admin" value="1"/>
|
||||
<input type="submit" class="button" value="Login"/>
|
||||
</form>
|
||||
<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 %}
|
||||
|
||||
<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="Username" 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,40 +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",
|
||||
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') }}"
|
||||
});
|
||||
image_advtab: true,
|
||||
relative_urls: false,
|
||||
remove_script_host: false,
|
||||
document_base_url: "{{ constant('BASE_URL') }}"
|
||||
});
|
||||
</script>
|
||||
<table width="800" cellspacing="1" cellpadding="2" border="0" align="center">
|
||||
<form method="post">
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<p class="note note-image" style="width: 80%;">Sending mails may take some time if there are much users in db.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right">
|
||||
<label for="mail_subject">Subject:</label>
|
||||
</td>
|
||||
<td align="left">
|
||||
<input type="text" id="mail_subject" name="mail_subject" value="{{ mail_subject }}" size="30" maxlength="30" />
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<textarea id="mail_content" name="mail_content" style="width: 100%" class="tinymce">{{ mail_content }}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2" align="center">
|
||||
<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/><input type="submit" name="submit" value="Send" />
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
|
||||
<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>
|
||||
<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,9 +1,28 @@
|
||||
Please choose template in which you want to edit menu items.<br/>
|
||||
<form method="post" action="?p=menus">
|
||||
<select name="template">
|
||||
{% for template in templates %}
|
||||
<option value="{{ template.template }}">{{ template.template }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
<input type="submit" class="button" value="Edit" />
|
||||
</form>
|
||||
<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">
|
||||
<button type="submit" type="button" class="btn btn-primary btn-flat">Edit</button>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
@@ -1,22 +1,26 @@
|
||||
<table width="700" cellspacing="1" cellpadding="2" border="0" align="center">
|
||||
<form method="post">
|
||||
<tr>
|
||||
<td align="center">
|
||||
<p>This is your personal notepad. Be sure to save it each time you modify something.</p>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<textarea style="text-align: left;" name="content" cols="50" rows="15" onchange="notepad_onchange(this);">{% if content is not null %}{{ content }}{% endif %}</textarea>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="center">
|
||||
<input type="submit" name="submit" onclick="notepad_save(this);" value="Save" />
|
||||
</td>
|
||||
</tr>
|
||||
</form>
|
||||
</table>
|
||||
<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>
|
||||
|
||||
{# <?php echo isset($_content) ? htmlentities($_content, ENT_COMPAT, 'UTF-8') : ''; ?> #}
|
||||
|
||||
{# confirm leaving current page if content of the notepad has been modified #}
|
||||
@@ -38,14 +42,15 @@
|
||||
}
|
||||
|
||||
function notepad_onchange(e) {
|
||||
if(original_value != e.value) {
|
||||
if (original_value != e.value) {
|
||||
window.onbeforeunload = confirm_exit;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
function notepad_save(e) {
|
||||
window.onbeforeunload = function(e) {};
|
||||
window.onbeforeunload = function (e) {
|
||||
};
|
||||
return true;
|
||||
}
|
||||
</script>
|
@@ -1,97 +1,111 @@
|
||||
<form method="post" action="?p=pages&action={% if action == 'edit' %}edit{% else %}add{% endif %}">
|
||||
{% if action == 'edit' %}
|
||||
<input type="hidden" name="id" value="{{ id }}" />
|
||||
{% endif %}
|
||||
<table class="table" id="page-edit-table" width="100%" border="0" cellspacing="1" cellpadding="4">
|
||||
<tr>
|
||||
<th><b>{% if action == 'edit' %}Edit{% else %}Add{% endif %} page</b></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<table border="0" cellpadding="1">
|
||||
<tr>
|
||||
<td>Link/name:</td>
|
||||
<td><input name="name" value="{{ name }}" size="29" maxlength="29"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Title:</td>
|
||||
<td><input name="title" value="{{ title }}" size="29" maxlength="29"/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>PHP:</td>
|
||||
<td>
|
||||
<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 %}
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Content:</td>
|
||||
<td id="body-parent">
|
||||
<textarea id="body" name="body" maxlength="65000" cols="50" rows="5">{{ body|raw }}</textarea>
|
||||
</td>
|
||||
<tr/>
|
||||
<tr>
|
||||
<td>Access:</td>
|
||||
<td>
|
||||
<select name="access">
|
||||
{% for id, group in groups %}
|
||||
<option value="{{ group.getId() }}"{% if access == group.getId() %} selected{% endif %}>{{ group.getName() }}</option>
|
||||
{% endfor %}
|
||||
</select>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td align="right"><input type="submit" class="button" value="Save"/></td>
|
||||
<td align="left">
|
||||
<input type="button" onclick="window.location = '{{ constant('ADMIN_URL') }}?p=pages';" class="button" value="Cancel"/>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<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');
|
||||
{% 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="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>
|
||||
|
||||
} 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>
|
||||
function decodeHtml(html) {
|
||||
var txt = document.createElement("textarea");
|
||||
txt.innerHTML = html;
|
||||
return txt.value;
|
||||
}
|
||||
});
|
||||
</script> {% endif %}
|
@@ -1,27 +1,66 @@
|
||||
<table class="table" width="100%" cellspacing="1" cellpadding="4">
|
||||
<tr>
|
||||
<th><b>Name</b></th>
|
||||
<th><b>Title</b></th>
|
||||
<th><b>Options</b></th>
|
||||
</tr>
|
||||
{% 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">
|
||||
<img src="{{ constant('BASE_URL') }}images/edit.png"/>
|
||||
Edit
|
||||
</a>
|
||||
<a href="?p=pages&action=delete&id={{ page.id }}" class="ico" onclick="return confirm('Are you sure?');" title="Delete">
|
||||
<img src="{{ constant('BASE_URL') }}images/del.png"/>
|
||||
Delete
|
||||
</a>
|
||||
<a href="?p=pages&action=hide&id={{ page.id }}" class="ico" title="<?php echo ($_page['hidden'] != 1 ? 'Hide' : 'Show'); ?>">
|
||||
<img src="{{ constant('BASE_URL') }}images/{% if page.hidden != 1 %}success{% else %}error{% endif %}.png"/>
|
||||
{% if page.hidden != 1 %}Hide{% else %}Show{% endif %}
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<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>
|
||||
<script>
|
||||
$(function () {
|
||||
$('#tb_pages').DataTable()
|
||||
})
|
||||
</script>
|
@@ -1,17 +1,27 @@
|
||||
<form enctype="multipart/form-data" method="post" action="{{ constant('ADMIN_URL') }}?p=plugins">
|
||||
<input type="hidden" name="upload_plugin" />
|
||||
<table cellspacing="3" border="0">
|
||||
<tr>
|
||||
<td colspan="2">Install plugin:</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<input type="file" name="plugin" />
|
||||
</td>
|
||||
<td>
|
||||
<input type="submit" value="Upload" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</form>
|
||||
<br/><br/>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
<div class="box box-primary collapsed-box">
|
||||
<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-plus"></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,25 +1,67 @@
|
||||
<b>Installed plugins:</b>
|
||||
<table class="table" border="0" align="center">
|
||||
<tr>
|
||||
<th>Plugin name (Description on hover)</th>
|
||||
<th>Filename</th>
|
||||
<th>Version</th>
|
||||
<th>Author</th>
|
||||
<th>Contact</th>
|
||||
<th>Options</th>
|
||||
</tr>
|
||||
{% for plugin in plugins %}
|
||||
<tr>
|
||||
<td><div title="{{ plugin.description }}">{{ plugin.name }}</div></td>
|
||||
<td>{{ plugin.file }}.json</td>
|
||||
<td>{{ plugin.version }}</td>
|
||||
<td>{{ plugin.author }}</td>
|
||||
<td>{{ plugin.contact }}</td>
|
||||
<td>
|
||||
{% if plugin.uninstall %}
|
||||
<a href="?p=plugins&uninstall={{ plugin.file }}" onclick="return confirm('Are you sure?');">Uninstall</a>
|
||||
{% endif %}
|
||||
</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</table>
|
||||
<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>
|
||||
<script>
|
||||
$(function () {
|
||||
$('#plugins').DataTable()
|
||||
})
|
||||
</script>
|
@@ -1,38 +1,39 @@
|
||||
<table>
|
||||
<tr>
|
||||
<td>
|
||||
<table class="table">
|
||||
<tr><th colspan="2">Statistics</th></tr>
|
||||
<tr>
|
||||
<td>Total accounts:</td>
|
||||
<td>{{ total_accounts }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Total players:</td>
|
||||
<td>{{ total_players }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Total guilds:</td>
|
||||
<td>{{ total_guilds }}</td>
|
||||
</tr>
|
||||
<tr><td>Total houses:</td>
|
||||
<td>{{ total_houses }}</td></tr>
|
||||
</table>
|
||||
</td>
|
||||
<td>
|
||||
<table class="table">
|
||||
<tr><th colspan="3">TOP 10 - Most wealth accounts</th></tr>
|
||||
<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 %}
|
||||
</table>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<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>
|
@@ -1,19 +1,56 @@
|
||||
Users being active within last {{ config_visitors_counter_ttl }} minutes.<br/><br/>
|
||||
<table class="table" width="100%" border="0">
|
||||
<tr>
|
||||
<th><b>IP</b></th>
|
||||
<th><b>Last visit</b></th>
|
||||
<th><b>Page</b></th>
|
||||
</tr>
|
||||
{% set i = 0 %}
|
||||
{% for visitor in visitors %}
|
||||
{% set i = i + 1 %}
|
||||
<tr>
|
||||
<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 %}
|
||||
</table>
|
||||
<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>
|
||||
<script>
|
||||
$(function () {
|
||||
$('#visitors').DataTable()
|
||||
})
|
||||
</script>
|
Reference in New Issue
Block a user