This commit is contained in:
Jackson Dou 2023-08-20 11:28:52 +08:00
parent 950498e36b
commit bfd4e90878
63 changed files with 578 additions and 200 deletions

View file

@ -0,0 +1,36 @@
<?php
require 'application.php';
@header('Content-Type: application/json; charset=UTF-8');
if (!checkRefererHost()) exit('{"code":403}');
$act = get('act');
switch ($act) {
case 'stat':
$count_client = $DB->count('clients', array('client_status' => 1));
$count_clients = $DB->count('clients');
$count_account = $DB->count('account', array('account_status' => 1));
$count_accounts = $DB->count('account');
$count_ssl = $DB->count('ssl');
$count_ssls = $DB->count('ssl');
$count_ticket = $DB->count('tickets', "`ticket_status`=0 OR `ticket_status`=2");
$count_tickets = $DB->count('tickets');
$result = [
"count_client" => $count_client,
"count_clients" => $count_clients,
"count_account" => $count_account,
"count_accounts" => $count_accounts,
"count_ssl" => $count_ssl,
"count_ssls" => $count_ssls,
"count_ticket" => $count_ticket,
"count_tickets" => $count_tickets
];
send_response(0, $result);
break;
default:
send_response(-4, null, 'No Act');
break;
}

63
src/admin/api/emails.php Executable file
View file

@ -0,0 +1,63 @@
<?php
require 'application.php';
// if (!defined('IN_CRONLITE')) {
// exit('Access Denied');
// }
@header('Content-Type: application/json; charset=UTF-8');
// if (!checkRefererHost()) exit('{"code":403}');
$act = get('act');
switch ($act) {
case 'info':
$email_id = intval(get('email_id'));
if ($email_id > 0) {
$row = $DB->find('emails', '*', array('email_id' => $email_id), null, 1);
} else {
$row = null;
}
if (!$row) send_response(-1, null, '记录不存在');
send_response(0, $row);
break;
case 'list':
$where = " 1=1";
$email_id = intval(post('email_id'));
$email_client_id = post('email_client_id');
$email_subject = post('email_subject');
$email_to = post('email_to');
if (!empty($email_id)) {
$where .= " AND `email_id`='{$email_id}'";
}
if (!empty($email_client_id)) {
$where .= " AND `email_client_id`='{$email_client_id}'";
}
if (!empty($email_subject)) {
$where .= " AND `email_subject` like '%{$email_subject}%'";
}
if (!empty($email_to)) {
$where .= " AND `email_to` like '%{$email_to}%'";
}
$offset = intval(post('offset', 0));
$limit = intval(post('limit', 10));
$total = $DB->count('emails', $where);
if ($total > 0) {
$rows = $DB->findAll('emails', 'email_id,email_client_id,email_subject,email_date,email_to,email_read', $where, "`email_id` DESC", "$offset,$limit");
} else {
$rows = array();
}
// send_response(0, array('total' => $total, 'rows' => $rows));
exit(json_encode(array('code' => 0, 'rows' => $rows, 'total' => $total)));
break;
default:
send_response(-4, null, 'No Act');
break;
}

View file

@ -1,4 +1,7 @@
<?php
require_once __DIR__ . '/../core/application.php';
define('ROOT_ADMIN', dirname(__FILE__));
require_once ROOT . '/core/adminarea.php';

View file

@ -0,0 +1,22 @@
<?php
if (!defined('IN_CRONLITE')) {
exit('Access Denied');
}
$account_id = get('account_id');
if (empty($account_id)) {
redirect('admin/accounts');
}
$AccountInfo = $DB->find('account', '*', array('account_id' => $account_id), null, 1);
if (empty($AccountInfo)) {
setMessage('not found', 'danger');
redirect('admin/accounts');
}
$PageInfo['title'] = 'Account Domains';
$AccountDomainList = $DB->findAll('account_domain', '*', array('domain_account_id' => $account_id));

View file

@ -1,14 +1,6 @@
<?php
$PageInfo['title'] = 'Dashboard';
$count_client = $DB->count('clients', array('client_status' => 1));
$count_clients = $DB->count('clients');
$count_account = $DB->count('account', array('account_status' => 1));
$count_accounts = $DB->count('account');
$count_ssl = $DB->count('ssl');
$count_ssls = $DB->count('ssl');
$count_ticket = $DB->count('tickets', "`ticket_status`=0 OR `ticket_status`=2");
$count_tickets = $DB->count('tickets');
$date = date("Y-m-d H:i:s");
$mysqlversion = $DB->getColumn("select VERSION()");

View file

@ -9,8 +9,4 @@ if (!in_array($action, array('list', 'view'))) {
}
require __DIR__ . '/controllers/emails/' . $action . '.php';
require __DIR__ . '/views/header.php';
require __DIR__ . '/views/navbar.php';
require __DIR__ . '/views/sidebar.php';
require __DIR__ . '/views/emails/' . $action . '.php';
require __DIR__ . '/views/footer.php';

View file

@ -2,8 +2,4 @@
require_once __DIR__ . '/application.php';
require_once __DIR__ . '/controllers/dashboard/view.php';
require_once __DIR__ . '/views/header.php';
require_once __DIR__ . '/views/navbar.php';
require_once __DIR__ . '/views/sidebar.php';
require_once __DIR__ . '/views/dashboard/view.php';
require_once __DIR__ . '/views/footer.php';

View file

@ -31,8 +31,16 @@
<?php if ($count > 0): ?>
<?php foreach ($rows as $row): ?>
<tr>
<td><?php echo $row['account_id'];?></td>
<td><?php echo $row['account_client_id']; ?></td>
<td>
<a href="accounts.php?action=details&account_id=<?php echo $row['account_id']; ?>">
<?php echo $row['account_id']; ?>
</a>
</td>
<td>
<a href="clients.php?action=details&id=<?php echo $row['account_client_id']; ?>">
<?php echo $row['account_client_id']; ?>
</a>
</td>
<td>
<a href="hosting-provider.php?action=details&api_key=<?php echo $row['account_api_key']; ?>">
<?php echo $row['account_api_key']; ?>

View file

@ -30,37 +30,40 @@
<td><?php echo $ClientInfo['client_fname']; ?></td>
</tr>
<tr>
<td><b><?php echo $lang->I18N('Last Name'); ?></b></td><td><?php echo $ClientInfo['client_lname']; ?></td>
<td><?php echo $lang->I18N('Last Name'); ?></td><td><?php echo $ClientInfo['client_lname']; ?></td>
</tr>
<tr>
<td><b><?php echo $lang->I18N('Email Address'); ?></b></td><td><?php echo $ClientInfo['client_email']; ?></td>
<td><?php echo $lang->I18N('Email Address'); ?></td><td><?php echo $ClientInfo['client_email']; ?></td>
</tr>
<tr>
<td><b><?php echo $lang->I18N('Phone Number'); ?></b></td><td><?php echo $ClientInfo['client_phone']; ?></td>
<td><?php echo $lang->I18N('Phone Number'); ?></td><td><?php echo $ClientInfo['client_phone']; ?></td>
</tr>
<tr>
<td><b><?php echo $lang->I18N('Billing Address'); ?></b></td><td><?php echo $ClientInfo['client_address']; ?></td>
<td><?php echo $lang->I18N('Billing Address'); ?></td><td><?php echo $ClientInfo['client_address']; ?></td>
</tr>
<tr>
<td><b><?php echo $lang->I18N('Company'); ?></b></td><td><?php echo $ClientInfo['client_company']; ?></td>
<td><?php echo $lang->I18N('Company'); ?></td><td><?php echo $ClientInfo['client_company']; ?></td>
</tr>
<tr>
<td><b><?php echo $lang->I18N('Country'); ?></b></td><td><?php echo $CountryName; ?></td>
<td><?php echo $lang->I18N('Country'); ?></td><td><?php echo $CountryName; ?></td>
</tr>
<tr>
<td><b><?php echo $lang->I18N('City'); ?></b></td><td><?php echo $ClientInfo['client_city']; ?></td>
<td><?php echo $lang->I18N('City'); ?></td><td><?php echo $ClientInfo['client_city']; ?></td>
</tr>
<tr>
<td><b>Postal Code</b></td><td><?php echo $ClientInfo['client_pcode']; ?></td>
<td>Postal Code</td><td><?php echo $ClientInfo['client_pcode']; ?></td>
</tr>
<tr>
<td><b><?php echo $lang->I18N('Hosting Accounts'); ?></b></td><td><?php echo $count_account; ?></td>
<td><?php echo $lang->I18N('Hosting Accounts'); ?></td>
<td><a href="<?php echo setURL('admin/accounts', '', array('action' => 'list', 'client_id' => $ClientInfo['client_id'])); ?>"><?php echo $count_account; ?></a></td>
</tr>
<tr>
<td><b><?php echo $lang->I18N('SSL Certificates'); ?></b></td><td><?php echo $count_ssl; ?></td>
<td><?php echo $lang->I18N('SSL Certificates'); ?></td>
<td><a href="<?php echo setURL('admin/ssl', '', array('action' => 'list', 'client_id' => $ClientInfo['client_id'])); ?>"><?php echo $count_ssl; ?></a></td>
</tr>
<tr>
<td><b>Support Tickets</b></td><td><?php echo $count_tickets; ?></td>
<td>Support Tickets</td>
<td><a href="<?php echo setURL('admin/tickets', '', array('action' => 'list', 'client_id' => $ClientInfo['client_id'])); ?>"><?php echo $count_tickets; ?></a></td>
</tr>
</table>
</div>

View file

@ -27,7 +27,9 @@
<?php if ($count > 0): ?>
<?php foreach ($rows as $value): ?>
<tr>
<td><?php echo $value['client_id']; ?></td>
<td>
<a href="clients.php?action=details&id=<?php echo $value['client_id']; ?>"><?php echo $value['client_id']; ?></a>
</td>
<td><?php echo $value['client_fname'] . " " . $value['client_lname']; ?></td>
<td><?php echo $value['client_email']; ?></td>
<td><?php echo $value['client_phone']; ?></td>

View file

@ -1,4 +1,13 @@
<?php
if (!defined('IN_CRONLITE')) {
exit;
}
require ROOT_ADMIN . '/views/header.php';
require ROOT_ADMIN . '/views/navbar.php';
require ROOT_ADMIN . '/views/sidebar.php';
?>
<div class="content-wrapper">
<div class="row">
<div class="col-lg-3 col-md-6">
@ -10,7 +19,7 @@
</div>
<div class="col-xs-9 text-right">
<div class="huge">
<span id="count_client"><?php echo $count_client; ?></span>/<span class="count-all" id="count_clients"><?php echo $count_clients; ?></span>
<span id="count_client"></span>/<span class="count-all" id="count_clients"></span>
</div>
<div>客户数量</div>
</div>
@ -34,7 +43,7 @@
</div>
<div class="col-xs-9 text-right">
<div class="huge">
<span id="count_account"><?php echo $count_account; ?></span>/<span class="count-all" id="count_accounts"><?php echo $count_accounts; ?></span>
<span id="count_account"></span>/<span class="count-all" id="count_accounts"></span>
</div>
<div>账户数量</div>
</div>
@ -58,7 +67,7 @@
</div>
<div class="col-xs-9 text-right">
<div class="huge">
<span id="count_ticket"><?php echo $count_ticket; ?></span>/<span class="count-all" id="count_tickets"><?php echo $count_tickets; ?></span>
<span id="count_ticket"></span>/<span class="count-all" id="count_tickets"></span>
</div>
<div>工单数量</div>
</div>
@ -82,7 +91,7 @@
</div>
<div class="col-xs-9 text-right">
<div class="huge">
<span id="count_ssl"><?php echo $count_ssl; ?></span>/<span class="count-all" id="count_ssls"><?php echo $count_ssls; ?></span>
<span id="count_ssl"></span>/<span class="count-all" id="count_ssls"></span>
</div>
<div>证书数量</div>
</div>
@ -143,4 +152,42 @@
</div>
</div>
</div>
</div>
</div>
<?php
require ROOT_ADMIN . '/views/footer.php';
?>
<script>
$(document).ready(function() {
$.ajax({
type: "GET",
url: "api/dashboard.php?act=stat",
dataType: 'json',
async: true,
success: function(res) {
var data = res.data;
$('#count_client').html(data.count_client);
$('#count_clients').html(data.count_clients);
$('#count_account').html(data.count_account);
$('#count_accounts').html(data.count_accounts);
$('#count_ssl').html(data.count_ssl);
$('#count_ssls').html(data.count_ssls);
$('#count_ticket').html(data.count_ticket);
$('#count_tickets').html(data.count_tickets);
}
});
// check update
// $.ajax({
// url: '<?php // echo $checkupdate ?>',
// type: 'get',
// dataType: 'jsonp',
// jsonpCallback: 'callback'
// }).done(function(data){
// $("#checkupdate").html(data.msg);
// });
});
</script>
</body>
</html>

View file

@ -2,6 +2,13 @@
if (!defined('IN_CRONLITE')) {
exit;
}
$PageInfo['rel'] = '<link href="' . $site_url . '/assets/css/bootstrap-table.css" rel="stylesheet" />';
require ROOT_ADMIN . '/views/header.php';
require ROOT_ADMIN . '/views/navbar.php';
require ROOT_ADMIN . '/views/sidebar.php';
?>
<div class="content-wrapper">
@ -9,47 +16,100 @@ if (!defined('IN_CRONLITE')) {
<li><a href="index.php"><?php echo $lang->I18N('Dashboard'); ?></a></li>
<li class="active"><?php echo $lang->I18N('Emails List'); ?></li>
</ol>
<div class="panel panel-default">
<div class="panel-heading">
<div class="pull-right">
<a href="emails.php?action=add" class="btn btn-primary btn-xs">
<i class="fa fa-plus"></i> <?php echo $lang->I18N('add'); ?>
</a>
<div id="searchToolbar">
<form onsubmit="return searchSubmit()" method="GET" class="form-inline">
<input type="hidden" name="did">
<div class="form-group">
<label>搜索</label>
<input type="text" class="form-control" name="email_id" placeholder="邮件ID" style="width: 80px;" />
</div>
<span class="panel-title"><?php echo $PageInfo['title']; ?></span>
</div>
<div class="table-responsive">
<table class="table table-stripped table-bordered table-hover">
<thead>
<th width="100">ID</th>
<th><?php echo $lang->I18N('Client'); ?></th>
<th><?php echo $lang->I18N('Title'); ?></th>
<th><?php echo $lang->I18N('Status'); ?></th>
<th style="width: 160px;"><?php echo $lang->I18N('Date'); ?></th>
<th style="width: 100px;"><?php echo $lang->I18N('Action'); ?></th>
</thead>
<tbody>
<?php if ($count > 0): ?>
<?php foreach ($rows as $value): ?>
<tr>
<td><?php echo $value['email_id']; ?></td>
<td><?php echo $value['email_client_id']; ?></td>
<td><?php echo $value["email_subject"]; ?></td>
<td><?php echo $status_types[$value['email_read']]; ?></td>
<td><?php echo $value["email_date"]; ?></td>
<td>
<a href="emails.php?action=view&id=<?php echo $value['email_id']; ?>" class="btn btn-primary btn-xs"><i class="fa fa-info-circle"></i> <?php echo $lang->I18N('details'); ?></a>
</td>
</tr>
<?php endforeach;?>
<?php else: ?>
<tr>
<td colspan="5" class="text-center">Nothing found</td>
</tr>
<?php endif;?>
</tbody>
</table>
</div>
<div class="panel-footer"><?php echo $count; ?> Records Found, Page 1 of 1</div>
<div class="form-group">
<input type="text" class="form-control" name="email_client_id" placeholder="客户ID" style="width: 80px;" />
</div>
<div class="form-group">
<input type="text" class="form-control" name="email_to" placeholder="接收人" style="width: 120px;" />
</div>
<div class="form-group">
<input type="text" class="form-control" name="email_subject" placeholder="主题">
</div>
<div class="form-group">
<button class="btn btn-primary" type="submit"><i class="fa fa-search"></i> 搜索</button>&nbsp;
<a href="javascript:searchClear()" class="btn btn-default" title="刷新记录列表"><i class="fa fa-repeat"></i> 重置</a>&nbsp;
</div>
</form>
</div>
<table id="listTable"></table>
</div>
<?php
require ROOT_ADMIN . '/views/footer.php';
?>
<script src="<?php echo $site_cdnpublic; ?>bootstrap-table/1.20.2/bootstrap-table.min.js"></script>
<script src="<?php echo $site_cdnpublic; ?>bootstrap-table/1.20.2/extensions/page-jump-to/bootstrap-table-page-jump-to.min.js"></script>
<script src="<?php echo $site_url; ?>/assets/js/custom.js"></script>
<script>
$(document).ready(function() {
updateToolbar();
const defaultPageSize = 15;
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
$("#listTable").bootstrapTable({
url: 'api/emails.php?act=list',
pageNumber: pageNumber,
pageSize: pageSize,
classes: 'table table-striped table-hover table-bordered',
columns: [{
field: 'email_id',
title: '<?php echo $lang->I18N('Email ID'); ?>',
formatter: function(value, row, index) {
return '<a href="emails.php?action=view&id=' + value + '">' + value + '</a>';
}
},
{
field: 'email_client_id',
title: '<?php echo $lang->I18N('Clients'); ?>',
formatter: function(value, row, index) {
if (value > 0) {
return '<a href="clients.php?action=details&id=' + value + '">' + value + '</a>';
}
return '-';
}
},
{
field: 'email_subject',
title: '<?php echo $lang->I18N('Title'); ?>'
},
{
field: 'email_to',
title: '接收人',
formatter: function(value, row, index) {
return value || '-';
}
},
{
field: 'email_date',
title: '<?php echo $lang->I18N('Date'); ?>'
},
{
field: 'email_read',
title: '<?php echo $lang->I18N('Status'); ?>',
formatter: function(value, row, index) {
return value == 0 ? '<span class="label label-success">已查看</span>' : '<span class="label label-default">未查看</span>';
}
},
{
field: '',
title: '<?php echo $lang->I18N('Action'); ?>',
formatter: function(value, row, index) {
return '<a href="emails.php?action=view&id=' + row.email_id + '" class="btn btn-primary btn-xs"><i class="fa fa-info-circle"></i> <?php echo $lang->I18N('details'); ?></a>';
}
}
]
})
});
</script>
</body>
</html>

View file

@ -2,9 +2,12 @@
if (!defined('IN_CRONLITE')) {
exit;
}
require ROOT_ADMIN . '/views/header.php';
require ROOT_ADMIN . '/views/navbar.php';
require ROOT_ADMIN . '/views/sidebar.php';
?>
<div class="content-wrapper">
<ol class="breadcrumb page-breadcrumb">
<li><a href="index.php"><?php echo $lang->I18N('Dashboard'); ?></a></li>
@ -15,7 +18,7 @@ if (!defined('IN_CRONLITE')) {
<div class="panel panel-default">
<div class="panel-heading">
<div class="pull-right">
<a href="<?php echo setURL('admin/emails', '', array('action' => 'view', 'client_id' => $data['email_client_id'])); ?>" class="btn btn-success btn-xs">
<a href="<?php echo setURL('admin/emails', '', array('action' => 'list', 'email_client_id' => $data['email_client_id'])); ?>" class="btn btn-success btn-xs">
<i class="fa fa-edit"></i> <?php echo $lang->I18N('Client More'); ?>
</a>
<a href="emails.php?action=list" class="btn btn-primary btn-xs">
@ -37,3 +40,10 @@ if (!defined('IN_CRONLITE')) {
</div>
</div>
</div>
<?php
require ROOT_ADMIN . '/views/footer.php';
?>
</body>
</html>

View file

@ -3,24 +3,22 @@
</div><!-- row page-wrapper end -->
</div><!-- container-fluid end -->
<div id="hidden-area"><?php getMessage(); ?></div>
<div id="hidden-area"><?php getMessage(); ?></div>
<script src="<?php echo $site_url; ?>/assets/jquery/jquery.min.js"></script>
<script src="<?php echo $site_url; ?>/assets/bootstrap/js/bootstrap.min.js?_=<?php echo $static_release; ?>"></script>
<script src="<?php echo $site_url; ?>/assets/layer/layer.js"></script>
<script src="<?php echo $site_url; ?>/assets/js/common.js"></script>
<script src="<?php echo $site_cdnpublic; ?>jquery/1.12.4/jquery.min.js"></script>
<script src="<?php echo $site_cdnpublic; ?>twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="<?php echo $site_url; ?>/assets/layer/layer.js"></script>
<script src="<?php echo $site_url; ?>/assets/js/common.js?_=<?php echo $static_release; ?>"></script>
<script src="<?php echo $site_url; ?>/assets/js/admin.js?_=<?php echo $static_release; ?>"></script>
<?php if (!empty($load_editor)): ?>
<?php if (!empty($load_editor)): ?>
<script src="<?php echo $site_url; ?>/assets/nicedit/nicedit.js"></script>
<script type="text/javascript">
bkLib.onDomLoaded(function(){
new nicEditor({
iconsPath : '<?php echo $site_url; ?>/assets/nicedit/nicEditorIcons.gif'
}).panelInstance('content');
});
</script>
<?php endif; ?>
</body>
</html>
<script src="<?php echo $site_url; ?>/assets/nicedit/nicedit.js"></script>
<script type="text/javascript">
bkLib.onDomLoaded(function(){
new nicEditor({
iconsPath : '<?php echo $site_url; ?>/assets/nicedit/nicEditorIcons.gif'
}).panelInstance('content');
});
</script>
<?php endif; ?>

View file

@ -13,24 +13,26 @@
<meta name="keywords" content="<?php echo $page_keywords; ?>" />
<meta name="author" content="UIISC" />
<meta name="copyright" content="® CROGRAM" />
<!-- Site info -->
<title><?php echo $PageInfo['title']; ?> - <?php echo $lang->I18N('AdminArea'); ?> - <?php echo $SiteConfig['site_name']; ?></title>
<link rel="icon" type="image/x-icon" href="<?php echo $site_url; ?>/assets/image/favicon.ico">
<link rel="shortcut" type="image/x-icon" href="<?php echo $site_url; ?>/assets/image/favicon.ico">
<link href="<?php echo $site_url; ?>/assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<link href="<?php echo $site_url; ?>/assets/css/font-awesome.min.css" rel="stylesheet" />
<!-- Style -->
<link href="<?php echo $site_cdnpublic; ?>twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<link href="<?php echo $site_cdnpublic; ?>font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" />
<link href="<?php echo $site_url; ?>/assets/theme.switcher/css/auto.css" id="theme" type="text/css" rel="stylesheet" media="screen,projection" />
<link href="<?php echo $site_url; ?>/assets/css/common.css?_=<?php echo $static_release; ?>" rel="stylesheet" />
<link href="<?php echo $site_url; ?>/assets/css/admin.css" rel="stylesheet" />
<link href="<?php echo $site_url; ?>/assets/css/admin.css?_=<?php echo $static_release; ?>" rel="stylesheet" />
<!-- Common JS -->
<script type="text/javascript">
var site_domain = "<?php echo $site_domain; ?>";
var cur_lang = "<?php echo $lang->language_current; ?>";
var ifastnet_aff = "<?php echo $ifastnet_aff; ?>";
</script>
<script src="<?php echo $site_url; ?>/assets/theme.switcher/theme.switcher.js" type="text/javascript"></script>
<!-- Custom JS -->
<?php echo $PageInfo['rel']; ?>
<script src="<?php echo $site_url; ?>/assets/theme.switcher/theme.switcher.js" type="text/javascript"></script>
</head>
<body>

View file

@ -31,7 +31,7 @@
</div>
</div>
<script src="<?php echo $site_url; ?>/assets/jquery/jquery.min.js"></script>
<script src="<?php echo $site_cdnpublic; ?>jquery/1.12.4/jquery.min.js"></script>
<script src="<?php echo $site_url; ?>/assets/bootstrap/js/bootstrap.min.js?_=<?php echo $static_release; ?>"></script>
<script src="<?php echo $site_url; ?>/assets/js/common.js"></script>

View file

@ -13,11 +13,6 @@
<li><a href="<?php echo setURL('about');?>" target="_blank"><?php echo $lang->I18N('about'); ?></a></li>
<li>
<a href="#" aria-hidden="true"><i id="theme-selector"></i></a>
<script type="text/javascript">
var sel = document.getElementById('theme-selector');
sel.className = getThemeClasses(getTheme());
sel.onclick = themeSelectorClicked;
</script>
</li>
<li class="dropup">
<div class="dropdown-toggle" id="changelanguage" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">
@ -32,9 +27,9 @@
</footer>
<div id="hidden-area"><?php getMessage(); ?></div>
<script src="<?php echo $site_url; ?>/assets/jquery/jquery.min.js"></script>
<script src="<?php echo $site_url; ?>/assets/bootstrap/js/bootstrap.min.js?_=<?php echo $static_release; ?>"></script>
<script src="<?php echo $site_cdnpublic; ?>/jquery/1.12.4/jquery.min.js"></script>
<script src="<?php echo $site_cdnpublic; ?>/twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="<?php echo $site_url; ?>/assets/layer/layer.js"></script>
<script src="<?php echo $site_url; ?>/assets/js/common.js"></script>
<script src="<?php echo $site_url; ?>/assets/js/common.js?_=<?php echo $static_release; ?>"></script>
</body>
</html>

View file

@ -18,8 +18,8 @@
<link rel="icon" type="image/x-icon" href="<?php echo $site_url; ?>/assets/image/favicon.ico">
<link rel="shortcut" type="image/x-icon" href="<?php echo $site_url; ?>/assets/image/favicon.ico">
<link href="<?php echo $site_url; ?>/assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<link href="<?php echo $site_url; ?>/assets/css/font-awesome.min.css" rel="stylesheet" />
<link href="<?php echo $site_cdnpublic; ?>/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<link href="<?php echo $site_cdnpublic; ?>/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" />
<link href="<?php echo $site_url; ?>/assets/theme.switcher/css/auto.css" id="theme" type="text/css" rel="stylesheet" media="screen,projection" />
<link href="<?php echo $site_url; ?>/assets/css/common.css?_=<?php echo $static_release; ?>" rel="stylesheet" />
<!-- <link href="<?php echo $site_url; ?>/assets/css/admin.css" rel="stylesheet" /> -->

View file

@ -55,49 +55,12 @@
</li>
<li>
<a href="#" aria-hidden="true"><i id="theme-selector"></i></a>
<script type="text/javascript">
var sel = document.getElementById('theme-selector');
sel.className = getThemeClasses(getTheme());
sel.onclick = themeSelectorClicked;
</script>
</li>
</ul>
</div>
</div>
</nav>
</div>
<script>
function logout() {
layer.confirm('确定退出登录 ', {
icon: 3,
btn: ['确定', '取消']
}, function() {
var ii = layer.load(2);
$.ajax({
type: 'POST',
url: 'api/logout.php',
dataType: 'json',
success: function(data) {
layer.close(ii);
if (data.code == 0) {
layer.msg('退出登录成功');
setTimeout(function() {
window.location.href = 'login.php';
}, 2000);
} else {
layer.alert(data.msg, {
icon: 2
});
}
},
error: function(data) {
layer.close(ii);
layer.msg('服务器错误');
}
});
});
}
</script>
<div class="container-fluid">
<div class="row page-wrapper">

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

7
src/assets/css/bootstrap-table.css vendored Normal file

File diff suppressed because one or more lines are too long

View file

@ -31,6 +31,7 @@ button {
.breadcrumb {
border: 1px solid #ddd;
margin-bottom: 10px;
}
.page-wrapper {

View file

Before

Width:  |  Height:  |  Size: 730 KiB

After

Width:  |  Height:  |  Size: 730 KiB

View file

Before

Width:  |  Height:  |  Size: 141 KiB

After

Width:  |  Height:  |  Size: 141 KiB

View file

Before

Width:  |  Height:  |  Size: 898 KiB

After

Width:  |  Height:  |  Size: 898 KiB

31
src/assets/js/admin.js Executable file
View file

@ -0,0 +1,31 @@
// admin
function logout() {
layer.confirm('确定退出登录 ', {
icon: 3,
btn: ['确定', '取消']
}, function() {
var ii = layer.load(2);
$.ajax({
type: 'POST',
url: 'api/logout.php',
dataType: 'json',
success: function(data) {
layer.close(ii);
if (data.code == 0) {
layer.msg('退出登录成功');
setTimeout(function() {
window.location.href = 'login.php';
}, 2000);
} else {
layer.alert(data.msg, {
icon: 2
});
}
},
error: function(data) {
layer.close(ii);
layer.msg('服务器错误');
}
});
});
}

View file

@ -1,3 +1,5 @@
themeSelectorInit('theme-selector');
$(".language-change-click").click(function (x) {
// console.log('language-change-click');
change_language(x.target.dataset.language);

133
src/assets/js/custom.js Normal file
View file

@ -0,0 +1,133 @@
var location_url = window.location.href;
var parameter_str = location_url.split('?')[1];
if (parameter_str !== undefined) {
parameter_str = parameter_str.split('#')[0];
var $_GET = {};
var parameter_arr = parameter_str.split('&');
var tmp_arr;
for (var i = 0, len = parameter_arr.length; i <= len - 1; i++) {
tmp_arr = parameter_arr[i].split('=');
$_GET[tmp_arr[0]] = decodeURIComponent(tmp_arr[1]);
}
window.$_GET = $_GET;
} else {
window.$_GET = [];
}
function searchSubmit(){
$('#listTable').bootstrapTable('refresh');
return false;
}
function searchClear(){
$('#searchToolbar').find('input[name]').each(function() {
$(this).val('');
});
$('#searchToolbar').find('select[name]').each(function() {
$(this).find('option:first').prop("selected", 'selected');
});
$('#listTable').bootstrapTable('refresh');
}
function updateToolbar(){
$('#searchToolbar').find(':input[name]').each(function() {
var name = $(this).attr('name');
if(typeof window.$_GET[name] != 'undefined')
$(this).val(window.$_GET[name]);
})
}
function updateQueryStr(obj){
var arr = [];
for (var p in obj){
if (obj.hasOwnProperty(p) && typeof obj[p] != 'undefined' && obj[p] != '') {
arr.push(p + "=" + encodeURIComponent(obj[p]));
}
}
history.replaceState({}, null, '?'+arr.join("&"));
}
if (typeof $.fn.bootstrapTable !== "undefined") {
$.fn.bootstrapTable.custom = {
method: 'post',
contentType: "application/x-www-form-urlencoded",
sortable: true,
pagination: true,
sidePagination: 'server',
pageNumber: 1,
pageSize: 15,
pageList: [10, 15, 20, 30, 50, 100],
loadingFontSize: '18px',
toolbar: '#searchToolbar',
showColumns: true,
minimumCountColumns: 2,
showToggle: true,
showFullscreen: true,
paginationPreText: '前页',
paginationNextText: '后页',
showJumpTo: true,
paginationLoop: false,
queryParamsType: '',
queryParams: function(params) {
$('#searchToolbar').find(':input[name]').each(function() {
params[$(this).attr('name')] = $(this).val()
})
updateQueryStr(params);
params.offset = params.pageSize * (params.pageNumber-1);
params.limit = params.pageSize;
return params;
},
formatLoadingMessage: function(){
return '加载中';
},
formatShowingRows: function(t,n,r,e){
return '当前第 '+t+' 至 '+n+' 条, 总共 <b>'+r+'</b> 条';
},
formatRecordsPerPage: function(t){
return '每页显示 '+t+' 条';
},
formatNoMatches: function(){
return '没有找到匹配的记录';
}
};
$.extend($.fn.bootstrapTable.defaults, $.fn.bootstrapTable.custom);
}
function httpGet(url, callback){
$.ajax({
url: url,
type: 'get',
dataType: 'json',
success: function (res) {
callback(res)
},
error: function () {
if (typeof layer !== "undefined") {
layer.closeAll();
layer.msg('服务器错误');
}
}
});
}
function httpPost(url, data, callback){
$.ajax({
url: url,
type: 'post',
data: data,
dataType: 'json',
success: function (res) {
callback(res)
},
error: function () {
if (typeof layer !== "undefined") {
layer.closeAll();
layer.msg('服务器错误');
}
}
});
}
var isMobile = function(){
if( /Android|SymbianOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini|Windows Phone|Midp/i.test(navigator.userAgent)) {
return true;
}
return false;
}

View file

@ -1,6 +1,12 @@
// theme Selector Switcher
linkLoader(getTheme());
function themeSelectorInit(eleId) {
var sel = document.getElementById(eleId);
sel.className = getThemeClasses(getTheme());
sel.onclick = themeSelectorClicked;
}
function themeSelectorClicked() {
var next = nextTheme(getTheme());
linkLoader(next);

View file

Before

Width:  |  Height:  |  Size: 106 KiB

After

Width:  |  Height:  |  Size: 106 KiB

View file

@ -4,7 +4,7 @@
<div id="hidden-area"><?php getMessage(); ?></div>
<script src="<?php echo $site_url; ?>/assets/jquery/jquery.min.js"></script>
<script src="<?php echo $site_cdnpublic; ?>jquery/1.12.4/jquery.min.js"></script>
<script src="<?php echo $site_url; ?>/assets/js/halfmoon.min.js"></script>
<script src="<?php echo $site_url; ?>/assets/js/common.js"></script>
</body>

View file

@ -21,7 +21,7 @@
<?php echo $PageInfo['rel']; ?>
<link href="<?php echo $site_url; ?>/assets/css/halfmoon.min.css" rel="stylesheet" />
<link href="<?php echo $site_url; ?>/assets/css/font-awesome.min.css" rel="stylesheet" />
<link href="<?php echo $site_cdnpublic; ?>font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" />
<link href="<?php echo $site_url; ?>/assets/css/style.css" rel="stylesheet" />
<script type="text/javascript">
var site_domain = "<?php echo $site_domain; ?>";

View file

@ -1,8 +1,8 @@
<?php
// ini_set('display_errors', 'On');
// error_reporting(E_ALL);
// error_reporting(-1);
ini_set('display_errors', 'On');
error_reporting(E_ALL);
error_reporting(-1);
if (defined('IN_CRONLITE')) {
exit('Access Denied');
@ -63,7 +63,7 @@ if (isset($_SERVER['PATH_INFO'])) {
}
define('SITE_DOMAIN', $site_domain);
define('SITEURL', $site_url);
define('SITE_URL', $site_url);
include_once ROOT . '/data/config.php';
include_once __DIR__ . '/library/functions.php';
@ -91,7 +91,11 @@ if ($DB->query("SELECT * FROM `pre_admin` WHERE 1") == false) {
exit();
}
$PageInfo = array('title' => 'UIISC', 'rel' => '');
$PageInfo = array(
'title' => 'UIISC',
'rel' => '',
'body_before' => ''
);
// $CACHE = new \lib\Cache();
// $conf = $CACHE->pre_fetch();
@ -118,15 +122,17 @@ if (!file_exists(ROOT . '/data/install.lock') && file_exists(ROOT . '/install/in
}
// if ($conf['cdnpublic'] == 1) {
// $cdnpublic = '//lib.baomitu.com/';
// $site_cdnpublic = '//lib.baomitu.com/';
// } elseif ($conf['cdnpublic'] == 2) {
// $cdnpublic = 'https://cdn.bootcdn.net/ajax/libs/';
// $site_cdnpublic = 'https://cdn.bootcdn.net/ajax/libs/';
// } elseif ($conf['cdnpublic'] == 4) {
// $cdnpublic = '//s1.pstatp.com/cdn/expire-1-M/';
// $site_cdnpublic = '//s1.pstatp.com/cdn/expire-1-M/';
// } else {
// $cdnpublic = '//cdn.staticfile.org/';
// $site_cdnpublic = '//cdn.staticfile.org/';
// }
$site_cdnpublic = $site_url . '/assets/';
$SiteConfig = $DB->find('config', '*', array('site_key' => 'UIISC'));
$page_title = $SiteConfig['site_brand'];

View file

@ -384,7 +384,7 @@ function setRouter($module, $section = '', $param = array(), $anchor = '')
*/
function setURL($module, $section = '', $param = array(), $anchor = '')
{
return SITEURL . '/' . setRouter($module, $section, $param, $anchor);
return SITE_URL . '/' . setRouter($module, $section, $param, $anchor);
}
/** Determine if a variable is an email address
@ -427,7 +427,7 @@ function logout()
function email_build_body($title, $nickname, $content, $description = '')
{
return '<div class="container" style="margin:20px 5px;font-family: Arial, Helvetica, sans-serif;">
return '<div style="margin:20px 5px;font-family: Arial, Helvetica, sans-serif;">
<h2 style="text-align:center;"><b>' . $title . '</b></h2>
<hr />
<h3>Dear ' . $nickname . ',</h3>
@ -440,7 +440,7 @@ function email_build_body($title, $nickname, $content, $description = '')
<hr />
<div style="text-align:center;">
<p>Need our help ?</p>
<p><a href="' . setURL('clientarea/tickets', '', array('action' => 'add')) . '">We are here to help you out !</a></p>
<p><a href="' . setURL('clientarea/tickets', '', array('action' => 'add')) . '" target="_blank">We are here to help you out !</a></p>
<p><b>UIISC</b></p>
</div>
</div>';

View file

@ -16,11 +16,11 @@ if (!defined('IN_CRONLITE')) {
<link rel="icon" href="../assets/image/favicon.ico">
<title><?php echo $PageInfo['title']; ?> - UIISC Installation</title>
<link href="../assets/bootstrap/css/bootstrap.min.css" rel="stylesheet" />
<link href="../assets/css/font-awesome.min.css" rel="stylesheet" />
<link href="../assets/twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<link href="../assets/font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" />
<link href="../assets/css/common.css" rel="stylesheet" />
<link href="assets/css/style.css" rel="stylesheet" />
<script src="../assets/js/jquery.js"></script>
<script src="../assets/jquery/1.12.4/js/jquery.js"></script>
</head>
<body>

View file

@ -9,7 +9,7 @@ if (!defined('IN_CRONLITE')) {
<div class="navbar-inner navbar-content-center" style="padding-top:15px;">
<ul class="navbar-left list-inline text-center text-muted credit">
<li>
<span class="co">&copy;&nbsp;<?php echo $SiteConfig['site_build_year']; ?>-<?php echo date("Y"); ?>&nbsp;<a href="<?php echo SITEURL;?>"><?php echo $SiteConfig['site_brand']; ?></a>&nbsp;</span>
<span class="co">&copy;&nbsp;<?php echo $SiteConfig['site_build_year']; ?>-<?php echo date("Y"); ?>&nbsp;<a href="<?php echo SITE_URL;?>"><?php echo $SiteConfig['site_brand']; ?></a>&nbsp;</span>
<span class="co">&nbsp;Powered by <a href="https://uiisc.org" target="_blank">UIISC</a>&nbsp;</span>
<span class="co">&nbsp;Partnered with <a href="https://ifastnet.com/" name="jump-ifastnet" target="_blank">iFastNet</a>&nbsp;</span>
<span>time: <?php echo get_execution_time();?>s</span>
@ -30,8 +30,8 @@ if (!defined('IN_CRONLITE')) {
</div>
</div>
</footer>
<script src="assets/jquery/jquery.min.js?_=<?php echo $static_release; ?>"></script>
<script src="assets/bootstrap/js/bootstrap.min.js?_=<?php echo $static_release; ?>"></script>
<script src="<?php echo $site_cdnpublic; ?>jquery/1.12.4/jquery.min.js"></script>
<script src="<?php echo $site_cdnpublic; ?>twitter-bootstrap/3.3.7/js/bootstrap.min.js"></script>
<script src="assets/js/common.js?_=<?php echo $static_release; ?>"></script>
<?php if (!empty($google_site_verification)) { include("google_analytics.php");} ?>

View file

@ -30,8 +30,9 @@ if (!defined('IN_CRONLITE')) {
<meta name="google-site-verification" content="<?php echo $google_site_verification; ?>" />
<?php endif; ?>
<link href="assets/image/favicon.ico?_=<?php echo $static_release; ?>" rel="icon" />
<link href="assets/bootstrap/css/bootstrap.min.css?_=<?php echo $static_release; ?>" rel="stylesheet" />
<link href="assets/css/font-awesome.min.css" rel="stylesheet" />
<link href="<?php echo $site_cdnpublic; ?>twitter-bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<link href="<?php echo $site_cdnpublic; ?>font-awesome/5.15.4/css/fontawesome.min.css" rel="stylesheet" />
<link href="<?php echo $site_url; ?>/assets/theme.switcher/css/auto.css" id="theme" type="text/css" rel="stylesheet" media="screen,projection" />
<link href="assets/css/common.css?_=<?php echo $static_release; ?>" rel="stylesheet" />
<!--[if lt IE 9]>

View file

@ -14,11 +14,11 @@ if (!defined('IN_CRONLITE')) {
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="<?php echo SITEURL;?>"><?php echo $SiteConfig['site_brand']; ?></a>
<a class="navbar-brand" href="<?php echo SITE_URL;?>"><?php echo $SiteConfig['site_brand']; ?></a>
</div>
<div id="navbar" class="navbar-collapse collapse">
<ul class="nav navbar-nav">
<li><a href="<?php echo SITEURL;?>"><?php echo $lang->I18N('home'); ?></a></li>
<li><a href="<?php echo SITE_URL;?>"><?php echo $lang->I18N('home'); ?></a></li>
<li><a href="<?php echo setURL('solution');?>"><?php echo $lang->I18N('solution'); ?></a></li>
<li><a href="<?php echo setURL('support');?>"><?php echo $lang->I18N('support'); ?></a></li>
<li class="dropdown">
@ -45,11 +45,6 @@ if (!defined('IN_CRONLITE')) {
<li><a href="<?php echo setURL('clientarea/index');?>"><?php echo $lang->I18N('clientarea'); ?></a></li>
<li>
<a href="#" aria-hidden="true"><i id="theme-selector"></i></a>
<script type="text/javascript">
var sel = document.getElementById('theme-selector');
sel.className = getThemeClasses(getTheme());
sel.onclick = themeSelectorClicked;
</script>
</li>
</ul>
</div>

View file

@ -52,23 +52,3 @@ if (!defined('IN_CRONLITE')) {
</div>
</div>
</div>
<!-- <script type="text/javascript">
$('.check-domain').click(function () {
var domain = $('#domainInput').val()
if (domain) {
$.ajax({
method: 'post',
url: 'https://api.croidc.cn/mofh/DomainCheck',
dataType: 'json',
contentType : "application/json",
data: JSON.stringify({
domain: domain
}),
success: function (x) {
console.log(x);
}
})
}
})
</script> -->