update: add hosting hostname
This commit is contained in:
parent
47cf5a7bfd
commit
c967c3e8ca
27 changed files with 410 additions and 58 deletions
|
@ -1,4 +1,13 @@
|
|||
<?php
|
||||
|
||||
require_once __DIR__ . '/../../core/application.php';
|
||||
// require_once ROOT . '/core/adminarea.php';
|
||||
|
||||
if (isset($_SESSION['UIISC_ADMIN'])) {
|
||||
$AdminInfo = $DB->find('admin', '*', array('admin_key' => base64_decode($_SESSION['UIISC_ADMIN'])), null, 1);
|
||||
if (!$AdminInfo) {
|
||||
unset($_SESSION['UIISC_ADMIN']);
|
||||
send_response(403, null, 'need login');
|
||||
}
|
||||
} else {
|
||||
send_response(403, null, 'need login');
|
||||
}
|
||||
|
|
71
src/admin/api/clients.php
Executable file
71
src/admin/api/clients.php
Executable file
|
@ -0,0 +1,71 @@
|
|||
<?php
|
||||
|
||||
require 'application.php';
|
||||
|
||||
@header('Content-Type: application/json; charset=UTF-8');
|
||||
if (!checkRefererHost()) exit('{"code":403}');
|
||||
|
||||
$act = get('act');
|
||||
|
||||
switch ($act) {
|
||||
case 'add':
|
||||
$form_data = array(
|
||||
'client_fname' => post('client_fname'),
|
||||
'client_lname' => post('client_lname'),
|
||||
'client_email' => post('client_email'),
|
||||
'client_phone' => post('client_phone'),
|
||||
'client_company' => post('client_company'),
|
||||
'client_address' => post('client_address'),
|
||||
'client_country' => post('client_country'),
|
||||
'client_city' => post('client_city'),
|
||||
'client_pcode' => post('client_pcode'),
|
||||
'client_state' => post('client_state'),
|
||||
'client_password'=> hash('sha256', post('client_password', '123456')),
|
||||
// 'client_key' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'), 0, 8),
|
||||
'client_key' => randstr(8),
|
||||
'client_status' => post('client_status', 0),
|
||||
'client_signup_ip' => get_client_ip(),
|
||||
'client_addtime' => date('Y-m-d H:i:s'),
|
||||
);
|
||||
|
||||
$client_id = $DB->insert('clients', $form_data);
|
||||
|
||||
if ($client_id) {
|
||||
send_response(200, array('client_id' => $client_id), 'success');
|
||||
} else {
|
||||
send_response(-1, $msg = 'error');
|
||||
}
|
||||
case 'edit':
|
||||
$client_id = post('client_id');
|
||||
$client_password = post('client_password', '');
|
||||
$form_data = array(
|
||||
'client_fname' => post('client_fname'),
|
||||
'client_lname' => post('client_lname'),
|
||||
'client_email' => post('client_email'),
|
||||
'client_phone' => post('client_phone'),
|
||||
'client_company' => post('client_company'),
|
||||
'client_address' => post('client_address'),
|
||||
'client_country' => post('client_country'),
|
||||
'client_city' => post('client_city'),
|
||||
'client_pcode' => post('client_pcode'),
|
||||
'client_state' => post('client_state'),
|
||||
// 'client_key' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'), 0, 8),
|
||||
'client_status' => post('client_status', 0),
|
||||
'client_updatetime' => date('Y-m-d H:i:s'),
|
||||
);
|
||||
|
||||
if ($client_password) {
|
||||
$form_data['client_password'] = hash('sha256', $client_password);
|
||||
}
|
||||
|
||||
$result = $DB->update('clients', $form_data, array('client_id' => $client_id));
|
||||
|
||||
if ($result) {
|
||||
send_response(200, array('client_id' => $client_id), 'success');
|
||||
} else {
|
||||
send_response(-1, $msg = 'error');
|
||||
}
|
||||
default:
|
||||
send_response(-4, $msg = 'No Act');
|
||||
break;
|
||||
}
|
|
@ -9,21 +9,34 @@ $act = get('act');
|
|||
|
||||
switch ($act) {
|
||||
case 'list':
|
||||
$count = $DB->count('account_hostname');
|
||||
$total = $DB->count('account_hostname');
|
||||
$list = array();
|
||||
if ($count > 0) {
|
||||
$total = intval($total);
|
||||
if ($total > 0) {
|
||||
$list = $DB->findAll('account_hostname', '*', array(), '`host_id` ASC');
|
||||
}
|
||||
exit(json_encode(['code' => 0, 'total' => $total, 'list' => $list]));
|
||||
send_response(200, array('total' => $total, 'list' => $list));
|
||||
break;
|
||||
case 'options':
|
||||
$api_id = get('api_id');
|
||||
if (!$api_id) {
|
||||
send_response(-1, array());
|
||||
}
|
||||
|
||||
$where = array(
|
||||
'api_id' => $api_id
|
||||
);
|
||||
$list = $DB->findAll('account_hostname', 'api_id,host_id,host_name', $where, '`host_id` ASC');
|
||||
send_response(200, $list);
|
||||
break;
|
||||
case 'add':
|
||||
$hostname = post('hostname');
|
||||
if (!$hostname) {
|
||||
exit(json_encode(['code' => -1, 'msg' => '主机名不能为空 !']));
|
||||
send_response(-1, null, '主机名不能为空 !');
|
||||
}
|
||||
$api_id = post('api_id');
|
||||
if (!$api_id) {
|
||||
exit(json_encode(['code' => -1, 'msg' => '托管服务提供商不能为空 !']));
|
||||
send_response(-1, null, '托管服务提供商不能为空 !');
|
||||
}
|
||||
|
||||
$domain = strtolower($hostname);
|
||||
|
@ -39,20 +52,20 @@ switch ($act) {
|
|||
|
||||
$has = $DB->count('account_hostname', $data);
|
||||
if ($has && $has > 0) {
|
||||
exit(json_encode(['code' => -1, 'msg' => 'Hostname aleady exsist !']));
|
||||
send_response(-1, null, 'Hostname aleady exsist !');
|
||||
} else {
|
||||
$result = $DB->insert('account_hostname', $data);
|
||||
if ($result) {
|
||||
exit(json_encode(['code' => 0, 'msg' => 'Hostname added successfully !']));
|
||||
send_response(0, null, 'Hostname added successfully !');
|
||||
} else {
|
||||
exit(json_encode(['code' => -1, 'msg' => 'Something went wrong !']));
|
||||
send_response(-1, null, 'Something went wrong !');
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'delete':
|
||||
$host_id = post('host_id');
|
||||
if (!$host_id) {
|
||||
exit(json_encode(['code' => -1, 'msg' => '主机ID不能为空 !']));
|
||||
send_response(-1, null, '主机ID不能为空 !');
|
||||
}
|
||||
$data = array(
|
||||
'host_id' => $host_id
|
||||
|
@ -60,16 +73,16 @@ switch ($act) {
|
|||
|
||||
$has = $DB->count('account_hostname', $data);
|
||||
if (!$has > 0) {
|
||||
exit(json_encode(['code' => -1, 'msg' => 'Hostname not found !']));
|
||||
send_response(-1, null, 'Hostname not found !');
|
||||
} else {
|
||||
$result = $DB->delete('account_hostname', $data);
|
||||
if ($result) {
|
||||
exit(json_encode(['code' => 0, 'msg' => 'Hostname deleted successfully !']));
|
||||
send_response(0, null, 'Hostname deleted successfully !');
|
||||
} else {
|
||||
exit(json_encode(['code' => -1, 'msg' => 'Something went wrong !']));
|
||||
send_response(-1, null, 'Something went wrong !');
|
||||
}
|
||||
}
|
||||
default:
|
||||
exit('{"code":-4,"msg":"No Act"}');
|
||||
send_response(-4, NULL, 'No Act');
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
require_once __DIR__ . '/application.php';
|
||||
require_once __DIR__ . '/../../core/application.php';
|
||||
|
||||
@header('Content-Type: application/json; charset=UTF-8');
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
<?php
|
||||
|
||||
require_once __DIR__ . '/application.php';
|
||||
require_once __DIR__ . '/../../core/application.php';
|
||||
|
||||
@header('Content-Type: application/json; charset=UTF-8');
|
||||
|
||||
|
|
0
src/admin/controllers/accounts/add.php
Normal file
0
src/admin/controllers/accounts/add.php
Normal file
|
@ -8,15 +8,15 @@ if (!$SSLInfo) {
|
|||
}
|
||||
|
||||
if ($SSLInfo['ssl_status'] == 'processing') {
|
||||
$Status = '<span class="badge bg-primary">Processing</span>';
|
||||
$Status = '<span class="label label-primary">Processing</span>';
|
||||
} elseif ($SSLInfo['ssl_status'] == 'active') {
|
||||
$Status = '<span class="badge bg-success">Active</span>';
|
||||
$Status = '<span class="label label-success">Active</span>';
|
||||
} elseif ($SSLInfo['ssl_status'] == 'incomplete') {
|
||||
$Status = '<span class="badge bg-danger">Incomplete</span>';
|
||||
$Status = '<span class="label label-info">Incomplete</span>';
|
||||
} elseif ($SSLInfo['ssl_status'] == 'cancelled') {
|
||||
$Status = '<span class="badge bg-">Cancelled</span>';
|
||||
$Status = '<span class="label label-warning">Cancelled</span>';
|
||||
} elseif ($SSLInfo['ssl_status'] == 'expired') {
|
||||
$Status = '<span class="badge bg-danger">Expired</span>';
|
||||
$Status = '<span class="label label-danger">Expired</span>';
|
||||
} else {
|
||||
$Status = '';
|
||||
}
|
||||
|
|
|
@ -25,15 +25,15 @@ if ($SSLApi['api_token'] && strtotime($SSLApi['api_token_expiretime']) - 180 >=
|
|||
$SSLInfo = $apiClient->getOrderStatus($SSLApi['ssl_key']);
|
||||
|
||||
if ($SSLInfo['status'] == 'processing') {
|
||||
$Status = '<span class="badge bg-primary">Processing</span>';
|
||||
$Status = '<span class="label label-primary">Processing</span>';
|
||||
} elseif ($SSLInfo['status'] == 'active') {
|
||||
$Status = '<span class="badge bg-success">Active</span>';
|
||||
$Status = '<span class="label label-success">Active</span>';
|
||||
} elseif ($SSLInfo['status'] == 'incomplete') {
|
||||
$Status = '<span class="badge bg-danger">Incomplete</span>';
|
||||
$Status = '<span class="label label-info">Incomplete</span>';
|
||||
} elseif ($SSLInfo['status'] == 'cancelled') {
|
||||
$Status = '<span class="badge bg-">Cancelled</span>';
|
||||
$Status = '<span class="label label-warning">Cancelled</span>';
|
||||
} elseif ($SSLInfo['status'] == 'expired') {
|
||||
$Status = '<span class="badge bg-danger">Expired</span>';
|
||||
$Status = '<span class="label label-danger">Expired</span>';
|
||||
} else {
|
||||
$Status = '';
|
||||
}
|
||||
|
|
104
src/admin/views/accounts/add.php
Executable file
104
src/admin/views/accounts/add.php
Executable file
|
@ -0,0 +1,104 @@
|
|||
<div class="content-wrapper">
|
||||
<div class="container">
|
||||
<ol class="breadcrumb page-breadcrumb">
|
||||
<li><a href="index.php"><?php echo $lang->I18N('Dashboard'); ?></a></li>
|
||||
<li><a href="accounts.php"><?php echo $lang->I18N('Account List'); ?></a></li>
|
||||
<li class="active"><?php echo $lang->I18N('add'); ?></li>
|
||||
</ol>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="pull-right">
|
||||
<a href="<?php echo setURL('admin/accounts', '', array('action' => 'list')); ?>" class="btn btn-info btn-xs">
|
||||
<i class="fa fa-list"></i> <?php echo $lang->I18N('list'); ?>
|
||||
</a>
|
||||
</div>
|
||||
<div class="panel-title">
|
||||
<?php echo $PageInfo['title']; ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Name</label>
|
||||
<input type="text" value="<?php echo $ClientInfo['client_fname'] . ' ' . $ClientInfo['client_lname']; ?>" class="form-control disabled" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Email</label>
|
||||
<input type="text" value="<?php echo $ClientInfo['client_email']; ?>" class="form-control disabled" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required"><?php echo $lang->I18N('Phone Number'); ?></label>
|
||||
<input type="text" value="<?php echo $ClientInfo['client_phone']; ?>" class="form-control disabled" readonly>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Billing Address</label>
|
||||
<input type="text" value="<?php echo $ClientInfo['client_address']; ?>" class="form-control disabled" readonly>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-12"><hr /></div>
|
||||
<?php if ($AccountInfo['account_status'] == '1'): ?>
|
||||
<form class="row" action="controllers/accounts/password.php" method="post">
|
||||
<input type="hidden" name="account_id" value="<?php echo $account_id; ?>">
|
||||
<div class="col-md-6">
|
||||
<div class="pb-10 px-10">
|
||||
<label class="form-label required">New Password</label>
|
||||
<input type="password" name="new_password" placeholder="New password here..." class="form-control">
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label"> </label>
|
||||
<button type="submit" name="submit" class="form-control btn btn-primary btn-sm text-white">Change Password</button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- <div class="col-md-12">
|
||||
<div class="mb-10 px-10">
|
||||
<input type="submit" name="submit" value="Change Password" class="btn btn-primary btn-sm text-white">
|
||||
</div>
|
||||
</div> -->
|
||||
</form>
|
||||
<hr>
|
||||
<form
|
||||
action="controllers/accounts/deactivate.php"
|
||||
method="post"
|
||||
onsubmit="
|
||||
var reason = document.getElementsByName('reason')[0].value;
|
||||
if (reason.length < 8) {
|
||||
alert('Reason must be 8 characters long...');
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label required">Deacivation Reason</label>
|
||||
<textarea name="reason" placeholder="Deactivation reason here..." class="form-control" id="reason"></textarea>
|
||||
<div class="text-muted my-10 alert alert-secondary">Your account will be deleted after 30 days of your account deactivation and all of the account data will be removed completely(This action cannot be undo).</div>
|
||||
<input type="hidden" name="account_id" value="<?php echo $AccountInfo['account_id']; ?>">
|
||||
</div>
|
||||
<div class="mb-10 px-10">
|
||||
<input type="submit" name="submit" value="Deactivate Account" class="btn btn-danger btn-sm text-white">
|
||||
</div>
|
||||
</form>
|
||||
<?php else: ?>
|
||||
<form class="row" action="controllers/accounts/reactivate.php" method="post">
|
||||
<input type="hidden" name="account_id" value="<?php echo $account_id; ?>">
|
||||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label">Activate Account</label>
|
||||
<button type="submit" name="submit" class="btn btn-success text-white btn-block my-5">Activate Account</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<?php endif;?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
|
@ -78,7 +78,7 @@
|
|||
<div class="col-md-4 col-sm-6">
|
||||
<div class="d-flex justify-content-between align-items-center">
|
||||
<b>Creation Date:</b>
|
||||
<span><?php echo $AccountInfo['account_date']; ?></span>
|
||||
<span><?php echo $AccountInfo['account_addtime']; ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-4 col-sm-6">
|
||||
|
|
|
@ -101,7 +101,7 @@
|
|||
<div class="col-md-6">
|
||||
<div class="mb-10 px-10">
|
||||
<label class="form-label">Activate Account</label>
|
||||
<button type="submit" name="submit" class="btn btn-success text-white btn-block my-5 btn-rounded">Activate Account</button>
|
||||
<button type="submit" name="submit" class="btn btn-success text-white btn-block my-5">Activate Account</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
|
|
@ -41,7 +41,7 @@
|
|||
</td>
|
||||
<td><?php echo $row['account_username']; ?></td>
|
||||
<td><?php echo $row['account_domain']; ?></td>
|
||||
<td><?php echo $row['account_date']; ?></td>
|
||||
<td><?php echo $row['account_addtime']; ?></td>
|
||||
<td><?php if ($row['account_status'] == '0'): ?>
|
||||
<span class="label label-info"><?php echo $lang->I18N('Inactive'); ?></span>
|
||||
<?php elseif ($row['account_status'] == '1'): ?>
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<ol class="breadcrumb page-breadcrumb">
|
||||
<li><a href="index.php"><?php echo $lang->I18N('Dashboard'); ?></a></li>
|
||||
<li><a href="clients.php"><?php echo $lang->I18N('Client List'); ?></a></li>
|
||||
<li class="active"><?php echo $lang->I18N('details'); ?></li>
|
||||
<li class="active"><?php echo $lang->I18N('add'); ?></li>
|
||||
</ol>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
|
@ -16,12 +16,100 @@
|
|||
<span class="panel-title"><?php echo $PageInfo['title']; ?></span>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
</div>
|
||||
<form id="form-client-add" class="row" onsubmit="return saveSubmit();" method="post">
|
||||
<div class="col-md-6 mb-10">
|
||||
<label class="form-label"><?php echo $lang->I18N('Status'); ?></label>
|
||||
<select class="form-control" name="client_status">
|
||||
<option value="0"><?php echo $lang->I18N('Inactive'); ?></option>
|
||||
<option value="1"><?php echo $lang->I18N('Active'); ?></option>
|
||||
<option value="2"><?php echo $lang->I18N('Suspended'); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6 mb-10">
|
||||
<label class="form-label"><?php echo $lang->I18N('Password'); ?></label>
|
||||
<input type="text" name="client_password" value="123456" class="form-control" placeholder="默认密码 123456">
|
||||
</div>
|
||||
<div class="col-md-6 mb-10">
|
||||
<label class="form-label required"><?php echo $lang->I18N('First Name'); ?></label>
|
||||
<input type="text" name="client_fname" value="" class="form-control" required>
|
||||
</div>
|
||||
<div class="col-md-6 mb-10">
|
||||
<label class="form-label required"><?php echo $lang->I18N('Last Name'); ?></label>
|
||||
<input type="text" name="client_lname" value="" class="form-control" required>
|
||||
</div>
|
||||
<div class="col-md-6 mb-10">
|
||||
<label class="form-label required"><?php echo $lang->I18N('Email Address'); ?></label>
|
||||
<input type="text" name="client_email" value="" class="form-control" required>
|
||||
</div>
|
||||
<div class="col-md-6 mb-10">
|
||||
<label class="form-label required"><?php echo $lang->I18N('Phone Number'); ?></label>
|
||||
<input type="text" name="client_phone" value="" class="form-control" required>
|
||||
</div>
|
||||
<div class="col-md-6 mb-10">
|
||||
<label class="form-label"><?php echo $lang->I18N('Billing Address'); ?></label>
|
||||
<input type="text" name="client_address" value="" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-6 mb-10">
|
||||
<label class="form-label"><?php echo $lang->I18N('Company'); ?></label>
|
||||
<input type="text" name="client_company" value="" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-6 mb-10">
|
||||
<label class="form-label"><?php echo $lang->I18N('Country'); ?></label>
|
||||
<input type="text" name="client_country" value="" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-6 mb-10">
|
||||
<label class="form-label"><?php echo $lang->I18N('State'); ?></label>
|
||||
<input type="text" name="client_state" value="" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-6 mb-10">
|
||||
<label class="form-label"><?php echo $lang->I18N('City'); ?></label>
|
||||
<input type="text" name="client_city" value="" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-6 mb-10">
|
||||
<label class="form-label"><?php echo $lang->I18N('Postal Code'); ?></label>
|
||||
<input type="text" name="client_pcode" value="" class="form-control">
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<a href="#" target="_blank" class="btn btn-primary btn-sm"><?php echo $lang->I18N('Save') ?></a>
|
||||
<button class="btn btn-primary btn-sm" onclick="saveSubmit();"><?php echo $lang->I18N('Save') ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function saveSubmit() {
|
||||
var ii = layer.load(2);
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'api/clients.php?act=add',
|
||||
data: $("#form-client-add").serialize(),
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
layer.close(ii);
|
||||
if (res.code == 200) {
|
||||
layer.alert(res.msg, {
|
||||
icon: 1,
|
||||
closeBtn: false
|
||||
}, function() {
|
||||
if (res.data.client_id) {
|
||||
window.location.href = 'clients.php?action=details&id=' + res.data.client_id;
|
||||
} else {
|
||||
window.location.href = 'clients.php';
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.alert(res.msg, {
|
||||
icon: 2
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function(res) {
|
||||
layer.close(ii);
|
||||
layer.msg('服务器错误');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -66,7 +66,7 @@
|
|||
</table>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<a href="clients.php?action=login&client_id=<?php echo $ClientInfo['client_id'] ?>" target="_blank" class="btn btn-primary btn-sm">
|
||||
<a href="clients.php?action=login&id=<?php echo $ClientInfo['client_id'] ?>" target="_blank" class="btn btn-primary btn-sm">
|
||||
<i class="fa fa-sign-in-alt"></i> Login as <?php echo $ClientInfo['client_fname'] ?>
|
||||
</a>
|
||||
<?php if ($ClientInfo['client_status'] !== '1'): ?>
|
||||
|
|
|
@ -26,8 +26,20 @@
|
|||
</span>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<form id="form-client-edit" class="row" onsubmit="return saveSubmit();" method="post">
|
||||
<div class="col-md-6 mb-10">
|
||||
<label class="form-label"><?php echo $lang->I18N('Status'); ?></label>
|
||||
<select class="form-control" name="client_status" default="<?php echo $ClientInfo['client_status']; ?>">
|
||||
<option value="0"><?php echo $lang->I18N('Inactive'); ?></option>
|
||||
<option value="1"><?php echo $lang->I18N('Active'); ?></option>
|
||||
<option value="2"><?php echo $lang->I18N('Suspended'); ?></option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-6 mb-10">
|
||||
<label class="form-label"><?php echo $lang->I18N('Password'); ?></label>
|
||||
<input type="text" name="client_password" value="" class="form-control" placeholder="留空白则不修改">
|
||||
</div>
|
||||
<div class="col-md-6 mb-10">
|
||||
<label class="form-label required"><?php echo $lang->I18N('First Name'); ?></label>
|
||||
<input type="text" name="client_fname" value="<?php echo $ClientInfo['client_fname']; ?>" class="form-control" required>
|
||||
</div>
|
||||
|
@ -55,6 +67,10 @@
|
|||
<label class="form-label required"><?php echo $lang->I18N('Country'); ?></label>
|
||||
<input type="text" name="country_name" value="<?php echo $CountryName; ?>" class="form-control" required>
|
||||
</div>
|
||||
<div class="col-md-6 mb-10">
|
||||
<label class="form-label"><?php echo $lang->I18N('State'); ?></label>
|
||||
<input type="text" name="client_state" value="<?php echo $ClientInfo['client_state']; ?>" class="form-control">
|
||||
</div>
|
||||
<div class="col-md-6 mb-10">
|
||||
<label class="form-label required"><?php echo $lang->I18N('City'); ?></label>
|
||||
<input type="text" name="client_city" value="<?php echo $ClientInfo['client_city']; ?>" class="form-control" required>
|
||||
|
@ -63,11 +79,47 @@
|
|||
<label class="form-label required"><?php echo $lang->I18N('Postal Code'); ?></label>
|
||||
<input type="text" name="client_pcode" value="<?php echo $ClientInfo['client_pcode']; ?>" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<a href="#" target="_blank" class="btn btn-primary btn-sm"><?php echo $lang->I18N('Save'); ?></a>
|
||||
<button class="btn btn-primary btn-sm" onclick="saveSubmit();"><?php echo $lang->I18N('Save') ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
function saveSubmit() {
|
||||
var ii = layer.load(2);
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: 'api/clients.php?act=edit',
|
||||
data: $("#form-client-edit").serialize(),
|
||||
dataType: 'json',
|
||||
success: function(res) {
|
||||
layer.close(ii);
|
||||
if (res.code == 200) {
|
||||
layer.alert(res.msg, {
|
||||
icon: 1,
|
||||
closeBtn: false
|
||||
}, function() {
|
||||
if (res.data.client_id) {
|
||||
window.location.href = 'clients.php?action=edit&id=' + res.data.client_id;
|
||||
} else {
|
||||
window.location.href = 'clients.php';
|
||||
}
|
||||
});
|
||||
} else {
|
||||
layer.alert(res.msg, {
|
||||
icon: 2
|
||||
});
|
||||
}
|
||||
},
|
||||
error: function(res) {
|
||||
layer.close(ii);
|
||||
layer.msg('服务器错误');
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
</script>
|
||||
|
|
|
@ -32,7 +32,7 @@
|
|||
<td><?php echo $value['client_fname'] . " " . $value['client_lname']; ?></td>
|
||||
<td><?php echo $value['client_email']; ?></td>
|
||||
<td><?php echo $value['client_phone']; ?></td>
|
||||
<td><?php echo $value['client_date']; ?></td>
|
||||
<td><?php echo $value['client_addtime']; ?></td>
|
||||
<td><?php if ($value['client_status'] == '0'): ?>
|
||||
<span class="label label-warning"><?php echo $lang->I18N('Inactive'); ?></span>
|
||||
<?php elseif ($value['client_status'] == '1'): ?>
|
||||
|
@ -45,12 +45,12 @@
|
|||
<a href="<?php echo setURL('admin/clients', '', array('action' => 'edit', 'id' => $value['client_id'])); ?>" class="btn btn-success btn-xs">
|
||||
<i class="fa fa-edit"></i> <?php echo $lang->I18N('edit'); ?>
|
||||
</a>
|
||||
<a href="clients.php?action=login&id=<?php echo $value['client_id'] ?>" target="_blank" class="btn btn-info btn-xs">
|
||||
<i class="fa fa-sign-in-alt"></i> <?php echo $lang->I18N('login'); ?>
|
||||
</a>
|
||||
<a href="<?php echo setURL('admin/clients', '', array('action' => 'details', 'id' => $value['client_id'])); ?>" class="btn btn-primary btn-xs">
|
||||
<i class="fa fa-info-circle"></i> <?php echo $lang->I18N('details'); ?>
|
||||
</a>
|
||||
<a href="clients.php?action=login&id=<?php echo $value['client_id'] ?>" target="_blank" class="btn btn-info btn-xs">
|
||||
<i class="fa fa-sign-in-alt"></i> <?php echo $lang->I18N('login'); ?>
|
||||
</a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
|
|
|
@ -51,7 +51,7 @@ if (!defined('IN_CRONLITE')) {
|
|||
</table>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<p class="pb-10"><?php echo $count; ?> Records Found</p>
|
||||
<div><?php echo $count; ?> Records Found</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
@ -13,7 +13,9 @@ if (!defined('IN_CRONLITE')) {
|
|||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<div class="pull-right">
|
||||
<a href="hosting-hostname.php?id=<?php echo $data['api_id']; ?>" class="btn btn-primary btn-xs"><i class="fa fa-info-circle"></i> <?php echo $lang->I18N('Hostname'); ?></a>
|
||||
<a href="hosting-hostname.php?id=<?php echo $data['api_id']; ?>" class="btn btn-info btn-xs">
|
||||
<i class="fa fa-ethernet"></i> <?php echo $lang->I18N('Hostname'); ?>
|
||||
</a>
|
||||
<a href="<?php echo setURL('admin/hosting-provider', '', array('action' => 'edit', 'id' => $data['api_id'])); ?>" class="btn btn-success btn-xs">
|
||||
<i class="fa fa-edit"></i> <?php echo $lang->I18N('edit'); ?>
|
||||
</a>
|
||||
|
|
|
@ -21,6 +21,7 @@ if (!defined('IN_CRONLITE')) {
|
|||
<div class="table-responsive">
|
||||
<table class="table table-stripped table-bordered table-hover">
|
||||
<thead>
|
||||
<th>ID</th>
|
||||
<th>Key</th>
|
||||
<th><?php echo $lang->I18N('Type'); ?></th>
|
||||
<th>Panel URL</th>
|
||||
|
@ -31,6 +32,7 @@ if (!defined('IN_CRONLITE')) {
|
|||
<?php if ($count > 0): ?>
|
||||
<?php foreach ($rows as $value): ?>
|
||||
<tr>
|
||||
<td><?php echo $value['api_id']; ?></td>
|
||||
<td><?php echo $value['api_key']; ?></td>
|
||||
<td><?php echo $value['api_type']; ?></td>
|
||||
<td><?php echo $value['api_cpanel_url']; ?></td>
|
||||
|
@ -38,7 +40,7 @@ if (!defined('IN_CRONLITE')) {
|
|||
<td>
|
||||
<a href="hosting-provider.php?action=edit&id=<?php echo $value['api_id']; ?>" class="btn btn-success btn-xs"><i class="fa fa-edit"></i> <?php echo $lang->I18N('edit'); ?></a>
|
||||
<a href="hosting-provider.php?action=details&id=<?php echo $value['api_id']; ?>" class="btn btn-primary btn-xs"><i class="fa fa-info-circle"></i> <?php echo $lang->I18N('details'); ?></a>
|
||||
<a href="hosting-hostname.php?id=<?php echo $value['api_id']; ?>" class="btn btn-primary btn-xs"><i class="fa fa-info-circle"></i> <?php echo $lang->I18N('Hostname'); ?></a>
|
||||
<a href="hosting-hostname.php?id=<?php echo $value['api_id']; ?>" class="btn btn-info btn-xs"><i class="fa fa-ethernet"></i> <?php echo $lang->I18N('Hostname'); ?></a>
|
||||
</td>
|
||||
</tr>
|
||||
<?php endforeach;?>
|
||||
|
|
|
@ -2,12 +2,6 @@ body {
|
|||
padding-top: 51px;
|
||||
padding-bottom: 60px;
|
||||
}
|
||||
.badge,
|
||||
.badge-pill,
|
||||
.btn-rounded {
|
||||
border-radius: 4px !important;
|
||||
border: none;
|
||||
}
|
||||
|
||||
#hidden-area {
|
||||
position: fixed;
|
||||
|
|
|
@ -140,4 +140,20 @@ button {
|
|||
|
||||
.footer .co {
|
||||
display: inline-block;
|
||||
}
|
||||
|
||||
pre,
|
||||
.badge,
|
||||
.breadcrumb,
|
||||
.btn,
|
||||
.dropdown-menu,
|
||||
.form-control,
|
||||
.label,
|
||||
.panel,
|
||||
.panel-footer,
|
||||
.panel-heading {
|
||||
border-top-left-radius: 0;
|
||||
border-top-right-radius: 0;
|
||||
border-bottom-left-radius: 0;
|
||||
border-bottom-right-radius: 0;
|
||||
}
|
|
@ -61,7 +61,7 @@ if (isset($_POST['submit'])) {
|
|||
'account_api_key' => post('api_key'),
|
||||
'account_domain' => $Result['account_domain'],
|
||||
'account_status' => '1',
|
||||
'account_date' => $Result['date'],
|
||||
'account_addtime' => $Result['date'],
|
||||
'account_client_id' => $ClientInfo['client_id'],
|
||||
'account_sql' => 'NULL',
|
||||
));
|
||||
|
|
|
@ -44,7 +44,7 @@ if (isset($_POST['signup'])) {
|
|||
// 'client_phone' => 'null',
|
||||
// 'client_state' => 'null',
|
||||
'client_password' => hash('sha256', post('password')),
|
||||
'client_date' => date('Y-m-d H:i:s'),
|
||||
'client_addtime' => date('Y-m-d H:i:s'),
|
||||
'client_key' => substr(str_shuffle('qwertyuioplkjhgfdsazxcvbnm012345789QWERTYUIOPLKJHGFDSAZXCVBNM'), 0, 8),
|
||||
'client_status' => 0,
|
||||
);
|
||||
|
|
|
@ -31,7 +31,7 @@ if (!defined('IN_CRONLITE')) {
|
|||
<td># <?php echo $value['account_id']; ?></td>
|
||||
<td><?php echo $value['account_username']; ?></td>
|
||||
<td><?php echo $value['account_domain']; ?></td>
|
||||
<td><?php echo $value['account_date']; ?></td>
|
||||
<td><?php echo $value['account_addtime']; ?></td>
|
||||
<td><?php
|
||||
if ($value['account_status'] == '0') {
|
||||
$btn = ['danger', 'lock'];
|
||||
|
|
|
@ -69,7 +69,7 @@
|
|||
<div class="col-md-6">
|
||||
<div class="d-flex justify-content-between align-items-center m-5">
|
||||
<b>Creation Date:</b>
|
||||
<span><?php echo $data['account_date']; ?></span>
|
||||
<span><?php echo $data['account_addtime']; ?></span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
|
|
|
@ -237,7 +237,7 @@ function post($field = '', $default = '')
|
|||
/**
|
||||
* API Response
|
||||
*/
|
||||
function send_response($code = 200, $data = NULL, $msg = 'Error')
|
||||
function send_response($code = 200, $data = NULL, $msg = '')
|
||||
{
|
||||
header("Access-Control-Allow-Origin: *");
|
||||
header("Access-Control-Allow-Methods: GET, POST, OPTIONS");
|
||||
|
|
|
@ -9,7 +9,7 @@ $sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_account` (
|
|||
`account_domain` VARCHAR(70) NOT NULL,
|
||||
`account_sql` VARCHAR(8) NOT NULL,
|
||||
`account_status` INT(1) NOT NULL COMMENT "0未激活1已激活2禁用3删除",
|
||||
`account_date` VARCHAR(20) NOT NULL,
|
||||
`account_addtime` DATETIME NOT NULL,
|
||||
`account_signup_ip` varchar(20) DEFAULT NULL COMMENT "注册IP",
|
||||
PRIMARY KEY (`account_id`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;');
|
||||
|
@ -91,11 +91,12 @@ $sql = mysqli_query($connect, 'CREATE TABLE IF NOT EXISTS `uiisc_clients` (
|
|||
`client_pcode` VARCHAR(20) NOT NULL,
|
||||
`client_key` VARCHAR(8) NOT NULL,
|
||||
`client_state` VARCHAR(30) NOT NULL,
|
||||
`client_date` VARCHAR(30) NOT NULL,
|
||||
`client_status` INT(1) NOT NULL,
|
||||
`client_company` VARCHAR(50) NOT NULL,
|
||||
`client_password` VARCHAR(64) NOT NULL,
|
||||
`client_signup_ip` varchar(20) DEFAULT NULL COMMENT "注册IP",
|
||||
`client_addtime` DATETIME NOT NULL,
|
||||
`client_updatetime` DATETIME DEFAULT NULL,
|
||||
PRIMARY KEY (`client_id`)
|
||||
) ENGINE=MyISAM AUTO_INCREMENT=1000 DEFAULT CHARSET=utf8mb4;');
|
||||
|
||||
|
|
Loading…
Reference in a new issue