Merge branch 'Development' of https://github.com/Focuslinkstech/phpnuxbill into Development
This commit is contained in:
commit
d00d04994d
@ -321,4 +321,5 @@ ALTER TABLE `tbl_transactions` ADD `admin_id` INT NOT NULL DEFAULT '1' AFTER `ty
|
|||||||
ALTER TABLE `tbl_user_recharges` ADD `admin_id` INT NOT NULL DEFAULT '1' AFTER `type`;
|
ALTER TABLE `tbl_user_recharges` ADD `admin_id` INT NOT NULL DEFAULT '1' AFTER `type`;
|
||||||
ALTER TABLE `tbl_plans` CHANGE `allow_purchase` `prepaid` ENUM('yes','no') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'yes' COMMENT 'is prepaid';
|
ALTER TABLE `tbl_plans` CHANGE `allow_purchase` `prepaid` ENUM('yes','no') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'yes' COMMENT 'is prepaid';
|
||||||
ALTER TABLE `tbl_transactions` ADD `note` VARCHAR(256) NOT NULL DEFAULT '' COMMENT 'for note' AFTER `type`;
|
ALTER TABLE `tbl_transactions` ADD `note` VARCHAR(256) NOT NULL DEFAULT '' COMMENT 'for note' AFTER `type`;
|
||||||
ALTER TABLE `tbl_payment_gateway` ADD `trx_invoice` VARCHAR(25) NOT NULL DEFAULT '' COMMENT 'from tbl_transactions' AFTER `paid_date`;
|
ALTER TABLE `tbl_payment_gateway` ADD `trx_invoice` VARCHAR(25) NOT NULL DEFAULT '' COMMENT 'from tbl_transactions' AFTER `paid_date`;
|
||||||
|
ALTER TABLE `tbl_customers` ADD `status` ENUM('Active','Banned','Disabled') NOT NULL DEFAULT 'Active' AFTER `auto_renewal`;
|
@ -34,6 +34,10 @@ class Package
|
|||||||
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
|
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
|
||||||
$p = ORM::for_table('tbl_plans')->where('id', $plan_id)->find_one();
|
$p = ORM::for_table('tbl_plans')->where('id', $plan_id)->find_one();
|
||||||
|
|
||||||
|
if($c['status'] != 'Active'){
|
||||||
|
_alert(Lang::T('This account status').' : '.Lang::T($c['status']),'danger', "");
|
||||||
|
}
|
||||||
|
|
||||||
$add_cost = 0;
|
$add_cost = 0;
|
||||||
$bills = [];
|
$bills = [];
|
||||||
// Zero cost recharge
|
// Zero cost recharge
|
||||||
|
@ -163,7 +163,9 @@ class User
|
|||||||
$id = User::getID();
|
$id = User::getID();
|
||||||
}
|
}
|
||||||
$d = ORM::for_table('tbl_customers')->find_one($id);
|
$d = ORM::for_table('tbl_customers')->find_one($id);
|
||||||
|
if ($d['status'] != 'Banned') {
|
||||||
|
_alert(Lang::T('This account status') . ' : ' . Lang::T($d['status']), 'danger', "logout");
|
||||||
|
}
|
||||||
if (empty($d['username'])) {
|
if (empty($d['username'])) {
|
||||||
r2(U . 'logout', 'd', '');
|
r2(U . 'logout', 'd', '');
|
||||||
}
|
}
|
||||||
|
@ -459,6 +459,7 @@ switch ($action) {
|
|||||||
$phonenumber = Lang::phoneFormat(_post('phonenumber'));
|
$phonenumber = Lang::phoneFormat(_post('phonenumber'));
|
||||||
$service_type = _post('service_type');
|
$service_type = _post('service_type');
|
||||||
$coordinates = _post('coordinates');
|
$coordinates = _post('coordinates');
|
||||||
|
$status = _post('status');
|
||||||
run_hook('edit_customer'); #HOOK
|
run_hook('edit_customer'); #HOOK
|
||||||
$msg = '';
|
$msg = '';
|
||||||
if (Validator::Length($username, 35, 2) == false) {
|
if (Validator::Length($username, 35, 2) == false) {
|
||||||
@ -517,6 +518,7 @@ switch ($action) {
|
|||||||
$d->email = $email;
|
$d->email = $email;
|
||||||
$d->account_type = $account_type;
|
$d->account_type = $account_type;
|
||||||
$d->address = $address;
|
$d->address = $address;
|
||||||
|
$d->status = $status;
|
||||||
$d->phonenumber = $phonenumber;
|
$d->phonenumber = $phonenumber;
|
||||||
$d->service_type = $service_type;
|
$d->service_type = $service_type;
|
||||||
$d->coordinates = $coordinates;
|
$d->coordinates = $coordinates;
|
||||||
@ -606,19 +608,33 @@ switch ($action) {
|
|||||||
default:
|
default:
|
||||||
run_hook('list_customers'); #HOOK
|
run_hook('list_customers'); #HOOK
|
||||||
$search = _post('search');
|
$search = _post('search');
|
||||||
|
$order = _post('order', 'username');
|
||||||
|
$orderby = _post('orderby', 'asc');
|
||||||
|
$order_pos = [
|
||||||
|
'username' => 0,
|
||||||
|
'created_at' => 8,
|
||||||
|
'balance' => 3
|
||||||
|
];
|
||||||
|
|
||||||
if ($search != '') {
|
if ($search != '') {
|
||||||
$query = ORM::for_table('tbl_customers')
|
$query = ORM::for_table('tbl_customers')
|
||||||
->whereRaw("username LIKE '%$search%' OR fullname LIKE '%$search%' OR address LIKE '%$search%' ".
|
->whereRaw("username LIKE '%$search%' OR fullname LIKE '%$search%' OR address LIKE '%$search%' ".
|
||||||
"OR phonenumber LIKE '%$search%' OR email LIKE '%$search%' ")
|
"OR phonenumber LIKE '%$search%' OR email LIKE '%$search%' ");
|
||||||
->order_by_asc('username');
|
|
||||||
$d = $query->findMany();
|
|
||||||
} else {
|
} else {
|
||||||
$query = ORM::for_table('tbl_customers')->order_by_asc('username');
|
$query = ORM::for_table('tbl_customers');
|
||||||
|
}
|
||||||
|
if($orderby=='asc'){
|
||||||
|
$query->order_by_asc($order);
|
||||||
|
}else{
|
||||||
|
$query->order_by_desc($order);
|
||||||
}
|
}
|
||||||
$d = $query->findMany();
|
$d = $query->findMany();
|
||||||
$ui->assign('xheader', '<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.11.3/css/jquery.dataTables.min.css">');
|
$ui->assign('xheader', '<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/1.11.3/css/jquery.dataTables.min.css">');
|
||||||
$ui->assign('d', $d);
|
$ui->assign('d', $d);
|
||||||
$ui->assign('search', $search);
|
$ui->assign('search', $search);
|
||||||
|
$ui->assign('order', $order);
|
||||||
|
$ui->assign('order_pos', $order_pos[$order]);
|
||||||
|
$ui->assign('orderby', $orderby);
|
||||||
$ui->display('customers.tpl');
|
$ui->display('customers.tpl');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -18,6 +18,9 @@ if (isset($_GET['renewal'])) {
|
|||||||
|
|
||||||
if (_post('send') == 'balance') {
|
if (_post('send') == 'balance') {
|
||||||
if ($config['enable_balance'] == 'yes' && $config['allow_balance_transfer'] == 'yes') {
|
if ($config['enable_balance'] == 'yes' && $config['allow_balance_transfer'] == 'yes') {
|
||||||
|
if ($user['status'] != 'Active') {
|
||||||
|
_alert(Lang::T('This account status') . ' : ' . Lang::T($user['status']), 'danger', "");
|
||||||
|
}
|
||||||
$target = ORM::for_table('tbl_customers')->where('username', _post('username'))->find_one();
|
$target = ORM::for_table('tbl_customers')->where('username', _post('username'))->find_one();
|
||||||
if (!$target) {
|
if (!$target) {
|
||||||
r2(U . 'home', 'd', Lang::T('Username not found'));
|
r2(U . 'home', 'd', Lang::T('Username not found'));
|
||||||
@ -77,6 +80,9 @@ if (_post('send') == 'balance') {
|
|||||||
r2(U . 'home', 'd', Lang::T('Failed, balance is not available'));
|
r2(U . 'home', 'd', Lang::T('Failed, balance is not available'));
|
||||||
}
|
}
|
||||||
} else if (_post('send') == 'plan') {
|
} else if (_post('send') == 'plan') {
|
||||||
|
if ($user['status'] != 'Active') {
|
||||||
|
_alert(Lang::T('This account status') . ' : ' . Lang::T($user['status']), 'danger', "");
|
||||||
|
}
|
||||||
$actives = ORM::for_table('tbl_user_recharges')
|
$actives = ORM::for_table('tbl_user_recharges')
|
||||||
->where('username', _post('username'))
|
->where('username', _post('username'))
|
||||||
->find_many();
|
->find_many();
|
||||||
@ -92,6 +98,9 @@ if (_post('send') == 'balance') {
|
|||||||
$ui->assign('_bills', User::_billing());
|
$ui->assign('_bills', User::_billing());
|
||||||
|
|
||||||
if (isset($_GET['recharge']) && !empty($_GET['recharge'])) {
|
if (isset($_GET['recharge']) && !empty($_GET['recharge'])) {
|
||||||
|
if ($user['status'] != 'Active') {
|
||||||
|
_alert(Lang::T('This account status') . ' : ' . Lang::T($user['status']), 'danger', "");
|
||||||
|
}
|
||||||
if (!empty(App::getTokenValue(_get('stoken')))) {
|
if (!empty(App::getTokenValue(_get('stoken')))) {
|
||||||
r2(U . "voucher/invoice/");
|
r2(U . "voucher/invoice/");
|
||||||
die();
|
die();
|
||||||
@ -119,7 +128,10 @@ if (isset($_GET['recharge']) && !empty($_GET['recharge'])) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
} else if (!empty(_get('extend'))) {
|
} else if (!empty(_get('extend'))) {
|
||||||
if(!$config['extend_expired']){
|
if ($user['status'] != 'Active') {
|
||||||
|
_alert(Lang::T('This account status') . ' : ' . Lang::T($user['status']), 'danger', "");
|
||||||
|
}
|
||||||
|
if (!$config['extend_expired']) {
|
||||||
r2(U . 'home', 'e', "cannot extend");
|
r2(U . 'home', 'e', "cannot extend");
|
||||||
}
|
}
|
||||||
if (!empty(App::getTokenValue(_get('stoken')))) {
|
if (!empty(App::getTokenValue(_get('stoken')))) {
|
||||||
@ -130,7 +142,7 @@ if (isset($_GET['recharge']) && !empty($_GET['recharge'])) {
|
|||||||
if ($tur) {
|
if ($tur) {
|
||||||
$m = date("m");
|
$m = date("m");
|
||||||
$path = $CACHE_PATH . DIRECTORY_SEPARATOR . "extends" . DIRECTORY_SEPARATOR;
|
$path = $CACHE_PATH . DIRECTORY_SEPARATOR . "extends" . DIRECTORY_SEPARATOR;
|
||||||
if(!file_exists($path)){
|
if (!file_exists($path)) {
|
||||||
mkdir($path);
|
mkdir($path);
|
||||||
}
|
}
|
||||||
$path .= $user['id'] . ".txt";
|
$path .= $user['id'] . ".txt";
|
||||||
@ -148,7 +160,7 @@ if (isset($_GET['recharge']) && !empty($_GET['recharge'])) {
|
|||||||
$router = $tur['routers'];
|
$router = $tur['routers'];
|
||||||
}
|
}
|
||||||
$p = ORM::for_table('tbl_plans')->findOne($tur['plan_id']);
|
$p = ORM::for_table('tbl_plans')->findOne($tur['plan_id']);
|
||||||
if(!$p){
|
if (!$p) {
|
||||||
r2(U . 'home', '3', "Plan Not Found");
|
r2(U . 'home', '3', "Plan Not Found");
|
||||||
}
|
}
|
||||||
if ($tur['routers'] == 'radius') {
|
if ($tur['routers'] == 'radius') {
|
||||||
@ -171,12 +183,12 @@ if (isset($_GET['recharge']) && !empty($_GET['recharge'])) {
|
|||||||
App::setToken(_get('stoken'), $id);
|
App::setToken(_get('stoken'), $id);
|
||||||
file_put_contents($path, $m);
|
file_put_contents($path, $m);
|
||||||
_log("Customer $tur[customer_id] $tur[username] extend for $days days", "Customer", $user['id']);
|
_log("Customer $tur[customer_id] $tur[username] extend for $days days", "Customer", $user['id']);
|
||||||
Message::sendTelegram("#u$user[username] #extend #".$p['type']." \n" . $p['name_plan'] .
|
Message::sendTelegram("#u$user[username] #extend #" . $p['type'] . " \n" . $p['name_plan'] .
|
||||||
"\nLocation: " . $p['routers'] .
|
"\nLocation: " . $p['routers'] .
|
||||||
"\nCustomer: " . $user['fullname'] .
|
"\nCustomer: " . $user['fullname'] .
|
||||||
"\nNew Expired: " . Lang::dateAndTimeFormat($expiration, $tur['time']));
|
"\nNew Expired: " . Lang::dateAndTimeFormat($expiration, $tur['time']));
|
||||||
r2(U . 'home', 's', "Extend until $expiration");
|
r2(U . 'home', 's', "Extend until $expiration");
|
||||||
}else{
|
} else {
|
||||||
r2(U . 'home', 'e', "Plan is not expired");
|
r2(U . 'home', 'e', "Plan is not expired");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -5,8 +5,8 @@
|
|||||||
* by https://t.me/ibnux
|
* by https://t.me/ibnux
|
||||||
**/
|
**/
|
||||||
|
|
||||||
if(User::getID()){
|
if (User::getID()) {
|
||||||
r2(U.'home');
|
r2(U . 'home');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (isset($routes['1'])) {
|
if (isset($routes['1'])) {
|
||||||
@ -24,13 +24,16 @@ switch ($do) {
|
|||||||
$d = ORM::for_table('tbl_customers')->where('username', $username)->find_one();
|
$d = ORM::for_table('tbl_customers')->where('username', $username)->find_one();
|
||||||
if ($d) {
|
if ($d) {
|
||||||
$d_pass = $d['password'];
|
$d_pass = $d['password'];
|
||||||
|
if ($d['status'] != 'Banned') {
|
||||||
|
_alert(Lang::T('This account status') . ' : ' . Lang::T($d['status']), 'danger', "");
|
||||||
|
}
|
||||||
if (Password::_uverify($password, $d_pass) == true) {
|
if (Password::_uverify($password, $d_pass) == true) {
|
||||||
$_SESSION['uid'] = $d['id'];
|
$_SESSION['uid'] = $d['id'];
|
||||||
User::setCookie($d['id']);
|
User::setCookie($d['id']);
|
||||||
$d->last_login = date('Y-m-d H:i:s');
|
$d->last_login = date('Y-m-d H:i:s');
|
||||||
$d->save();
|
$d->save();
|
||||||
_log($username . ' ' . Lang::T('Login Successful'), 'User', $d['id']);
|
_log($username . ' ' . Lang::T('Login Successful'), 'User', $d['id']);
|
||||||
_alert(Lang::T('Login Successful'),'success', "home");
|
_alert(Lang::T('Login Successful'), 'success', "home");
|
||||||
} else {
|
} else {
|
||||||
_msglog('e', Lang::T('Invalid Username or Password'));
|
_msglog('e', Lang::T('Invalid Username or Password'));
|
||||||
_log($username . ' ' . Lang::T('Failed Login'), 'User');
|
_log($username . ' ' . Lang::T('Failed Login'), 'User');
|
||||||
@ -68,7 +71,7 @@ switch ($do) {
|
|||||||
r2(U . 'login', 'e', Lang::T('Voucher activation failed'));
|
r2(U . 'login', 'e', Lang::T('Voucher activation failed'));
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
_alert(Lang::T('Login Successful'),'success', "dashboard");
|
_alert(Lang::T('Login Successful'), 'success', "dashboard");
|
||||||
r2(U . 'login', 'e', Lang::T('Voucher activation failed') . '.');
|
r2(U . 'login', 'e', Lang::T('Voucher activation failed') . '.');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -148,6 +148,9 @@ switch ($action) {
|
|||||||
r2(U . "voucher/invoice/");
|
r2(U . "voucher/invoice/");
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
|
if($user['status'] != 'Active'){
|
||||||
|
_alert(Lang::T('This account status').' : '.Lang::T($user['status']),'danger', "");
|
||||||
|
}
|
||||||
$plan = ORM::for_table('tbl_plans')->where('enabled', '1')->find_one($routes['3']);
|
$plan = ORM::for_table('tbl_plans')->where('enabled', '1')->find_one($routes['3']);
|
||||||
if (empty($plan)) {
|
if (empty($plan)) {
|
||||||
r2(U . "order/package", 'e', Lang::T("Plan Not found"));
|
r2(U . "order/package", 'e', Lang::T("Plan Not found"));
|
||||||
@ -181,6 +184,9 @@ switch ($action) {
|
|||||||
if ($config['enable_balance'] != 'yes') {
|
if ($config['enable_balance'] != 'yes') {
|
||||||
r2(U . "order/package", 'e', Lang::T("Balance not enabled"));
|
r2(U . "order/package", 'e', Lang::T("Balance not enabled"));
|
||||||
}
|
}
|
||||||
|
if($user['status'] != 'Active'){
|
||||||
|
_alert(Lang::T('This account status').' : '.Lang::T($user['status']),'danger', "");
|
||||||
|
}
|
||||||
$ui->assign('_title', Lang::T('Buy for friend'));
|
$ui->assign('_title', Lang::T('Buy for friend'));
|
||||||
$ui->assign('_system_menu', 'package');
|
$ui->assign('_system_menu', 'package');
|
||||||
$plan = ORM::for_table('tbl_plans')->find_one($routes['3']);
|
$plan = ORM::for_table('tbl_plans')->find_one($routes['3']);
|
||||||
@ -322,6 +328,9 @@ switch ($action) {
|
|||||||
} else if (!empty($gateway)) {
|
} else if (!empty($gateway)) {
|
||||||
$_SESSION['gateway'] = $gateway;
|
$_SESSION['gateway'] = $gateway;
|
||||||
}
|
}
|
||||||
|
if($user['status'] != 'Active'){
|
||||||
|
_alert(Lang::T('This account status').' : '.Lang::T($user['status']),'danger', "");
|
||||||
|
}
|
||||||
if (empty($gateway)) {
|
if (empty($gateway)) {
|
||||||
r2(U . 'order/gateway/' . $routes[2] . '/' . $routes[3], 'w', Lang::T("Please select Payment Gateway"));
|
r2(U . 'order/gateway/' . $routes[2] . '/' . $routes[3], 'w', Lang::T("Please select Payment Gateway"));
|
||||||
}
|
}
|
||||||
|
@ -581,5 +581,13 @@
|
|||||||
"Created___Expired": "Created \/ Expired",
|
"Created___Expired": "Created \/ Expired",
|
||||||
"Bank_Transfer": "Bank Transfer",
|
"Bank_Transfer": "Bank Transfer",
|
||||||
"Recharge_Using": "Recharge Using",
|
"Recharge_Using": "Recharge Using",
|
||||||
"ago": "ago"
|
"ago": "ago",
|
||||||
|
"Disabled": "Disabled",
|
||||||
|
"Banned": "Banned",
|
||||||
|
"Customer_cannot_login_again": "Customer cannot login again",
|
||||||
|
"Customer_can_login_but_cannot_buy_internet_plan__Admin_cannot_recharge_customer": "Customer can login but cannot buy internet plan, Admin cannot recharge customer",
|
||||||
|
"Don_t_forget_to_deactivate_all_active_plan_too": "Don't forget to deactivate all active plan too",
|
||||||
|
"Ascending": "Ascending",
|
||||||
|
"Descending": "Descending",
|
||||||
|
"Created_Date": "Created Date"
|
||||||
}
|
}
|
@ -93,5 +93,8 @@
|
|||||||
],
|
],
|
||||||
"2024.4.5" : [
|
"2024.4.5" : [
|
||||||
"ALTER TABLE `tbl_payment_gateway` ADD `trx_invoice` VARCHAR(25) NOT NULL DEFAULT '' COMMENT 'from tbl_transactions' AFTER `paid_date`;"
|
"ALTER TABLE `tbl_payment_gateway` ADD `trx_invoice` VARCHAR(25) NOT NULL DEFAULT '' COMMENT 'from tbl_transactions' AFTER `paid_date`;"
|
||||||
|
],
|
||||||
|
"2024.5.17" : [
|
||||||
|
"ALTER TABLE `tbl_customers` ADD `status` ENUM('Active','Banned','Disabled') NOT NULL DEFAULT 'Active' AFTER `auto_renewal`;"
|
||||||
]
|
]
|
||||||
}
|
}
|
@ -3,7 +3,7 @@
|
|||||||
<form class="form-horizontal" method="post" role="form" action="{$_url}customers/edit-post">
|
<form class="form-horizontal" method="post" role="form" action="{$_url}customers/edit-post">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
<div class="panel panel-{if $d['status']=='Active'}primary{else}danger{/if} panel-hovered panel-stacked mb30">
|
||||||
<div class="panel-heading">{Lang::T('Edit Contact')}</div>
|
<div class="panel-heading">{Lang::T('Edit Contact')}</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<input type="hidden" name="id" value="{$d['id']}">
|
<input type="hidden" name="id" value="{$d['id']}">
|
||||||
@ -20,7 +20,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
<input type="text" class="form-control" name="username" value="{$d['username']}"
|
<input type="text" class="form-control" name="username" value="{$d['username']}"
|
||||||
required
|
required
|
||||||
placeholder="{if $_c['country_code_phone']!= ''}{$_c['country_code_phone']} {Lang::T('Phone Number')}{else}{Lang::T('Username')}{/if}">
|
placeholder="{if $_c['country_code_phone']!= ''}{$_c['country_code_phone']} {Lang::T('Phone Number')}{else}{Lang::T('Username')}{/if}">
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -108,6 +108,26 @@
|
|||||||
<div id="map" style="width: '100%'; height: 200px; min-height: 150px;"></div>
|
<div id="map" style="width: '100%'; height: 200px; min-height: 150px;"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-md-3 control-label">{Lang::T('Status')}</label>
|
||||||
|
<div class="col-md-9">
|
||||||
|
<select class="form-control" id="status" name="status">
|
||||||
|
<option value="Active" {if $d['status'] eq 'Active' }selected{/if}>{Lang::T('Active')}
|
||||||
|
</option>
|
||||||
|
<option value="Disabled" {if $d['status'] eq 'Disabled' }selected{/if}>
|
||||||
|
{Lang::T('Disabled')}
|
||||||
|
</option>
|
||||||
|
<option value="Banned" {if $d['status'] eq 'Banned' }selected{/if}>
|
||||||
|
{Lang::T('Banned')}
|
||||||
|
</option>
|
||||||
|
</select>
|
||||||
|
<span class="help-block">
|
||||||
|
{Lang::T('Banned')}: {Lang::T('Customer cannot login again')}.<br>
|
||||||
|
{Lang::T('Disabled')}: {Lang::T('Customer can login but cannot buy internet plan, Admin cannot recharge customer')}.<br>
|
||||||
|
{Lang::T('Don\'t forget to deactivate all active plan too')}.
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -219,13 +239,15 @@
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
{/literal}{if $d['coordinates']}
|
{/literal}
|
||||||
setupMap({$d['coordinates']});
|
{if $d['coordinates']}
|
||||||
{else}
|
setupMap({$d['coordinates']});
|
||||||
getLocation();
|
{else}
|
||||||
{/if}{literal}
|
getLocation();
|
||||||
}
|
{/if}
|
||||||
</script>
|
{literal}
|
||||||
{/literal}
|
}
|
||||||
|
</script>
|
||||||
|
{/literal}
|
||||||
|
|
||||||
{include file="sections/footer.tpl"}
|
{include file="sections/footer.tpl"}
|
@ -2,15 +2,17 @@
|
|||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-4 col-md-4">
|
<div class="col-sm-4 col-md-4">
|
||||||
<div class="box box-primary">
|
<div class="box box-{if $d['status']=='Active'}primary{else}danger{/if}">
|
||||||
<div class="box-body box-profile">
|
<div class="box-body box-profile">
|
||||||
<img class="profile-user-img img-responsive img-circle"
|
<img class="profile-user-img img-responsive img-circle"
|
||||||
src="https://robohash.org/{$d['id']}?set=set3&size=100x100&bgset=bg1"
|
src="https://robohash.org/{$d['id']}?set=set3&size=100x100&bgset=bg1"
|
||||||
onerror="this.src='{$UPLOAD_PATH}/user.default.jpg'" alt="avatar">
|
onerror="this.src='{$UPLOAD_PATH}/user.default.jpg'" alt="avatar">
|
||||||
|
|
||||||
<h3 class="profile-username text-center">{$d['fullname']}</h3>
|
<h3 class="profile-username text-center">{$d['fullname']}</h3>
|
||||||
|
|
||||||
<ul class="list-group list-group-unbordered">
|
<ul class="list-group list-group-unbordered">
|
||||||
|
<li class="list-group-item">
|
||||||
|
<b>{Lang::T('Status')}</b> <span
|
||||||
|
class="pull-right {if $d['status'] !='Active'}bg-red{/if}"> {Lang::T($d['status'])} </span>
|
||||||
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<b>{Lang::T('Username')}</b> <span class="pull-right">{$d['username']}</span>
|
<b>{Lang::T('Username')}</b> <span class="pull-right">{$d['username']}</span>
|
||||||
</li>
|
</li>
|
||||||
@ -233,23 +235,23 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
{if $d['coordinates']}
|
{if $d['coordinates']}
|
||||||
{literal}
|
{literal}
|
||||||
<script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js"></script>
|
<script src="https://unpkg.com/leaflet@1.9.3/dist/leaflet.js"></script>
|
||||||
<script>
|
<script>
|
||||||
function setupMap(lat, lon) {
|
function setupMap(lat, lon) {
|
||||||
var map = L.map('map').setView([lat, lon], 17);
|
var map = L.map('map').setView([lat, lon], 17);
|
||||||
L.tileLayer('https://{s}.basemaps.cartocdn.com/rastertiles/light_all/{z}/{x}/{y}.png', {
|
L.tileLayer('https://{s}.basemaps.cartocdn.com/rastertiles/light_all/{z}/{x}/{y}.png', {
|
||||||
attribution:
|
attribution:
|
||||||
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>',
|
'© <a href="https://www.openstreetmap.org/copyright">OpenStreetMap</a> contributors © <a href="https://carto.com/attributions">CARTO</a>',
|
||||||
subdomains: 'abcd',
|
subdomains: 'abcd',
|
||||||
maxZoom: 20
|
maxZoom: 20
|
||||||
}).addTo(map);
|
}).addTo(map);
|
||||||
var marker = L.marker([lat, lon]).addTo(map);
|
var marker = L.marker([lat, lon]).addTo(map);
|
||||||
}
|
}
|
||||||
window.onload = function() {
|
window.onload = function() {
|
||||||
{/literal}setupMap({$d['coordinates']});{literal}
|
{/literal}setupMap({$d['coordinates']});{literal}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
{/literal}
|
{/literal}
|
||||||
{/if}
|
{/if}
|
||||||
{include file="sections/footer.tpl"}
|
{include file="sections/footer.tpl"}
|
@ -16,18 +16,38 @@
|
|||||||
<div class="panel panel-hovered mb20 panel-primary">
|
<div class="panel panel-hovered mb20 panel-primary">
|
||||||
<div class="panel-heading">
|
<div class="panel-heading">
|
||||||
{if in_array($_admin['user_type'],['SuperAdmin','Admin'])}
|
{if in_array($_admin['user_type'],['SuperAdmin','Admin'])}
|
||||||
<div class="btn-group pull-right">
|
<div class="btn-group pull-right">
|
||||||
<a class="btn btn-primary btn-xs" title="save" href="{$_url}customers/csv"
|
<a class="btn btn-primary btn-xs" title="save" href="{$_url}customers/csv"
|
||||||
onclick="return confirm('This will export to CSV?')"><span class="glyphicon glyphicon-download"
|
onclick="return confirm('This will export to CSV?')"><span class="glyphicon glyphicon-download"
|
||||||
aria-hidden="true"></span> CSV</a>
|
aria-hidden="true"></span> CSV</a>
|
||||||
</div>
|
</div>
|
||||||
{/if}
|
{/if}
|
||||||
{Lang::T('Manage Contact')}
|
{Lang::T('Manage Contact')}
|
||||||
</div>
|
</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
|
<form id="site-search" method="post" action="{$_url}customers">
|
||||||
<div class="col-md-8">
|
<div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
|
||||||
<form id="site-search" method="post" action="{$_url}customers">
|
<div class="col-lg-4">
|
||||||
|
<div class="input-group">
|
||||||
|
<span class="input-group-addon">Order </span>
|
||||||
|
<div class="row row-no-gutters">
|
||||||
|
<div class="col-xs-8">
|
||||||
|
<select class="form-control" id="order" name="order">
|
||||||
|
<option value="username" {if $order eq 'username' }selected{/if}>{Lang::T('Username')}</option>
|
||||||
|
<option value="created_at" {if $order eq 'created_at' }selected{/if}>{Lang::T('Created Date')}</option>
|
||||||
|
<option value="balance" {if $order eq 'balance' }selected{/if}>{Lang::T('Balance')}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<div class="col-xs-4">
|
||||||
|
<select class="form-control" id="orderby" name="orderby">
|
||||||
|
<option value="asc" {if $orderby eq 'asc' }selected{/if}>{Lang::T('Ascending')}</option>
|
||||||
|
<option value="desc" {if $orderby eq 'desc' }selected{/if}>{Lang::T('Descending')}</option>
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-4">
|
||||||
<div class="input-group">
|
<div class="input-group">
|
||||||
<div class="input-group-addon">
|
<div class="input-group-addon">
|
||||||
<span class="fa fa-search"></span>
|
<span class="fa fa-search"></span>
|
||||||
@ -38,13 +58,15 @@
|
|||||||
<button class="btn btn-success" type="submit">{Lang::T('Search')}</button>
|
<button class="btn btn-success" type="submit">{Lang::T('Search')}</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</div>
|
||||||
|
<div class="col-lg-2">
|
||||||
|
<a href="{$_url}customers/add" class="btn btn-primary btn-block"><i
|
||||||
|
class="ion ion-android-add">
|
||||||
|
</i> {Lang::T('Add New Contact')}</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-4">
|
</form>
|
||||||
<a href="{$_url}customers/add" class="btn btn-primary btn-block"><i class="ion ion-android-add">
|
<br>
|
||||||
</i> {Lang::T('Add New Contact')}</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="table-responsive table_mobile">
|
<div class="table-responsive table_mobile">
|
||||||
<table id="customerTable" class="table table-bordered table-striped table-condensed">
|
<table id="customerTable" class="table table-bordered table-striped table-condensed">
|
||||||
<thead>
|
<thead>
|
||||||
@ -56,50 +78,52 @@
|
|||||||
<th>{Lang::T('Contact')}</th>
|
<th>{Lang::T('Contact')}</th>
|
||||||
<th>{Lang::T('Package')}</th>
|
<th>{Lang::T('Package')}</th>
|
||||||
<th>{Lang::T('Service Type')}</th>
|
<th>{Lang::T('Service Type')}</th>
|
||||||
|
<th>{Lang::T('Status')}</th>
|
||||||
<th>{Lang::T('Created On')}</th>
|
<th>{Lang::T('Created On')}</th>
|
||||||
<th>{Lang::T('Manage')}</th>
|
<th>{Lang::T('Manage')}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{foreach $d as $ds}
|
{foreach $d as $ds}
|
||||||
<tr>
|
<tr>
|
||||||
<td onclick="window.location.href = '{$_url}customers/view/{$ds['id']}'"
|
<td onclick="window.location.href = '{$_url}customers/view/{$ds['id']}'"
|
||||||
style="cursor:pointer;">{$ds['username']}</td>
|
style="cursor:pointer;">{$ds['username']}</td>
|
||||||
<td>{$ds['account_type']}</td>
|
<td>{$ds['account_type']}</td>
|
||||||
<td onclick="window.location.href = '{$_url}customers/view/{$ds['id']}'"
|
<td onclick="window.location.href = '{$_url}customers/view/{$ds['id']}'"
|
||||||
style="cursor: pointer;">{$ds['fullname']}</td>
|
style="cursor: pointer;">{$ds['fullname']}</td>
|
||||||
<td>{Lang::moneyFormat($ds['balance'])}</td>
|
<td>{Lang::moneyFormat($ds['balance'])}</td>
|
||||||
<td align="center">
|
<td align="center">
|
||||||
{if $ds['phonenumber']}
|
{if $ds['phonenumber']}
|
||||||
<a href="tel:{$ds['phonenumber']}" class="btn btn-default btn-xs"
|
<a href="tel:{$ds['phonenumber']}" class="btn btn-default btn-xs"
|
||||||
title="{$ds['phonenumber']}"><i class="glyphicon glyphicon-earphone"></i></a>
|
title="{$ds['phonenumber']}"><i class="glyphicon glyphicon-earphone"></i></a>
|
||||||
{/if}
|
{/if}
|
||||||
{if $ds['email']}
|
{if $ds['email']}
|
||||||
<a href="mailto:{$ds['email']}" class="btn btn-default btn-xs"
|
<a href="mailto:{$ds['email']}" class="btn btn-default btn-xs"
|
||||||
title="{$ds['email']}"><i class="glyphicon glyphicon-envelope"></i></a>
|
title="{$ds['email']}"><i class="glyphicon glyphicon-envelope"></i></a>
|
||||||
{/if}
|
{/if}
|
||||||
{if $ds['coordinates']}
|
{if $ds['coordinates']}
|
||||||
<a href="https://www.google.com/maps/dir//{$ds['coordinates']}/" target="_blank"
|
<a href="https://www.google.com/maps/dir//{$ds['coordinates']}/" target="_blank"
|
||||||
class="btn btn-default btn-xs" title="{$ds['coordinates']}"><i
|
class="btn btn-default btn-xs" title="{$ds['coordinates']}"><i
|
||||||
class="glyphicon glyphicon-map-marker"></i></a>
|
class="glyphicon glyphicon-map-marker"></i></a>
|
||||||
{/if}
|
{/if}
|
||||||
</td>
|
</td>
|
||||||
<td align="center" api-get-text="{$_url}autoload/customer_is_active/{$ds['id']}">
|
<td align="center" api-get-text="{$_url}autoload/customer_is_active/{$ds['id']}">
|
||||||
<span class="label label-default">•</span>
|
<span class="label label-default">•</span>
|
||||||
</td>
|
</td>
|
||||||
<td>{$ds['service_type']}</td>
|
<td>{$ds['service_type']}</td>
|
||||||
<td>{Lang::dateTimeFormat($ds['created_at'])}</td>
|
<td>{Lang::T($ds['status'])}</td>
|
||||||
<td align="center">
|
<td>{Lang::dateTimeFormat($ds['created_at'])}</td>
|
||||||
<a href="{$_url}customers/view/{$ds['id']}" id="{$ds['id']}"
|
<td align="center">
|
||||||
style="margin: 0px; color:black"
|
<a href="{$_url}customers/view/{$ds['id']}" id="{$ds['id']}"
|
||||||
class="btn btn-success btn-xs"> {Lang::T('View')} </a>
|
style="margin: 0px; color:black"
|
||||||
<a href="{$_url}customers/edit/{$ds['id']}" id="{$ds['id']}"
|
class="btn btn-success btn-xs"> {Lang::T('View')} </a>
|
||||||
style="margin: 0px; color:black"
|
<a href="{$_url}customers/edit/{$ds['id']}" id="{$ds['id']}"
|
||||||
class="btn btn-info btn-xs"> {Lang::T('Edit')} </a>
|
style="margin: 0px; color:black"
|
||||||
<a href="{$_url}plan/recharge/{$ds['id']}" id="{$ds['id']}" style="margin: 0px;"
|
class="btn btn-info btn-xs"> {Lang::T('Edit')} </a>
|
||||||
class="btn btn-primary btn-xs">{Lang::T('Recharge')}</a>
|
<a href="{$_url}plan/recharge/{$ds['id']}" id="{$ds['id']}" style="margin: 0px;"
|
||||||
</td>
|
class="btn btn-primary btn-xs">{Lang::T('Recharge')}</a>
|
||||||
</tr>
|
</td>
|
||||||
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
@ -115,11 +139,15 @@
|
|||||||
<script>
|
<script>
|
||||||
var $j = jQuery.noConflict();
|
var $j = jQuery.noConflict();
|
||||||
|
|
||||||
$j(document).ready(function () {
|
$j(document).ready(function() {
|
||||||
$j('#customerTable').DataTable({
|
$j('#customerTable').DataTable({
|
||||||
|
order: [[{$order_pos}, '{$orderby}']],
|
||||||
"pagingType": "full_numbers",
|
"pagingType": "full_numbers",
|
||||||
"lengthMenu": [ [5, 10, 25, 50, 100, -1], [5, 10, 25, 50, 100, "All"] ],
|
"lengthMenu": [
|
||||||
"pageLength": 5
|
[5, 10, 25, 50, 100, -1],
|
||||||
|
[5, 10, 25, 50, 100, "All"]
|
||||||
|
],
|
||||||
|
"pageLength": 25
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user