Compare commits
109 Commits
2024.2.26.
...
2024.3.14
Author | SHA1 | Date | |
---|---|---|---|
68d3c9181c | |||
e206a583fd | |||
ca27c47b75 | |||
2c67108cf1 | |||
dee4c78e93 | |||
a6c004e1cb | |||
8318bb4e6b | |||
b27e0adca9 | |||
2925d3a1e3 | |||
add28c2fca | |||
afbab3dd42 | |||
b68e4d2e68 | |||
c8f4574984 | |||
60c573821b | |||
e6e993cf21 | |||
ca0edb4e17 | |||
ed9a411095 | |||
c69fb1cae2 | |||
d30aadc5e4 | |||
b732cfd90e | |||
46a56c12e3 | |||
9b2d42610a | |||
ef85bdb02f | |||
23763ed308 | |||
9fcdf04005 | |||
60babfa7b5 | |||
4cdde32cb1 | |||
538850b323 | |||
47393b4da9 | |||
87167b7770 | |||
81572a61a4 | |||
3412ecc7de | |||
3ab38897f9 | |||
8c2471d1d2 | |||
b0937a424a | |||
171b938d3a | |||
61c1d25096 | |||
f885b8e8a3 | |||
2bb664e241 | |||
c9058769ce | |||
6d15437333 | |||
7c5958c8c1 | |||
1a4a0f2c10 | |||
629d9e8ed4 | |||
b9e987570c | |||
b95788262d | |||
3bb55320e3 | |||
7a9f937a9e | |||
c00e51adda | |||
0cc526e29a | |||
16f0642007 | |||
e1f7b324cb | |||
8f0ff3e786 | |||
9023f89456 | |||
140b756994 | |||
ca59c89e1d | |||
4e23918999 | |||
758a0a99a9 | |||
b6cf9bec0b | |||
6e07c3ae85 | |||
ef76aadc16 | |||
8e960107fc | |||
c4e702ee2f | |||
08790e7295 | |||
cfefd38a31 | |||
37a5ee8566 | |||
e5c8aae758 | |||
99d393d0c0 | |||
e6280d597b | |||
18db9cd280 | |||
6aab647f48 | |||
b8b4623078 | |||
6a79cff233 | |||
4c02283fd0 | |||
403de91fba | |||
4ee3743cf3 | |||
77e48dae8b | |||
0745532951 | |||
b53116d22a | |||
f7df824145 | |||
f154322f99 | |||
a76ba6ee8b | |||
61b3f5b5f5 | |||
b153e5b595 | |||
9ab0b6a0fa | |||
a7f191f058 | |||
012a1ecfab | |||
dc70a49f52 | |||
bc7380eab7 | |||
f4da09a26e | |||
de3312055a | |||
699289662b | |||
bae079f71c | |||
28f4624e8d | |||
fbd215e741 | |||
2437096473 | |||
dfeee540cf | |||
a0b9e85f38 | |||
08153e6ec1 | |||
2660f5d2d0 | |||
82e67f0b83 | |||
41dd0d86e7 | |||
c8004f1a27 | |||
61edfb932a | |||
747a67b691 | |||
b938db9e5d | |||
1ec8049068 | |||
848dcb5caf | |||
afe6b34fd6 |
9
.htaccess_firewall
Normal file
9
.htaccess_firewall
Normal file
@ -0,0 +1,9 @@
|
||||
<Files *.php>
|
||||
Order Deny,Allow
|
||||
Deny from all
|
||||
</Files>
|
||||
|
||||
<Files index.php>
|
||||
Order Allow,Deny
|
||||
Allow from all
|
||||
</Files>
|
53
CHANGELOG.md
53
CHANGELOG.md
@ -2,6 +2,59 @@
|
||||
|
||||
# CHANGELOG
|
||||
|
||||
## 2024.3.14
|
||||
|
||||
- Add Note to Invoices
|
||||
- Add Additional Bill
|
||||
- View Invoice from Customer side
|
||||
|
||||
## 2024.3.13
|
||||
|
||||
- Postpaid System
|
||||
- Additional Cost
|
||||
|
||||
## 2024.3.12
|
||||
|
||||
- Check if Validity Period, so calculate price will not affected other validity
|
||||
- Add firewall using .htaccess for apache only
|
||||
- Multiple Payment Gateway by @Focuslinkstech
|
||||
- Fix Logic Multiple Payment gateway
|
||||
- Fix delete Attribute
|
||||
- Allow Delete Payment Gateway
|
||||
- Allow Delete Plugin
|
||||
|
||||
## 2024.3.6
|
||||
|
||||
- change attributes view
|
||||
|
||||
## 2024.3.4
|
||||
|
||||
- add [[username]] for reminder
|
||||
- fix agent show when editing
|
||||
- fix password admin when sending notification
|
||||
- add file exists for pages
|
||||
|
||||
## 2024.3.3
|
||||
|
||||
- Change loading button by @Focuslinkstech
|
||||
- Add Customer Announcements by @Gerandonk
|
||||
- Add PPPOE Period Validity by @Gerandonk
|
||||
|
||||
## 2024.2.29
|
||||
|
||||
- Fix Hook Functionality
|
||||
- Change Customer Menu
|
||||
|
||||
## 2024.2.28
|
||||
|
||||
- Fix Buy Plan with Balance
|
||||
- Add Expired date for reminder
|
||||
|
||||
## 2024.2.27
|
||||
|
||||
- fix path notification
|
||||
- redirect to dashboard if already login
|
||||
|
||||
## 2024.2.26
|
||||
|
||||
- Clean Unused JS and CSS
|
||||
|
11
init.php
11
init.php
@ -76,10 +76,10 @@ if ($_app_stage != 'Live') {
|
||||
define('U', APP_URL . '/index.php?_route=');
|
||||
|
||||
// notification message
|
||||
if (file_exists($root_path . $UPLOAD_PATH . DIRECTORY_SEPARATOR . "notifications.json")) {
|
||||
$_notifmsg = json_decode(file_get_contents($root_path . $UPLOAD_PATH . DIRECTORY_SEPARATOR . 'notifications.json'), true);
|
||||
if (file_exists($UPLOAD_PATH . DIRECTORY_SEPARATOR . "notifications.json")) {
|
||||
$_notifmsg = json_decode(file_get_contents($UPLOAD_PATH . DIRECTORY_SEPARATOR . 'notifications.json'), true);
|
||||
}
|
||||
$_notifmsg_default = json_decode(file_get_contents($root_path . $UPLOAD_PATH . DIRECTORY_SEPARATOR . 'notifications.default.json'), true);
|
||||
$_notifmsg_default = json_decode(file_get_contents($UPLOAD_PATH . DIRECTORY_SEPARATOR . 'notifications.default.json'), true);
|
||||
|
||||
//register all plugin
|
||||
foreach (glob(File::pathFixer($PLUGIN_PATH . DIRECTORY_SEPARATOR . '*.php')) as $filename) {
|
||||
@ -96,6 +96,7 @@ $result = ORM::for_table('tbl_appconfig')->find_many();
|
||||
foreach ($result as $value) {
|
||||
$config[$value['setting']] = $value['value'];
|
||||
}
|
||||
$_c = $config;
|
||||
if (empty($http_proxy) && !empty($config['http_proxy'])) {
|
||||
$http_proxy = $config['http_proxy'];
|
||||
if (empty($http_proxyauth) && !empty($config['http_proxyauth'])) {
|
||||
@ -237,7 +238,7 @@ function r2($to, $ntype = 'e', $msg = '')
|
||||
exit;
|
||||
}
|
||||
|
||||
function _alert($text, $type = 'success', $url = "home")
|
||||
function _alert($text, $type = 'success', $url = "home", $time = 3)
|
||||
{
|
||||
global $ui;
|
||||
if (!isset($ui)) return;
|
||||
@ -250,8 +251,10 @@ function _alert($text, $type = 'success', $url = "home")
|
||||
}
|
||||
$ui->assign('text', $text);
|
||||
$ui->assign('type', $type);
|
||||
$ui->assign('time', $time);
|
||||
$ui->assign('url', $url);
|
||||
$ui->display('alert.tpl');
|
||||
die();
|
||||
}
|
||||
|
||||
|
||||
|
@ -91,7 +91,7 @@ CREATE TABLE `tbl_plans` (
|
||||
`data_limit` int(10) UNSIGNED DEFAULT NULL,
|
||||
`data_unit` enum('MB','GB') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`validity` int(10) NOT NULL,
|
||||
`validity_unit` enum('Mins','Hrs','Days','Months') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`validity_unit` enum('Mins','Hrs','Days','Months','Period') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`shared_users` int(10) DEFAULT NULL,
|
||||
`routers` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`is_radius` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1 is radius',
|
||||
@ -315,4 +315,6 @@ ALTER TABLE `tbl_customers` ADD `created_by` INT NOT NULL DEFAULT '0' AFTER `aut
|
||||
ALTER TABLE `tbl_plans` ADD `list_expired` VARCHAR(32) NOT NULL DEFAULT '' COMMENT 'address list' AFTER `pool_expired`;
|
||||
ALTER TABLE `tbl_bandwidth` ADD `burst` VARCHAR(128) NOT NULL DEFAULT '' AFTER `rate_up_unit`;
|
||||
ALTER TABLE `tbl_transactions` ADD `admin_id` INT NOT NULL DEFAULT '1' AFTER `type`;
|
||||
ALTER TABLE `tbl_user_recharges` ADD `admin_id` INT NOT NULL DEFAULT '1' AFTER `type`;
|
||||
ALTER TABLE `tbl_user_recharges` ADD `admin_id` INT NOT NULL DEFAULT '1' AFTER `type`;
|
||||
ALTER TABLE `tbl_plans` CHANGE `allow_purchase` `prepaid` ENUM('yes','no') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'yes' COMMENT 'is prepaid';
|
||||
ALTER TABLE `tbl_transactions` ADD `note` VARCHAR(256) NOT NULL DEFAULT '' COMMENT 'for note' AFTER `type`;
|
@ -1 +1,3 @@
|
||||
Pengumuman!!<br>Besok libur<br><br>Announcement!!<br>Tomorrow holiday<br>
|
||||
Pengumuman!!<br>Besok libur<br><br>Announcement!!<br>Tomorrow holiday<br><br>
|
||||
<br>
|
||||
This Announcement is for Login Page.
|
8
pages_template/Announcement_Customer.html
Normal file
8
pages_template/Announcement_Customer.html
Normal file
@ -0,0 +1,8 @@
|
||||
Pengumuman Pelanggan!!<br>
|
||||
Besok libur<br>
|
||||
<br>
|
||||
Customer Announcement!!<br>
|
||||
Tomorrow holiday<br>
|
||||
<br>
|
||||
<br>
|
||||
This Announcement is for Customer Dashboard
|
19
system/.htaccess
Normal file
19
system/.htaccess
Normal file
@ -0,0 +1,19 @@
|
||||
<Files *.php>
|
||||
Order Deny,Allow
|
||||
Deny from all
|
||||
</Files>
|
||||
|
||||
<Files cron.php>
|
||||
Order Allow,Deny
|
||||
Allow from all
|
||||
</Files>
|
||||
|
||||
<Files api.php>
|
||||
Order Allow,Deny
|
||||
Allow from all
|
||||
</Files>
|
||||
|
||||
<Files cron_reminder.php>
|
||||
Order Allow,Deny
|
||||
Allow from all
|
||||
</Files>
|
@ -51,7 +51,7 @@ class Admin
|
||||
if ($id) {
|
||||
return ORM::for_table('tbl_users')->find_one($id);
|
||||
} else {
|
||||
return [];
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -38,6 +38,7 @@ function register_menu($name, $admin, $function, $position, $icon = '', $label =
|
||||
$hook_registered = array();
|
||||
|
||||
function register_hook($action, $function){
|
||||
global $hook_registered;
|
||||
$hook_registered[] = [
|
||||
'action' => $action,
|
||||
'function' => $function
|
||||
|
@ -60,25 +60,30 @@ class Message
|
||||
global $config;
|
||||
run_hook('send_whatsapp'); #HOOK
|
||||
if (!empty($config['wa_url'])) {
|
||||
$waurl = str_replace('[number]', urlencode($phone), $config['wa_url']);
|
||||
$waurl = str_replace('[number]', urlencode(Lang::phoneFormat($phone)), $config['wa_url']);
|
||||
$waurl = str_replace('[text]', urlencode($txt), $waurl);
|
||||
return Http::getData($waurl);
|
||||
}
|
||||
}
|
||||
|
||||
public static function sendPackageNotification($phone, $name, $package, $price, $message, $via)
|
||||
public static function sendPackageNotification($customer, $package, $price, $message, $via)
|
||||
{
|
||||
$msg = str_replace('[[name]]', $name, $message);
|
||||
global $u;
|
||||
$msg = str_replace('[[name]]', $customer['fullname'], $message);
|
||||
$msg = str_replace('[[username]]', $customer['username'], $msg);
|
||||
$msg = str_replace('[[package]]', $package, $msg);
|
||||
$msg = str_replace('[[price]]', $price, $msg);
|
||||
if($u){
|
||||
$msg = str_replace('[[expired_date]]', Lang::dateAndTimeFormat($u['expiration'], $u['time']), $msg);
|
||||
}
|
||||
if (
|
||||
!empty($phone) && strlen($phone) > 5
|
||||
!empty($customer['phonenumber']) && strlen($customer['phonenumber']) > 5
|
||||
&& !empty($message) && in_array($via, ['sms', 'wa'])
|
||||
) {
|
||||
if ($via == 'sms') {
|
||||
Message::sendSMS($phone, $msg);
|
||||
Message::sendSMS($customer['phonenumber'], $msg);
|
||||
} else if ($via == 'wa') {
|
||||
Message::sendWhatsapp($phone, $msg);
|
||||
Message::sendWhatsapp($customer['phonenumber'], $msg);
|
||||
}
|
||||
}
|
||||
return "$via: $msg";
|
||||
@ -118,8 +123,11 @@ class Message
|
||||
$textInvoice = str_replace('[[plan_name]]', $trx['plan_name'], $textInvoice);
|
||||
$textInvoice = str_replace('[[plan_price]]', Lang::moneyFormat($trx['price']), $textInvoice);
|
||||
$textInvoice = str_replace('[[name]]', $cust['fullname'], $textInvoice);
|
||||
$textInvoice = str_replace('[[note]]', $cust['note'], $textInvoice);
|
||||
$textInvoice = str_replace('[[user_name]]', $trx['username'], $textInvoice);
|
||||
$textInvoice = str_replace('[[user_password]]', $cust['password'], $textInvoice);
|
||||
$textInvoice = str_replace('[[username]]', $trx['username'], $textInvoice);
|
||||
$textInvoice = str_replace('[[password]]', $cust['password'], $textInvoice);
|
||||
$textInvoice = str_replace('[[expired_date]]', Lang::dateAndTimeFormat($trx['expiration'], $trx['time']), $textInvoice);
|
||||
$textInvoice = str_replace('[[footer]]', $config['note'], $textInvoice);
|
||||
|
||||
|
@ -17,9 +17,9 @@ class Package
|
||||
* @param string $channel channel payment gateway
|
||||
* @return boolean
|
||||
*/
|
||||
public static function rechargeUser($id_customer, $router_name, $plan_id, $gateway, $channel)
|
||||
public static function rechargeUser($id_customer, $router_name, $plan_id, $gateway, $channel, $note = '')
|
||||
{
|
||||
global $config, $admin;
|
||||
global $config, $admin, $c, $p, $b, $t, $d, $zero;
|
||||
$date_now = date("Y-m-d H:i:s");
|
||||
$date_only = date("Y-m-d");
|
||||
$time_only = date("H:i:s");
|
||||
@ -30,11 +30,59 @@ class Package
|
||||
}
|
||||
|
||||
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
|
||||
$p = ORM::for_table('tbl_plans')->where('id', $plan_id)->where('enabled', '1')->find_one();
|
||||
$p = ORM::for_table('tbl_plans')->where('id', $plan_id)->find_one();
|
||||
|
||||
// Additional cost
|
||||
$add_cost = 0;
|
||||
$add_rem = User::getAttribute("Additional Remaining", $id_customer);
|
||||
// if empty then it doesnt have cycle, if zero then it finish
|
||||
if ($add_rem != 0) {
|
||||
$add_cost = User::getAttribute("Additional Cost", $id_customer);
|
||||
if (empty($add_cost)) {
|
||||
$add_cost = 0;
|
||||
}
|
||||
}
|
||||
if ($add_cost > 0 && $router_name != 'balance') {
|
||||
$bills = User::getAttributes("Bill", $id_customer);
|
||||
foreach ($bills as $k => $v) {
|
||||
$note .= $k . " : " . Lang::moneyFormat($v) . "\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Zero cost recharge
|
||||
if (isset($zero) && $zero == 1) {
|
||||
$p['price'] = 0;
|
||||
$add_cost = 0;
|
||||
}
|
||||
|
||||
if (!$p['enabled']) {
|
||||
if (!isset($admin) || !isset($admin['id']) || empty($admin['id'])) {
|
||||
r2(U . 'home', 'e', Lang::T('Plan Not found'));
|
||||
}
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
|
||||
r2(U . 'dashboard', 'e', Lang::T('Plan Not found'));
|
||||
}
|
||||
}
|
||||
|
||||
if ($p['validity_unit'] == 'Period') {
|
||||
$day_exp = User::getAttribute("Expired Date", $c['id']); //ORM::for_table('tbl_customers_fields')->where('field_name', 'Expired Date')->where('customer_id', $c['id'])->find_one();
|
||||
if (!$day_exp) {
|
||||
$day_exp = 20;
|
||||
// $day_exp = date('d', strtotime($c['created_at']));
|
||||
// if (empty($day_exp) || $day_exp > 28) {
|
||||
// $day_exp = 1;
|
||||
// }
|
||||
$f = ORM::for_table('tbl_customers_fields')->create();
|
||||
$f->customer_id = $c['id'];
|
||||
$f->field_name = 'Expired Date';
|
||||
$f->field_value = $day_exp;
|
||||
$f->save();
|
||||
}
|
||||
}
|
||||
|
||||
if ($router_name == 'balance') {
|
||||
// insert table transactions
|
||||
$inv = "INV-" . Package::_raid(5);
|
||||
$inv = "INV-" . Package::_raid();
|
||||
$t = ORM::for_table('tbl_transactions')->create();
|
||||
$t->invoice = $inv;
|
||||
$t->username = $c['username'];
|
||||
@ -48,8 +96,8 @@ class Package
|
||||
$t->routers = $router_name;
|
||||
$t->type = "Balance";
|
||||
if ($admin) {
|
||||
$t->admin_id = $admin['id'];
|
||||
}else{
|
||||
$t->admin_id = ($admin['id']) ? $admin['id'] : '0';
|
||||
} else {
|
||||
$t->admin_id = '0';
|
||||
}
|
||||
$t->save();
|
||||
@ -86,17 +134,49 @@ class Package
|
||||
}
|
||||
|
||||
/**
|
||||
* 1 Customer only can have 1 PPPOE and 1 Hotspot Plan
|
||||
* 1 Customer only can have 1 PPPOE and 1 Hotspot Plan, 1 prepaid and 1 postpaid
|
||||
*/
|
||||
$b = ORM::for_table('tbl_user_recharges')
|
||||
->select('tbl_user_recharges.id', 'id')
|
||||
->select('customer_id')
|
||||
->select('username')
|
||||
->select('plan_id')
|
||||
->select('namebp')
|
||||
->select('recharged_on')
|
||||
->select('recharged_time')
|
||||
->select('expiration')
|
||||
->select('time')
|
||||
->select('status')
|
||||
->select('method')
|
||||
->select('tbl_user_recharges.routers', 'routers')
|
||||
->select('tbl_user_recharges.type', 'type')
|
||||
->select('admin_id')
|
||||
->select('prepaid')
|
||||
->where('customer_id', $id_customer)
|
||||
->where('routers', $router_name)
|
||||
->where('Type', $p['type'])
|
||||
->where('tbl_user_recharges.routers', $router_name)
|
||||
->where('tbl_user_recharges.Type', $p['type'])
|
||||
->where('prepaid', $p['prepaid'])
|
||||
->join('tbl_plans', array('tbl_plans.id', '=', 'tbl_user_recharges.plan_id'))
|
||||
->find_one();
|
||||
|
||||
run_hook("recharge_user");
|
||||
|
||||
|
||||
$mikrotik = Mikrotik::info($router_name);
|
||||
if ($p['validity_unit'] == 'Months') {
|
||||
$date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' month'));
|
||||
} else if ($p['validity_unit'] == 'Period') {
|
||||
$date_tmp = date("Y-m-$day_exp", strtotime('+' . $p['validity'] . ' month'));
|
||||
$dt1 = new DateTime("$date_only");
|
||||
$dt2 = new DateTime("$date_tmp");
|
||||
$diff = $dt2->diff($dt1);
|
||||
$sum = $diff->format("%a"); // => 453
|
||||
if ($sum >= 35) {
|
||||
$date_exp = date("Y-m-$day_exp", strtotime('+0 month'));
|
||||
} else {
|
||||
$date_exp = date("Y-m-$day_exp", strtotime('+' . $p['validity'] . ' month'));
|
||||
};
|
||||
$time = date("23:59:00");
|
||||
} else if ($p['validity_unit'] == 'Days') {
|
||||
$date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' day'));
|
||||
} else if ($p['validity_unit'] == 'Hrs') {
|
||||
@ -116,6 +196,9 @@ class Package
|
||||
if ($p['validity_unit'] == 'Months') {
|
||||
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
|
||||
$time = $b['time'];
|
||||
} else if ($p['validity_unit'] == 'Period') {
|
||||
$date_exp = date("Y-m-$day_exp", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
|
||||
$time = date("23:59:00");
|
||||
} else if ($p['validity_unit'] == 'Days') {
|
||||
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days'));
|
||||
$time = $b['time'];
|
||||
@ -152,31 +235,55 @@ class Package
|
||||
$b->routers = $router_name;
|
||||
$b->type = "Hotspot";
|
||||
if ($admin) {
|
||||
$b->admin_id = $admin['id'];
|
||||
}else{
|
||||
$b->admin_id = ($admin['id']) ? $admin['id'] : '0';
|
||||
} else {
|
||||
$b->admin_id = '0';
|
||||
}
|
||||
$b->save();
|
||||
|
||||
// insert table transactions
|
||||
$t = ORM::for_table('tbl_transactions')->create();
|
||||
$t->invoice = "INV-" . Package::_raid(5);
|
||||
$t->invoice = "INV-" . Package::_raid();
|
||||
$t->username = $c['username'];
|
||||
$t->plan_name = $p['name_plan'];
|
||||
$t->price = $p['price'];
|
||||
$t->price = $p['price'] + $add_cost;
|
||||
$t->recharged_on = $date_only;
|
||||
$t->recharged_time = $time_only;
|
||||
$t->expiration = $date_exp;
|
||||
$t->time = $time;
|
||||
$t->method = "$gateway - $channel";
|
||||
$t->routers = $router_name;
|
||||
$t->note = $note;
|
||||
$t->type = "Hotspot";
|
||||
if ($admin) {
|
||||
$t->admin_id = $admin['id'];
|
||||
}else{
|
||||
$t->admin_id = ($admin['id']) ? $admin['id'] : '0';
|
||||
} else {
|
||||
$t->admin_id = '0';
|
||||
}
|
||||
$t->save();
|
||||
|
||||
if ($p['validity_unit'] == 'Period') {
|
||||
// insert to fields
|
||||
$fl = ORM::for_table('tbl_customers_fields')->where('field_name', 'Invoice')->where('customer_id', $c['id'])->find_one();
|
||||
if (!$fl) {
|
||||
$fl = ORM::for_table('tbl_customers_fields')->create();
|
||||
$fl->customer_id = $c['id'];
|
||||
$fl->field_name = 'Invoice';
|
||||
$fl->field_value = $p['price'];
|
||||
$fl->save();
|
||||
} else {
|
||||
$fl->customer_id = $c['id'];
|
||||
$fl->field_value = $p['price'];
|
||||
$fl->save();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Message::sendTelegram("#u$c[username] $c[fullname] #recharge #Hotspot \n" . $p['name_plan'] .
|
||||
"\nRouter: " . $router_name .
|
||||
"\nGateway: " . $gateway .
|
||||
"\nChannel: " . $channel .
|
||||
"\nPrice: " . Lang::moneyFormat($p['price']));
|
||||
} else {
|
||||
if ($p['is_radius']) {
|
||||
Radius::customerAddPlan($c, $p, "$date_exp $time");
|
||||
@ -201,37 +308,73 @@ class Package
|
||||
$d->routers = $router_name;
|
||||
$d->type = "Hotspot";
|
||||
if ($admin) {
|
||||
$b->admin_id = $admin['id'];
|
||||
}else{
|
||||
$b->admin_id = '0';
|
||||
$d->admin_id = ($admin['id']) ? $admin['id'] : '0';
|
||||
} else {
|
||||
$d->admin_id = '0';
|
||||
}
|
||||
$d->save();
|
||||
|
||||
// insert table transactions
|
||||
$t = ORM::for_table('tbl_transactions')->create();
|
||||
$t->invoice = "INV-" . Package::_raid(5);
|
||||
$t->invoice = "INV-" . Package::_raid();
|
||||
$t->username = $c['username'];
|
||||
$t->plan_name = $p['name_plan'];
|
||||
$t->price = $p['price'];
|
||||
if ($p['validity_unit'] == 'Period' && $p['price'] != 0) {
|
||||
// Calculating Price
|
||||
$sd = new DateTime("$date_only");
|
||||
$ed = new DateTime("$date_exp");
|
||||
$td = $ed->diff($sd);
|
||||
$fd = $td->format("%a");
|
||||
$gi = ($p['price'] / 30) * $fd;
|
||||
if ($gi > $p['price']) {
|
||||
$t->price = $p['price'] + $add_cost;
|
||||
} else {
|
||||
$t->price = $gi + $add_cost;
|
||||
}
|
||||
} else {
|
||||
$t->price = $p['price'] + $add_cost;
|
||||
}
|
||||
$t->recharged_on = $date_only;
|
||||
$t->recharged_time = $time_only;
|
||||
$t->expiration = $date_exp;
|
||||
$t->time = $time;
|
||||
$t->method = "$gateway - $channel";
|
||||
$t->routers = $router_name;
|
||||
$t->note = $note;
|
||||
$t->type = "Hotspot";
|
||||
if ($admin) {
|
||||
$t->admin_id = $admin['id'];
|
||||
}else{
|
||||
$t->admin_id = ($admin['id']) ? $admin['id'] : '0';
|
||||
} else {
|
||||
$t->admin_id = '0';
|
||||
}
|
||||
$t->save();
|
||||
|
||||
if ($p['validity_unit'] == 'Period' && $p['price'] != 0) {
|
||||
// insert to fields
|
||||
$fl = ORM::for_table('tbl_customers_fields')->where('field_name', 'Invoice')->where('customer_id', $c['id'])->find_one();
|
||||
if (!$fl) {
|
||||
$fl = ORM::for_table('tbl_customers_fields')->create();
|
||||
$fl->customer_id = $c['id'];
|
||||
$fl->field_name = 'Invoice';
|
||||
if ($gi > $p['price']) {
|
||||
$fl->field_value = $p['price'];
|
||||
} else {
|
||||
$fl->field_value = $gi;
|
||||
}
|
||||
$fl->save();
|
||||
} else {
|
||||
$fl->customer_id = $c['id'];
|
||||
$fl->field_value = $p['price'];
|
||||
$fl->save();
|
||||
}
|
||||
}
|
||||
|
||||
Message::sendTelegram("#u$c[username] $c[fullname] #buy #Hotspot \n" . $p['name_plan'] .
|
||||
"\nRouter: " . $router_name .
|
||||
"\nGateway: " . $gateway .
|
||||
"\nChannel: " . $channel .
|
||||
"\nPrice: " . Lang::moneyFormat($p['price']));
|
||||
}
|
||||
Message::sendTelegram("#u$c[username] #buy #Hotspot \n" . $p['name_plan'] .
|
||||
"\nRouter: " . $router_name .
|
||||
"\nGateway: " . $gateway .
|
||||
"\nChannel: " . $channel .
|
||||
"\nPrice: " . Lang::moneyFormat($p['price']));
|
||||
} else {
|
||||
|
||||
if ($b) {
|
||||
@ -240,6 +383,9 @@ class Package
|
||||
if ($p['validity_unit'] == 'Months') {
|
||||
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
|
||||
$time = $b['time'];
|
||||
} else if ($p['validity_unit'] == 'Period') {
|
||||
$date_exp = date("Y-m-$day_exp", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
|
||||
$time = date("23:59:00");
|
||||
} else if ($p['validity_unit'] == 'Days') {
|
||||
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days'));
|
||||
$time = $b['time'];
|
||||
@ -276,31 +422,54 @@ class Package
|
||||
$b->routers = $router_name;
|
||||
$b->type = "PPPOE";
|
||||
if ($admin) {
|
||||
$b->admin_id = $admin['id'];
|
||||
}else{
|
||||
$b->admin_id = ($admin['id']) ? $admin['id'] : '0';
|
||||
} else {
|
||||
$b->admin_id = '0';
|
||||
}
|
||||
$b->save();
|
||||
|
||||
// insert table transactions
|
||||
$t = ORM::for_table('tbl_transactions')->create();
|
||||
$t->invoice = "INV-" . Package::_raid(5);
|
||||
$t->invoice = "INV-" . Package::_raid();
|
||||
$t->username = $c['username'];
|
||||
$t->plan_name = $p['name_plan'];
|
||||
$t->price = $p['price'];
|
||||
$t->price = $p['price'] + $add_cost;
|
||||
$t->recharged_on = $date_only;
|
||||
$t->recharged_time = $time_only;
|
||||
$t->expiration = $date_exp;
|
||||
$t->time = $time;
|
||||
$t->method = "$gateway - $channel";
|
||||
$t->routers = $router_name;
|
||||
$t->note = $note;
|
||||
$t->type = "PPPOE";
|
||||
if ($admin) {
|
||||
$t->admin_id = $admin['id'];
|
||||
}else{
|
||||
$t->admin_id = ($admin['id']) ? $admin['id'] : '0';
|
||||
} else {
|
||||
$t->admin_id = '0';
|
||||
}
|
||||
$t->save();
|
||||
|
||||
if ($p['validity_unit'] == 'Period' && $p['price'] != 0) {
|
||||
// insert to fields
|
||||
$fl = ORM::for_table('tbl_customers_fields')->where('field_name', 'Invoice')->where('customer_id', $c['id'])->find_one();
|
||||
if (!$fl) {
|
||||
$fl = ORM::for_table('tbl_customers_fields')->create();
|
||||
$fl->customer_id = $c['id'];
|
||||
$fl->field_name = 'Invoice';
|
||||
$fl->field_value = $p['price'];
|
||||
$fl->save();
|
||||
} else {
|
||||
$fl->customer_id = $c['id'];
|
||||
$fl->field_value = $p['price'];
|
||||
$fl->save();
|
||||
}
|
||||
}
|
||||
|
||||
Message::sendTelegram("#u$c[username] $c[fullname] #recharge #PPPOE \n" . $p['name_plan'] .
|
||||
"\nRouter: " . $router_name .
|
||||
"\nGateway: " . $gateway .
|
||||
"\nChannel: " . $channel .
|
||||
"\nPrice: " . Lang::moneyFormat($p['price']));
|
||||
} else {
|
||||
if ($p['is_radius']) {
|
||||
Radius::customerAddPlan($c, $p, "$date_exp $time");
|
||||
@ -325,39 +494,78 @@ class Package
|
||||
$d->routers = $router_name;
|
||||
$d->type = "PPPOE";
|
||||
if ($admin) {
|
||||
$d->admin_id = $admin['id'];
|
||||
}else{
|
||||
$d->admin_id = ($admin['id']) ? $admin['id'] : '0';
|
||||
} else {
|
||||
$d->admin_id = '0';
|
||||
}
|
||||
$d->save();
|
||||
|
||||
// insert table transactions
|
||||
$t = ORM::for_table('tbl_transactions')->create();
|
||||
$t->invoice = "INV-" . Package::_raid(5);
|
||||
$t->invoice = "INV-" . Package::_raid();
|
||||
$t->username = $c['username'];
|
||||
$t->plan_name = $p['name_plan'];
|
||||
$t->price = $p['price'];
|
||||
if ($p['validity_unit'] == 'Period' && $p['price'] != 0) {
|
||||
// Calculating Price
|
||||
$sd = new DateTime("$date_only");
|
||||
$ed = new DateTime("$date_exp");
|
||||
$td = $ed->diff($sd);
|
||||
$fd = $td->format("%a");
|
||||
$gi = ($p['price'] / 30) * $fd;
|
||||
if ($gi > $p['price']) {
|
||||
$t->price = $p['price'] + $add_cost;
|
||||
} else {
|
||||
$t->price = $gi + $add_cost;
|
||||
}
|
||||
} else {
|
||||
$t->price = $p['price'] + $add_cost;
|
||||
}
|
||||
$t->recharged_on = $date_only;
|
||||
$t->recharged_time = $time_only;
|
||||
$t->expiration = $date_exp;
|
||||
$t->time = $time;
|
||||
$t->method = "$gateway - $channel";
|
||||
$t->note = $note;
|
||||
$t->routers = $router_name;
|
||||
if ($admin) {
|
||||
$t->admin_id = $admin['id'];
|
||||
}else{
|
||||
$t->admin_id = ($admin['id']) ? $admin['id'] : '0';
|
||||
} else {
|
||||
$t->admin_id = '0';
|
||||
}
|
||||
$t->type = "PPPOE";
|
||||
$t->save();
|
||||
}
|
||||
Message::sendTelegram("#u$c[username] #buy #PPPOE \n" . $p['name_plan'] .
|
||||
"\nRouter: " . $router_name .
|
||||
"\nGateway: " . $gateway .
|
||||
"\nChannel: " . $channel .
|
||||
"\nPrice: " . Lang::moneyFormat($p['price']));
|
||||
}
|
||||
|
||||
if ($p['validity_unit'] == 'Period' && $p['price'] != 0) {
|
||||
// insert to fields
|
||||
$fl = ORM::for_table('tbl_customers_fields')->where('field_name', 'Invoice')->where('customer_id', $c['id'])->find_one();
|
||||
if (!$fl) {
|
||||
$fl = ORM::for_table('tbl_customers_fields')->create();
|
||||
$fl->customer_id = $c['id'];
|
||||
$fl->field_name = 'Invoice';
|
||||
if ($gi > $p['price']) {
|
||||
$fl->field_value = $p['price'];
|
||||
} else {
|
||||
$fl->field_value = $gi;
|
||||
}
|
||||
$fl->save();
|
||||
} else {
|
||||
$fl->customer_id = $c['id'];
|
||||
$fl->field_value = $p['price'];
|
||||
$fl->save();
|
||||
}
|
||||
}
|
||||
|
||||
Message::sendTelegram("#u$c[username] $c[fullname] #buy #PPPOE \n" . $p['name_plan'] .
|
||||
"\nRouter: " . $router_name .
|
||||
"\nGateway: " . $gateway .
|
||||
"\nChannel: " . $channel .
|
||||
"\nPrice: " . Lang::moneyFormat($p['price']));
|
||||
}
|
||||
}
|
||||
if ($add_rem > 0) {
|
||||
User::setAttribute('Additional Remaining', ($add_rem - 1), $id_customer);
|
||||
}
|
||||
run_hook("recharge_user_finish");
|
||||
Message::sendInvoice($c, $t);
|
||||
return true;
|
||||
}
|
||||
@ -365,7 +573,7 @@ class Package
|
||||
public static function changeTo($username, $plan_id, $from_id)
|
||||
{
|
||||
$c = ORM::for_table('tbl_customers')->where('username', $username)->find_one();
|
||||
$p = ORM::for_table('tbl_plans')->where('id', $plan_id)->where('enabled', '1')->find_one();
|
||||
$p = ORM::for_table('tbl_plans')->where('id', $plan_id)->find_one();
|
||||
$b = ORM::for_table('tbl_user_recharges')->find_one($from_id);
|
||||
if ($p['routers'] == $b['routers'] && $b['routers'] != 'radius') {
|
||||
$mikrotik = Mikrotik::info($p['routers']);
|
||||
@ -442,9 +650,9 @@ class Package
|
||||
}
|
||||
|
||||
|
||||
public static function _raid($l)
|
||||
public static function _raid()
|
||||
{
|
||||
return substr(str_shuffle(str_repeat('0123456789', $l)), 0, $l);
|
||||
return ORM::for_table('tbl_transactions')->max('id') + 1;
|
||||
}
|
||||
|
||||
/**
|
||||
@ -477,7 +685,11 @@ class Package
|
||||
$invoice .= Lang::pads(Lang::T('Plan Name'), $in['plan_name'], ' ') . "\n";
|
||||
$invoice .= Lang::pads(Lang::T('Plan Price'), Lang::moneyFormat($in['price']), ' ') . "\n";
|
||||
$invoice .= Lang::pad($in['method'], ' ', 2) . "\n";
|
||||
|
||||
if(!empty($in['note'])){
|
||||
$invoice .= Lang::pad("", '=') . "\n";
|
||||
$invoice .= Lang::pad($in['note'], ' ', 2);
|
||||
}
|
||||
$invoice .= Lang::pad("", '=') . "\n";
|
||||
$invoice .= Lang::pads(Lang::T('Username'), $in['username'], ' ') . "\n";
|
||||
$invoice .= Lang::pads(Lang::T('Password'), '**********', ' ') . "\n";
|
||||
if ($in['type'] != 'Balance') {
|
||||
@ -501,7 +713,11 @@ class Package
|
||||
$invoice .= Lang::pads(Lang::T('Plan Name'), $in['plan_name'], ' ') . "\n";
|
||||
$invoice .= Lang::pads(Lang::T('Plan Price'), Lang::moneyFormat($in['price']), ' ') . "\n";
|
||||
$invoice .= Lang::pad($in['method'], ' ', 2) . "\n";
|
||||
|
||||
if(!empty($in['note'])){
|
||||
$invoice .= Lang::pad("", '=') . "\n";
|
||||
$invoice .= Lang::pad($in['note'], ' ', 2);
|
||||
}
|
||||
$invoice .= Lang::pad("", '=') . "\n";
|
||||
$invoice .= Lang::pads(Lang::T('Username'), $in['username'], ' ') . "\n";
|
||||
$invoice .= Lang::pads(Lang::T('Password'), '**********', ' ') . "\n";
|
||||
if ($in['type'] != 'Balance') {
|
||||
@ -511,6 +727,6 @@ class Package
|
||||
$invoice .= Lang::pad("", '=') . "\n";
|
||||
$invoice .= Lang::pad($config['note'], ' ', 2) . "\n";
|
||||
$ui->assign('whatsapp', urlencode("```$invoice```"));
|
||||
$ui->assign('in',$in);
|
||||
$ui->assign('in', $in);
|
||||
}
|
||||
}
|
||||
|
@ -8,15 +8,16 @@
|
||||
|
||||
class User
|
||||
{
|
||||
public static function getID(){
|
||||
public static function getID()
|
||||
{
|
||||
global $db_password;
|
||||
if(isset($_SESSION['uid']) && !empty($_SESSION['uid'])){
|
||||
if (isset($_SESSION['uid']) && !empty($_SESSION['uid'])) {
|
||||
return $_SESSION['uid'];
|
||||
}else if(isset($_COOKIE['uid'])){
|
||||
} else if (isset($_COOKIE['uid'])) {
|
||||
// id.time.sha1
|
||||
$tmp = explode('.',$_COOKIE['uid']);
|
||||
if(sha1($tmp[0].'.'.$tmp[1].'.'.$db_password)==$tmp[2]){
|
||||
if(time()-$tmp[1] < 86400*30){
|
||||
$tmp = explode('.', $_COOKIE['uid']);
|
||||
if (sha1($tmp[0] . '.' . $tmp[1] . '.' . $db_password) == $tmp[2]) {
|
||||
if (time() - $tmp[1] < 86400 * 30) {
|
||||
$_SESSION['uid'] = $tmp[0];
|
||||
return $tmp[0];
|
||||
}
|
||||
@ -25,35 +26,120 @@ class User
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static function setCookie($uid){
|
||||
global $db_password;
|
||||
if(isset($uid)){
|
||||
$time = time();
|
||||
setcookie('uid', $uid.'.'.$time.'.'.sha1($uid.'.'.$time.'.'.$db_password), time()+86400*30);
|
||||
}
|
||||
}
|
||||
|
||||
public static function removeCookie(){
|
||||
if(isset($_COOKIE['uid'])){
|
||||
setcookie('uid', '', time()-86400);
|
||||
}
|
||||
}
|
||||
|
||||
public static function _info()
|
||||
public static function setAttribute($name, $value, $id = 0)
|
||||
{
|
||||
$id = User::getID();
|
||||
if (!$id) {
|
||||
$id = User::getID();
|
||||
if (!$id) {
|
||||
return '';
|
||||
}
|
||||
}
|
||||
$f = ORM::for_table('tbl_customers_fields')->where('field_name', $name)->where('customer_id', $id)->find_one();
|
||||
if(!$f){
|
||||
$f = ORM::for_table('tbl_customers_fields')->create();
|
||||
$f->customer_id = $id;
|
||||
$f->field_name = $name;
|
||||
$f->field_value = $value;
|
||||
$f->save();
|
||||
$result = $f->id();
|
||||
if ($result) {
|
||||
return $result;
|
||||
}
|
||||
}else{
|
||||
$f->field_value = $value;
|
||||
$f->save();
|
||||
return $f['id'];
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
public static function getAttribute($name, $id = 0)
|
||||
{
|
||||
if (!$id) {
|
||||
$id = User::getID();
|
||||
if (!$id) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
$f = ORM::for_table('tbl_customers_fields')->where('field_name', $name)->where('customer_id', $id)->find_one();
|
||||
if ($f) {
|
||||
return $f['field_value'];
|
||||
}
|
||||
return '';
|
||||
}
|
||||
|
||||
public static function getAttributes($endWith, $id = 0)
|
||||
{
|
||||
if (!$id) {
|
||||
$id = User::getID();
|
||||
if (!$id) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
$attrs = [];
|
||||
$f = ORM::for_table('tbl_customers_fields')->where_like('field_name', "%$endWith")->where('customer_id', $id)->find_many();
|
||||
if ($f) {
|
||||
foreach ($f as $k) {
|
||||
$attrs[$k['field_name']] = $k['field_value'];
|
||||
}
|
||||
return $attrs;
|
||||
}
|
||||
return [];
|
||||
}
|
||||
|
||||
public static function setCookie($uid)
|
||||
{
|
||||
global $db_password;
|
||||
if (isset($uid)) {
|
||||
$time = time();
|
||||
setcookie('uid', $uid . '.' . $time . '.' . sha1($uid . '.' . $time . '.' . $db_password), time() + 86400 * 30);
|
||||
}
|
||||
}
|
||||
|
||||
public static function removeCookie()
|
||||
{
|
||||
if (isset($_COOKIE['uid'])) {
|
||||
setcookie('uid', '', time() - 86400);
|
||||
}
|
||||
}
|
||||
|
||||
public static function _info($id = 0)
|
||||
{
|
||||
if (!$id) {
|
||||
$id = User::getID();
|
||||
}
|
||||
$d = ORM::for_table('tbl_customers')->find_one($id);
|
||||
|
||||
if(empty($d['username'])){
|
||||
if (empty($d['username'])) {
|
||||
r2(U . 'logout', 'd', '');
|
||||
}
|
||||
return $d;
|
||||
}
|
||||
|
||||
public static function _billing()
|
||||
public static function _billing($id = 0)
|
||||
{
|
||||
$id = User::getID();
|
||||
$d = ORM::for_table('tbl_user_recharges')->where('customer_id', $id)->find_many();
|
||||
if (!$id) {
|
||||
$id = User::getID();
|
||||
}
|
||||
$d = ORM::for_table('tbl_user_recharges')
|
||||
->select('tbl_user_recharges.id', 'id')
|
||||
->select('customer_id')
|
||||
->select('username')
|
||||
->select('plan_id')
|
||||
->select('namebp')
|
||||
->select('recharged_on')
|
||||
->select('recharged_time')
|
||||
->select('expiration')
|
||||
->select('time')
|
||||
->select('status')
|
||||
->select('method')
|
||||
->select('tbl_user_recharges.routers', 'routers')
|
||||
->select('tbl_user_recharges.type', 'type')
|
||||
->select('admin_id')
|
||||
->select('prepaid')
|
||||
->where('customer_id', $id)
|
||||
->join('tbl_plans', array('tbl_plans.id', '=', 'tbl_user_recharges.plan_id'))
|
||||
->find_many();
|
||||
return $d;
|
||||
}
|
||||
}
|
||||
|
@ -78,9 +78,9 @@ $ui->assign('_domain', str_replace('www.', '', parse_url(APP_URL, PHP_URL_HOST))
|
||||
$ui->assign('_url', APP_URL . '/index.php?_route=');
|
||||
$ui->assign('_path', __DIR__);
|
||||
$ui->assign('_c', $config);
|
||||
$ui->assign('UPLOAD_PATH', $UPLOAD_PATH);
|
||||
$ui->assign('CACHE_PATH', $CACHE_PATH);
|
||||
$ui->assign('PAGES_PATH', $PAGES_PATH);
|
||||
$ui->assign('UPLOAD_PATH', str_replace($root_path, '', $UPLOAD_PATH));
|
||||
$ui->assign('CACHE_PATH', str_replace($root_path, '', $CACHE_PATH));
|
||||
$ui->assign('PAGES_PATH', str_replace($root_path, '', $PAGES_PATH));
|
||||
$ui->assign('_system_menu', 'dashboard');
|
||||
|
||||
function _msglog($type, $msg)
|
||||
|
@ -5,6 +5,10 @@
|
||||
* by https://t.me/ibnux
|
||||
**/
|
||||
|
||||
if(Admin::getID()){
|
||||
r2(U.'dashboard');
|
||||
}
|
||||
|
||||
if (isset($routes['1'])) {
|
||||
$do = $routes['1'];
|
||||
} else {
|
||||
|
@ -38,10 +38,18 @@ switch ($action) {
|
||||
case 'plan':
|
||||
$server = _post('server');
|
||||
$jenis = _post('jenis');
|
||||
if($server=='radius'){
|
||||
$d = ORM::for_table('tbl_plans')->where('is_radius', 1)->where('type', $jenis)->where('enabled', '1')->find_many();
|
||||
if(in_array($admin['user_type'], array('SuperAdmin', 'Admin'))){
|
||||
if($server=='radius'){
|
||||
$d = ORM::for_table('tbl_plans')->where('is_radius', 1)->where('type', $jenis)->find_many();
|
||||
}else{
|
||||
$d = ORM::for_table('tbl_plans')->where('routers', $server)->where('type', $jenis)->find_many();
|
||||
}
|
||||
}else{
|
||||
$d = ORM::for_table('tbl_plans')->where('routers', $server)->where('type', $jenis)->where('enabled', '1')->find_many();
|
||||
if($server=='radius'){
|
||||
$d = ORM::for_table('tbl_plans')->where('is_radius', 1)->where('type', $jenis)->where('enabled', '1')->find_many();
|
||||
}else{
|
||||
$d = ORM::for_table('tbl_plans')->where('routers', $server)->where('type', $jenis)->where('enabled', '1')->find_many();
|
||||
}
|
||||
}
|
||||
$ui->assign('d', $d);
|
||||
|
||||
|
@ -12,6 +12,9 @@ $ui->assign('_system_menu', 'customers');
|
||||
$action = $routes['1'];
|
||||
$ui->assign('_admin', $admin);
|
||||
|
||||
if (empty($action)) {
|
||||
$action = 'list';
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
case 'list':
|
||||
@ -45,7 +48,7 @@ switch ($action) {
|
||||
|
||||
case 'csv':
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'),'danger', "dashboard");
|
||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||
}
|
||||
$cs = ORM::for_table('tbl_customers')
|
||||
->select('tbl_customers.id', 'id')
|
||||
@ -83,29 +86,63 @@ switch ($action) {
|
||||
}
|
||||
break;
|
||||
case 'add':
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'),'danger', "dashboard");
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||
}
|
||||
run_hook('view_add_customer'); #HOOK
|
||||
$ui->display('customers-add.tpl');
|
||||
break;
|
||||
case 'recharge':
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'),'danger', "dashboard");
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||
}
|
||||
$id_customer = $routes['2'];
|
||||
$b = ORM::for_table('tbl_user_recharges')->where('customer_id', $id_customer)->find_one();
|
||||
if ($b) {
|
||||
if (Package::rechargeUser($id_customer, $b['routers'], $b['plan_id'], "Recharge", $admin['fullname'])) {
|
||||
r2(U . 'customers/view/' . $id_customer, 's', 'Success Recharge Customer');
|
||||
} else {
|
||||
r2(U . 'customers/view/' . $id_customer, 'e', 'Customer plan is inactive');
|
||||
$gateway = 'Recharge';
|
||||
$channel = $admin['fullname'];
|
||||
$cust = User::_info($id_customer);
|
||||
$plan = ORM::for_table('tbl_plans')->find_one($b['plan_id']);
|
||||
$add_cost = 0;
|
||||
$add_rem = User::getAttribute("Additional Remaining", $id_customer);
|
||||
if($add_rem != 0){
|
||||
$add_cost = User::getAttribute("Additional Cost", $id_customer);
|
||||
if (empty($add_cost)) {
|
||||
$add_cost = 0;
|
||||
}
|
||||
}
|
||||
if ($using == 'balance' && $config['enable_balance'] == 'yes') {
|
||||
if (!$cust) {
|
||||
r2(U . 'prepaid/recharge', 'e', Lang::T('Customer not found'));
|
||||
}
|
||||
if (!$plan) {
|
||||
r2(U . 'prepaid/recharge', 'e', Lang::T('Plan not found'));
|
||||
}
|
||||
if ($cust['balance'] < ($plan['price'] + $add_cost)) {
|
||||
r2(U . 'prepaid/recharge', 'e', Lang::T('insufficient balance'));
|
||||
}
|
||||
$gateway = 'Recharge Balance';
|
||||
}
|
||||
if ($using == 'zero') {
|
||||
$zero = 1;
|
||||
$gateway = 'Recharge Zero';
|
||||
}
|
||||
$bills = User::getAttributes("Bill", $id_customer);
|
||||
$ui->assign('bills', $bills);
|
||||
$ui->assign('add_cost', $add_cost);
|
||||
$ui->assign('add_rem', $add_rem);
|
||||
$ui->assign('cust', $cust);
|
||||
$ui->assign('gateway', $gateway);
|
||||
$ui->assign('channel', $channel);
|
||||
$ui->assign('server', $b['routers']);
|
||||
$ui->assign('using', 'cash');
|
||||
$ui->assign('plan', $plan);
|
||||
$ui->display('recharge-confirm.tpl');
|
||||
}
|
||||
r2(U . 'customers/view/' . $id_customer, 'e', 'Cannot find active plan');
|
||||
case 'deactivate':
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'),'danger', "dashboard");
|
||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||
}
|
||||
$id_customer = $routes['2'];
|
||||
$b = ORM::for_table('tbl_user_recharges')->where('customer_id', $id_customer)->find_one();
|
||||
@ -212,8 +249,8 @@ switch ($action) {
|
||||
}
|
||||
break;
|
||||
case 'edit':
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'),'danger', "dashboard");
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||
}
|
||||
$id = $routes['2'];
|
||||
run_hook('edit_customer'); #HOOK
|
||||
@ -233,7 +270,7 @@ switch ($action) {
|
||||
|
||||
case 'delete':
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'),'danger', "dashboard");
|
||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||
}
|
||||
$id = $routes['2'];
|
||||
run_hook('delete_customer'); #HOOK
|
||||
@ -274,7 +311,7 @@ switch ($action) {
|
||||
} catch (Throwable $e) {
|
||||
}
|
||||
try {
|
||||
$c->delete();
|
||||
if ($c) $c->delete();
|
||||
} catch (Exception $e) {
|
||||
} catch (Throwable $e) {
|
||||
}
|
||||
@ -462,6 +499,7 @@ switch ($action) {
|
||||
// Delete the Customers Attributes with the given field name
|
||||
ORM::for_table('tbl_customers_fields')
|
||||
->where('field_name', $fieldName)
|
||||
->where('customer_id', $id)
|
||||
->delete_many();
|
||||
}
|
||||
}
|
||||
@ -495,7 +533,7 @@ switch ($action) {
|
||||
}
|
||||
}
|
||||
}
|
||||
r2(U . 'customers/list', 's', 'User Updated Successfully');
|
||||
r2(U . 'customers/view/' . $id, 's', 'User Updated Successfully');
|
||||
} else {
|
||||
r2(U . 'customers/edit/' . $id, 'e', $msg);
|
||||
}
|
||||
|
@ -16,13 +16,18 @@ $first_day_month = date('Y-m-01');
|
||||
$mdate = date('Y-m-d');
|
||||
$month_n = date('n');
|
||||
|
||||
$iday = ORM::for_table('tbl_transactions')->where('recharged_on', $mdate)->sum('price');
|
||||
$iday = ORM::for_table('tbl_transactions')
|
||||
->where('recharged_on', $mdate)
|
||||
->where_not_equal('method', 'Customer - Balance')
|
||||
->where_not_equal('method', 'Recharge Balance - Administrator')
|
||||
->sum('price');
|
||||
|
||||
if ($iday == '') {
|
||||
$iday = '0.00';
|
||||
}
|
||||
$ui->assign('iday', $iday);
|
||||
|
||||
$imonth = ORM::for_table('tbl_transactions')->where_gte('recharged_on', $first_day_month)->where_lte('recharged_on', $mdate)->sum('price');
|
||||
$imonth = ORM::for_table('tbl_transactions')->where_not_equal('method', 'Customer - Balance')->where_not_equal('method', 'Recharge Balance - Administrator')->where_gte('recharged_on', $first_day_month)->where_lte('recharged_on', $mdate)->sum('price');
|
||||
if ($imonth == '') {
|
||||
$imonth = '0.00';
|
||||
}
|
||||
@ -144,6 +149,8 @@ if (file_exists($cacheMSfile) && time() - filemtime($cacheMSfile) < 43200) {
|
||||
->select_expr('MONTH(recharged_on)', 'month')
|
||||
->select_expr('SUM(price)', 'total')
|
||||
->where_raw("YEAR(recharged_on) = YEAR(CURRENT_DATE())") // Filter by the current year
|
||||
->where_not_equal('method', 'Customer - Balance')
|
||||
->where_not_equal('method', 'Recharge Balance - Administrator')
|
||||
->group_by_expr('MONTH(recharged_on)')
|
||||
->find_many();
|
||||
|
||||
|
@ -4,5 +4,10 @@
|
||||
* by https://t.me/ibnux
|
||||
**/
|
||||
|
||||
|
||||
r2(APP_URL.'/index.php?_route=dashboard');
|
||||
if(Admin::getID()){
|
||||
r2(U.'dashboard');
|
||||
}if(User::getID()){
|
||||
r2(U.'home');
|
||||
}else{
|
||||
r2(U.'login');
|
||||
}
|
||||
|
@ -62,10 +62,11 @@ switch ($action) {
|
||||
$title = ' Reports [' . $mdate . ']';
|
||||
$title = str_replace('-', ' ', $title);
|
||||
|
||||
$UPLOAD_URL_PATH = str_replace($root_path, '', $UPLOAD_PATH);
|
||||
if (file_exists($UPLOAD_PATH . '/logo.png')) {
|
||||
$logo = $UPLOAD_PATH . '/logo.png';
|
||||
$logo = $UPLOAD_URL_PATH . '/logo.png';
|
||||
} else {
|
||||
$logo = $UPLOAD_PATH . '/logo.default.png';
|
||||
$logo = $UPLOAD_URL_PATH . '/logo.default.png';
|
||||
}
|
||||
|
||||
if ($x) {
|
||||
@ -169,7 +170,7 @@ $style
|
||||
$html
|
||||
EOF;
|
||||
$mpdf->WriteHTML($nhtml);
|
||||
$mpdf->Output(date('Y-m-d') . Package::_raid(4) . '.pdf', 'D');
|
||||
$mpdf->Output(date('Ymd_His') . '.pdf', 'D');
|
||||
} else {
|
||||
echo 'No Data';
|
||||
}
|
||||
@ -234,10 +235,12 @@ EOF;
|
||||
|
||||
$title = ' Reports [' . $mdate . ']';
|
||||
$title = str_replace('-', ' ', $title);
|
||||
|
||||
$UPLOAD_URL_PATH = str_replace($root_path, '', $UPLOAD_PATH);
|
||||
if (file_exists($UPLOAD_PATH . '/logo.png')) {
|
||||
$logo = $UPLOAD_PATH . '/logo.png';
|
||||
$logo = $UPLOAD_URL_PATH . '/logo.png';
|
||||
} else {
|
||||
$logo = $UPLOAD_PATH . '/logo.default.png';
|
||||
$logo = $UPLOAD_URL_PATH . '/logo.default.png';
|
||||
}
|
||||
|
||||
if ($x) {
|
||||
@ -341,7 +344,7 @@ $style
|
||||
$html
|
||||
EOF;
|
||||
$mpdf->WriteHTML($nhtml);
|
||||
$mpdf->Output(date('Y-m-d') . Package::_raid(4) . '.pdf', 'D');
|
||||
$mpdf->Output(date('Ymd_His') . '.pdf', 'D');
|
||||
} else {
|
||||
echo 'No Data';
|
||||
}
|
||||
|
@ -99,9 +99,6 @@ if (isset($_GET['recharge']) && !empty($_GET['recharge'])) {
|
||||
if(!$plan['enabled']){
|
||||
r2(U . "home", 'e', 'Plan is not exists');
|
||||
}
|
||||
if($plan['allow_purchase'] != 'yes'){
|
||||
r2(U . "home", 'e', 'Cannot recharge this plan');
|
||||
}
|
||||
if ($user['balance'] > $plan['price']) {
|
||||
r2(U . "order/pay/$router[id]/$bill[plan_id]", 'e', 'Order Plan');
|
||||
} else {
|
||||
|
@ -5,6 +5,10 @@
|
||||
* by https://t.me/ibnux
|
||||
**/
|
||||
|
||||
if(User::getID()){
|
||||
r2(U.'home');
|
||||
}
|
||||
|
||||
if (isset($routes['1'])) {
|
||||
$do = $routes['1'];
|
||||
} else {
|
||||
|
@ -37,7 +37,7 @@ switch ($action) {
|
||||
}
|
||||
$ui->assign('_title', 'Top Up');
|
||||
$ui->assign('_system_menu', 'balance');
|
||||
$plans_balance = ORM::for_table('tbl_plans')->where('enabled', '1')->where('type', 'Balance')->where('allow_purchase', 'yes')->find_many();
|
||||
$plans_balance = ORM::for_table('tbl_plans')->where('enabled', '1')->where('type', 'Balance')->where('prepaid', 'yes')->find_many();
|
||||
$ui->assign('plans_balance', $plans_balance);
|
||||
$ui->display('user-orderBalance.tpl');
|
||||
break;
|
||||
@ -49,24 +49,24 @@ switch ($action) {
|
||||
$ui->assign('_system_menu', 'package');
|
||||
if (!empty($_SESSION['nux-router'])) {
|
||||
if ($_SESSION['nux-router'] == 'radius') {
|
||||
$radius_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 1)->where('type', 'PPPOE')->where('allow_purchase', 'yes')->find_many();
|
||||
$radius_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 1)->where('type', 'Hotspot')->where('allow_purchase', 'yes')->find_many();
|
||||
$radius_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 1)->where('type', 'PPPOE')->where('prepaid', 'yes')->find_many();
|
||||
$radius_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 1)->where('type', 'Hotspot')->where('prepaid', 'yes')->find_many();
|
||||
} else {
|
||||
$routers = ORM::for_table('tbl_routers')->where('id', $_SESSION['nux-router'])->find_many();
|
||||
$rs = [];
|
||||
foreach ($routers as $r) {
|
||||
$rs[] = $r['name'];
|
||||
}
|
||||
$plans_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where_in('routers', $rs)->where('is_radius', 0)->where('type', 'PPPOE')->where('allow_purchase', 'yes')->find_many();
|
||||
$plans_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where_in('routers', $rs)->where('is_radius', 0)->where('type', 'Hotspot')->where('allow_purchase', 'yes')->find_many();
|
||||
$plans_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where_in('routers', $rs)->where('is_radius', 0)->where('type', 'PPPOE')->where('prepaid', 'yes')->find_many();
|
||||
$plans_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where_in('routers', $rs)->where('is_radius', 0)->where('type', 'Hotspot')->where('prepaid', 'yes')->find_many();
|
||||
}
|
||||
} else {
|
||||
$radius_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 1)->where('type', 'PPPOE')->where('allow_purchase', 'yes')->find_many();
|
||||
$radius_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 1)->where('type', 'Hotspot')->where('allow_purchase', 'yes')->find_many();
|
||||
$radius_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 1)->where('type', 'PPPOE')->where('prepaid', 'yes')->find_many();
|
||||
$radius_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 1)->where('type', 'Hotspot')->where('prepaid', 'yes')->find_many();
|
||||
|
||||
$routers = ORM::for_table('tbl_routers')->find_many();
|
||||
$plans_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 0)->where('type', 'PPPOE')->where('allow_purchase', 'yes')->find_many();
|
||||
$plans_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 0)->where('type', 'Hotspot')->where('allow_purchase', 'yes')->find_many();
|
||||
$plans_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 0)->where('type', 'PPPOE')->where('prepaid', 'yes')->find_many();
|
||||
$plans_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 0)->where('type', 'Hotspot')->where('prepaid', 'yes')->find_many();
|
||||
}
|
||||
$ui->assign('routers', $routers);
|
||||
$ui->assign('radius_pppoe', $radius_pppoe);
|
||||
@ -114,7 +114,7 @@ switch ($action) {
|
||||
run_hook('customer_check_payment_status'); #HOOK
|
||||
include $PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $trx['gateway'] . '.php';
|
||||
call_user_func($trx['gateway'] . '_validate_config');
|
||||
call_user_func($config['payment_gateway'] . '_get_status', $trx, $user);
|
||||
call_user_func($trx['gateway'] . '_get_status', $trx, $user);
|
||||
} else if ($routes['3'] == 'cancel') {
|
||||
run_hook('customer_cancel_payment'); #HOOK
|
||||
$trx->pg_paid_response = '{}';
|
||||
@ -142,7 +142,7 @@ switch ($action) {
|
||||
$ui->display('user-orderView.tpl');
|
||||
break;
|
||||
case 'pay':
|
||||
if ($_c['enable_balance'] != 'yes' && $config['allow_balance_transfer'] != 'yes') {
|
||||
if ($config['enable_balance'] != 'yes') {
|
||||
r2(U . "order/package", 'e', Lang::T("Balance not enabled"));
|
||||
}
|
||||
$plan = ORM::for_table('tbl_plans')->where('enabled', '1')->find_one($routes['3']);
|
||||
@ -152,9 +152,6 @@ switch ($action) {
|
||||
if (!$plan['enabled']) {
|
||||
r2(U . "home", 'e', 'Plan is not exists');
|
||||
}
|
||||
if ($plan['allow_purchase'] != 'yes') {
|
||||
r2(U . "home", 'e', 'Cannot recharge this plan');
|
||||
}
|
||||
if ($routes['2'] == 'radius') {
|
||||
$router_name = 'radius';
|
||||
} else {
|
||||
@ -176,7 +173,7 @@ switch ($action) {
|
||||
}
|
||||
break;
|
||||
case 'send':
|
||||
if ($_c['enable_balance'] != 'yes') {
|
||||
if ($config['enable_balance'] != 'yes') {
|
||||
r2(U . "order/package", 'e', Lang::T("Balance not enabled"));
|
||||
}
|
||||
$ui->assign('_title', Lang::T('Buy for friend'));
|
||||
@ -188,9 +185,6 @@ switch ($action) {
|
||||
if (!$plan['enabled']) {
|
||||
r2(U . "home", 'e', 'Plan is not exists');
|
||||
}
|
||||
if ($plan['allow_purchase'] != 'yes') {
|
||||
r2(U . "home", 'e', 'Cannot recharge this plan');
|
||||
}
|
||||
if ($routes['2'] == 'radius') {
|
||||
$router_name = 'radius';
|
||||
} else {
|
||||
@ -266,19 +260,49 @@ switch ($action) {
|
||||
$ui->assign('plan', $plan);
|
||||
$ui->display('user-sendPlan.tpl');
|
||||
break;
|
||||
case 'buy':
|
||||
case 'gateway':
|
||||
$ui->assign('_title', Lang::T('Select Payment Gateway'));
|
||||
$ui->assign('_system_menu', 'package');
|
||||
if (strpos($user['email'], '@') === false) {
|
||||
r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address"));
|
||||
}
|
||||
if ($config['payment_gateway'] == 'none') {
|
||||
r2(U . 'home', 'e', Lang::T("No Payment Gateway Available"));
|
||||
$pgs = array_values(explode(',', $config['payment_gateway']));
|
||||
if(count($pgs)==0){
|
||||
sendTelegram("Payment Gateway not set, please set it in Settings");
|
||||
_log(Lang::T("Payment Gateway not set, please set it in Settings"));
|
||||
r2(U . "home", 'e', Lang::T("Failed to create Transaction.."));
|
||||
}
|
||||
if (!file_exists($PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $config['payment_gateway'] . '.php')) {
|
||||
r2(U . 'home', 'e', Lang::T("No Payment Gateway Available"));
|
||||
if(count($pgs)>1){
|
||||
$ui->assign('pgs',$pgs );
|
||||
//$ui->assign('pgs', $pgs);
|
||||
$ui->assign('route2', $routes[2]);
|
||||
$ui->assign('route3', $routes[3]);
|
||||
|
||||
//$ui->assign('plan', $plan);
|
||||
$ui->display('user-selectGateway.tpl');
|
||||
break;
|
||||
}else{
|
||||
if(empty($pgs[0])){
|
||||
sendTelegram("Payment Gateway not set, please set it in Settings");
|
||||
_log(Lang::T("Payment Gateway not set, please set it in Settings"));
|
||||
r2(U . "home", 'e', Lang::T("Failed to create Transaction.."));
|
||||
}else{
|
||||
$_POST['gateway'] = $pgs[0];
|
||||
}
|
||||
}
|
||||
case 'buy':
|
||||
$gateway = _post('gateway');
|
||||
if (empty($gateway) && !empty($_SESSION['gateway'])) {
|
||||
$gateway = $_SESSION['gateway'];
|
||||
} else if (!empty($gateway)) {
|
||||
$_SESSION['gateway'] = $gateway;
|
||||
}
|
||||
if (empty($gateway)) {
|
||||
r2(U . 'order/gateway/' . $routes[2] . '/' . $routes[3], 'w', Lang::T("Please select Payment Gateway"));
|
||||
}
|
||||
run_hook('customer_buy_plan'); #HOOK
|
||||
include $PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $config['payment_gateway'] . '.php';
|
||||
call_user_func($config['payment_gateway'] . '_validate_config');
|
||||
include $PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $gateway . '.php';
|
||||
call_user_func($gateway . '_validate_config');
|
||||
|
||||
if ($routes['2'] == 'radius') {
|
||||
$router['id'] = 0;
|
||||
@ -289,7 +313,7 @@ switch ($action) {
|
||||
$router['id'] = 0;
|
||||
$router['name'] = 'balance';
|
||||
}
|
||||
$plan = ORM::for_table('tbl_plans')->where('enabled', '1')->where('allow_purchase', 'yes')->find_one($routes['3']);
|
||||
$plan = ORM::for_table('tbl_plans')->where('enabled', '1')->find_one($routes['3']);
|
||||
if (empty($router) || empty($plan)) {
|
||||
r2(U . "order/package", 'e', Lang::T("Plan Not found"));
|
||||
}
|
||||
@ -301,7 +325,7 @@ switch ($action) {
|
||||
if ($d['pg_url_payment']) {
|
||||
r2(U . "order/view/" . $d['id'], 'w', Lang::T("You already have unpaid transaction, cancel it or pay it."));
|
||||
} else {
|
||||
if ($config['payment_gateway'] == $d['gateway']) {
|
||||
if ($gateway == $d['gateway']) {
|
||||
$id = $d['id'];
|
||||
} else {
|
||||
$d->status = 4;
|
||||
@ -312,7 +336,7 @@ switch ($action) {
|
||||
if (empty($id)) {
|
||||
$d = ORM::for_table('tbl_payment_gateway')->create();
|
||||
$d->username = $user['username'];
|
||||
$d->gateway = $config['payment_gateway'];
|
||||
$d->gateway = $gateway;
|
||||
$d->plan_id = $plan['id'];
|
||||
$d->plan_name = $plan['name_plan'];
|
||||
$d->routers_id = $router['id'];
|
||||
@ -324,7 +348,7 @@ switch ($action) {
|
||||
$id = $d->id();
|
||||
} else {
|
||||
$d->username = $user['username'];
|
||||
$d->gateway = $config['payment_gateway'];
|
||||
$d->gateway = $gateway;
|
||||
$d->plan_id = $plan['id'];
|
||||
$d->plan_name = $plan['name_plan'];
|
||||
$d->routers_id = $router['id'];
|
||||
@ -337,7 +361,7 @@ switch ($action) {
|
||||
if (!$id) {
|
||||
r2(U . "order/package/" . $d['id'], 'e', Lang::T("Failed to create Transaction.."));
|
||||
} else {
|
||||
call_user_func($config['payment_gateway'] . '_create_transaction', $d, $user);
|
||||
call_user_func($gateway . '_create_transaction', $d, $user);
|
||||
}
|
||||
break;
|
||||
default:
|
||||
|
@ -8,9 +8,35 @@
|
||||
_admin();
|
||||
$ui->assign('_system_menu', 'paymentgateway');
|
||||
|
||||
$action = alphanumeric($routes['1']);
|
||||
$action = alphanumeric($routes[1]);
|
||||
$ui->assign('_admin', $admin);
|
||||
|
||||
if ($action == 'delete') {
|
||||
$pg = alphanumeric($routes[2]);
|
||||
if (file_exists($PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $pg . '.php')) {
|
||||
deleteFile($PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR, $pg);
|
||||
}
|
||||
r2(U . 'paymentgateway', 's', Lang::T('Payment Gateway Deleted'));
|
||||
}
|
||||
|
||||
if (_post('save') == 'actives') {
|
||||
$pgs = '';
|
||||
if(is_array($_POST['pgs'])){
|
||||
$pgs = implode(',', $_POST['pgs']);
|
||||
}
|
||||
$d = ORM::for_table('tbl_appconfig')->where('setting', 'payment_gateway')->find_one();
|
||||
if ($d) {
|
||||
$d->value = $pgs;
|
||||
$d->save();
|
||||
} else {
|
||||
$d = ORM::for_table('tbl_appconfig')->create();
|
||||
$d->setting = 'payment_gateway';
|
||||
$d->value = $pgs;
|
||||
$d->save();
|
||||
}
|
||||
r2(U . 'paymentgateway', 's', Lang::T('Payment Gateway saved successfully'));
|
||||
}
|
||||
|
||||
if (file_exists($PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $action . '.php')) {
|
||||
include $PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $action . '.php';
|
||||
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
|
||||
@ -36,22 +62,22 @@ if (file_exists($PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $action . '.php'))
|
||||
$pgs[] = str_replace('.php', '', $file);
|
||||
}
|
||||
}
|
||||
if (isset($_POST['payment_gateway'])) {
|
||||
$payment_gateway = _post('payment_gateway');
|
||||
$d = ORM::for_table('tbl_appconfig')->where('setting', 'payment_gateway')->find_one();
|
||||
if ($d) {
|
||||
$d->value = $payment_gateway;
|
||||
$d->save();
|
||||
} else {
|
||||
$d = ORM::for_table('tbl_appconfig')->create();
|
||||
$d->setting = 'payment_gateway';
|
||||
$d->value = $payment_gateway;
|
||||
$d->save();
|
||||
}
|
||||
r2(U . 'paymentgateway', 's', Lang::T('Payment Gateway saved successfully'));
|
||||
}
|
||||
$ui->assign('_title', 'Payment Gateway Settings');
|
||||
$ui->assign('pgs', $pgs);
|
||||
$ui->assign('actives', explode(',', $config['payment_gateway']));
|
||||
$ui->display('paymentgateway.tpl');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function deleteFile($path, $name)
|
||||
{
|
||||
$files = scandir($path);
|
||||
foreach ($files as $file) {
|
||||
if (is_file($path . $file) && strpos($file, $name) !== false) {
|
||||
unlink($path . $file);
|
||||
} else if (is_dir($path . $file) && !in_array($file, ['.', '..'])) {
|
||||
deleteFile($path . $file . DIRECTORY_SEPARATOR, $name);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -32,9 +32,55 @@ if (file_exists($cache) && time() - filemtime($cache) < (24 * 60 * 60)) {
|
||||
file_put_contents($cache, $data);
|
||||
$json = json_decode($data, true);
|
||||
}
|
||||
|
||||
switch ($action) {
|
||||
case 'delete':
|
||||
if (!is_writeable($CACHE_PATH)) {
|
||||
r2(U . "pluginmanager", 'e', 'Folder cache/ is not writable');
|
||||
}
|
||||
if (!is_writeable($PLUGIN_PATH)) {
|
||||
r2(U . "pluginmanager", 'e', 'Folder plugin/ is not writable');
|
||||
}
|
||||
set_time_limit(-1);
|
||||
$tipe = $routes['2'];
|
||||
$plugin = $routes['3'];
|
||||
$file = $CACHE_PATH . DIRECTORY_SEPARATOR . $plugin . '.zip';
|
||||
if (file_exists($file)) unlink($file);
|
||||
if ($tipe == 'plugin') {
|
||||
foreach ($json['plugins'] as $plg) {
|
||||
if ($plg['id'] == $plugin) {
|
||||
$fp = fopen($file, 'w+');
|
||||
$ch = curl_init($plg['github'] . '/archive/refs/heads/master.zip');
|
||||
curl_setopt($ch, CURLOPT_POST, 0);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
|
||||
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
|
||||
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
|
||||
curl_setopt($ch, CURLOPT_FILE, $fp);
|
||||
curl_exec($ch);
|
||||
curl_close($ch);
|
||||
fclose($fp);
|
||||
|
||||
$zip = new ZipArchive();
|
||||
$zip->open($file);
|
||||
$zip->extractTo($CACHE_PATH);
|
||||
$zip->close();
|
||||
$folder = $CACHE_PATH . File::pathFixer('/' . $plugin . '-main/');
|
||||
if (!file_exists($folder)) {
|
||||
$folder = $CACHE_PATH . File::pathFixer('/' . $plugin . '-master/');
|
||||
}
|
||||
if (!file_exists($folder)) {
|
||||
r2(U . "pluginmanager", 'e', 'Extracted Folder is unknown');
|
||||
}
|
||||
scanAndRemovePath($folder, $PLUGIN_PATH . DIRECTORY_SEPARATOR);
|
||||
File::deleteFolder($folder);
|
||||
unlink($file);
|
||||
r2(U . "pluginmanager", 's', 'Plugin ' . $plugin . ' has been deleted');
|
||||
break;
|
||||
}
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
case 'install':
|
||||
if (!is_writeable($CACHE_PATH)) {
|
||||
r2(U . "pluginmanager", 'e', 'Folder cache/ is not writable');
|
||||
@ -45,7 +91,7 @@ switch ($action) {
|
||||
set_time_limit(-1);
|
||||
$tipe = $routes['2'];
|
||||
$plugin = $routes['3'];
|
||||
$file = $CACHE_PATH . File::pathFixer('/') . $plugin . '.zip';
|
||||
$file = $CACHE_PATH . DIRECTORY_SEPARATOR . $plugin . '.zip';
|
||||
if (file_exists($file)) unlink($file);
|
||||
if ($tipe == 'plugin') {
|
||||
foreach ($json['plugins'] as $plg) {
|
||||
@ -127,3 +173,24 @@ switch ($action) {
|
||||
$ui->assign('pgs', $json['payment_gateway']);
|
||||
$ui->display('plugin-manager.tpl');
|
||||
}
|
||||
|
||||
|
||||
function scanAndRemovePath($source, $target)
|
||||
{
|
||||
$files = scandir($source);
|
||||
foreach ($files as $file) {
|
||||
if (is_file($source . $file)) {
|
||||
if(file_exists($target.$file)){
|
||||
unlink($target . $file);
|
||||
}
|
||||
} else if (is_dir($source . $file) && !in_array($file, ['.', '..'])) {
|
||||
scanAndRemovePath($source. $file. DIRECTORY_SEPARATOR, $target. $file. DIRECTORY_SEPARATOR);
|
||||
if(file_exists($target.$file)){
|
||||
rmdir($target . $file);
|
||||
}
|
||||
}
|
||||
}
|
||||
if(file_exists($target)){
|
||||
rmdir($target);
|
||||
}
|
||||
}
|
@ -89,10 +89,6 @@ switch ($action) {
|
||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||
}
|
||||
$ui->assign('xfooter', $select2_customer);
|
||||
$p = ORM::for_table('tbl_plans')->where('enabled', '1')->find_many();
|
||||
$ui->assign('p', $p);
|
||||
$r = ORM::for_table('tbl_routers')->where('enabled', '1')->find_many();
|
||||
$ui->assign('r', $r);
|
||||
if (isset($routes['2']) && !empty($routes['2'])) {
|
||||
$ui->assign('cust', ORM::for_table('tbl_customers')->find_one($routes['2']));
|
||||
}
|
||||
@ -100,21 +96,63 @@ switch ($action) {
|
||||
$ui->display('recharge.tpl');
|
||||
break;
|
||||
|
||||
case 'recharge-user':
|
||||
case 'recharge-confirm':
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||
}
|
||||
$id = $routes['2'];
|
||||
$ui->assign('id', $id);
|
||||
$id_customer = _post('id_customer');
|
||||
$server = _post('server');
|
||||
$planId = _post('plan');
|
||||
$using = _post('using');
|
||||
|
||||
$c = ORM::for_table('tbl_customers')->find_many();
|
||||
$ui->assign('c', $c);
|
||||
$p = ORM::for_table('tbl_plans')->where('enabled', '1')->find_many();
|
||||
$ui->assign('p', $p);
|
||||
$r = ORM::for_table('tbl_routers')->where('enabled', '1')->find_many();
|
||||
$ui->assign('r', $r);
|
||||
run_hook('view_recharge_customer'); #HOOK
|
||||
$ui->display('recharge-user.tpl');
|
||||
$msg = '';
|
||||
if ($id_customer == '' or $server == '' or $planId == '' or $using == '') {
|
||||
$msg .= Lang::T('All field is required') . '<br>';
|
||||
}
|
||||
|
||||
if ($msg == '') {
|
||||
$gateway = 'Recharge';
|
||||
$channel = $admin['fullname'];
|
||||
$cust = User::_info($id_customer);
|
||||
$plan = ORM::for_table('tbl_plans')->find_one($planId);
|
||||
$add_cost = 0;
|
||||
$add_rem = User::getAttribute("Additional Remaining", $id_customer);
|
||||
if($add_rem != 0){
|
||||
$add_cost = User::getAttribute("Additional Cost", $id_customer);
|
||||
if (empty($add_cost)) {
|
||||
$add_cost = 0;
|
||||
}
|
||||
}
|
||||
if ($using == 'balance' && $config['enable_balance'] == 'yes') {
|
||||
if (!$cust) {
|
||||
r2(U . 'prepaid/recharge', 'e', Lang::T('Customer not found'));
|
||||
}
|
||||
if (!$plan) {
|
||||
r2(U . 'prepaid/recharge', 'e', Lang::T('Plan not found'));
|
||||
}
|
||||
if ($cust['balance'] < ($plan['price'] + $add_cost)) {
|
||||
r2(U . 'prepaid/recharge', 'e', Lang::T('insufficient balance'));
|
||||
}
|
||||
$gateway = 'Recharge Balance';
|
||||
}
|
||||
if ($using == 'zero') {
|
||||
$zero = 1;
|
||||
$gateway = 'Recharge Zero';
|
||||
}
|
||||
$bills = User::getAttributes("Bill", $id_customer);
|
||||
$ui->assign('bills', $bills);
|
||||
$ui->assign('add_cost', $add_cost);
|
||||
$ui->assign('add_rem', $add_rem);
|
||||
$ui->assign('cust', $cust);
|
||||
$ui->assign('gateway', $gateway);
|
||||
$ui->assign('channel', $channel);
|
||||
$ui->assign('server', $server);
|
||||
$ui->assign('using', $using);
|
||||
$ui->assign('plan', $plan);
|
||||
$ui->display('recharge-confirm.tpl');
|
||||
} else {
|
||||
r2(U . 'prepaid/recharge', 'e', $msg);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'recharge-post':
|
||||
@ -122,24 +160,53 @@ switch ($action) {
|
||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||
}
|
||||
$id_customer = _post('id_customer');
|
||||
$type = _post('type');
|
||||
$server = _post('server');
|
||||
$plan = _post('plan');
|
||||
$date_only = date("Y-m-d");
|
||||
$time = date("H:i:s");
|
||||
$planId = _post('plan');
|
||||
$using = _post('using');
|
||||
|
||||
$msg = '';
|
||||
if ($id_customer == '' or $type == '' or $server == '' or $plan == '') {
|
||||
$msg .= 'All field is required' . '<br>';
|
||||
if ($id_customer == '' or $server == '' or $planId == '' or $using == '') {
|
||||
$msg .= Lang::T('All field is required') . '<br>';
|
||||
}
|
||||
|
||||
if ($msg == '') {
|
||||
if (Package::rechargeUser($id_customer, $server, $plan, "Recharge", $admin['fullname'])) {
|
||||
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
|
||||
$in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one();
|
||||
$gateway = 'Recharge';
|
||||
$channel = $admin['fullname'];
|
||||
$cust = User::_info($id_customer);
|
||||
$add_cost = 0;
|
||||
$add_rem = User::getAttribute("Additional Remaining", $id_customer);
|
||||
if($add_rem != 0){
|
||||
$add_cost = User::getAttribute("Additional Cost", $id_customer);
|
||||
if (empty($add_cost)) {
|
||||
$add_cost = 0;
|
||||
}
|
||||
}
|
||||
if ($using == 'balance' && $config['enable_balance'] == 'yes') {
|
||||
$plan = ORM::for_table('tbl_plans')->find_one($planId);
|
||||
if (!$cust) {
|
||||
r2(U . 'prepaid/recharge', 'e', Lang::T('Customer not found'));
|
||||
}
|
||||
if (!$plan) {
|
||||
r2(U . 'prepaid/recharge', 'e', Lang::T('Plan not found'));
|
||||
}
|
||||
if ($cust['balance'] < ($plan['price'] + $add_cost)) {
|
||||
r2(U . 'prepaid/recharge', 'e', Lang::T('insufficient balance'));
|
||||
}
|
||||
$gateway = 'Recharge Balance';
|
||||
}
|
||||
if ($using == 'zero') {
|
||||
$add_cost = 0;
|
||||
$zero = 1;
|
||||
$gateway = 'Recharge Zero';
|
||||
}
|
||||
if (Package::rechargeUser($id_customer, $server, $planId, $gateway, $channel)) {
|
||||
if ($using == 'balance') {
|
||||
Balance::min($cust['id'], $plan['price'] + $add_cost);
|
||||
}
|
||||
$in = ORM::for_table('tbl_transactions')->where('username', $cust['username'])->order_by_desc('id')->find_one();
|
||||
Package::createInvoice($in);
|
||||
$ui->display('invoice.tpl');
|
||||
_log('[' . $admin['username'] . ']: ' . 'Recharge ' . $c['username'] . ' [' . $in['plan_name'] . '][' . Lang::moneyFormat($in['price']) . ']', $admin['user_type'], $admin['id']);
|
||||
_log('[' . $admin['username'] . ']: ' . 'Recharge ' . $cust['username'] . ' [' . $in['plan_name'] . '][' . Lang::moneyFormat($in['price']) . ']', $admin['user_type'], $admin['id']);
|
||||
} else {
|
||||
r2(U . 'prepaid/recharge', 'e', "Failed to recharge account");
|
||||
}
|
||||
@ -193,7 +260,11 @@ switch ($action) {
|
||||
$d = ORM::for_table('tbl_user_recharges')->find_one($id);
|
||||
if ($d) {
|
||||
$ui->assign('d', $d);
|
||||
$p = ORM::for_table('tbl_plans')->where('enabled', '1')->where_not_equal('type', 'Balance')->find_many();
|
||||
if (in_array($admin['user_type'], array('SuperAdmin', 'Admin'))) {
|
||||
$p = ORM::for_table('tbl_plans')->where_not_equal('type', 'Balance')->find_many();
|
||||
} else {
|
||||
$p = ORM::for_table('tbl_plans')->where('enabled', '1')->where_not_equal('type', 'Balance')->find_many();
|
||||
}
|
||||
$ui->assign('p', $p);
|
||||
run_hook('view_edit_customer_plan'); #HOOK
|
||||
$ui->assign('_title', 'Edit Plan');
|
||||
@ -283,7 +354,7 @@ switch ($action) {
|
||||
break;
|
||||
|
||||
case 'voucher':
|
||||
$ui->assign('_title', Lang::T('Prepaid Vouchers'));
|
||||
$ui->assign('_title', Lang::T('Vouchers'));
|
||||
$limit = 10;
|
||||
$page = _get('p', 0);
|
||||
$pageNow = $page * $limit;
|
||||
@ -669,7 +740,11 @@ switch ($action) {
|
||||
}
|
||||
$ui->assign('_title', Lang::T('Refill Balance'));
|
||||
$ui->assign('xfooter', $select2_customer);
|
||||
$ui->assign('p', ORM::for_table('tbl_plans')->where('enabled', '1')->where('type', 'Balance')->find_many());
|
||||
if (in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
|
||||
$ui->assign('p', ORM::for_table('tbl_plans')->where('type', 'Balance')->find_many());
|
||||
} else {
|
||||
$ui->assign('p', ORM::for_table('tbl_plans')->where('enabled', '1')->where('type', 'Balance')->find_many());
|
||||
}
|
||||
run_hook('view_deposit'); #HOOK
|
||||
$ui->display('deposit.tpl');
|
||||
break;
|
||||
|
@ -201,7 +201,7 @@ switch ($action) {
|
||||
$pool_expired = _post('pool_expired');
|
||||
$list_expired = _post('list_expired');
|
||||
$enabled = _post('enabled');
|
||||
$allow_purchase = _post('allow_purchase');
|
||||
$prepaid = _post('prepaid');
|
||||
|
||||
$msg = '';
|
||||
if (Validator::UnsignedNumber($validity) == false) {
|
||||
@ -269,7 +269,7 @@ switch ($action) {
|
||||
$d->pool_expired = $pool_expired;
|
||||
$d->list_expired = $list_expired;
|
||||
$d->enabled = $enabled;
|
||||
$d->allow_purchase = $allow_purchase;
|
||||
$d->prepaid = $prepaid;
|
||||
$d->save();
|
||||
$plan_id = $d->id();
|
||||
|
||||
@ -309,7 +309,7 @@ switch ($action) {
|
||||
$pool_expired = _post('pool_expired');
|
||||
$list_expired = _post('list_expired');
|
||||
$enabled = _post('enabled');
|
||||
$allow_purchase = _post('allow_purchase');
|
||||
$prepaid = _post('prepaid');
|
||||
$routers = _post('routers');
|
||||
$msg = '';
|
||||
if (Validator::UnsignedNumber($validity) == false) {
|
||||
@ -374,7 +374,7 @@ switch ($action) {
|
||||
$d->pool_expired = $pool_expired;
|
||||
$d->list_expired = $list_expired;
|
||||
$d->enabled = $enabled;
|
||||
$d->allow_purchase = $allow_purchase;
|
||||
$d->prepaid = $prepaid;
|
||||
$d->save();
|
||||
|
||||
r2(U . 'services/hotspot', 's', Lang::T('Data Updated Successfully'));
|
||||
@ -471,7 +471,7 @@ switch ($action) {
|
||||
$pool_expired = _post('pool_expired');
|
||||
$list_expired = _post('list_expired');
|
||||
$enabled = _post('enabled');
|
||||
$allow_purchase = _post('allow_purchase');
|
||||
$prepaid = _post('prepaid');
|
||||
|
||||
|
||||
$msg = '';
|
||||
@ -533,7 +533,7 @@ switch ($action) {
|
||||
$d->pool_expired = $pool_expired;
|
||||
$d->list_expired = $list_expired;
|
||||
$d->enabled = $enabled;
|
||||
$d->allow_purchase = $allow_purchase;
|
||||
$d->prepaid = $prepaid;
|
||||
$d->save();
|
||||
$plan_id = $d->id();
|
||||
|
||||
@ -566,7 +566,7 @@ switch ($action) {
|
||||
$pool_expired = _post('pool_expired');
|
||||
$list_expired = _post('list_expired');
|
||||
$enabled = _post('enabled');
|
||||
$allow_purchase = _post('allow_purchase');
|
||||
$prepaid = _post('prepaid');
|
||||
|
||||
$msg = '';
|
||||
if (Validator::UnsignedNumber($validity) == false) {
|
||||
@ -626,7 +626,7 @@ switch ($action) {
|
||||
$d->pool_expired = $pool_expired;
|
||||
$d->list_expired = $list_expired;
|
||||
$d->enabled = $enabled;
|
||||
$d->allow_purchase = $allow_purchase;
|
||||
$d->prepaid = $prepaid;
|
||||
$d->save();
|
||||
|
||||
r2(U . 'services/pppoe', 's', Lang::T('Data Updated Successfully'));
|
||||
@ -678,7 +678,7 @@ switch ($action) {
|
||||
$name = _post('name');
|
||||
$price = _post('price');
|
||||
$enabled = _post('enabled');
|
||||
$allow_purchase = _post('allow_purchase');
|
||||
$prepaid = _post('prepaid');
|
||||
|
||||
$msg = '';
|
||||
if (Validator::UnsignedNumber($price) == false) {
|
||||
@ -698,7 +698,7 @@ switch ($action) {
|
||||
$d->name_plan = $name;
|
||||
$d->price = $price;
|
||||
$d->enabled = $enabled;
|
||||
$d->allow_purchase = $allow_purchase;
|
||||
$d->prepaid = 'yes';
|
||||
$d->save();
|
||||
|
||||
r2(U . 'services/balance', 's', Lang::T('Data Updated Successfully'));
|
||||
@ -710,7 +710,6 @@ switch ($action) {
|
||||
$name = _post('name');
|
||||
$price = _post('price');
|
||||
$enabled = _post('enabled');
|
||||
$allow_purchase = _post('allow_purchase');
|
||||
|
||||
$msg = '';
|
||||
if (Validator::UnsignedNumber($price) == false) {
|
||||
@ -736,7 +735,7 @@ switch ($action) {
|
||||
$d->routers = '';
|
||||
$d->pool = '';
|
||||
$d->enabled = $enabled;
|
||||
$d->allow_purchase = $allow_purchase;
|
||||
$d->prepaid = 'yes';
|
||||
$d->save();
|
||||
|
||||
r2(U . 'services/balance', 's', Lang::T('Data Created Successfully'));
|
||||
|
@ -30,15 +30,16 @@ switch ($action) {
|
||||
r2(U . "settings/app", 's', 'Test Telegram has been send<br>Result: ' . $result);
|
||||
}
|
||||
|
||||
$UPLOAD_URL_PATH = str_replace($root_path,'', $UPLOAD_PATH);
|
||||
if (file_exists($UPLOAD_PATH . DIRECTORY_SEPARATOR . 'logo.png')) {
|
||||
$logo = $UPLOAD_PATH . DIRECTORY_SEPARATOR . 'logo.png?' . time();
|
||||
$logo = $UPLOAD_URL_PATH . DIRECTORY_SEPARATOR . 'logo.png?' . time();
|
||||
} else {
|
||||
$logo = $UPLOAD_PATH . DIRECTORY_SEPARATOR . 'logo.default.png';
|
||||
$logo = $UPLOAD_URL_PATH . DIRECTORY_SEPARATOR . 'logo.default.png';
|
||||
}
|
||||
$ui->assign('logo', $logo);
|
||||
if ($_c['radius_enable'] && empty($_c['radius_client'])) {
|
||||
if ($config['radius_enable'] && empty($config['radius_client'])) {
|
||||
try {
|
||||
$_c['radius_client'] = Radius::getClient();
|
||||
$config['radius_client'] = Radius::getClient();
|
||||
$ui->assign('_c', $_c);
|
||||
} catch (Exception $e) {
|
||||
//ignore
|
||||
@ -495,11 +496,11 @@ switch ($action) {
|
||||
$date_now = date("Y-m-d H:i:s");
|
||||
run_hook('add_admin'); #HOOK
|
||||
if ($msg == '') {
|
||||
$password = Password::_crypt($password);
|
||||
$passwordC = Password::_crypt($password);
|
||||
$d = ORM::for_table('tbl_users')->create();
|
||||
$d->username = $username;
|
||||
$d->fullname = $fullname;
|
||||
$d->password = $password;
|
||||
$d->password = $passwordC;
|
||||
$d->user_type = $user_type;
|
||||
$d->phone = $phone;
|
||||
$d->email = $email;
|
||||
|
@ -49,7 +49,11 @@ switch ($action) {
|
||||
$ui->display('user-activation-list.tpl');
|
||||
|
||||
break;
|
||||
|
||||
case 'invoice':
|
||||
$id = $routes[2];
|
||||
$in = ORM::for_table('tbl_transactions')->where('username', $user['username'])->where('id', $id)->find_one();
|
||||
Package::createInvoice($in);
|
||||
$ui->display('invoice-customer.tpl');
|
||||
default:
|
||||
$ui->display('a404.tpl');
|
||||
}
|
||||
|
@ -24,7 +24,7 @@ echo "Found " . count($d) . " user(s)\n";
|
||||
run_hook('cronjob'); #HOOK
|
||||
|
||||
foreach ($d as $ds) {
|
||||
if ($ds['type'] == 'Hotspot') {
|
||||
if ($ds['type'] == 'Hotspot') { # HOTSPOT
|
||||
$date_now = strtotime(date("Y-m-d H:i:s"));
|
||||
$expiration = strtotime($ds['expiration'] . ' ' . $ds['time']);
|
||||
echo $ds['expiration'] . " : " . (($isCli) ? $ds['username'] : Lang::maskText($ds['username']));
|
||||
@ -54,14 +54,14 @@ foreach ($d as $ds) {
|
||||
}
|
||||
Mikrotik::removeHotspotActiveUser($client, $c['username']);
|
||||
}
|
||||
echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $u['namebp'], $price, $textExpired, $config['user_notification_expired'])."\n";
|
||||
echo Message::sendPackageNotification($c, $u['namebp'], $price, $textExpired, $config['user_notification_expired'])."\n";
|
||||
//update database user dengan status off
|
||||
$u->status = 'off';
|
||||
$u->save();
|
||||
|
||||
// autorenewal from deposit
|
||||
if ($config['enable_balance'] == 'yes' && $c['auto_renewal']) {
|
||||
if ($p && $p['enabled'] && $c['balance'] >= $p['price'] && $p['allow_purchase'] == 'yes') {
|
||||
if ($p && $p['enabled'] && $c['balance'] >= $p['price']) {
|
||||
if (Package::rechargeUser($ds['customer_id'], $p['routers'], $p['id'], 'Customer', 'Balance')) {
|
||||
// if success, then get the balance
|
||||
Balance::min($ds['customer_id'], $p['price']);
|
||||
@ -82,7 +82,7 @@ foreach ($d as $ds) {
|
||||
}
|
||||
} else
|
||||
echo " : ACTIVE \r\n";
|
||||
} else {
|
||||
} else { # PPPOE
|
||||
$date_now = strtotime(date("Y-m-d H:i:s"));
|
||||
$expiration = strtotime($ds['expiration'] . ' ' . $ds['time']);
|
||||
echo $ds['expiration'] . " : " . (($isCli) ? $ds['username'] : Lang::maskText($ds['username']));
|
||||
@ -109,14 +109,14 @@ foreach ($d as $ds) {
|
||||
}
|
||||
Mikrotik::removePpoeActive($client, $c['username']);
|
||||
}
|
||||
echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $u['namebp'], $price, $textExpired, $config['user_notification_expired'])."\n";
|
||||
echo Message::sendPackageNotification($c, $u['namebp'], $price, $textExpired, $config['user_notification_expired'])."\n";
|
||||
|
||||
$u->status = 'off';
|
||||
$u->save();
|
||||
|
||||
// autorenewal from deposit
|
||||
if ($config['enable_balance'] == 'yes' && $c['auto_renewal']) {
|
||||
if ($p && $p['enabled'] && $c['balance'] >= $p['price'] && $p['allow_purchase'] == 'yes') {
|
||||
if ($p && $p['enabled'] && $c['balance'] >= $p['price']) {
|
||||
if (Package::rechargeUser($ds['customer_id'], $p['routers'], $p['id'], 'Customer', 'Balance')) {
|
||||
// if success, then get the balance
|
||||
Balance::min($ds['customer_id'], $p['price']);
|
||||
|
@ -40,11 +40,11 @@ foreach ($d as $ds) {
|
||||
$c = ORM::for_table('tbl_customers')->where('id', $ds['customer_id'])->find_one();
|
||||
$price = Lang::moneyFormat($p['price']);
|
||||
if ($ds['expiration'] == $day7) {
|
||||
echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $p['name_plan'], $price, Lang::getNotifText('reminder_7_day'), $config['user_notification_reminder']) . "\n";
|
||||
echo Message::sendPackageNotification($c, $p['name_plan'], $price, Lang::getNotifText('reminder_7_day'), $config['user_notification_reminder']) . "\n";
|
||||
} else if ($ds['expiration'] == $day3) {
|
||||
echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $p['name_plan'], $price, Lang::getNotifText('reminder_3_day'), $config['user_notification_reminder']) . "\n";
|
||||
echo Message::sendPackageNotification($c, $p['name_plan'], $price, Lang::getNotifText('reminder_3_day'), $config['user_notification_reminder']) . "\n";
|
||||
} else if ($ds['expiration'] == $day1) {
|
||||
echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $p['name_plan'], $price, Lang::getNotifText('reminder_1_day'), $config['user_notification_reminder']) . "\n";
|
||||
echo Message::sendPackageNotification($c, $p['name_plan'], $price, Lang::getNotifText('reminder_1_day'), $config['user_notification_reminder']) . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -384,7 +384,6 @@
|
||||
"After_Customer_activate_voucher_or_login__customer_will_be_redirected_to_this_url": "After Customer activate voucher or login, customer will be redirected to this url",
|
||||
"Voucher_Prefix": "Voucher Prefix",
|
||||
"Voucher_activation_success__now_you_can_login": "Voucher activation success, now you can login",
|
||||
"Client_Can_Purchase": "Client Can Purchase",
|
||||
"Buy_this__your_active_package_will_be_overwritten": "Buy this? your active package will be overwritten",
|
||||
"Pay_this_with_Balance__your_active_package_will_be_overwritten": "Pay this with Balance? your active package will be overwritten",
|
||||
"Buy_this__your_active_package_will_be_overwrite": "Buy this? your active package will be overwrite",
|
||||
@ -456,5 +455,37 @@
|
||||
"Click_Here": "Click Here",
|
||||
"danger": "danger",
|
||||
"Logout_Successful": "Logout Successful",
|
||||
"warning": "warning"
|
||||
"warning": "warning",
|
||||
"Users_Announcement": "Users Announcement",
|
||||
"Customer_Announcement": "Customer Announcement",
|
||||
"1_Period___1_Month__Expires_the_20th_of_each_month": "1 Period = 1 Month, Expires the 20th of each month",
|
||||
"Period": "Period",
|
||||
"Add": "Add",
|
||||
"Select_Payment_Gateway": "Select Payment Gateway",
|
||||
"Available_Payment_Gateway": "Available Payment Gateway",
|
||||
"Pay_Now": "Pay Now",
|
||||
"Please_select_Payment_Gateway": "Please select Payment Gateway",
|
||||
"Payment_Gateway_Deleted": "Payment Gateway Deleted",
|
||||
"Payment_Gateway_not_set__please_set_it_in_Settings": "Payment Gateway not set, please set it in Settings",
|
||||
"Failed_to_create_Transaction__": "Failed to create Transaction..",
|
||||
"Show_To_Customer": "Type",
|
||||
"Using": "Using",
|
||||
"Default": "Default",
|
||||
"Customer_Balance": "Customer Balance",
|
||||
"Vouchers": "Vouchers",
|
||||
"Refill_Customer": "Refill Customer",
|
||||
"Recharge_Customer": "Recharge Customer",
|
||||
"Plans": "Plans",
|
||||
"PPPOE": "PPPOE",
|
||||
"Bandwidth": "Bandwidth",
|
||||
"Customers": "Customers",
|
||||
"Actives": "Actives",
|
||||
"Name": "Name",
|
||||
"Confirm": "Confirm",
|
||||
"Plan": "Plan",
|
||||
"Total": "Total",
|
||||
"Current_Cycle": "Current Cycle",
|
||||
"Additional_Cost": "Additional Cost",
|
||||
"Remaining": "Remaining",
|
||||
"": ""
|
||||
}
|
@ -69,5 +69,14 @@
|
||||
"2024.2.23" : [
|
||||
"ALTER TABLE `tbl_transactions` ADD `admin_id` INT NOT NULL DEFAULT '1' AFTER `type`;",
|
||||
"ALTER TABLE `tbl_user_recharges` ADD `admin_id` INT NOT NULL DEFAULT '1' AFTER `type`;"
|
||||
],
|
||||
"2024.3.3" : [
|
||||
"ALTER TABLE `tbl_plans` CHANGE `validity_unit` `validity_unit` ENUM('Mins','Hrs','Days','Months','Period') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;"
|
||||
],
|
||||
"2024.3.12" : [
|
||||
"ALTER TABLE `tbl_plans` CHANGE `allow_purchase` `prepaid` ENUM('yes','no') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'yes' COMMENT 'is prepaid';"
|
||||
],
|
||||
"2024.3.14" : [
|
||||
"ALTER TABLE `tbl_transactions` ADD `note` VARCHAR(256) NOT NULL DEFAULT '' COMMENT 'for note' AFTER `type`;"
|
||||
]
|
||||
}
|
@ -4,19 +4,19 @@
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
||||
<title>{$_title} - {Lang::T('Login')}</title>
|
||||
<title>{Lang::T('Login')} - {$_c['CompanyName']}</title>
|
||||
<link rel="shortcut icon" href="ui/ui/images/logo.png" type="image/x-icon" />
|
||||
|
||||
<link rel="stylesheet" href="ui/ui/styles/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="ui/ui/styles/modern-AdminLTE.min.css">
|
||||
|
||||
|
||||
|
||||
</head>
|
||||
|
||||
<body class="hold-transition login-page">
|
||||
<div class="login-box">
|
||||
<div class="login-logo">
|
||||
<b>Nux</b>Billing
|
||||
{$_c['CompanyName']}
|
||||
</div>
|
||||
<div class="login-box-body">
|
||||
<p class="login-box-msg">{Lang::T('Enter Admin Area')}</p>
|
||||
|
@ -9,7 +9,7 @@
|
||||
<link rel="shortcut icon" href="ui/ui/images/logo.png" type="image/x-icon" />
|
||||
<link rel="stylesheet" href="ui/ui/styles/bootstrap.min.css">
|
||||
<link rel="stylesheet" href="ui/ui/styles/modern-AdminLTE.min.css">
|
||||
<meta http-equiv="refresh" content="3; url={$url}">
|
||||
<meta http-equiv="refresh" content="{$time}; url={$url}">
|
||||
</head>
|
||||
|
||||
<body class="hold-transition lockscreen">
|
||||
@ -20,7 +20,7 @@
|
||||
{$text}
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<a href="{$url}" id="button" class="btn btn-{$type} btn-block btn-block">{Lang::T('Click Here')} (3)</a>
|
||||
<a href="{$url}" id="button" class="btn btn-{$type} btn-block btn-block">{Lang::T('Click Here')} ({$time})</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="lockscreen-footer text-center">
|
||||
@ -29,7 +29,7 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var time = 3;
|
||||
var time = {$time};
|
||||
timer();
|
||||
|
||||
function timer() {
|
||||
|
@ -15,13 +15,14 @@
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Expired Notification Message')}</label>
|
||||
<div class="col-md-6">
|
||||
<textarea class="form-control" id="expired"
|
||||
name="expired"
|
||||
<textarea class="form-control" id="expired" name="expired"
|
||||
placeholder="Hello [[name]], your internet package [[package]] has been expired"
|
||||
rows="3">{if $_json['expired']!=''}{Lang::htmlspecialchars($_json['expired'])}{else}Hello [[name]], your internet package [[package]] has been expired.{/if}</textarea>
|
||||
</div>
|
||||
<p class="help-block col-md-4">
|
||||
<b>[[name]]</b> will be replaced with Customer Name. <b>[[package]]</b> will be replaced with Package name. <b>[[price]]</b> will be replaced with Package price.
|
||||
<b>[[name]]</b> will be replaced with Customer Name.
|
||||
<b>[[package]]</b> will be replaced with Package name.
|
||||
<b>[[price]]</b> will be replaced with Package price.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -33,7 +34,10 @@
|
||||
rows="3">{Lang::htmlspecialchars($_json['reminder_7_day'])}</textarea>
|
||||
</div>
|
||||
<p class="help-block col-md-4">
|
||||
<b>[[name]]</b> will be replaced with Customer Name. <b>[[package]]</b> will be replaced with Package name. <b>[[price]]</b> will be replaced with Package price.
|
||||
<b>[[name]]</b> will be replaced with Customer Name.
|
||||
<b>[[package]]</b> will be replaced with Package name.
|
||||
<b>[[price]]</b> will be replaced with Package price.
|
||||
<b>[[expired_date]]</b> will be replaced with Expiration date.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -45,7 +49,10 @@
|
||||
rows="3">{Lang::htmlspecialchars($_json['reminder_3_day'])}</textarea>
|
||||
</div>
|
||||
<p class="help-block col-md-4">
|
||||
<b>[[name]]</b> will be replaced with Customer Name. <b>[[package]]</b> will be replaced with Package name. <b>[[price]]</b> will be replaced with Package price.
|
||||
<b>[[name]]</b> will be replaced with Customer Name.
|
||||
<b>[[package]]</b> will be replaced with Package name.
|
||||
<b>[[price]]</b> will be replaced with Package price.
|
||||
<b>[[expired_date]]</b> will be replaced with Expiration date.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -57,7 +64,10 @@
|
||||
rows="3">{Lang::htmlspecialchars($_json['reminder_1_day'])}</textarea>
|
||||
</div>
|
||||
<p class="help-block col-md-4">
|
||||
<b>[[name]]</b> will be replaced with Customer Name. <b>[[package]]</b> will be replaced with Package name. <b>[[price]]</b> will be replaced with Package price.
|
||||
<b>[[name]]</b> will be replaced with Customer Name.
|
||||
<b>[[package]]</b> will be replaced with Package name.
|
||||
<b>[[price]]</b> will be replaced with Package price.
|
||||
<b>[[expired_date]]</b> will be replaced with Expiration date.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@ -117,40 +127,41 @@
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Send Balance')}</label>
|
||||
<div class="col-md-6">
|
||||
<textarea class="form-control" id="balance_send" name="balance_send"
|
||||
rows="3">{if $_json['balance_send']}{Lang::htmlspecialchars($_json['balance_send'])}{else}{Lang::htmlspecialchars($_default['balance_send'])}{/if}</textarea>
|
||||
{if $_c['enable_balance'] == 'yes'}
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Send Balance')}</label>
|
||||
<div class="col-md-6">
|
||||
<textarea class="form-control" id="balance_send" name="balance_send"
|
||||
rows="3">{if $_json['balance_send']}{Lang::htmlspecialchars($_json['balance_send'])}{else}{Lang::htmlspecialchars($_default['balance_send'])}{/if}</textarea>
|
||||
</div>
|
||||
<p class="col-md-4 help-block">
|
||||
<b>[[name]]</b> Receiver name.<br>
|
||||
<b>[[balance]]</b> how much balance have been send.<br>
|
||||
<b>[[current_balance]]</b> Current Balance.
|
||||
</p>
|
||||
</div>
|
||||
<p class="col-md-4 help-block">
|
||||
<b>[[name]]</b> Receiver name.<br>
|
||||
<b>[[balance]]</b> how much balance have been send.<br>
|
||||
<b>[[current_balance]]</b> Current Balance.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Received Balance')}</label>
|
||||
<div class="col-md-6">
|
||||
<textarea class="form-control" id="balance_received" name="balance_received"
|
||||
rows="3">{if $_json['balance_received']}{Lang::htmlspecialchars($_json['balance_received'])}{else}{Lang::htmlspecialchars($_default['balance_received'])}{/if}</textarea>
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Received Balance')}</label>
|
||||
<div class="col-md-6">
|
||||
<textarea class="form-control" id="balance_received" name="balance_received"
|
||||
rows="3">{if $_json['balance_received']}{Lang::htmlspecialchars($_json['balance_received'])}{else}{Lang::htmlspecialchars($_default['balance_received'])}{/if}</textarea>
|
||||
</div>
|
||||
<p class="col-md-4 help-block">
|
||||
<b>[[name]]</b> Sender name.<br>
|
||||
<b>[[balance]]</b> how much balance have been received.<br>
|
||||
<b>[[current_balance]]</b> Current Balance.
|
||||
</p>
|
||||
</div>
|
||||
<p class="col-md-4 help-block">
|
||||
<b>[[name]]</b> Sender name.<br>
|
||||
<b>[[balance]]</b> how much balance have been received.<br>
|
||||
<b>[[current_balance]]</b> Current Balance.
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<button class="btn btn-success btn-block"
|
||||
type="submit">{Lang::T('Save Changes')}</button>
|
||||
<button class="btn btn-success btn-block" type="submit">{Lang::T('Save Changes')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,4 +1,4 @@
|
||||
<option value="">Select Plans</option>
|
||||
{foreach $d as $ds}
|
||||
<option value="{$ds['id']}">{$ds['name_plan']} • {Lang::moneyFormat($ds['price'])}</option>
|
||||
<option value="{$ds['id']}">{if $ds['enabled'] neq 1}DISABLED PLAN • {/if}{$ds['name_plan']} • {Lang::moneyFormat($ds['price'])}{if $ds['prepaid'] neq 'yes'} • POSTPAID {/if}</option>
|
||||
{/foreach}
|
@ -1,59 +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('Add Service Plan')}</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}services/balance-add-post" >
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Status')}</label>
|
||||
<div class="col-md-10">
|
||||
<label class="radio-inline warning">
|
||||
<input type="radio" checked name="enabled" value="1"> Enable
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="enabled" value="0"> Disable
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Client Can Purchase')}</label>
|
||||
<div class="col-md-10">
|
||||
<label class="radio-inline warning">
|
||||
<input type="radio" checked name="allow_purchase" value="yes"> Yes
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="allow_purchase" value="no"> No
|
||||
</label>
|
||||
</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" required class="form-control" id="name" name="name" maxlength="40" placeholder="Topup 100">
|
||||
</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>
|
||||
<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/balance-add-post">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Status')}</label>
|
||||
<div class="col-md-10">
|
||||
<label class="radio-inline warning">
|
||||
<input type="radio" checked name="enabled" value="1"> Enable
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" name="enabled" value="0"> Disable
|
||||
</label>
|
||||
</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" required class="form-control" id="name" name="name" maxlength="40"
|
||||
placeholder="Topup 100">
|
||||
</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>
|
||||
</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/balance">{Lang::T('Cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</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}services/balance">{Lang::T('Cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{include file="sections/footer.tpl"}
|
||||
{include file="sections/footer.tpl"}
|
@ -18,18 +18,6 @@
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Client Can Purchase')}</label>
|
||||
<div class="col-md-10">
|
||||
<label class="radio-inline warning">
|
||||
<input type="radio" {if $d['allow_purchase'] == yes}checked{/if} name="allow_purchase" value="yes"> Yes
|
||||
</label>
|
||||
<label class="radio-inline">
|
||||
<input type="radio" {if $d['allow_purchase'] == no}checked{/if} name="allow_purchase" value="no">
|
||||
No
|
||||
</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Plan Name')}</label>
|
||||
<div class="col-md-6">
|
||||
|
@ -1,21 +1,20 @@
|
||||
{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 New Contact')}</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}customers/add-post">
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}customers/add-post">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">{Lang::T('Add New Contact')}</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Username')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Username')}</label>
|
||||
<div class="col-md-9">
|
||||
<div class="input-group">
|
||||
{if $_c['country_code_phone']!= ''}
|
||||
<span class="input-group-addon" id="basic-addon1">+</span>
|
||||
<span class="input-group-addon" id="basic-addon1">+</span>
|
||||
{else}
|
||||
<span class="input-group-addon" id="basic-addon1"><i
|
||||
class="glyphicon glyphicon-phone-alt"></i></span>
|
||||
<span class="input-group-addon" id="basic-addon1"><i
|
||||
class="glyphicon glyphicon-phone-alt"></i></span>
|
||||
{/if}
|
||||
<input type="text" class="form-control" name="username" required
|
||||
placeholder="{if $_c['country_code_phone']!= ''}{$_c['country_code_phone']}{/if} {Lang::T('Phone Number')}">
|
||||
@ -23,26 +22,26 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Full Name')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Full Name')}</label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" required class="form-control" id="fullname" name="fullname">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Email')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Email')}</label>
|
||||
<div class="col-md-9">
|
||||
<input type="email" class="form-control" id="email" name="email">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Phone Number')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Phone Number')}</label>
|
||||
<div class="col-md-9">
|
||||
<div class="input-group">
|
||||
{if $_c['country_code_phone']!= ''}
|
||||
<span class="input-group-addon" id="basic-addon1">+</span>
|
||||
<span class="input-group-addon" id="basic-addon1">+</span>
|
||||
{else}
|
||||
<span class="input-group-addon" id="basic-addon1"><i
|
||||
class="glyphicon glyphicon-phone-alt"></i></span>
|
||||
<span class="input-group-addon" id="basic-addon1"><i
|
||||
class="glyphicon glyphicon-phone-alt"></i></span>
|
||||
{/if}
|
||||
<input type="text" class="form-control" name="phonenumber"
|
||||
placeholder="{if $_c['country_code_phone']!= ''}{$_c['country_code_phone']}{/if} {Lang::T('Phone Number')}">
|
||||
@ -50,15 +49,15 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Password')}</label>
|
||||
<div class="col-md-6">
|
||||
<input type="password" class="form-control" autocomplete="off" required id="password"
|
||||
<label class="col-md-3 control-label">{Lang::T('Password')}</label>
|
||||
<div class="col-md-9">
|
||||
<input type="password" class="form-control" autocomplete="off" required id="password" value="{rand(000000,999999)}"
|
||||
name="password" onmouseleave="this.type = 'password'" onmouseenter="this.type = 'text'">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('PPPOE Password')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('PPPOE Password')}</label>
|
||||
<div class="col-md-9">
|
||||
<input type="password" class="form-control" id="pppoe_password" name="pppoe_password"
|
||||
value="{$d['pppoe_password']}" onmouseleave="this.type = 'password'"
|
||||
onmouseenter="this.type = 'text'">
|
||||
@ -68,14 +67,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Address')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Address')}</label>
|
||||
<div class="col-md-9">
|
||||
<textarea name="address" id="address" class="form-control"></textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Service Type')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Service Type')}</label>
|
||||
<div class="col-md-9">
|
||||
<select class="form-control" id="service_type" name="service_type">
|
||||
<option value="Hotspot" {if $d['service_type'] eq 'Hotspot' }selected{/if}>Hotspot
|
||||
</option>
|
||||
@ -84,64 +83,64 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">{Lang::T('Attributes')}</div>
|
||||
<div class="panel-body">
|
||||
<!-- Customers Attributes add start -->
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Attributes')}</label>
|
||||
<div id="custom-fields-container" class="col-md-6">
|
||||
<button class="btn btn-success btn-sm" type="button"
|
||||
id="add-custom-field">+</button>
|
||||
</div>
|
||||
<div id="custom-fields-container">
|
||||
</div>
|
||||
<!-- Customers Attributes add end -->
|
||||
|
||||
<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}customers/list">{Lang::T('Cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<button class="btn btn-success btn-block" type="button"
|
||||
id="add-custom-field">{Lang::T('Add')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<center>
|
||||
<button class="btn btn-primary" type="submit">
|
||||
{Lang::T('Save Changes')}
|
||||
</button>
|
||||
<br><a href="{$_url}customers/list" class="btn btn-link">{Lang::T('Cancel')}</a>
|
||||
</center>
|
||||
</form>
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
var customFieldsContainer = document.getElementById('custom-fields-container');
|
||||
var addCustomFieldButton = document.getElementById('add-custom-field');
|
||||
<script type="text/javascript">
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
var customFieldsContainer = document.getElementById('custom-fields-container');
|
||||
var addCustomFieldButton = document.getElementById('add-custom-field');
|
||||
|
||||
addCustomFieldButton.addEventListener('click', function() {
|
||||
var fieldIndex = customFieldsContainer.children.length;
|
||||
var newField = document.createElement('div');
|
||||
newField.className = 'form-group';
|
||||
newField.innerHTML = `
|
||||
<label class="col-md-2 control-label">Name:</label>
|
||||
<div class="col-md-3">
|
||||
addCustomFieldButton.addEventListener('click', function() {
|
||||
var fieldIndex = customFieldsContainer.children.length;
|
||||
var newField = document.createElement('div');
|
||||
newField.className = 'form-group';
|
||||
newField.innerHTML = `
|
||||
<div class="col-md-4">
|
||||
<input type="text" class="form-control" name="custom_field_name[]" placeholder="Name">
|
||||
</div>
|
||||
<label class="col-md-2 control-label">Value:</label>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-6">
|
||||
<input type="text" class="form-control" name="custom_field_value[]" placeholder="Value">
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button type="button" class="remove-custom-field btn btn-danger btn-sm">-</button>
|
||||
</div>
|
||||
`;
|
||||
customFieldsContainer.appendChild(newField);
|
||||
});
|
||||
customFieldsContainer.appendChild(newField);
|
||||
});
|
||||
|
||||
customFieldsContainer.addEventListener('click', function(event) {
|
||||
if (event.target.classList.contains('remove-custom-field')) {
|
||||
var fieldContainer = event.target.parentNode.parentNode;
|
||||
fieldContainer.parentNode.removeChild(fieldContainer);
|
||||
}
|
||||
customFieldsContainer.addEventListener('click', function(event) {
|
||||
if (event.target.classList.contains('remove-custom-field')) {
|
||||
var fieldContainer = event.target.parentNode.parentNode;
|
||||
fieldContainer.parentNode.removeChild(fieldContainer);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
{/literal}
|
||||
|
||||
|
||||
|
@ -1,22 +1,21 @@
|
||||
{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 Contact')}</div>
|
||||
<div class="panel-body">
|
||||
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}customers/edit-post">
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}customers/edit-post">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">{Lang::T('Edit Contact')}</div>
|
||||
<div class="panel-body">
|
||||
<input type="hidden" name="id" value="{$d['id']}">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Username')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Username')}</label>
|
||||
<div class="col-md-9">
|
||||
<div class="input-group">
|
||||
{if $_c['country_code_phone']!= ''}
|
||||
<span class="input-group-addon" id="basic-addon1">+</span>
|
||||
<span class="input-group-addon" id="basic-addon1">+</span>
|
||||
{else}
|
||||
<span class="input-group-addon" id="basic-addon1"><i
|
||||
class="glyphicon glyphicon-phone-alt"></i></span>
|
||||
<span class="input-group-addon" id="basic-addon1"><i
|
||||
class="glyphicon glyphicon-phone-alt"></i></span>
|
||||
{/if}
|
||||
<input type="text" class="form-control" name="username" value="{$d['username']}"
|
||||
required
|
||||
@ -25,27 +24,27 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Full Name')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Full Name')}</label>
|
||||
<div class="col-md-9">
|
||||
<input type="text" class="form-control" id="fullname" name="fullname"
|
||||
value="{$d['fullname']}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Email')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Email')}</label>
|
||||
<div class="col-md-9">
|
||||
<input type="email" class="form-control" id="email" name="email" value="{$d['email']}">
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Phone Number')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Phone Number')}</label>
|
||||
<div class="col-md-9">
|
||||
<div class="input-group">
|
||||
{if $_c['country_code_phone']!= ''}
|
||||
<span class="input-group-addon" id="basic-addon1">+</span>
|
||||
<span class="input-group-addon" id="basic-addon1">+</span>
|
||||
{else}
|
||||
<span class="input-group-addon" id="basic-addon1"><i
|
||||
class="glyphicon glyphicon-phone-alt"></i></span>
|
||||
<span class="input-group-addon" id="basic-addon1"><i
|
||||
class="glyphicon glyphicon-phone-alt"></i></span>
|
||||
{/if}
|
||||
<input type="text" class="form-control" name="phonenumber" value="{$d['phonenumber']}"
|
||||
placeholder="{if $_c['country_code_phone']!= ''}{$_c['country_code_phone']}{/if} {Lang::T('Phone Number')}">
|
||||
@ -53,8 +52,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Password')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Password')}</label>
|
||||
<div class="col-md-9">
|
||||
<input type="password" autocomplete="off" class="form-control" id="password" name="password"
|
||||
onmouseleave="this.type = 'password'" onmouseenter="this.type = 'text'"
|
||||
value="{$d['password']}">
|
||||
@ -62,8 +61,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('PPPOE Password')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('PPPOE Password')}</label>
|
||||
<div class="col-md-9">
|
||||
<input type="password" autocomplete="off" class="form-control" id="pppoe_password"
|
||||
name="pppoe_password" value="{$d['pppoe_password']}"
|
||||
onmouseleave="this.type = 'password'" onmouseenter="this.type = 'text'">
|
||||
@ -73,14 +72,14 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Address')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Address')}</label>
|
||||
<div class="col-md-9">
|
||||
<textarea name="address" id="address" class="form-control">{$d['address']}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Service Type')}</label>
|
||||
<div class="col-md-6">
|
||||
<label class="col-md-3 control-label">{Lang::T('Service Type')}</label>
|
||||
<div class="col-md-9">
|
||||
<select class="form-control" id="service_type" name="service_type">
|
||||
<option value="Hotspot" {if $d['service_type'] eq 'Hotspot' }selected{/if}>Hotspot
|
||||
</option>
|
||||
@ -89,79 +88,82 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">{Lang::T('Attributes')}</div>
|
||||
<div class="panel-body">
|
||||
<!--Customers Attributes edit start -->
|
||||
{if $customFields}
|
||||
{foreach $customFields as $customField}
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label"
|
||||
for="{$customField.field_name}">{$customField.field_name}</label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control" type="text" name="custom_fields[{$customField.field_name}]"
|
||||
id="{$customField.field_name}" value="{$customField.field_value}">
|
||||
</div>
|
||||
<input type="checkbox" name="delete_custom_fields[]" value="{$customField.field_name}"> Delete
|
||||
</div>
|
||||
{/foreach}
|
||||
{foreach $customFields as $customField}
|
||||
<div class="form-group">
|
||||
<label class="col-md-4 control-label"
|
||||
for="{$customField.field_name}">{$customField.field_name}</label>
|
||||
<div class="col-md-6">
|
||||
<input class="form-control" type="text" name="custom_fields[{$customField.field_name}]"
|
||||
id="{$customField.field_name}" value="{$customField.field_value}">
|
||||
</div>
|
||||
<label class="col-md-2">
|
||||
<input type="checkbox" name="delete_custom_fields[]" value="{$customField.field_name}"> Delete
|
||||
</label>
|
||||
</div>
|
||||
{/foreach}
|
||||
{/if}
|
||||
<!--Customers Attributes edit end -->
|
||||
<!--Customers Attributes add start -->
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Attributes')}</label>
|
||||
<div id="custom-fields-container" class="col-md-6">
|
||||
<button class="btn btn-success btn-sm" type="button"
|
||||
id="add-custom-field">+</button>
|
||||
</div>
|
||||
<!-- Customers Attributes add start -->
|
||||
<div id="custom-fields-container">
|
||||
</div>
|
||||
<!--Customers Attributes add end -->
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-2 col-lg-10">
|
||||
<button class="btn btn-primary" type="submit">
|
||||
{Lang::T('Save Changes')}
|
||||
</button>
|
||||
Or <a href="{$_url}customers/list">{Lang::T('Cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
<!-- Customers Attributes add end -->
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<button class="btn btn-success btn-block" type="button"
|
||||
id="add-custom-field">{Lang::T('Add')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<center>
|
||||
<button class="btn btn-primary" type="submit">
|
||||
{Lang::T('Save Changes')}
|
||||
</button>
|
||||
<br><a href="{$_url}customers/list" class="btn btn-link">{Lang::T('Cancel')}</a>
|
||||
</center>
|
||||
</form>
|
||||
|
||||
{literal}
|
||||
<script type="text/javascript">
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
var customFieldsContainer = document.getElementById('custom-fields-container');
|
||||
var addCustomFieldButton = document.getElementById('add-custom-field');
|
||||
<script type="text/javascript">
|
||||
document.addEventListener("DOMContentLoaded", function() {
|
||||
var customFieldsContainer = document.getElementById('custom-fields-container');
|
||||
var addCustomFieldButton = document.getElementById('add-custom-field');
|
||||
|
||||
addCustomFieldButton.addEventListener('click', function () {
|
||||
var fieldIndex = customFieldsContainer.children.length;
|
||||
var newField = document.createElement('div');
|
||||
newField.className = 'form-group';
|
||||
newField.innerHTML = `
|
||||
<label class="col-md-2 control-label">Name:</label>
|
||||
<div class="col-md-3">
|
||||
addCustomFieldButton.addEventListener('click', function() {
|
||||
var fieldIndex = customFieldsContainer.children.length;
|
||||
var newField = document.createElement('div');
|
||||
newField.className = 'form-group';
|
||||
newField.innerHTML = `
|
||||
<div class="col-md-4">
|
||||
<input type="text" class="form-control" name="custom_field_name[]" placeholder="Name">
|
||||
</div>
|
||||
<label class="col-md-2 control-label">Value:</label>
|
||||
<div class="col-md-3">
|
||||
<div class="col-md-6">
|
||||
<input type="text" class="form-control" name="custom_field_value[]" placeholder="Value">
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button type="button" class="remove-custom-field btn btn-danger btn-sm">-</button>
|
||||
</div>
|
||||
`;
|
||||
customFieldsContainer.appendChild(newField);
|
||||
});
|
||||
customFieldsContainer.appendChild(newField);
|
||||
});
|
||||
|
||||
customFieldsContainer.addEventListener('click', function (event) {
|
||||
if (event.target.classList.contains('remove-custom-field')) {
|
||||
var fieldContainer = event.target.parentNode.parentNode;
|
||||
fieldContainer.parentNode.removeChild(fieldContainer);
|
||||
}
|
||||
customFieldsContainer.addEventListener('click', function(event) {
|
||||
if (event.target.classList.contains('remove-custom-field')) {
|
||||
var fieldContainer = event.target.parentNode.parentNode;
|
||||
fieldContainer.parentNode.removeChild(fieldContainer);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
</script>
|
||||
</script>
|
||||
{/literal}
|
||||
|
||||
{include file="sections/footer.tpl"}
|
@ -60,49 +60,52 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<!-- solid sales graph -->
|
||||
{if $_c['hide_mrc'] != 'yes'}
|
||||
<div class="box box-solid ">
|
||||
<div class="box-header">
|
||||
<i class="fa fa-th"></i>
|
||||
|
||||
<h3 class="box-title">{Lang::T('Monthly Registered Customers')}</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn bg-teal btn-sm" data-widget="collapse"><i class="fa fa-minus"></i>
|
||||
</button>
|
||||
<a href="{$_url}settings/app#hide_dashboard_content" class="btn bg-teal btn-sm" ><i class="fa fa-times"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body border-radius-none">
|
||||
<canvas class="chart" id="chart" style="height: 250px;"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- solid sales graph -->
|
||||
{if $_c['hide_tms'] != 'yes'}
|
||||
<div class="box box-solid ">
|
||||
<div class="box-header">
|
||||
<i class="fa fa-inbox"></i>
|
||||
|
||||
<h3 class="box-title">{Lang::T('Total Monthly Sales')}</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn bg-teal btn-sm" data-widget="collapse"><i class="fa fa-minus"></i>
|
||||
</button>
|
||||
<a href="{$_url}settings/app#hide_dashboard_content" class="btn bg-teal btn-sm" ><i class="fa fa-times"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body border-radius-none">
|
||||
<canvas class="chart" id="salesChart" style="height: 250px;"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
<div class="row">
|
||||
<div class="col-md-7">
|
||||
|
||||
<!-- solid sales graph -->
|
||||
{if $_c['hide_mrc'] != 'yes'}
|
||||
<div class="box box-solid ">
|
||||
<div class="box-header">
|
||||
<i class="fa fa-th"></i>
|
||||
|
||||
<h3 class="box-title">{Lang::T('Monthly Registered Customers')}</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn bg-teal btn-sm" data-widget="collapse"><i class="fa fa-minus"></i>
|
||||
</button>
|
||||
<a href="{$_url}settings/app#hide_dashboard_content" class="btn bg-teal btn-sm"><i
|
||||
class="fa fa-times"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body border-radius-none">
|
||||
<canvas class="chart" id="chart" style="height: 250px;"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
<!-- solid sales graph -->
|
||||
{if $_c['hide_tms'] != 'yes'}
|
||||
<div class="box box-solid ">
|
||||
<div class="box-header">
|
||||
<i class="fa fa-inbox"></i>
|
||||
|
||||
<h3 class="box-title">{Lang::T('Total Monthly Sales')}</h3>
|
||||
|
||||
<div class="box-tools pull-right">
|
||||
<button type="button" class="btn bg-teal btn-sm" data-widget="collapse"><i class="fa fa-minus"></i>
|
||||
</button>
|
||||
<a href="{$_url}settings/app#hide_dashboard_content" class="btn bg-teal btn-sm"><i
|
||||
class="fa fa-times"></i>
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
<div class="box-body border-radius-none">
|
||||
<canvas class="chart" id="salesChart" style="height: 250px;"></canvas>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if $_c['disable_voucher'] != 'yes' && $stocks['unused']>0 || $stocks['used']>0}
|
||||
{if $_c['hide_vs'] != 'yes'}
|
||||
<div class="panel panel-primary mb20 panel-hovered project-stats table-responsive">
|
||||
|
@ -21,7 +21,7 @@
|
||||
data-placeholder="{Lang::T('Select Plans')}...">
|
||||
<option></option>
|
||||
{foreach $p as $pl}
|
||||
<option value="{$pl['id']}">{$pl['name_plan']} - {Lang::moneyFormat($pl['price'])}</option>
|
||||
<option value="{$pl['id']}">{if $pl['enabled'] neq 1}DISABLED PLAN • {/if}{$pl['name_plan']} - {Lang::moneyFormat($pl['price'])}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
|
@ -14,10 +14,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Client Can Purchase')}</label>
|
||||
<label class="col-md-2 control-label">{Lang::T('Type')}</label>
|
||||
<div class="col-md-10">
|
||||
<input type="radio" name="allow_purchase" value="yes" checked> Yes
|
||||
<input type="radio" name="allow_purchase" value="no"> No
|
||||
<input type="radio" name="prepaid" onclick="prePaid()" value="yes" checked> Prepaid
|
||||
<input type="radio" name="prepaid" onclick="postPaid()" value="no"> Postpaid
|
||||
</div>
|
||||
</div>
|
||||
{if $_c['radius_enable']}
|
||||
@ -121,16 +121,9 @@
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select class="form-control" id="validity_unit" name="validity_unit">
|
||||
<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>
|
||||
</select>
|
||||
</div>
|
||||
<p class="help-block col-md-4">{Lang::T('1 Period = 1 Month, Expires the 20th of each month')}</p>
|
||||
</div>
|
||||
<span id="routerChoose" class="">
|
||||
<div class="form-group">
|
||||
@ -165,8 +158,7 @@
|
||||
</div> *}
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<button class="btn btn-success"
|
||||
type="submit">{Lang::T('Save Changes')}</button>
|
||||
<button class="btn btn-success" type="submit">{Lang::T('Save Changes')}</button>
|
||||
Or <a href="{$_url}services/hotspot">{Lang::T('Cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
@ -175,6 +167,23 @@
|
||||
</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);
|
||||
}
|
||||
|
||||
function postPaid() {
|
||||
$("#validity_unit").html(postOpt);
|
||||
}
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
prePaid()
|
||||
})
|
||||
</script>
|
||||
{if $_c['radius_enable']}
|
||||
{literal}
|
||||
<script>
|
||||
|
@ -10,15 +10,18 @@
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Status')}</label>
|
||||
<div class="col-md-10">
|
||||
<input type="radio" name="enabled" value="1" {if $d['enabled'] == 1}checked{/if}> Enable
|
||||
<input type="radio" name="enabled" value="0" {if $d['enabled'] == 0}checked{/if}> Disable
|
||||
<input type="radio" name="enabled" value="1" {if $d['enabled'] == 1}checked{/if}> Enable
|
||||
<input type="radio" name="enabled" value="0" {if $d['enabled'] == 0}checked{/if}> Disable
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Client Can Purchase')}</label>
|
||||
<label class="col-md-2 control-label">{Lang::T('Type')}</label>
|
||||
<div class="col-md-10">
|
||||
<input type="radio" name="allow_purchase" value="yes" {if $d['allow_purchase'] == yes}checked{/if}> Yes
|
||||
<input type="radio" name="allow_purchase" value="no" {if $d['allow_purchase'] == no}checked{/if}> No
|
||||
<input type="radio" name="prepaid" onclick="prePaid()" value="yes"
|
||||
{if $d['prepaid'] == yes}checked{/if}>
|
||||
Prepaid
|
||||
<input type="radio" name="prepaid" onclick="postPaid()" value="no"
|
||||
{if $d['prepaid'] == no}checked{/if}> Postpaid
|
||||
</div>
|
||||
</div>
|
||||
{if $_c['radius_enable'] and $d['is_radius']}
|
||||
@ -131,16 +134,23 @@
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select class="form-control" id="validity_unit" name="validity_unit">
|
||||
<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>
|
||||
{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>
|
||||
</div>
|
||||
<p class="help-block col-md-4">{Lang::T('1 Period = 1 Month, Expires the 20th of each month')}
|
||||
</p>
|
||||
</div>
|
||||
<span id="routerChoose" class="{if $d['is_radius']}hidden{/if}">
|
||||
<div class="form-group">
|
||||
@ -174,8 +184,7 @@
|
||||
</div> *}
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-10">
|
||||
<button class="btn btn-success"
|
||||
type="submit">{Lang::T('Save Changes')}</button>
|
||||
<button class="btn btn-success" type="submit">{Lang::T('Save Changes')}</button>
|
||||
Or <a href="{$_url}services/hotspot">{Lang::T('Cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
@ -186,6 +195,21 @@
|
||||
</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);
|
||||
}
|
||||
|
||||
function postPaid() {
|
||||
$("#validity_unit").html(postOpt);
|
||||
}
|
||||
</script>
|
||||
|
||||
{if $_c['radius_enable'] && $d['is_radius']}
|
||||
{literal}
|
||||
<script>
|
||||
@ -213,4 +237,4 @@
|
||||
</script>
|
||||
{/literal}
|
||||
{/if}
|
||||
{include file="sections/footer.tpl"}
|
||||
{include file="sections/footer.tpl"}
|
@ -51,7 +51,7 @@
|
||||
<tbody>
|
||||
{foreach $d as $ds}
|
||||
<tr {if $ds['enabled'] != 1}class="danger" title="disabled"
|
||||
{elseif $ds['allow_purchase'] != 'yes'}class="warning" title="Customer can't purchase" {/if}>
|
||||
{elseif $ds['prepaid'] != 'yes'}class="warning" title="Postpaid" {/if}>
|
||||
<td class="headcol">{$ds['name_plan']}</td>
|
||||
<td>{$ds['typebp']}</td>
|
||||
<td>{$ds['name_bw']}</td>
|
||||
|
21
ui/ui/invoice-customer.tpl
Normal file
21
ui/ui/invoice-customer.tpl
Normal file
@ -0,0 +1,21 @@
|
||||
{include file="sections/user-header.tpl"}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-md-offset-2">
|
||||
<div class="panel panel-hovered panel-primary panel-stacked mb30">
|
||||
<div class="panel-heading">{$in['invoice']}</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal" method="post" action="{$_url}prepaid/print" target="_blank">
|
||||
<pre id="content">{$invoice}</pre>
|
||||
<input type="hidden" name="id" value="{$in['id']}">
|
||||
<a href="{$_url}voucher/list-activated" class="btn btn-default btn-sm"><i
|
||||
class="ion-reply-all"></i>{Lang::T('Finish')}</a>
|
||||
<a href="https://api.whatsapp.com/send/?text={$whatsapp}" target="_blank"
|
||||
class="btn btn-primary btn-sm">
|
||||
<i class="glyphicon glyphicon-share"></i> WhatsApp</a>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="sections/user-footer.tpl"}
|
@ -1,34 +1,31 @@
|
||||
{include file="sections/header.tpl"}
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<form method="post">
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<div class="panel panel-info panel-hovered">
|
||||
<div class="panel-heading">{Lang::T('Payment Gateway')}</div>
|
||||
<div class="panel-body row">
|
||||
{foreach $pgs as $pg}
|
||||
<div class="col-sm-4 mb20">
|
||||
<a href="{$_url}paymentgateway/{$pg}"
|
||||
class="btn btn-block btn-{if $pg==$_c['payment_gateway']}success{else}default{/if}">{ucwords($pg)}</a>
|
||||
</div>
|
||||
{/foreach}
|
||||
</div>
|
||||
<div class="panel-footer">
|
||||
<form method="post">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-2 control-label">Payment Gateway</label>
|
||||
<div class="col-md-8">
|
||||
<select name="payment_gateway" id="payment_gateway" class="form-control">
|
||||
<option value="none">None</option>
|
||||
<div class="panel-heading">{Lang::T('Payment Gateway')}</div>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-striped table-condensed">
|
||||
<tbody>
|
||||
{foreach $pgs as $pg}
|
||||
<option value="{$pg}" {if $_c['payment_gateway'] eq {$pg}}selected="selected" {/if}>{ucwords($pg)}</option>
|
||||
<tr>
|
||||
<td width="10" align="center" valign="center"><input type="checkbox" name="pgs[]"
|
||||
{if in_array($pg, $actives)}checked{/if} value="{$pg}"></td>
|
||||
<td><a href="{$_url}paymentgateway/{$pg}"
|
||||
class="btn btn-block btn-{if in_array($pg, $actives)}info{else}default{/if} text-left">{ucwords($pg)}</a>
|
||||
</td>
|
||||
<td width="10"><a href="{$_url}paymentgateway/delete/{$pg}"
|
||||
onclick="return confirm('{Lang::T('Delete')} {$pg}?')" class="btn btn-danger"><i
|
||||
class="glyphicon glyphicon-trash"></i></a></td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button class="btn btn-block btn-primary" type="submit">{Lang::T('Save Changes')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="panel-footer"><button type="submit" class="btn btn-primary btn-block" name="save"
|
||||
value="actives">{Lang::T('Save Changes')}</button></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{include file="sections/footer.tpl"}
|
||||
</form>
|
||||
{include file="sections/footer.tpl"}
|
@ -14,17 +14,22 @@
|
||||
<div style="max-height: 50px; min-height: 50px;">{$plugin['description']}</div>
|
||||
</div>
|
||||
<div class="box-footer ">
|
||||
<center><small><i>@{$plugin['author']} Last update: {$plugin['last_update']}</i></small></center>
|
||||
<center><small><i>@{$plugin['author']} Last update: {$plugin['last_update']}</i></small>
|
||||
</center>
|
||||
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
||||
<a href="{$plugin['url']}" target="_blank" class="btn btn-primary"><i
|
||||
class="ion ion-chatboxes"></i> Website</a>
|
||||
<a href="{$plugin['github']}" target="_blank" class="btn btn-success"><i
|
||||
class="ion ion-chatboxes"></i> Github</a>
|
||||
<a href="{$plugin['url']}" target="_blank" style="color: black;" class="btn btn-primary"><i
|
||||
class="glyphicon glyphicon-globe"></i> Web</a>
|
||||
<a href="{$plugin['github']}" target="_blank" style="color: black;" class="btn btn-info"><i
|
||||
class="glyphicon glyphicon-align-left"></i> Source</a>
|
||||
</div>
|
||||
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
||||
<a href="{$_url}pluginmanager/delete/plugin/{$plugin['id']}" onclick="return confirm('{Lang::T('Delete')}?')" class="btn btn-danger"><i
|
||||
class="glyphicon glyphicon-trash"></i> Delete</a>
|
||||
<a {if $zipExt } href="{$_url}pluginmanager/install/plugin/{$plugin['id']}"
|
||||
onclick="return confirm('Installing plugin will take some time to complete, do not close the page while it loading to install the plugin')"
|
||||
{else} href="#" onclick="alert('PHP ZIP extension is not installed')"
|
||||
{/if}
|
||||
class="btn btn-warning"><i class="ion ion-chatboxes"></i> Install</a>
|
||||
{else} href="#" onclick="alert('PHP ZIP extension is not installed')"
|
||||
{/if} style="color: black;"
|
||||
class="btn btn-success"><i class="glyphicon glyphicon-circle-arrow-down"></i> Install</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -47,15 +52,15 @@
|
||||
<div class="box-footer ">
|
||||
<center><small><i>@{$pg['author']} Last update: {$pg['last_update']}</i></small></center>
|
||||
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
||||
<a href="{$pg['url']}" target="_blank" class="btn btn-primary"><i
|
||||
class="ion ion-chatboxes"></i> Website</a>
|
||||
<a href="{$pg['github']}" target="_blank" class="btn btn-success"><i
|
||||
class="ion ion-chatboxes"></i> Github</a>
|
||||
<a href="{$pg['url']}" target="_blank" style="color: black;" class="btn btn-primary"><i
|
||||
class="glyphicon glyphicon-globe"></i> Web</a>
|
||||
<a href="{$pg['github']}" target="_blank" style="color: black;" class="btn btn-info"><i
|
||||
class="glyphicon glyphicon-align-left"></i> Source</a>
|
||||
<a {if $zipExt } href="{$_url}pluginmanager/install/payment/{$pg['id']}"
|
||||
onclick="return confirm('Installing plugin will take some time to complete, do not close the page while it loading to install the plugin')"
|
||||
{else} href="#" onclick="alert('PHP ZIP extension is not available')"
|
||||
{/if}
|
||||
class="btn btn-warning"><i class="ion ion-chatboxes"></i> Install</a>
|
||||
{else} href="#" onclick="alert('PHP ZIP extension is not available')"
|
||||
{/if} style="color: black;"
|
||||
class="btn btn-success"><i class="glyphicon glyphicon-circle-arrow-down"></i> Install</a>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -14,10 +14,10 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Client Can Purchase')}</label>
|
||||
<label class="col-md-2 control-label">{Lang::T('Type')}</label>
|
||||
<div class="col-md-10">
|
||||
<input type="radio" checked name="allow_purchase" value="yes"> Yes
|
||||
<input type="radio" name="allow_purchase" value="no"> No
|
||||
<input type="radio" name="prepaid" onclick="prePaid()" value="yes" checked> Prepaid
|
||||
<input type="radio" name="prepaid" onclick="postPaid()" value="no"> Postpaid
|
||||
</div>
|
||||
</div>
|
||||
{if $_c['radius_enable']}
|
||||
@ -63,12 +63,9 @@
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select class="form-control" id="validity_unit" name="validity_unit">
|
||||
<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>
|
||||
</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">
|
||||
<label class="col-md-2 control-label"><a
|
||||
@ -119,6 +116,23 @@
|
||||
</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);
|
||||
}
|
||||
|
||||
function postPaid() {
|
||||
$("#validity_unit").html(postOpt);
|
||||
}
|
||||
document.addEventListener("DOMContentLoaded", function(event) {
|
||||
prePaid()
|
||||
})
|
||||
</script>
|
||||
{if $_c['radius_enable']}
|
||||
{literal}
|
||||
<script>
|
||||
|
@ -15,10 +15,11 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Client Can Purchase')}</label>
|
||||
<label class="col-md-2 control-label">{Lang::T('Type')}</label>
|
||||
<div class="col-md-10">
|
||||
<input type="radio" name="allow_purchase" value="yes" {if $d['allow_purchase'] == yes}checked{/if}> Yes
|
||||
<input type="radio" name="allow_purchase" value="no" {if $d['allow_purchase'] == no}checked{/if}> No
|
||||
<input type="radio" name="prepaid" onclick="prePaid()" value="yes" {if $d['prepaid'] == yes}checked{/if}>
|
||||
Prepaid
|
||||
<input type="radio" name="prepaid" onclick="postPaid()" value="no" {if $d['prepaid'] == no}checked{/if}> Postpaid
|
||||
</div>
|
||||
</div>
|
||||
{if $_c['radius_enable'] and $d['is_radius']}
|
||||
@ -65,16 +66,23 @@
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<select class="form-control" id="validity_unit" name="validity_unit">
|
||||
<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>
|
||||
{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>
|
||||
</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">
|
||||
<label class="col-md-2 control-label"><a href="{$_url}pool/add">{Lang::T('IP Pool')}</a></label>
|
||||
@ -116,8 +124,7 @@
|
||||
</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>
|
||||
<button class="btn btn-success" type="submit">{Lang::T('Save Changes')}</button>
|
||||
Or <a href="{$_url}services/pppoe">{Lang::T('Cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
@ -127,6 +134,21 @@
|
||||
</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);
|
||||
}
|
||||
|
||||
function postPaid() {
|
||||
$("#validity_unit").html(postOpt);
|
||||
}
|
||||
</script>
|
||||
{if $_c['radius_enable'] && $d['is_radius']}
|
||||
{literal}
|
||||
<script>
|
||||
@ -145,4 +167,4 @@
|
||||
</script>
|
||||
{/literal}
|
||||
{/if}
|
||||
{include file="sections/footer.tpl"}
|
||||
{include file="sections/footer.tpl"}
|
@ -49,7 +49,7 @@
|
||||
<tbody>
|
||||
{foreach $d as $ds}
|
||||
<tr {if $ds['enabled'] != 1}class="danger" title="disabled"
|
||||
{elseif $ds['allow_purchase'] != 'yes'}class="warning" title="Customer can't purchase" {/if}>
|
||||
{elseif $ds['prepaid'] != 'yes'}class="warning" title="Postpaid" {/if}>
|
||||
<td>{$ds['name_plan']}</td>
|
||||
<td>{$ds['name_bw']}</td>
|
||||
<td>{Lang::moneyFormat($ds['price'])}</td>
|
||||
|
@ -23,7 +23,8 @@
|
||||
<select id="id_plan" name="id_plan" class="form-control select2">
|
||||
{foreach $p as $ps}
|
||||
<option value="{$ps['id']}" {if $d['plan_id'] eq $ps['id']} selected {/if}>
|
||||
{if $ps['is_radius']=='1'}Radius{else}{$ps['routers']}{/if} - {$ps['name_plan']}</option>
|
||||
{if $ps['enabled'] neq 1}DISABLED PLAN • {/if}
|
||||
{if $ps['is_radius']=='1'}Radius{else}{$ps['routers']}{/if} • {$ps['name_plan']}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
|
@ -16,7 +16,7 @@
|
||||
aria-hidden="true"></span> CSV</a>
|
||||
</div>
|
||||
{/if}
|
||||
{Lang::T('Prepaid Users')}
|
||||
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
|
||||
|
99
ui/ui/recharge-confirm.tpl
Normal file
99
ui/ui/recharge-confirm.tpl
Normal file
@ -0,0 +1,99 @@
|
||||
{include file="sections/header.tpl"}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6 col-md-offset-3">
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">{Lang::T('Confirm')}</div>
|
||||
<div class="panel-body">
|
||||
<center><b>{Lang::T('Customer')}</b></center>
|
||||
<ul class="list-group list-group-unbordered">
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('Username')}</b> <span class="pull-right">{$cust['username']}</span>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('Name')}</b> <span class="pull-right">{$cust['fullname']}</span>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('Phone Number')}</b> <span class="pull-right">{$cust['phonenumber']}</span>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('Email')}</b> <span class="pull-right">{$cust['email']}</span>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('Address')}</b> <span class="pull-right">{$cust['address']}</span>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('Balance')}</b> <span
|
||||
class="pull-right">{Lang::moneyFormat($cust['balance'])}</span>
|
||||
</li>
|
||||
</ul>
|
||||
<center><b>{Lang::T('Plan')}</b></center>
|
||||
<ul class="list-group list-group-unbordered">
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('Plan Name')}</b> <span class="pull-right">{$plan['name_plan']}</span>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('Location')}</b> <span
|
||||
class="pull-right">{if $plan['is_radius']}Radius{else}{$plan['routers']}{/if}</span>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('Type')}</b> <span
|
||||
class="pull-right">{if $plan['prepaid'] eq 'yes'}Prepaid{else}Postpaid{/if}
|
||||
{$plan['type']}</span>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('Plan Price')}</b> <span
|
||||
class="pull-right">{if $using eq 'zero'}{Lang::moneyFormat(0)}{else}{Lang::moneyFormat($plan['price'])}{/if}</span>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('Plan Validity')}</b> <span class="pull-right">{$plan['validity']}
|
||||
{$plan['validity_unit']}</span>
|
||||
</li>
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('Using')}</b> <span class="pull-right">{ucwords($using)}</span>
|
||||
</li>
|
||||
</ul>
|
||||
<center><b>{Lang::T('Total')}</b></center>
|
||||
<ul class="list-group list-group-unbordered">
|
||||
{if $add_rem != 0 and $using neq 'zero' and $add_cost>0}
|
||||
{foreach $bills as $k => $v}
|
||||
<li class="list-group-item">
|
||||
<b>{$k}</b> <span class="pull-right">{Lang::moneyFormat($v)}</span>
|
||||
</li>
|
||||
{/foreach}
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('Additional Cost')}</b> <span
|
||||
class="pull-right">{Lang::moneyFormat($add_cost)}</span>
|
||||
</li>
|
||||
{if $add_rem != ''}
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('Remaining')}</b> <span class="pull-right">{$add_rem}</span>
|
||||
</li>
|
||||
{/if}
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('Total')}</b> <small>({Lang::T('Plan Price')} +{Lang::T('Additional Cost')})</small><span class="pull-right"
|
||||
style="font-size: large; font-weight:bolder; font-family: 'Courier New', Courier, monospace; ">{Lang::moneyFormat($plan['price']+$add_cost)}</span>
|
||||
</li>
|
||||
{else}
|
||||
<li class="list-group-item">
|
||||
<b>{Lang::T('Total')}</b> <span class="pull-right"
|
||||
style="font-size: large; font-weight:bolder; font-family: 'Courier New', Courier, monospace; ">{if $using eq 'zero'}{Lang::moneyFormat(0)}{else}{Lang::moneyFormat($plan['price'])}{/if}</span>
|
||||
</li>
|
||||
{/if}
|
||||
</ul>
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}prepaid/recharge-post">
|
||||
<input type="hidden" name="id_customer" value="{$cust['id']}">
|
||||
<input type="hidden" name="plan" value="{$plan['id']}">
|
||||
<input type="hidden" name="server" value="{$server}">
|
||||
<input type="hidden" name="using" value="{$using}">
|
||||
<center>
|
||||
<button class="btn btn-success" type="submit">{Lang::T('Recharge')}</button><br>
|
||||
<a class="btn btn-link" href="{$_url}prepaid/recharge">{Lang::T('Cancel')}</a>
|
||||
</center>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{include file="sections/footer.tpl"}
|
@ -1,62 +0,0 @@
|
||||
{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('Recharge Account')}</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}prepaid/recharge-post" >
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Select Account')}</label>
|
||||
<div class="col-md-6">
|
||||
<select id="personSelect" class="form-control select2" name="id_customer" style="width: 100%" data-placeholder="Select a customer...">
|
||||
<option></option>
|
||||
{foreach $c as $cs}
|
||||
{if $id eq $cs['id']}
|
||||
<option value="{$cs['id']}" selected>{$cs['username']}</option>
|
||||
{else}
|
||||
<option value="{$cs['id']}">{$cs['username']}</option>
|
||||
{/if}
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Type')}</label>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Routers')}</label>
|
||||
<div class="col-md-6">
|
||||
<select id="server" name="server" class="form-control select2">
|
||||
<option value=''>Select Routers</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Service Plan')}</label>
|
||||
<div class="col-md-6">
|
||||
<select id="plan" name="plan" class="form-control select2">
|
||||
<option value=''>Select Plans</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-2 col-lg-10">
|
||||
<button class="btn btn-success" type="submit">{Lang::T('Recharge')}</button>
|
||||
Or <a href="{$_url}customers/list">{Lang::T('Cancel')}</a>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
{include file="sections/footer.tpl"}
|
@ -5,7 +5,7 @@
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">{Lang::T('Recharge Account')}</div>
|
||||
<div class="panel-body">
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}prepaid/recharge-post">
|
||||
<form class="form-horizontal" method="post" role="form" action="{$_url}prepaid/recharge-confirm">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Select Account')}</label>
|
||||
<div class="col-md-6">
|
||||
@ -27,7 +27,7 @@
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Routers')}</label>
|
||||
<div class="col-md-6">
|
||||
<select id="server" name="server" class="form-control select2">
|
||||
<select id="server" data-type="server" name="server" class="form-control select2">
|
||||
<option value=''>{Lang::T('Select Routers')}</option>
|
||||
</select>
|
||||
</div>
|
||||
@ -41,7 +41,19 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Using')}</label>
|
||||
<div class="col-md-6">
|
||||
<select name="using" class="form-control">
|
||||
<option value="cash">{Lang::T('Cash')}</option>
|
||||
{if $_c['enable_balance'] eq 'yes'}
|
||||
<option value="balance">{Lang::T('Customer Balance')}</option>
|
||||
{/if}
|
||||
<option value="zero">{$_c['currency_code']} 0</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="help-block col-md-4">Postpaid Recharge for the first time use {$_c['currency_code']} 0</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-2 col-lg-10">
|
||||
<button class="btn btn-success"
|
||||
|
@ -27,21 +27,21 @@
|
||||
if (el.addEventListener) { // all browsers except IE before version 9
|
||||
el.addEventListener("click", function() {
|
||||
$(this).html(
|
||||
`<span class="glyphicon glyphicon-refresh" role="status" aria-hidden="true"></span>`
|
||||
`<span class="loading"></span>`
|
||||
);
|
||||
setTimeout(() => {
|
||||
$(this).prop("disabled", true);
|
||||
}, 100);
|
||||
// setTimeout(() => {
|
||||
// $(this).prop("disabled", true);
|
||||
// }, 100);
|
||||
}, false);
|
||||
} else {
|
||||
if (el.attachEvent) { // IE before version 9
|
||||
el.attachEvent("click", function() {
|
||||
$(this).html(
|
||||
`<span class="glyphicon glyphicon-refresh" role="status" aria-hidden="true"></span>`
|
||||
`<span class="loading"></span>`
|
||||
);
|
||||
setTimeout(() => {
|
||||
$(this).prop("disabled", true);
|
||||
}, 100);
|
||||
// setTimeout(() => {
|
||||
// $(this).prop("disabled", true);
|
||||
// }, 100);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
@ -57,8 +57,36 @@
|
||||
max-height: 1em;
|
||||
line-height: 1em;
|
||||
}
|
||||
</style>
|
||||
|
||||
|
||||
.loading {
|
||||
pointer-events: none;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.loading::after {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
vertical-align: middle;
|
||||
margin-left: 10px;
|
||||
border: 2px solid #fff;
|
||||
border-top-color: transparent;
|
||||
border-radius: 50%;
|
||||
animation: spin 0.8s infinite linear;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
{if isset($xheader)}
|
||||
{$xheader}
|
||||
{/if}
|
||||
@ -130,69 +158,64 @@
|
||||
</li>
|
||||
{$_MENU_AFTER_DASHBOARD}
|
||||
{if !in_array($_admin['user_type'],['Report'])}
|
||||
<li class="{if $_system_menu eq 'customers'}active{/if} treeview">
|
||||
<a href="#">
|
||||
<i class="ion ion-android-contacts"></i> <span>{Lang::T('Customer')}</span>
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
<li {if $_system_menu eq 'customers'}class="active" {/if}>
|
||||
<a href="{$_url}customers">
|
||||
<i class="fa fa-users"></i>
|
||||
<span>{Lang::T('Customer')}</span>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li {if $_routes[1] eq 'add'}class="active" {/if}><a href="{$_url}customers/add"><i
|
||||
class="fa fa-user-plus"></i> {Lang::T('Add New Contact')}</a></li>
|
||||
<li {if $_routes[1] eq 'list'}class="active" {/if}><a href="{$_url}customers/list"><i
|
||||
class="fa fa-users"></i> {Lang::T('List Contact')}</a></li>
|
||||
{$_MENU_CUSTOMERS}
|
||||
</ul>
|
||||
</li>
|
||||
{$_MENU_AFTER_CUSTOMERS}
|
||||
<li class="{if $_system_menu eq 'prepaid'}active{/if} treeview">
|
||||
<a href="#">
|
||||
<i class="fa fa-ticket"></i> <span>{Lang::T('Prepaid')}</span>
|
||||
<i class="fa fa-ticket"></i> <span>{Lang::T('Services')}</span>
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li {if $_routes[1] eq 'list'}class="active" {/if}><a
|
||||
href="{$_url}prepaid/list">{Lang::T('Prepaid Users')}</a></li>
|
||||
href="{$_url}prepaid/list">{Lang::T('Active Users')}</a></li>
|
||||
{if $_c['disable_voucher'] != 'yes'}
|
||||
<li {if $_routes[1] eq 'voucher'}class="active" {/if}><a
|
||||
href="{$_url}prepaid/voucher">{Lang::T('Prepaid Vouchers')}</a></li>
|
||||
href="{$_url}prepaid/voucher">{Lang::T('Vouchers')}</a></li>
|
||||
<li {if $_routes[1] eq 'refill'}class="active" {/if}><a
|
||||
href="{$_url}prepaid/refill">{Lang::T('Refill Account')}</a></li>
|
||||
href="{$_url}prepaid/refill">{Lang::T('Refill Customer')}</a></li>
|
||||
{/if}
|
||||
<li {if $_routes[1] eq 'recharge'}class="active" {/if}><a
|
||||
href="{$_url}prepaid/recharge">{Lang::T('Recharge Account')}</a></li>
|
||||
<li {if $_routes[1] eq 'deposit'}class="active" {/if}><a
|
||||
href="{$_url}prepaid/deposit">{Lang::T('Refill Balance')}</a></li>
|
||||
{$_MENU_PREPAID}
|
||||
href="{$_url}prepaid/recharge">{Lang::T('Recharge Customer')}</a></li>
|
||||
{if $_c['enable_balance'] == 'yes'}
|
||||
<li {if $_routes[1] eq 'deposit'}class="active" {/if}><a
|
||||
href="{$_url}prepaid/deposit">{Lang::T('Refill Balance')}</a></li>
|
||||
{/if}
|
||||
{$_MENU_SERVICES}
|
||||
</ul>
|
||||
</li>
|
||||
{/if}
|
||||
{$_MENU_AFTER_PREPAID}
|
||||
{$_MENU_AFTER_SERVICES}
|
||||
{if in_array($_admin['user_type'],['SuperAdmin','Admin'])}
|
||||
<li class="{if $_system_menu eq 'services'}active{/if} treeview">
|
||||
<a href="#">
|
||||
<i class="ion ion-cube"></i> <span>{Lang::T('Services')}</span>
|
||||
<i class="ion ion-cube"></i> <span>{Lang::T('Plans')}</span>
|
||||
<span class="pull-right-container">
|
||||
<i class="fa fa-angle-left pull-right"></i>
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li {if $_routes[1] eq 'hotspot'}class="active" {/if}><a
|
||||
href="{$_url}services/hotspot">{Lang::T('Hotspot Plans')}</a></li>
|
||||
href="{$_url}services/hotspot">{Lang::T('Hotspot')}</a></li>
|
||||
<li {if $_routes[1] eq 'pppoe'}class="active" {/if}><a
|
||||
href="{$_url}services/pppoe">{Lang::T('PPPOE Plans')}</a></li>
|
||||
href="{$_url}services/pppoe">{Lang::T('PPPOE')}</a></li>
|
||||
<li {if $_routes[1] eq 'list'}class="active" {/if}><a
|
||||
href="{$_url}bandwidth/list">{Lang::T('Bandwidth Plans')}</a></li>
|
||||
<li {if $_routes[1] eq 'balance'}class="active" {/if}><a
|
||||
href="{$_url}services/balance">{Lang::T('Balance Plans')}</a></li>
|
||||
{$_MENU_SERVICES}
|
||||
href="{$_url}bandwidth/list">{Lang::T('Bandwidth')}</a></li>
|
||||
{if $_c['enable_balance'] == 'yes'}
|
||||
<li {if $_routes[1] eq 'balance'}class="active" {/if}><a
|
||||
href="{$_url}services/balance">{Lang::T('Balance')}</a></li>
|
||||
{/if}
|
||||
{$_MENU_PLANS}
|
||||
</ul>
|
||||
</li>
|
||||
{/if}
|
||||
{$_MENU_AFTER_SERVICES}
|
||||
{$_MENU_AFTER_PLANS}
|
||||
<li class="{if $_system_menu eq 'reports'}active{/if} treeview">
|
||||
<a href="#">
|
||||
<i class="ion ion-clipboard"></i> <span>{Lang::T('Reports')}</span>
|
||||
@ -258,6 +281,9 @@
|
||||
href="{$_url}pages/Voucher">{Lang::T('Voucher')} Template</a></li>
|
||||
<li {if $_routes[1] eq 'Announcement'}class="active" {/if}><a
|
||||
href="{$_url}pages/Announcement">{Lang::T('Announcement')}</a></li>
|
||||
<li {if $_routes[1] eq 'Announcement_Customer'}class="active" {/if}><a
|
||||
href="{$_url}pages/Announcement_Customer">{Lang::T('Customer Announcement')}</a>
|
||||
</li>
|
||||
<li {if $_routes[1] eq 'Registration_Info'}class="active" {/if}><a
|
||||
href="{$_url}pages/Registration_Info">{Lang::T('Registration Info')}</a></li>
|
||||
<li {if $_routes[1] eq 'Privacy_Policy'}class="active" {/if}><a
|
||||
|
@ -85,7 +85,7 @@
|
||||
if (el.addEventListener) { // all browsers except IE before version 9
|
||||
el.addEventListener("click", function() {
|
||||
$(this).html(
|
||||
`<span class="glyphicon glyphicon-refresh" role="status" aria-hidden="true"></span>`
|
||||
`<span class="loading"></span>`
|
||||
);
|
||||
setTimeout(() => {
|
||||
$(this).prop("disabled", true);
|
||||
@ -95,7 +95,7 @@
|
||||
if (el.attachEvent) { // IE before version 9
|
||||
el.attachEvent("click", function() {
|
||||
$(this).html(
|
||||
`<span class="glyphicon glyphicon-refresh" role="status" aria-hidden="true"></span>`
|
||||
`<span class="loading"></span>`
|
||||
);
|
||||
setTimeout(() => {
|
||||
$(this).prop("disabled", true);
|
||||
|
@ -37,6 +37,35 @@
|
||||
margin-top: 100px;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.loading {
|
||||
pointer-events: none;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.loading::after {
|
||||
content: "";
|
||||
display: inline-block;
|
||||
width: 16px;
|
||||
height: 16px;
|
||||
vertical-align: middle;
|
||||
margin-left: 10px;
|
||||
border: 2px solid #fff;
|
||||
border-top-color: transparent;
|
||||
border-radius: 50%;
|
||||
animation: spin 0.8s infinite linear;
|
||||
}
|
||||
|
||||
@keyframes spin {
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(360deg);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
{if isset($xheader)}
|
||||
@ -61,7 +90,8 @@
|
||||
<li class="dropdown user user-menu">
|
||||
<a href="#" class="dropdown-toggle" data-toggle="dropdown">
|
||||
{if $_c['enable_balance'] == 'yes'}
|
||||
<span style="color: whitesmoke;"> {Lang::moneyFormat($_user['balance'])} </span>
|
||||
<span
|
||||
style="color: whitesmoke;"> {Lang::moneyFormat($_user['balance'])} </span>
|
||||
{else}
|
||||
<span>{$_user['fullname']}</span>
|
||||
{/if}
|
||||
@ -78,7 +108,7 @@
|
||||
<p>
|
||||
{$_user['fullname']}
|
||||
<small>{$_user['phonenumber']}<br>
|
||||
{$_user['email']}</small>
|
||||
{$_user['email']}</small>
|
||||
</p>
|
||||
</li>
|
||||
<li class="user-body">
|
||||
@ -168,20 +198,20 @@
|
||||
|
||||
|
||||
{if isset($notify)}
|
||||
<script>
|
||||
// Display SweetAlert toast notification
|
||||
Swal.fire({
|
||||
icon: '{if $notify_t == "s"}success{else}warning{/if}',
|
||||
title: '{$notify}',
|
||||
toast: true,
|
||||
position: 'top-end',
|
||||
showConfirmButton: false,
|
||||
timer: 5000,
|
||||
timerProgressBar: true,
|
||||
didOpen: (toast) => {
|
||||
toast.addEventListener('mouseenter', Swal.stopTimer)
|
||||
toast.addEventListener('mouseleave', Swal.resumeTimer)
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/if}
|
||||
<script>
|
||||
// Display SweetAlert toast notification
|
||||
Swal.fire({
|
||||
icon: '{if $notify_t == "s"}success{else}warning{/if}',
|
||||
title: '{$notify}',
|
||||
toast: true,
|
||||
position: 'top-end',
|
||||
showConfirmButton: false,
|
||||
timer: 5000,
|
||||
timerProgressBar: true,
|
||||
didOpen: (toast) => {
|
||||
toast.addEventListener('mouseenter', Swal.stopTimer)
|
||||
toast.addEventListener('mouseleave', Swal.resumeTimer)
|
||||
}
|
||||
});
|
||||
</script>
|
||||
{/if}
|
@ -10,7 +10,7 @@
|
||||
<table id="datatable" class="table table-bordered table-striped table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>{Lang::T('Username')}</th>
|
||||
<th>{Lang::T('Invoice')}</th>
|
||||
<th>{Lang::T('Plan Name')}</th>
|
||||
<th>{Lang::T('Plan Price')}</th>
|
||||
<th>{Lang::T('Type')}</th>
|
||||
@ -21,8 +21,8 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
{foreach $d as $ds}
|
||||
<tr>
|
||||
<td>{$ds['username']}</td>
|
||||
<tr onclick="window.location.href = '{$_url}voucher/invoice/{$ds['id']}'" style="cursor: pointer;">
|
||||
<td>{$ds['invoice']}</td>
|
||||
<td>{$ds['plan_name']}</td>
|
||||
<td>{Lang::moneyFormat($ds['price'])}</td>
|
||||
<td>{$ds['type']}</td>
|
||||
|
@ -53,7 +53,10 @@
|
||||
<h3 class="box-title">{Lang::T('Announcement')}</h3>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
{include file="$_path/../pages/Announcement.html"}
|
||||
{$Announcement_Customer = "{$PAGES_PATH}/Announcement_Customer.html"}
|
||||
{if file_exists($Announcement_Customer)}
|
||||
{include file=$Announcement_Customer}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -111,7 +114,7 @@
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">{$_bill['routers']}</h3>
|
||||
<div class="btn-group pull-right">
|
||||
{if $_bill['type'] != 'Hotspot'}
|
||||
{if $_bill['type'] == 'Hotspot'}
|
||||
{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}
|
||||
{else}
|
||||
{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}
|
||||
@ -128,11 +131,8 @@
|
||||
<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}home&deactivate={$_bill['id']}"
|
||||
onclick="return confirm('{Lang::T('Deactivate')}?')">{Lang::T('Deactivate')}</a>
|
||||
{else}
|
||||
<a class="label label-warning pull-right" href="{$_url}order/package">{Lang::T('expired')}</a>
|
||||
{if $_bill['status'] != 'on'}
|
||||
<a class="label label-danger pull-right" href="{$_url}order/package">{Lang::T('expired')}</a>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
@ -146,17 +146,21 @@
|
||||
<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}
|
||||
<a class="label label-primary pull-right" href="{$_url}home&recharge={$_bill['id']}"
|
||||
onclick="return confirm('{Lang::T('Recharge')}?')">{Lang::T('Recharge')}</a>
|
||||
</td>
|
||||
</tr>
|
||||
{if $nux_ip}
|
||||
<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>
|
||||
</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}
|
||||
{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>
|
||||
@ -170,6 +174,18 @@
|
||||
</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">
|
||||
<a class="btn btn-primary pull-right btn-sm" href="{$_url}home&recharge={$_bill['id']}"
|
||||
onclick="return confirm('{Lang::T('Recharge')}?')">{Lang::T('Recharge')}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
{/foreach}
|
||||
</div>
|
||||
|
@ -32,7 +32,10 @@
|
||||
<div class="panel panel-info">
|
||||
<div class="panel-heading">{Lang::T('Announcement')}</div>
|
||||
<div class="panel-body">
|
||||
{include file="$_path/../pages/Announcement.html"}
|
||||
{$Announcement = "{$PAGES_PATH}/Announcement.html"}
|
||||
{if file_exists($Announcement)}
|
||||
{include file=$Announcement}
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -21,7 +21,7 @@
|
||||
</table>
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<a href="{$_url}order/buy/0/{$plan['id']}"
|
||||
<a href="{$_url}order/gateway/0/{$plan['id']}"
|
||||
onclick="return confirm('{Lang::T('Buy Balance')}?')"
|
||||
class="btn btn-sm btn-block btn-primary">Buy</a>
|
||||
</div>
|
||||
|
@ -37,7 +37,7 @@
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
||||
<a href="{$_url}order/buy/radius/{$plan['id']}"
|
||||
<a href="{$_url}order/gateway/radius/{$plan['id']}"
|
||||
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
|
||||
class="btn btn-sm btn-block btn-warning text-black">Buy</a>
|
||||
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
|
||||
@ -88,7 +88,7 @@
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
||||
<a href="{$_url}order/buy/radius/{$plan['id']}"
|
||||
<a href="{$_url}order/gateway/radius/{$plan['id']}"
|
||||
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
|
||||
class="btn btn-sm btn-block btn-warning text-black">Buy</a>
|
||||
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
|
||||
@ -139,7 +139,7 @@
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
||||
<a href="{$_url}order/buy/pppoe/{$plan['id']}"
|
||||
<a href="{$_url}order/gateway/pppoe/{$plan['id']}"
|
||||
onclick="return confirm('{Lang::T('Buy this? your active package will be overwritten')}')"
|
||||
class="btn btn-sm btn-block btn-warning text-black">Buy</a>
|
||||
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
|
||||
@ -188,7 +188,7 @@
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
||||
<a href="{$_url}order/buy/hotspot/{$plan['id']}"
|
||||
<a href="{$_url}order/gateway/hotspot/{$plan['id']}"
|
||||
onclick="return confirm('{Lang::T('Buy this? your active package will be overwritten')}')"
|
||||
class="btn btn-sm btn-block btn-warning text-black">Buy</a>
|
||||
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
|
||||
@ -248,7 +248,7 @@
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
||||
<a href="{$_url}order/buy/{$router['id']}/{$plan['id']}"
|
||||
<a href="{$_url}order/gateway/{$router['id']}/{$plan['id']}"
|
||||
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
|
||||
class="btn btn-sm btn-block btn-warning text-black">Buy</a>
|
||||
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
|
||||
@ -297,7 +297,7 @@
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
||||
<a href="{$_url}order/buy/{$router['id']}/{$plan['id']}"
|
||||
<a href="{$_url}order/gateway/{$router['id']}/{$plan['id']}"
|
||||
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
|
||||
class="btn btn-sm btn-block btn-warning text-black">Buy</a>
|
||||
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
|
||||
@ -347,7 +347,7 @@
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
||||
<a href="{$_url}order/buy/{$router['id']}/{$plan['id']}"
|
||||
<a href="{$_url}order/gateway/{$router['id']}/{$plan['id']}"
|
||||
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
|
||||
class="btn btn-sm btn-block btn-warning text-black">Buy</a>
|
||||
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
|
||||
@ -394,7 +394,7 @@
|
||||
</div>
|
||||
<div class="box-body">
|
||||
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
||||
<a href="{$_url}order/buy/{$router['id']}/{$plan['id']}"
|
||||
<a href="{$_url}order/gateway/{$router['id']}/{$plan['id']}"
|
||||
onclick="return confirm('{Lang::T('Buy this? your active package will be overwrite')}')"
|
||||
class="btn btn-sm btn-block btn-warning text-black">Buy</a>
|
||||
{if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']}
|
||||
|
29
ui/ui/user-selectGateway.tpl
Normal file
29
ui/ui/user-selectGateway.tpl
Normal file
@ -0,0 +1,29 @@
|
||||
{include file="sections/user-header.tpl"}
|
||||
|
||||
<div class="row">
|
||||
<div class="col-sm-12">
|
||||
<div class="panel panel-info panel-hovered">
|
||||
<div class="panel-heading">{Lang::T('Available Payment Gateway')}</div>
|
||||
<div class="panel-footer">
|
||||
<form method="post" action="{$_url}order/buy/{$route2}/{$route3}">
|
||||
<div class="form-group row">
|
||||
<label class="col-md-2 control-label">Payment Gateway</label>
|
||||
<div class="col-md-8">
|
||||
<select name="gateway" id="gateway" class="form-control">
|
||||
{foreach $pgs as $pg}
|
||||
<option value="{$pg}">
|
||||
{ucwords($pg)}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<button type="submit" class="btn btn-block btn-primary">{Lang::T('Pay Now')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{include file="sections/user-footer.tpl"}
|
@ -65,7 +65,7 @@
|
||||
<div class="form-group">
|
||||
<label class="col-md-3 control-label">{Lang::T('User Type')}</label>
|
||||
<div class="col-md-9">
|
||||
<select name="user_type" id="user_type" class="form-control">
|
||||
<select name="user_type" id="user_type" class="form-control" onchange="checkUserType(this)">
|
||||
{if $_admin['user_type'] eq 'Agent'}
|
||||
<option value="Sales" {if $d['user_type'] eq 'Sales'}selected="selected" {/if}>Sales
|
||||
</option>
|
||||
@ -87,7 +87,7 @@
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group {if $d['user_type'] eq 'Sales'}hidden{/if}" id="agentChooser">
|
||||
<div class="form-group {if $d['user_type'] neq 'Sales'}hidden{/if}" id="agentChooser">
|
||||
<label class="col-md-3 control-label">{Lang::T('Agent')}</label>
|
||||
<div class="col-md-9">
|
||||
<select name="root" id="root" class="form-control">
|
||||
|
@ -11,7 +11,7 @@
|
||||
class="glyphicon glyphicon-trash" aria-hidden="true"></span> Delete All</a>
|
||||
</div>
|
||||
{/if}
|
||||
{Lang::T('Prepaid Vouchers')}
|
||||
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
|
||||
|
@ -77,6 +77,9 @@ if (empty($step)) {
|
||||
// remove downloaded zip
|
||||
if (file_exists($file)) unlink($file);
|
||||
} else if ($step == 3) {
|
||||
deleteFolder('system/autoload/');
|
||||
deleteFolder('system/vendor/');
|
||||
deleteFolder('ui/ui/');
|
||||
copyFolder($folder, pathFixer('./'));
|
||||
deleteFolder('install/');
|
||||
deleteFolder($folder);
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "2024.2.26"
|
||||
"version": "2024.3.14"
|
||||
}
|
Reference in New Issue
Block a user