Compare commits

..

91 Commits

Author SHA1 Message Date
82569239e2 update changelog 2024-09-13 14:46:14 +07:00
bc0b3abe92 Merge pull request #301 from agstrxyz/Development
Paket vpn tunnel remot
2024-09-13 06:15:28 +07:00
f5d9649f97 Add files via upload 2024-09-13 00:46:40 +07:00
095e8937a2 Paket vpn tunnel remot 2024-09-13 00:43:46 +07:00
5f50d725f1 Merge pull request #298 from Focuslinkstech/Development
add styles to some tables
2024-09-12 23:40:11 +07:00
68de3a71b9 if admin session time error, it logout admin out whether admin are online or not, once time reach it logout you out 2024-09-12 11:39:45 +01:00
fe532a6238 change the time calculation logic 2024-09-11 16:52:34 +01:00
05b681df47 change current_time to current_date 2024-09-11 14:38:54 +01:00
723e99ebed fix panel headers in css, add cron job monitor to check if cron is running, has run, or not setup 2024-09-11 14:19:13 +01:00
13aabeea8e add styles to some tables 2024-09-09 20:45:13 +01:00
400672454c Merge pull request #297 from Focuslinkstech/Development
add htmlspecialchars_decode
2024-09-09 22:11:32 +07:00
aa3e522bc9 add htmlspecialchars_decode 2024-09-09 13:18:10 +01:00
b7fce955ac chenge _post to _get 2024-09-09 14:01:55 +07:00
594fab1151 fix toggle dark mode admin area 2024-09-09 13:55:39 +07:00
3aead7a98a Fix toggle dark mode 2024-09-09 13:23:26 +07:00
9a1321f597 Merge branch 'master' into Development 2024-09-09 10:47:14 +07:00
45bb3f04ee add back button on inbox 2024-09-09 10:26:28 +07:00
0d2b140bcf Fix Balance sent/received 2024-09-09 10:23:51 +07:00
f736868819 update remote-address instead local-address 2024-09-09 09:44:28 +07:00
53512cfa58 Merge pull request #295 from Focuslinkstech/Development
more css style added
2024-09-08 17:50:50 +07:00
d0e66d8651 more css style added 2024-09-08 09:50:54 +01:00
c45ea74a29 Merge pull request #294 from Focuslinkstech/Development
fix pending transaction in customer dashboard
2024-09-07 18:29:40 +07:00
22615eb278 fix pending transaction in customer dashboard 2024-09-07 12:25:21 +01:00
ae550df078 Merge pull request #293 from Focuslinkstech/Development
We added bold to sidebar, we want your opinion if it looks good or we…
2024-09-06 20:16:27 +07:00
cc74667451 fix customer dashboard table list, , Package Bandwidth and Recharge Button 2024-09-06 13:56:33 +01:00
0fec69df89 We added bold to sidebar, we want your opinion if it looks good or we should remove it.
Please if you dont like the bold feature kindly report it
2024-09-06 13:19:23 +01:00
36b4a282ee Merge pull request #292 from hotspotbilling/revert-291-master
Revert "Just Fixes"
2024-09-06 18:00:50 +07:00
cb5ffb4236 Revert "Just Fixes" 2024-09-06 18:00:33 +07:00
2328489a14 Merge pull request #291 from Focuslinkstech/master 2024-09-06 17:56:44 +07:00
f8351e46f6 Merge pull request #290 from Focuslinkstech/Development 2024-09-06 17:56:17 +07:00
cf9a11ef94 add margin to the reports table list 2024-09-06 11:48:20 +01:00
80d4c904d0 Merge branch 'hotspotbilling:Development' into Development 2024-09-06 11:44:40 +01:00
9e63d7ce20 add margin to the table list 2024-09-06 11:36:30 +01:00
b517ef2b73 fix ignore list 2024-09-06 11:00:09 +07:00
ea0c663278 MikrotikPppoeCustom for PPPOE Custom Username, IP and Password 2024-09-06 10:59:26 +07:00
299fd90949 fix dark mode drop-down menu 2024-09-05 16:13:14 +01:00
c255a7be49 fix modal in dark mode 2024-09-05 15:47:28 +01:00
4f74aa0bff Please if you dont like the bold feature kindly report it 2024-09-05 14:14:50 +01:00
93d53cc6d8 We added bold to sidebar, we want your opinion if it looks good or we should remove it 2024-09-05 13:59:19 +01:00
40f452cff8 just little bold 2024-09-05 13:46:07 +01:00
aa787af017 fix bandwidth name not displayed on active packages on customer dashboard 2024-09-05 10:36:28 +01:00
af753d3a52 remove excess div 2024-09-05 10:07:22 +01:00
d060e21032 Added to Balance list 2024-09-05 10:05:23 +01:00
f43a2dcd7a Merge branch 'hotspotbilling:Development' into Development 2024-09-05 09:51:21 +01:00
0b5bc1fe71 Add margin to tables list in customer dashboard to give it unique view 2024-09-05 09:48:21 +01:00
4f969c787a Merge pull request #289 from Focuslinkstech/Development
Fix disabled on table list in dark mode
2024-09-05 14:13:40 +07:00
087ce1d0b6 Shift table down to fit the container 2024-09-05 08:11:17 +01:00
d7d76dde94 Fix disabled on table list in dark mode 2024-09-05 07:51:15 +01:00
7cbb874029 Merge pull request #288 from Focuslinkstech/Development
Development
2024-09-04 16:46:01 +07:00
44fe6a0ff7 fix list group item 2024-09-04 09:24:42 +01:00
74ec6128ab fixed box header color 2024-09-04 09:17:22 +01:00
899c27f1a7 Add Dark Mode to Customer Dashboard 2024-09-04 08:57:53 +01:00
f7a86666c2 Merge pull request #287 from Focuslinkstech/Development
Dark Mode Journey Has Started
2024-09-04 09:54:47 +07:00
a22e2e1b2c Dark Mode Journey Has Started 2024-09-03 17:43:39 +01:00
cc6babf04a Merge pull request #286 from Focuslinkstech/Development
fix WhatsApp welcome message not sending
2024-09-01 12:01:31 +07:00
9e7698f83d fix WhatsApp welcome message not sending 2024-08-31 12:37:20 +01:00
e1008ae61f move error customer to folder user-ui 2024-08-30 14:02:23 +07:00
ef0d19393f forgot to check enabled router when showing offline router 2024-08-30 13:53:13 +07:00
8e2a40d670 Error page for customer 2024-08-30 11:44:57 +07:00
34482ff0d4 move register button to right 2024-08-30 11:22:18 +07:00
35ace619d2 Merge pull request #283 from ahmadhusein17/Development
Development
2024-08-29 23:39:07 +07:00
6da6041cb8 Update admin-add.tpl 2024-08-29 23:33:43 +07:00
463ee27116 Update sendPlan.tpl 2024-08-29 19:03:57 +07:00
fe930a1012 Update selectGateway.tpl 2024-08-29 19:01:28 +07:00
abd22418ce Update profile.tpl 2024-08-29 18:55:21 +07:00
9099584d7c Update orderView.tpl 2024-08-29 18:46:21 +07:00
5a84e10b70 Update orderHistory.tpl 2024-08-29 18:30:55 +07:00
89786c64af Update orderBalance.tpl 2024-08-29 18:25:29 +07:00
e7ec68872b Update header.tpl 2024-08-29 18:17:53 +07:00
82d756567e add Registration code sms verification code to Language, some carrier block text Verification 2024-08-29 15:33:49 +07:00
9436a6e8f1 remove active when extend 2024-08-29 11:23:57 +07:00
e8885e91ec Merge pull request #282 from ahmadhusein17/Development
Development
2024-08-29 09:04:37 +07:00
8e96f1457a Update page-edit.tpl 2024-08-28 22:55:30 +07:00
2a2e9c3bd4 Update message.tpl 2024-08-28 22:53:55 +07:00
b8e856518f Update message.tpl 2024-08-28 22:36:11 +07:00
4e19894152 Update invoice.tpl 2024-08-28 22:34:25 +07:00
414f9929e5 Update invoice-print.tpl 2024-08-28 22:33:23 +07:00
5bcf278733 Update deposit.tpl 2024-08-28 22:30:08 +07:00
453ea564cf Update dbstatus.tpl 2024-08-28 22:29:12 +07:00
a167d97e3c Update dashboard.tpl 2024-08-28 22:25:25 +07:00
55349b40dd Update bandwidth.tpl 2024-08-28 22:15:01 +07:00
bac8819c31 Update bandwidth-edit.tpl 2024-08-28 22:14:06 +07:00
aaeaa9305a Update bandwidth-add.tpl 2024-08-28 22:13:24 +07:00
f37987a4c6 Update balance.tpl 2024-08-28 22:12:19 +07:00
393939fab4 Update balance-edit.tpl 2024-08-28 22:10:51 +07:00
0189234b56 Update app-settings.tpl 2024-08-28 22:08:33 +07:00
8d4d88f702 Update app-localisation.tpl 2024-08-28 21:46:15 +07:00
5d79cb65ce Update admin-edit.tpl 2024-08-28 21:42:45 +07:00
1d08e8d204 Update admin-add.tpl 2024-08-28 21:38:56 +07:00
afaafd6195 remove debug 2024-08-28 14:50:26 +07:00
bd9989eaf2 hide when no router offline 2024-08-28 14:39:19 +07:00
70 changed files with 4399 additions and 1114 deletions

1
.gitignore vendored
View File

@ -46,6 +46,7 @@ system/devices/**
!system/devices/Radius.php
!system/devices/RadiusRest.php
!system/devices/MikrotikPppoe.php
!system/devices/MikrotikPppoeCustom.php
!system/devices/MikrotikHotspot.php
/.vs
docker-compose.yml

View File

@ -2,6 +2,13 @@
# CHANGELOG
## 2024.9.13
- Add Selling Mikrotik VPN By @agstrxyz
- Theme Redesign by @Focuslinkstech
- Fix That and this
## 2024.8.28
- add Router Status Offline/Online by @Focuslinkstech

View File

@ -13,25 +13,27 @@ class Admin
{
global $db_pass, $config;
$enable_session_timeout = $config['enable_session_timeout'];
if ($enable_session_timeout) {
$timeout = 60;
if ($config['session_timeout_duration']) {
$timeout = intval($config['session_timeout_duration']);
$session_timeout_duration = $config['session_timeout_duration'] ? intval($config['session_timeout_duration'] * 60) : intval(60 * 60); // Convert minutes to seconds
// Check if the session is active and valid
if (isset($_SESSION['aid']) && isset($_SESSION['aid_expiration'])) {
if ($_SESSION['aid_expiration'] > time()) {
if ($enable_session_timeout) {
$_SESSION['aid_expiration'] = time() + $session_timeout_duration;
}
return $_SESSION['aid'];
}
// Session expired, log out the user
elseif ($enable_session_timeout && $_SESSION['aid_expiration'] <= time()) {
self::removeCookie();
session_destroy();
_alert(Lang::T('Session has expired. Please log in again.'), 'danger', "admin");
return 0;
}
$session_timeout_duration = $timeout * 60; // Convert minutes to seconds
}
if (isset($_SESSION['aid']) && isset($_SESSION['aid_expiration']) && $_SESSION['aid_expiration'] > time()) {
return $_SESSION['aid'];
} elseif ($enable_session_timeout && isset($_SESSION['aid']) && isset($_SESSION['aid_expiration']) && $_SESSION['aid_expiration'] <= time()) {
self::removeCookie();
session_destroy();
_alert(Lang::T('Session has expired. Please log in again.'), 'danger', "admin");
return 0;
}
// Check if cookie is set and valid
// Check if the cookie is set and valid
elseif (isset($_COOKIE['aid'])) {
// id.time.sha1
$tmp = explode('.', $_COOKIE['aid']);
if (sha1($tmp[0] . '.' . $tmp[1] . '.' . $db_pass) == $tmp[2]) {
if (time() - $tmp[1] < 86400 * 7) {

View File

@ -201,10 +201,10 @@ class Message
return "$via: $msg";
}
public static function sendBalanceNotification($cust, $balance, $balance_now, $message, $via)
public static function sendBalanceNotification($cust, $target, $balance, $balance_now, $message, $via)
{
global $config;
$msg = str_replace('[[name]]', $cust['fullname'] . ' (' . $cust['username'] . ')', $message);
$msg = str_replace('[[name]]', $target['fullname'] . ' (' . $target['username'] . ')', $message);
$msg = str_replace('[[current_balance]]', Lang::moneyFormat($balance_now), $msg);
$msg = str_replace('[[balance]]', Lang::moneyFormat($balance), $msg);
$phone = $cust['phonenumber'];
@ -219,6 +219,7 @@ class Message
} else if ($via == 'wa') {
Message::sendWhatsapp($phone, $msg);
}
self::addToInbox($cust['id'], Lang::T('Balance Notification'), $msg);
}
return "$via: $msg";
}
@ -258,4 +259,15 @@ class Message
Message::sendWhatsapp($cust['phonenumber'], $textInvoice);
}
}
public static function addToInbox($to_customer_id, $subject, $body, $from = 'System'){
$v = ORM::for_table('tbl_customers_inbox')->create();
$v->from = $from;
$v->customer_id = $to_customer_id;
$v->subject = $subject;
$v->date_created = date('Y-m-d H:i:s');
$v->body = nl2br($body);
$v->save();
}
}

View File

@ -210,14 +210,15 @@ class User
->select('tbl_user_recharges.id', 'id')
->selects([
'customer_id', 'username', 'plan_id', 'namebp', 'recharged_on', 'recharged_time', 'expiration', 'time',
'status', 'method', 'plan_type', 'name_bw',
'status', 'method', 'plan_type',
['tbl_user_recharges.routers', 'routers'],
['tbl_user_recharges.type', 'type'],
'admin_id', 'prepaid'
])
->left_outer_join('tbl_plans', ['tbl_plans.id', '=', 'tbl_user_recharges.plan_id'])
->left_outer_join('tbl_bandwidth', ['tbl_bandwidth.id', '=', 'tbl_plans.id_bw'])
->select('tbl_bandwidth.name_bw', 'name_bw')
->where('customer_id', $id)
->left_outer_join('tbl_plans', array('tbl_plans.id', '=', 'tbl_user_recharges.plan_id'))
->left_outer_join('tbl_bandwidth', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))
->find_many();
return $d;
}

View File

@ -129,11 +129,11 @@ try {
$e->getTraceAsString()
);
if (!Admin::getID()) {
r2(U . 'home', 'e', $e->getMessage());
$ui->display('user-ui/error.tpl'); die();
}
$ui->assign("error_message", $e->getMessage() . '<br><pre>' . $e->getTraceAsString() . '</pre>');
$ui->assign("error_title", "PHPNuxBill Crash");
$ui->display('router-error.tpl');
$ui->display('error.tpl');
die();
} catch (Exception $e) {
Message::sendTelegram(
@ -142,10 +142,10 @@ try {
$e->getTraceAsString()
);
if (!Admin::getID()) {
r2(U . 'home', 'e', $e->getMessage());
$ui->display('user-ui/error.tpl'); die();
}
$ui->assign("error_message", $e->getMessage() . '<br><pre>' . $e->getTraceAsString() . '</pre>');
$ui->assign("error_title", "PHPNuxBill Crash");
$ui->display('router-error.tpl');
$ui->display('error.tpl');
die();
}

View File

@ -139,12 +139,12 @@ switch ($action) {
file_put_contents($phoneFile, $phone);
// send send OTP to user
if ($config['phone_otp_type'] === 'sms') {
Message::sendSMS($phone, $config['CompanyName'] . "\n Your Verification code is: $otp");
Message::sendSMS($phone, $config['CompanyName'] . "\n\n" . Lang::T("Verification code") . "\n$otp");
} elseif ($config['phone_otp_type'] === 'whatsapp') {
Message::sendWhatsapp($phone, $config['CompanyName'] . "\n Your Verification code is: $otp");
Message::sendWhatsapp($phone, $config['CompanyName'] . "\n\n" . Lang::T("Verification code") . "\n$otp");
} elseif ($config['phone_otp_type'] === 'both') {
Message::sendSMS($phone, $config['CompanyName'] . "\n Your Verification code is: $otp");
Message::sendWhatsapp($phone, $config['CompanyName'] . "\n Your Verification code is: $otp");
Message::sendSMS($phone, $config['CompanyName'] . "\n\n" . Lang::T("Verification code") . "\n$otp");
Message::sendWhatsapp($phone, $config['CompanyName'] . "\n\n" . Lang::T("Verification code") . "\n$otp");
}
//redirect after sending OTP
r2(U . 'accounts/phone-update', 'e', Lang::T('Verification code has been sent to your phone'));

View File

@ -455,7 +455,7 @@ switch ($action) {
'args' => [$d['phonenumber'], $welcomeMessage]
],
'whatsapp' => [
'enabled' => isset($_POST['wa']) && $_POST['wa'] == 'wa',
'enabled' => isset($_POST['wa']),
'method' => 'sendWhatsapp',
'args' => [$d['phonenumber'], $welcomeMessage]
],
@ -673,10 +673,10 @@ switch ($action) {
default:
run_hook('list_customers'); #HOOK
$search = _post('search');
$order = _post('order', 'username');
$filter = _post('filter', 'Active');
$orderby = _post('orderby', 'asc');
$search = _req('search');
$order = _req('order', 'username');
$filter = _req('filter', 'Active');
$orderby = _req('orderby', 'asc');
$order_pos = [
'username' => 0,
'created_at' => 8,

View File

@ -210,11 +210,16 @@ if (file_exists($cacheMSfile) && time() - filemtime($cacheMSfile) < 43200) {
}
if ($config['router_check']) {
$routeroffs = ORM::for_table('tbl_routers')->selects(['id', 'name', 'last_seen'])->where('status', 'Offline')->order_by_desc('name')->find_array();
print_r($routeroffs);
$routeroffs = ORM::for_table('tbl_routers')->selects(['id', 'name', 'last_seen'])->where('status', 'Offline')->where('enabled', '1')->order_by_desc('name')->find_array();
$ui->assign('routeroffs', $routeroffs);
}
$timestampFile = "$UPLOAD_PATH/cron_last_run.txt";
if (file_exists($timestampFile)) {
$lastRunTime = file_get_contents($timestampFile);
$ui->assign('run_date', date('Y-m-d h:i:s A', $lastRunTime));
}
// Assign the monthly sales data to Smarty
$ui->assign('start_date', $start_date);
$ui->assign('current_date', $current_date);

View File

@ -71,8 +71,9 @@ if (_post('send') == 'balance') {
$d->pg_url_payment = 'balance';
$d->status = 2;
$d->save();
Message::sendBalanceNotification($user, $balance, ($user['balance'] - $balance), Lang::getNotifText('balance_send'), $config['user_notification_payment']);
Message::sendBalanceNotification($target, $balance, ($target['balance'] + $balance), Lang::getNotifText('balance_received'), $config['user_notification_payment']);
//
Message::sendBalanceNotification($user, $target, $balance, ($user['balance'] - $balance), Lang::getNotifText('balance_send'), $config['user_notification_payment']);
Message::sendBalanceNotification($target, $user, $balance, ($target['balance'] + $balance), Lang::getNotifText('balance_received'), $config['user_notification_payment']);
Message::sendTelegram("#u$user[username] send balance to #u$target[username] \n" . Lang::moneyFormat($balance));
r2(U . 'home', 's', Lang::T('Sending balance success'));
}
@ -188,6 +189,8 @@ if (isset($_GET['recharge']) && !empty($_GET['recharge'])) {
if ($_app_stage != 'demo') {
if (file_exists($dvc)) {
require_once $dvc;
global $isChangePlan;
$isChangePlan = true;
(new $p['device'])->add_customer($user, $p);
} else {
new Exception(Lang::T("Devices Not Found"));
@ -314,7 +317,15 @@ if (!empty($_SESSION['nux-mac']) && !empty($_SESSION['nux-ip'] && !empty($_SESSI
}
}
}
$tcf = ORM::for_table('tbl_customers_fields')
->where('customer_id', $user['id'])
->find_many();
$vpn = ORM::for_table('tbl_port_pool')
->find_one();
$ui->assign('cf', $tcf);
$ui->assign('vpn', $vpn);
$ui->assign('unpaid', ORM::for_table('tbl_payment_gateway')
->where('username', $user['username'])
->where('status', 1)

View File

@ -113,12 +113,19 @@ switch ($action) {
->where('type', 'Hotspot')
->where('prepaid', 'yes')
->find_many();
$plans_vpn = ORM::for_table('tbl_plans')
->where('plan_type', $account_type)
->where('enabled', '1')->where('is_radius', 0)
->where('type', 'VPN')
->where('prepaid', 'yes')
->find_many();
}
$ui->assign('routers', $routers);
$ui->assign('radius_pppoe', $radius_pppoe);
$ui->assign('radius_hotspot', $radius_hotspot);
$ui->assign('plans_pppoe', $plans_pppoe);
$ui->assign('plans_hotspot', $plans_hotspot);
$ui->assign('plans_vpn', $plans_vpn);
run_hook('customer_view_order_plan'); #HOOK
$ui->display('user-ui/orderPlan.tpl');
break;

View File

@ -848,6 +848,8 @@ switch ($action) {
if ($_app_stage != 'demo') {
if (file_exists($dvc)) {
require_once $dvc;
global $isChangePlan;
$isChangePlan = true;
(new $p['device'])->add_customer($c, $p);
} else {
new Exception(Lang::T("Devices Not Found"));

View File

@ -147,6 +147,132 @@ switch ($action) {
} else {
r2(U . 'pool/edit/' . $id, 'e', $msg);
}
case 'port':
$ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/pool.js"></script>');
$name = _post('name');
if ($name != '') {
$query = ORM::for_table('tbl_port_pool')->where_like('pool_name', '%' . $name . '%')->order_by_desc('id');
$d = Paginator::findMany($query, ['name' => $name]);
} else {
$query = ORM::for_table('tbl_port_pool')->order_by_desc('id');
$d = Paginator::findMany($query);
}
$ui->assign('d', $d);
run_hook('view_port'); #HOOK
$ui->display('port.tpl');
break;
case 'add-port':
$r = ORM::for_table('tbl_routers')->find_many();
$ui->assign('r', $r);
run_hook('view_add_port'); #HOOK
$ui->display('port-add.tpl');
break;
case 'edit-port':
$id = $routes['2'];
$d = ORM::for_table('tbl_port_pool')->find_one($id);
if ($d) {
$ui->assign('d', $d);
run_hook('view_edit_port'); #HOOK
$ui->display('port-edit.tpl');
} else {
r2(U . 'pool/port', 'e', Lang::T('Account Not Found'));
}
break;
case 'delete-port':
$id = $routes['2'];
run_hook('delete_port'); #HOOK
$d = ORM::for_table('tbl_port_pool')->find_one($id);
if ($d) {
$d->delete();
r2(U . 'pool/port', 's', Lang::T('Data Deleted Successfully'));
}
break;
case 'sync':
$pools = ORM::for_table('tbl_port_pool')->find_many();
$log = '';
foreach ($pools as $pool) {
if ($pool['routers'] != 'radius') {
(new MikrotikPppoe())->update_pool($pool, $pool);
$log .= 'DONE: ' . $pool['port_name'] . ': ' . $pool['range_port'] . '<br>';
}
}
r2(U . 'pool/list', 's', $log);
break;
case 'add-port-post':
$name = _post('name');
$port_range = _post('port_range');
$public_ip = _post('public_ip');
$routers = _post('routers');
run_hook('add_pool'); #HOOK
$msg = '';
if (Validator::Length($name, 30, 2) == false) {
$msg .= 'Name should be between 3 to 30 characters' . '<br>';
}
if ($port_range == '' or $routers == '') {
$msg .= Lang::T('All field is required') . '<br>';
}
$d = ORM::for_table('tbl_port_pool')->where('routers', $routers)->find_one();
if ($d) {
$msg .= Lang::T('Routers already have ports, each router can only have 1 port range!') . '<br>';
}
if ($msg == '') {
$b = ORM::for_table('tbl_port_pool')->create();
$b->public_ip = $public_ip;
$b->port_name = $name;
$b->range_port = $port_range;
$b->routers = $routers;
$b->save();
r2(U . 'pool/port', 's', Lang::T('Data Created Successfully'));
} else {
r2(U . 'pool/add-port', 'e', $msg);
}
break;
case 'edit-port-post':
$name = _post('name');
$public_ip = _post('public_ip');
$range_port = _post('range_port');
$routers = _post('routers');
run_hook('edit_port'); #HOOK
$msg = '';
$msg = '';
if (Validator::Length($name, 30, 2) == false) {
$msg .= 'Name should be between 3 to 30 characters' . '<br>';
}
if ($range_port == '' or $routers == '') {
$msg .= Lang::T('All field is required') . '<br>';
}
$id = _post('id');
$d = ORM::for_table('tbl_port_pool')->find_one($id);
$old = ORM::for_table('tbl_port_pool')->find_one($id);
if (!$d) {
$msg .= Lang::T('Data Not Found') . '<br>';
}
if ($msg == '') {
$d->port_name = $name;
$d->public_ip = $public_ip;
$d->range_port = $range_port;
$d->routers = $routers;
$d->save();
r2(U . 'pool/port', 's', Lang::T('Data Updated Successfully'));
} else {
r2(U . 'pool/edit-port/' . $id, 'e', $msg);
}
break;
default:

View File

@ -132,9 +132,9 @@ switch ($do) {
} else {
$otp = rand(100000, 999999);
file_put_contents($otpPath, $otp);
Message::sendSMS($username, $config['CompanyName'] . "\nYour Verification code are: $otp");
Message::sendSMS($username, $config['CompanyName'] . "\n\n".Lang::T("Registration code")."\n$otp");
$ui->assign('username', $username);
$ui->assign('notify', 'Verification code has been sent to your phone');
$ui->assign('notify', 'Registration code has been sent to your phone');
$ui->assign('notify_t', 's');
$ui->display('user-ui/register-otp.tpl');
}

View File

@ -901,6 +901,380 @@ switch ($action) {
r2(U . 'services/balance-add', 'e', $msg);
}
break;
case 'vpn':
$ui->assign('_title', Lang::T('VPN Plans'));
$ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/pppoe.js"></script>');
$name = _post('name');
$name = _req('name');
$type1 = _req('type1');
$type2 = _req('type2');
$type3 = _req('type3');
$bandwidth = _req('bandwidth');
$valid = _req('valid');
$device = _req('device');
$status = _req('status');
$router = _req('router');
$ui->assign('type1', $type1);
$ui->assign('type2', $type2);
$ui->assign('type3', $type3);
$ui->assign('bandwidth', $bandwidth);
$ui->assign('valid', $valid);
$ui->assign('device', $device);
$ui->assign('status', $status);
$ui->assign('router', $router);
$append_url = "&type1=" . urlencode($type1)
. "&type2=" . urlencode($type2)
. "&type3=" . urlencode($type3)
. "&bandwidth=" . urlencode($bandwidth)
. "&valid=" . urlencode($valid)
. "&device=" . urlencode($device)
. "&status=" . urlencode($status)
. "&router=" . urlencode($router);
$bws = ORM::for_table('tbl_plans')->distinct()->select("id_bw")->where('tbl_plans.type', 'VPN')->findArray();
$ids = array_column($bws, 'id_bw');
if(count($ids)){
$ui->assign('bws', ORM::for_table('tbl_bandwidth')->select("id")->select('name_bw')->where_id_in($ids)->findArray());
}else{
$ui->assign('bws', []);
}
$ui->assign('type2s', ORM::for_table('tbl_plans')->getEnum("plan_type"));
$ui->assign('type3s', ORM::for_table('tbl_plans')->getEnum("typebp"));
$ui->assign('valids', ORM::for_table('tbl_plans')->getEnum("validity_unit"));
$ui->assign('routers', array_column(ORM::for_table('tbl_plans')->distinct()->select("routers")->whereNotEqual('routers', '')->findArray(), 'routers'));
$devices = [];
$files = scandir($DEVICE_PATH);
foreach ($files as $file) {
$ext = pathinfo($file, PATHINFO_EXTENSION);
if ($ext == 'php') {
$devices[] = pathinfo($file, PATHINFO_FILENAME);
}
}
$ui->assign('devices', $devices);
$query = ORM::for_table('tbl_bandwidth')
->left_outer_join('tbl_plans', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))
->where('tbl_plans.type', 'VPN');
if (!empty($type1)) {
$query->where('tbl_plans.prepaid', $type1);
}
if (!empty($type2)) {
$query->where('tbl_plans.plan_type', $type2);
}
if (!empty($type3)) {
$query->where('tbl_plans.typebp', $type3);
}
if (!empty($bandwidth)) {
$query->where('tbl_plans.id_bw', $bandwidth);
}
if (!empty($valid)) {
$query->where('tbl_plans.validity_unit', $valid);
}
if (!empty($router)) {
if ($router == 'radius') {
$query->where('tbl_plans.is_radius', '1');
} else {
$query->where('tbl_plans.routers', $router);
}
}
if (!empty($device)) {
$query->where('tbl_plans.device', $device);
}
if (in_array($status, ['0', '1'])) {
$query->where('tbl_plans.enabled', $status);
}
if ($name != '') {
$query->where_like('tbl_plans.name_plan', '%' . $name . '%');
}
$d = Paginator::findMany($query, ['name' => $name], 20, $append_url);
$ui->assign('d', $d);
run_hook('view_list_vpn'); #HOOK
$ui->display('vpn.tpl');
break;
case 'vpn-add':
$ui->assign('_title', Lang::T('VPN Plans'));
$d = ORM::for_table('tbl_bandwidth')->find_many();
$ui->assign('d', $d);
$r = ORM::for_table('tbl_routers')->find_many();
$ui->assign('r', $r);
$devices = [];
$files = scandir($DEVICE_PATH);
foreach ($files as $file) {
$ext = pathinfo($file, PATHINFO_EXTENSION);
if ($ext == 'php') {
$devices[] = pathinfo($file, PATHINFO_FILENAME);
}
}
$ui->assign('devices', $devices);
run_hook('view_add_vpn'); #HOOK
$ui->display('vpn-add.tpl');
break;
case 'vpn-edit':
$ui->assign('_title', Lang::T('VPN Plans'));
$id = $routes['2'];
$d = ORM::for_table('tbl_plans')->find_one($id);
if ($d) {
if (empty($d['device'])) {
if ($d['is_radius']) {
$d->device = 'Radius';
} else {
$d->device = 'MikrotikVpn';
}
$d->save();
}
$ui->assign('d', $d);
$p = ORM::for_table('tbl_pool')->where('routers', ($d['is_radius']) ? 'radius' : $d['routers'])->find_many();
$ui->assign('p', $p);
$b = ORM::for_table('tbl_bandwidth')->find_many();
$ui->assign('b', $b);
$r = [];
if ($d['is_radius']) {
$r = ORM::for_table('tbl_routers')->find_many();
}
$ui->assign('r', $r);
$devices = [];
$files = scandir($DEVICE_PATH);
foreach ($files as $file) {
$ext = pathinfo($file, PATHINFO_EXTENSION);
if ($ext == 'php') {
$devices[] = pathinfo($file, PATHINFO_FILENAME);
}
}
$ui->assign('devices', $devices);
//select expired plan
if ($d['is_radius']) {
$exps = ORM::for_table('tbl_plans')->selects('id', 'name_plan')->where('type', 'VPN')->where("is_radius", 1)->findArray();
} else {
$exps = ORM::for_table('tbl_plans')->selects('id', 'name_plan')->where('type', 'VPN')->where("routers", $d['routers'])->findArray();
}
$ui->assign('exps', $exps);
run_hook('view_edit_vpn'); #HOOK
$ui->display('vpn-edit.tpl');
} else {
r2(U . 'services/vpn', 'e', Lang::T('Account Not Found'));
}
break;
case 'vpn-delete':
$id = $routes['2'];
$d = ORM::for_table('tbl_plans')->find_one($id);
if ($d) {
run_hook('delete_vpn'); #HOOK
$dvc = Package::getDevice($d);
if ($_app_stage != 'demo') {
if (file_exists($dvc)) {
require_once $dvc;
(new $d['device'])->remove_plan($d);
} else {
new Exception(Lang::T("Devices Not Found"));
}
}
$d->delete();
r2(U . 'services/vpn', 's', Lang::T('Data Deleted Successfully'));
}
break;
case 'vpn-add-post':
$name = _post('name_plan');
$plan_type = _post('plan_type');
$radius = _post('radius');
$id_bw = _post('id_bw');
$price = _post('price');
$validity = _post('validity');
$validity_unit = _post('validity_unit');
$routers = _post('routers');
$device = _post('device');
$pool = _post('pool_name');
$enabled = _post('enabled');
$prepaid = _post('prepaid');
$expired_date = _post('expired_date');
$msg = '';
if (Validator::UnsignedNumber($validity) == false) {
$msg .= 'The validity must be a number' . '<br>';
}
if (Validator::UnsignedNumber($price) == false) {
$msg .= 'The price must be a number' . '<br>';
}
if ($name == '' or $id_bw == '' or $price == '' or $validity == '' or $pool == '') {
$msg .= Lang::T('All field is required') . '<br>';
}
if (empty($radius)) {
if ($routers == '') {
$msg .= Lang::T('All field is required') . '<br>';
}
}
$d = ORM::for_table('tbl_plans')->where('name_plan', $name)->find_one();
if ($d) {
$msg .= Lang::T('Name Plan Already Exist') . '<br>';
}
run_hook('add_vpn'); #HOOK
if ($msg == '') {
$b = ORM::for_table('tbl_bandwidth')->where('id', $id_bw)->find_one();
if ($b['rate_down_unit'] == 'Kbps') {
$unitdown = 'K';
$raddown = '000';
} else {
$unitdown = 'M';
$raddown = '000000';
}
if ($b['rate_up_unit'] == 'Kbps') {
$unitup = 'K';
$radup = '000';
} else {
$unitup = 'M';
$radup = '000000';
}
$rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown;
$radiusRate = $b['rate_up'] . $radup . '/' . $b['rate_down'] . $raddown . '/' . $b['burst'];
$rate = trim($rate . " " . $b['burst']);
$d = ORM::for_table('tbl_plans')->create();
$d->type = 'VPN';
$d->name_plan = $name;
$d->id_bw = $id_bw;
$d->price = $price;
$d->plan_type = $plan_type;
$d->validity = $validity;
$d->validity_unit = $validity_unit;
$d->pool = $pool;
if (!empty($radius)) {
$d->is_radius = 1;
$d->routers = '';
} else {
$d->is_radius = 0;
$d->routers = $routers;
}
if ($prepaid == 'no') {
if ($expired_date > 28 && $expired_date < 1) {
$expired_date = 20;
}
$d->expired_date = $expired_date;
} else {
$d->expired_date = 0;
}
$d->enabled = $enabled;
$d->prepaid = $prepaid;
$d->device = $device;
$d->save();
$dvc = Package::getDevice($d);
if ($_app_stage != 'demo') {
if (file_exists($dvc)) {
require_once $dvc;
(new $d['device'])->add_plan($d);
} else {
new Exception(Lang::T("Devices Not Found"));
}
}
r2(U . 'services/vpn', 's', Lang::T('Data Created Successfully'));
} else {
r2(U . 'services/vpn-add', 'e', $msg);
}
break;
case 'edit-vpn-post':
$id = _post('id');
$plan_type = _post('plan_type');
$name = _post('name_plan');
$id_bw = _post('id_bw');
$price = _post('price');
$validity = _post('validity');
$validity_unit = _post('validity_unit');
$routers = _post('routers');
$device = _post('device');
$pool = _post('pool_name');
$plan_expired = _post('plan_expired');
$enabled = _post('enabled');
$prepaid = _post('prepaid');
$expired_date = _post('expired_date');
$on_login = _post('on_login');
$on_logout = _post('on_logout');
$msg = '';
if (Validator::UnsignedNumber($validity) == false) {
$msg .= 'The validity must be a number' . '<br>';
}
if (Validator::UnsignedNumber($price) == false) {
$msg .= 'The price must be a number' . '<br>';
}
if ($name == '' or $id_bw == '' or $price == '' or $validity == '' or $pool == '') {
$msg .= Lang::T('All field is required') . '<br>';
}
$d = ORM::for_table('tbl_plans')->where('id', $id)->find_one();
$old = ORM::for_table('tbl_plans')->where('id', $id)->find_one();
if ($d) {
} else {
$msg .= Lang::T('Data Not Found') . '<br>';
}
run_hook('edit_vpn'); #HOOK
if ($msg == '') {
$b = ORM::for_table('tbl_bandwidth')->where('id', $id_bw)->find_one();
if ($b['rate_down_unit'] == 'Kbps') {
$unitdown = 'K';
$raddown = '000';
} else {
$unitdown = 'M';
$raddown = '000000';
}
if ($b['rate_up_unit'] == 'Kbps') {
$unitup = 'K';
$radup = '000';
} else {
$unitup = 'M';
$radup = '000000';
}
$rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown;
$radiusRate = $b['rate_up'] . $radup . '/' . $b['rate_down'] . $raddown . '/' . $b['burst'];
$rate = trim($rate . " " . $b['burst']);
$d->name_plan = $name;
$d->id_bw = $id_bw;
$d->price = $price;
$d->plan_type = $plan_type;
$d->validity = $validity;
$d->validity_unit = $validity_unit;
$d->routers = $routers;
$d->pool = $pool;
$d->plan_expired = $plan_expired;
$d->enabled = $enabled;
$d->prepaid = $prepaid;
$d->device = $device;
$d->on_login = $on_login;
$d->on_logout = $on_logout;
if ($prepaid == 'no') {
if ($expired_date > 28 && $expired_date < 1) {
$expired_date = 20;
}
$d->expired_date = $expired_date;
} else {
$d->expired_date = 0;
}
$d->save();
$dvc = Package::getDevice($d);
if ($_app_stage != 'demo') {
if (file_exists($dvc)) {
require_once $dvc;
(new $d['device'])->update_plan($old, $d);
} else {
new Exception(Lang::T("Devices Not Found"));
}
}
r2(U . 'services/vpn', 's', Lang::T('Data Updated Successfully'));
} else {
r2(U . 'services/vpn-edit/' . $id, 'e', $msg);
}
break;
default:
$ui->display('a404.tpl');
}

View File

@ -151,7 +151,7 @@ switch ($action) {
$ui->assign("error_message", "Radius table not found.<br><br>" .
$e->getMessage() .
"<br><br>Download <a href=\"https://raw.githubusercontent.com/hotspotbilling/phpnuxbill/Development/install/radius.sql\">here</a> or <a href=\"https://raw.githubusercontent.com/hotspotbilling/phpnuxbill/master/install/radius.sql\">here</a> and import it to database.<br><br>Check config.php for radius connection details");
$ui->display('router-error.tpl');
$ui->display('error.tpl');
die();
}
}
@ -295,6 +295,16 @@ switch ($action) {
$d->value = _post('pppoe_plan');
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'vpn_plan')->find_one();
if ($d) {
$d->value = _post('vpn_plan');
$d->save();
} else {
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'vpn_plan';
$d->value = _post('vpn_plan');
$d->save();
}
$currency_code = $_POST['currency_code'];
$d = ORM::for_table('tbl_appconfig')->where('setting', 'currency_code')->find_one();

View File

@ -1,6 +1,27 @@
<?php
include "../init.php";
$lockFile = "$CACHE_PATH/router_monitor.lock";
if (!is_dir($CACHE_PATH)) {
echo "Directory '$CACHE_PATH' does not exist. Exiting...\n";
exit;
}
$lock = fopen($lockFile, 'c');
if ($lock === false) {
echo "Failed to open lock file. Exiting...\n";
exit;
}
if (!flock($lock, LOCK_EX | LOCK_NB)) {
echo "Script is already running. Exiting...\n";
fclose($lock);
exit;
}
$isCli = true;
if (php_sapi_name() !== 'cli') {
$isCli = false;
@ -81,27 +102,7 @@ foreach ($d as $ds) {
if ($config['router_check']) {
$lockFile = $CACHE_PATH . '/router_monitor.lock';
if (!is_dir($CACHE_PATH)) {
echo "Directory '$CACHE_PATH' does not exist. Exiting...\n";
exit;
}
$lock = fopen($lockFile, 'c');
if ($lock === false) {
echo "Failed to open lock file. Exiting...\n";
exit;
}
if (!flock($lock, LOCK_EX | LOCK_NB)) {
echo "Script is already running. Exiting...\n";
fclose($lock);
exit;
}
echo "Checking router status...\n";
$routers = ORM::for_table('tbl_routers')->where('enabled', '1')->find_many();
if (!$routers) {
echo "No active routers found in the database.\n";
@ -186,14 +187,20 @@ if ($config['router_check']) {
Message::SendEmail($adminEmail, $subject, $message);
sendTelegram($message);
}
if (defined('PHP_SAPI') && PHP_SAPI === 'cli') {
echo "Cronjob finished\n";
} else {
echo "</pre>";
}
flock($lock, LOCK_UN);
fclose($lock);
unlink($lockFile);
echo "Router monitoring finished\n";
}
if (defined('PHP_SAPI') && PHP_SAPI === 'cli') {
echo "Cronjob finished\n";
} else {
echo "</pre>";
}
flock($lock, LOCK_UN);
fclose($lock);
unlink($lockFile);
$timestampFile = "$UPLOAD_PATH/cron_last_run.txt";
file_put_contents($timestampFile, time());

View File

@ -50,9 +50,9 @@ class MikrotikPppoe
$setRequest->setArgument('name', $customer['username']);
}
if (!empty($customer['pppoe_ip'])) {
$setRequest->setArgument('local-address', $customer['pppoe_ip']);
$setRequest->setArgument('remote-address', $customer['pppoe_ip']);
}else{
$setRequest->setArgument('local-address', '0.0.0.0');
$setRequest->setArgument('remote-address', '0.0.0.0');
}
$setRequest->setArgument('profile', $plan['name_plan']);
$setRequest->setArgument('comment', $customer['fullname'] . ' | ' . $customer['email'] . ' | ' . implode(', ', User::getBillNames($customer['id'])));
@ -338,7 +338,7 @@ class MikrotikPppoe
$setRequest->setArgument('name', $customer['username']);
}
if (!empty($customer['pppoe_ip'])) {
$setRequest->setArgument('local-address', $customer['pppoe_ip']);
$setRequest->setArgument('remote-address', $customer['pppoe_ip']);
}
$client->sendSync($setRequest);
}

View File

@ -0,0 +1,504 @@
<?php
use PEAR2\Net\RouterOS;
class MikrotikVpn
{
function description()
{
return [
'title' => 'Mikrotik Vpn',
'description' => 'To handle connection between PHPNuxBill with Mikrotik VPN',
'author' => 'agstr',
'url' => [
'Github' => 'https://github.com/agstrxyz',
'Telegram' => 'https://t.me/agstrxyz',
'Youtube' => 'https://www.youtube.com/@agstrxyz',
'Donate' => 'https://paypal.me/ibnux'
]
];
}
function add_customer($customer, $plan)
{
global $isChangePlan;
$mikrotik = $this->info($plan['routers']);
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$cid = self::getIdByCustomer($customer, $client);
if (empty($cid)) {
$this->addVpnUser($client, $plan, $customer);
}else{
$setRequest = new RouterOS\Request('/ppp/secret/set');
$setRequest->setArgument('numbers', $cid);
if (!empty($customer['pppoe_password'])) {
$setRequest->setArgument('password', $customer['pppoe_password']);
} else {
$setRequest->setArgument('password', $customer['password']);
}
if (!empty($customer['pppoe_username'])) {
$setRequest->setArgument('name', $customer['pppoe_username']);
} else {
$setRequest->setArgument('name', $customer['username']);
}
if (!empty($customer['pppoe_ip'])) {
$setRequest->setArgument('remote-address', $customer['pppoe_ip']);
}else{
$setRequest->setArgument('remote-address', '0.0.0.0');
}
$setRequest->setArgument('profile', $plan['name_plan']);
$setRequest->setArgument('comment', $customer['fullname'] . ' | ' . $customer['email'] . ' | ' . implode(', ', User::getBillNames($customer['id'])));
$client->sendSync($setRequest);
if(isset($isChangePlan) && $isChangePlan){
$this->removeVpnActive($client, $customer['username']);
if (!empty($customer['pppoe_username'])) {
$this->removeVpnActive($client, $customer['pppoe_username']);
}
}
}
}
function remove_customer($customer, $plan)
{
$mikrotik = $this->info($plan['routers']);
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
if (!empty($plan['plan_expired'])) {
$p = ORM::for_table("tbl_plans")->find_one($plan['plan_expired']);
if($p){
$this->add_customer($customer, $p);
$this->removeVpnActive($client, $customer['username']);
if (!empty($customer['pppoe_username'])) {
$this->removeVpnActive($client, $customer['pppoe_username']);
}
return;
}
}
$this->removeVpnUser($client, $customer['username'], $customer['id']);
if (!empty($customer['pppoe_username'])) {
$this->removeVpnUser($client, $customer['pppoe_username'], $customer['id']);
}
$this->removeVpnActive($client, $customer['username']);
if (!empty($customer['pppoe_username'])) {
$this->removeVpnActive($client, $customer['pppoe_username']);
}
}
public function change_username($plan, $from, $to)
{
$mikrotik = $this->info($plan['routers']);
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$printRequest = new RouterOS\Request('/ppp/secret/print');
$printRequest->setQuery(RouterOS\Query::where('name', $from));
$cid = $client->sendSync($printRequest)->getProperty('.id');
if (!empty($cid)) {
$setRequest = new RouterOS\Request('/ppp/secret/set');
$setRequest->setArgument('numbers', $cid);
$setRequest->setArgument('name', $to);
$client->sendSync($setRequest);
$this->removeVpnActive($client, $from);
}
}
function add_plan($plan)
{
$mikrotik = $this->info($plan['routers']);
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$bw = ORM::for_table("tbl_bandwidth")->find_one($plan['id_bw']);
if ($bw['rate_down_unit'] == 'Kbps') {
$unitdown = 'K';
} else {
$unitdown = 'M';
}
if ($bw['rate_up_unit'] == 'Kbps') {
$unitup = 'K';
} else {
$unitup = 'M';
}
$rate = $bw['rate_up'] . $unitup . "/" . $bw['rate_down'] . $unitdown;
if(!empty(trim($bw['burst']))){
$rate .= ' '.$bw['burst'];
}
$pool = ORM::for_table("tbl_pool")->where("pool_name", $plan['pool'])->find_one();
$addRequest = new RouterOS\Request('/ppp/profile/add');
$client->sendSync(
$addRequest
->setArgument('name', $plan['name_plan'])
->setArgument('local-address', (!empty($pool['local_ip'])) ? $pool['local_ip']: $pool['pool_name'])
->setArgument('remote-address', $pool['pool_name'])
->setArgument('rate-limit', $rate)
);
}
function getIdByCustomer($customer, $client){
$printRequest = new RouterOS\Request('/ppp/secret/print');
$printRequest->setQuery(RouterOS\Query::where('name', $customer['username']));
$id = $client->sendSync($printRequest)->getProperty('.id');
if(empty($id)){
if (!empty($customer['pppoe_username'])) {
$printRequest = new RouterOS\Request('/ppp/secret/print');
$printRequest->setQuery(RouterOS\Query::where('name', $customer['pppoe_username']));
$id = $client->sendSync($printRequest)->getProperty('.id');
}
}
return $id;
}
function update_plan($old_name, $new_plan)
{
$mikrotik = $this->info($new_plan['routers']);
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$printRequest = new RouterOS\Request(
'/ppp profile print .proplist=.id',
RouterOS\Query::where('name', $old_name['name_plan'])
);
$profileID = $client->sendSync($printRequest)->getProperty('.id');
if (empty($profileID)) {
$this->add_plan($new_plan);
} else {
$bw = ORM::for_table("tbl_bandwidth")->find_one($new_plan['id_bw']);
if ($bw['rate_down_unit'] == 'Kbps') {
$unitdown = 'K';
} else {
$unitdown = 'M';
}
if ($bw['rate_up_unit'] == 'Kbps') {
$unitup = 'K';
} else {
$unitup = 'M';
}
$rate = $bw['rate_up'] . $unitup . "/" . $bw['rate_down'] . $unitdown;
if(!empty(trim($bw['burst']))){
$rate .= ' '.$bw['burst'];
}
$pool = ORM::for_table("tbl_pool")->where("pool_name", $new_plan['pool'])->find_one();
$setRequest = new RouterOS\Request('/ppp/profile/set');
$client->sendSync(
$setRequest
->setArgument('numbers', $profileID)
->setArgument('local-address', (!empty($pool['local_ip'])) ? $pool['local_ip']: $pool['pool_name'])
->setArgument('remote-address', $pool['pool_name'])
->setArgument('rate-limit', $rate)
->setArgument('on-up', $new_plan['on_login'])
->setArgument('on-down', $new_plan['on_logout'])
);
}
}
function remove_plan($plan)
{
$mikrotik = $this->info($plan['routers']);
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$printRequest = new RouterOS\Request(
'/ppp profile print .proplist=.id',
RouterOS\Query::where('name', $plan['name_plan'])
);
$profileID = $client->sendSync($printRequest)->getProperty('.id');
$removeRequest = new RouterOS\Request('/ppp/profile/remove');
$client->sendSync(
$removeRequest
->setArgument('numbers', $profileID)
);
}
function add_pool($pool){
global $_app_stage;
if ($_app_stage == 'demo') {
return null;
}
$mikrotik = $this->info($pool['routers']);
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$addRequest = new RouterOS\Request('/ip/pool/add');
$client->sendSync(
$addRequest
->setArgument('name', $pool['pool_name'])
->setArgument('ranges', $pool['range_ip'])
);
}
function update_pool($old_pool, $new_pool){
global $_app_stage;
if ($_app_stage == 'demo') {
return null;
}
$mikrotik = $this->info($new_pool['routers']);
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$printRequest = new RouterOS\Request(
'/ip pool print .proplist=.id',
RouterOS\Query::where('name', $old_pool['pool_name'])
);
$poolID = $client->sendSync($printRequest)->getProperty('.id');
if (empty($poolID)) {
$this->add_pool($new_pool);
} else {
$setRequest = new RouterOS\Request('/ip/pool/set');
$client->sendSync(
$setRequest
->setArgument('numbers', $poolID)
->setArgument('name', $new_pool['pool_name'])
->setArgument('ranges', $new_pool['range_ip'])
);
}
}
function remove_pool($pool){
global $_app_stage;
if ($_app_stage == 'demo') {
return null;
}
$mikrotik = $this->info($pool['routers']);
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$printRequest = new RouterOS\Request(
'/ip pool print .proplist=.id',
RouterOS\Query::where('name', $pool['pool_name'])
);
$poolID = $client->sendSync($printRequest)->getProperty('.id');
$removeRequest = new RouterOS\Request('/ip/pool/remove');
$client->sendSync(
$removeRequest
->setArgument('numbers', $poolID)
);
}
function online_customer($customer, $router_name)
{
$mikrotik = $this->info($router_name);
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$printRequest = new RouterOS\Request(
'/ppp active print',
RouterOS\Query::where('user', $customer['username'])
);
return $client->sendSync($printRequest)->getProperty('.id');
}
function info($name)
{
return ORM::for_table('tbl_routers')->where('name', $name)->find_one();
}
function getClient($ip, $user, $pass)
{
global $_app_stage;
if ($_app_stage == 'demo') {
return null;
}
$iport = explode(":", $ip);
return new RouterOS\Client($iport[0], $user, $pass, ($iport[1]) ? $iport[1] : null);
}
function removeVpnUser($client, $username, $cstid)
{
global $_app_stage;
if ($_app_stage == 'demo') {
return null;
}
$printRequest = new RouterOS\Request('/ppp/secret/print');
//$printRequest->setArgument('.proplist', '.id');
$printRequest->setQuery(RouterOS\Query::where('name', $username));
$id = $client->sendSync($printRequest)->getProperty('.id');
$removeRequest = new RouterOS\Request('/ppp/secret/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
$this->rmNat($client, $cstid);
}
function addVpnUser($client, $plan, $customer)
{
$setRequest = new RouterOS\Request('/ppp/secret/add');
$setRequest->setArgument('service', 'any');
$setRequest->setArgument('profile', $plan['name_plan']);
$setRequest->setArgument('comment', $customer['fullname'] . ' | ' . $customer['email'] . ' | ' . implode(', ', User::getBillNames($customer['id'])));
if (!empty($customer['pppoe_password'])) {
$setRequest->setArgument('password', $customer['pppoe_password']);
} else {
$setRequest->setArgument('password', $customer['password']);
}
if (!empty($customer['pppoe_username'])) {
$setRequest->setArgument('name', $customer['pppoe_username']);
} else {
$setRequest->setArgument('name', $customer['username']);
}
if (!empty($customer['pppoe_ip'])) {
$ips = $customer['pppoe_ip'];
$setRequest->setArgument('remote-address', $customer['pppoe_ip']);
} else {
$ips = $this->checkIpAddr($plan['pool'], $customer['id']);
$setRequest->setArgument('remote-address', $ips);
}
$this->addNat($client, $plan, $customer, $ips);
$client->sendSync($setRequest);
$customer->service_type = 'VPN';
$customer->pppoe_ip = $ips;
$customer->save();
}
function removeVpnActive($client, $username)
{
global $_app_stage;
if ($_app_stage == 'demo') {
return null;
}
$onlineRequest = new RouterOS\Request('/ppp/active/print');
$onlineRequest->setArgument('.proplist', '.id');
$onlineRequest->setQuery(RouterOS\Query::where('name', $username));
$id = $client->sendSync($onlineRequest)->getProperty('.id');
$removeRequest = new RouterOS\Request('/ppp/active/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
}
function addIpToAddressList($client, $ip, $listName, $comment = '')
{
global $_app_stage;
if ($_app_stage == 'demo') {
return null;
}
$addRequest = new RouterOS\Request('/ip/firewall/address-list/add');
$client->sendSync(
$addRequest
->setArgument('address', $ip)
->setArgument('comment', $comment)
->setArgument('list', $listName)
);
}
function removeIpFromAddressList($client, $ip)
{
global $_app_stage;
if ($_app_stage == 'demo') {
return null;
}
$printRequest = new RouterOS\Request(
'/ip firewall address-list print .proplist=.id',
RouterOS\Query::where('address', $ip)
);
$id = $client->sendSync($printRequest)->getProperty('.id');
$removeRequest = new RouterOS\Request('/ip/firewall/address-list/remove');
$client->sendSync(
$removeRequest
->setArgument('numbers', $id)
);
}
function addNat($client, $plan, $cust, $ips)
{
global $_app_stage;
if ($_app_stage == 'demo') {
return null;
}
$this->checkPort($cust['id'], 'Winbox', $plan['routers']);
$this->checkPort($cust['id'], 'Api', $plan['routers']);
$this->checkPort($cust['id'], 'Web', $plan['routers']);
$tcf = ORM::for_table('tbl_customers_fields')
->where('customer_id', $cust['id'])
->find_many();
foreach ($tcf as $cf) {
$dst = $cf['field_value'];
$cmnt = $cf['field_name'];
if ($cmnt == 'Winbox') {
$tp = '8291'; }
if ($cmnt == 'Web') {
$tp = '80'; }
if ($cmnt == 'Api') {
$tp = '8728'; }
if ($cmnt == 'Winbox' || $cmnt == 'Web' || $cmnt == 'Api') {
$addRequest = new RouterOS\Request('/ip/firewall/nat/add');
$client->sendSync(
$addRequest
->setArgument('chain', 'dstnat')
->setArgument('protocol', 'tcp')
->setArgument('dst-port', $dst)
->setArgument('action', 'dst-nat')
->setArgument('to-addresses', $ips)
->setArgument('to-ports', $tp)
->setArgument('address', $ip)
->setArgument('comment', $cmnt.' || '.$cust['username'])
);
}
}
}
function rmNat($client, $cstid)
{
global $_app_stage;
if ($_app_stage == 'demo') {
return null;
}
$tcf = ORM::for_table('tbl_customers_fields')
->where('customer_id', $cstid)
->find_many();
$cst = ORM::for_table('tbl_customers')->find_one($cstid);
$printRequest = new RouterOS\Request('/ip/firewall/nat/print');
$printRequest->setQuery(RouterOS\Query::where('to-addresses', $cst['pppoe_ip']));
$nats = $client->sendSync($printRequest);
foreach ($nats as $nat) {
$id = $client->sendSync($printRequest)->getProperty('.id');
$removeRequest = new RouterOS\Request('/ip/firewall/nat/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
}
}
function checkPort($id, $portn, $router)
{
$tcf = ORM::for_table('tbl_customers_fields')
->where('customer_id', $id)
->where('field_name', $portn)
->find_one();
$ports = ORM::for_table('tbl_port_pool')
->where('routers', $router)
->find_one();
$port = explode('-',$ports['range_port']);
if (empty($tcf) && !empty($ports)) {
repeat:
$portr = rand($port['0'], $port['1']);
if (ORM::for_table('tbl_customers_fields')->where('field_value', $portr)->find_one()) {
if($portr == $port['1'])
{
return;
}
goto repeat;
}
$cf = ORM::for_table('tbl_customers_fields')->create();
$cf->customer_id = $id;
$cf->field_name = $portn;
$cf->field_value = $portr;
$cf->save();
}
}
function checkIpAddr($pname, $id) {
$c = ORM::for_table('tbl_customers')->find_one($id);
$ipp = ORM::for_table('tbl_pool')
->where('pool_name', $pname)
->find_one();
$ip_r = explode('-',$ipp['range_ip']);
$ip_1 = explode('.',$ip_r['0']);
$ip_2 = explode('.',$ip_r['1']);
repeat:
$ipt = rand($ip_1['3'], $ip_2['3']);
$ips = $ip_1['0'].'.'.$ip_1['1'].'.'.$ip_1['2'].'.'.$ipt;
if (empty($c['pppoe_ip'])) {
if (ORM::for_table('tbl_customers')->where('pppoe_ip' ,$ips)->find_one()) {
if ($ip_2['3'] == $ipt)
{
return;
}
goto repeat;
}
return $ips;
}
}
}

View File

@ -538,7 +538,6 @@
"Zip_Code": "Kode Pos",
"Phone": "Telepon",
"Customer_Geo_Location_Information": "Informasi Lokasi Geo Pelanggan",
"": "",
"Code": "Kode",
"Send_Personal_Message": "Kirim Pesan Pribadi",
"Send_Via": "Kirim melalui",
@ -571,7 +570,8 @@
"Languge_set_to_indonesia": "Language set to indonesia",
"Enable": "Aktifkan",
"Diable": "Nonaktifkan",
"Balance" "Saldo",
"Verification_code": "Kod3 V3r1fik@s1",
"Registration_code": "Kod3 R3g1str@s1",
"TX": "TX",
"RX": "RX",
"Database": "Database"

View File

@ -155,5 +155,11 @@
"2024.8.28" : [
"ALTER TABLE `tbl_routers` ADD `status` ENUM('Online', 'Offline') DEFAULT 'Online' AFTER `coordinates`;",
"ALTER TABLE `tbl_routers` ADD `last_seen` DATETIME AFTER `status`;"
],
"2024.9.13" : [
"ALTER TABLE `tbl_plans` CHANGE `type` `type` ENUM('Hotspot','PPPOE','VPN','Balance') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;",
"ALTER TABLE `tbl_customers` CHANGE `service_type` `service_type` ENUM('Hotspot','PPPoE','VPN','Others') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'Others' COMMENT 'For selecting user type';",
"ALTER TABLE `tbl_transactions` CHANGE `type` `type` ENUM('Hotspot','PPPOE','VPN','Balance') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;",
"CREATE TABLE IF NOT EXISTS `tbl_port_pool` ( `id` int(10) NOT NULL AUTO_INCREMENT , `public_ip` varchar(40) NOT NULL, `port_name` varchar(40) NOT NULL, `range_port` varchar(40) NOT NULL, `routers` varchar(40) NOT NULL, PRIMARY KEY (`id`)) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;"
]
}

View File

@ -89,9 +89,9 @@
<label class="col-md-5 control-label">{Lang::T('Send Notification')}</label>
<div class="col-md-7">
<select name="send_notif" id="send_notif" class="form-control">
<option value="-">Don't Send</option>
<option value="sms">By SMS</option>
<option value="wa">By WhatsApp</option>
<option value="-">{Lang::T("Don't Send")}</option>
<option value="sms">{Lang::T('By SMS')}</option>
<option value="wa">{Lang::T('By WhatsApp')}</option>
</select>
</div>
</div>
@ -116,4 +116,4 @@
</script>
{/literal}
{include file="sections/footer.tpl"}
{include file="sections/footer.tpl"}

View File

@ -56,9 +56,9 @@
<div class="col-md-9">
<select name="status" id="status" class="form-control">
<option value="Active" {if $d['status'] eq 'Active'}selected="selected" {/if}>
Active</option>
{Lang::T('Active')}</option>
<option value="Inactive" {if $d['status'] eq 'Inactive'}selected="selected" {/if}>
Inactive</option>
{Lang::T('Inactive')}</option>
</select>
</div>
</div>
@ -141,4 +141,4 @@
}
</script>
{/literal}
{include file="sections/footer.tpl"}
{include file="sections/footer.tpl"}

View File

@ -105,7 +105,7 @@
</div>
<hr>
<div class="form-group">
<label class="col-md-2 control-label">Radius Plan</label>
<label class="col-md-2 control-label">{Lang::T('Radius Package')}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="radius_plan" name="radius_plan"
value="{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}">
@ -113,7 +113,7 @@
<span class="help-block col-md-4">{Lang::T('Change title in user Plan order')}</span>
</div>
<div class="form-group">
<label class="col-md-2 control-label">Hotspot Plan</label>
<label class="col-md-2 control-label">{Lang::T('Hotspot Package')}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="hotspot_plan" name="hotspot_plan"
value="{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}">
@ -121,13 +121,21 @@
<span class="help-block col-md-4">{Lang::T('Change title in user Plan order')}</span>
</div>
<div class="form-group">
<label class="col-md-2 control-label">PPPOE Plan</label>
<label class="col-md-2 control-label">{Lang::T('PPPOE Package')}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="pppoe_plan" name="pppoe_plan"
value="{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}">
</div>
<span class="help-block col-md-4">{Lang::T('Change title in user Plan order')}</span>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('VPN Package')}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="vpn_plan" name="vpn_plan"
value="{if $_c['vpn_plan']==''}VPN Plan{else}{$_c['vpn_plan']}{/if}">
</div>
<span class="help-block col-md-4">{Lang::T('Change title in user Plan order')}</span>
</div>
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<button class="btn btn-primary"
@ -141,4 +149,4 @@
</div>
</div>
{include file="sections/footer.tpl"}
{include file="sections/footer.tpl"}

View File

@ -196,7 +196,7 @@
</p>
</div>
<div class="form-group">
<label class="col-md-2 control-label">Redirect after Activation</label>
<label class="col-md-2 control-label">{Lang::T('Redirect URL after Activation')}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="voucher_redirect" name="voucher_redirect"
placeholder="https://192.168.88.1/status" value="{$_c['voucher_redirect']}">
@ -216,7 +216,7 @@
</div>
<div class="panel-body">
<div class="form-group">
<label class="col-md-2 control-label">Enable Radius</label>
<label class="col-md-2 control-label">{Lang::T('Enable Radius')}</label>
<div class="col-md-6">
<select name="radius_enable" id="radius_enable" class="form-control text-muted">
<option value="0">{Lang::T('No')}</option>
@ -266,7 +266,7 @@
<button class="btn btn-primary btn-xs" title="save" type="submit"><span
class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span></button>
</div>
{Lang::T('Balance System')}
{Lang::T('Customer Balance System')}
</div>
<div class="panel-body">
<div class="form-group">
@ -410,14 +410,14 @@
<p class="help-block col-md-4">{Lang::T('Empty this to use internal mail() PHP')}</p>
</div>
<div class="form-group">
<label class="col-md-2 control-label">SMTP Username</label>
<label class="col-md-2 control-label">{Lang::T('SMTP Username')}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="smtp_user" name="smtp_user"
value="{$_c['smtp_user']}" placeholder="user@host.tld">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">SMTP Password</label>
<label class="col-md-2 control-label">{Lang::T('SMTP Password')}</label>
<div class="col-md-6">
<input type="password" class="form-control" id="smtp_pass" name="smtp_pass"
value="{$_c['smtp_pass']}" onmouseleave="this.type = 'password'"
@ -469,13 +469,13 @@
<div class="col-md-6">
<select name="user_notification_expired" id="user_notification_expired"
class="form-control">
<option value="none">None</option>
<option value="none">{Lang::T('None')}</option>
<option value="wa" {if $_c['user_notification_expired']=='wa' }selected="selected"
{/if}>Whatsapp</option>
{/if}>{Lang::T('By WhatsApp')}</option>
<option value="sms" {if $_c['user_notification_expired']=='sms' }selected="selected"
{/if}>SMS</option>
{/if}>{Lang::T('By SMS')}</option>
<option value="email" {if $_c['user_notification_expired']=='email' }selected="selected"
{/if}>Email</option>
{/if}>{Lang::T('By Email')}</option>
</select>
</div>
<p class="help-block col-md-4">{Lang::T('User will get notification when package expired')}</p>
@ -485,13 +485,13 @@
<div class="col-md-6">
<select name="user_notification_payment" id="user_notification_payment"
class="form-control">
<option value="none">None</option>
<option value="none">{Lang::T('None')}</option>
<option value="wa" {if $_c['user_notification_payment']=='wa' }selected="selected"
{/if}>Whatsapp</option>
{/if}>{Lang::T('By WhatsApp')}</option>
<option value="sms" {if $_c['user_notification_payment']=='sms' }selected="selected"
{/if}>SMS</option>
{/if}>{Lang::T('By SMS')}</option>
<option value="email" {if $_c['user_notification_payment']=='email' }selected="selected"
{/if}>Email</option>
{/if}>{Lang::T('By Email')}</option>
</select>
</div>
<p class="help-block col-md-4">
@ -502,13 +502,13 @@
<div class="col-md-6">
<select name="user_notification_reminder" id="user_notification_reminder"
class="form-control">
<option value="none">None</option>
<option value="none">{Lang::T('None')}</option>
<option value="wa" {if $_c['user_notification_reminder']=='wa' }selected="selected"
{/if}>Whatsapp</option>
{/if}>{Lang::T('By WhatsApp')}</option>
<option value="sms" {if $_c['user_notification_reminder']=='sms' }selected="selected"
{/if}>SMS</option>
{/if}>{Lang::T('By SMS')}</option>
<option value="sms" {if $_c['user_notification_reminder']=='email' }selected="selected"
{/if}>Email</option>
{/if}>{Lang::T('By Email')}</option>
</select>
</div>
</div>
@ -546,7 +546,7 @@
<label class="col-md-2 control-label">{Lang::T('Access Token')}</label>
<div class="col-md-6">
<input type="password" class="form-control" id="api_key" name="api_key"
value="{$_c['api_key']}" placeholder="Empty this to randomly created API key"
value="{$_c['api_key']}" placeholder="{Lang::T('Empty this to randomly created API key')}"
onmouseleave="this.type = 'password'" onmouseenter="this.type = 'text'">
</div>
<p class="col-md-4 help-block">{Lang::T('This Token will act as SuperAdmin/Admin')}</p>
@ -655,11 +655,11 @@
<div class="col-md-6">
<select name="phone_otp_type" id="phone_otp_type" class="form-control">
<option value="sms" {if $_c['phone_otp_type']=='sms' }selected="selected" {/if}>
{Lang::T('SMS')}
{Lang::T('By SMS')}
<option value="whatsapp" {if $_c['phone_otp_type']=='whatsapp' }selected="selected"
{/if}> {Lang::T('WhatsApp')}
{/if}> {Lang::T('by WhatsApp')}
<option value="both" {if $_c['phone_otp_type']=='both' }selected="selected" {/if}>
{Lang::T('SMS and WhatsApp')}
{Lang::T('By WhatsApp and SMS')}
</option>
</select>
</div>
@ -759,18 +759,18 @@
</option>
<!-- Custom tax rate option -->
<option value="custom" {if $_c['tax_rate']=='custom' }selected="selected" {/if}>
{Lang::T('Custom')}</option>
{Lang::T('Custome')}</option>
</select>
</div>
<p class="help-block col-md-4">{Lang::T('Tax Rates in percentage')}</p>
</div>
<!-- Custom tax rate input field (initially hidden) -->
<div class="form-group" id="customTaxRate" style="display: none;">
<label class="col-md-2 control-label">{Lang::T('Custom Tax Rate')}</label>
<label class="col-md-2 control-label">{Lang::T('Custome Tax Rate')}</label>
<div class="col-md-6">
<input type="text" value="{$_c['custom_tax_rate']}" class="form-control"
name="custom_tax_rate" id="custom_tax_rate"
placeholder="{Lang::T('Enter Custom Tax Rate')}">
placeholder="{Lang::T('Enter Custome Tax Rate')}">
</div>
<p class="help-block col-md-4">{Lang::T('Enter the custom tax rate (e.g., 3.75 for 3.75%)')}</p>
</div>

View File

@ -3,7 +3,7 @@
<div class="row">
<div class="col-sm-12 col-md-12">
<div class="panel panel-primary panel-hovered panel-stacked mb30">
<div class="panel-heading">{Lang::T('Edit Service Plan')}</div>
<div class="panel-heading">{Lang::T('Edit Service Package')}</div>
<div class="panel-body">
<form class="form-horizontal" method="post" role="form" action="{$_url}services/balance-edit-post">
<input type="hidden" name="id" value="{$d['id']}">
@ -19,13 +19,13 @@
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Plan Name')}</label>
<label class="col-md-2 control-label">{Lang::T('Package Name')}</label>
<div class="col-md-6">
<input type="text" required class="form-control" id="name" value="{$d['name_plan']}" name="name" maxlength="40" placeholder="Topup 100">
<input type="text" required class="form-control" id="name" value="{$d['name_plan']}" name="name" maxlength="40" placeholder="{Lang::T('Topup')} 100">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Plan Price')}</label>
<label class="col-md-2 control-label">{Lang::T('Package Price')}</label>
<div class="col-md-6">
<div class="input-group">
<span class="input-group-addon">{$_c['currency_code']}</span>

View File

@ -3,7 +3,7 @@
<div class="row">
<div class="col-sm-12">
<div class="panel panel-hovered mb20 panel-primary">
<div class="panel-heading">{Lang::T('Balance Plans')}</div>
<div class="panel-heading">{Lang::T('Balance Package')}</div>
<div class="panel-body">
<div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
<div class="col-md-8">
@ -20,15 +20,15 @@
</form>
</div>
<div class="col-md-4">
<a href="{$_url}services/balance-add" class="btn btn-primary btn-block"><i class="ion ion-android-add"> </i> {Lang::T('New Service Plan')}</a>
<a href="{$_url}services/balance-add" class="btn btn-primary btn-block"><i class="ion ion-android-add"> </i> {Lang::T('New Service Package')}</a>
</div>&nbsp;
</div>
<div class="table-responsive">
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{Lang::T('Plan Name')}</th>
<th>{Lang::T('Plan Price')}</th>
<th>{Lang::T('Package Name')}</th>
<th>{Lang::T('Package Price')}</th>
<th>{Lang::T('Manage')}</th>
</tr>
</thead>

View File

@ -70,7 +70,7 @@
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<button class="btn btn-primary"
type="submit">{Lang::T('Submit')}</button>
type="submit">{Lang::T('Save')}</button>
Or <a href="{$_url}bandwidth/list">{Lang::T('Cancel')}</a>
</div>
</div>
@ -81,4 +81,4 @@
</div>
</div>
{include file="sections/footer.tpl"}
{include file="sections/footer.tpl"}

View File

@ -81,7 +81,7 @@
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<button class="btn btn-primary"
type="submit">{Lang::T('Submit')}</button>
type="submit">{Lang::T('Save Change')}</button>
Or <a href="{$_url}bandwidth/list">{Lang::T('Cancel')}</a>
</div>
</div>
@ -92,4 +92,4 @@
</div>
</div>
{include file="sections/footer.tpl"}
{include file="sections/footer.tpl"}

View File

@ -57,8 +57,8 @@
</div>
{include file="pagination.tpl"}
<div class="bs-callout bs-callout-info" id="callout-navbar-role">
<h4>{Lang::T('Create Bandwidth Plan for expired Internet Plan')}</h4>
<p>{Lang::T('When customer expired, you can move it to Expired Internet Plan')}</p>
<h4>{Lang::T('Create Bandwidth Package for expired Internet Package')}</h4>
<p>{Lang::T('When customer expired, you can move it to Expired Internet Package')}</p>
</div>
</div>
</div>

View File

@ -70,6 +70,7 @@
<option value="Hotspot">Hotspot
</option>
<option value="PPPoE">PPPoE</option>
<option value="VPN">VPN</option>
<option value="Others">{Lang::T('Others')}</option>
</select>
</div>

View File

@ -75,6 +75,7 @@
<option value="Hotspot" {if $d['service_type'] eq 'Hotspot' }selected{/if}>Hotspot
</option>
<option value="PPPoE" {if $d['service_type'] eq 'PPPoE' }selected{/if}>PPPoE</option>
<option value="VPN" {if $d['service_type'] eq 'VPN' }selected{/if}>VPN</option>
<option value="Others" {if $d['service_type'] eq 'Others' }selected{/if}>Others</option>
</select>
</div>

View File

@ -29,7 +29,7 @@
<div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
<div class="col-lg-4">
<div class="input-group">
<span class="input-group-addon">Order &nbsp;&nbsp;</span>
<span class="input-group-addon">Order&nbsp;&nbsp;</span>
<div class="row row-no-gutters">
<div class="col-xs-8">
<select class="form-control" id="order" name="order">

View File

@ -54,7 +54,7 @@
<li>{Lang::dateFormat($start_date)}</li>
<li>{Lang::dateFormat($current_date)}</li>
{if $_c['enable_balance'] == 'yes' && in_array($_admin['user_type'],['SuperAdmin','Admin', 'Report'])}
<li>
<li onclick="window.location.href = '{$_url}customers&search=&order=balance&filter=Active&orderby=desc'" style="cursor: pointer;">
{Lang::T('Customer Balance')} <sup>{$_c['currency_code']}</sup>
<b>{number_format($cb,0,$_c['dec_point'],$_c['thousands_sep'])}</b>
</li>
@ -112,7 +112,7 @@
<table class="table table-condensed">
<thead>
<tr>
<th>{Lang::T('Plan Name')}</th>
<th>{Lang::T('Package Name')}</th>
<th>unused</th>
<th>used</th>
</tr>
@ -145,7 +145,7 @@
<tr>
<th>{Lang::T('Username')}</th>
<th>{Lang::T('Created / Expired')}</th>
<th>{Lang::T('Internet Plan')}</th>
<th>{Lang::T('Internet Package')}</th>
<th>{Lang::T('Location')}</th>
</tr>
</thead>
@ -175,7 +175,7 @@
<div class="col-md-5">
{if $_c['router_check']}
{if $_c['router_check'] && count($routeroffs)> 0}
<div class="panel panel-danger">
<div class="panel-heading text-bold">{Lang::T('Routers Offline')}</div>
<div class="table-responsive">
@ -194,6 +194,25 @@
</div>
</div>
{/if}
{if $run_date}
{assign var="current_time" value=$smarty.now}
{assign var="run_time" value=strtotime($run_date)}
{if $current_time - $run_time > 3600}
<div class="panel panel-warning panel-hovered mb20 activities">
<div class="panel-heading"><i class="fa fa-clock-o"></i> &nbsp; {Lang::T('Cron has not run for over 1 hour. Please
check your setup.')}</div>
</div>
{else}
<div class="panel panel-success panel-hovered mb20 activities">
<div class="panel-heading">{Lang::T('Cron Job last ran on')}: {$run_date}</div>
</div>
{/if}
{else}
<div class="panel panel-danger panel-hovered mb20 activities">
<div class="panel-heading"><i class="fa fa-warning"></i> &nbsp; {Lang::T('Cron appear not been setup, please check
your cron setup.')}</div>
</div>
{/if}
{if $_c['hide_pg'] != 'yes'}
<div class="panel panel-success panel-hovered mb20 activities">
<div class="panel-heading">{Lang::T('Payment Gateway')}: {str_replace(',',', ',$_c['payment_gateway'])}
@ -437,4 +456,4 @@
</script>
{/if}
{include file="sections/footer.tpl"}
{include file="sections/footer.tpl"}

View File

@ -11,7 +11,7 @@
<tr>
<th width="50%">{Lang::T('Table Name')}</th>
<th>{Lang::T('Rows')}</th>
<th>Select</th>
<th>{Lang::T('Choose')}</th>
</tr>
</thead>
<tbody>
@ -31,7 +31,7 @@
<div class="col-md-4 text-right">
<button type="submit" class="btn btn-primary btn-xs btn-block"><i
class="fa fa-download"></i>
{Lang::T('Download Database Backup')}</button>
{Lang::T('Download Backup')} Database</button>
</div>
</div>
</div>
@ -41,14 +41,14 @@
</div>
<div class="col-sm-5">
<div class="panel panel-primary">
<div class="panel-heading">{Lang::T('Restore Database')}</div>
<div class="panel-heading">{Lang::T('Restore')} Database</div>
<form method="post" action="{$_url}settings/dbrestore" enctype="multipart/form-data">
<div class="panel-body">
<div class="row">
<div class="col-md-7"><input type="file" name="json" accept="application/json"></div>
<div class="col-md-5 text-right">
<button type="submit" class="btn btn-primary btn-block btn-xs"><i class="fa fa-upload"></i>
{Lang::T('Restore Database')}</button>
{Lang::T('Restore')} Database</button>
</div>
</div>
</div>

View File

@ -16,7 +16,7 @@
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label"><a href="{$_url}services/balance">{Lang::T('Balance Plans')}</a></label>
<label class="col-md-2 control-label"><a href="{$_url}services/balance">{Lang::T('Balance Package')}</a></label>
<div class="col-md-6">
<select id="planSelect" class="form-control select2" name="id_plan" style="width: 100%"
data-placeholder="{Lang::T('Select Plans')}...">
@ -41,4 +41,4 @@
</div>
</div>
{include file="sections/footer.tpl"}
{include file="sections/footer.tpl"}

View File

@ -35,8 +35,8 @@
<select class="form-control" id="type2" name="type2">
<option value="">{Lang::T('Type')}</option>
{foreach $type2s as $t}
<option value="{$t}" {if $type2 eq $t }selected{/if}>{Lang::T($t)}
</option>
<option value="{$t}" {if $type2 eq $t }selected{/if}>{Lang::T($t)}
</option>
{/foreach}
</select>
</div>
@ -44,9 +44,9 @@
<select class="form-control" id="bandwidth" name="bandwidth">
<option value="">Bandwidth</option>
{foreach $bws as $b}
<option value="{$b['id']}" {if $bandwidth eq $b['id'] }selected{/if}>
{$b['name_bw']}
</option>
<option value="{$b['id']}" {if $bandwidth eq $b['id'] }selected{/if}>
{$b['name_bw']}
</option>
{/foreach}
</select>
</div>
@ -54,8 +54,8 @@
<select class="form-control" id="type3" name="type3">
<option value="">{Lang::T('Category')}</option>
{foreach $type3s as $t}
<option value="{$t}" {if $type3 eq $t }selected{/if}>{$t}
</option>
<option value="{$t}" {if $type3 eq $t }selected{/if}>{$t}
</option>
{/foreach}
</select>
</div>
@ -63,8 +63,8 @@
<select class="form-control" id="valid" name="valid">
<option value="">{Lang::T('Validity')}</option>
{foreach $valids as $v}
<option value="{$v}" {if $valid eq $v }selected{/if}>{$v}
</option>
<option value="{$v}" {if $valid eq $v }selected{/if}>{$v}
</option>
{/foreach}
</select>
</div>
@ -72,7 +72,7 @@
<select class="form-control" id="router" name="router">
<option value="">{Lang::T('Location')}</option>
{foreach $routers as $r}
<option value="{$r}" {if $router eq $r }selected{/if}>{$r}</option>
<option value="{$r}" {if $router eq $r }selected{/if}>{$r}</option>
{/foreach}
<option value="radius" {if $router eq 'radius' }selected{/if}>Radius</option>
</select>
@ -81,7 +81,7 @@
<select class="form-control" id="device" name="device">
<option value="">{Lang::T('Device')}</option>
{foreach $devices as $r}
<option value="{$r}" {if $device eq $r }selected{/if}>{$r}</option>
<option value="{$r}" {if $device eq $r }selected{/if}>{$r}</option>
{/foreach}
</select>
</div>
@ -104,38 +104,40 @@
</div>
</form>
<div class="table-responsive">
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th></th>
<th colspan="5" class="text-center">{Lang::T('Internet Package')}</th>
<th colspan="2" class="text-center" style="background-color: rgb(246, 244, 244);">{Lang::T('Limit')}</th>
<th colspan="2"></th>
<th colspan="2" class="text-center" style="background-color: rgb(243, 241, 172);">
{Lang::T('Expired')}</th>
<th colspan="3"></th>
</tr>
<tr>
<th>{Lang::T('Name')}</th>
<th>{Lang::T('Type')}</th>
<th><a href="{$_url}bandwidth/list">Bandwidth</a></th>
<th>{Lang::T('Category')}</th>
<th>{Lang::T('Price')}</th>
<th>{Lang::T('Validity')}</th>
<th style="background-color: rgb(246, 244, 244);">{Lang::T('Time')}</th>
<th style="background-color: rgb(246, 244, 244);">{Lang::T('Data')}</th>
<th><a href="{$_url}routers/list">{Lang::T('Location')}</a></th>
<th>{Lang::T('Device')}</th>
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Internet Package')}</th>
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Date')}</th>
<th>{Lang::T('ID')}</th>
<th>{Lang::T('Manage')}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th></th>
<th colspan="5" class="text-center">{Lang::T('Internet Package')}</th>
<th colspan="2" class="text-center" style="background-color: rgb(246, 244, 244);">
{Lang::T('Limit')}</th>
<th colspan="2"></th>
<th colspan="2" class="text-center" style="background-color: rgb(243, 241, 172);">
{Lang::T('Expired')}</th>
<th colspan="3"></th>
</tr>
<tr>
<th>{Lang::T('Name')}</th>
<th>{Lang::T('Type')}</th>
<th><a href="{$_url}bandwidth/list">Bandwidth</a></th>
<th>{Lang::T('Category')}</th>
<th>{Lang::T('Price')}</th>
<th>{Lang::T('Validity')}</th>
<th style="background-color: rgb(246, 244, 244);">{Lang::T('Time')}</th>
<th style="background-color: rgb(246, 244, 244);">{Lang::T('Data')}</th>
<th><a href="{$_url}routers/list">{Lang::T('Location')}</a></th>
<th>{Lang::T('Device')}</th>
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Internet Package')}</th>
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Date')}</th>
<th>{Lang::T('ID')}</th>
<th>{Lang::T('Manage')}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr {if $ds['enabled'] !=1}class="danger" title="disabled" {elseif $ds['prepaid'] !='yes'
}class="warning" title="Postpaid" {/if}>
}class="warning" title="Postpaid" {/if}>
<td class="headcol">{$ds['name_plan']}</td>
<td>{if $ds['prepaid'] == no}<b>Postpaid</b>{else}Prepaid{/if} {$ds['plan_type']}</td>
<td>{$ds['name_bw']}</td>
@ -146,11 +148,11 @@
<td>{$ds['data_limit']} {$ds['data_unit']}</td>
<td>
{if $ds['is_radius']}
<span class="label label-primary">RADIUS</span>
<span class="label label-primary">RADIUS</span>
{else}
{if $ds['routers']!=''}
<a href="{$_url}routers/edit/0&name={$ds['routers']}">{$ds['routers']}</a>
{/if}
{if $ds['routers']!=''}
<a href="{$_url}routers/edit/0&name={$ds['routers']}">{$ds['routers']}</a>
{/if}
{/if}
</td>
<td>{$ds['device']}</td>
@ -163,13 +165,14 @@
<a href="{$_url}services/edit/{$ds['id']}"
class="btn btn-info btn-xs">{Lang::T('Edit')}</a>
<a href="{$_url}services/delete/{$ds['id']}" id="{$ds['id']}"
onclick="return confirm('{Lang::T('Delete')}?')" class="btn btn-danger btn-xs"><i
class="glyphicon glyphicon-trash"></i></a>
onclick="return confirm('{Lang::T('Delete')}?')"
class="btn btn-danger btn-xs"><i class="glyphicon glyphicon-trash"></i></a>
</td>
</tr>
{/foreach}
</tbody>
</table>
{/foreach}
</tbody>
</table>
</div>
</div>
<div class="panel-footer">
{include file="pagination.tpl"}
@ -182,4 +185,4 @@
</div>
</div>
{include file="sections/footer.tpl"}
{include file="sections/footer.tpl"}

View File

@ -32,8 +32,8 @@
{Lang::pads(Lang::T('Sales'), $_admin['fullname'], ' ')}
{Lang::pad("", '=')}
{Lang::pads(Lang::T('Type'), $in['type'], ' ')}
{Lang::pads(Lang::T('Plan Name'), $in['plan_name'], ' ')}
{Lang::pads(Lang::T('Plan Price'), Lang::moneyFormat($in['price']), ' ')}
{Lang::pads(Lang::T('Package Name'), $in['plan_name'], ' ')}
{Lang::pads(Lang::T('Package Price'), Lang::moneyFormat($in['price']), ' ')}
{Lang::pad($in['method'], ' ', 2)}
{Lang::pads(Lang::T('Username'), $in['username'], ' ')}
@ -69,4 +69,4 @@
</body>
</html>
</html>

View File

@ -17,7 +17,7 @@
<a href="{$_url}plan/view/{$in['id']}/send" class="btn btn-info text-black btn-sm"><i
class="glyphicon glyphicon-envelope"></i> {Lang::T("Resend")}</a>
<button type="submit" class="btn btn-info text-black btn-sm"><i class="glyphicon glyphicon-print"></i>
Print</button>
{Lang::T('Print')}</button>
<a href="nux://print?text={urlencode($invoice)}"
class="btn btn-success text-black btn-sm hidden-md hidden-lg">
<i class="glyphicon glyphicon-phone"></i>
@ -37,4 +37,4 @@
var s5_taf_parent = window.location;
document.getElementById('content').innerHTML = document.getElementById('formcontent').innerHTML;
</script>
{include file="sections/footer.tpl"}
{include file="sections/footer.tpl"}

View File

@ -23,9 +23,9 @@
<label class="col-md-2 control-label">{Lang::T('Send Via')}</label>
<div class="col-md-6">
<select class="form-control" name="via" id="via">
<option value="sms" selected> {Lang::T('SMS')}</option>
<option value="wa"> {Lang::T('WhatsApp')}</option>
<option value="both"> {Lang::T('SMS and WhatsApp')}</option>
<option value="sms" selected> {Lang::T('via SMS')}</option>
<option value="wa"> {Lang::T('Via WhatsApp')}</option>
<option value="both"> {Lang::T('Via WhatsApp and SMS')}</option>
</select>
</div>
</div>
@ -61,4 +61,4 @@
</div>
{include file="sections/footer.tpl"}
{include file="sections/footer.tpl"}

View File

@ -27,7 +27,7 @@
</div>
<br>
{/if}
<button type="submit" class="btn btn-primary btn-block">SAVE</button>
<button type="submit" class="btn btn-primary btn-block">{Lang::T('Save')}</button>
<br>
<p class="help-block">{Lang::T('Sometimes you need to refresh 3 times until content change')}</p>
<input type="text" class="form-control" onclick="this.select()" readonly
@ -42,9 +42,9 @@
<div class="panel-footer">
<p class="help-block">
<b>[[company_name]]</b> {Lang::T('Your Company Name at Settings')}.<br>
<b>[[price]]</b> {Lang::T('Plan Price')}.<br>
<b>[[price]]</b> {Lang::T('Package Price')}.<br>
<b>[[voucher_code]]</b> {Lang::T('Voucher Code')}.<br>
<b>[[plan]]</b> {Lang::T('Voucher Plan')}.<br>
<b>[[plan]]</b> {Lang::T('Voucher Package')}.<br>
<b>[[counter]]</b> {Lang::T('Counter')}.<br>
</p>
</div>

View File

@ -5,19 +5,19 @@
<div class="panel panel-hovered mb20 panel-primary">
<div class="panel-heading">
{if in_array($_admin['user_type'],['SuperAdmin','Admin'])}
<div class="btn-group pull-right">
<a class="btn btn-primary btn-xs" title="save" href="{$_url}plan/sync"
onclick="return confirm('This will sync/send Caustomer active plan to Mikrotik?')"><span
class="glyphicon glyphicon-refresh" aria-hidden="true"></span> sync</a>
</div>
{* <div class="btn-group pull-right">
<a class="btn btn-info btn-xs" title="save" href="{$_url}plan/csv{$append_url}"
onclick="return confirm('This will export to CSV?')"><span class="glyphicon glyphicon-download"
aria-hidden="true"></span> CSV</a>
</div> *}
<div class="btn-group pull-right">
<a class="btn btn-primary btn-xs" title="save" href="{$_url}plan/sync"
onclick="return confirm('This will sync/send Caustomer active plan to Mikrotik?')"><span
class="glyphicon glyphicon-refresh" aria-hidden="true"></span> sync</a>
</div>
{* <div class="btn-group pull-right">
<a class="btn btn-info btn-xs" title="save" href="{$_url}plan/csv{$append_url}"
onclick="return confirm('This will export to CSV?')"><span class="glyphicon glyphicon-download"
aria-hidden="true"></span> CSV</a>
</div> *}
{/if}
&nbsp;
{Lang::T('Active Customers')}
{Lang::T('Active Customers')}
</div>
<form id="site-search" method="post" action="{$_url}plan/list/">
<div class="panel-body">
@ -36,8 +36,8 @@
<select class="form-control" id="router" name="router">
<option value="">{Lang::T('Location')}</option>
{foreach $routers as $r}
<option value="{$r}" {if $router eq $r }selected{/if}>{$r}
</option>
<option value="{$r}" {if $router eq $r }selected{/if}>{$r}
</option>
{/foreach}
</select>
</div>
@ -45,8 +45,8 @@
<select class="form-control" id="plan" name="plan">
<option value="">{Lang::T('Plan Name')}</option>
{foreach $plans as $p}
<option value="{$p['id']}" {if $plan eq $p['id'] }selected{/if}>{$p['name_plan']}
</option>
<option value="{$p['id']}" {if $plan eq $p['id'] }selected{/if}>{$p['name_plan']}
</option>
{/foreach}
</select>
</div>
@ -70,34 +70,39 @@
</div>
</form>
<div class="table-responsive">
<table id="datatable" class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{Lang::T('Username')}</th>
<th>{Lang::T('Plan Name')}</th>
<th>{Lang::T('Type')}</th>
<th>{Lang::T('Created On')}</th>
<th>{Lang::T('Expires On')}</th>
<th>{Lang::T('Method')}</th>
<th><a href="{$_url}routers/list">{Lang::T('Location')}</a></th>
<th>{Lang::T('Manage')}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr {if $ds['status']=='off'}class="danger" {/if}>
<div style="margin-left: 5px; margin-right: 5px;">&nbsp;
<table id="datatable" class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{Lang::T('Username')}</th>
<th>{Lang::T('Plan Name')}</th>
<th>{Lang::T('Type')}</th>
<th>{Lang::T('Created On')}</th>
<th>{Lang::T('Expires On')}</th>
<th>{Lang::T('Method')}</th>
<th><a href="{$_url}routers/list">{Lang::T('Location')}</a></th>
<th>{Lang::T('Manage')}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr {if $ds['status']=='off' }class="danger" {/if}>
<td>
{if $ds['customer_id'] == '0'}
<a href="{$_url}plan/voucher/&search={$ds['username']}">{$ds['username']}</a>
<a href="{$_url}plan/voucher/&search={$ds['username']}">{$ds['username']}</a>
{else}
<a href="{$_url}customers/viewu/{$ds['username']}">{$ds['username']}</a>
<a href="{$_url}customers/viewu/{$ds['username']}">{$ds['username']}</a>
{/if}
</td>
{if $ds['type'] == 'Hotspot'}
<td><a href="{$_url}services/edit/{$ds['plan_id']}">{$ds['namebp']}</a></td>
{else}
{/if}
{if $ds['type'] == 'PPPOE'}
<td><a href="{$_url}services/pppoe-edit/{$ds['plan_id']}">{$ds['namebp']}</a></td>
{/if}
{if $ds['type'] == 'VPN'}
<td><a href="{$_url}services/vpn-edit/{$ds['plan_id']}">{$ds['namebp']}</a></td>
{/if}
<td>{$ds['type']}</td>
<td>{Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}</td>
<td>{Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}</td>
@ -107,19 +112,20 @@
<a href="{$_url}plan/edit/{$ds['id']}" class="btn btn-warning btn-xs"
style="color: black;">{Lang::T('Edit')}</a>
{if in_array($_admin['user_type'],['SuperAdmin','Admin'])}
<a href="{$_url}plan/delete/{$ds['id']}" id="{$ds['id']}"
onclick="return confirm('{Lang::T('Delete')}?')" class="btn btn-danger btn-xs"><i
class="glyphicon glyphicon-trash"></i></a>
<a href="{$_url}plan/delete/{$ds['id']}" id="{$ds['id']}"
onclick="return confirm('{Lang::T('Delete')}?')"
class="btn btn-danger btn-xs"><i class="glyphicon glyphicon-trash"></i></a>
{/if}
{if $ds['status']=='off' && $_c['extend_expired']}
<a href="javascript:extend('{$ds['id']}')"
class="btn btn-info btn-xs">{Lang::T('Extend')}</a>
<a href="javascript:extend('{$ds['id']}')"
class="btn btn-info btn-xs">{Lang::T('Extend')}</a>
{/if}
</td>
</tr>
{/foreach}
</tbody>
</table>
{/foreach}
</tbody>
</table>
</div>
</div>
{include file="pagination.tpl"}
</div>
@ -131,10 +137,10 @@
var res = prompt("Extend for many days?", "3");
if (res) {
if (confirm("Extend for " + res + " days?")) {
window.location.href = "{$_url}plan/extend/"+idP+"/"+res+"&stoken={App::getToken()}";
window.location.href = "{$_url}plan/extend/" + idP + "/" + res + "&stoken={App::getToken()}";
}
}
}
</script>
{include file="sections/footer.tpl"}
{include file="sections/footer.tpl"}

51
ui/ui/port-add.tpl Normal file
View File

@ -0,0 +1,51 @@
{include file="sections/header.tpl"}
<div class="row">
<div class="col-sm-12 col-md-12">
<div class="panel panel-primary panel-hovered panel-stacked mb30">
<div class="panel-heading">{Lang::T('Add Port Pool')}</div>
<div class="panel-body">
<form class="form-horizontal" method="post" role="form" action="{$_url}pool/add-port-post" >
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Port Name')}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="name" name="name" placeholder="Vpn Tunnel">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Public IP')}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="public_ip" name="public_ip" placeholder="12.34.56.78">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Range Port')}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="port_range" name="port_range" placeholder=" 3000-8000">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label"><a href="{$_url}routers/add">{Lang::T('Routers')}</a></label>
<div class="col-md-6">
<select id="routers" name="routers" class="form-control select2">
{foreach $r as $rs}
<option value="{$rs['name']}">{$rs['name']}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<button class="btn btn-primary" type="submit">{Lang::T('Save Changes')}</button>
Or <a href="{$_url}pool/port">{Lang::T('Cancel')}</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

49
ui/ui/port-edit.tpl Normal file
View File

@ -0,0 +1,49 @@
{include file="sections/header.tpl"}
<div class="row">
<div class="col-sm-12 col-md-12">
<div class="panel panel-primary panel-hovered panel-stacked mb30">
<div class="panel-heading">{Lang::T('Edit Port')}</div>
<div class="panel-body">
<form class="form-horizontal" method="post" role="form" action="{$_url}pool/edit-port-post" >
<input type="hidden" name="id" value="{$d['id']}">
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Port Name')}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="name" name="name" value="{$d['port_name']}">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Public IP')}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="public_ip" name="public_ip" value="{$d['public_ip']}" placeholder="12.34.56.78">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Range Port')}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="range_port" name="range_port" value="{$d['range_port']}">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Routers')}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="routers" name="routers" value="{$d['routers']}" readonly>
</div>
</div>
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<button class="btn btn-success" type="submit">{Lang::T('Save Changes')}</button>
Or <a href="{$_url}pool/port">{Lang::T('Cancel')}</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

76
ui/ui/port.tpl Normal file
View File

@ -0,0 +1,76 @@
{include file="sections/header.tpl"}
<!-- port -->
<div class="row">
<div class="col-sm-12">
<div class="panel panel-hovered mb20 panel-primary">
<div class="panel-heading">
<div class="btn-group pull-right">
<a class="btn btn-primary btn-xs" title="save" href="{$_url}pool/sync"
onclick="return confirm('This will sync/send IP port to Mikrotik?')"><span
class="glyphicon glyphicon-refresh" aria-hidden="true"></span> sync</a>
</div>
{Lang::T('Port Pool')} - VPN Tunnels
</div>
<div class="panel-body">
<div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
<div class="col-md-8">
<form id="site-search" method="post" action="{$_url}pool/port/">
<div class="input-group">
<div class="input-group-addon">
<span class="fa fa-search"></span>
</div>
<input type="text" name="name" class="form-control"
placeholder="{Lang::T('Search by Name')}...">
<div class="input-group-btn">
<button class="btn btn-success" type="submit">{Lang::T('Search')}</button>
</div>
</div>
</form>
</div>
<div class="col-md-4">
<a href="{$_url}pool/add-port" class="btn btn-primary btn-block"><i
class="ion ion-android-add"> </i> {Lang::T('New port')}</a>
</div>&nbsp;
</div>
<div class="table-responsive">
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>{Lang::T('Port Name')}</th>
<th>{Lang::T('Public IP')}</th>
<th>{Lang::T('Range Port')}</th>
<th>{Lang::T('Routers')}</th>
<th>{Lang::T('Manage')}</th>
<th>ID</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['port_name']}</td>
<td>{$ds['public_ip']}</td>
<td>{$ds['range_port']}</td>
<td>{$ds['routers']}</td>
<td align="center">
<a href="{$_url}pool/edit-port/{$ds['id']}" class="btn btn-info btn-xs">{Lang::T('Edit')}</a>
<a href="{$_url}pool/delete-port/{$ds['id']}" id="{$ds['id']}"
onclick="return confirm('{Lang::T('Delete')}?')"
class="btn btn-danger btn-xs"><i class="glyphicon glyphicon-trash"></i></a>
</td>
<td>{$ds['id']}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{include file="pagination.tpl"}
<div class="bs-callout bs-callout-info" id="callout-navbar-role">
<h4>{Lang::T('Create expired Internet Plan')}</h4>
<p>{Lang::T('When customer expired, you can move it to Expired Internet Plan')}</p>
</div>
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

View File

@ -35,8 +35,8 @@
<select class="form-control" id="type2" name="type2">
<option value="">{Lang::T('Type')}</option>
{foreach $type2s as $t}
<option value="{$t}" {if $type2 eq $t }selected{/if}>{Lang::T($t)}
</option>
<option value="{$t}" {if $type2 eq $t }selected{/if}>{Lang::T($t)}
</option>
{/foreach}
</select>
</div>
@ -44,9 +44,9 @@
<select class="form-control" id="bandwidth" name="bandwidth">
<option value="">Bandwidth</option>
{foreach $bws as $b}
<option value="{$b['id']}" {if $bandwidth eq $b['id'] }selected{/if}>
{$b['name_bw']}
</option>
<option value="{$b['id']}" {if $bandwidth eq $b['id'] }selected{/if}>
{$b['name_bw']}
</option>
{/foreach}
</select>
</div>
@ -54,8 +54,8 @@
<select class="form-control" id="type3" name="type3">
<option value="">{Lang::T('Category')}</option>
{foreach $type3s as $t}
<option value="{$t}" {if $type3 eq $t }selected{/if}>{$t}
</option>
<option value="{$t}" {if $type3 eq $t }selected{/if}>{$t}
</option>
{/foreach}
</select>
</div>
@ -63,8 +63,8 @@
<select class="form-control" id="valid" name="valid">
<option value="">{Lang::T('Validity')}</option>
{foreach $valids as $v}
<option value="{$v}" {if $valid eq $v }selected{/if}>{$v}
</option>
<option value="{$v}" {if $valid eq $v }selected{/if}>{$v}
</option>
{/foreach}
</select>
</div>
@ -72,7 +72,7 @@
<select class="form-control" id="router" name="router">
<option value="">{Lang::T('Location')}</option>
{foreach $routers as $r}
<option value="{$r}" {if $router eq $r }selected{/if}>{$r}</option>
<option value="{$r}" {if $router eq $r }selected{/if}>{$r}</option>
{/foreach}
<option value="radius" {if $router eq 'radius' }selected{/if}>Radius</option>
</select>
@ -81,7 +81,7 @@
<select class="form-control" id="device" name="device">
<option value="">{Lang::T('Device')}</option>
{foreach $devices as $r}
<option value="{$r}" {if $device eq $r }selected{/if}>{$r}</option>
<option value="{$r}" {if $device eq $r }selected{/if}>{$r}</option>
{/foreach}
</select>
</div>
@ -104,36 +104,38 @@
</div>
</form>
<div class="table-responsive">
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th></th>
<th colspan="4" class="text-center">{Lang::T('Internet Plan')}</th>
<th></th>
<th colspan="2" class="text-center" style="background-color: rgb(243, 241, 172);">
{Lang::T('Expired')}</th>
<th colspan="4"></th>
</tr>
<tr>
<th>{Lang::T('Name')}</th>
<th>{Lang::T('Type')}</th>
<th><a href="{$_url}bandwidth/list">{Lang::T('Bandwidth')}</a></th>
<th>{Lang::T('Price')}</th>
<th>{Lang::T('Validity')}</th>
<th><a href="{$_url}pool/list">{Lang::T('IP Pool')}</a></th>
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Internet Plan')}</th>
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Date')}</th>
<th><a href="{$_url}routers/list">{Lang::T('Location')}</a></th>
<th>{Lang::T('Device')}</th>
<th>{Lang::T('Manage')}</th>
<th>ID</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr {if $ds['enabled'] != 1}class="danger" title="disabled" {/if}>
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th></th>
<th colspan="4" class="text-center">{Lang::T('Internet Plan')}</th>
<th></th>
<th colspan="2" class="text-center" style="background-color: rgb(243, 241, 172);">
{Lang::T('Expired')}</th>
<th colspan="4"></th>
</tr>
<tr>
<th>{Lang::T('Name')}</th>
<th>{Lang::T('Type')}</th>
<th><a href="{$_url}bandwidth/list">{Lang::T('Bandwidth')}</a></th>
<th>{Lang::T('Price')}</th>
<th>{Lang::T('Validity')}</th>
<th><a href="{$_url}pool/list">{Lang::T('IP Pool')}</a></th>
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Internet Plan')}</th>
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Date')}</th>
<th><a href="{$_url}routers/list">{Lang::T('Location')}</a></th>
<th>{Lang::T('Device')}</th>
<th>{Lang::T('Manage')}</th>
<th>ID</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr {if $ds['enabled'] !=1}class="danger" title="disabled" {/if}>
<td>{$ds['name_plan']}</td>
<td>{$ds['plan_type']} {if $ds['prepaid'] != 'yes'}<b>{Lang::T('Postpaid')}</b>{else}{Lang::T('Prepaid')}{/if}</td>
<td>{$ds['plan_type']} {if $ds['prepaid'] !=
'yes'}<b>{Lang::T('Postpaid')}</b>{else}{Lang::T('Prepaid')}{/if}</td>
<td>{$ds['name_bw']}</td>
<td>{Lang::moneyFormat($ds['price'])}</td>
<td>{$ds['validity']} {$ds['validity_unit']}</td>
@ -144,11 +146,11 @@
<td>{if $ds['prepaid'] == no}{$ds['expired_date']}{/if}</td>
<td>
{if $ds['is_radius']}
<span class="label label-primary">RADIUS</span>
<span class="label label-primary">RADIUS</span>
{else}
{if $ds['routers']!=''}
<a href="{$_url}routers/edit/0&name={$ds['routers']}">{$ds['routers']}</a>
{/if}
{if $ds['routers']!=''}
<a href="{$_url}routers/edit/0&name={$ds['routers']}">{$ds['routers']}</a>
{/if}
{/if}
</td>
<td>{$ds['device']}</td>
@ -161,9 +163,10 @@
</td>
<td>{$ds['id']}</td>
</tr>
{/foreach}
</tbody>
</table>
{/foreach}
</tbody>
</table>
</div>
</div>
<div class="panel-footer">
{include file="pagination.tpl"}
@ -176,4 +179,4 @@
</div>
</div>
{include file="sections/footer.tpl"}
{include file="sections/footer.tpl"}

View File

@ -22,6 +22,7 @@
<div class="col-md-6">
<label><input type="radio" id="Hot" name="type" value="Hotspot"> {Lang::T('Hotspot Plans')}</label>
<label><input type="radio" id="POE" name="type" value="PPPOE"> {Lang::T('PPPOE Plans')}</label>
<label><input type="radio" id="VPN" name="type" value="VPN"> {Lang::T('VPN Plans')}</label>
</div>
</div>
<div class="form-group">

View File

@ -80,8 +80,9 @@
</div>
</div>
</span>
<div class="box box-primary box-solid">
<div class="table-responsive">
<div class="box box-primary box-solid">
<div class="table-responsive">&nbsp;&nbsp;
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-condensed">
<thead>
<tr>
@ -126,6 +127,7 @@
</tbody>
</table>
</div>
</div>
<div class="box-footer">
<p class="text-center small text-info">{Lang::T('All Transactions at Date')}:
{Lang::dateAndTimeFormat($sd, $ts)} - {Lang::dateAndTimeFormat($ed, $te)}</p>

View File

@ -96,7 +96,7 @@ $(function() {
});
};
}else{
} else if ($('#POE').is(':checked')) {
$.ajax({
type: "POST",
dataType: "html",
@ -117,6 +117,27 @@ $(function() {
}
});
});
} else {
$.ajax({
type: "POST",
dataType: "html",
url: "index.php?_route=autoload/server",
success: function(msg){
$("#server").html(msg);
}
});
$("#server").change(function(){
var server = $("#server").val();
$.ajax({
type: "POST",
dataType: "html",
url: "index.php?_route=autoload/plan",
data: "jenis=VPN&server="+server,
success: function(msg){
$("#plan").html(msg);
}
});
});
}
});
});

View File

@ -41,6 +41,36 @@
});
</script>
<script>
const toggleIcon = document.getElementById('toggleIcon');
const body = document.body;
const savedMode = localStorage.getItem('mode');
if (savedMode === 'dark') {
body.classList.add('dark-mode');
toggleIcon.textContent = '🌜';
}
function setMode(mode) {
if (mode === 'dark') {
body.classList.add('dark-mode');
toggleIcon.textContent = '🌜';
} else {
body.classList.remove('dark-mode');
toggleIcon.textContent = '🌞';
}
}
toggleIcon.addEventListener('click', () => {
if (body.classList.contains('dark-mode')) {
setMode('light');
localStorage.setItem('mode', 'light');
} else {
setMode('dark');
localStorage.setItem('mode', 'dark');
}
});
</script>
{if isset($xfooter)}
{$xfooter}
{/if}

View File

@ -148,12 +148,26 @@
color: inherit;
background-color: transparent;
border-color: transparent;
border-bottom-right-radius: 21px;
border-bottom-left-radius: 21px;
}
.panel-primary>.panel-heading {
color: inherit;
background-color: transparent;
border-color: transparent;
.panel-success>.panel-heading {
border-bottom-right-radius: 21px;
border-bottom-left-radius: 21px;
}
.panel-warning>.panel-heading {
border-bottom-right-radius: 21px;
border-bottom-left-radius: 21px;
}
.panel-danger>.panel-heading {
color: #a94442;
background-color: #f2dede;
border-color: #ebccd1;
border-bottom-right-radius: 21px;
border-bottom-left-radius: 21px;
}
.panel-heading {
@ -171,7 +185,7 @@
-webkit-border-radius: 1px !important;
-moz-border-radius: 1px !important;
-ms-border-radius: 1px !important;
border-radius: 25px !important;
border-radius: 15px !important;
border-color: rgba(221, 224, 255, .54);
}
@ -180,11 +194,13 @@
background-color: transparent;
border-color: transparent;
}
.box.box-solid.box-info>.box-header {
color: inherit;
background-color: transparent;
border-color: transparent;
}
.box.box-solid.box-danger>.box-header {
color: inherit;
background-color: transparent;
@ -211,6 +227,7 @@
border-top: 1px solid transparent;
padding: 10px;
background-color: inherit;
border-radius: 15px;
}
.panel-footer {
@ -232,6 +249,30 @@
box-shadow: 0px 4px 30px rgba(221, 224, 255, .54);
}
.panel-success>.panel-heading {
color: #3c763d;
background-color: transparent;
border-color: #d6e9c6;
}
.content-header>h1 {
font-weight: bold;
}
.box-header>.fa,
.box-header>.glyphicon,
.box-header>.ion,
.box-header .box-title {
font-weight: bold;
}
.modern-skin-dark .main-sidebar .sidebar .sidebar-menu li>a {
font-weight: bold;
}
.main-header .logo .logo-lg {
font-weight: bold;
}
/* Search Bar Start Here */
.wrap {
@ -303,6 +344,13 @@
overflow-y: auto;
}
.panel-heading {
padding: 10px 15px;
border-bottom: 0px solid transparent;
border-top-right-radius: 21px;
border-top-left-radius: 21px;
}
/* Search Bar End Here */
/* New Customize Interface End Here */
@ -332,7 +380,6 @@
th:first-child,
td:first-child {
position: sticky;
left: 0px;
background-color: #f9f9f9;
}
@ -534,6 +581,559 @@
-ms-transform: translateX(26px);
transform: translateX(26px);
}
/* dark mode styles start here */
.dark-mode {
background-color: #1a202c;
color: #cbd5e0;
}
.dark-mode .main-header .logo,
.dark-mode .main-header .navbar,
.dark-mode .main-sidebar,
.dark-mode .main-sidebar .sidebar,
.dark-mode .sidebar-menu li>a {
background-color: #1a202c;
color: #cbd5e0;
}
.dark-mode .sidebar-menu li:hover,
.dark-mode .sidebar-menu li:focus {
color: #10d435;
}
.dark-mode .main-sidebar .sidebar .sidebar-menu li.active a {
background-color: #2e298e;
}
.dark-mode .content,
.dark-mode .content-header,
.dark-mode .content-wrapper,
.dark-mode .right-side {
background-color: #2d3748;
}
.dark-mode .main-footer {
background-color: #1a202c;
color: #cbd5e0;
}
.dark-mode .panel,
.dark-mode .box {
background-color: #2d3748;
border-color: #4a5568;
box-shadow: none;
}
.dark-mode .panel-heading,
.dark-mode .box-header {
background-color: transparent;
color: #cbd5e0;
}
.dark-mode .box-footer,
.dark-mode .panel-footer {
background-color: #2d3748;
}
.dark-mode .search-container {
background-color: #2d3748;
color: #cbd5e0;
}
.dark-mode .searchTerm {
background-color: #4a5568;
color: #cbd5e0;
}
.dark-mode .cancelButton {
background-color: #e53e3e;
}
.dark-mode .notification-top-bar {
background-color: #742a2a;
}
.dark-mode .bs-callout {
background-color: #2d3748;
border-color: #4a5568;
color: #cbd5e0;
}
.dark-mode .bs-callout h4 {
color: #cbd5e0;
}
.dark-mode .bg-gray {
background-color: inherit !important;
}
.toggle-container {
position: absolute;
top: 17px;
right: 15px;
cursor: pointer;
}
.toggle-container .toggle-icon {
font-size: 25px;
color: rgb(100 116 139);
transition: color 0.5s ease;
}
@media (max-width: 600px) {
.toggle-container {
top: 15px;
right: 60px;
}
.toggle-container .toggle-icon {
font-size: 20px;
color: rgb(100 116 139);
transition: color 0.5s ease;
}
}
.dark-mode .toggle-container .toggle-icon {
color: #ffdd57;
}
.dark-mode th:first-child,
.dark-mode td:first-child {
background-color: #4a4949;
}
.dark-mode .panel>.table:last-child>tbody:last-child>tr:last-child td:first-child,
.dark-mode .panel>.table:last-child>tbody:last-child>tr:last-child th:first-child,
.dark-mode .panel>.table:last-child>tfoot:last-child>tr:last-child td:first-child,
.dark-mode .panel>.table:last-child>tfoot:last-child>tr:last-child th:first-child,
.dark-mode .panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:first-child,
.dark-mode .panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:first-child,
.dark-mode .panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:first-child,
.dark-mode .panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:first-child {
background-color: #4a4949;
border-bottom-left-radius: 21px;
}
.dark-mode .table>thead>tr>td.danger,
.dark-mode .table>thead>tr>th.danger,
.dark-mode .table>thead>tr.danger>td,
.dark-mode .table>thead>tr.danger>th,
.dark-mode .table>tbody>tr>td.danger,
.dark-mode .table>tbody>tr>th.danger,
.dark-mode .table>tbody>tr.danger>td,
.dark-mode .table>tbody>tr.danger>th,
.dark-mode .table>tfoot>tr>td.danger,
.dark-mode .table>tfoot>tr>th.danger,
.dark-mode .table>tfoot>tr.danger>td,
.dark-mode .table>tfoot>tr.danger>th {
background-color: #694760;
}
.dark-mode .table>thead>tr>td.warning,
.dark-mode .table>thead>tr>th.warning,
.dark-mode .table>thead>tr.warning>td,
.dark-mode .table>thead>tr.warning>th,
.dark-mode .table>tbody>tr>td.warning,
.dark-mode .table>tbody>tr>th.warning,
.dark-mode .table>tbody>tr.warning>td,
.dark-mode .table>tbody>tr.warning>th,
.dark-mode .table>tfoot>tr>td.warning,
.dark-mode .table>tfoot>tr>th.warning,
.dark-mode .table>tfoot>tr.warning>td,
.dark-mode .table>tfoot>tr.danger>th {
background-color: #787c63;
color: #ffffff;
}
.dark-mode .table>thead>tr>td.success,
.dark-mode .table>thead>tr>th.success,
.dark-mode .table>thead>tr.success>td,
.dark-mode .table>thead>tr.success>th,
.dark-mode .table>tbody>tr>td.success,
.dark-mode .table>tbody>tr>th.success,
.dark-mode .table>tbody>tr.success>td,
.dark-mode .table>tbody>tr.success>th,
.dark-mode .table>tfoot>tr>td.success,
.dark-mode .table>tfoot>tr>th.success,
.dark-mode .table>tfoot>tr.success>td,
.dark-mode .table>tfoot>tr.success>th {
background-color: #7dcba7;
color: #ffffff;
}
.dark-mode .panel-heading {
padding: 10px 15px;
border-bottom: 1px solid transparent;
border-top-right-radius: 21px;
border-top-left-radius: 21px;
}
.dark-mode .table-bordered>thead>tr>th,
.dark-mode .table-bordered>thead>tr>td,
.dark-mode .table-bordered>tbody>tr>th,
.dark-mode .table-bordered>tbody>tr>td,
.dark-mode .table-bordered>tfoot>tr>th,
.dark-mode .table-bordered>tfoot>tr>td {
border: 1px solid;
border-color: rgba(221, 224, 255, .54);
}
/* Dark Mode - Input Fields */
.dark-mode input:not(#filterNavigateMenu),
.dark-mode textarea:not(#filterNavigateMenu),
.dark-mode select:not(#filterNavigateMenu),
.dark-mode .select2-selection:not(#filterNavigateMenu) {
color: inherit;
transition: all .5s ease-in-out;
}
.dark-mode input:focus:not(#filterNavigateMenu),
.dark-mode textarea:focus:not(#filterNavigateMenu),
.dark-mode select:focus:not(#filterNavigateMenu),
.dark-mode .select2-selection:focus:not(#filterNavigateMenu) {
color: #1f201f;
outline: none;
}
.dark-mode .nav-stacked>li>a {
color: inherit;
}
.dark-mode .input-group .form-control {
position: relative;
z-index: 2;
float: left;
width: 100%;
margin-bottom: 0;
color: inherit;
border-color: rgba(221, 224, 255, .54);
background-color: inherit;
}
.dark-mode .input-group .input-group-addon {
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
color: inherit;
border-bottom-left-radius: 0;
border-color: rgba(221, 224, 255, .54);
background-color: transparent;
}
.dark-mode .input-group .form-control:last-child,
.dark-mode .input-group-addon:last-child,
.dark-mode .input-group-btn:last-child>.btn,
.dark-mode .input-group-btn:last-child>.btn-group>.btn,
.dark-mode .input-group-btn:last-child>.dropdown-toggle,
.dark-mode .input-group-btn:first-child>.btn:not(:first-child),
.dark-mode .input-group-btn:first-child>.btn-group:not(:first-child)>.btn {
color: inherit;
}
.dark-mode input:not(#filterNavigateMenu),
textarea:not(#filterNavigateMenu),
optgroup:not(#filterNavigateMenu),
select:not(#filterNavigateMenu),
.dark-mode .select2-selection:not(#filterNavigateMenu) {
-moz-transition: all .5s ease-in-out;
-o-transition: all .5s ease-in-out;
-webkit-transition: all .5s ease-in-out;
transition: all .5s ease-in-out;
}
.dark-mode .form-control {
display: block;
width: 100%;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
color: inherit;
background-color: transparent;
background-image: none;
border: 1px solid;
border-color: rgba(221, 224, 255, .54);
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.dark-mode .help-block {
display: block;
margin-top: 5px;
margin-bottom: 10px;
color: inherit;
}
.dark-mode .text-muted {
color: rgba(221, 224, 255, .54);
}
.dark-mode .breadcrumb {
padding: 8px 15px;
margin-bottom: 20px;
list-style: none;
background-color: rgba(221, 224, 255, .54);
border-radius: 4px;
}
.dark-mode .pagination>.disabled>span,
.dark-mode .pagination>.disabled>span:hover,
.dark-mode .pagination>.disabled>span:focus,
.dark-mode .pagination>.disabled>a,
.dark-mode .pagination>.disabled>a:hover,
.dark-mode .pagination>.disabled>a:focus {
color: inherit;
background-color: rgba(221, 224, 255, .54);
border-color: rgba(221, 224, 255, .54);
cursor: not-allowed;
}
.dark-mode .pagination>.active>a,
.dark-mode .pagination>.active>a:hover,
.dark-mode .pagination>.active>a:focus,
.dark-mode .pagination>.active>span,
.dark-mode .pagination>.active>span:hover,
.dark-mode .pagination>.active>span:focus {
z-index: 2;
color: #fff;
background-color: #435ebe;
border-color: rgba(221, 224, 255, .54);
box-shadow: 0 2px 5px rgba(67, 94, 190, .3);
cursor: default;
}
.dark-mode .pagination>li>a {
background: inherit;
color: inherit;
border: 1px solid;
border-color: rgba(221, 224, 255, .54);
}
.dark-mode .table {
background-color: #2a2a2a;
color: #ddd;
border-color: #444;
}
.dark-mode .table th,
.dark-mode .table td {
background-color: #333;
border-color: #444;
color: #ddd;
}
.dark-mode .table th {
background-color: #444;
font-weight: bold;
}
.dark-mode .table-striped tbody tr:nth-of-type(odd) {
background-color: #3a3a3a;
}
.dark-mode .table-bordered {
border: 1px solid #444;
}
.dark-mode .table-hover tbody tr:hover {
background-color: #555;
color: #fff;
}
.dark-mode .table-condensed th,
.dark-mode .table-condensed td {
padding: 8px;
}
.dark-mode .panel>.table:last-child,
.dark-mode .panel>.table-responsive:last-child>.table:last-child {
border-bottom-right-radius: 21px;
border-bottom-left-radius: 21px;
}
.dark-mode .panel>.table:last-child>tbody:last-child>tr:last-child,
.dark-mode .panel>.table:last-child>tfoot:last-child>tr:last-child,
.dark-mode .panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,
.dark-mode .panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child {
border-bottom-right-radius: 21px;
border-bottom-left-radius: 21px;
}
.dark-mode .panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,
.dark-mode .panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,
.dark-mode .panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,
.dark-mode .panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,
.dark-mode .panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,
.dark-mode .panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,
.dark-mode .panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,
.dark-mode .panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child {
border-bottom-right-radius: 21px;
}
/* Dark Mode - Select2 Dropdown start here */
.dark-mode .select2-container--bootstrap .select2-results__option--highlighted[aria-selected] {
background-color: rgb(96, 89, 89);
color: #ffffff;
}
.dark-mode .select2-container--bootstrap .select2-results__option {
padding: 6px 12px;
background-color: rgb(96, 89, 89);
color: #f8f9fa;
}
.dark-mode .select2-results__option[aria-selected] {
cursor: pointer;
background-color: inherit;
color: #ffffff;
}
.dark-mode .select2-results__option {
padding: 6px 12px;
user-select: none;
-webkit-user-select: none;
background-color: #343a40;
color: #f8f9fa;
}
.dark-mode .select2-dropdown {
background-color: #343a40;
border-color: #454d55;
}
.dark-mode .select2-selection--single {
background-color: #495057;
color: #ffffff;
border-color: #454d55;
}
.dark-mode .select2-selection__rendered {
color: #ffffff;
}
.dark-mode .select2-selection__arrow b {
border-color: #ffffff transparent transparent transparent;
}
.dark-mode .select2-container--bootstrap .select2-selection--single .select2-selection__rendered {
color: inherit;
padding: 0;
}
.dark-mode .main-footer {
border-top: 1px solid transparent;
}
.dark-mode .list-group-item {
position: relative;
display: block;
padding: 10px 15px;
margin-bottom: -1px;
background-color: transparent;
border: 1px solid rgba(221, 224, 255, .54);
}
.dark-mode .modern-skin-dark .main-sidebar .sidebar .sidebar-menu li>a {
font-weight: bold;
}
.dark-mode .content-header>h1 {
font-weight: bold;
}
.dark-mode .box-header>.fa,
.dark-mode .box-header>.glyphicon,
.dark-mode .box-header>.ion,
.dark-mode .box-header .box-title {
font-weight: bold;
}
.dark-mode .content-header>h2 {
font-weight: bold;
}
.dark-mode .main-header .logo .logo-lg {
font-weight: bold;
}
.dark-mode .modal-content {
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 15px;
border-bottom-left-radius: 15px;
-webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, .125);
box-shadow: 0 2px 3px rgba(0, 0, 0, .125);
border: 0;
background: #1a202c;
}
.dark-mode .modal-header {
padding: 15px;
border-bottom: 1px solid rgba(221, 224, 255, .54);
min-height: 16.428571429px;
background-color: #1a202c;
color: inherit;
}
.dark-mode .navbar-nav>.notifications-menu>.dropdown-menu>li.footer>a,
.dark-mode .navbar-nav>.messages-menu>.dropdown-menu>li.footer>a,
.dark-mode .navbar-nav>.tasks-menu>.dropdown-menu>li.footer>a {
background: #1a202c !important;
color: inherit !important;
}
.dark-mode .navbar-nav>.user-menu>.dropdown-menu>.user-footer {
background-color: #1a202c;
}
.dark-mode .nav-tabs-custom>.tab-content {
background-color: #1a202c;
padding: 10px;
border-bottom-right-radius: 15px;
border-bottom-left-radius: 15px;
}
.dark-mode .nav-tabs-custom {
margin-bottom: 20px;
background: #1a202c;
box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
border-radius: 15px;
}
.dark-mode .nav-tabs-custom>.nav-tabs>li:first-of-type.active>a {
border-left-color: transparent;
}
.dark-mode .nav-tabs-custom>.nav-tabs>li.active>a {
border-top-color: transparent;
border-left-color: rgba(221, 224, 255, .54);
border-right-color: rgba(221, 224, 255, .54);
color: inherit;
background-color: #1a202c;
}
.dark-mode pre {
display: block;
padding: 9.5px;
margin: 0 0 10px;
font-size: 13px;
line-height: 1.428571429;
word-break: break-all;
word-wrap: break-word;
color: inherit;
background-color: inherit;
border: 1px solid #ccc;
border-radius: 4px;
}
/* Dark Mode - Select2 Dropdown ends here */
/* dark mode styles start ends here */
</style>
{if isset($xheader)}
{$xheader}
@ -570,6 +1170,11 @@
<button type="button" id="closeSearch" class="cancelButton">{Lang::T('Cancel')}</button>
</div>
</div>
<li>
<a class="toggle-container" href="#">
<i class="toggle-icon" id="toggleIcon">🌞</i>
</a>
</li>
<li class="dropdown user user-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
<img src="https://robohash.org/{$_admin['id']}?set=set3&size=100x100&bgset=bg1"
@ -678,6 +1283,8 @@
href="{$_url}services/hotspot">Hotspot</a></li>
<li {if $_routes[1] eq 'pppoe' }class="active" {/if}><a
href="{$_url}services/pppoe">PPPOE</a></li>
<li {if $_routes[1] eq 'vpn' }class="active" {/if}><a
href="{$_url}services/vpn">VPN</a></li>
<li {if $_routes[1] eq 'list' }class="active" {/if}><a
href="{$_url}bandwidth/list">Bandwidth</a></li>
{if $_c['enable_balance'] == 'yes'}
@ -699,7 +1306,7 @@
</a>
{/if}
<ul class="treeview-menu">
<li {if $_system_menu eq 'reports' }class="active" {/if}><a
<li {if $_routes[1] eq 'reports' }class="active" {/if}><a
href="{$_url}reports">{Lang::T('Daily Reports')}</a></li>
<li {if $_routes[1] eq 'activation' }class="active" {/if}><a
href="{$_url}reports/activation">{Lang::T('Activation History')}</a></li>
@ -736,6 +1343,8 @@
href="{$_url}routers">Routers</a></li>
<li {if $_routes[0] eq 'pool' and $_routes[1] eq 'list' }class="active" {/if}><a
href="{$_url}pool/list">IP Pool</a></li>
<li {if $_routes[0] eq 'pool' and $_routes[1] eq 'port' }class="active" {/if}><a
href="{$_url}pool/port">Port Pool</a></li>
<li {if $_routes[0] eq 'routers' and $_routes[1] eq 'maps' }class="active" {/if}><a
href="{$_url}routers/maps">{Lang::T('Routers Maps')}</a></li>
{$_MENU_NETWORK}
@ -852,7 +1461,7 @@
{/if}
{$_MENU_AFTER_LOGS}
{if in_array($_admin['user_type'],['SuperAdmin','Admin'])}
<li {if $_system_menu eq 'community' }class="active" {/if}>
<li {if $_routes[1] eq 'docs' }class="active" {/if}>
<a href="{if $_c['docs_clicked'] != 'yes'}{$_url}settings/docs{else}./docs/{/if}">
<i class="ion ion-ios-bookmarks"></i>
<span class="text">{Lang::T('Documentation')}</span>

View File

@ -4,11 +4,13 @@
<div class="row">
<div class="col col-md-6 col-md-push-6">
{if $unpaid }
<div class="box box-danger box-solid">
<div class="box-header">
<h3 class="box-title">{Lang::T('Unpaid Order')}</h3>
</div>
<table class="table table-condensed table-bordered table-striped table-hover" style="margin-bottom: 0px;">
<div class="box box-danger box-solid">
<div class="box-header">
<h3 class="box-title">{Lang::T('Unpaid Order')}</h3>
</div>
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-condensed table-bordered table-striped table-hover"
style="margin-bottom: 0px;">
<tbody>
<tr>
<td>{Lang::T('expired')}</td>
@ -27,26 +29,27 @@
<td>{$unpaid['routers']}</td>
</tr>
</tbody>
</table>
<div class="box-footer p-2">
<div class="btn-group btn-group-justified mb15">
<div class="btn-group">
<a href="{$_url}order/view/{$unpaid['id']}/cancel" class="btn btn-danger btn-sm"
onclick="return confirm('{Lang::T('Cancel it?')}')">
<span class="glyphicon glyphicon-trash"></span>
{Lang::T('Cancel')}
</a>
</div>
<div class="btn-group">
<a class="btn btn-success btn-block btn-sm" href="{$_url}order/view/{$unpaid['id']}">
<span class="icon"><i class="ion ion-card"></i></span>
<span>{Lang::T('PAY NOW')}</span>
</a>
</div>
</div>
</div>
</table> &nbsp;
</div>
<div class="box-footer p-2">
<div class="btn-group btn-group-justified mb15">
<div class="btn-group">
<a href="{$_url}order/view/{$unpaid['id']}/cancel" class="btn btn-danger btn-sm"
onclick="return confirm('{Lang::T('Cancel it?')}')">
<span class="glyphicon glyphicon-trash"></span>
{Lang::T('Cancel')}
</a>
</div>
<div class="btn-group">
<a class="btn btn-success btn-block btn-sm" href="{$_url}order/view/{$unpaid['id']}">
<span class="icon"><i class="ion ion-card"></i></span>
<span>{Lang::T('PAY NOW')}</span>
</a>
</div>
</div>
</div>&nbsp;&nbsp;
</div>
{/if}
<div class="box box-info box-solid">
<div class="box-header">
@ -55,7 +58,7 @@
<div class="box-body">
{$Announcement_Customer = "{$PAGES_PATH}/Announcement_Customer.html"}
{if file_exists($Announcement_Customer)}
{include file=$Announcement_Customer}
{include file=$Announcement_Customer}
{/if}
</div>
</div>
@ -65,337 +68,376 @@
<div class="box-header">
<h3 class="box-title">{Lang::T('Your Account Information')}</h3>
</div>
<table class="table table-bordered table-striped table-bordered table-hover mb-0"
style="margin-bottom: 0px;">
<tr>
<td class="small text-success text-uppercase text-normal">{Lang::T('Username')}</td>
<td class="small mb15">{$_user['username']}</td>
</tr>
<tr>
<td class="small text-success text-uppercase text-normal">{Lang::T('Password')}</td>
<td class="small mb15"><input type="password" value="{$_user['password']}"
style="width:100%; border: 0px;" onmouseleave="this.type = 'password'"
onmouseenter="this.type = 'text'" onclick="this.select()"></td>
</tr>
<tr>
<td class="small text-success text-uppercase text-normal">{Lang::T('Service Type')}</td>
<td class="small mb15">
{if $_user.service_type == 'Hotspot'}
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped table-bordered table-hover mb-0"
style="margin-bottom: 0px;">
<tr>
<td class="small text-success text-uppercase text-normal">{Lang::T('Username')}</td>
<td class="small mb15">{$_user['username']}</td>
</tr>
<tr>
<td class="small text-success text-uppercase text-normal">{Lang::T('Password')}</td>
<td class="small mb15"><input type="password" value="{$_user['password']}"
style="width:100%; border: 0px;" onmouseleave="this.type = 'password'"
onmouseenter="this.type = 'text'" onclick="this.select()"></td>
</tr>
<tr>
<td class="small text-success text-uppercase text-normal">{Lang::T('Service Type')}</td>
<td class="small mb15">
{if $_user.service_type == 'Hotspot'}
Hotspot
{elseif $_user.service_type == 'PPPoE'}
{elseif $_user.service_type == 'PPPoE'}
PPPoE
{elseif $_user.service_type == 'Others' || $_user.service_type == null}
{elseif $_user.service_type == 'VPN'}
VPN
{elseif $_user.service_type == 'Others' || $_user.service_type == null}
Others
{/if}
</td>
</tr>
{/if}
</td>
</tr>
{if $_c['enable_balance'] == 'yes'}
{if $_c['enable_balance'] == 'yes'}
<tr>
<td class="small text-warning text-uppercase text-normal">{Lang::T('Balance')}</td>
<td class="small mb15 text-bold">
{Lang::moneyFormat($_user['balance'])}
{if $_user['auto_renewal'] == 1}
<a class="label label-success pull-right" href="{$_url}home&renewal=0"
onclick="return confirm('{Lang::T('Disable auto renewal?')}')">{Lang::T('Auto Renewal On')}</a>
<a class="label label-success pull-right" href="{$_url}home&renewal=0"
onclick="return confirm('{Lang::T('Disable auto renewal?')}')">{Lang::T('Auto Renewal
On')}</a>
{else}
<a class="label label-danger pull-right" href="{$_url}home&renewal=1"
onclick="return confirm('{Lang::T('Enable auto renewal?')}')">{Lang::T('Auto Renewal Off')}</a>
<a class="label label-danger pull-right" href="{$_url}home&renewal=1"
onclick="return confirm('{Lang::T('Enable auto renewal?')}')">{Lang::T('Auto Renewal
Off')}</a>
{/if}
</td>
</tr>
{/if}
</table>
{/if}
</table>&nbsp;&nbsp;
</div>
{if $abills && count($abills)>0}
<div class="box-header">
<h3 class="box-title">{Lang::T('Additional Billing')}</h3>
</div>
<div class="box-header">
<h3 class="box-title">{Lang::T('Additional Billing')}</h3>
</div>
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped table-bordered table-hover mb-0"
style="margin-bottom: 0px;">
{assign var="total" value=0}
{foreach $abills as $k => $v}
<tr>
<td class="small text-success text-uppercase text-normal">{str_replace(' Bill', '', $k)}</td>
<td class="small mb15">
{if strpos($v, ':') === false}
{Lang::moneyFormat($v)}
<sup title="recurring">∞</sup>
{assign var="total" value=$v+$total}
{else}
{assign var="exp" value=explode(':',$v)}
{Lang::moneyFormat($exp[0])}
<sup
title="{$exp[1]} more times">{if $exp[1]==0}{Lang::T('paid off')}{else}{$exp[1]}x{/if}</sup>
{if $exp[1]>0}
{assign var="total" value=$exp[0]+$total}
{/if}
{/if}
</td>
</tr>
<tr>
<td class="small text-success text-uppercase text-normal">{str_replace(' Bill', '', $k)}</td>
<td class="small mb15">
{if strpos($v, ':') === false}
{Lang::moneyFormat($v)}
<sup title="recurring">∞</sup>
{assign var="total" value=$v+$total}
{else}
{assign var="exp" value=explode(':',$v)}
{Lang::moneyFormat($exp[0])}
<sup title="{$exp[1]} more times">{if $exp[1]==0}{Lang::T('paid
off')}{else}{$exp[1]}x{/if}</sup>
{if $exp[1]>0}
{assign var="total" value=$exp[0]+$total}
{/if}
{/if}
</td>
</tr>
{/foreach}
<tr>
<td class="small text-success text-uppercase text-normal"><b>{Lang::T('Total')}</b></td>
<td class="small mb15"><b>
{if $total==0}
{ucwords(Lang::T('paid off'))}
{ucwords(Lang::T('paid off'))}
{else}
{Lang::moneyFormat($total)}
{Lang::moneyFormat($total)}
{/if}
</b></td>
</tr>
</table>
</div> &nbsp;&nbsp;
{/if}
</div>
{if $_bills}
<div class="box box-primary box-solid">
{foreach $_bills as $_bill}
{if $_bill['routers'] != 'radius'}
<div class="box-header">
<h3 class="box-title">{$_bill['routers']}</h3>
<div class="btn-group pull-right">
{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}
{/if}
</div>
</div>
{else}
<div class="box-header">
<h3 class="box-title">{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</h3>
</div>
<div class="box box-primary box-solid">
{foreach $_bills as $_bill}
{if $_bill['routers'] != 'radius'}
<div class="box-header">
<h3 class="box-title">{$_bill['routers']}</h3>
<div class="btn-group pull-right">
{if $_bill['type'] == 'Hotspot'}
{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}
{else if $_bill['type'] == 'PPPOE'}
{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}
{else if $_bill['type'] == 'VPN'}
{if $_c['pppoe_plan']==''}VPN Plan{else}{$_c['vpn_plan']}{/if}
{/if}
<table class="table table-bordered table-striped table-bordered table-hover" style="margin-bottom: 0px;">
<tr>
<td class="small text-primary text-uppercase text-normal">{Lang::T('Plan Name')}</td>
<td class="small mb15">
{$_bill['namebp']}
{if $_bill['status'] != 'on'}
<a class="label label-danger pull-right" href="{$_url}order/package">{Lang::T('expired')}</a>
{/if}
</td>
</tr>
<tr>
<td class="small text-primary text-uppercase text-normal">{Lang::T('Bandwidth')}</td>
<td class="small mb15">
{$_bill['name_bw']}
</td>
</tr>
<tr>
<td class="small text-info text-uppercase text-normal">{Lang::T('Created On')}</td>
<td class="small mb15">
{if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['recharged_on'],$_bill['recharged_time'])}
{/if}&nbsp;</td>
</tr>
<tr>
<td class="small text-danger text-uppercase text-normal">{Lang::T('Expires On')}</td>
<td class="small mb15 text-danger">
{if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['expiration'],$_bill['time'])}{/if}&nbsp;
</td>
</tr>
<tr>
<td class="small text-success text-uppercase text-normal">{Lang::T('Type')}</td>
<td class="small mb15 text-success">
<b>{if $_bill['prepaid'] eq yes}Prepaid{else}Postpaid{/if}</b>
{$_bill['plan_type']}
</td>
</tr>
{if $nux_ip neq ''}
<tr>
<td class="small text-primary text-uppercase text-normal">{Lang::T('Current IP')}</td>
<td class="small mb15">{$nux_ip}</td>
</tr>
{/if}
{if $nux_mac neq ''}
<tr>
<td class="small text-primary text-uppercase text-normal">{Lang::T('Current MAC')}</td>
<td class="small mb15">{$nux_mac}</td>
</tr>
{/if}
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on' && $_bill['routers'] != 'radius' && $_c['hs_auth_method'] != 'hchap'}
<tr>
<td class="small text-primary text-uppercase text-normal">{Lang::T('Login Status')}</td>
<td class="small mb15" id="login_status_{$_bill['id']}">
<img src="ui/ui/images/loading.gif">
</td>
</tr>
{/if}
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on' && $_c['hs_auth_method'] == 'hchap'}
<tr>
<td class="small text-primary text-uppercase text-normal">{Lang::T('Login Status')}</td>
<td class="small mb15">
{if $logged == '1'}
<a href="http://{$hostname}/status"
class="btn btn-success btn-xs btn-block">{Lang::T('You are Online, Check Status')}</a>
{else}
<a href="{$_url}home&mikrotik=login"
onclick="return confirm('{Lang::T('Connect to Internet')}')"
class="btn btn-danger btn-xs btn-block">{Lang::T('Not Online, Login now?')}</a>
{/if}
</td>
</tr>
{/if}
<tr>
<td class="small text-primary text-uppercase text-normal">
{if $_bill['status'] == 'on'}
<a href="{$_url}home&deactivate={$_bill['id']}"
onclick="return confirm('{Lang::T('Deactivate')}?')" class="btn btn-danger btn-xs"><i
class="glyphicon glyphicon-trash"></i></a>
{/if}
</td>
<td class="small row">
{if $_bill['status'] != 'on' && $_bill['prepaid'] != 'yes' && $_c['extend_expired']}
<a class="btn btn-warning text-black btn-sm"
href="{$_url}home&extend={$_bill['id']}&stoken={App::getToken()}"
onclick="return confirm('{Text::toHex($_c['extend_confirmation'])}')">{Lang::T('Extend')}</a>
{/if}
<a class="btn btn-primary pull-right btn-sm"
href="{$_url}home&recharge={$_bill['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Recharge')}?')">{Lang::T('Recharge')}</a>
<a class="btn btn-warning text-black pull-right btn-sm"
href="{$_url}home&sync={$_bill['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Sync account if you failed login to internet')}?')"
data-toggle="tooltip" data-placement="top" title="{Lang::T('Sync account if you failed login to internet')}"><span
class="glyphicon glyphicon-refresh" aria-hidden="true"></span> {Lang::T('Sync')}</a>
</td>
</tr>
</table>
{/foreach}
</div>
</div>
{else}
<div class="box-header">
<h3 class="box-title">{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</h3>
</div>
{/if}
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped table-bordered table-hover"
style="margin-bottom: 0px;">
<tr>
<td class="small text-primary text-uppercase text-normal">{Lang::T('Plan Name')}</td>
<td class="small mb15">
{$_bill['namebp']}
{if $_bill['status'] != 'on'}
<a class="label label-danger pull-right"
href="{$_url}order/package">{Lang::T('expired')}</a>
{/if}
</td>
</tr>
<tr>
<td class="small text-primary text-uppercase text-normal">{Lang::T('Bandwidth')}</td>
<td class="small mb15">
{$_bill['name_bw']}
</td>
</tr>
<tr>
<td class="small text-info text-uppercase text-normal">{Lang::T('Created On')}</td>
<td class="small mb15">
{if $_bill['time'] ne
''}{Lang::dateAndTimeFormat($_bill['recharged_on'],$_bill['recharged_time'])}
{/if}&nbsp;</td>
</tr>
<tr>
<td class="small text-danger text-uppercase text-normal">{Lang::T('Expires On')}</td>
<td class="small mb15 text-danger">
{if $_bill['time'] ne
''}{Lang::dateAndTimeFormat($_bill['expiration'],$_bill['time'])}{/if}&nbsp;
</td>
</tr>
<tr>
<td class="small text-success text-uppercase text-normal">{Lang::T('Type')}</td>
<td class="small mb15 text-success">
<b>{if $_bill['prepaid'] eq yes}Prepaid{else}Postpaid{/if}</b>
{$_bill['plan_type']}
</td>
</tr>
{if $_bill['type'] == 'VPN' && $_bill['routers'] == $vpn['routers']}
<tr>
<td class="small text-success text-uppercase text-normal">{Lang::T('Public IP')}</td>
<td class="small mb15">{$vpn['public_ip']} / {$vpn['port_name']}</td>
</tr>
<tr>
<td class="small text-success text-uppercase text-normal">{Lang::T('Private IP')}</td>
<td class="small mb15">{$_user['pppoe_ip']}</td>
</tr>
{foreach $cf as $tcf}
<tr>
{if $tcf['field_name'] == 'Winbox' or $tcf['field_name'] == 'Api' or $tcf['field_name'] == 'Web'}
<td class="small text-info text-uppercase text-normal">{$tcf['field_name']} - Port</td>
<td class="small mb15"><a href="http://{$vpn['public_ip']}:{$tcf['field_value']}" target="_blank">{$tcf['field_value']}</a></td>
</tr>
{/if}
{/foreach}
{/if}
{if $nux_ip neq ''}
<tr>
<td class="small text-primary text-uppercase text-normal">{Lang::T('Current IP')}</td>
<td class="small mb15">{$nux_ip}</td>
</tr>
{/if}
{if $nux_mac neq ''}
<tr>
<td class="small text-primary text-uppercase text-normal">{Lang::T('Current MAC')}</td>
<td class="small mb15">{$nux_mac}</td>
</tr>
{/if}
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on' && $_bill['routers'] != 'radius' &&
$_c['hs_auth_method'] != 'hchap'}
<tr>
<td class="small text-primary text-uppercase text-normal">{Lang::T('Login Status')}</td>
<td class="small mb15" id="login_status_{$_bill['id']}">
<img src="ui/ui/images/loading.gif">
</td>
</tr>
{/if}
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on' && $_c['hs_auth_method'] == 'hchap'}
<tr>
<td class="small text-primary text-uppercase text-normal">{Lang::T('Login Status')}</td>
<td class="small mb15">
{if $logged == '1'}
<a href="http://{$hostname}/status" class="btn btn-success btn-xs btn-block">{Lang::T('You
are
Online, Check Status')}</a>
{else}
<a href="{$_url}home&mikrotik=login"
onclick="return confirm('{Lang::T('Connect to Internet')}')"
class="btn btn-danger btn-xs btn-block">{Lang::T('Not Online, Login now?')}</a>
{/if}
</td>
</tr>
{/if}
<tr>
<td class="small text-primary text-uppercase text-normal">
{if $_bill['status'] == 'on'}
<a href="{$_url}home&deactivate={$_bill['id']}"
onclick="return confirm('{Lang::T('Deactivate')}?')" class="btn btn-danger btn-xs"><i
class="glyphicon glyphicon-trash"></i></a>
{/if}
</td>
<td class="small row">
{if $_bill['status'] != 'on' && $_bill['prepaid'] != 'yes' && $_c['extend_expired']}
<a class="btn btn-warning text-black btn-sm"
href="{$_url}home&extend={$_bill['id']}&stoken={App::getToken()}"
onclick="return confirm('{Text::toHex($_c['extend_confirmation'])}')">{Lang::T('Extend')}</a>
{/if}
<a class="btn btn-primary pull-right btn-sm"
href="{$_url}home&recharge={$_bill['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Recharge')}?')">{Lang::T('Recharge')}</a>
<a class="btn btn-warning text-black pull-right btn-sm"
href="{$_url}home&sync={$_bill['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Sync account if you failed login to internet')}?')"
data-toggle="tooltip" data-placement="top"
title="{Lang::T('Sync account if you failed login to internet')}"><span
class="glyphicon glyphicon-refresh" aria-hidden="true"></span> {Lang::T('Sync')}</a>
</td>
</tr>
</table>
</div>
&nbsp;&nbsp;
{/foreach}
</div>
{/if}
{if $_c['disable_voucher'] == 'yes'}
<div class="box-footer">
{if $_c['payment_gateway'] != 'none' or $_c['payment_gateway'] == '' }
<a href="{$_url}order/package" class="btn btn-primary btn-block">
<i class="ion ion-ios-cart"></i>
{Lang::T('Order Package')}
</a>
{/if}
</div>
<div class="box-footer">
{if $_c['payment_gateway'] != 'none' or $_c['payment_gateway'] == '' }
<a href="{$_url}order/package" class="btn btn-primary btn-block">
<i class="ion ion-ios-cart"></i>
{Lang::T('Order Package')}
</a>
{/if}
</div>
{/if}
{if $_bills}
{foreach $_bills as $_bill}
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on' && $_c['hs_auth_method'] != 'hchap'}
<script>
setTimeout(() => {
$.ajax({
url: "index.php?_route=autoload_user/isLogin/{$_bill['id']}",
cache: false,
success: function(msg) {
$("#login_status_{$_bill['id']}").html(msg);
}
});
}, 2000);
</script>
{/if}
{/foreach}
{foreach $_bills as $_bill}
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on' && $_c['hs_auth_method'] != 'hchap'}
<script>
setTimeout(() => {
$.ajax({
url: "index.php?_route=autoload_user/isLogin/{$_bill['id']}",
cache: false,
success: function (msg) {
$("#login_status_{$_bill['id']}").html(msg);
}
});
}, 2000);
</script>
{/if}
{/foreach}
{/if}
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes'}
<div class="box box-primary box-solid mb30">
<div class="box-header">
<h4 class="box-title">{Lang::T("Transfer Balance")}</h4>
</div>
<div class="box-body p-0">
<form method="post" onsubmit="return askConfirm()" role="form" action="{$_url}home">
<div class="form-group">
<div class="col-sm-5">
<input type="text" id="username" name="username" class="form-control" required
placeholder="{Lang::T('Username')}">
</div>
<div class="col-sm-5">
<input type="number" id="balance" name="balance" autocomplete="off" class="form-control"
required placeholder="{Lang::T('Balance')}">
</div>
<div class="form-group col-sm-2" align="center">
<button class="btn btn-success btn-block" id="sendBtn" type="submit" name="send"
onclick="return confirm('{Lang::T("Are You Sure?")}')" value="balance"><i
class="glyphicon glyphicon-send"></i></button>
</div>
<div class="box box-primary box-solid mb30">
<div class="box-header">
<h4 class="box-title">{Lang::T("Transfer Balance")}</h4>
</div>
<div class="box-body p-0">
<form method="post" onsubmit="return askConfirm()" role="form" action="{$_url}home">
<div class="form-group">
<div class="col-sm-5">
<input type="text" id="username" name="username" class="form-control" required
placeholder="{Lang::T('Username')}">
</div>
</form>
<script>
function askConfirm() {
if(confirm('{Lang::T('Send your balance?')}')){
<div class="col-sm-5">
<input type="number" id="balance" name="balance" autocomplete="off" class="form-control"
required placeholder="{Lang::T('Balance')}">
</div>
<div class="form-group col-sm-2" align="center">
<button class="btn btn-success btn-block" id="sendBtn" type="submit" name="send"
onclick="return confirm('{Lang::T(" Are You Sure?")}')" value="balance"><i
class="glyphicon glyphicon-send"></i></button>
</div>
</div>
</form>
<script>
function askConfirm() {
if (confirm('{Lang::T('Send your balance ? ')}')) {
setTimeout(() => {
document.getElementById('sendBtn').setAttribute('disabled', '');
}, 1000);
return true;
}
return false;
}
</script>
</div>
<div class="box-header">
<h4 class="box-title">{Lang::T("Recharge a friend")}</h4>
</div>
<div class="box-body p-0">
<form method="post" role="form" action="{$_url}home">
<div class="form-group">
<div class="col-sm-10">
<input type="text" id="username" name="username" class="form-control" required
placeholder="{Lang::T('Username')}">
</div>
<div class="form-group col-sm-2" align="center">
<button class="btn btn-success btn-block" id="sendBtn" type="submit" name="send"
onclick="return confirm('{Lang::T("Are You Sure?")}')" value="plan"><i
class="glyphicon glyphicon-send"></i></button>
</div>
</div>
</form>
</div>
}
</script>
</div>
<div class="box-header">
<h4 class="box-title">{Lang::T("Recharge a friend")}</h4>
</div>
<div class="box-body p-0">
<form method="post" role="form" action="{$_url}home">
<div class="form-group">
<div class="col-sm-10">
<input type="text" id="username" name="username" class="form-control" required
placeholder="{Lang::T('Username')}">
</div>
<div class="form-group col-sm-2" align="center">
<button class="btn btn-success btn-block" id="sendBtn" type="submit" name="send"
onclick="return confirm('{Lang::T(" Are You Sure?")}')" value="plan"><i
class="glyphicon glyphicon-send"></i></button>
</div>
</div>
</form>
</div>
</div>
{/if}
<br>
{if $_c['disable_voucher'] != 'yes'}
<div class="box box-primary box-solid mb30">
<div class="box-header">
<h3 class="box-title">{Lang::T('Voucher Activation')}</h3>
</div>
<div class="box-body">
<form method="post" role="form" class="form-horizontal" action="{$_url}voucher/activation-post">
<div class="input-group">
<span class="input-group-btn">
<a class="btn btn-default"
href="{APP_URL}/scan/?back={urlencode($_url)}{urlencode("home&code=")}"><i
class="glyphicon glyphicon-qrcode"></i></a>
</span>
<input type="text" id="code" name="code" class="form-control"
placeholder="{Lang::T('Enter voucher code here')}" value="{$code}">
<span class="input-group-btn">
<button class="btn btn-primary" type="submit">{Lang::T('Recharge')}</button>
</span>
</div>
</form>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group">
<a class="btn btn-default" href="{$_url}voucher/activation">
<i class="ion ion-ios-cart"></i>
{Lang::T('Order Voucher')}
</a>
{if $_c['payment_gateway'] != 'none' or $_c['payment_gateway'] == '' }
<a href="{$_url}order/package" class="btn btn-default">
<i class="ion ion-ios-cart"></i>
{Lang::T('Order Package')}
</a>
{/if}
<div class="box box-primary box-solid mb30">
<div class="box-header">
<h3 class="box-title">{Lang::T('Voucher Activation')}</h3>
</div>
<div class="box-body">
<form method="post" role="form" class="form-horizontal" action="{$_url}voucher/activation-post">
<div class="input-group">
<span class="input-group-btn">
<a class="btn btn-default" href="{APP_URL}/scan/?back={urlencode($_url)}{urlencode("
home&code=")}"><i class="glyphicon glyphicon-qrcode"></i></a>
</span>
<input type="text" id="code" name="code" class="form-control"
placeholder="{Lang::T('Enter voucher code here')}" value="{$code}">
<span class="input-group-btn">
<button class="btn btn-primary" type="submit">{Lang::T('Recharge')}</button>
</span>
</div>
</form>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group">
<a class="btn btn-default" href="{$_url}voucher/activation">
<i class="ion ion-ios-cart"></i>
{Lang::T('Order Voucher')}
</a>
{if $_c['payment_gateway'] != 'none' or $_c['payment_gateway'] == '' }
<a href="{$_url}order/package" class="btn btn-default">
<i class="ion ion-ios-cart"></i>
{Lang::T('Order Package')}
</a>
{/if}
</div>
</div>
</div>
{/if}
</div>
</div>
{if isset($hostname) && $hchap == 'true' && $_c['hs_auth_method'] == 'hchap'}
<script type="text/javascript" src="/ui/ui/scripts/md5.js"></script>
<script type="text/javascript">
var hostname = "http://{$hostname}/login";
var user = "{$_user['username']}";
var pass = "{$_user['password']}";
var dst = "{$apkurl}";
var authdly = "2";
var key = hexMD5('{$key1}' + pass + '{$key2}');
var auth = hostname + '?username=' + user + '&dst=' + dst + '&password=' + key;
document.write('<meta http-equiv="refresh" target="_blank" content="' + authdly + '; url=' + auth + '">');
</script>
<script type="text/javascript" src="/ui/ui/scripts/md5.js"></script>
<script type="text/javascript">
var hostname = "http://{$hostname}/login";
var user = "{$_user['username']}";
var pass = "{$_user['password']}";
var dst = "{$apkurl}";
var authdly = "2";
var key = hexMD5('{$key1}' + pass + '{$key2}');
var auth = hostname + '?username=' + user + '&dst=' + dst + '&password=' + key;
document.write('<meta http-equiv="refresh" target="_blank" content="' + authdly + '; url=' + auth + '">');
</script>
{/if}
{include file="user-ui/footer.tpl"}

51
ui/ui/user-ui/error.tpl Normal file
View File

@ -0,0 +1,51 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>{ucwords(Lang::T("Error"))} - {$_c['CompanyName']}</title>
<meta content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" name="viewport">
<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">
</head>
<body class="hold-transition lockscreen">
<div class="lockscreen-wrapper">
<div class="panel panel-danger">
<div class="panel-heading">{ucwords(Lang::T("Internal Error"))}</div>
<div class="panel-body">
{Lang::T("Sorry, the software failed to process the request, if it still happening, please tell")}
{$_c['CompanyName']}
</div>
<div class="panel-footer">
<a href="{$url}" id="button" class="btn btn-danger btn-block">{Lang::T('Try Again')}</a>
</div>
</div>
<div class="lockscreen-footer text-center">
{$_c['CompanyName']}
</div>
</div>
{if $_c['tawkto'] != ''}
<!--Start of Tawk.to Script-->
<script type="text/javascript">
var Tawk_API = Tawk_API || {},
Tawk_LoadStart = new Date();
(function() {
var s1 = document.createElement("script"),
s0 = document.getElementsByTagName("script")[0];
s1.async = true;
s1.src='https://embed.tawk.to/{$_c['tawkto']}';
s1.charset = 'UTF-8';
s1.setAttribute('crossorigin', '*');
s0.parentNode.insertBefore(s1, s0);
})();
</script>
<!--End of Tawk.to Script-->
{/if}
</body>
</html>

View File

@ -71,6 +71,36 @@
<!--End of Tawk.to Script-->
{/if}
<script>
const toggleIcon = document.getElementById('toggleIcon');
const body = document.body;
const savedMode = localStorage.getItem('mode');
if (savedMode === 'dark') {
body.classList.add('dark-mode');
toggleIcon.textContent = '🌜';
}
function setMode(mode) {
if (mode === 'dark') {
body.classList.add('dark-mode');
toggleIcon.textContent = '🌜';
} else {
body.classList.remove('dark-mode');
toggleIcon.textContent = '🌞';
}
}
toggleIcon.addEventListener('click', () => {
if (body.classList.contains('dark-mode')) {
setMode('light');
localStorage.setItem('mode', 'light');
} else {
setMode('dark');
localStorage.setItem('mode', 'dark');
}
});
</script>
{literal}
<script>
var listAtts = document.querySelectorAll(`[api-get-text]`);

View File

@ -178,7 +178,7 @@
}
.content .row [class*=col-] .box {
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
box-shadow: 4px 4px 30px rgba(221, 224, 255, .54);
-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
-ms-box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
@ -215,16 +215,19 @@
background: transparent;
background-color: transparent;
}
.box.box-solid.box-primary>.box-header {
color: inherit;
background-color: transparent;
border-color: transparent;
}
.box.box-solid.box-info>.box-header {
color: inherit;
background-color: transparent;
border-color: transparent;
}
.box.box-solid.box-danger>.box-header {
color: inherit;
background-color: transparent;
@ -246,6 +249,25 @@
box-shadow: 0px 4px 30px rgba(221, 224, 255, .54);
}
.modern-skin-dark .main-sidebar .sidebar .sidebar-menu li>a {
font-weight: bold;
}
.content-header>h1 {
font-weight: bold;
}
.box-header>.fa,
.box-header>.glyphicon,
.box-header>.ion,
.box-header .box-title {
font-weight: bold;
}
.main-header .logo .logo-lg {
font-weight: bold;
}
/* New Customize Interface End Here */
::-moz-selection {
@ -306,6 +328,430 @@
margin: 0;
padding: 10px;
}
.toggle-container {
cursor: pointer;
}
.toggle-container .toggle-icon {
font-size: 25px;
color: rgb(100 116 139);
transition: color 0.5s ease;
}
@media (max-width: 600px) {
.toggle-container .toggle-icon {
font-size: 20px;
color: rgb(100 116 139);
transition: color 0.5s ease;
}
}
/* dark mode styles start here */
.dark-mode {
background-color: #1a202c;
color: #cbd5e0;
}
.dark-mode .main-header .logo,
.dark-mode .main-header .navbar,
.dark-mode .main-sidebar,
.dark-mode .main-sidebar .sidebar,
.dark-mode .sidebar-menu li>a {
background-color: #0e1219;
color: #cbd5e0;
}
.dark-mode .sidebar-menu li:hover,
.dark-mode .sidebar-menu li:focus {
color: #10d435;
}
.dark-mode .main-sidebar .sidebar .sidebar-menu li.active a {
background-color: #2e298e;
}
.dark-mode .content,
.dark-mode .content-header,
.dark-mode .content-wrapper,
.dark-mode .right-side {
background-color: #0e1219;
}
.dark-mode .main-footer {
background-color: #1a202c;
color: #cbd5e0;
}
.dark-mode .panel,
.dark-mode .box {
background-color: #2d3748;
border-color: #4a5568;
box-shadow: none;
}
.dark-mode .panel-heading,
.dark-mode .box-header {
background-color: transparent;
color: #cbd5e0;
}
.dark-mode .box-footer,
.dark-mode .panel-footer {
background-color: #2d3748;
}
.dark-mode .search-container {
background-color: #2d3748;
color: #cbd5e0;
}
.dark-mode .searchTerm {
background-color: #4a5568;
color: #cbd5e0;
}
.dark-mode .cancelButton {
background-color: #e53e3e;
}
.dark-mode .notification-top-bar {
background-color: #742a2a;
}
.dark-mode .bs-callout {
background-color: #2d3748;
border-color: #4a5568;
color: #cbd5e0;
}
.dark-mode .bs-callout h4 {
color: #cbd5e0;
}
.dark-mode .bg-gray {
background-color: inherit !important;
}
.dark-mode .breadcrumb {
padding: 8px 15px;
margin-bottom: 20px;
list-style: none;
background-color: rgba(221, 224, 255, .54);
border-radius: 4px;
}
.dark-mode .pagination>.disabled>span,
.dark-mode .pagination>.disabled>span:hover,
.dark-mode .pagination>.disabled>span:focus,
.dark-mode .pagination>.disabled>a,
.dark-mode .pagination>.disabled>a:hover,
.dark-mode .pagination>.disabled>a:focus {
color: inherit;
background-color: rgba(221, 224, 255, .54);
border-color: rgba(221, 224, 255, .54);
cursor: not-allowed;
}
.dark-mode .pagination>.active>a,
.dark-mode .pagination>.active>a:hover,
.dark-mode .pagination>.active>a:focus,
.dark-mode .pagination>.active>span,
.dark-mode .pagination>.active>span:hover,
.dark-mode .pagination>.active>span:focus {
z-index: 2;
color: #fff;
background-color: #435ebe;
border-color: rgba(221, 224, 255, .54);
box-shadow: 0 2px 5px rgba(67, 94, 190, .3);
cursor: default;
}
.dark-mode .pagination>li>a {
background: inherit;
color: inherit;
border: 1px solid;
border-color: rgba(221, 224, 255, .54);
}
.dark-mode .table {
background-color: inherit;
color: #ddd;
border-color: #444;
}
.dark-mode .table th,
.dark-mode .table td {
background-color: inherit;
border-color: inherit;
color: #ddd;
}
.dark-mode .table th {
background-color: inherit;
font-weight: bold;
}
.dark-mode .table-striped tbody tr:nth-of-type(odd) {
background-color: inherit;
}
.dark-mode .table-bordered {
border: 1px solid #444;
}
.dark-mode .table-hover tbody tr:hover {
background-color: #555;
color: #fff;
}
.dark-mode .table-condensed th,
.dark-mode .table-condensed td {
padding: 8px;
}
.dark-mode .panel>.table:last-child,
.dark-mode .panel>.table-responsive:last-child>.table:last-child {
border-bottom-right-radius: 21px;
border-bottom-left-radius: 21px;
}
.dark-mode .panel>.table:last-child>tbody:last-child>tr:last-child,
.dark-mode .panel>.table:last-child>tfoot:last-child>tr:last-child,
.dark-mode .panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child,
.dark-mode .panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child {
border-bottom-right-radius: 21px;
border-bottom-left-radius: 21px;
}
.dark-mode .panel>.table:last-child>tbody:last-child>tr:last-child td:last-child,
.dark-mode .panel>.table:last-child>tbody:last-child>tr:last-child th:last-child,
.dark-mode .panel>.table:last-child>tfoot:last-child>tr:last-child td:last-child,
.dark-mode .panel>.table:last-child>tfoot:last-child>tr:last-child th:last-child,
.dark-mode .panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child td:last-child,
.dark-mode .panel>.table-responsive:last-child>.table:last-child>tbody:last-child>tr:last-child th:last-child,
.dark-mode .panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child td:last-child,
.dark-mode .panel>.table-responsive:last-child>.table:last-child>tfoot:last-child>tr:last-child th:last-child {
border-bottom-right-radius: 21px;
}
.dark-mode .help-block {
display: block;
margin-top: 5px;
margin-bottom: 10px;
color: inherit;
}
.dark-mode .text-muted {
color: rgba(221, 224, 255, .54);
}
.dark-mode .form-control {
display: block;
width: 100%;
padding: 6px 12px;
font-size: 14px;
line-height: 1.428571429;
color: inherit;
background-color: transparent;
background-image: none;
border: 1px solid;
border-color: rgba(221, 224, 255, .54);
border-radius: 4px;
-webkit-box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
box-shadow: inset 0 1px 1px rgba(0, 0, 0, .075);
-webkit-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
-o-transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
transition: border-color ease-in-out .15s, box-shadow ease-in-out .15s;
}
.dark-mode .main-footer {
border-top: 1px solid transparent;
}
.dark-mode .box.box-solid.box-primary>.box-header {
color: #fff;
background-color: inherit;
border-color: rgba(221, 224, 255, .54);
border-top-left-radius: 45px;
border-top-right-radius: 45px;
}
.dark-mode .box-body {
border-radius: 0px;
padding: 10px;
}
.dark-mode .box-header {
display: block;
padding: 10px;
position: relative;
border-color: transparent;
border-radius: 0px;
}
.dark-mode .nav-stacked>li>a {
color: inherit;
}
.dark-mode .list-group-item {
position: relative;
display: block;
padding: 10px 15px;
margin-bottom: -1px;
background-color: transparent;
border: 1px solid rgba(221, 224, 255, .54);
}
.dark-mode .panel-footer {
padding: 10px 15px;
border-top: 1px rgba(221, 224, 255, .54);
border-bottom-right-radius: 3px;
border-bottom-left-radius: 3px;
}
.dark-mode .content .row [class*=col-] .box {
-webkit-box-shadow: 0 1px 1px rgba(0, 0, 0, .05);
box-shadow: 4px 4px 30px rgba(221, 224, 255, .54);
-moz-box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
-ms-box-shadow: 0 1px 1px rgba(0, 0, 0, .1);
-webkit-border-radius: 1px !important;
-moz-border-radius: 1px !important;
-ms-border-radius: 1px !important;
border-radius: 15px !important;
border-color: inherit;
background-color: inherit;
}
/* Dark Mode - Input Fields */
.dark-mode input:not(#filterNavigateMenu),
.dark-mode textarea:not(#filterNavigateMenu),
.dark-mode select:not(#filterNavigateMenu),
.dark-mode .select2-selection:not(#filterNavigateMenu) {
color: inherit;
transition: all .5s ease-in-out;
}
.dark-mode input:focus:not(#filterNavigateMenu),
.dark-mode textarea:focus:not(#filterNavigateMenu),
.dark-mode select:focus:not(#filterNavigateMenu),
.dark-mode .select2-selection:focus:not(#filterNavigateMenu) {
color: #1f201f;
outline: none;
}
.dark-mode .input-group .form-control {
position: relative;
z-index: 2;
float: left;
width: 100%;
margin-bottom: 0;
color: inherit;
border-color: rgba(221, 224, 255, .54);
background-color: inherit;
}
.dark-mode .input-group .input-group-addon {
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 0;
color: inherit;
border-bottom-left-radius: 0;
border-color: rgba(221, 224, 255, .54);
background-color: transparent;
}
.dark-mode .input-group .form-control:last-child,
.dark-mode .input-group-addon:last-child,
.dark-mode .input-group-btn:last-child>.btn,
.dark-mode .input-group-btn:last-child>.btn-group>.btn,
.dark-mode .input-group-btn:last-child>.dropdown-toggle,
.dark-mode .input-group-btn:first-child>.btn:not(:first-child),
.dark-mode .input-group-btn:first-child>.btn-group:not(:first-child)>.btn {
color: inherit;
}
.dark-mode input:not(#filterNavigateMenu),
textarea:not(#filterNavigateMenu),
optgroup:not(#filterNavigateMenu),
select:not(#filterNavigateMenu),
.dark-mode .select2-selection:not(#filterNavigateMenu) {
-moz-transition: all .5s ease-in-out;
-o-transition: all .5s ease-in-out;
-webkit-transition: all .5s ease-in-out;
transition: all .5s ease-in-out;
}
.dark-mode .modern-skin-dark .main-sidebar .sidebar .sidebar-menu li>a {
font-weight: bold;
}
.dark-mode .content-header>h1 {
font-weight: bold;
}
.dark-mode .box-header>.fa,
.dark-mode .box-header>.glyphicon,
.dark-mode .box-header>.ion,
.dark-mode .box-header .box-title {
font-weight: bold;
}
.dark-mode .content-header>h2 {
font-weight: bold;
}
.dark-mode .main-header .logo .logo-lg {
font-weight: bold;
}
.dark-mode .modal-content {
border-top-left-radius: 0;
border-top-right-radius: 0;
border-bottom-right-radius: 15px;
border-bottom-left-radius: 15px;
-webkit-box-shadow: 0 2px 3px rgba(0, 0, 0, .125);
box-shadow: 0 2px 3px rgba(0, 0, 0, .125);
border: 0;
background: #1a202c;
}
.dark-mode .modal-header {
padding: 15px;
border-bottom: 1px solid rgba(221, 224, 255, .54);
min-height: 16.428571429px;
background-color: #1a202c;
color: inherit;
}
.dark-mode .navbar-nav>.notifications-menu>.dropdown-menu>li .menu>li>a,
.dark-mode .navbar-nav>.messages-menu>.dropdown-menu>li .menu>li>a,
.dark-mode .navbar-nav>.tasks-menu>.dropdown-menu>li .menu>li>a {
display: block;
white-space: nowrap;
border-bottom: 1px solid rgba(221, 224, 255, .54);
background: #1a202c;
color: inherit;
}
.dark-mode .navbar-nav>.notifications-menu>.dropdown-menu>li.footer>a,
.dark-mode .navbar-nav>.messages-menu>.dropdown-menu>li.footer>a,
.dark-mode .navbar-nav>.tasks-menu>.dropdown-menu>li.footer>a {
background: #1a202c !important;
color: inherit !important;
}
.dark-mode .navbar-nav>.user-menu>.dropdown-menu>.user-footer {
background-color: #1a202c;
}
</style>
{if isset($xheader)}
@ -327,9 +773,14 @@
</a>
<div class="navbar-custom-menu">
<ul class="nav navbar-nav">
<li>
<a class="toggle-container" href="#">
<i class="toggle-icon" id="toggleIcon">🌞</i>
</a>
</li>
<li class="dropdown tasks-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="true">
<i class="fa fa-flag-o"></i> <span class="d-none d-sm-inline">{ucwords($user_language)}</span>
<i class="fa fa-flag-o"></i>
</a>
<ul class="dropdown-menu">
<li>
@ -422,7 +873,7 @@
<li {if $_system_menu eq 'voucher'}class="active" {/if}>
<a href="{$_url}voucher/activation">
<i class="fa fa-ticket"></i>
<span>{Lang::T('Voucher')}</span>
<span>Voucher</span>
</a>
</li>
{/if}
@ -485,4 +936,4 @@
}
});
</script>
{/if}
{/if}

View File

@ -14,7 +14,7 @@
{if Text::is_html($mail['body'])}
{$mail['body']}
{else}
{nl2br($mail['body'])}
{nl2br(htmlspecialchars_decode($mail['body']))}
{/if}
</div>
</div>
@ -29,10 +29,11 @@
{Lang::T("Next")}</a>
{/if}
</div>
<a href="{$_url}mail" class="btn btn-primary"><i class="fa fa-arrow-left"></i> {Lang::T("Back")}</a>
<a href="{$_url}mail/delete/{$mail['id']}" class="btn btn-danger"
onclick="return confirm('{Lang::T("Delete")}?')"><i class="fa fa-trash-o"></i>
{Lang::T("Delete")}</a>
<a href="https://api.whatsapp.com/send?text={if Text::is_html($mail['body'])}{urlencode(strip_tags($mail['body']))}{else}{urlencode($mail['body'])}{/if}" class="btn btn-primary"><i class="fa fa-share"></i> {Lang::T("Share")}</a>
<a href="https://api.whatsapp.com/send?text={if Text::is_html($mail['body'])}{urlencode(strip_tags($mail['body']))}{else}{urlencode($mail['body'])}{/if}" class="btn btn-success"><i class="fa fa-share"></i> {Lang::T("Share")}</a>
</div>
<!-- /.box-footer -->
</div>

View File

@ -3,35 +3,36 @@
<div class="row">
<div class="col-sm-12">
{if $_c['enable_balance'] == 'yes'}
<div class="box box-solid box-success bg-gray-light">
<div class="box-header">{Lang::T('Balance Plans')}</div>
<div class="box-body row">
{foreach $plans_balance as $plan}
<div class="col col-md-4">
<div class="box box-solid box-default">
<div class="box-header text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
</tbody>
</table>
</div>
<div class="box-body">
<a href="{$_url}order/gateway/0/{$plan['id']}"
onclick="return confirm('{Lang::T('Buy Balance')}?')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy')}</a>
</div>
<div class="box box-solid box-success bg-gray-light">
<div class="box-header">{Lang::T('Buy Balance Plans')}</div>
<div class="box-body row">
{foreach $plans_balance as $plan}
<div class="col col-md-4">
<div class="box box-solid box-default">
<div class="box-header text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
</tbody>
</table>
</div>
</div>
{/foreach}
<div class="box-body">
<a href="{$_url}order/gateway/0/{$plan['id']}"
onclick="return confirm('{Lang::T('Buy Balance')}?')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy')}</a>
</div>
</div>
</div>
{/foreach}
</div>
</div>
{/if}
</div>
</div>
</div>
{include file="user-ui/footer.tpl"}
{include file="user-ui/footer.tpl"}

View File

@ -11,14 +11,14 @@
<thead>
<tr>
<th>{Lang::T('Plan Name')}</th>
<th>{Lang::T('Gateway')}</th>
<th>{Lang::T('Routers')}</th>
<th>{Lang::T('Payment Method')}</th>
<th>Routers</th>
<th>{Lang::T('Type')}</th>
<th>{Lang::T('Plan Price')}</th>
<th>{Lang::T('Created On')}</th>
<th>{Lang::T('Expires On')}</th>
<th>{Lang::T('Date Done')}</th>
<th>{Lang::T('Method')}</th>
<th>{Lang::T('Created on')}</th>
<th>{Lang::T('Expires on')}</th>
<th>{Lang::T('Date')}</th>
<th>{Lang::T('Status')}</th>
</tr>
</thead>
<tbody>
@ -53,4 +53,4 @@
</div>
{include file="user-ui/footer.tpl"}
{include file="user-ui/footer.tpl"}

View File

@ -6,419 +6,551 @@
<div class="box-header">{Lang::T('Order Internet Package')}</div>
</div>
{if $_c['radius_enable']}
{if $_user['service_type'] == 'PPPoE'}
{if Lang::arrayCount($radius_pppoe)>0}
<ol class="breadcrumb">
<li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li>
<li>{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}</li>
</ol>
<div class="row">
{foreach $radius_pppoe as $plan}
<div class="col col-md-4">
<div class="box box-primary">
<div class="box-header text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/radius/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-warning text-black">{Lang::T('Buy')}</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/radius/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/send/radius/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
</div>
</div>
{/foreach}
{if $_user['service_type'] == 'PPPoE'}
{if Lang::arrayCount($radius_pppoe)>0}
<ol class="breadcrumb">
<li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li>
<li>{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}</li>
</ol>
<div class="row">
{foreach $radius_pppoe as $plan}
<div class="col col-md-4">
<div class="box box-primary">
<div class="box-header text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
</div>
{/if}
{elseif $_user['service_type'] == 'Hotspot'}
{if Lang::arrayCount($radius_hotspot)>0}
<ol class="breadcrumb">
<li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li>
<li>{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}</li>
</ol>
<div class="row">
{foreach $radius_hotspot as $plan}
<div class="col col-md-4">
<div class="box box-primary">
<div class="box-header text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/radius/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-warning text-black">{Lang::T('Buy')}</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/radius/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/send/radius/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
</div>
</div>
{/foreach}
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/radius/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-warning text-black">{Lang::T('Buy')}</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/radius/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
$_user['balance']>=$plan['price']}
<a href="{$_url}order/send/radius/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
{/if}
{elseif $_user['service_type'] == 'Others' || $_user['service_type'] == '' && (Lang::arrayCount($radius_pppoe)>0 || Lang::arrayCount($radius_hotspot)>0)}
<ol class="breadcrumb">
<li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li>
<li>{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}</li>
</ol>
{if Lang::arrayCount($radius_pppoe)>0}
<div class="row">
{foreach $radius_pppoe as $plan}
<div class="col col-md-4">
<div class="box box-primary">
<div class="box-header text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/pppoe/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this? your active package will be overwritten')}')"
class="btn btn-sm btn-block btn-warning text-black">{Lang::T('Buy')}</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/pppoe/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwritten')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/send/pppoe/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
</div>
</div>
{/foreach}
</div>
</div>
{/foreach}
</div>
{/if}
{elseif $_user['service_type'] == 'Hotspot'}
{if Lang::arrayCount($radius_hotspot)>0}
<ol class="breadcrumb">
<li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li>
<li>{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}</li>
</ol>
<div class="row">
{foreach $radius_hotspot as $plan}
<div class="col col-md-4">
<div class="box box-primary">
<div class="box-header text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
</div>
{/if}
{if Lang::arrayCount($radius_hotspot)>0}
<ol class="breadcrumb">
<li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li>
<li>{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}</li>
</ol>
<div class="row">
{foreach $radius_hotspot as $plan}
<div class="col col-md-4">
<div class="box box-primary">
<div class="box-header text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/hotspot/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this? your active package will be overwritten')}')"
class="btn btn-sm btn-block btn-warning text-black">{Lang::T('Buy')}</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/hotspot/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwritten')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/send/hotspot/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
</div>
</div>
{/foreach}
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/radius/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-warning text-black">{Lang::T('Buy')}</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/radius/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
$_user['balance']>=$plan['price']}
<a href="{$_url}order/send/radius/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
{/if}
{/if}
</div>
</div>
{/foreach}
</div>
{/if}
{elseif $_user['service_type'] == 'Others' || $_user['service_type'] == '' && (Lang::arrayCount($radius_pppoe)>0
|| Lang::arrayCount($radius_hotspot)>0)}
<ol class="breadcrumb">
<li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li>
<li>{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}</li>
</ol>
{if Lang::arrayCount($radius_pppoe)>0}
<div class="row">
{foreach $radius_pppoe as $plan}
<div class="col col-md-4">
<div class="box box-primary">
<div class="box-header text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/pppoe/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this? your active package will be overwritten')}')"
class="btn btn-sm btn-block btn-warning text-black">{Lang::T('Buy')}</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/pppoe/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwritten')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
$_user['balance']>=$plan['price']}
<a href="{$_url}order/send/pppoe/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
</div>
</div>
{/foreach}
</div>
{/if}
{if Lang::arrayCount($radius_hotspot)>0}
<ol class="breadcrumb">
<li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li>
<li>{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}</li>
</ol>
<div class="row">
{foreach $radius_hotspot as $plan}
<div class="col col-md-4">
<div class="box box-primary">
<div class="box-header text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/hotspot/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this? your active package will be overwritten')}')"
class="btn btn-sm btn-block btn-warning text-black">{Lang::T('Buy')}</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/hotspot/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwritten')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
$_user['balance']>=$plan['price']}
<a href="{$_url}order/send/hotspot/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
</div>
</div>
{/foreach}
</div>
{/if}
{/if}
{/if}
{foreach $routers as $router}
{if Validator::isRouterHasPlan($plans_hotspot, $router['name']) || Validator::isRouterHasPlan($plans_pppoe, $router['name'])}
<div class="box box-solid box-primary bg-gray">
<div class="box-header text-white text-bold">{$router['name']}</div>
{if $router['description'] != ''}
<div class="box-body">
{$router['description']}
</div>
{/if}
{if $_user['service_type'] == 'Hotspot' && Validator::countRouterPlan($plans_hotspot, $router['name'])>0}
<div class="box-header text-white">{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}
</div>
<div class="box-body row">
{foreach $plans_hotspot as $plan}
{if $router['name'] eq $plan['routers']}
<div class="col col-md-4">
<div class="box box-primary">
<div class="box-header text-center text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-warning text-black">{Lang::T('Buy')}</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/send/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
</div>
</div>
{/if}
{/foreach}
</div>
{/if}
{if $_user['service_type'] == 'PPPoE' && Validator::countRouterPlan($plans_pppoe,$router['name'])>0}
<div class="box-header text-white">{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}</div>
<div class="box-body row">
{foreach $plans_pppoe as $plan}
{if $router['name'] eq $plan['routers']}
<div class="col col-md-4">
<div class="box box- box-primary">
<div class="box-header text-bold text-center">{$plan['name_plan']}</div>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-warning text-black">{Lang::T('Buy')}</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/send/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
</div>
</div>
{/if}
{/foreach}
</div>
{/if}
{if $_user['service_type'] == 'Others' || $_user['service_type'] == '' && (Validator::countRouterPlan($plans_hotspot, $router['name'])>0 || Validator::countRouterPlan($plans_pppoe, $router['name'])>0)}
<div class="box-header text-white">{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}
</div>
<div class="box-body row">
{foreach $plans_hotspot as $plan}
{if $router['name'] eq $plan['routers']}
<div class="col col-md-4">
<div class="box box-primary">
<div class="box-header text-center text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-warning text-black">{Lang::T('Buy')}</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/send/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
</div>
</div>
{/if}
{/foreach}
</div>
<div class="box-header text-white">{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}</div>
<div class="box-body row">
{foreach $plans_pppoe as $plan}
{if $router['name'] eq $plan['routers']}
<div class="col col-md-4">
<div class="box box- box-primary">
<div class="box-header text-bold text-center">{$plan['name_plan']}</div>
<div class="table-responsive">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-warning text-black">{Lang::T('Buy')}</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/send/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
</div>
</div>
{/if}
{/foreach}
</div>
{/if}
</div>
{if Validator::isRouterHasPlan($plans_hotspot, $router['name']) || Validator::isRouterHasPlan($plans_pppoe,
$router['name']) || Validator::isRouterHasPlan($plans_vpn,
$router['name'])}
<div class="box box-solid box-primary bg-gray">
<div class="box-header text-white text-bold">{$router['name']}</div>
{if $router['description'] != ''}
<div class="box-body">
{$router['description']}
</div>
{/if}
{if $_user['service_type'] == 'Hotspot' && Validator::countRouterPlan($plans_hotspot, $router['name'])>0}
<div class="box-header text-white">{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}
</div>
<div class="box-body row">
{foreach $plans_hotspot as $plan}
{if $router['name'] eq $plan['routers']}
<div class="col col-md-4">
<div class="box box-primary">
<div class="box-header text-center text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-warning text-black">{Lang::T('Buy')}</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
$_user['balance']>=$plan['price']}
<a href="{$_url}order/send/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
</div>
</div>
{/if}
{/foreach}
</div>
{/if}
{if $_user['service_type'] == 'PPPoE' && Validator::countRouterPlan($plans_pppoe,$router['name'])>0}
<div class="box-header text-white">{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}</div>
<div class="box-body row">
{foreach $plans_pppoe as $plan}
{if $router['name'] eq $plan['routers']}
<div class="col col-md-4">
<div class="box box- box-primary">
<div class="box-header text-bold text-center">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-warning text-black">{Lang::T('Buy')}</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
$_user['balance']>=$plan['price']}
<a href="{$_url}order/send/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
</div>
</div>
{/if}
{/foreach}
</div>
{/if}
{if $_user['service_type'] == 'VPN' && Validator::countRouterPlan($plans_vpn,$router['name'])>0}
<div class="box-header text-white">{if $_c['vpn_plan']==''}VPN Plan{else}{$_c['vpn_plan']}{/if}</div>
<div class="box-body row">
{foreach $plans_vpn as $plan}
{if $router['name'] eq $plan['routers']}
<div class="col col-md-4">
<div class="box box- box-primary">
<div class="box-header text-bold text-center">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-warning text-black">{Lang::T('Buy')}</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
$_user['balance']>=$plan['price']}
<a href="{$_url}order/send/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
</div>
</div>
{/if}
{/foreach}
</div>
{/if}
{if $_user['service_type'] == 'Others' || $_user['service_type'] == '' &&
(Validator::countRouterPlan($plans_hotspot, $router['name'])>0 || Validator::countRouterPlan($plans_pppoe,
$router['name'])>0 || Validator::countRouterPlan($plans_vpn,
$router['name'])>0)}
<div class="box-header text-white">{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}
</div>
<div class="box-body row">
{foreach $plans_hotspot as $plan}
{if $router['name'] eq $plan['routers']}
<div class="col col-md-4">
<div class="box box-primary">
<div class="box-header text-center text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-warning text-black">{Lang::T('Buy')}</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
$_user['balance']>=$plan['price']}
<a href="{$_url}order/send/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
</div>
</div>
{/if}
{/foreach}
</div>
<div class="box-header text-white">{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}</div>
<div class="box-body row">
{foreach $plans_pppoe as $plan}
{if $router['name'] eq $plan['routers']}
<div class="col col-md-4">
<div class="box box- box-primary">
<div class="box-header text-bold text-center">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-warning text-black">{Lang::T('Buy')}</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
$_user['balance']>=$plan['price']}
<a href="{$_url}order/send/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
</div>
</div>
{/if}
{/foreach}
</div>
<div class="box-header text-white">{if $_c['vpn_plan']==''}VPN Plan{else}{$_c['vpn_plan']}{/if}</div>
<div class="box-body row">
{foreach $plans_vpn as $plan}
{if $router['name'] eq $plan['routers']}
<div class="col col-md-4">
<div class="box box- box-primary">
<div class="box-header text-bold text-center">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Type')}</td>
<td>{$plan['type']}</td>
</tr>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="box-body">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="{$_url}order/gateway/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-warning text-black">{Lang::T('Buy')}</a>
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
<a href="{$_url}order/pay/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Pay this with Balance? your active package will be overwrite')}')"
class="btn btn-sm btn-block btn-success">{Lang::T('Pay With Balance')}</a>
{/if}
</div>
{if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' &&
$_user['balance']>=$plan['price']}
<a href="{$_url}order/send/{$router['id']}/{$plan['id']}&stoken={App::getToken()}"
onclick="return confirm('{Lang::T('Buy this for friend account?')}')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy for friend')}</a>
{/if}
</div>
</div>
</div>
{/if}
{/foreach}
</div>
{/if}
</div>
{/if}
{/foreach}
</div>
</div>
{include file="user-ui/footer.tpl"}
{include file="user-ui/footer.tpl"}

View File

@ -5,7 +5,7 @@
<div class="col-md-6">
<div
class="panel mb20 {if $trx['status']==1}panel-warning{elseif $trx['status']==2}panel-success{elseif $trx['status']==3}panel-danger{elseif $trx['status']==4}panel-danger{else}panel-primary{/if} panel-hovered">
<div class="panel-footer">Transaction #{$trx['id']}</div>
<div class="panel-footer">{Lang::T('Transaction')} #{$trx['id']}</div>
{if !in_array($trx['routers'],['balance','radius'])}
<div class="panel-body">
<div class="panel panel-primary panel-hovered">
@ -120,7 +120,7 @@
{/if}
{/if}
<tr>
<td>{Lang::T('Plan Validity')}</td>
<td>{Lang::T('Validity Periode')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
<tr>
@ -134,15 +134,15 @@
{/if}
</div>
{if $trx['status']==1}
<div class="panel-footer ">
<div class="panel-footer">
<div class="btn-group btn-group-justified">
<a href="{$trx['pg_url_payment']}" {if $trx['gateway']=='midtrans'} target="_blank" {/if}
class="btn btn-primary">{Lang::T('PAY NOW')}</a>
class="btn btn-primary">{Lang::T('Pay Now')}</a>
<a href="{$_url}order/view/{$trx['id']}/check"
class="btn btn-info">{Lang::T('Check for Payment')}</a>
</div>
</div>
<div class="panel-footer ">
<div class="panel-footer">
<a href="{$_url}order/view/{$trx['id']}/cancel" class="btn btn-danger"
onclick="return confirm('{Lang::T('Cancel it?')}')">{Lang::T('Cancel')}</a>
</div>
@ -150,4 +150,4 @@
</div>
</div>
</div>
{include file="user-ui/footer.tpl"}
{include file="user-ui/footer.tpl"}

View File

@ -4,9 +4,8 @@
<div class="row">
<div class="col-sm-12 col-md-12">
<div class="panel panel-primary panel-hovered panel-stacked mb30">
<div class="panel-heading">{Lang::T('Edit User')}</div>
<div class="panel-heading">{Lang::T('Data Change')}</div>
<div class="panel-body">
<form class="form-horizontal" method="post" role="form" action="{$_url}accounts/edit-profile-post">
<input type="hidden" name="id" value="{$_user['id']}">
<div class="form-group">
@ -21,7 +20,7 @@
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Full Name')}</label>
<label class="col-md-2 control-label">{Lang::T('Full name')}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="fullname" name="fullname"
value="{$_user['fullname']}">
@ -36,25 +35,25 @@
</div>
{if $_c['allow_phone_otp'] != 'yes'}
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Phone Number')}</label>
<label class="col-md-2 control-label">{Lang::T('Phone number')}</label>
<div class="col-md-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">+</span>
<input type="text" class="form-control" name="phonenumber" id="phonenumber"
value="{$_user['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')}">
</div>
</div>
</div>
{else}
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Phone Number')}</label>
<label class="col-md-2 control-label">{Lang::T('Phone number')}</label>
<div class="col-md-6">
<div class="input-group">
<span class="input-group-addon" id="basic-addon1">+</span>
<input type="text" class="form-control" name="phonenumber" id="phonenumber"
value="{$_user['phonenumber']}" readonly
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')}">
<span class="input-group-btn">
<a href="{$_url}accounts/phone-update" type="button"
class="btn btn-info btn-flat">{Lang::T('Change')}</a>
@ -63,7 +62,6 @@
</div>
</div>
{/if}
{if $_c['allow_email_otp'] != 'yes'}
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Email')}</label>
@ -87,7 +85,6 @@
</div>
</div>
{/if}
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<button class="btn btn-success" type="submit">
@ -96,10 +93,9 @@
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{include file="user-ui/footer.tpl"}
{include file="user-ui/footer.tpl"}

View File

@ -112,10 +112,10 @@
</div>
<div class="btn-group btn-group-justified mb15">
<div class="btn-group">
<button class="btn btn-primary" type="submit">{Lang::T('Register')}</button>
<a href="{$_url}register" class="btn btn-success">{Lang::T('Cancel')}</a>
</div>
<div class="btn-group">
<a href="{$_url}register" class="btn btn-success">{Lang::T('Cancel')}</a>
<button class="btn btn-primary" type="submit">{Lang::T('Register')}</button>
</div>
</div>
<br>

View File

@ -41,7 +41,7 @@
{/if}
<li class="list-group-item">
<b>{Lang::T('Type')}</b> <span class="pull-right">{if $plan['prepaid'] eq
'yes'}Prepaid{else}Postpaid
'yes'}{Lang::T('Prepaid')}{else}{Lang::T('Postpaid')}
{/if}
{$plan['type']}</span>
</li>
@ -54,7 +54,7 @@
</li>
{if $plan['validity']}
<li class="list-group-item">
<b>{Lang::T('Plan Validity')}</b> <span class="pull-right">{$plan['validity']}
<b>{Lang::T('Validity Periode')}</b> <span class="pull-right">{$plan['validity']}
{$plan['validity_unit']}</span>
</li>
{/if}

View File

@ -38,7 +38,7 @@
{Lang::moneyFormat($plan['price'])}</td>
</tr>
<tr>
<td>{Lang::T('Validity')}</td>
<td>{Lang::T('Validity Periode')}</td>
<td>{$plan['validity']} {$plan['validity_unit']}</td>
</tr>
</tbody>
@ -53,7 +53,7 @@
</div>
<div class="form-group col-sm-3" align="center">
<button class="btn btn-success btn-block" id="sendBtn" type="submit" name="send"
onclick="return confirm('{Lang::T(" Are You Sure?")}')" value="plan"><i
onclick="return confirm('{Lang::T("Are You Sure?")}')" value="plan"><i
class="glyphicon glyphicon-send"></i></button>
</div>
</div>
@ -64,4 +64,4 @@
</div>
</div>
</div>
{include file="user-ui/footer.tpl"}
{include file="user-ui/footer.tpl"}

View File

@ -17,11 +17,12 @@
<div class="panel panel-hovered mb20 panel-primary">
<div class="panel-heading">
{if in_array($_admin['user_type'],['SuperAdmin','Admin'])}
<div class="btn-group pull-right">
<a class="btn btn-danger btn-xs" title="Remove used Voucher" href="{$_url}plan/remove-voucher"
onclick="return confirm('Delete all used voucher code more than 3 months?')"><span class="glyphicon glyphicon-trash"
aria-hidden="true"></span> {Lang::T('Delete')} &gt; {Lang::T('3 Months')}</a>
</div>
<div class="btn-group pull-right">
<a class="btn btn-danger btn-xs" title="Remove used Voucher" href="{$_url}plan/remove-voucher"
onclick="return confirm('Delete all used voucher code more than 3 months?')"><span
class="glyphicon glyphicon-trash" aria-hidden="true"></span> {Lang::T('Delete')} &gt; {Lang::T('3
Months')}</a>
</div>
{/if}
&nbsp;
</div>
@ -41,8 +42,8 @@
<select class="form-control" id="router" name="router">
<option value="">{Lang::T('Location')}</option>
{foreach $routers as $r}
<option value="{$r}" {if $router eq $r }selected{/if}>{$r}
</option>
<option value="{$r}" {if $router eq $r }selected{/if}>{$r}
</option>
{/foreach}
</select>
</div>
@ -50,7 +51,7 @@
<select class="form-control" id="plan" name="plan">
<option value="">{Lang::T('Plan Name')}</option>
{foreach $plans as $p}
<option value="{$p['id']}" {if $plan eq $p['id'] }selected{/if}>{$p['name_plan']}</option>
<option value="{$p['id']}" {if $plan eq $p['id'] }selected{/if}>{$p['name_plan']}</option>
{/foreach}
</select>
</div>
@ -65,7 +66,7 @@
<select class="form-control" id="customer" name="customer">
<option value="">{Lang::T('Customer')}</option>
{foreach $customers as $c}
<option value="{$c['user']}" {if $customer eq $c['user'] }selected{/if}>{$c['user']}</option>
<option value="{$c['user']}" {if $customer eq $c['user'] }selected{/if}>{$c['user']}</option>
{/foreach}
</select>
</div>
@ -76,8 +77,8 @@
class="fa fa-search"></span></button>
</div>
<div class="btn-group" role="group">
<a class="btn btn-warning btn-block" title="Clear Search Query" href="{$_url}plan/voucher/"><span
class="glyphicon glyphicon-remove-circle"></span></a>
<a class="btn btn-warning btn-block" title="Clear Search Query"
href="{$_url}plan/voucher/"><span class="glyphicon glyphicon-remove-circle"></span></a>
</div>
</div>
</div>
@ -85,24 +86,25 @@
</form>
</div>
<div class="table-responsive">
<table id="datatable" class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>ID</th>
<th>{Lang::T('Type')}</th>
<th>{Lang::T('Routers')}</th>
<th>{Lang::T('Plan Name')}</th>
<th>{Lang::T('Code Voucher')}</th>
<th>{Lang::T('Status Voucher')}</th>
<th>{Lang::T('Customer')}</th>
<th>{Lang::T('Used Date')}</th>
<th>{Lang::T('Generated By')}</th>
<th>{Lang::T('Manage')}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr {if $ds['status'] eq '1'}class="danger" {/if}>
<div style="margin-left: 5px; margin-right: 5px;">&nbsp;
<table id="datatable" class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th>ID</th>
<th>{Lang::T('Type')}</th>
<th>{Lang::T('Routers')}</th>
<th>{Lang::T('Plan Name')}</th>
<th>{Lang::T('Code Voucher')}</th>
<th>{Lang::T('Status Voucher')}</th>
<th>{Lang::T('Customer')}</th>
<th>{Lang::T('Used Date')}</th>
<th>{Lang::T('Generated By')}</th>
<th>{Lang::T('Manage')}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr {if $ds['status'] eq '1' }class="danger" {/if}>
<td>{$ds['id']}</td>
<td>{$ds['type']}</td>
<td>{$ds['routers']}</td>
@ -112,33 +114,35 @@
onmouseenter="this.style.backgroundColor = 'white';">
{$ds['code']}</td>
<td>{if $ds['status'] eq '0'} <label class="btn-tag btn-tag-success"> Not Use
</label> {else} <label class="btn-tag btn-tag-danger">Used</label>
</label> {else} <label class="btn-tag btn-tag-danger">Used</label>
{/if}</td>
<td>{if $ds['user'] eq '0'} -
{else}<a href="{$_url}customers/viewu/{$ds['user']}">{$ds['user']}</a>
{/if}</td>
<td>{if $ds['used_date']}{Lang::dateTimeFormat($ds['used_date'])}{/if}</td>
<td>{if $ds['generated_by']}
<a href="{$_url}settings/users-view/{$ds['generated_by']}">{$admins[$ds['generated_by']]}</a>
<a
href="{$_url}settings/users-view/{$ds['generated_by']}">{$admins[$ds['generated_by']]}</a>
{else} -
{/if}
</td>
<td>
{if $ds['status'] neq '1'}
<a href="{$_url}plan/voucher-view/{$ds['id']}" id="{$ds['id']}" style="margin: 0px;"
class="btn btn-success btn-xs">&nbsp;&nbsp;{Lang::T('View')}&nbsp;&nbsp;</a>
<a href="{$_url}plan/voucher-view/{$ds['id']}" id="{$ds['id']}" style="margin: 0px;"
class="btn btn-success btn-xs">&nbsp;&nbsp;{Lang::T('View')}&nbsp;&nbsp;</a>
{/if}
{if in_array($_admin['user_type'],['SuperAdmin','Admin'])}
<a href="{$_url}plan/voucher-delete/{$ds['id']}" id="{$ds['id']}" class="btn btn-danger btn-xs"
onclick="return confirm('{Lang::T('Delete')}?')"><i
class="glyphicon glyphicon-trash"></i></a>
<a href="{$_url}plan/voucher-delete/{$ds['id']}" id="{$ds['id']}"
class="btn btn-danger btn-xs" onclick="return confirm('{Lang::T('Delete')}?')"><i
class="glyphicon glyphicon-trash"></i></a>
{/if}
</td>
</tr>
{/foreach}
</tbody>
</table>
{/foreach}
</tbody>
</table>
</div>
</div>
{include file="pagination.tpl"}
</div>
{include file="sections/footer.tpl"}
{include file="sections/footer.tpl"}

188
ui/ui/vpn-add.tpl Normal file
View File

@ -0,0 +1,188 @@
{include file="sections/header.tpl"}
<div class="row">
<div class="col-sm-12 col-md-12">
<div class="panel panel-primary panel-hovered panel-stacked mb30">
<div class="panel-heading">{Lang::T('Add Service Plan')}</div>
<div class="panel-body">
<form class="form-horizontal" method="post" role="form" action="{$_url}services/vpn-add-post">
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Status')}
<a tabindex="0" class="btn btn-link btn-xs" role="button" data-toggle="popover"
data-trigger="focus" data-container="body"
data-content="Customer cannot buy disabled Plan, but admin can recharge it, use it if you want only admin recharge it">?</a>
</label>
<div class="col-md-10">
<input type="radio" checked name="enabled" value="1"> {Lang::T('Enable')}
<input type="radio" name="enabled" value="0"> {Lang::T('Disable')}
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Type')}
<a tabindex="0" class="btn btn-link btn-xs" role="button" data-toggle="popover"
data-trigger="focus" data-container="body"
data-content="Postpaid will have fix expired date">?</a>
</label>
<div class="col-md-10">
<input type="radio" name="prepaid" onclick="prePaid()" value="yes" checked> {Lang::T('Prepaid')}
<input type="radio" name="prepaid" onclick="postPaid()" value="no"> {Lang::T('Postpaid')}
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Plan Type')}
<a tabindex="0" class="btn btn-link btn-xs" role="button" data-toggle="popover"
data-trigger="focus" data-container="body"
data-content="Personal Plan will only show to personal Customer, Business plan will only show to Business Customer">?</a>
</label>
<div class="col-md-10">
<input type="radio" name="plan_type" value="Personal" checked> {Lang::T('Personal')}
<input type="radio" name="plan_type" value="Business"> {Lang::T('Business')}
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Device')}
<a tabindex="0" class="btn btn-link btn-xs" role="button" data-toggle="popover"
data-trigger="focus" data-container="body"
data-content="This Device are the logic how PHPNuxBill Communicate with Mikrotik or other Devices">?</a>
</label>
<div class="col-md-6">
<select class="form-control" id="device" name="device">
{foreach $devices as $dev}
<option value="{$dev}" {if $dev == 'MikrotikVpn'}selected{/if}>{$dev}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Plan Name')}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="name_plan" maxlength="40" name="name_plan">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label"><a
href="{$_url}bandwidth/add">{Lang::T('Bandwidth Name')}</a></label>
<div class="col-md-6">
<select id="id_bw" name="id_bw" class="form-control select2">
<option value="">{Lang::T('Select Bandwidth')}...</option>
{foreach $d as $ds}
<option value="{$ds['id']}">{$ds['name_bw']}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Plan Price')}</label>
<div class="col-md-6">
<div class="input-group">
<span class="input-group-addon">{$_c['currency_code']}</span>
<input type="number" class="form-control" name="price" required>
</div>
</div>
{if $_c['enable_tax'] == 'yes'}
{if $_c['tax_rate'] == 'custom'}
<p class="help-block col-md-4">{number_format($_c['custom_tax_rate'], 2)} % {Lang::T('Tax Rates
will be added')}</p>
{else}
<p class="help-block col-md-4">{number_format($_c['tax_rate'] * 100, 2)} % {Lang::T('Tax Rates
will be added')}</p>
{/if}
{/if}
</div>
<div class="form-group">
<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">
</div>
<div class="col-md-2">
<select class="form-control" id="validity_unit" name="validity_unit">
</select>
</div>
<p class="help-block col-md-4">{Lang::T('1 Period = 1 Month, Expires the 20th of each month')}
</p>
</div>
<div class="form-group hidden" id="expired_date">
<label class="col-md-2 control-label">{Lang::T('Expired Date')}
<a tabindex="0" class="btn btn-link btn-xs" role="button" data-toggle="popover"
data-trigger="focus" data-container="body"
data-content="Expired will be this date every month">?</a>
</label>
<div class="col-md-6">
<input type="number" class="form-control" name="expired_date" maxlength="2" value="20" min="1" max="28" step="1" >
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label"><a
href="{$_url}routers/add">{Lang::T('Router Name')}</a></label>
<div class="col-md-6">
<select id="routers" name="routers" required class="form-control select2">
<option value=''>{Lang::T('Select Routers')}</option>
{foreach $r as $rs}
<option value="{$rs['name']}">{$rs['name']}</option>
{/foreach}
</select>
<p class="help-block">{Lang::T('Cannot be change after saved')}</p>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label"><a href="{$_url}pool/add">{Lang::T('IP Pool')}</a></label>
<div class="col-md-6">
<select id="pool_name" name="pool_name" required class="form-control select2">
<option value=''>{Lang::T('Select Pool')}</option>
</select>
</div>
</div>
<div class="form-group">
<div class="col-md-offset-2 col-md-10">
<button class="btn btn-primary" type="submit">{Lang::T('Save Changes')}</button>
Or <a href="{$_url}services/pppoe">{Lang::T('Cancel')}</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
<script>
var preOpt = `<option value="Mins">{Lang::T('Mins')}</option>
<option value="Hrs">{Lang::T('Hrs')}</option>
<option value="Days">{Lang::T('Days')}</option>
<option value="Months">{Lang::T('Months')}</option>`;
var postOpt = `<option value="Period">{Lang::T('Period')}</option>`;
function prePaid() {
$("#validity_unit").html(preOpt);
$('#expired_date').addClass('hidden');
}
function postPaid() {
$("#validity_unit").html(postOpt);
$("#expired_date").removeClass('hidden');
}
document.addEventListener("DOMContentLoaded", function(event) {
prePaid()
})
</script>
{if $_c['radius_enable']}
{literal}
<script>
function isRadius(cek) {
if (cek.checked) {
document.getElementById("routers").required = false;
document.getElementById("routers").disabled = true;
$.ajax({
url: "index.php?_route=autoload/pool",
data: "routers=radius",
cache: false,
success: function(msg) {
$("#pool_name").html(msg);
}
});
} else {
document.getElementById("routers").required = true;
document.getElementById("routers").disabled = false;
}
}
</script>
{/literal}
{/if}
{include file="sections/footer.tpl"}

255
ui/ui/vpn-edit.tpl Normal file
View File

@ -0,0 +1,255 @@
{include file="sections/header.tpl"}
<form class="form-horizontal" method="post" role="form" action="{$_url}services/edit-vpn-post">
<div class="row">
<div class="col-md-6">
<div class="panel panel-primary panel-hovered panel-stacked mb30">
<div class="panel-heading">{Lang::T('Edit Service Plan')} || {$d['name_plan']}</div>
<div class="panel-body">
<input type="hidden" name="id" value="{$d['id']}">
<div class="form-group">
<label class="col-md-3 control-label">{Lang::T('Status')}
<a tabindex="0" class="btn btn-link btn-xs" role="button" data-toggle="popover"
data-trigger="focus" data-container="body"
data-content="Customer cannot buy disabled Plan, but admin can recharge it, use it if you want only admin recharge it">?</a>
</label>
<div class="col-md-9">
<input type="radio" name="enabled" value="1" {if $d['enabled'] == 1}checked{/if}> {Lang::T('Enable')}
<input type="radio" name="enabled" value="0" {if $d['enabled'] == 0}checked{/if}> {Lang::T('Disable')}
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{Lang::T('Type')}
<a tabindex="0" class="btn btn-link btn-xs" role="button" data-toggle="popover"
data-trigger="focus" data-container="body"
data-content="Postpaid will have fix expired date">?</a>
</label>
<div class="col-md-9">
<input type="radio" name="prepaid" onclick="prePaid()" value="yes"
{if $d['prepaid'] == 'yes'}checked{/if}>
{Lang::T('Prepaid')}
<input type="radio" name="prepaid" onclick="postPaid()" value="no"
{if $d['prepaid'] == 'no'}checked{/if}> {Lang::T('Postpaid')}
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{Lang::T('Plan Type')}
<a tabindex="0" class="btn btn-link btn-xs" role="button" data-toggle="popover"
data-trigger="focus" data-container="body"
data-content="Personal Plan will only show to personal Customer, Business plan will only show to Business Customer">?</a>
</label>
<div class="col-md-9">
<input type="radio" name="plan_type" value="Personal"
{if $d['plan_type'] == 'Personal'}checked{/if}>
{Lang::T('Personal')}
<input type="radio" name="plan_type" value="Business"
{if $d['plan_type'] == 'Business'}checked{/if}> {Lang::T('Business')}
</div>
</div>
{if $_c['radius_enable'] and $d['is_radius']}
<div class="form-group">
<label class="col-md-3 control-label">Radius
<a tabindex="0" class="btn btn-link btn-xs" role="button" data-toggle="popover"
data-trigger="focus" data-container="body"
data-content="If you enable Radius, choose device to radius, except if you have custom device.">?</a>
</label>
<div class="col-md-9">
<label class="label label-primary">RADIUS</label>
</div>
</div>
{/if}
<div class="form-group">
<label class="col-md-3 control-label">{Lang::T('Device')}
<a tabindex="0" class="btn btn-link btn-xs" role="button" data-toggle="popover"
data-trigger="focus" data-container="body"
data-content="This Device are the logic how PHPNuxBill Communicate with Mikrotik or other Devices">?</a>
</label>
<div class="col-md-9">
<select class="form-control" id="device" name="device">
{foreach $devices as $dev}
<option value="{$dev}" {if $dev == $d['device']}selected{/if}>{$dev}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{Lang::T('Plan Name')}</label>
<div class="col-md-9">
<input type="text" class="form-control" id="name_plan" maxlength="40" name="name_plan"
value="{$d['name_plan']}">
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label"><a
href="{$_url}bandwidth/add">{Lang::T('Bandwidth Name')}</a></label>
<div class="col-md-9">
<select id="id_bw" name="id_bw" class="form-control select2">
{foreach $b as $bs}
<option value="{$bs['id']}" {if $d['id_bw'] eq $bs['id']} selected {/if}>
{$bs['name_bw']}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{Lang::T('Plan Price')}</label>
<div class="col-md-9">
<div class="input-group">
<span class="input-group-addon">{$_c['currency_code']}</span>
<input type="number" class="form-control" name="price" required value="{$d['price']}">
</div>
</div>
{if $_c['enable_tax'] == 'yes'}
{if $_c['tax_rate'] == 'custom'}
<p class="help-block col-md-4">{number_format($_c['custom_tax_rate'], 2)} % {Lang::T('Tax Rates
will be added')}</p>
{else}
<p class="help-block col-md-4">{number_format($_c['tax_rate'] * 100, 2)} % {Lang::T('Tax Rates
will be added')}</p>
{/if}
{/if}
</div>
<div class="form-group">
<label class="col-md-3 control-label">{Lang::T('Plan Validity')}</label>
<div class="col-md-3">
<input type="text" class="form-control" id="validity" name="validity"
value="{$d['validity']}">
</div>
<div class="col-md-6">
<select class="form-control" id="validity_unit" name="validity_unit">
{if $d['prepaid'] == yes}
<option value="Mins" {if $d['validity_unit'] eq 'Mins'} selected {/if}>{Lang::T('Mins')}
</option>
<option value="Hrs" {if $d['validity_unit'] eq 'Hrs'} selected {/if}>{Lang::T('Hrs')}
</option>
<option value="Days" {if $d['validity_unit'] eq 'Days'} selected {/if}>{Lang::T('Days')}
</option>
<option value="Months" {if $d['validity_unit'] eq 'Months'} selected {/if}>
{Lang::T('Months')}</option>
{else}
<option value="Period" {if $d['validity_unit'] eq 'Period'} selected {/if}>
{Lang::T('Period')}</option>
{/if}
</select>
<p class="help-block">{Lang::T('1 Period = 1 Month, Expires the 20th of each month')}</p>
</div>
</div>
<div class="form-group {if $d['prepaid'] == yes}hidden{/if}" id="expired_date">
<label class="col-md-3 control-label">{Lang::T('Expired Date')}
<a tabindex="0" class="btn btn-link btn-xs" role="button" data-toggle="popover"
data-trigger="focus" data-container="body"
data-content="Expired will be this date every month">?</a>
</label>
<div class="col-md-9">
<input type="number" class="form-control" name="expired_date" maxlength="2"
value="{if $d['expired_date']}{$d['expired_date']}{else}20{/if}" min="1" max="28"
step="1">
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label"><a href="{$_url}pool/add">{Lang::T('IP Pool')}</a></label>
<div class="col-md-9">
<select id="pool_name" name="pool_name" required class="form-control select2">
{foreach $p as $ps}
<option value="{$ps['pool_name']}" {if $d['pool'] eq $ps['pool_name']} selected {/if}>
{$ps['pool_name']}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-3 control-label">{Lang::T('Router Name')}</label>
<div class="col-md-9">
<input type="text" class="form-control" id="routers" name="routers" value="{$d['routers']}"
readonly>
</div>
</div>
<legend>{Lang::T('Expired Action')} <sub>{Lang::T('Optional')}</sub></legend>
<div class="form-group">
<label class="col-md-3 control-label">{Lang::T('Expired Internet Plan')}</label>
<div class="col-md-9">
<select id="plan_expired" name="plan_expired" class="form-control select2">
<option value='0'>Default - Remove Customer</option>
{foreach $exps as $exp}
<option value="{$exp['id']}" {if $d['plan_expired'] eq $exp['id']} selected {/if}>
{$exp['name_plan']}</option>
{/foreach}
</select>
<p class="help-block">
{Lang::T('When Expired, customer will be move to selected internet plan')}</p>
</div>
</div>
</div>
</div>
</div>
{if !$d['is_radius']}
<div class="col-md-6">
<div class="panel panel-primary panel-hovered panel-stacked mb30">
<div class="panel-heading">{Lang::T('on-login / on-up')}</div>
<div class="panel-body">
<textarea class="form-control" id="code" name="on_login"
style="font-family: 'Courier New', Courier, monospace;" rows="15">{$d['on_login']}</textarea>
</div>
</div>
<div class="panel panel-primary panel-hovered panel-stacked mb30">
<div class="panel-heading">{Lang::T('on-logout / on-down')}</div>
<div class="panel-body">
<textarea class="form-control" id="code2" name="on_logout"
style="font-family: 'Courier New', Courier, monospace;" rows="15">{$d['on_logout']}</textarea>
</div>
</div>
</div>
{/if}
</div>
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<button class="btn btn-success" type="submit">{Lang::T('Save Changes')}</button>
Or <a href="{$_url}services/vpn">{Lang::T('Cancel')}</a>
</div>
</div>
</form>
<script>
var preOpt = `<option value="Mins">{Lang::T('Mins')}</option>
<option value="Hrs">{Lang::T('Hrs')}</option>
<option value="Days">{Lang::T('Days')}</option>
<option value="Months">{Lang::T('Months')}</option>`;
var postOpt = `<option value="Period">{Lang::T('Period')}</option>`;
function prePaid() {
$("#validity_unit").html(preOpt);
$('#expired_date').addClass('hidden');
}
function postPaid() {
$("#validity_unit").html(postOpt);
$("#expired_date").removeClass('hidden');
}
</script>
<script language="javascript" type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.js"></script>
<script language="javascript" type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/mode/perl/perl.min.js"></script>
<link rel="stylesheet" type="text/css"
href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.css">
</link>
<link rel="stylesheet" type="text/css"
href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/theme/abbott.min.css">
</link>
<script>
CodeMirror.fromTextArea(document.getElementById('code'), {
lineNumbers: true,
mode: 'text/x-perl',
});
CodeMirror.fromTextArea(document.getElementById('code2'), {
lineNumbers: true,
mode: 'text/x-perl',
});
</script>
{include file="sections/footer.tpl"}

179
ui/ui/vpn.tpl Normal file
View File

@ -0,0 +1,179 @@
{include file="sections/header.tpl"}
<div class="row">
<div class="col-sm-12">
<div class="panel panel-hovered mb20 panel-primary">
<div class="panel-heading">
<div class="btn-group pull-right">
<a class="btn btn-primary btn-xs" title="save" href="{$_url}services/sync/vpn"
onclick="return confirm('This will sync/send vpn plan to Mikrotik?')"><span
class="glyphicon glyphicon-refresh" aria-hidden="true"></span> sync</a>
</div>{Lang::T('VPN Package')}
</div>
<form id="site-search" method="post" action="{$_url}services/vpn">
<div class="panel-body">
<div class="row row-no-gutters" style="padding: 5px">
<div class="col-lg-2">
<div class="input-group">
<div class="input-group-btn">
<a class="btn btn-danger" title="Clear Search Query"
href="{$_url}services/vpn"><span
class="glyphicon glyphicon-remove-circle"></span></a>
</div>
<input type="text" name="name" class="form-control"
placeholder="{Lang::T('Search by Name')}...">
</div>
</div>
<div class="col-lg-1 col-xs-4">
<select class="form-control" id="type1" name="type1">
<option value="">{Lang::T('Prepaid')} &amp; {Lang::T('Postpaid')}</option>
<option value="yes" {if $type1 eq 'yes' }selected{/if}>{Lang::T('Prepaid')}</option>
<option value="no" {if $type1 eq 'no' }selected{/if}>{Lang::T('Postpaid')}</option>
</select>
</div>
<div class="col-lg-1 col-xs-4">
<select class="form-control" id="type2" name="type2">
<option value="">{Lang::T('Type')}</option>
{foreach $type2s as $t}
<option value="{$t}" {if $type2 eq $t }selected{/if}>{Lang::T($t)}
</option>
{/foreach}
</select>
</div>
<div class="col-lg-1 col-xs-4">
<select class="form-control" id="bandwidth" name="bandwidth">
<option value="">Bandwidth</option>
{foreach $bws as $b}
<option value="{$b['id']}" {if $bandwidth eq $b['id'] }selected{/if}>
{$b['name_bw']}
</option>
{/foreach}
</select>
</div>
<div class="col-lg-1 col-xs-4">
<select class="form-control" id="type3" name="type3">
<option value="">{Lang::T('Category')}</option>
{foreach $type3s as $t}
<option value="{$t}" {if $type3 eq $t }selected{/if}>{$t}
</option>
{/foreach}
</select>
</div>
<div class="col-lg-1 col-xs-4">
<select class="form-control" id="valid" name="valid">
<option value="">{Lang::T('Validity')}</option>
{foreach $valids as $v}
<option value="{$v}" {if $valid eq $v }selected{/if}>{$v}
</option>
{/foreach}
</select>
</div>
<div class="col-lg-1 col-xs-4">
<select class="form-control" id="router" name="router">
<option value="">{Lang::T('Location')}</option>
{foreach $routers as $r}
<option value="{$r}" {if $router eq $r }selected{/if}>{$r}</option>
{/foreach}
<option value="radius" {if $router eq 'radius' }selected{/if}>Radius</option>
</select>
</div>
<div class="col-lg-1 col-xs-4">
<select class="form-control" id="device" name="device">
<option value="">{Lang::T('Device')}</option>
{foreach $devices as $r}
<option value="{$r}" {if $device eq $r }selected{/if}>{$r}</option>
{/foreach}
</select>
</div>
<div class="col-lg-1 col-xs-4">
<select class="form-control" id="status" name="status">
<option value="-">{Lang::T('Status')}</option>
<option value="1" {if $status eq '1' }selected{/if}>{Lang::T('Enabled')}</option>
<option value="0" {if $status eq '0' }selected{/if}>{Lang::T('Disable')}</option>
</select>
</div>
<div class="col-lg-1 col-xs-8">
<button class="btn btn-success btn-block" type="submit"><span
class="fa fa-search"></span></button>
</div>
<div class="col-lg-1 col-xs-4">
<a href="{$_url}services/vpn-add" class="btn btn-primary btn-block"
title="{Lang::T('New Service Plan')}"><i class="ion ion-android-add"></i></a>
</div>
</div>
</div>
</form>
<div class="table-responsive">
<table class="table table-bordered table-striped table-condensed">
<thead>
<tr>
<th></th>
<th colspan="4" class="text-center">{Lang::T('Internet Plan')}</th>
<th></th>
<th colspan="2" class="text-center" style="background-color: rgb(243, 241, 172);">
{Lang::T('Expired')}</th>
<th colspan="4"></th>
</tr>
<tr>
<th>{Lang::T('Name')}</th>
<th>{Lang::T('Type')}</th>
<th><a href="{$_url}bandwidth/list">{Lang::T('Bandwidth')}</a></th>
<th>{Lang::T('Price')}</th>
<th>{Lang::T('Validity')}</th>
<th><a href="{$_url}pool/list">{Lang::T('IP Pool')}</a></th>
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Internet Plan')}</th>
<th style="background-color: rgb(243, 241, 172);">{Lang::T('Date')}</th>
<th><a href="{$_url}routers/list">{Lang::T('Location')}</a></th>
<th>{Lang::T('Device')}</th>
<th>{Lang::T('Manage')}</th>
<th>ID</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr {if $ds['enabled'] != 1}class="danger" title="disabled" {/if}>
<td>{$ds['name_plan']}</td>
<td>{$ds['plan_type']} {if $ds['prepaid'] != 'yes'}<b>{Lang::T('Postpaid')}</b>{else}{Lang::T('Prepaid')}{/if}</td>
<td>{$ds['name_bw']}</td>
<td>{Lang::moneyFormat($ds['price'])}</td>
<td>{$ds['validity']} {$ds['validity_unit']}</td>
<td>{$ds['pool']}</td>
<td>{if $ds['plan_expired']}<a
href="{$_url}services/vpn-edit/{$ds['plan_expired']}">{Lang::T('Yes')}</a>{else}{Lang::T('No')}
{/if}</td>
<td>{if $ds['prepaid'] == no}{$ds['expired_date']}{/if}</td>
<td>
{if $ds['is_radius']}
<span class="label label-primary">RADIUS</span>
{else}
{if $ds['routers']!=''}
<a href="{$_url}routers/edit/0&name={$ds['routers']}">{$ds['routers']}</a>
{/if}
{/if}
</td>
<td>{$ds['device']}</td>
<td>
<a href="{$_url}services/vpn-edit/{$ds['id']}"
class="btn btn-info btn-xs">{Lang::T('Edit')}</a>
<a href="{$_url}services/vpn-delete/{$ds['id']}"
onclick="return confirm('{Lang::T('Delete')}?')" id="{$ds['id']}"
class="btn btn-danger btn-xs"><i class="glyphicon glyphicon-trash"></i></a>
</td>
<td>{$ds['id']}</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
<div class="panel-footer">
{include file="pagination.tpl"}
<div class="bs-callout bs-callout-info" id="callout-navbar-role">
<h4>{Lang::T('Create expired Internet Plan')}</h4>
<p>{Lang::T('When customer expired, you can move it to Expired Internet Plan')}</p>
</div>
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

View File

@ -1,3 +1,3 @@
{
"version": "2024.8.28"
"version": "2024.9.13"
}