Merge branch 'Development' of https://github.com/Focuslinkstech/phpnuxbill into Development

This commit is contained in:
Focuslinkstech 2024-03-08 09:37:56 +01:00
commit 08790e7295
39 changed files with 634 additions and 341 deletions

View File

@ -2,6 +2,38 @@
# CHANGELOG # 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
- Add Customer Announcements by @Gerandonk
- Add PPPOE Period Validity by @Gerandonk
## 2024.2.29
- Fix Hook Functionality
- Change Customer Menu
## 2024.2.28
- Fix Buy Plan with Balance
- Add Expired date for reminder
## 2024.2.27
- fix path notification
- redirect to dashboard if already login
## 2024.2.26 ## 2024.2.26
- Clean Unused JS and CSS - Clean Unused JS and CSS

View File

@ -76,10 +76,10 @@ if ($_app_stage != 'Live') {
define('U', APP_URL . '/index.php?_route='); define('U', APP_URL . '/index.php?_route=');
// notification message // notification message
if (file_exists($root_path . $UPLOAD_PATH . DIRECTORY_SEPARATOR . "notifications.json")) { if (file_exists($UPLOAD_PATH . DIRECTORY_SEPARATOR . "notifications.json")) {
$_notifmsg = json_decode(file_get_contents($root_path . $UPLOAD_PATH . DIRECTORY_SEPARATOR . 'notifications.json'), true); $_notifmsg = json_decode(file_get_contents($UPLOAD_PATH . DIRECTORY_SEPARATOR . 'notifications.json'), true);
} }
$_notifmsg_default = json_decode(file_get_contents($root_path . $UPLOAD_PATH . DIRECTORY_SEPARATOR . 'notifications.default.json'), true); $_notifmsg_default = json_decode(file_get_contents($UPLOAD_PATH . DIRECTORY_SEPARATOR . 'notifications.default.json'), true);
//register all plugin //register all plugin
foreach (glob(File::pathFixer($PLUGIN_PATH . DIRECTORY_SEPARATOR . '*.php')) as $filename) { foreach (glob(File::pathFixer($PLUGIN_PATH . DIRECTORY_SEPARATOR . '*.php')) as $filename) {
@ -96,6 +96,7 @@ $result = ORM::for_table('tbl_appconfig')->find_many();
foreach ($result as $value) { foreach ($result as $value) {
$config[$value['setting']] = $value['value']; $config[$value['setting']] = $value['value'];
} }
$_c = $config;
if (empty($http_proxy) && !empty($config['http_proxy'])) { if (empty($http_proxy) && !empty($config['http_proxy'])) {
$http_proxy = $config['http_proxy']; $http_proxy = $config['http_proxy'];
if (empty($http_proxyauth) && !empty($config['http_proxyauth'])) { if (empty($http_proxyauth) && !empty($config['http_proxyauth'])) {
@ -237,7 +238,7 @@ function r2($to, $ntype = 'e', $msg = '')
exit; exit;
} }
function _alert($text, $type = 'success', $url = "home") function _alert($text, $type = 'success', $url = "home", $time = 3)
{ {
global $ui; global $ui;
if (!isset($ui)) return; if (!isset($ui)) return;
@ -250,8 +251,10 @@ function _alert($text, $type = 'success', $url = "home")
} }
$ui->assign('text', $text); $ui->assign('text', $text);
$ui->assign('type', $type); $ui->assign('type', $type);
$ui->assign('time', $time);
$ui->assign('url', $url); $ui->assign('url', $url);
$ui->display('alert.tpl'); $ui->display('alert.tpl');
die();
} }

View File

@ -91,7 +91,7 @@ CREATE TABLE `tbl_plans` (
`data_limit` int(10) UNSIGNED DEFAULT NULL, `data_limit` int(10) UNSIGNED DEFAULT NULL,
`data_unit` enum('MB','GB') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, `data_unit` enum('MB','GB') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`validity` int(10) NOT NULL, `validity` int(10) NOT NULL,
`validity_unit` enum('Mins','Hrs','Days','Months') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `validity_unit` enum('Mins','Hrs','Days','Months','Period') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`shared_users` int(10) DEFAULT NULL, `shared_users` int(10) DEFAULT NULL,
`routers` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `routers` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`is_radius` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1 is radius', `is_radius` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1 is radius',

View File

@ -1 +1,3 @@
Pengumuman!!<br>Besok libur<br><br>Announcement!!<br>Tomorrow holiday<br> Pengumuman!!<br>Besok libur<br><br>Announcement!!<br>Tomorrow holiday<br><br>
<br>
This Announcement is for Login Page.

View File

@ -0,0 +1,8 @@
Pengumuman Pelanggan!!<br>
Besok libur<br>
<br>
Customer Announcement!!<br>
Tomorrow holiday<br>
<br>
<br>
This Announcement is for Customer Dashboard

View File

@ -51,7 +51,7 @@ class Admin
if ($id) { if ($id) {
return ORM::for_table('tbl_users')->find_one($id); return ORM::for_table('tbl_users')->find_one($id);
} else { } else {
return []; return null;
} }
} }
} }

View File

@ -38,6 +38,7 @@ function register_menu($name, $admin, $function, $position, $icon = '', $label =
$hook_registered = array(); $hook_registered = array();
function register_hook($action, $function){ function register_hook($action, $function){
global $hook_registered;
$hook_registered[] = [ $hook_registered[] = [
'action' => $action, 'action' => $action,
'function' => $function 'function' => $function

View File

@ -60,25 +60,30 @@ class Message
global $config; global $config;
run_hook('send_whatsapp'); #HOOK run_hook('send_whatsapp'); #HOOK
if (!empty($config['wa_url'])) { 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); $waurl = str_replace('[text]', urlencode($txt), $waurl);
return Http::getData($waurl); return Http::getData($waurl);
} }
} }
public static function sendPackageNotification($phone, $name, $package, $price, $message, $via) public static function sendPackageNotification($customer, $package, $price, $message, $via)
{ {
$msg = str_replace('[[name]]', $name, $message); global $u;
$msg = str_replace('[[name]]', $customer['fullname'], $message);
$msg = str_replace('[[username]]', $customer['username'], $msg);
$msg = str_replace('[[package]]', $package, $msg); $msg = str_replace('[[package]]', $package, $msg);
$msg = str_replace('[[price]]', $price, $msg); $msg = str_replace('[[price]]', $price, $msg);
if($u){
$msg = str_replace('[[expired_date]]', Lang::dateAndTimeFormat($u['expiration'], $u['time']), $msg);
}
if ( if (
!empty($phone) && strlen($phone) > 5 !empty($customer['phonenumber']) && strlen($customer['phonenumber']) > 5
&& !empty($message) && in_array($via, ['sms', 'wa']) && !empty($message) && in_array($via, ['sms', 'wa'])
) { ) {
if ($via == 'sms') { if ($via == 'sms') {
Message::sendSMS($phone, $msg); Message::sendSMS($customer['phonenumber'], $msg);
} else if ($via == 'wa') { } else if ($via == 'wa') {
Message::sendWhatsapp($phone, $msg); Message::sendWhatsapp($customer['phonenumber'], $msg);
} }
} }
return "$via: $msg"; return "$via: $msg";

View File

@ -19,7 +19,7 @@ class Package
*/ */
public static function rechargeUser($id_customer, $router_name, $plan_id, $gateway, $channel) public static function rechargeUser($id_customer, $router_name, $plan_id, $gateway, $channel)
{ {
global $config, $admin; global $config, $admin, $c, $p, $b, $t, $d;
$date_now = date("Y-m-d H:i:s"); $date_now = date("Y-m-d H:i:s");
$date_only = date("Y-m-d"); $date_only = date("Y-m-d");
$time_only = date("H:i:s"); $time_only = date("H:i:s");
@ -31,6 +31,16 @@ 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)->where('enabled', '1')->find_one(); $p = ORM::for_table('tbl_plans')->where('id', $plan_id)->where('enabled', '1')->find_one();
if ($p['validity_unit'] == 'Period') {
$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') { if ($router_name == 'balance') {
// insert table transactions // insert table transactions
@ -48,8 +58,8 @@ class Package
$t->routers = $router_name; $t->routers = $router_name;
$t->type = "Balance"; $t->type = "Balance";
if ($admin) { if ($admin) {
$t->admin_id = $admin['id']; $t->admin_id = ($admin['id']) ? $admin['id'] : '0';
}else{ } else {
$t->admin_id = '0'; $t->admin_id = '0';
} }
$t->save(); $t->save();
@ -94,9 +104,24 @@ class Package
->where('Type', $p['type']) ->where('Type', $p['type'])
->find_one(); ->find_one();
run_hook("recharge_user");
$mikrotik = Mikrotik::info($router_name); $mikrotik = Mikrotik::info($router_name);
if ($p['validity_unit'] == 'Months') { if ($p['validity_unit'] == 'Months') {
$date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' month')); $date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' month'));
} else if ($p['validity_unit'] == 'Period') {
$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-{$f['field_value']}", strtotime('+0 month'));
} else {
$date_exp = date("Y-m-{$f['field_value']}", strtotime('+' . $p['validity'] . ' month'));
};
$time = date("23:59:00");
} else if ($p['validity_unit'] == 'Days') { } else if ($p['validity_unit'] == 'Days') {
$date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' day')); $date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' day'));
} else if ($p['validity_unit'] == 'Hrs') { } else if ($p['validity_unit'] == 'Hrs') {
@ -116,6 +141,9 @@ class Package
if ($p['validity_unit'] == 'Months') { if ($p['validity_unit'] == 'Months') {
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months')); $date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
$time = $b['time']; $time = $b['time'];
} else if ($p['validity_unit'] == 'Period') {
$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') { } else if ($p['validity_unit'] == 'Days') {
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days')); $date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days'));
$time = $b['time']; $time = $b['time'];
@ -152,8 +180,8 @@ class Package
$b->routers = $router_name; $b->routers = $router_name;
$b->type = "Hotspot"; $b->type = "Hotspot";
if ($admin) { if ($admin) {
$b->admin_id = $admin['id']; $b->admin_id = ($admin['id']) ? $admin['id'] : '0';
}else{ } else {
$b->admin_id = '0'; $b->admin_id = '0';
} }
$b->save(); $b->save();
@ -172,11 +200,32 @@ class Package
$t->routers = $router_name; $t->routers = $router_name;
$t->type = "Hotspot"; $t->type = "Hotspot";
if ($admin) { if ($admin) {
$t->admin_id = $admin['id']; $t->admin_id = ($admin['id']) ? $admin['id'] : '0';
}else{ } else {
$t->admin_id = '0'; $t->admin_id = '0';
} }
$t->save(); $t->save();
// 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 .
"\nPrice: " . Lang::moneyFormat($p['price']));
} else { } else {
if ($p['is_radius']) { if ($p['is_radius']) {
Radius::customerAddPlan($c, $p, "$date_exp $time"); Radius::customerAddPlan($c, $p, "$date_exp $time");
@ -201,18 +250,29 @@ class Package
$d->routers = $router_name; $d->routers = $router_name;
$d->type = "Hotspot"; $d->type = "Hotspot";
if ($admin) { if ($admin) {
$d->admin_id = $admin['id']; $d->admin_id = ($admin['id']) ? $admin['id'] : '0';
}else{ } else {
$d->admin_id = '0'; $d->admin_id = '0';
} }
$d->save(); $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 // insert table transactions
$t = ORM::for_table('tbl_transactions')->create(); $t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . Package::_raid(5); $t->invoice = "INV-" . Package::_raid(5);
$t->username = $c['username']; $t->username = $c['username'];
$t->plan_name = $p['name_plan']; $t->plan_name = $p['name_plan'];
$t->price = $p['price']; if ($gi > $p['price']) {
$t->price = $p['price'];
} else {
$t->price = $gi;
}
$t->recharged_on = $date_only; $t->recharged_on = $date_only;
$t->recharged_time = $time_only; $t->recharged_time = $time_only;
$t->expiration = $date_exp; $t->expiration = $date_exp;
@ -221,17 +281,36 @@ class Package
$t->routers = $router_name; $t->routers = $router_name;
$t->type = "Hotspot"; $t->type = "Hotspot";
if ($admin) { if ($admin) {
$t->admin_id = $admin['id']; $t->admin_id = ($admin['id']) ? $admin['id'] : '0';
}else{ } else {
$t->admin_id = '0'; $t->admin_id = '0';
} }
$t->save(); $t->save();
// 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 .
"\nPrice: " . Lang::moneyFormat($p['price']));
} }
Message::sendTelegram("#u$c[username] #buy #Hotspot \n" . $p['name_plan'] .
"\nRouter: " . $router_name .
"\nGateway: " . $gateway .
"\nChannel: " . $channel .
"\nPrice: " . Lang::moneyFormat($p['price']));
} else { } else {
if ($b) { if ($b) {
@ -240,6 +319,9 @@ class Package
if ($p['validity_unit'] == 'Months') { if ($p['validity_unit'] == 'Months') {
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months')); $date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
$time = $b['time']; $time = $b['time'];
} else if ($p['validity_unit'] == 'Period') {
$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') { } else if ($p['validity_unit'] == 'Days') {
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days')); $date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days'));
$time = $b['time']; $time = $b['time'];
@ -276,8 +358,8 @@ class Package
$b->routers = $router_name; $b->routers = $router_name;
$b->type = "PPPOE"; $b->type = "PPPOE";
if ($admin) { if ($admin) {
$b->admin_id = $admin['id']; $b->admin_id = ($admin['id']) ? $admin['id'] : '0';
}else{ } else {
$b->admin_id = '0'; $b->admin_id = '0';
} }
$b->save(); $b->save();
@ -296,11 +378,32 @@ class Package
$t->routers = $router_name; $t->routers = $router_name;
$t->type = "PPPOE"; $t->type = "PPPOE";
if ($admin) { if ($admin) {
$t->admin_id = $admin['id']; $t->admin_id = ($admin['id']) ? $admin['id'] : '0';
}else{ } else {
$t->admin_id = '0'; $t->admin_id = '0';
} }
$t->save(); $t->save();
// 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 .
"\nPrice: " . Lang::moneyFormat($p['price']));
} else { } else {
if ($p['is_radius']) { if ($p['is_radius']) {
Radius::customerAddPlan($c, $p, "$date_exp $time"); Radius::customerAddPlan($c, $p, "$date_exp $time");
@ -325,18 +428,29 @@ class Package
$d->routers = $router_name; $d->routers = $router_name;
$d->type = "PPPOE"; $d->type = "PPPOE";
if ($admin) { if ($admin) {
$d->admin_id = $admin['id']; $d->admin_id = ($admin['id']) ? $admin['id'] : '0';
}else{ } else {
$d->admin_id = '0'; $d->admin_id = '0';
} }
$d->save(); $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 // insert table transactions
$t = ORM::for_table('tbl_transactions')->create(); $t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . Package::_raid(5); $t->invoice = "INV-" . Package::_raid(5);
$t->username = $c['username']; $t->username = $c['username'];
$t->plan_name = $p['name_plan']; $t->plan_name = $p['name_plan'];
$t->price = $p['price']; if ($gi > $p['price']) {
$t->price = $p['price'];
} else {
$t->price = $gi;
}
$t->recharged_on = $date_only; $t->recharged_on = $date_only;
$t->recharged_time = $time_only; $t->recharged_time = $time_only;
$t->expiration = $date_exp; $t->expiration = $date_exp;
@ -344,20 +458,39 @@ class Package
$t->method = "$gateway - $channel"; $t->method = "$gateway - $channel";
$t->routers = $router_name; $t->routers = $router_name;
if ($admin) { if ($admin) {
$t->admin_id = $admin['id']; $t->admin_id = ($admin['id']) ? $admin['id'] : '0';
}else{ } else {
$t->admin_id = '0'; $t->admin_id = '0';
} }
$t->type = "PPPOE"; $t->type = "PPPOE";
$t->save(); $t->save();
}
Message::sendTelegram("#u$c[username] #buy #PPPOE \n" . $p['name_plan'] .
"\nRouter: " . $router_name .
"\nGateway: " . $gateway .
"\nChannel: " . $channel .
"\nPrice: " . Lang::moneyFormat($p['price']));
}
// 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 .
"\nPrice: " . Lang::moneyFormat($p['price']));
}
}
run_hook("recharge_user_finish");
Message::sendInvoice($c, $t); Message::sendInvoice($c, $t);
return true; return true;
} }
@ -511,6 +644,6 @@ class Package
$invoice .= Lang::pad("", '=') . "\n"; $invoice .= Lang::pad("", '=') . "\n";
$invoice .= Lang::pad($config['note'], ' ', 2) . "\n"; $invoice .= Lang::pad($config['note'], ' ', 2) . "\n";
$ui->assign('whatsapp', urlencode("```$invoice```")); $ui->assign('whatsapp', urlencode("```$invoice```"));
$ui->assign('in',$in); $ui->assign('in', $in);
} }
} }

View File

@ -78,9 +78,9 @@ $ui->assign('_domain', str_replace('www.', '', parse_url(APP_URL, PHP_URL_HOST))
$ui->assign('_url', APP_URL . '/index.php?_route='); $ui->assign('_url', APP_URL . '/index.php?_route=');
$ui->assign('_path', __DIR__); $ui->assign('_path', __DIR__);
$ui->assign('_c', $config); $ui->assign('_c', $config);
$ui->assign('UPLOAD_PATH', $UPLOAD_PATH); $ui->assign('UPLOAD_PATH', str_replace($root_path, '', $UPLOAD_PATH));
$ui->assign('CACHE_PATH', $CACHE_PATH); $ui->assign('CACHE_PATH', str_replace($root_path, '', $CACHE_PATH));
$ui->assign('PAGES_PATH', $PAGES_PATH); $ui->assign('PAGES_PATH', str_replace($root_path, '', $PAGES_PATH));
$ui->assign('_system_menu', 'dashboard'); $ui->assign('_system_menu', 'dashboard');
function _msglog($type, $msg) function _msglog($type, $msg)

View File

@ -5,6 +5,10 @@
* by https://t.me/ibnux * by https://t.me/ibnux
**/ **/
if(Admin::getID()){
r2(U.'dashboard');
}
if (isset($routes['1'])) { if (isset($routes['1'])) {
$do = $routes['1']; $do = $routes['1'];
} else { } else {

View File

@ -12,6 +12,9 @@ $ui->assign('_system_menu', 'customers');
$action = $routes['1']; $action = $routes['1'];
$ui->assign('_admin', $admin); $ui->assign('_admin', $admin);
if(empty($action)){
$action = 'list';
}
switch ($action) { switch ($action) {
case 'list': case 'list':
@ -274,7 +277,7 @@ switch ($action) {
} catch (Throwable $e) { } catch (Throwable $e) {
} }
try { try {
$c->delete(); if($c) $c->delete();
} catch (Exception $e) { } catch (Exception $e) {
} catch (Throwable $e) { } catch (Throwable $e) {
} }

View File

@ -4,5 +4,10 @@
* by https://t.me/ibnux * by https://t.me/ibnux
**/ **/
if(Admin::getID()){
r2(APP_URL.'/index.php?_route=dashboard'); r2(U.'dashboard');
}if(User::getID()){
r2(U.'home');
}else{
r2(U.'login');
}

View File

@ -62,10 +62,11 @@ switch ($action) {
$title = ' Reports [' . $mdate . ']'; $title = ' Reports [' . $mdate . ']';
$title = str_replace('-', ' ', $title); $title = str_replace('-', ' ', $title);
$UPLOAD_URL_PATH = str_replace($root_path, '', $UPLOAD_PATH);
if (file_exists($UPLOAD_PATH . '/logo.png')) { if (file_exists($UPLOAD_PATH . '/logo.png')) {
$logo = $UPLOAD_PATH . '/logo.png'; $logo = $UPLOAD_URL_PATH . '/logo.png';
} else { } else {
$logo = $UPLOAD_PATH . '/logo.default.png'; $logo = $UPLOAD_URL_PATH . '/logo.default.png';
} }
if ($x) { if ($x) {
@ -234,10 +235,12 @@ EOF;
$title = ' Reports [' . $mdate . ']'; $title = ' Reports [' . $mdate . ']';
$title = str_replace('-', ' ', $title); $title = str_replace('-', ' ', $title);
$UPLOAD_URL_PATH = str_replace($root_path, '', $UPLOAD_PATH);
if (file_exists($UPLOAD_PATH . '/logo.png')) { if (file_exists($UPLOAD_PATH . '/logo.png')) {
$logo = $UPLOAD_PATH . '/logo.png'; $logo = $UPLOAD_URL_PATH . '/logo.png';
} else { } else {
$logo = $UPLOAD_PATH . '/logo.default.png'; $logo = $UPLOAD_URL_PATH . '/logo.default.png';
} }
if ($x) { if ($x) {

View File

@ -99,9 +99,6 @@ if (isset($_GET['recharge']) && !empty($_GET['recharge'])) {
if(!$plan['enabled']){ if(!$plan['enabled']){
r2(U . "home", 'e', 'Plan is not exists'); r2(U . "home", 'e', 'Plan is not exists');
} }
if($plan['allow_purchase'] != 'yes'){
r2(U . "home", 'e', 'Cannot recharge this plan');
}
if ($user['balance'] > $plan['price']) { if ($user['balance'] > $plan['price']) {
r2(U . "order/pay/$router[id]/$bill[plan_id]", 'e', 'Order Plan'); r2(U . "order/pay/$router[id]/$bill[plan_id]", 'e', 'Order Plan');
} else { } else {

View File

@ -5,6 +5,10 @@
* by https://t.me/ibnux * by https://t.me/ibnux
**/ **/
if(User::getID()){
r2(U.'home');
}
if (isset($routes['1'])) { if (isset($routes['1'])) {
$do = $routes['1']; $do = $routes['1'];
} else { } else {

View File

@ -142,7 +142,7 @@ switch ($action) {
$ui->display('user-orderView.tpl'); $ui->display('user-orderView.tpl');
break; break;
case 'pay': case 'pay':
if ($_c['enable_balance'] != 'yes' && $config['allow_balance_transfer'] != '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"));
} }
$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']);
@ -176,7 +176,7 @@ switch ($action) {
} }
break; break;
case 'send': case 'send':
if ($_c['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"));
} }
$ui->assign('_title', Lang::T('Buy for friend')); $ui->assign('_title', Lang::T('Buy for friend'));

View File

@ -30,15 +30,16 @@ switch ($action) {
r2(U . "settings/app", 's', 'Test Telegram has been send<br>Result: ' . $result); r2(U . "settings/app", 's', 'Test Telegram has been send<br>Result: ' . $result);
} }
$UPLOAD_URL_PATH = str_replace($root_path,'', $UPLOAD_PATH);
if (file_exists($UPLOAD_PATH . DIRECTORY_SEPARATOR . 'logo.png')) { if (file_exists($UPLOAD_PATH . DIRECTORY_SEPARATOR . 'logo.png')) {
$logo = $UPLOAD_PATH . DIRECTORY_SEPARATOR . 'logo.png?' . time(); $logo = $UPLOAD_URL_PATH . DIRECTORY_SEPARATOR . 'logo.png?' . time();
} else { } else {
$logo = $UPLOAD_PATH . DIRECTORY_SEPARATOR . 'logo.default.png'; $logo = $UPLOAD_URL_PATH . DIRECTORY_SEPARATOR . 'logo.default.png';
} }
$ui->assign('logo', $logo); $ui->assign('logo', $logo);
if ($_c['radius_enable'] && empty($_c['radius_client'])) { if ($config['radius_enable'] && empty($config['radius_client'])) {
try { try {
$_c['radius_client'] = Radius::getClient(); $config['radius_client'] = Radius::getClient();
$ui->assign('_c', $_c); $ui->assign('_c', $_c);
} catch (Exception $e) { } catch (Exception $e) {
//ignore //ignore
@ -495,11 +496,11 @@ switch ($action) {
$date_now = date("Y-m-d H:i:s"); $date_now = date("Y-m-d H:i:s");
run_hook('add_admin'); #HOOK run_hook('add_admin'); #HOOK
if ($msg == '') { if ($msg == '') {
$password = Password::_crypt($password); $passwordC = Password::_crypt($password);
$d = ORM::for_table('tbl_users')->create(); $d = ORM::for_table('tbl_users')->create();
$d->username = $username; $d->username = $username;
$d->fullname = $fullname; $d->fullname = $fullname;
$d->password = $password; $d->password = $passwordC;
$d->user_type = $user_type; $d->user_type = $user_type;
$d->phone = $phone; $d->phone = $phone;
$d->email = $email; $d->email = $email;

View File

@ -24,7 +24,7 @@ echo "Found " . count($d) . " user(s)\n";
run_hook('cronjob'); #HOOK run_hook('cronjob'); #HOOK
foreach ($d as $ds) { foreach ($d as $ds) {
if ($ds['type'] == 'Hotspot') { if ($ds['type'] == 'Hotspot') { # HOTSPOT
$date_now = strtotime(date("Y-m-d H:i:s")); $date_now = strtotime(date("Y-m-d H:i:s"));
$expiration = strtotime($ds['expiration'] . ' ' . $ds['time']); $expiration = strtotime($ds['expiration'] . ' ' . $ds['time']);
echo $ds['expiration'] . " : " . (($isCli) ? $ds['username'] : Lang::maskText($ds['username'])); echo $ds['expiration'] . " : " . (($isCli) ? $ds['username'] : Lang::maskText($ds['username']));
@ -54,7 +54,7 @@ foreach ($d as $ds) {
} }
Mikrotik::removeHotspotActiveUser($client, $c['username']); 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 //update database user dengan status off
$u->status = 'off'; $u->status = 'off';
$u->save(); $u->save();
@ -82,7 +82,7 @@ foreach ($d as $ds) {
} }
} else } else
echo " : ACTIVE \r\n"; echo " : ACTIVE \r\n";
} else { } else { # PPPOE
$date_now = strtotime(date("Y-m-d H:i:s")); $date_now = strtotime(date("Y-m-d H:i:s"));
$expiration = strtotime($ds['expiration'] . ' ' . $ds['time']); $expiration = strtotime($ds['expiration'] . ' ' . $ds['time']);
echo $ds['expiration'] . " : " . (($isCli) ? $ds['username'] : Lang::maskText($ds['username'])); echo $ds['expiration'] . " : " . (($isCli) ? $ds['username'] : Lang::maskText($ds['username']));
@ -109,7 +109,7 @@ foreach ($d as $ds) {
} }
Mikrotik::removePpoeActive($client, $c['username']); 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->status = 'off';
$u->save(); $u->save();

View File

@ -40,11 +40,11 @@ foreach ($d as $ds) {
$c = ORM::for_table('tbl_customers')->where('id', $ds['customer_id'])->find_one(); $c = ORM::for_table('tbl_customers')->where('id', $ds['customer_id'])->find_one();
$price = Lang::moneyFormat($p['price']); $price = Lang::moneyFormat($p['price']);
if ($ds['expiration'] == $day7) { 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) { } 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) { } 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";
} }
} }
} }

View File

@ -456,5 +456,10 @@
"Click_Here": "Click Here", "Click_Here": "Click Here",
"danger": "danger", "danger": "danger",
"Logout_Successful": "Logout Successful", "Logout_Successful": "Logout Successful",
"warning": "warning" "warning": "warning",
"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",
"Add": "Add"
} }

View File

@ -69,5 +69,8 @@
"2024.2.23" : [ "2024.2.23" : [
"ALTER TABLE `tbl_transactions` ADD `admin_id` INT NOT NULL DEFAULT '1' AFTER `type`;", "ALTER TABLE `tbl_transactions` 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_user_recharges` ADD `admin_id` INT NOT NULL DEFAULT '1' AFTER `type`;"
],
"2024.3.3" : [
"ALTER TABLE `tbl_plans` CHANGE `validity_unit` `validity_unit` ENUM('Mins','Hrs','Days','Months','Period') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;"
] ]
} }

View File

@ -4,7 +4,7 @@
<head> <head>
<meta charset="utf-8"> <meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"> <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="shortcut icon" href="ui/ui/images/logo.png" type="image/x-icon" />
<link rel="stylesheet" href="ui/ui/styles/bootstrap.min.css"> <link rel="stylesheet" href="ui/ui/styles/bootstrap.min.css">
@ -16,7 +16,7 @@
<body class="hold-transition login-page"> <body class="hold-transition login-page">
<div class="login-box"> <div class="login-box">
<div class="login-logo"> <div class="login-logo">
<b>Nux</b>Billing {$_c['CompanyName']}
</div> </div>
<div class="login-box-body"> <div class="login-box-body">
<p class="login-box-msg">{Lang::T('Enter Admin Area')}</p> <p class="login-box-msg">{Lang::T('Enter Admin Area')}</p>

View File

@ -9,7 +9,7 @@
<link rel="shortcut icon" href="ui/ui/images/logo.png" type="image/x-icon" /> <link rel="shortcut icon" href="ui/ui/images/logo.png" type="image/x-icon" />
<link rel="stylesheet" href="ui/ui/styles/bootstrap.min.css"> <link rel="stylesheet" href="ui/ui/styles/bootstrap.min.css">
<link rel="stylesheet" href="ui/ui/styles/modern-AdminLTE.min.css"> <link rel="stylesheet" href="ui/ui/styles/modern-AdminLTE.min.css">
<meta http-equiv="refresh" content="3; url={$url}"> <meta http-equiv="refresh" content="{$time}; url={$url}">
</head> </head>
<body class="hold-transition lockscreen"> <body class="hold-transition lockscreen">
@ -20,7 +20,7 @@
{$text} {$text}
</div> </div>
<div class="panel-footer"> <div class="panel-footer">
<a href="{$url}" id="button" class="btn btn-{$type} btn-block btn-block">{Lang::T('Click Here')} (3)</a> <a href="{$url}" id="button" class="btn btn-{$type} btn-block btn-block">{Lang::T('Click Here')} ({$time})</a>
</div> </div>
</div> </div>
<div class="lockscreen-footer text-center"> <div class="lockscreen-footer text-center">
@ -29,7 +29,7 @@
</div> </div>
<script> <script>
var time = 3; var time = {$time};
timer(); timer();
function timer() { function timer() {

View File

@ -15,13 +15,14 @@
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Expired Notification Message')}</label> <label class="col-md-2 control-label">{Lang::T('Expired Notification Message')}</label>
<div class="col-md-6"> <div class="col-md-6">
<textarea class="form-control" id="expired" <textarea class="form-control" id="expired" name="expired"
name="expired"
placeholder="Hello [[name]], your internet package [[package]] has been expired" placeholder="Hello [[name]], your internet package [[package]] has been expired"
rows="3">{if $_json['expired']!=''}{Lang::htmlspecialchars($_json['expired'])}{else}Hello [[name]], your internet package [[package]] has been expired.{/if}</textarea> rows="3">{if $_json['expired']!=''}{Lang::htmlspecialchars($_json['expired'])}{else}Hello [[name]], your internet package [[package]] has been expired.{/if}</textarea>
</div> </div>
<p class="help-block col-md-4"> <p class="help-block col-md-4">
<b>[[name]]</b> will be replaced with Customer Name. <b>[[package]]</b> will be replaced with Package name. <b>[[price]]</b> will be replaced with Package price. <b>[[name]]</b> will be replaced with Customer Name.
<b>[[package]]</b> will be replaced with Package name.
<b>[[price]]</b> will be replaced with Package price.
</p> </p>
</div> </div>
</div> </div>
@ -33,7 +34,10 @@
rows="3">{Lang::htmlspecialchars($_json['reminder_7_day'])}</textarea> rows="3">{Lang::htmlspecialchars($_json['reminder_7_day'])}</textarea>
</div> </div>
<p class="help-block col-md-4"> <p class="help-block col-md-4">
<b>[[name]]</b> will be replaced with Customer Name. <b>[[package]]</b> will be replaced with Package name. <b>[[price]]</b> will be replaced with Package price. <b>[[name]]</b> will be replaced with Customer Name.
<b>[[package]]</b> will be replaced with Package name.
<b>[[price]]</b> will be replaced with Package price.
<b>[[expired_date]]</b> will be replaced with Expiration date.
</p> </p>
</div> </div>
</div> </div>
@ -45,7 +49,10 @@
rows="3">{Lang::htmlspecialchars($_json['reminder_3_day'])}</textarea> rows="3">{Lang::htmlspecialchars($_json['reminder_3_day'])}</textarea>
</div> </div>
<p class="help-block col-md-4"> <p class="help-block col-md-4">
<b>[[name]]</b> will be replaced with Customer Name. <b>[[package]]</b> will be replaced with Package name. <b>[[price]]</b> will be replaced with Package price. <b>[[name]]</b> will be replaced with Customer Name.
<b>[[package]]</b> will be replaced with Package name.
<b>[[price]]</b> will be replaced with Package price.
<b>[[expired_date]]</b> will be replaced with Expiration date.
</p> </p>
</div> </div>
</div> </div>
@ -57,7 +64,10 @@
rows="3">{Lang::htmlspecialchars($_json['reminder_1_day'])}</textarea> rows="3">{Lang::htmlspecialchars($_json['reminder_1_day'])}</textarea>
</div> </div>
<p class="help-block col-md-4"> <p class="help-block col-md-4">
<b>[[name]]</b> will be replaced with Customer Name. <b>[[package]]</b> will be replaced with Package name. <b>[[price]]</b> will be replaced with Package price. <b>[[name]]</b> will be replaced with Customer Name.
<b>[[package]]</b> will be replaced with Package name.
<b>[[price]]</b> will be replaced with Package price.
<b>[[expired_date]]</b> will be replaced with Expiration date.
</p> </p>
</div> </div>
</div> </div>
@ -117,40 +127,41 @@
</p> </p>
</div> </div>
</div> </div>
<div class="panel-body"> {if $_c['enable_balance'] == 'yes'}
<div class="form-group"> <div class="panel-body">
<label class="col-md-2 control-label">{Lang::T('Send Balance')}</label> <div class="form-group">
<div class="col-md-6"> <label class="col-md-2 control-label">{Lang::T('Send Balance')}</label>
<textarea class="form-control" id="balance_send" name="balance_send" <div class="col-md-6">
rows="3">{if $_json['balance_send']}{Lang::htmlspecialchars($_json['balance_send'])}{else}{Lang::htmlspecialchars($_default['balance_send'])}{/if}</textarea> <textarea class="form-control" id="balance_send" name="balance_send"
rows="3">{if $_json['balance_send']}{Lang::htmlspecialchars($_json['balance_send'])}{else}{Lang::htmlspecialchars($_default['balance_send'])}{/if}</textarea>
</div>
<p class="col-md-4 help-block">
<b>[[name]]</b> Receiver name.<br>
<b>[[balance]]</b> how much balance have been send.<br>
<b>[[current_balance]]</b> Current Balance.
</p>
</div> </div>
<p class="col-md-4 help-block">
<b>[[name]]</b> Receiver name.<br>
<b>[[balance]]</b> how much balance have been send.<br>
<b>[[current_balance]]</b> Current Balance.
</p>
</div> </div>
</div> <div class="panel-body">
<div class="panel-body"> <div class="form-group">
<div class="form-group"> <label class="col-md-2 control-label">{Lang::T('Received Balance')}</label>
<label class="col-md-2 control-label">{Lang::T('Received Balance')}</label> <div class="col-md-6">
<div class="col-md-6"> <textarea class="form-control" id="balance_received" name="balance_received"
<textarea class="form-control" id="balance_received" name="balance_received" rows="3">{if $_json['balance_received']}{Lang::htmlspecialchars($_json['balance_received'])}{else}{Lang::htmlspecialchars($_default['balance_received'])}{/if}</textarea>
rows="3">{if $_json['balance_received']}{Lang::htmlspecialchars($_json['balance_received'])}{else}{Lang::htmlspecialchars($_default['balance_received'])}{/if}</textarea> </div>
<p class="col-md-4 help-block">
<b>[[name]]</b> Sender name.<br>
<b>[[balance]]</b> how much balance have been received.<br>
<b>[[current_balance]]</b> Current Balance.
</p>
</div> </div>
<p class="col-md-4 help-block">
<b>[[name]]</b> Sender name.<br>
<b>[[balance]]</b> how much balance have been received.<br>
<b>[[current_balance]]</b> Current Balance.
</p>
</div> </div>
</div> {/if}
</div> </div>
<div class="panel-body"> <div class="panel-body">
<div class="form-group"> <div class="form-group">
<button class="btn btn-success btn-block" <button class="btn btn-success btn-block" type="submit">{Lang::T('Save Changes')}</button>
type="submit">{Lang::T('Save Changes')}</button>
</div> </div>
</div> </div>
</div> </div>

View File

@ -1,21 +1,20 @@
{include file="sections/header.tpl"} {include file="sections/header.tpl"}
<div class="row"> <form class="form-horizontal" method="post" role="form" action="{$_url}customers/add-post">
<div class="col-sm-12 col-md-12"> <div class="row">
<div class="panel panel-primary panel-hovered panel-stacked mb30"> <div class="col-md-6">
<div class="panel-heading">{Lang::T('Add New Contact')}</div> <div class="panel panel-primary panel-hovered panel-stacked mb30">
<div class="panel-body"> <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"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Username')}</label> <label class="col-md-3 control-label">{Lang::T('Username')}</label>
<div class="col-md-6"> <div class="col-md-9">
<div class="input-group"> <div class="input-group">
{if $_c['country_code_phone']!= ''} {if $_c['country_code_phone']!= ''}
<span class="input-group-addon" id="basic-addon1">+</span> <span class="input-group-addon" id="basic-addon1">+</span>
{else} {else}
<span class="input-group-addon" id="basic-addon1"><i <span class="input-group-addon" id="basic-addon1"><i
class="glyphicon glyphicon-phone-alt"></i></span> class="glyphicon glyphicon-phone-alt"></i></span>
{/if} {/if}
<input type="text" class="form-control" name="username" required <input type="text" class="form-control" name="username" required
placeholder="{if $_c['country_code_phone']!= ''}{$_c['country_code_phone']}{/if} {Lang::T('Phone Number')}"> placeholder="{if $_c['country_code_phone']!= ''}{$_c['country_code_phone']}{/if} {Lang::T('Phone Number')}">
@ -23,26 +22,26 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Full Name')}</label> <label class="col-md-3 control-label">{Lang::T('Full Name')}</label>
<div class="col-md-6"> <div class="col-md-9">
<input type="text" required class="form-control" id="fullname" name="fullname"> <input type="text" required class="form-control" id="fullname" name="fullname">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Email')}</label> <label class="col-md-3 control-label">{Lang::T('Email')}</label>
<div class="col-md-6"> <div class="col-md-9">
<input type="email" class="form-control" id="email" name="email"> <input type="email" class="form-control" id="email" name="email">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Phone Number')}</label> <label class="col-md-3 control-label">{Lang::T('Phone Number')}</label>
<div class="col-md-6"> <div class="col-md-9">
<div class="input-group"> <div class="input-group">
{if $_c['country_code_phone']!= ''} {if $_c['country_code_phone']!= ''}
<span class="input-group-addon" id="basic-addon1">+</span> <span class="input-group-addon" id="basic-addon1">+</span>
{else} {else}
<span class="input-group-addon" id="basic-addon1"><i <span class="input-group-addon" id="basic-addon1"><i
class="glyphicon glyphicon-phone-alt"></i></span> class="glyphicon glyphicon-phone-alt"></i></span>
{/if} {/if}
<input type="text" class="form-control" name="phonenumber" <input type="text" class="form-control" name="phonenumber"
placeholder="{if $_c['country_code_phone']!= ''}{$_c['country_code_phone']}{/if} {Lang::T('Phone Number')}"> placeholder="{if $_c['country_code_phone']!= ''}{$_c['country_code_phone']}{/if} {Lang::T('Phone Number')}">
@ -50,15 +49,15 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Password')}</label> <label class="col-md-3 control-label">{Lang::T('Password')}</label>
<div class="col-md-6"> <div class="col-md-9">
<input type="password" class="form-control" autocomplete="off" required id="password" <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'"> name="password" onmouseleave="this.type = 'password'" onmouseenter="this.type = 'text'">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('PPPOE Password')}</label> <label class="col-md-3 control-label">{Lang::T('PPPOE Password')}</label>
<div class="col-md-6"> <div class="col-md-9">
<input type="password" class="form-control" id="pppoe_password" name="pppoe_password" <input type="password" class="form-control" id="pppoe_password" name="pppoe_password"
value="{$d['pppoe_password']}" onmouseleave="this.type = 'password'" value="{$d['pppoe_password']}" onmouseleave="this.type = 'password'"
onmouseenter="this.type = 'text'"> onmouseenter="this.type = 'text'">
@ -68,14 +67,14 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Address')}</label> <label class="col-md-3 control-label">{Lang::T('Address')}</label>
<div class="col-md-6"> <div class="col-md-9">
<textarea name="address" id="address" class="form-control"></textarea> <textarea name="address" id="address" class="form-control"></textarea>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Service Type')}</label> <label class="col-md-3 control-label">{Lang::T('Service Type')}</label>
<div class="col-md-6"> <div class="col-md-9">
<select class="form-control" id="service_type" name="service_type"> <select class="form-control" id="service_type" name="service_type">
<option value="Hotspot" {if $d['service_type'] eq 'Hotspot' }selected{/if}>Hotspot <option value="Hotspot" {if $d['service_type'] eq 'Hotspot' }selected{/if}>Hotspot
</option> </option>
@ -84,64 +83,65 @@
</select> </select>
</div> </div>
</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 add start --> <!-- Customers Attributes add start -->
<div class="form-group"> <div id="custom-fields-container">
<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>
<!-- Customers Attributes add end --> <!-- Customers Attributes add end -->
</div>
<div class="form-group"> <div class="panel-footer">
<div class="col-lg-offset-2 col-lg-10"> <button class="btn btn-success btn-block" type="button"
<button class="btn btn-primary" type="submit"> id="add-custom-field">{Lang::T('Add')}</button>
{Lang::T('Save Changes')} </div>
</button>
Or <a href="{$_url}customers/list">{Lang::T('Cancel')}</a>
</div>
</div>
</form>
</div> </div>
</div> </div>
</div> </div>
</div> <center>
</div> <button class="btn btn-primary" type="submit">
{Lang::T('Save Changes')}
</button>
<br><a href="{$_url}customers/list" class="btn btn-link">{Lang::T('Cancel')}</a>
</center>
</form>
{literal} {literal}
<script type="text/javascript"> <script type="text/javascript">
document.addEventListener("DOMContentLoaded", function() { document.addEventListener("DOMContentLoaded", function() {
var customFieldsContainer = document.getElementById('custom-fields-container'); var customFieldsContainer = document.getElementById('custom-fields-container');
var addCustomFieldButton = document.getElementById('add-custom-field'); var addCustomFieldButton = document.getElementById('add-custom-field');
addCustomFieldButton.addEventListener('click', function() { addCustomFieldButton.addEventListener('click', function() {
var fieldIndex = customFieldsContainer.children.length; var fieldIndex = customFieldsContainer.children.length;
var newField = document.createElement('div'); var newField = document.createElement('div');
newField.className = 'form-group'; newField.className = 'form-group';
newField.innerHTML = ` newField.innerHTML = `
<label class="col-md-2 control-label">Name:</label> <div class="col-md-4">
<div class="col-md-3">
<input type="text" class="form-control" name="custom_field_name[]" placeholder="Name"> <input type="text" class="form-control" name="custom_field_name[]" placeholder="Name">
</div> </div>
<label class="col-md-2 control-label">Value:</label> <div class="col-md-6">
<div class="col-md-3">
<input type="text" class="form-control" name="custom_field_value[]" placeholder="Value"> <input type="text" class="form-control" name="custom_field_value[]" placeholder="Value">
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<button type="button" class="remove-custom-field btn btn-danger btn-sm">-</button> <button type="button" class="remove-custom-field btn btn-danger btn-sm">-</button>
</div> </div>
`; `;
customFieldsContainer.appendChild(newField); customFieldsContainer.appendChild(newField);
}); });
customFieldsContainer.addEventListener('click', function(event) { customFieldsContainer.addEventListener('click', function(event) {
if (event.target.classList.contains('remove-custom-field')) { if (event.target.classList.contains('remove-custom-field')) {
var fieldContainer = event.target.parentNode.parentNode; var fieldContainer = event.target.parentNode.parentNode;
fieldContainer.parentNode.removeChild(fieldContainer); fieldContainer.parentNode.removeChild(fieldContainer);
} }
});
}); });
}); </script>
</script>
{/literal} {/literal}

View File

@ -1,22 +1,21 @@
{include file="sections/header.tpl"} {include file="sections/header.tpl"}
<div class="row"> <form class="form-horizontal" method="post" role="form" action="{$_url}customers/edit-post">
<div class="col-sm-12 col-md-12"> <div class="row">
<div class="panel panel-primary panel-hovered panel-stacked mb30"> <div class="col-md-6">
<div class="panel-heading">{Lang::T('Edit Contact')}</div> <div class="panel panel-primary panel-hovered panel-stacked mb30">
<div class="panel-body"> <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']}"> <input type="hidden" name="id" value="{$d['id']}">
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Username')}</label> <label class="col-md-3 control-label">{Lang::T('Username')}</label>
<div class="col-md-6"> <div class="col-md-9">
<div class="input-group"> <div class="input-group">
{if $_c['country_code_phone']!= ''} {if $_c['country_code_phone']!= ''}
<span class="input-group-addon" id="basic-addon1">+</span> <span class="input-group-addon" id="basic-addon1">+</span>
{else} {else}
<span class="input-group-addon" id="basic-addon1"><i <span class="input-group-addon" id="basic-addon1"><i
class="glyphicon glyphicon-phone-alt"></i></span> class="glyphicon glyphicon-phone-alt"></i></span>
{/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
@ -25,27 +24,27 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Full Name')}</label> <label class="col-md-3 control-label">{Lang::T('Full Name')}</label>
<div class="col-md-6"> <div class="col-md-9">
<input type="text" class="form-control" id="fullname" name="fullname" <input type="text" class="form-control" id="fullname" name="fullname"
value="{$d['fullname']}"> value="{$d['fullname']}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Email')}</label> <label class="col-md-3 control-label">{Lang::T('Email')}</label>
<div class="col-md-6"> <div class="col-md-9">
<input type="email" class="form-control" id="email" name="email" value="{$d['email']}"> <input type="email" class="form-control" id="email" name="email" value="{$d['email']}">
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Phone Number')}</label> <label class="col-md-3 control-label">{Lang::T('Phone Number')}</label>
<div class="col-md-6"> <div class="col-md-9">
<div class="input-group"> <div class="input-group">
{if $_c['country_code_phone']!= ''} {if $_c['country_code_phone']!= ''}
<span class="input-group-addon" id="basic-addon1">+</span> <span class="input-group-addon" id="basic-addon1">+</span>
{else} {else}
<span class="input-group-addon" id="basic-addon1"><i <span class="input-group-addon" id="basic-addon1"><i
class="glyphicon glyphicon-phone-alt"></i></span> class="glyphicon glyphicon-phone-alt"></i></span>
{/if} {/if}
<input type="text" class="form-control" name="phonenumber" value="{$d['phonenumber']}" <input type="text" class="form-control" name="phonenumber" value="{$d['phonenumber']}"
placeholder="{if $_c['country_code_phone']!= ''}{$_c['country_code_phone']}{/if} {Lang::T('Phone Number')}"> placeholder="{if $_c['country_code_phone']!= ''}{$_c['country_code_phone']}{/if} {Lang::T('Phone Number')}">
@ -53,8 +52,8 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Password')}</label> <label class="col-md-3 control-label">{Lang::T('Password')}</label>
<div class="col-md-6"> <div class="col-md-9">
<input type="password" autocomplete="off" class="form-control" id="password" name="password" <input type="password" autocomplete="off" class="form-control" id="password" name="password"
onmouseleave="this.type = 'password'" onmouseenter="this.type = 'text'" onmouseleave="this.type = 'password'" onmouseenter="this.type = 'text'"
value="{$d['password']}"> value="{$d['password']}">
@ -62,8 +61,8 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('PPPOE Password')}</label> <label class="col-md-3 control-label">{Lang::T('PPPOE Password')}</label>
<div class="col-md-6"> <div class="col-md-9">
<input type="password" autocomplete="off" class="form-control" id="pppoe_password" <input type="password" autocomplete="off" class="form-control" id="pppoe_password"
name="pppoe_password" value="{$d['pppoe_password']}" name="pppoe_password" value="{$d['pppoe_password']}"
onmouseleave="this.type = 'password'" onmouseenter="this.type = 'text'"> onmouseleave="this.type = 'password'" onmouseenter="this.type = 'text'">
@ -73,14 +72,14 @@
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Address')}</label> <label class="col-md-3 control-label">{Lang::T('Address')}</label>
<div class="col-md-6"> <div class="col-md-9">
<textarea name="address" id="address" class="form-control">{$d['address']}</textarea> <textarea name="address" id="address" class="form-control">{$d['address']}</textarea>
</div> </div>
</div> </div>
<div class="form-group"> <div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Service Type')}</label> <label class="col-md-3 control-label">{Lang::T('Service Type')}</label>
<div class="col-md-6"> <div class="col-md-9">
<select class="form-control" id="service_type" name="service_type"> <select class="form-control" id="service_type" name="service_type">
<option value="Hotspot" {if $d['service_type'] eq 'Hotspot' }selected{/if}>Hotspot <option value="Hotspot" {if $d['service_type'] eq 'Hotspot' }selected{/if}>Hotspot
</option> </option>
@ -89,79 +88,82 @@
</select> </select>
</div> </div>
</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 --> <!--Customers Attributes edit start -->
{if $customFields} {if $customFields}
{foreach $customFields as $customField} {foreach $customFields as $customField}
<div class="form-group"> <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> for="{$customField.field_name}">{$customField.field_name}</label>
<div class="col-md-6"> <div class="col-md-6">
<input class="form-control" type="text" name="custom_fields[{$customField.field_name}]" <input class="form-control" type="text" name="custom_fields[{$customField.field_name}]"
id="{$customField.field_name}" value="{$customField.field_value}"> id="{$customField.field_name}" value="{$customField.field_value}">
</div> </div>
<input type="checkbox" name="delete_custom_fields[]" value="{$customField.field_name}"> Delete <label class="col-md-2">
</div> <input type="checkbox" name="delete_custom_fields[]" value="{$customField.field_name}"> Delete
{/foreach} </label>
</div>
{/foreach}
{/if} {/if}
<!--Customers Attributes edit end --> <!--Customers Attributes edit end -->
<!--Customers Attributes add start --> <!-- Customers Attributes add start -->
<div class="form-group"> <div id="custom-fields-container">
<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>
<!--Customers Attributes add end --> <!-- Customers Attributes add end -->
<div class="form-group"> </div>
<div class="col-lg-offset-2 col-lg-10"> <div class="panel-footer">
<button class="btn btn-primary" type="submit"> <button class="btn btn-success btn-block" type="button"
{Lang::T('Save Changes')} id="add-custom-field">{Lang::T('Add')}</button>
</button> </div>
Or <a href="{$_url}customers/list">{Lang::T('Cancel')}</a>
</div>
</div>
</form>
</div> </div>
</div> </div>
</div> </div>
</div> <center>
</div> <button class="btn btn-primary" type="submit">
{Lang::T('Save Changes')}
</button>
<br><a href="{$_url}customers/list" class="btn btn-link">{Lang::T('Cancel')}</a>
</center>
</form>
{literal} {literal}
<script type="text/javascript"> <script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () { document.addEventListener("DOMContentLoaded", function() {
var customFieldsContainer = document.getElementById('custom-fields-container'); var customFieldsContainer = document.getElementById('custom-fields-container');
var addCustomFieldButton = document.getElementById('add-custom-field'); var addCustomFieldButton = document.getElementById('add-custom-field');
addCustomFieldButton.addEventListener('click', function () { addCustomFieldButton.addEventListener('click', function() {
var fieldIndex = customFieldsContainer.children.length; var fieldIndex = customFieldsContainer.children.length;
var newField = document.createElement('div'); var newField = document.createElement('div');
newField.className = 'form-group'; newField.className = 'form-group';
newField.innerHTML = ` newField.innerHTML = `
<label class="col-md-2 control-label">Name:</label> <div class="col-md-4">
<div class="col-md-3">
<input type="text" class="form-control" name="custom_field_name[]" placeholder="Name"> <input type="text" class="form-control" name="custom_field_name[]" placeholder="Name">
</div> </div>
<label class="col-md-2 control-label">Value:</label> <div class="col-md-6">
<div class="col-md-3">
<input type="text" class="form-control" name="custom_field_value[]" placeholder="Value"> <input type="text" class="form-control" name="custom_field_value[]" placeholder="Value">
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<button type="button" class="remove-custom-field btn btn-danger btn-sm">-</button> <button type="button" class="remove-custom-field btn btn-danger btn-sm">-</button>
</div> </div>
`; `;
customFieldsContainer.appendChild(newField); customFieldsContainer.appendChild(newField);
}); });
customFieldsContainer.addEventListener('click', function (event) { customFieldsContainer.addEventListener('click', function(event) {
if (event.target.classList.contains('remove-custom-field')) { if (event.target.classList.contains('remove-custom-field')) {
var fieldContainer = event.target.parentNode.parentNode; var fieldContainer = event.target.parentNode.parentNode;
fieldContainer.parentNode.removeChild(fieldContainer); fieldContainer.parentNode.removeChild(fieldContainer);
} }
});
}); });
}); </script>
</script>
{/literal} {/literal}
{include file="sections/footer.tpl"} {include file="sections/footer.tpl"}

View File

@ -60,49 +60,52 @@
</div> </div>
</div> </div>
</div> </div>
<!-- solid sales graph -->
{if $_c['hide_mrc'] != 'yes'}
<div class="box box-solid ">
<div class="box-header">
<i class="fa fa-th"></i>
<h3 class="box-title">{Lang::T('Monthly Registered Customers')}</h3>
<div class="box-tools pull-right">
<button type="button" class="btn bg-teal btn-sm" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
<a href="{$_url}settings/app#hide_dashboard_content" class="btn bg-teal btn-sm" ><i class="fa fa-times"></i>
</a>
</div>
</div>
<div class="box-body border-radius-none">
<canvas class="chart" id="chart" style="height: 250px;"></canvas>
</div>
</div>
{/if}
<!-- solid sales graph -->
{if $_c['hide_tms'] != 'yes'}
<div class="box box-solid ">
<div class="box-header">
<i class="fa fa-inbox"></i>
<h3 class="box-title">{Lang::T('Total Monthly Sales')}</h3>
<div class="box-tools pull-right">
<button type="button" class="btn bg-teal btn-sm" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
<a href="{$_url}settings/app#hide_dashboard_content" class="btn bg-teal btn-sm" ><i class="fa fa-times"></i>
</a>
</div>
</div>
<div class="box-body border-radius-none">
<canvas class="chart" id="salesChart" style="height: 250px;"></canvas>
</div>
</div>
{/if}
<div class="row"> <div class="row">
<div class="col-md-7"> <div class="col-md-7">
<!-- solid sales graph -->
{if $_c['hide_mrc'] != 'yes'}
<div class="box box-solid ">
<div class="box-header">
<i class="fa fa-th"></i>
<h3 class="box-title">{Lang::T('Monthly Registered Customers')}</h3>
<div class="box-tools pull-right">
<button type="button" class="btn bg-teal btn-sm" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
<a href="{$_url}settings/app#hide_dashboard_content" class="btn bg-teal btn-sm"><i
class="fa fa-times"></i>
</a>
</div>
</div>
<div class="box-body border-radius-none">
<canvas class="chart" id="chart" style="height: 250px;"></canvas>
</div>
</div>
{/if}
<!-- solid sales graph -->
{if $_c['hide_tms'] != 'yes'}
<div class="box box-solid ">
<div class="box-header">
<i class="fa fa-inbox"></i>
<h3 class="box-title">{Lang::T('Total Monthly Sales')}</h3>
<div class="box-tools pull-right">
<button type="button" class="btn bg-teal btn-sm" data-widget="collapse"><i class="fa fa-minus"></i>
</button>
<a href="{$_url}settings/app#hide_dashboard_content" class="btn bg-teal btn-sm"><i
class="fa fa-times"></i>
</a>
</div>
</div>
<div class="box-body border-radius-none">
<canvas class="chart" id="salesChart" style="height: 250px;"></canvas>
</div>
</div>
{/if}
{if $_c['disable_voucher'] != 'yes' && $stocks['unused']>0 || $stocks['used']>0} {if $_c['disable_voucher'] != 'yes' && $stocks['unused']>0 || $stocks['used']>0}
{if $_c['hide_vs'] != 'yes'} {if $_c['hide_vs'] != 'yes'}
<div class="panel panel-primary mb20 panel-hovered project-stats table-responsive"> <div class="panel panel-primary mb20 panel-hovered project-stats table-responsive">

View File

@ -60,6 +60,7 @@
<label class="col-md-2 control-label">{Lang::T('Plan Validity')}</label> <label class="col-md-2 control-label">{Lang::T('Plan Validity')}</label>
<div class="col-md-4"> <div class="col-md-4">
<input type="text" class="form-control" id="validity" name="validity"> <input type="text" class="form-control" id="validity" name="validity">
<p class="help-block">{Lang::T('1 Period = 1 Month, Expires the 20th of each month')}</p>
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<select class="form-control" id="validity_unit" name="validity_unit"> <select class="form-control" id="validity_unit" name="validity_unit">
@ -67,6 +68,7 @@
<option value="Hrs">{Lang::T('Hrs')}</option> <option value="Hrs">{Lang::T('Hrs')}</option>
<option value="Days">{Lang::T('Days')}</option> <option value="Days">{Lang::T('Days')}</option>
<option value="Months">{Lang::T('Months')}</option> <option value="Months">{Lang::T('Months')}</option>
<option value="Period">{Lang::T('Period')}</option>
</select> </select>
</div> </div>
</div> </div>

View File

@ -62,6 +62,7 @@
<div class="col-md-4"> <div class="col-md-4">
<input type="text" class="form-control" id="validity" name="validity" <input type="text" class="form-control" id="validity" name="validity"
value="{$d['validity']}"> value="{$d['validity']}">
<p class="help-block">{Lang::T('1 Period = 30 Month, Expires the 20th of each month')}</p>
</div> </div>
<div class="col-md-2"> <div class="col-md-2">
<select class="form-control" id="validity_unit" name="validity_unit"> <select class="form-control" id="validity_unit" name="validity_unit">
@ -73,6 +74,7 @@
</option> </option>
<option value="Months" {if $d['validity_unit'] eq 'Months'} selected {/if}> <option value="Months" {if $d['validity_unit'] eq 'Months'} selected {/if}>
{Lang::T('Months')}</option> {Lang::T('Months')}</option>
<option value="Period" {if $d['validity_unit'] eq 'Period'} selected {/if}>{Lang::T('Period')}</option>
</select> </select>
</div> </div>
</div> </div>

View File

@ -27,21 +27,21 @@
if (el.addEventListener) { // all browsers except IE before version 9 if (el.addEventListener) { // all browsers except IE before version 9
el.addEventListener("click", function() { el.addEventListener("click", function() {
$(this).html( $(this).html(
`<span class="glyphicon glyphicon-refresh" role="status" aria-hidden="true"></span>` `<span class="loading"></span>`
); );
setTimeout(() => { // setTimeout(() => {
$(this).prop("disabled", true); // $(this).prop("disabled", true);
}, 100); // }, 100);
}, false); }, false);
} else { } else {
if (el.attachEvent) { // IE before version 9 if (el.attachEvent) { // IE before version 9
el.attachEvent("click", function() { el.attachEvent("click", function() {
$(this).html( $(this).html(
`<span class="glyphicon glyphicon-refresh" role="status" aria-hidden="true"></span>` `<span class="loading"></span>`
); );
setTimeout(() => { // setTimeout(() => {
$(this).prop("disabled", true); // $(this).prop("disabled", true);
}, 100); // }, 100);
}); });
} }
} }

View File

@ -57,8 +57,36 @@
max-height: 1em; max-height: 1em;
line-height: 1em; line-height: 1em;
} }
</style>
.loading {
pointer-events: none;
opacity: 0.7;
}
.loading::after {
content: "";
display: inline-block;
width: 16px;
height: 16px;
vertical-align: middle;
margin-left: 10px;
border: 2px solid #fff;
border-top-color: transparent;
border-radius: 50%;
animation: spin 0.8s infinite linear;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
{if isset($xheader)} {if isset($xheader)}
{$xheader} {$xheader}
{/if} {/if}
@ -130,20 +158,11 @@
</li> </li>
{$_MENU_AFTER_DASHBOARD} {$_MENU_AFTER_DASHBOARD}
{if !in_array($_admin['user_type'],['Report'])} {if !in_array($_admin['user_type'],['Report'])}
<li class="{if $_system_menu eq 'customers'}active{/if} treeview"> <li {if $_system_menu eq 'customers'}class="active" {/if}>
<a href="#"> <a href="{$_url}customers">
<i class="ion ion-android-contacts"></i> <span>{Lang::T('Customer')}</span> <i class="fa fa-users"></i>
<span class="pull-right-container"> <span>{Lang::T('Customer')}</span>
<i class="fa fa-angle-left pull-right"></i>
</span>
</a> </a>
<ul class="treeview-menu">
<li {if $_routes[1] eq 'add'}class="active" {/if}><a href="{$_url}customers/add"><i
class="fa fa-user-plus"></i> {Lang::T('Add New Contact')}</a></li>
<li {if $_routes[1] eq 'list'}class="active" {/if}><a href="{$_url}customers/list"><i
class="fa fa-users"></i> {Lang::T('List Contact')}</a></li>
{$_MENU_CUSTOMERS}
</ul>
</li> </li>
{$_MENU_AFTER_CUSTOMERS} {$_MENU_AFTER_CUSTOMERS}
<li class="{if $_system_menu eq 'prepaid'}active{/if} treeview"> <li class="{if $_system_menu eq 'prepaid'}active{/if} treeview">
@ -164,8 +183,10 @@
{/if} {/if}
<li {if $_routes[1] eq 'recharge'}class="active" {/if}><a <li {if $_routes[1] eq 'recharge'}class="active" {/if}><a
href="{$_url}prepaid/recharge">{Lang::T('Recharge Account')}</a></li> href="{$_url}prepaid/recharge">{Lang::T('Recharge Account')}</a></li>
<li {if $_routes[1] eq 'deposit'}class="active" {/if}><a {if $_c['enable_balance'] == 'yes'}
href="{$_url}prepaid/deposit">{Lang::T('Refill Balance')}</a></li> <li {if $_routes[1] eq 'deposit'}class="active" {/if}><a
href="{$_url}prepaid/deposit">{Lang::T('Refill Balance')}</a></li>
{/if}
{$_MENU_PREPAID} {$_MENU_PREPAID}
</ul> </ul>
</li> </li>
@ -186,8 +207,10 @@
href="{$_url}services/pppoe">{Lang::T('PPPOE Plans')}</a></li> href="{$_url}services/pppoe">{Lang::T('PPPOE Plans')}</a></li>
<li {if $_routes[1] eq 'list'}class="active" {/if}><a <li {if $_routes[1] eq 'list'}class="active" {/if}><a
href="{$_url}bandwidth/list">{Lang::T('Bandwidth Plans')}</a></li> href="{$_url}bandwidth/list">{Lang::T('Bandwidth Plans')}</a></li>
<li {if $_routes[1] eq 'balance'}class="active" {/if}><a {if $_c['enable_balance'] == 'yes'}
href="{$_url}services/balance">{Lang::T('Balance Plans')}</a></li> <li {if $_routes[1] eq 'balance'}class="active" {/if}><a
href="{$_url}services/balance">{Lang::T('Balance Plans')}</a></li>
{/if}
{$_MENU_SERVICES} {$_MENU_SERVICES}
</ul> </ul>
</li> </li>
@ -258,6 +281,9 @@
href="{$_url}pages/Voucher">{Lang::T('Voucher')} Template</a></li> href="{$_url}pages/Voucher">{Lang::T('Voucher')} Template</a></li>
<li {if $_routes[1] eq 'Announcement'}class="active" {/if}><a <li {if $_routes[1] eq 'Announcement'}class="active" {/if}><a
href="{$_url}pages/Announcement">{Lang::T('Announcement')}</a></li> 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>
<li {if $_routes[1] eq 'Registration_Info'}class="active" {/if}><a <li {if $_routes[1] eq 'Registration_Info'}class="active" {/if}><a
href="{$_url}pages/Registration_Info">{Lang::T('Registration Info')}</a></li> href="{$_url}pages/Registration_Info">{Lang::T('Registration Info')}</a></li>
<li {if $_routes[1] eq 'Privacy_Policy'}class="active" {/if}><a <li {if $_routes[1] eq 'Privacy_Policy'}class="active" {/if}><a

View File

@ -85,7 +85,7 @@
if (el.addEventListener) { // all browsers except IE before version 9 if (el.addEventListener) { // all browsers except IE before version 9
el.addEventListener("click", function() { el.addEventListener("click", function() {
$(this).html( $(this).html(
`<span class="glyphicon glyphicon-refresh" role="status" aria-hidden="true"></span>` `<span class="loading"></span>`
); );
setTimeout(() => { setTimeout(() => {
$(this).prop("disabled", true); $(this).prop("disabled", true);
@ -95,7 +95,7 @@
if (el.attachEvent) { // IE before version 9 if (el.attachEvent) { // IE before version 9
el.attachEvent("click", function() { el.attachEvent("click", function() {
$(this).html( $(this).html(
`<span class="glyphicon glyphicon-refresh" role="status" aria-hidden="true"></span>` `<span class="loading"></span>`
); );
setTimeout(() => { setTimeout(() => {
$(this).prop("disabled", true); $(this).prop("disabled", true);

View File

@ -37,7 +37,36 @@
margin-top: 100px; margin-top: 100px;
} }
} }
</style>
.loading {
pointer-events: none;
opacity: 0.7;
}
.loading::after {
content: "";
display: inline-block;
width: 16px;
height: 16px;
vertical-align: middle;
margin-left: 10px;
border: 2px solid #fff;
border-top-color: transparent;
border-radius: 50%;
animation: spin 0.8s infinite linear;
}
@keyframes spin {
0% {
transform: rotate(0deg);
}
100% {
transform: rotate(360deg);
}
}
</style>
{if isset($xheader)} {if isset($xheader)}
{$xheader} {$xheader}

View File

@ -53,7 +53,10 @@
<h3 class="box-title">{Lang::T('Announcement')}</h3> <h3 class="box-title">{Lang::T('Announcement')}</h3>
</div> </div>
<div class="box-body"> <div class="box-body">
{include file="$_path/../pages/Announcement.html"} {$Announcement_Customer = "{$PAGES_PATH}/Announcement_Customer.html"}
{if file_exists($Announcement_Customer)}
{include file=$Announcement_Customer}
{/if}
</div> </div>
</div> </div>
</div> </div>
@ -111,7 +114,7 @@
<div class="box-header"> <div class="box-header">
<h3 class="box-title">{$_bill['routers']}</h3> <h3 class="box-title">{$_bill['routers']}</h3>
<div class="btn-group pull-right"> <div class="btn-group pull-right">
{if $_bill['type'] != 'Hotspot'} {if $_bill['type'] == 'Hotspot'}
{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if} {if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}
{else} {else}
{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if} {if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}

View File

@ -32,7 +32,10 @@
<div class="panel panel-info"> <div class="panel panel-info">
<div class="panel-heading">{Lang::T('Announcement')}</div> <div class="panel-heading">{Lang::T('Announcement')}</div>
<div class="panel-body"> <div class="panel-body">
{include file="$_path/../pages/Announcement.html"} {$Announcement = "{$PAGES_PATH}/Announcement.html"}
{if file_exists($Announcement)}
{include file=$Announcement}
{/if}
</div> </div>
</div> </div>
</div> </div>

View File

@ -65,7 +65,7 @@
<div class="form-group"> <div class="form-group">
<label class="col-md-3 control-label">{Lang::T('User Type')}</label> <label class="col-md-3 control-label">{Lang::T('User Type')}</label>
<div class="col-md-9"> <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'} {if $_admin['user_type'] eq 'Agent'}
<option value="Sales" {if $d['user_type'] eq 'Sales'}selected="selected" {/if}>Sales <option value="Sales" {if $d['user_type'] eq 'Sales'}selected="selected" {/if}>Sales
</option> </option>
@ -87,7 +87,7 @@
</select> </select>
</div> </div>
</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> <label class="col-md-3 control-label">{Lang::T('Agent')}</label>
<div class="col-md-9"> <div class="col-md-9">
<select name="root" id="root" class="form-control"> <select name="root" id="root" class="form-control">

View File

@ -77,6 +77,9 @@ if (empty($step)) {
// remove downloaded zip // remove downloaded zip
if (file_exists($file)) unlink($file); if (file_exists($file)) unlink($file);
} else if ($step == 3) { } else if ($step == 3) {
deleteFolder('system/autoload/');
deleteFolder('system/vendor/');
deleteFolder('ui/ui/');
copyFolder($folder, pathFixer('./')); copyFolder($folder, pathFixer('./'));
deleteFolder('install/'); deleteFolder('install/');
deleteFolder($folder); deleteFolder($folder);

View File

@ -1,3 +1,3 @@
{ {
"version": "2024.2.26" "version": "2024.3.6"
} }