Compare commits

...

32 Commits

Author SHA1 Message Date
77e48dae8b add is file exists 2024-03-03 19:54:04 +07:00
0745532951 2024.3.3 2024-03-03 17:29:53 +07:00
b53116d22a Customer Announcement 2024-03-03 17:24:01 +07:00
f7df824145 Merge pull request #116 from gerandonk/Development
Development
2024-03-03 17:11:38 +07:00
f154322f99 Merge pull request #115 from Focuslinkstech/master
improvement
2024-03-03 17:10:06 +07:00
a76ba6ee8b update db for validity period 2024-03-03 11:30:34 +07:00
61b3f5b5f5 Add planwith validity period 2024-03-03 11:03:25 +07:00
b153e5b595 distinguish between announcements on the user dashboard and the login page 2024-03-03 11:00:42 +07:00
9ab0b6a0fa improvement
just replace the save loading with css for better loading feature
2024-03-02 12:40:04 +01:00
a7f191f058 damn, that curly bracket make error :)) 2024-03-01 19:42:59 +07:00
012a1ecfab allow purchase = no, but can recharge 2024-03-01 16:10:01 +07:00
dc70a49f52 upload path 2024-03-01 13:44:46 +07:00
bc7380eab7 add variable to global 2024-03-01 10:36:24 +07:00
f4da09a26e move hook before sending notification 2024-03-01 10:11:18 +07:00
de3312055a add hook when recharge 2024-03-01 09:57:59 +07:00
699289662b Fix Upload URL 2024-03-01 09:37:13 +07:00
bae079f71c Fix Hook Functionality 2024-02-29 13:32:46 +07:00
28f4624e8d change Customer menu 2024-02-29 11:37:54 +07:00
fbd215e741 Merge branch 'master' into Development 2024-02-29 09:26:19 +07:00
2437096473 $_c to $config in php file 2024-02-29 09:25:26 +07:00
dfeee540cf Fix variable $_c 2024-02-28 18:19:17 +07:00
a0b9e85f38 Add Expired date for reminder 2024-02-28 11:31:36 +07:00
08153e6ec1 Fix Buy Plan with Balance 2024-02-28 11:31:31 +07:00
2660f5d2d0 Dashboard 2 Column 2024-02-27 14:22:17 +07:00
82e67f0b83 fix Recharge 2024-02-27 13:12:53 +07:00
41dd0d86e7 Fix Recharge 2024-02-27 13:12:25 +07:00
c8004f1a27 fix update file 2024-02-27 13:10:06 +07:00
61edfb932a fix wrong logic != to == 2024-02-27 12:00:49 +07:00
747a67b691 2024.2.27 2024-02-27 10:39:21 +07:00
b938db9e5d redirect after login 2024-02-27 10:37:41 +07:00
1ec8049068 fix path 2024-02-27 10:32:09 +07:00
848dcb5caf fix variable Admin.php 2024-02-27 07:12:02 +07:00
35 changed files with 341 additions and 167 deletions

View File

@ -2,6 +2,27 @@
# CHANGELOG
## 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
- Clean Unused JS and CSS

View File

@ -76,10 +76,10 @@ if ($_app_stage != 'Live') {
define('U', APP_URL . '/index.php?_route=');
// notification message
if (file_exists($root_path . $UPLOAD_PATH . DIRECTORY_SEPARATOR . "notifications.json")) {
$_notifmsg = json_decode(file_get_contents($root_path . $UPLOAD_PATH . DIRECTORY_SEPARATOR . 'notifications.json'), true);
if (file_exists($UPLOAD_PATH . DIRECTORY_SEPARATOR . "notifications.json")) {
$_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
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) {
$config[$value['setting']] = $value['value'];
}
$_c = $config;
if (empty($http_proxy) && !empty($config['http_proxy'])) {
$http_proxy = $config['http_proxy'];
if (empty($http_proxyauth) && !empty($config['http_proxyauth'])) {
@ -237,7 +238,7 @@ function r2($to, $ntype = 'e', $msg = '')
exit;
}
function _alert($text, $type = 'success', $url = "home")
function _alert($text, $type = 'success', $url = "home", $time = 3)
{
global $ui;
if (!isset($ui)) return;
@ -250,8 +251,10 @@ function _alert($text, $type = 'success', $url = "home")
}
$ui->assign('text', $text);
$ui->assign('type', $type);
$ui->assign('time', $time);
$ui->assign('url', $url);
$ui->display('alert.tpl');
die();
}

View File

@ -91,7 +91,7 @@ CREATE TABLE `tbl_plans` (
`data_limit` int(10) UNSIGNED DEFAULT NULL,
`data_unit` enum('MB','GB') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT 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,
`routers` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`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) {
return ORM::for_table('tbl_users')->find_one($id);
} else {
return [];
return null;
}
}
}

View File

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

View File

@ -68,9 +68,13 @@ class Message
public static function sendPackageNotification($phone, $name, $package, $price, $message, $via)
{
global $u;
$msg = str_replace('[[name]]', $name, $message);
$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($message) && in_array($via, ['sms', 'wa'])

View File

@ -19,7 +19,7 @@ class Package
*/
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_only = date("Y-m-d");
$time_only = date("H:i:s");
@ -48,8 +48,8 @@ class Package
$t->routers = $router_name;
$t->type = "Balance";
if ($admin) {
$t->admin_id = $admin['id'];
}else{
$t->admin_id = ($admin['id']) ? $admin['id'] : '0';
} else {
$t->admin_id = '0';
}
$t->save();
@ -94,9 +94,24 @@ class Package
->where('Type', $p['type'])
->find_one();
run_hook("recharge_user");
$mikrotik = Mikrotik::info($router_name);
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'));
$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'));
} else {
$date_exp = date("Y-m-20", strtotime('+' . $p['validity'] . ' month'));
};
$time = date("23:59:00");
} else if ($p['validity_unit'] == 'Days') {
$date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' day'));
} else if ($p['validity_unit'] == 'Hrs') {
@ -116,6 +131,9 @@ class Package
if ($p['validity_unit'] == 'Months') {
$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'));
$time = date("23:59:00");
} else if ($p['validity_unit'] == 'Days') {
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days'));
$time = $b['time'];
@ -152,8 +170,8 @@ class Package
$b->routers = $router_name;
$b->type = "Hotspot";
if ($admin) {
$b->admin_id = $admin['id'];
}else{
$b->admin_id = ($admin['id']) ? $admin['id'] : '0';
} else {
$b->admin_id = '0';
}
$b->save();
@ -172,11 +190,17 @@ class Package
$t->routers = $router_name;
$t->type = "Hotspot";
if ($admin) {
$t->admin_id = $admin['id'];
}else{
$t->admin_id = ($admin['id']) ? $admin['id'] : '0';
} else {
$t->admin_id = '0';
}
$t->save();
Message::sendTelegram("#u$c[username] #recharge #Hotspot \n" . $p['name_plan'] .
"\nRouter: " . $router_name .
"\nGateway: " . $gateway .
"\nChannel: " . $channel .
"\nPrice: " . Lang::moneyFormat($p['price']));
} else {
if ($p['is_radius']) {
Radius::customerAddPlan($c, $p, "$date_exp $time");
@ -201,9 +225,9 @@ class Package
$d->routers = $router_name;
$d->type = "Hotspot";
if ($admin) {
$b->admin_id = $admin['id'];
}else{
$b->admin_id = '0';
$d->admin_id = ($admin['id']) ? $admin['id'] : '0';
} else {
$d->admin_id = '0';
}
$d->save();
@ -221,17 +245,19 @@ class Package
$t->routers = $router_name;
$t->type = "Hotspot";
if ($admin) {
$t->admin_id = $admin['id'];
}else{
$t->admin_id = ($admin['id']) ? $admin['id'] : '0';
} else {
$t->admin_id = '0';
}
$t->save();
}
Message::sendTelegram("#u$c[username] #buy #Hotspot \n" . $p['name_plan'] .
"\nRouter: " . $router_name .
"\nGateway: " . $gateway .
"\nChannel: " . $channel .
"\nPrice: " . Lang::moneyFormat($p['price']));
}
} else {
if ($b) {
@ -240,6 +266,9 @@ class Package
if ($p['validity_unit'] == 'Months') {
$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'));
$time = date("23:59:00");
} else if ($p['validity_unit'] == 'Days') {
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days'));
$time = $b['time'];
@ -276,8 +305,8 @@ class Package
$b->routers = $router_name;
$b->type = "PPPOE";
if ($admin) {
$b->admin_id = $admin['id'];
}else{
$b->admin_id = ($admin['id']) ? $admin['id'] : '0';
} else {
$b->admin_id = '0';
}
$b->save();
@ -296,11 +325,17 @@ class Package
$t->routers = $router_name;
$t->type = "PPPOE";
if ($admin) {
$t->admin_id = $admin['id'];
}else{
$t->admin_id = ($admin['id']) ? $admin['id'] : '0';
} else {
$t->admin_id = '0';
}
$t->save();
Message::sendTelegram("#u$c[username] #recharge #PPPOE \n" . $p['name_plan'] .
"\nRouter: " . $router_name .
"\nGateway: " . $gateway .
"\nChannel: " . $channel .
"\nPrice: " . Lang::moneyFormat($p['price']));
} else {
if ($p['is_radius']) {
Radius::customerAddPlan($c, $p, "$date_exp $time");
@ -325,8 +360,8 @@ class Package
$d->routers = $router_name;
$d->type = "PPPOE";
if ($admin) {
$d->admin_id = $admin['id'];
}else{
$d->admin_id = ($admin['id']) ? $admin['id'] : '0';
} else {
$d->admin_id = '0';
}
$d->save();
@ -344,13 +379,13 @@ class Package
$t->method = "$gateway - $channel";
$t->routers = $router_name;
if ($admin) {
$t->admin_id = $admin['id'];
}else{
$t->admin_id = ($admin['id']) ? $admin['id'] : '0';
} else {
$t->admin_id = '0';
}
$t->type = "PPPOE";
$t->save();
}
Message::sendTelegram("#u$c[username] #buy #PPPOE \n" . $p['name_plan'] .
"\nRouter: " . $router_name .
"\nGateway: " . $gateway .
@ -358,6 +393,8 @@ class Package
"\nPrice: " . Lang::moneyFormat($p['price']));
}
}
run_hook("recharge_user_finish");
Message::sendInvoice($c, $t);
return true;
}
@ -511,6 +548,6 @@ class Package
$invoice .= Lang::pad("", '=') . "\n";
$invoice .= Lang::pad($config['note'], ' ', 2) . "\n";
$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('_path', __DIR__);
$ui->assign('_c', $config);
$ui->assign('UPLOAD_PATH', $UPLOAD_PATH);
$ui->assign('CACHE_PATH', $CACHE_PATH);
$ui->assign('PAGES_PATH', $PAGES_PATH);
$ui->assign('UPLOAD_PATH', str_replace($root_path, '', $UPLOAD_PATH));
$ui->assign('CACHE_PATH', str_replace($root_path, '', $CACHE_PATH));
$ui->assign('PAGES_PATH', str_replace($root_path, '', $PAGES_PATH));
$ui->assign('_system_menu', 'dashboard');
function _msglog($type, $msg)

View File

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

View File

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

View File

@ -4,5 +4,10 @@
* by https://t.me/ibnux
**/
r2(APP_URL.'/index.php?_route=dashboard');
if(Admin::getID()){
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 = str_replace('-', ' ', $title);
$UPLOAD_URL_PATH = str_replace($root_path, '', $UPLOAD_PATH);
if (file_exists($UPLOAD_PATH . '/logo.png')) {
$logo = $UPLOAD_PATH . '/logo.png';
$logo = $UPLOAD_URL_PATH . '/logo.png';
} else {
$logo = $UPLOAD_PATH . '/logo.default.png';
$logo = $UPLOAD_URL_PATH . '/logo.default.png';
}
if ($x) {
@ -234,10 +235,12 @@ EOF;
$title = ' Reports [' . $mdate . ']';
$title = str_replace('-', ' ', $title);
$UPLOAD_URL_PATH = str_replace($root_path, '', $UPLOAD_PATH);
if (file_exists($UPLOAD_PATH . '/logo.png')) {
$logo = $UPLOAD_PATH . '/logo.png';
$logo = $UPLOAD_URL_PATH . '/logo.png';
} else {
$logo = $UPLOAD_PATH . '/logo.default.png';
$logo = $UPLOAD_URL_PATH . '/logo.default.png';
}
if ($x) {

View File

@ -99,9 +99,6 @@ if (isset($_GET['recharge']) && !empty($_GET['recharge'])) {
if(!$plan['enabled']){
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']) {
r2(U . "order/pay/$router[id]/$bill[plan_id]", 'e', 'Order Plan');
} else {

View File

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

View File

@ -142,7 +142,7 @@ switch ($action) {
$ui->display('user-orderView.tpl');
break;
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"));
}
$plan = ORM::for_table('tbl_plans')->where('enabled', '1')->find_one($routes['3']);
@ -176,7 +176,7 @@ switch ($action) {
}
break;
case 'send':
if ($_c['enable_balance'] != 'yes') {
if ($config['enable_balance'] != 'yes') {
r2(U . "order/package", 'e', Lang::T("Balance not enabled"));
}
$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);
}
$UPLOAD_URL_PATH = str_replace($root_path,'', $UPLOAD_PATH);
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 {
$logo = $UPLOAD_PATH . DIRECTORY_SEPARATOR . 'logo.default.png';
$logo = $UPLOAD_URL_PATH . DIRECTORY_SEPARATOR . 'logo.default.png';
}
$ui->assign('logo', $logo);
if ($_c['radius_enable'] && empty($_c['radius_client'])) {
if ($config['radius_enable'] && empty($config['radius_client'])) {
try {
$_c['radius_client'] = Radius::getClient();
$config['radius_client'] = Radius::getClient();
$ui->assign('_c', $_c);
} catch (Exception $e) {
//ignore

View File

@ -24,7 +24,7 @@ echo "Found " . count($d) . " user(s)\n";
run_hook('cronjob'); #HOOK
foreach ($d as $ds) {
if ($ds['type'] == 'Hotspot') {
if ($ds['type'] == 'Hotspot') { # HOTSPOT
$date_now = strtotime(date("Y-m-d H:i:s"));
$expiration = strtotime($ds['expiration'] . ' ' . $ds['time']);
echo $ds['expiration'] . " : " . (($isCli) ? $ds['username'] : Lang::maskText($ds['username']));
@ -82,7 +82,7 @@ foreach ($d as $ds) {
}
} else
echo " : ACTIVE \r\n";
} else {
} else { # PPPOE
$date_now = strtotime(date("Y-m-d H:i:s"));
$expiration = strtotime($ds['expiration'] . ' ' . $ds['time']);
echo $ds['expiration'] . " : " . (($isCli) ? $ds['username'] : Lang::maskText($ds['username']));

View File

@ -456,5 +456,9 @@
"Click_Here": "Click Here",
"danger": "danger",
"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"
}

View File

@ -69,5 +69,8 @@
"2024.2.23" : [
"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`;"
],
"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

@ -9,7 +9,7 @@
<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/modern-AdminLTE.min.css">
<meta http-equiv="refresh" content="3; url={$url}">
<meta http-equiv="refresh" content="{$time}; url={$url}">
</head>
<body class="hold-transition lockscreen">
@ -20,7 +20,7 @@
{$text}
</div>
<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 class="lockscreen-footer text-center">
@ -29,7 +29,7 @@
</div>
<script>
var time = 3;
var time = {$time};
timer();
function timer() {

View File

@ -15,13 +15,14 @@
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Expired Notification Message')}</label>
<div class="col-md-6">
<textarea class="form-control" id="expired"
name="expired"
<textarea class="form-control" id="expired" name="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>
</div>
<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>
</div>
</div>
@ -33,7 +34,10 @@
rows="3">{Lang::htmlspecialchars($_json['reminder_7_day'])}</textarea>
</div>
<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>
</div>
</div>
@ -45,7 +49,10 @@
rows="3">{Lang::htmlspecialchars($_json['reminder_3_day'])}</textarea>
</div>
<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>
</div>
</div>
@ -57,7 +64,10 @@
rows="3">{Lang::htmlspecialchars($_json['reminder_1_day'])}</textarea>
</div>
<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>
</div>
</div>
@ -149,8 +159,7 @@
<div class="panel-body">
<div class="form-group">
<button class="btn btn-success btn-block"
type="submit">{Lang::T('Save Changes')}</button>
<button class="btn btn-success btn-block" type="submit">{Lang::T('Save Changes')}</button>
</div>
</div>
</div>

View File

@ -108,8 +108,7 @@
<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>
<button class="btn btn-success btn-sm" type="button" id="add-custom-field">+</button>
</div>
</div>
<!--Customers Attributes add end -->
@ -129,12 +128,12 @@
</div>
{literal}
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function () {
<script type="text/javascript">
document.addEventListener("DOMContentLoaded", function() {
var customFieldsContainer = document.getElementById('custom-fields-container');
var addCustomFieldButton = document.getElementById('add-custom-field');
addCustomFieldButton.addEventListener('click', function () {
addCustomFieldButton.addEventListener('click', function() {
var fieldIndex = customFieldsContainer.children.length;
var newField = document.createElement('div');
newField.className = 'form-group';
@ -154,14 +153,14 @@
customFieldsContainer.appendChild(newField);
});
customFieldsContainer.addEventListener('click', function (event) {
customFieldsContainer.addEventListener('click', function(event) {
if (event.target.classList.contains('remove-custom-field')) {
var fieldContainer = event.target.parentNode.parentNode;
fieldContainer.parentNode.removeChild(fieldContainer);
}
});
});
</script>
</script>
{/literal}
{include file="sections/footer.tpl"}

View File

@ -60,8 +60,11 @@
</div>
</div>
</div>
<!-- solid sales graph -->
{if $_c['hide_mrc'] != 'yes'}
<div class="row">
<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>
@ -71,7 +74,8 @@
<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 href="{$_url}settings/app#hide_dashboard_content" class="btn bg-teal btn-sm"><i
class="fa fa-times"></i>
</a>
</div>
</div>
@ -79,10 +83,10 @@
<canvas class="chart" id="chart" style="height: 250px;"></canvas>
</div>
</div>
{/if}
{/if}
<!-- solid sales graph -->
{if $_c['hide_tms'] != 'yes'}
<!-- solid sales graph -->
{if $_c['hide_tms'] != 'yes'}
<div class="box box-solid ">
<div class="box-header">
<i class="fa fa-inbox"></i>
@ -92,7 +96,8 @@
<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 href="{$_url}settings/app#hide_dashboard_content" class="btn bg-teal btn-sm"><i
class="fa fa-times"></i>
</a>
</div>
</div>
@ -100,9 +105,7 @@
<canvas class="chart" id="salesChart" style="height: 250px;"></canvas>
</div>
</div>
{/if}
<div class="row">
<div class="col-md-7">
{/if}
{if $_c['disable_voucher'] != 'yes' && $stocks['unused']>0 || $stocks['used']>0}
{if $_c['hide_vs'] != 'yes'}
<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>
<div class="col-md-4">
<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 class="col-md-2">
<select class="form-control" id="validity_unit" name="validity_unit">
@ -67,6 +68,7 @@
<option value="Hrs">{Lang::T('Hrs')}</option>
<option value="Days">{Lang::T('Days')}</option>
<option value="Months">{Lang::T('Months')}</option>
<option value="Period">{Lang::T('Period')}</option>
</select>
</div>
</div>

View File

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

View File

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

View File

@ -57,8 +57,36 @@
max-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)}
{$xheader}
{/if}
@ -130,20 +158,11 @@
</li>
{$_MENU_AFTER_DASHBOARD}
{if !in_array($_admin['user_type'],['Report'])}
<li class="{if $_system_menu eq 'customers'}active{/if} treeview">
<a href="#">
<i class="ion ion-android-contacts"></i> <span>{Lang::T('Customer')}</span>
<span class="pull-right-container">
<i class="fa fa-angle-left pull-right"></i>
</span>
<li {if $_system_menu eq 'customers'}class="active" {/if}>
<a href="{$_url}customers">
<i class="fa fa-users"></i>
<span>{Lang::T('Customer')}</span>
</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>
{$_MENU_AFTER_CUSTOMERS}
<li class="{if $_system_menu eq 'prepaid'}active{/if} treeview">
@ -258,6 +277,8 @@
href="{$_url}pages/Voucher">{Lang::T('Voucher')} Template</a></li>
<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>
<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

View File

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

View File

@ -37,6 +37,35 @@
margin-top: 100px;
}
}
.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)}

View File

@ -53,7 +53,10 @@
<h3 class="box-title">{Lang::T('Announcement')}</h3>
</div>
<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>
@ -111,7 +114,7 @@
<div class="box-header">
<h3 class="box-title">{$_bill['routers']}</h3>
<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}
{else}
{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-heading">{Lang::T('Announcement')}</div>
<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>

View File

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

View File

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