Compare commits
11 Commits
2024.3.3.1
...
2024.3.6
Author | SHA1 | Date | |
---|---|---|---|
37a5ee8566 | |||
e5c8aae758 | |||
99d393d0c0 | |||
e6280d597b | |||
18db9cd280 | |||
6aab647f48 | |||
b8b4623078 | |||
6a79cff233 | |||
4c02283fd0 | |||
403de91fba | |||
4ee3743cf3 |
11
CHANGELOG.md
11
CHANGELOG.md
@ -2,6 +2,17 @@
|
||||
|
||||
# CHANGELOG
|
||||
|
||||
## 2024.3.6
|
||||
|
||||
- change attributes view
|
||||
|
||||
## 2024.3.4
|
||||
|
||||
- add [[username]] for reminder
|
||||
- fix agent show when editing
|
||||
- fix password admin when sending notification
|
||||
- add file exists for pages
|
||||
|
||||
## 2024.3.3
|
||||
|
||||
- Change loading button by @Focuslinkstech
|
||||
|
@ -60,29 +60,30 @@ class Message
|
||||
global $config;
|
||||
run_hook('send_whatsapp'); #HOOK
|
||||
if (!empty($config['wa_url'])) {
|
||||
$waurl = str_replace('[number]', urlencode($phone), $config['wa_url']);
|
||||
$waurl = str_replace('[number]', urlencode(Lang::phoneFormat($phone)), $config['wa_url']);
|
||||
$waurl = str_replace('[text]', urlencode($txt), $waurl);
|
||||
return Http::getData($waurl);
|
||||
}
|
||||
}
|
||||
|
||||
public static function sendPackageNotification($phone, $name, $package, $price, $message, $via)
|
||||
public static function sendPackageNotification($customer, $package, $price, $message, $via)
|
||||
{
|
||||
global $u;
|
||||
$msg = str_replace('[[name]]', $name, $message);
|
||||
$msg = str_replace('[[name]]', $customer['fullname'], $message);
|
||||
$msg = str_replace('[[username]]', $customer['username'], $msg);
|
||||
$msg = str_replace('[[package]]', $package, $msg);
|
||||
$msg = str_replace('[[price]]', $price, $msg);
|
||||
if($u){
|
||||
$msg = str_replace('[[expired_date]]', Lang::dateAndTimeFormat($u['expiration'], $u['time']), $msg);
|
||||
}
|
||||
if (
|
||||
!empty($phone) && strlen($phone) > 5
|
||||
!empty($customer['phonenumber']) && strlen($customer['phonenumber']) > 5
|
||||
&& !empty($message) && in_array($via, ['sms', 'wa'])
|
||||
) {
|
||||
if ($via == 'sms') {
|
||||
Message::sendSMS($phone, $msg);
|
||||
Message::sendSMS($customer['phonenumber'], $msg);
|
||||
} else if ($via == 'wa') {
|
||||
Message::sendWhatsapp($phone, $msg);
|
||||
Message::sendWhatsapp($customer['phonenumber'], $msg);
|
||||
}
|
||||
}
|
||||
return "$via: $msg";
|
||||
|
@ -31,6 +31,14 @@ class Package
|
||||
|
||||
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
|
||||
$p = ORM::for_table('tbl_plans')->where('id', $plan_id)->where('enabled', '1')->find_one();
|
||||
$f = ORM::for_table('tbl_customers_fields')->where('field_name', 'Expired Date')->where('customer_id', $c['id'])->find_one();
|
||||
if (!$f) {
|
||||
$f = ORM::for_table('tbl_customers_fields')->create();
|
||||
$f->customer_id = $c['id'];
|
||||
$f->field_name = 'Expired Date';
|
||||
$f->field_value = 20;
|
||||
$f->save();
|
||||
}
|
||||
|
||||
if ($router_name == 'balance') {
|
||||
// insert table transactions
|
||||
@ -101,15 +109,15 @@ class Package
|
||||
if ($p['validity_unit'] == 'Months') {
|
||||
$date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' month'));
|
||||
} else if ($p['validity_unit'] == 'Period') {
|
||||
$date_tmp = date("Y-m-20", strtotime('+' . $p['validity'] . ' month'));
|
||||
$date_tmp = date("Y-m-{$f['field_value']}", strtotime('+' . $p['validity'] . ' month'));
|
||||
$dt1 = new DateTime("$date_only");
|
||||
$dt2 = new DateTime("$date_tmp");
|
||||
$diff = $dt2->diff($dt1);
|
||||
$sum = $diff->format("%a");// => 453
|
||||
if ($sum >= 35) {
|
||||
$date_exp = date("Y-m-20", strtotime('+0 month'));
|
||||
$date_exp = date("Y-m-{$f['field_value']}", strtotime('+0 month'));
|
||||
} else {
|
||||
$date_exp = date("Y-m-20", strtotime('+' . $p['validity'] . ' month'));
|
||||
$date_exp = date("Y-m-{$f['field_value']}", strtotime('+' . $p['validity'] . ' month'));
|
||||
};
|
||||
$time = date("23:59:00");
|
||||
} else if ($p['validity_unit'] == 'Days') {
|
||||
@ -132,7 +140,7 @@ class Package
|
||||
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
|
||||
$time = $b['time'];
|
||||
} else if ($p['validity_unit'] == 'Period') {
|
||||
$date_exp = date("Y-m-20", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
|
||||
$date_exp = date("Y-m-{$f['field_value']}", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
|
||||
$time = date("23:59:00");
|
||||
} else if ($p['validity_unit'] == 'Days') {
|
||||
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days'));
|
||||
@ -196,7 +204,22 @@ class Package
|
||||
}
|
||||
$t->save();
|
||||
|
||||
Message::sendTelegram("#u$c[username] #recharge #Hotspot \n" . $p['name_plan'] .
|
||||
// insert to fields
|
||||
$fl = ORM::for_table('tbl_customers_fields')->where('field_name', 'Invoice')->where('customer_id', $c['id'])->find_one();
|
||||
if (!$fl) {
|
||||
$fl = ORM::for_table('tbl_customers_fields')->create();
|
||||
$fl->customer_id = $c['id'];
|
||||
$fl->field_name = 'Invoice';
|
||||
$fl->field_value = $p['price'];
|
||||
$fl->save();
|
||||
} else {
|
||||
$fl->customer_id = $c['id'];
|
||||
$fl->field_value = $p['price'];
|
||||
$fl->save();
|
||||
}
|
||||
|
||||
|
||||
Message::sendTelegram("#u$c[username] $c[fullname] #recharge #Hotspot \n" . $p['name_plan'] .
|
||||
"\nRouter: " . $router_name .
|
||||
"\nGateway: " . $gateway .
|
||||
"\nChannel: " . $channel .
|
||||
@ -231,12 +254,23 @@ class Package
|
||||
}
|
||||
$d->save();
|
||||
|
||||
// Calculating Price
|
||||
$sd = new DateTime("$date_only");
|
||||
$ed = new DateTime("$date_exp");
|
||||
$td = $ed->diff($sd);
|
||||
$fd = $td->format("%a");
|
||||
$gi = ($p['price']/30)*$fd;
|
||||
|
||||
// insert table transactions
|
||||
$t = ORM::for_table('tbl_transactions')->create();
|
||||
$t->invoice = "INV-" . Package::_raid(5);
|
||||
$t->username = $c['username'];
|
||||
$t->plan_name = $p['name_plan'];
|
||||
if ($gi > $p['price']) {
|
||||
$t->price = $p['price'];
|
||||
} else {
|
||||
$t->price = $gi;
|
||||
}
|
||||
$t->recharged_on = $date_only;
|
||||
$t->recharged_time = $time_only;
|
||||
$t->expiration = $date_exp;
|
||||
@ -251,7 +285,25 @@ class Package
|
||||
}
|
||||
$t->save();
|
||||
|
||||
Message::sendTelegram("#u$c[username] #buy #Hotspot \n" . $p['name_plan'] .
|
||||
// insert to fields
|
||||
$fl = ORM::for_table('tbl_customers_fields')->where('field_name', 'Invoice')->where('customer_id', $c['id'])->find_one();
|
||||
if (!$fl) {
|
||||
$fl = ORM::for_table('tbl_customers_fields')->create();
|
||||
$fl->customer_id = $c['id'];
|
||||
$fl->field_name = 'Invoice';
|
||||
if ($gi > $p['price']) {
|
||||
$fl->field_value = $p['price'];
|
||||
} else {
|
||||
$fl->field_value = $gi;
|
||||
}
|
||||
$fl->save();
|
||||
} else {
|
||||
$fl->customer_id = $c['id'];
|
||||
$fl->field_value = $p['price'];
|
||||
$fl->save();
|
||||
}
|
||||
|
||||
Message::sendTelegram("#u$c[username] $c[fullname] #buy #Hotspot \n" . $p['name_plan'] .
|
||||
"\nRouter: " . $router_name .
|
||||
"\nGateway: " . $gateway .
|
||||
"\nChannel: " . $channel .
|
||||
@ -267,7 +319,7 @@ class Package
|
||||
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
|
||||
$time = $b['time'];
|
||||
} else if ($p['validity_unit'] == 'Period') {
|
||||
$date_exp = date("Y-m-20", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
|
||||
$date_exp = date("Y-m-{$f['field_value']}", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
|
||||
$time = date("23:59:00");
|
||||
} else if ($p['validity_unit'] == 'Days') {
|
||||
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days'));
|
||||
@ -331,7 +383,22 @@ class Package
|
||||
}
|
||||
$t->save();
|
||||
|
||||
Message::sendTelegram("#u$c[username] #recharge #PPPOE \n" . $p['name_plan'] .
|
||||
// insert to fields
|
||||
$fl = ORM::for_table('tbl_customers_fields')->where('field_name', 'Invoice')->where('customer_id', $c['id'])->find_one();
|
||||
$gp = $gi;
|
||||
if (!$fl) {
|
||||
$fl = ORM::for_table('tbl_customers_fields')->create();
|
||||
$fl->customer_id = $c['id'];
|
||||
$fl->field_name = 'Invoice';
|
||||
$fl->field_value = $p['price'];
|
||||
$fl->save();
|
||||
} else {
|
||||
$fl->customer_id = $c['id'];
|
||||
$fl->field_value = $p['price'];
|
||||
$fl->save();
|
||||
}
|
||||
|
||||
Message::sendTelegram("#u$c[username] $c[fullname] #recharge #PPPOE \n" . $p['name_plan'] .
|
||||
"\nRouter: " . $router_name .
|
||||
"\nGateway: " . $gateway .
|
||||
"\nChannel: " . $channel .
|
||||
@ -366,12 +433,23 @@ class Package
|
||||
}
|
||||
$d->save();
|
||||
|
||||
// Calculating Price
|
||||
$sd = new DateTime("$date_only");
|
||||
$ed = new DateTime("$date_exp");
|
||||
$td = $ed->diff($sd);
|
||||
$fd = $td->format("%a");
|
||||
$gi = ($p['price']/30)*$fd;
|
||||
|
||||
// insert table transactions
|
||||
$t = ORM::for_table('tbl_transactions')->create();
|
||||
$t->invoice = "INV-" . Package::_raid(5);
|
||||
$t->username = $c['username'];
|
||||
$t->plan_name = $p['name_plan'];
|
||||
if ($gi > $p['price']) {
|
||||
$t->price = $p['price'];
|
||||
} else {
|
||||
$t->price = $gi;
|
||||
}
|
||||
$t->recharged_on = $date_only;
|
||||
$t->recharged_time = $time_only;
|
||||
$t->expiration = $date_exp;
|
||||
@ -386,7 +464,25 @@ class Package
|
||||
$t->type = "PPPOE";
|
||||
$t->save();
|
||||
|
||||
Message::sendTelegram("#u$c[username] #buy #PPPOE \n" . $p['name_plan'] .
|
||||
// insert to fields
|
||||
$fl = ORM::for_table('tbl_customers_fields')->where('field_name', 'Invoice')->where('customer_id', $c['id'])->find_one();
|
||||
if (!$fl) {
|
||||
$fl = ORM::for_table('tbl_customers_fields')->create();
|
||||
$fl->customer_id = $c['id'];
|
||||
$fl->field_name = 'Invoice';
|
||||
if ($gi > $p['price']) {
|
||||
$fl->field_value = $p['price'];
|
||||
} else {
|
||||
$fl->field_value = $gi;
|
||||
}
|
||||
$fl->save();
|
||||
} else {
|
||||
$fl->customer_id = $c['id'];
|
||||
$fl->field_value = $p['price'];
|
||||
$fl->save();
|
||||
}
|
||||
|
||||
Message::sendTelegram("#u$c[username] $c[fullname] #buy #PPPOE \n" . $p['name_plan'] .
|
||||
"\nRouter: " . $router_name .
|
||||
"\nGateway: " . $gateway .
|
||||
"\nChannel: " . $channel .
|
||||
|
@ -496,11 +496,11 @@ switch ($action) {
|
||||
$date_now = date("Y-m-d H:i:s");
|
||||
run_hook('add_admin'); #HOOK
|
||||
if ($msg == '') {
|
||||
$password = Password::_crypt($password);
|
||||
$passwordC = Password::_crypt($password);
|
||||
$d = ORM::for_table('tbl_users')->create();
|
||||
$d->username = $username;
|
||||
$d->fullname = $fullname;
|
||||
$d->password = $password;
|
||||
$d->password = $passwordC;
|
||||
$d->user_type = $user_type;
|
||||
$d->phone = $phone;
|
||||
$d->email = $email;
|
||||
|
@ -54,7 +54,7 @@ foreach ($d as $ds) {
|
||||
}
|
||||
Mikrotik::removeHotspotActiveUser($client, $c['username']);
|
||||
}
|
||||
echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $u['namebp'], $price, $textExpired, $config['user_notification_expired'])."\n";
|
||||
echo Message::sendPackageNotification($c, $u['namebp'], $price, $textExpired, $config['user_notification_expired'])."\n";
|
||||
//update database user dengan status off
|
||||
$u->status = 'off';
|
||||
$u->save();
|
||||
@ -109,7 +109,7 @@ foreach ($d as $ds) {
|
||||
}
|
||||
Mikrotik::removePpoeActive($client, $c['username']);
|
||||
}
|
||||
echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $u['namebp'], $price, $textExpired, $config['user_notification_expired'])."\n";
|
||||
echo Message::sendPackageNotification($c, $u['namebp'], $price, $textExpired, $config['user_notification_expired'])."\n";
|
||||
|
||||
$u->status = 'off';
|
||||
$u->save();
|
||||
|
@ -40,11 +40,11 @@ foreach ($d as $ds) {
|
||||
$c = ORM::for_table('tbl_customers')->where('id', $ds['customer_id'])->find_one();
|
||||
$price = Lang::moneyFormat($p['price']);
|
||||
if ($ds['expiration'] == $day7) {
|
||||
echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $p['name_plan'], $price, Lang::getNotifText('reminder_7_day'), $config['user_notification_reminder']) . "\n";
|
||||
echo Message::sendPackageNotification($c, $p['name_plan'], $price, Lang::getNotifText('reminder_7_day'), $config['user_notification_reminder']) . "\n";
|
||||
} else if ($ds['expiration'] == $day3) {
|
||||
echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $p['name_plan'], $price, Lang::getNotifText('reminder_3_day'), $config['user_notification_reminder']) . "\n";
|
||||
echo Message::sendPackageNotification($c, $p['name_plan'], $price, Lang::getNotifText('reminder_3_day'), $config['user_notification_reminder']) . "\n";
|
||||
} else if ($ds['expiration'] == $day1) {
|
||||
echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $p['name_plan'], $price, Lang::getNotifText('reminder_1_day'), $config['user_notification_reminder']) . "\n";
|
||||
echo Message::sendPackageNotification($c, $p['name_plan'], $price, Lang::getNotifText('reminder_1_day'), $config['user_notification_reminder']) . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -460,5 +460,6 @@
|
||||
"Users_Announcement": "Users Announcement",
|
||||
"Customer_Announcement": "Customer Announcement",
|
||||
"1_Period___1_Month__Expires_the_20th_of_each_month": "1 Period = 1 Month, Expires the 20th of each month",
|
||||
"Period": "Period"
|
||||
"Period": "Period",
|
||||
"Add": "Add"
|
||||
}
|
@ -4,7 +4,7 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>{$_title} - {Lang::T('Login')}</title>
|
||||
<title>{Lang::T('Login')} - {$_c['CompanyName']}</title>
|
||||
<link rel="shortcut icon" href="ui/ui/images/logo.png" type="image/x-icon" />
|
||||
|
||||
<link rel="stylesheet" href="ui/ui/styles/bootstrap.min.css">
|
||||
@ -16,7 +16,7 @@
|
||||
<body class="hold-transition login-page">
|
||||
<div class="login-box">
|
||||
<div class="login-logo">
|
||||
<b>Nux</b>Billing
|
||||
{$_c['CompanyName']}
|
||||
</div>
|
||||
<div class="login-box-body">
|
||||
<p class="login-box-msg">{Lang::T('Enter Admin Area')}</p>
|
||||
|
@ -127,6 +127,7 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{if $_c['enable_balance'] == 'yes'}
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Send Balance')}</label>
|
||||
@ -155,6 +156,7 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
|
@ -1,15 +1,14 @@
|
||||
{include file="sections/header.tpl"}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-12">
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}customers/add-post">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">{Lang::T('Add New Contact')}</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}customers/add-post">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Username')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Username')}</label>
|
||||
<div class="col-md-9">
|
||||
<div class="input-group">
|
||||
{if $_c['country_code_phone']!= ''}
|
||||
<span class="input-group-addon" id="basic-addon1">+</span>
|
||||
@ -23,20 +22,20 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Full Name')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Full Name')}</label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" required class="form-control" id="fullname" name="fullname">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Email')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Email')}</label>
|
||||
<div class="col-md-9">
|
||||
<input type="email" class="form-control" id="email" name="email">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Phone Number')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Phone Number')}</label>
|
||||
<div class="col-md-9">
|
||||
<div class="input-group">
|
||||
{if $_c['country_code_phone']!= ''}
|
||||
<span class="input-group-addon" id="basic-addon1">+</span>
|
||||
@ -50,15 +49,15 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Password')}</label>
|
||||
<div class="col-md-6">
|
||||
<input type="password" class="form-control" autocomplete="off" required id="password"
|
||||
<label class="col-md-3 control-label">{Lang::T('Password')}</label>
|
||||
<div class="col-md-9">
|
||||
<input type="password" class="form-control" autocomplete="off" required id="password" value="{rand(000000,999999)}"
|
||||
name="password" onmouseleave="this.type = 'password'" onmouseenter="this.type = 'text'">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('PPPOE Password')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('PPPOE Password')}</label>
|
||||
<div class="col-md-9">
|
||||
<input type="password" class="form-control" id="pppoe_password" name="pppoe_password"
|
||||
value="{$d['pppoe_password']}" onmouseleave="this.type = 'password'"
|
||||
onmouseenter="this.type = 'text'">
|
||||
@ -68,14 +67,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Address')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Address')}</label>
|
||||
<div class="col-md-9">
|
||||
<textarea name="address" id="address" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Service Type')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Service Type')}</label>
|
||||
<div class="col-md-9">
|
||||
<select class="form-control" id="service_type" name="service_type">
|
||||
<option value="Hotspot" {if $d['service_type'] eq 'Hotspot' }selected{/if}>Hotspot
|
||||
</option>
|
||||
@ -84,32 +83,35 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Customers Attributes add start -->
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Attributes')}</label>
|
||||
<div id="custom-fields-container" class="col-md-6">
|
||||
<button class="btn btn-success btn-sm" type="button"
|
||||
id="add-custom-field">+</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">{Lang::T('Attributes')}</div>
|
||||
<div class="panel-body">
|
||||
<!-- Customers Attributes add start -->
|
||||
<div id="custom-fields-container">
|
||||
|
||||
</div>
|
||||
<!-- Customers Attributes add end -->
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-2 col-lg-10">
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<button class="btn btn-success btn-block" type="button"
|
||||
id="add-custom-field">{Lang::T('Add')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<center>
|
||||
<button class="btn btn-primary" type="submit">
|
||||
{Lang::T('Save Changes')}
|
||||
</button>
|
||||
Or <a href="{$_url}customers/list">{Lang::T('Cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br><a href="{$_url}customers/list" class="btn btn-link">{Lang::T('Cancel')}</a>
|
||||
</center>
|
||||
</form>
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
<script type="text/javascript">
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
var customFieldsContainer = document.getElementById('custom-fields-container');
|
||||
var addCustomFieldButton = document.getElementById('add-custom-field');
|
||||
@ -119,12 +121,10 @@
|
||||
var newField = document.createElement('div');
|
||||
newField.className = 'form-group';
|
||||
newField.innerHTML = `
|
||||
<label class="col-md-2 control-label">Name:</label>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-4">
|
||||
<input type="text" class="form-control" name="custom_field_name[]" placeholder="Name">
|
||||
</div>
|
||||
<label class="col-md-2 control-label">Value:</label>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-6">
|
||||
<input type="text" class="form-control" name="custom_field_value[]" placeholder="Value">
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
@ -141,7 +141,7 @@
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
{/literal}
|
||||
|
||||
|
||||
|
@ -1,16 +1,15 @@
|
||||
{include file="sections/header.tpl"}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12 col-md-12">
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}customers/edit-post">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">{Lang::T('Edit Contact')}</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}customers/edit-post">
|
||||
<input type="hidden" name="id" value="{$d['id']}">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Username')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Username')}</label>
|
||||
<div class="col-md-9">
|
||||
<div class="input-group">
|
||||
{if $_c['country_code_phone']!= ''}
|
||||
<span class="input-group-addon" id="basic-addon1">+</span>
|
||||
@ -25,21 +24,21 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Full Name')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Full Name')}</label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control" id="fullname" name="fullname"
|
||||
value="{$d['fullname']}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Email')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Email')}</label>
|
||||
<div class="col-md-9">
|
||||
<input type="email" class="form-control" id="email" name="email" value="{$d['email']}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Phone Number')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Phone Number')}</label>
|
||||
<div class="col-md-9">
|
||||
<div class="input-group">
|
||||
{if $_c['country_code_phone']!= ''}
|
||||
<span class="input-group-addon" id="basic-addon1">+</span>
|
||||
@ -53,8 +52,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Password')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Password')}</label>
|
||||
<div class="col-md-9">
|
||||
<input type="password" autocomplete="off" class="form-control" id="password" name="password"
|
||||
onmouseleave="this.type = 'password'" onmouseenter="this.type = 'text'"
|
||||
value="{$d['password']}">
|
||||
@ -62,8 +61,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('PPPOE Password')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('PPPOE Password')}</label>
|
||||
<div class="col-md-9">
|
||||
<input type="password" autocomplete="off" class="form-control" id="pppoe_password"
|
||||
name="pppoe_password" value="{$d['pppoe_password']}"
|
||||
onmouseleave="this.type = 'password'" onmouseenter="this.type = 'text'">
|
||||
@ -73,14 +72,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Address')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Address')}</label>
|
||||
<div class="col-md-9">
|
||||
<textarea name="address" id="address" class="form-control">{$d['address']}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Service Type')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Service Type')}</label>
|
||||
<div class="col-md-9">
|
||||
<select class="form-control" id="service_type" name="service_type">
|
||||
<option value="Hotspot" {if $d['service_type'] eq 'Hotspot' }selected{/if}>Hotspot
|
||||
</option>
|
||||
@ -89,43 +88,49 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">{Lang::T('Attributes')}</div>
|
||||
<div class="panel-body">
|
||||
<!--Customers Attributes edit start -->
|
||||
{if $customFields}
|
||||
{foreach $customFields as $customField}
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label"
|
||||
<label class="col-md-4 control-label"
|
||||
for="{$customField.field_name}">{$customField.field_name}</label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control" type="text" name="custom_fields[{$customField.field_name}]"
|
||||
id="{$customField.field_name}" value="{$customField.field_value}">
|
||||
</div>
|
||||
<label class="col-md-2">
|
||||
<input type="checkbox" name="delete_custom_fields[]" value="{$customField.field_name}"> Delete
|
||||
</label>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
<!--Customers Attributes edit end -->
|
||||
<!--Customers Attributes add start -->
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Attributes')}</label>
|
||||
<div id="custom-fields-container" class="col-md-6">
|
||||
<button class="btn btn-success btn-sm" type="button" id="add-custom-field">+</button>
|
||||
<!-- Customers Attributes add start -->
|
||||
<div id="custom-fields-container">
|
||||
</div>
|
||||
<!-- Customers Attributes add end -->
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<button class="btn btn-success btn-block" type="button"
|
||||
id="add-custom-field">{Lang::T('Add')}</button>
|
||||
</div>
|
||||
</div>
|
||||
<!--Customers Attributes add end -->
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-2 col-lg-10">
|
||||
</div>
|
||||
</div>
|
||||
<center>
|
||||
<button class="btn btn-primary" type="submit">
|
||||
{Lang::T('Save Changes')}
|
||||
</button>
|
||||
Or <a href="{$_url}customers/list">{Lang::T('Cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br><a href="{$_url}customers/list" class="btn btn-link">{Lang::T('Cancel')}</a>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
@ -138,12 +143,10 @@
|
||||
var newField = document.createElement('div');
|
||||
newField.className = 'form-group';
|
||||
newField.innerHTML = `
|
||||
<label class="col-md-2 control-label">Name:</label>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-4">
|
||||
<input type="text" class="form-control" name="custom_field_name[]" placeholder="Name">
|
||||
</div>
|
||||
<label class="col-md-2 control-label">Value:</label>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-6">
|
||||
<input type="text" class="form-control" name="custom_field_value[]" placeholder="Value">
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
|
@ -29,9 +29,9 @@
|
||||
$(this).html(
|
||||
`<span class="loading"></span>`
|
||||
);
|
||||
setTimeout(() => {
|
||||
$(this).prop("disabled", true);
|
||||
}, 100);
|
||||
// setTimeout(() => {
|
||||
// $(this).prop("disabled", true);
|
||||
// }, 100);
|
||||
}, false);
|
||||
} else {
|
||||
if (el.attachEvent) { // IE before version 9
|
||||
@ -39,9 +39,9 @@
|
||||
$(this).html(
|
||||
`<span class="loading"></span>`
|
||||
);
|
||||
setTimeout(() => {
|
||||
$(this).prop("disabled", true);
|
||||
}, 100);
|
||||
// setTimeout(() => {
|
||||
// $(this).prop("disabled", true);
|
||||
// }, 100);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -183,8 +183,10 @@
|
||||
{/if}
|
||||
<li {if $_routes[1] eq 'recharge'}class="active" {/if}><a
|
||||
href="{$_url}prepaid/recharge">{Lang::T('Recharge Account')}</a></li>
|
||||
{if $_c['enable_balance'] == 'yes'}
|
||||
<li {if $_routes[1] eq 'deposit'}class="active" {/if}><a
|
||||
href="{$_url}prepaid/deposit">{Lang::T('Refill Balance')}</a></li>
|
||||
{/if}
|
||||
{$_MENU_PREPAID}
|
||||
</ul>
|
||||
</li>
|
||||
@ -205,8 +207,10 @@
|
||||
href="{$_url}services/pppoe">{Lang::T('PPPOE Plans')}</a></li>
|
||||
<li {if $_routes[1] eq 'list'}class="active" {/if}><a
|
||||
href="{$_url}bandwidth/list">{Lang::T('Bandwidth Plans')}</a></li>
|
||||
{if $_c['enable_balance'] == 'yes'}
|
||||
<li {if $_routes[1] eq 'balance'}class="active" {/if}><a
|
||||
href="{$_url}services/balance">{Lang::T('Balance Plans')}</a></li>
|
||||
{/if}
|
||||
{$_MENU_SERVICES}
|
||||
</ul>
|
||||
</li>
|
||||
@ -278,7 +282,8 @@
|
||||
<li {if $_routes[1] eq 'Announcement'}class="active" {/if}><a
|
||||
href="{$_url}pages/Announcement">{Lang::T('Announcement')}</a></li>
|
||||
<li {if $_routes[1] eq 'Announcement_Customer'}class="active" {/if}><a
|
||||
href="{$_url}pages/Announcement_Customer">{Lang::T('Customer Announcement')}</a></li>
|
||||
href="{$_url}pages/Announcement_Customer">{Lang::T('Customer Announcement')}</a>
|
||||
</li>
|
||||
<li {if $_routes[1] eq 'Registration_Info'}class="active" {/if}><a
|
||||
href="{$_url}pages/Registration_Info">{Lang::T('Registration Info')}</a></li>
|
||||
<li {if $_routes[1] eq 'Privacy_Policy'}class="active" {/if}><a
|
||||
|
@ -65,7 +65,7 @@
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">{Lang::T('User Type')}</label>
|
||||
<div class="col-md-9">
|
||||
<select name="user_type" id="user_type" class="form-control">
|
||||
<select name="user_type" id="user_type" class="form-control" onchange="checkUserType(this)">
|
||||
{if $_admin['user_type'] eq 'Agent'}
|
||||
<option value="Sales" {if $d['user_type'] eq 'Sales'}selected="selected" {/if}>Sales
|
||||
</option>
|
||||
@ -87,7 +87,7 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group {if $d['user_type'] eq 'Sales'}hidden{/if}" id="agentChooser">
|
||||
<div class="form-group {if $d['user_type'] neq 'Sales'}hidden{/if}" id="agentChooser">
|
||||
<label class="col-md-3 control-label">{Lang::T('Agent')}</label>
|
||||
<div class="col-md-9">
|
||||
<select name="root" id="root" class="form-control">
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "2024.3.3"
|
||||
"version": "2024.3.6"
|
||||
}
|
Reference in New Issue
Block a user