Compare commits
47 Commits
Author | SHA1 | Date | |
---|---|---|---|
5111166316 | |||
e53fe225cc | |||
c0a232797a | |||
5c33806326 | |||
d5d03875f0 | |||
df2e548a2a | |||
e3796d38e4 | |||
51015f8dc2 | |||
905f5c0772 | |||
ec5c78b5b3 | |||
fd4c634b9b | |||
264b7b43f6 | |||
c32e921cab | |||
694428f804 | |||
8061acbf9e | |||
922f24b630 | |||
79585d54a1 | |||
29db5cd139 | |||
7a005d2393 | |||
b807581d8c | |||
e5605e2d6b | |||
49ea4966f8 | |||
06643055ae | |||
847f074a6b | |||
938173cab7 | |||
27aeb93b57 | |||
c2611fe025 | |||
0520b1f337 | |||
88be741b8c | |||
3197c944f8 | |||
70e8acedc5 | |||
c4aa6aabfd | |||
44f2bc28ce | |||
12b7eba60f | |||
e34f156d0a | |||
c99231c45d | |||
ce7302cab7 | |||
d57d356ce3 | |||
60bd876b7f | |||
9d564f55ec | |||
7a40fe6e11 | |||
d323a9d582 | |||
81a2e1f936 | |||
410eb34d4a | |||
835276fef5 | |||
c53f23107b | |||
119690dae2 |
5
.gitignore
vendored
5
.gitignore
vendored
@ -48,4 +48,7 @@ system/devices/**
|
||||
!system/devices/MikrotikPppoe.php
|
||||
!system/devices/MikrotikHotspot.php
|
||||
/.vs
|
||||
docker-compose.yml
|
||||
docker-compose.yml
|
||||
docs/**
|
||||
!docs/*.html
|
||||
!docs/*.md
|
21
CHANGELOG.md
21
CHANGELOG.md
@ -2,6 +2,27 @@
|
||||
|
||||
# CHANGELOG
|
||||
|
||||
## 2024.7.23
|
||||
|
||||
- add Voucher Used Date
|
||||
- Reports page just 1 for all
|
||||
- fix start date at dashboard
|
||||
- fix installation parameter
|
||||
|
||||
## 2024.7.23
|
||||
|
||||
- Add Additional Bill Info to Customer
|
||||
- Add Voucher only Login, without username
|
||||
- Add Additional Bill info to Mikrotik Comment
|
||||
- Add dynamic Application URL For Installation
|
||||
- Fix Active Customers for Voucher
|
||||
|
||||
## 2024.7.15
|
||||
|
||||
- Radius Rest API
|
||||
- Getting Started Documentation
|
||||
- Only Show new update just once
|
||||
|
||||
## 2024.6.21
|
||||
|
||||
- Add filter result in voucher and internet plan
|
||||
|
@ -4,6 +4,23 @@ $db_port = ""; # Database Port. Keep it blank if you are un sure.
|
||||
$db_user = "root"; # Database Username
|
||||
$db_password = ""; # Database Password
|
||||
$db_name = "phpnuxbill"; # Database Name
|
||||
define('APP_URL', 'http://localhost/phpnuxbill'); # Application URL.
|
||||
$protocol = (!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off' || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
|
||||
$host = $_SERVER['HTTP_HOST'];
|
||||
$baseDir = rtrim(dirname($_SERVER['SCRIPT_NAME']), '/\\');
|
||||
define('APP_URL', $protocol . $host . $baseDir);
|
||||
#Please include http and do not use trailing slash after the url. For example use in this format- http://www.example.com Or http://www.example.com/finance
|
||||
$_app_stage = 'Live'; # Do not change this
|
||||
$_app_stage = 'Live'; # Do not change this
|
||||
|
||||
|
||||
|
||||
|
||||
//error reporting
|
||||
if($_app_stage!='Live'){
|
||||
error_reporting(E_ERROR);
|
||||
ini_set('display_errors', 1);
|
||||
ini_set('display_startup_errors', 1);
|
||||
}else{
|
||||
error_reporting(E_ERROR);
|
||||
ini_set('display_errors', 0);
|
||||
ini_set('display_startup_errors', 0);
|
||||
}
|
||||
|
3298
docs/index.html
Normal file
3298
docs/index.html
Normal file
File diff suppressed because one or more lines are too long
@ -18,6 +18,14 @@ if(isset($_GET['nux-router']) && !empty($_GET['nux-router'])){
|
||||
$_SESSION['nux-router'] = $_GET['nux-router'];
|
||||
}
|
||||
|
||||
//get chap id and chap challenge
|
||||
if(isset($_GET['nux-key']) && !empty($_GET['nux-key'])){
|
||||
$_SESSION['nux-key'] = $_GET['nux-key'];
|
||||
}
|
||||
//get mikrotik hostname
|
||||
if(isset($_GET['nux-hostname']) && !empty($_GET['nux-hostname'])){
|
||||
$_SESSION['nux-hostname'] = $_GET['nux-hostname'];
|
||||
}
|
||||
require_once 'system/vendor/autoload.php';
|
||||
require_once 'system/boot.php';
|
||||
App::_run();
|
||||
|
7
init.php
7
init.php
@ -67,9 +67,13 @@ require_once $root_path . File::pathFixer('system/orm.php');
|
||||
require_once $root_path . File::pathFixer('system/autoload/PEAR2/Autoload.php');
|
||||
include $root_path . File::pathFixer('system/autoload/Hookers.php');
|
||||
|
||||
if(!empty($db_password)){
|
||||
// compability for old version
|
||||
$db_pass = $db_password;
|
||||
}
|
||||
ORM::configure("mysql:host=$db_host;dbname=$db_name");
|
||||
ORM::configure('username', $db_user);
|
||||
ORM::configure('password', $db_password);
|
||||
ORM::configure('password', $db_pass);
|
||||
ORM::configure('return_result_sets', true);
|
||||
if ($_app_stage != 'Live') {
|
||||
ORM::configure('logging', true);
|
||||
@ -112,6 +116,7 @@ date_default_timezone_set($config['timezone']);
|
||||
|
||||
if ((!empty($radius_user) && $config['radius_enable']) || _post('radius_enable')) {
|
||||
if(!empty($radius_password)){
|
||||
// compability for old version
|
||||
$radius_pass = $radius_password;
|
||||
}
|
||||
ORM::configure("mysql:host=$radius_host;dbname=$radius_name", null, 'radius');
|
||||
|
@ -201,10 +201,39 @@ CREATE TABLE `tbl_voucher` (
|
||||
`code` varchar(55) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`user` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`status` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`used_date` DATETIME NULL DEFAULT NULL,
|
||||
`generated_by` int NOT NULL DEFAULT '0' COMMENT 'id admin'
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
||||
|
||||
DROP TABLE IF EXISTS `rad_acct`;
|
||||
CREATE TABLE `rad_acct` (
|
||||
`id` bigint NOT NULL,
|
||||
`acctsessionid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
|
||||
`username` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
|
||||
`realm` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
|
||||
`nasid` varchar(32) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
|
||||
`nasipaddress` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
|
||||
`nasportid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`nasporttype` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`framedipaddress` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
|
||||
`acctstatustype` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
|
||||
`macaddr` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
|
||||
`dateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
|
||||
|
||||
|
||||
ALTER TABLE `rad_acct`
|
||||
ADD PRIMARY KEY (`id`),
|
||||
ADD KEY `username` (`username`),
|
||||
ADD KEY `framedipaddress` (`framedipaddress`),
|
||||
ADD KEY `acctsessionid` (`acctsessionid`),
|
||||
ADD KEY `nasipaddress` (`nasipaddress`);
|
||||
|
||||
|
||||
ALTER TABLE `rad_acct`
|
||||
MODIFY `id` bigint NOT NULL AUTO_INCREMENT;
|
||||
|
||||
ALTER TABLE `tbl_appconfig`
|
||||
ADD PRIMARY KEY (`id`);
|
||||
|
||||
|
@ -28,53 +28,60 @@ if ($cn == '1') {
|
||||
if (isset($_POST['radius']) && $_POST['radius'] == 'yes') {
|
||||
$input = '<?php
|
||||
|
||||
define(\'APP_URL\', \'' . $appurl . '\');
|
||||
$_app_stage = \'Live\';
|
||||
$protocol = (!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] !== "off" || $_SERVER["SERVER_PORT"] == 443) ? "https://" : "http://";
|
||||
$host = $_SERVER["HTTP_HOST"];
|
||||
$baseDir = rtrim(dirname($_SERVER["SCRIPT_NAME"]), "/\\");
|
||||
define("APP_URL", $protocol . $host . $baseDir);
|
||||
|
||||
// Live, Dev, Demo
|
||||
$_app_stage = "Live";
|
||||
|
||||
// Database PHPNuxBill
|
||||
$db_host = \'' . $db_host . '\';
|
||||
$db_user = \'' . $db_user . '\';
|
||||
$db_password = \'' . $db_password . '\';
|
||||
$db_name = \'' . $db_name . '\';
|
||||
$db_host = "' . $db_host . '";
|
||||
$db_user = "' . $db_user . '";
|
||||
$db_pass = "' . $db_password . '";
|
||||
$db_name = "' . $db_name . '";
|
||||
|
||||
// Database Radius
|
||||
$radius_host = \'' . $db_host . '\';
|
||||
$radius_user = \'' . $db_user . '\';
|
||||
$radius_pass = \'' . $db_password . '\';
|
||||
$radius_name = \'' . $db_name . '\';
|
||||
$radius_host = "' . $db_host . '";
|
||||
$radius_user = "' . $db_user . '";
|
||||
$radius_pass = "' . $db_password . '";
|
||||
$radius_name = "' . $db_name . '";
|
||||
|
||||
if($_app_stage!=\'Live\'){
|
||||
if($_app_stage!="Live"){
|
||||
error_reporting(E_ERROR);
|
||||
ini_set(\'display_errors\', 1);
|
||||
ini_set(\'display_startup_errors\', 1);
|
||||
ini_set("display_errors", 1);
|
||||
ini_set("display_startup_errors", 1);
|
||||
}else{
|
||||
error_reporting(E_ERROR);
|
||||
ini_set(\'display_errors\', 0);
|
||||
ini_set(\'display_startup_errors\', 0);
|
||||
}
|
||||
';
|
||||
ini_set("display_errors", 0);
|
||||
ini_set("display_startup_errors", 0);
|
||||
}';
|
||||
} else {
|
||||
$input = '<?php
|
||||
$protocol = (!empty($_SERVER["HTTPS"]) && $_SERVER["HTTPS"] !== "off" || $_SERVER["SERVER_PORT"] == 443) ? "https://" : "http://";
|
||||
$host = $_SERVER["HTTP_HOST"];
|
||||
$baseDir = rtrim(dirname($_SERVER["SCRIPT_NAME"]), "/\\");
|
||||
define("APP_URL", $protocol . $host . $baseDir);
|
||||
|
||||
define(\'APP_URL\', \'' . $appurl . '\');
|
||||
$_app_stage = \'Live\';
|
||||
// Live, Dev, Demo
|
||||
$_app_stage = "Live";
|
||||
|
||||
// Database PHPNuxBill
|
||||
$db_host = \'' . $db_host . '\';
|
||||
$db_user = \'' . $db_user . '\';
|
||||
$db_password = \'' . $db_password . '\';
|
||||
$db_name = \'' . $db_name . '\';
|
||||
// Database PHPNuxBill
|
||||
$db_host = "' . $db_host . '";
|
||||
$db_user = "' . $db_user . '";
|
||||
$db_pass = "' . $db_password . '";
|
||||
$db_name = "' . $db_name . '";
|
||||
|
||||
if($_app_stage!=\'Live\'){
|
||||
error_reporting(E_ERROR);
|
||||
ini_set(\'display_errors\', 1);
|
||||
ini_set(\'display_startup_errors\', 1);
|
||||
}else{
|
||||
error_reporting(E_ERROR);
|
||||
ini_set(\'display_errors\', 0);
|
||||
ini_set(\'display_startup_errors\', 0);
|
||||
}
|
||||
';
|
||||
if($_app_stage!="Live"){
|
||||
error_reporting(E_ERROR);
|
||||
ini_set("display_errors", 1);
|
||||
ini_set("display_startup_errors", 1);
|
||||
}else{
|
||||
error_reporting(E_ERROR);
|
||||
ini_set("display_errors", 0);
|
||||
ini_set("display_startup_errors", 0);
|
||||
}';
|
||||
}
|
||||
$wConfig = "../config.php";
|
||||
$fh = fopen($wConfig, 'w') or die("Can't create config file, your server does not support 'fopen' function,
|
||||
|
160
pages_template/Email.html
Normal file
160
pages_template/Email.html
Normal file
@ -0,0 +1,160 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
|
||||
<head>
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||||
<title>[[Subject]]</title>
|
||||
<style media="all" type="text/css">
|
||||
@media all {
|
||||
.btn-primary table td:hover {
|
||||
background-color: #ec0867 !important;
|
||||
}
|
||||
|
||||
.btn-primary a:hover {
|
||||
background-color: #ec0867 !important;
|
||||
border-color: #ec0867 !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media only screen and (max-width: 640px) {
|
||||
|
||||
.main p,
|
||||
.main td,
|
||||
.main span {
|
||||
font-size: 16px !important;
|
||||
}
|
||||
|
||||
.wrapper {
|
||||
padding: 8px !important;
|
||||
}
|
||||
|
||||
.content {
|
||||
padding: 0 !important;
|
||||
}
|
||||
|
||||
.container {
|
||||
padding: 0 !important;
|
||||
padding-top: 8px !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.main {
|
||||
border-left-width: 0 !important;
|
||||
border-radius: 0 !important;
|
||||
border-right-width: 0 !important;
|
||||
}
|
||||
|
||||
.btn table {
|
||||
max-width: 100% !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.btn a {
|
||||
font-size: 16px !important;
|
||||
max-width: 100% !important;
|
||||
width: 100% !important;
|
||||
}
|
||||
}
|
||||
|
||||
@media all {
|
||||
.ExternalClass {
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
.ExternalClass,
|
||||
.ExternalClass p,
|
||||
.ExternalClass span,
|
||||
.ExternalClass font,
|
||||
.ExternalClass td,
|
||||
.ExternalClass div {
|
||||
line-height: 100%;
|
||||
}
|
||||
|
||||
.apple-link a {
|
||||
color: inherit !important;
|
||||
font-family: inherit !important;
|
||||
font-size: inherit !important;
|
||||
font-weight: inherit !important;
|
||||
line-height: inherit !important;
|
||||
text-decoration: none !important;
|
||||
}
|
||||
|
||||
#MessageViewBody a {
|
||||
color: inherit;
|
||||
text-decoration: none;
|
||||
font-size: inherit;
|
||||
font-family: inherit;
|
||||
font-weight: inherit;
|
||||
line-height: inherit;
|
||||
}
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body
|
||||
style="font-family: Helvetica, sans-serif; -webkit-font-smoothing: antialiased; font-size: 16px; line-height: 1.3; -ms-text-size-adjust: 100%; -webkit-text-size-adjust: 100%; background-color: #f4f5f6; margin: 0; padding: 0;">
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0" class="body"
|
||||
style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background-color: #f4f5f6; width: 100%;"
|
||||
width="100%" bgcolor="#f4f5f6">
|
||||
<tr>
|
||||
<td style="font-family: Helvetica, sans-serif; font-size: 16px; vertical-align: top;" valign="top">
|
||||
</td>
|
||||
<td class="container"
|
||||
style="font-family: Helvetica, sans-serif; font-size: 16px; vertical-align: top; max-width: 600px; padding: 0; padding-top: 24px; width: 600px; margin: 0 auto;"
|
||||
width="600" valign="top">
|
||||
<div class="content"
|
||||
style="box-sizing: border-box; display: block; margin: 0 auto; max-width: 600px; padding: 0;">
|
||||
<!-- START CENTERED WHITE CONTAINER -->
|
||||
<span class="preheader"
|
||||
style="color: transparent; display: none; height: 0; max-height: 0; max-width: 0; opacity: 0; overflow: hidden; mso-hide: all; visibility: hidden; width: 0;">This
|
||||
is preheader text. Some clients will show this text as a preview.</span>
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0" class="main"
|
||||
style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; background: #ffffff; border: 1px solid #eaebed; border-radius: 16px; width: 100%;"
|
||||
width="100%">
|
||||
<!-- START MAIN CONTENT AREA -->
|
||||
<tr>
|
||||
<td align="center"><h3>[[Company_Name]]</h3></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="wrapper"
|
||||
style="font-family: Helvetica, sans-serif; font-size: 16px; vertical-align: top; box-sizing: border-box; padding: 24px;"
|
||||
valign="top">
|
||||
<p
|
||||
style="font-family: Helvetica, sans-serif; font-size: 16px; font-weight: normal; margin: 0; margin-bottom: 16px;">
|
||||
[[Body]]</p>
|
||||
</td>
|
||||
</tr>
|
||||
|
||||
<!-- END MAIN CONTENT AREA -->
|
||||
</table>
|
||||
|
||||
<!-- START FOOTER -->
|
||||
<div class="footer" style="clear: both; padding-top: 24px; text-align: center; width: 100%;">
|
||||
<table role="presentation" border="0" cellpadding="0" cellspacing="0"
|
||||
style="border-collapse: separate; mso-table-lspace: 0pt; mso-table-rspace: 0pt; width: 100%;"
|
||||
width="100%">
|
||||
<tr>
|
||||
<td class="content-block"
|
||||
style="font-family: Helvetica, sans-serif; vertical-align: top; color: #9a9ea6; font-size: 16px; text-align: center;"
|
||||
valign="top" align="center">
|
||||
<p>
|
||||
<span class="apple-link"
|
||||
style="color: #9a9ea6; font-size: 16px; text-align: center;">[[Company_Address]]</span></p>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<!-- END FOOTER -->
|
||||
|
||||
<!-- END CENTERED WHITE CONTAINER -->
|
||||
</div>
|
||||
</td>
|
||||
<td style="font-family: Helvetica, sans-serif; font-size: 16px; vertical-align: top;" valign="top">
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</body>
|
||||
|
||||
</html>
|
263
radius.php
Normal file
263
radius.php
Normal file
@ -0,0 +1,263 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill)
|
||||
* by https://t.me/ibnux
|
||||
*
|
||||
* Authorize
|
||||
* - Voucher activation
|
||||
* Authenticate
|
||||
* - is it allow to login
|
||||
* Accounting
|
||||
* - log
|
||||
**/
|
||||
|
||||
header("Content-Type: application/json");
|
||||
|
||||
include "init.php";
|
||||
|
||||
$action = $_SERVER['HTTP_X_FREERADIUS_SECTION'];
|
||||
if (empty($action)) {
|
||||
$action = _get('action');
|
||||
}
|
||||
|
||||
$code = 200;
|
||||
|
||||
//debug
|
||||
// if (!empty($action)) {
|
||||
// file_put_contents("$action.json", json_encode([
|
||||
// 'header' => $_SERVER,
|
||||
// 'get' => $_GET,
|
||||
// 'post' => $_POST,
|
||||
// 'time' => time()
|
||||
// ]));
|
||||
// }
|
||||
|
||||
try {
|
||||
switch ($action) {
|
||||
case 'authenticate':
|
||||
$username = _req('username');
|
||||
$password = _req('password');
|
||||
if (empty($username) || empty($password)) {
|
||||
show_radius_result([
|
||||
"control:Auth-Type" => "Reject",
|
||||
"reply:Reply-Message" => 'Login invalid'
|
||||
], 401);
|
||||
}
|
||||
if ($username == $password) {
|
||||
$d = ORM::for_table('tbl_voucher')->where('code', $username)->find_one();
|
||||
} else {
|
||||
$d = ORM::for_table('tbl_customers')->where('username', $username)->find_one();
|
||||
if ($d['password'] != $password) {
|
||||
if ($d['pppoe_password'] != $password) {
|
||||
unset($d);
|
||||
}
|
||||
}
|
||||
}
|
||||
if ($d) {
|
||||
header("HTTP/1.1 204 No Content");
|
||||
die();
|
||||
} else {
|
||||
show_radius_result([
|
||||
"control:Auth-Type" => "Reject",
|
||||
"reply:Reply-Message" => 'Login invalid......'
|
||||
], 401);
|
||||
}
|
||||
break;
|
||||
case 'authorize':
|
||||
$username = _req('username');
|
||||
$password = _req('password');
|
||||
$isVoucher = ($username == $password);
|
||||
if (empty($username) || empty($password)) {
|
||||
show_radius_result([
|
||||
"control:Auth-Type" => "Reject",
|
||||
"reply:Reply-Message" => 'Login invalid......'
|
||||
], 401);
|
||||
}
|
||||
$tur = ORM::for_table('tbl_user_recharges')->where('username', $username)->find_one();
|
||||
if ($tur) {
|
||||
if (!$isVoucher) {
|
||||
$d = ORM::for_table('tbl_customers')->select('password')->where('username', $username)->find_one();
|
||||
if ($d['password'] != $password) {
|
||||
if ($d['pppoe_password'] != $password) {
|
||||
show_radius_result(['Reply-Message' => 'Username or Password is wrong'], 401);
|
||||
}
|
||||
}
|
||||
}
|
||||
process_radiust_rest($tur, $code);
|
||||
} else {
|
||||
if ($isVoucher) {
|
||||
$v = ORM::for_table('tbl_voucher')->where('code', $username)->where('routers', 'radius')->find_one();
|
||||
if ($v) {
|
||||
if ($v['status'] == 0) {
|
||||
if (Package::rechargeUser(0, $v['routers'], $v['id_plan'], "Voucher", $username)) {
|
||||
$v->status = "1";
|
||||
$v->used_date = date('Y-m-d H:i:s');
|
||||
$v->save();
|
||||
$tur = ORM::for_table('tbl_user_recharges')->where('username', $username)->find_one();
|
||||
if ($tur) {
|
||||
process_radiust_rest($tur, $code);
|
||||
} else {
|
||||
show_radius_result(['Reply-Message' => 'Voucher activation failed'], 401);
|
||||
}
|
||||
} else {
|
||||
show_radius_result(['Reply-Message' => 'Voucher activation failed.'], 401);
|
||||
}
|
||||
} else {
|
||||
show_radius_result(['Reply-Message' => 'Voucher Expired...'], 401);
|
||||
}
|
||||
} else {
|
||||
show_radius_result(['Reply-Message' => 'Voucher Expired..'], 401);
|
||||
}
|
||||
} else {
|
||||
show_radius_result(['Reply-Message' => 'Internet Plan Expired..'], 401);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'accounting':
|
||||
$username = _req('username');
|
||||
if (empty($username)) {
|
||||
show_radius_result([
|
||||
"control:Auth-Type" => "Reject",
|
||||
"reply:Reply-Message" => 'Username empty'
|
||||
], 200);
|
||||
die();
|
||||
}
|
||||
header("HTTP/1.1 200 ok");
|
||||
$d = ORM::for_table('rad_acct')
|
||||
->where('username', $username)
|
||||
->where('macaddr', _post('macAddr'))
|
||||
->where('acctstatustype', _post('acctStatusType'))
|
||||
->findOne();
|
||||
if (!$d) {
|
||||
$d = ORM::for_table('rad_acct')->create();
|
||||
}
|
||||
$d->acctsessionid = _post('acctSessionId');
|
||||
$d->username = $username;
|
||||
$d->realm = _post('realm');
|
||||
$d->nasipaddress = _post('nasip');
|
||||
$d->nasid = _post('nasid');
|
||||
$d->nasportid = _post('nasPortId');
|
||||
$d->nasporttype = _post('nasPortType');
|
||||
$d->framedipaddress = _post('framedIPAddress');
|
||||
$d->acctstatustype = _post('acctStatusType');
|
||||
$d->macaddr = _post('macAddr');
|
||||
$d->dateAdded = date('Y-m-d H:i:s');
|
||||
$d->save();
|
||||
show_radius_result([
|
||||
"control:Auth-Type" => "Accept",
|
||||
"reply:Reply-Message" => 'Saved'
|
||||
], 200);
|
||||
break;
|
||||
}
|
||||
die();
|
||||
} catch (Throwable $e) {
|
||||
Message::sendTelegram(
|
||||
"Sistem Error.\n" .
|
||||
$e->getMessage() . "\n" .
|
||||
$e->getTraceAsString()
|
||||
);
|
||||
show_radius_result(['Reply-Message' => 'Command Failed : ' . $action], 401);
|
||||
} catch (Exception $e) {
|
||||
Message::sendTelegram(
|
||||
"Sistem Error.\n" .
|
||||
$e->getMessage() . "\n" .
|
||||
$e->getTraceAsString()
|
||||
);
|
||||
show_radius_result(['Reply-Message' => 'Command Failed : ' . $action], 401);
|
||||
}
|
||||
show_radius_result(['Reply-Message' => 'Invalid Command : ' . $action], 401);
|
||||
|
||||
function process_radiust_rest($tur, $code)
|
||||
{
|
||||
global $config;
|
||||
$plan = ORM::for_table('tbl_plans')->where('id', $tur['plan_id'])->find_one();
|
||||
$bw = ORM::for_table("tbl_bandwidth")->find_one($plan['id_bw']);
|
||||
if ($bw['rate_down_unit'] == 'Kbps') {
|
||||
$unitdown = 'K';
|
||||
} else {
|
||||
$unitdown = 'M';
|
||||
}
|
||||
if ($bw['rate_up_unit'] == 'Kbps') {
|
||||
$unitup = 'K';
|
||||
} else {
|
||||
$unitup = 'M';
|
||||
}
|
||||
$rate = $bw['rate_up'] . $unitup . "/" . $bw['rate_down'] . $unitdown;
|
||||
$rates = explode('/', $rate);
|
||||
|
||||
if (!empty(trim($bw['burst']))) {
|
||||
$ratos = $rate . ' ' . $bw['burst'];
|
||||
} else {
|
||||
$ratos = $rates[0] . '/' . $rates[1];
|
||||
}
|
||||
|
||||
$attrs = [];
|
||||
$timeexp = strtotime($tur['expiration'] . ' ' . $tur['time']);
|
||||
$attrs['reply:Reply-Message'] = 'success';
|
||||
$attrs['Simultaneous-Use'] = $plan['shared_users'];
|
||||
$attrs['reply:Mikrotik-Wireless-Comment'] = $plan['name_plan'] . ' | ' . $tur['expiration'] . ' ' . $tur['time'];
|
||||
|
||||
$attrs['reply:Ascend-Data-Rate'] = str_replace('M', '000000', str_replace('K', '000', $rates[1]));
|
||||
$attrs['reply:Ascend-Xmit-Rate'] = str_replace('M', '000000', str_replace('K', '000', $rates[0]));
|
||||
$attrs['reply:Mikrotik-Rate-Limit'] = $ratos;
|
||||
$attrs['reply:WISPr-Bandwidth-Max-Up'] = str_replace('M', '000000', str_replace('K', '000', $rates[0]));
|
||||
$attrs['reply:WISPr-Bandwidth-Max-Down'] = str_replace('M', '000000', str_replace('K', '000', $rates[1]));
|
||||
$attrs['reply:expiration'] = date('d M Y H:i:s', $timeexp);
|
||||
$attrs['reply:WISPr-Session-Terminate-Time'] = date('Y-m-d', $timeexp) . 'T' . date('H:i:sP', $timeexp);
|
||||
|
||||
if ($plan['type'] == 'PPPOE') {
|
||||
$attrs['reply:Framed-Pool'] = $plan['pool'];
|
||||
}
|
||||
|
||||
if ($plan['typebp'] == "Limited") {
|
||||
if ($plan['limit_type'] == "Time_Limit") {
|
||||
if ($plan['time_unit'] == 'Hrs')
|
||||
$timelimit = $plan['time_limit'] * 60 * 60;
|
||||
else
|
||||
$timelimit = $plan['time_limit'] * 60;
|
||||
$attrs['reply:Max-All-Session'] = $timelimit;
|
||||
$attrs['reply:Expire-After'] = $timelimit;
|
||||
} else if ($plan['limit_type'] == "Data_Limit") {
|
||||
if ($plan['data_unit'] == 'GB')
|
||||
$datalimit = $plan['data_limit'] . "000000000";
|
||||
else
|
||||
$datalimit = $plan['data_limit'] . "000000";
|
||||
$attrs['reply:Max-Data'] = $datalimit;
|
||||
$attrs['reply:Mikrotik-Recv-Limit-Gigawords'] = $datalimit;
|
||||
$attrs['reply:Mikrotik-Xmit-Limit-Gigawords'] = $datalimit;
|
||||
} else if ($plan['limit_type'] == "Both_Limit") {
|
||||
if ($plan['time_unit'] == 'Hrs')
|
||||
$timelimit = $plan['time_limit'] * 60 * 60;
|
||||
else
|
||||
$timelimit = $plan['time_limit'] * 60;
|
||||
if ($plan['data_unit'] == 'GB')
|
||||
$datalimit = $plan['data_limit'] . "000000000";
|
||||
else
|
||||
$datalimit = $plan['data_limit'] . "000000";
|
||||
$attrs['reply:Max-All-Session'] = $timelimit;
|
||||
$attrs['reply:Max-Data'] = $datalimit;
|
||||
$attrs['reply:Mikrotik-Recv-Limit-Gigawords'] = $datalimit;
|
||||
$attrs['reply:Mikrotik-Xmit-Limit-Gigawords'] = $datalimit;
|
||||
}
|
||||
}
|
||||
$result = array_merge([
|
||||
"control:Auth-Type" => "Accept",
|
||||
"reply" => ["Reply-Message" => ['value' => 'success']]
|
||||
], $attrs);
|
||||
show_radius_result($result, $code);
|
||||
}
|
||||
|
||||
function show_radius_result($array, $code = 200)
|
||||
{
|
||||
if ($code == 401) {
|
||||
header("HTTP/1.1 401 Unauthorized");
|
||||
} else if ($code == 200) {
|
||||
header("HTTP/1.1 200 OK");
|
||||
} else if ($code == 204) {
|
||||
header("HTTP/1.1 204 No Content");
|
||||
die();
|
||||
}
|
||||
die(json_encode($array));
|
||||
die();
|
||||
}
|
@ -20,8 +20,8 @@ class Http
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_POST, 0);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 100);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
|
||||
if (is_array($headers) && count($headers) > 0) {
|
||||
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
|
||||
}
|
||||
@ -56,8 +56,8 @@ class Http
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 100);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
|
||||
curl_setopt($ch, CURLOPT_VERBOSE, false);
|
||||
curl_setopt($ch, CURLINFO_HEADER_OUT, false);
|
||||
if (!empty($http_proxy)) {
|
||||
@ -99,8 +99,8 @@ class Http
|
||||
$ch = curl_init();
|
||||
curl_setopt($ch, CURLOPT_URL, $url);
|
||||
curl_setopt($ch, CURLOPT_POST, 1);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
|
||||
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 100);
|
||||
curl_setopt($ch, CURLOPT_TIMEOUT, 100);
|
||||
curl_setopt($ch, CURLOPT_VERBOSE, false);
|
||||
curl_setopt($ch, CURLINFO_HEADER_OUT, false);
|
||||
if (!empty($http_proxy)) {
|
||||
|
@ -30,7 +30,7 @@ class Message
|
||||
public static function sendSMS($phone, $txt)
|
||||
{
|
||||
global $config;
|
||||
if(empty($txt)){
|
||||
if (empty($txt)) {
|
||||
return "";
|
||||
}
|
||||
run_hook('send_sms', [$phone, $txt]); #HOOK
|
||||
@ -68,7 +68,7 @@ class Message
|
||||
if ($_app_stage == 'demo') {
|
||||
return null;
|
||||
}
|
||||
if(!isset($client_m)){
|
||||
if (!isset($client_m)) {
|
||||
$mikrotik = ORM::for_table('tbl_routers')->where('name', $router_name)->find_one();
|
||||
$iport = explode(":", $mikrotik['ip_address']);
|
||||
$client_m = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
|
||||
@ -83,7 +83,7 @@ class Message
|
||||
public static function sendWhatsapp($phone, $txt)
|
||||
{
|
||||
global $config;
|
||||
if(empty($txt)){
|
||||
if (empty($txt)) {
|
||||
return "kosong";
|
||||
}
|
||||
run_hook('send_whatsapp', [$phone, $txt]); #HOOK
|
||||
@ -96,8 +96,11 @@ class Message
|
||||
|
||||
public static function sendEmail($to, $subject, $body)
|
||||
{
|
||||
global $config;
|
||||
if(empty($body)){
|
||||
global $config, $PAGES_PATH, $_app_stage;
|
||||
if (empty($body)) {
|
||||
return "";
|
||||
}
|
||||
if (empty($to)) {
|
||||
return "";
|
||||
}
|
||||
run_hook('send_email', [$to, $subject, $body]); #HOOK
|
||||
@ -113,7 +116,9 @@ class Message
|
||||
} else {
|
||||
$mail = new PHPMailer();
|
||||
$mail->isSMTP();
|
||||
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
|
||||
if ($_app_stage == 'Dev') {
|
||||
$mail->SMTPDebug = SMTP::DEBUG_SERVER;
|
||||
}
|
||||
$mail->Host = $config['smtp_host'];
|
||||
$mail->SMTPAuth = true;
|
||||
$mail->Username = $config['smtp_user'];
|
||||
@ -126,18 +131,38 @@ class Message
|
||||
if (!empty($config['mail_reply_to'])) {
|
||||
$mail->addReplyTo($config['mail_reply_to']);
|
||||
}
|
||||
$mail->isHTML(false);
|
||||
|
||||
$mail->addAddress($to);
|
||||
$mail->Subject = $subject;
|
||||
$mail->Body = $body;
|
||||
|
||||
if (!file_exists($PAGES_PATH . DIRECTORY_SEPARATOR . 'Email.html')) {
|
||||
if (!copy($PAGES_PATH . '_template' . DIRECTORY_SEPARATOR . 'Email.html', $PAGES_PATH . DIRECTORY_SEPARATOR . 'Email.html')) {
|
||||
file_put_contents($PAGES_PATH . DIRECTORY_SEPARATOR . 'Email.html', Http::getData('https://raw.githubusercontent.com/hotspotbilling/phpnuxbill/master/pages_template/Email.html'));
|
||||
}
|
||||
}
|
||||
|
||||
if (file_exists($PAGES_PATH . DIRECTORY_SEPARATOR . 'Email.html')) {
|
||||
$html = file_get_contents($PAGES_PATH . DIRECTORY_SEPARATOR . 'Email.html');
|
||||
$html = str_replace('[[Subject]]', $subject, $html);
|
||||
$html = str_replace('[[Company_Address]]', nl2br($config['address']), $html);
|
||||
$html = str_replace('[[Company_Name]]', nl2br($config['CompanyName']), $html);
|
||||
$html = str_replace('[[Body]]', nl2br($body), $html);
|
||||
$mail->isHTML(true);
|
||||
$mail->Body = $html;
|
||||
} else {
|
||||
$mail->isHTML(false);
|
||||
$mail->Body = $body;
|
||||
}
|
||||
$mail->send();
|
||||
|
||||
//<p style="font-family: Helvetica, sans-serif; font-size: 16px; font-weight: normal; margin: 0; margin-bottom: 16px;">
|
||||
}
|
||||
}
|
||||
|
||||
public static function sendPackageNotification($customer, $package, $price, $message, $via)
|
||||
{
|
||||
global $ds;
|
||||
if(empty($message)){
|
||||
global $ds, $config;
|
||||
if (empty($message)) {
|
||||
return "";
|
||||
}
|
||||
$msg = str_replace('[[name]]', $customer['fullname'], $message);
|
||||
@ -146,19 +171,19 @@ class Message
|
||||
$msg = str_replace('[[package]]', $package, $msg);
|
||||
$msg = str_replace('[[price]]', Lang::moneyFormat($price), $msg);
|
||||
list($bills, $add_cost) = User::getBills($customer['id']);
|
||||
if($add_cost>0){
|
||||
if ($add_cost > 0) {
|
||||
$note = "";
|
||||
foreach ($bills as $k => $v) {
|
||||
$note .= $k . " : " . Lang::moneyFormat($v) . "\n";
|
||||
}
|
||||
$note .= "Total : " . Lang::moneyFormat($add_cost+$price) . "\n";
|
||||
$note .= "Total : " . Lang::moneyFormat($add_cost + $price) . "\n";
|
||||
$msg = str_replace('[[bills]]', $note, $msg);
|
||||
}else{
|
||||
} else {
|
||||
$msg = str_replace('[[bills]]', '', $msg);
|
||||
}
|
||||
if ($ds) {
|
||||
$msg = str_replace('[[expired_date]]', Lang::dateAndTimeFormat($ds['expiration'], $ds['time']), $msg);
|
||||
}else{
|
||||
} else {
|
||||
$msg = str_replace('[[expired_date]]', "", $msg);
|
||||
}
|
||||
if (
|
||||
@ -167,6 +192,8 @@ class Message
|
||||
) {
|
||||
if ($via == 'sms') {
|
||||
echo Message::sendSMS($customer['phonenumber'], $msg);
|
||||
} else if ($via == 'email') {
|
||||
self::sendEmail($customer['email'], '[' . $config['CompanyName'] . '] ' . Lang::T("Internet Plan Reminder"), $msg);
|
||||
} else if ($via == 'wa') {
|
||||
echo Message::sendWhatsapp($customer['phonenumber'], $msg);
|
||||
}
|
||||
@ -174,17 +201,21 @@ class Message
|
||||
return "$via: $msg";
|
||||
}
|
||||
|
||||
public static function sendBalanceNotification($phone, $name, $balance, $balance_now, $message, $via)
|
||||
public static function sendBalanceNotification($cust, $balance, $balance_now, $message, $via)
|
||||
{
|
||||
$msg = str_replace('[[name]]', $name, $message);
|
||||
global $config;
|
||||
$msg = str_replace('[[name]]', $cust['fullname'] . ' (' . $cust['username'] . ')', $message);
|
||||
$msg = str_replace('[[current_balance]]', Lang::moneyFormat($balance_now), $msg);
|
||||
$msg = str_replace('[[balance]]', Lang::moneyFormat($balance), $msg);
|
||||
$phone = $cust['phonenumber'];
|
||||
if (
|
||||
!empty($phone) && strlen($phone) > 5
|
||||
&& !empty($message) && in_array($via, ['sms', 'wa'])
|
||||
&& !empty($message) && in_array($via, ['sms', 'wa', 'email'])
|
||||
) {
|
||||
if ($via == 'sms') {
|
||||
Message::sendSMS($phone, $msg);
|
||||
} else if ($config['user_notification_payment'] == 'email') {
|
||||
self::sendEmail($cust['email'], '[' . $config['CompanyName'] . '] ' . Lang::T("Balance Notification"), $msg);
|
||||
} else if ($via == 'wa') {
|
||||
Message::sendWhatsapp($phone, $msg);
|
||||
}
|
||||
@ -221,6 +252,8 @@ class Message
|
||||
|
||||
if ($config['user_notification_payment'] == 'sms') {
|
||||
Message::sendSMS($cust['phonenumber'], $textInvoice);
|
||||
} else if ($config['user_notification_payment'] == 'email') {
|
||||
self::sendEmail($cust['email'], '[' . $config['CompanyName'] . '] ' . Lang::T("Invoice") . ' #' . $trx['invoice'], $textInvoice);
|
||||
} else if ($config['user_notification_payment'] == 'wa') {
|
||||
Message::sendWhatsapp($cust['phonenumber'], $textInvoice);
|
||||
}
|
||||
|
@ -26,16 +26,30 @@ class Package
|
||||
$time_only = date("H:i:s");
|
||||
$time = date("H:i:s");
|
||||
$inv = "";
|
||||
$isVoucher = false;
|
||||
$c = [];
|
||||
|
||||
if ($id_customer == '' or $router_name == '' or $plan_id == '') {
|
||||
return false;
|
||||
}
|
||||
if(trim($gateway) == 'Voucher' && $id_customer == 0){
|
||||
$isVoucher = true;
|
||||
}
|
||||
|
||||
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
|
||||
$p = ORM::for_table('tbl_plans')->where('id', $plan_id)->find_one();
|
||||
|
||||
if ($c['status'] != 'Active') {
|
||||
_alert(Lang::T('This account status') . ' : ' . Lang::T($c['status']), 'danger', "");
|
||||
if(!$isVoucher){
|
||||
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
|
||||
if ($c['status'] != 'Active') {
|
||||
_alert(Lang::T('This account status') . ' : ' . Lang::T($c['status']), 'danger', "");
|
||||
}
|
||||
}else{
|
||||
$c = [
|
||||
'fullname' => $gateway,
|
||||
'email' => '',
|
||||
'username' => $channel,
|
||||
'password' => $channel,
|
||||
];
|
||||
}
|
||||
|
||||
$add_cost = 0;
|
||||
@ -136,7 +150,8 @@ class Package
|
||||
/**
|
||||
* 1 Customer only can have 1 PPPOE and 1 Hotspot Plan, 1 prepaid and 1 postpaid
|
||||
*/
|
||||
$b = ORM::for_table('tbl_user_recharges')
|
||||
|
||||
$query = ORM::for_table('tbl_user_recharges')
|
||||
->select('tbl_user_recharges.id', 'id')
|
||||
->select('customer_id')
|
||||
->select('username')
|
||||
@ -152,14 +167,18 @@ class Package
|
||||
->select('tbl_user_recharges.type', 'type')
|
||||
->select('admin_id')
|
||||
->select('prepaid')
|
||||
->where('customer_id', $id_customer)
|
||||
->where('tbl_user_recharges.routers', $router_name)
|
||||
->where('tbl_user_recharges.Type', $p['type'])
|
||||
# PPPOE or Hotspot only can have 1 per customer prepaid or postpaid
|
||||
# because 1 customer can have 1 PPPOE and 1 Hotspot Plan in mikrotik
|
||||
//->where('prepaid', $p['prepaid'])
|
||||
->left_outer_join('tbl_plans', array('tbl_plans.id', '=', 'tbl_user_recharges.plan_id'))
|
||||
->find_one();
|
||||
->left_outer_join('tbl_plans', array('tbl_plans.id', '=', 'tbl_user_recharges.plan_id'));
|
||||
if($isVoucher){
|
||||
$query->where('username', $c['username']);
|
||||
}else{
|
||||
$query->where('customer_id', $id_customer);
|
||||
}
|
||||
$b = $query->find_one();
|
||||
|
||||
run_hook("recharge_user");
|
||||
|
||||
|
1994
system/autoload/Parsedown.php
Normal file
1994
system/autoload/Parsedown.php
Normal file
File diff suppressed because it is too large
Load Diff
@ -56,6 +56,22 @@ class User
|
||||
return [$bills, $addcost];
|
||||
}
|
||||
|
||||
public static function getBillNames($id = 0)
|
||||
{
|
||||
if (!$id) {
|
||||
$id = User::getID();
|
||||
if (!$id) {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
$bills = [];
|
||||
$attrs = User::getAttributes('Bill', $id);
|
||||
foreach ($attrs as $k => $v) {
|
||||
$bills[] = str_replace(' Bill', '', $k);
|
||||
}
|
||||
return $bills;
|
||||
}
|
||||
|
||||
public static function billsPaid($bills, $id = 0)
|
||||
{
|
||||
if (!$id) {
|
||||
|
@ -45,10 +45,6 @@ switch ($action) {
|
||||
if ($_app_stage != 'demo') {
|
||||
if (file_exists($dvc)) {
|
||||
require_once $dvc;
|
||||
$exp = $p['plan_expired'];
|
||||
$p['plan_expired'] = 0;
|
||||
(new $p['device'])->remove_customer($user, $p);
|
||||
$p['plan_expired'] = $exp;
|
||||
(new $p['device'])->add_customer($user, $p);
|
||||
} else {
|
||||
new Exception(Lang::T("Devices Not Found"));
|
||||
|
@ -29,7 +29,7 @@ switch ($action) {
|
||||
if (!empty($_SESSION['nux-mac']) && !empty($_SESSION['nux-ip'])) {
|
||||
die('<a href="' . U . 'home&mikrotik=login&id=' . $bill['id'] . '" onclick="return confirm(\'' . Lang::T('Connect to Internet?') . '\')" class="btn btn-danger btn-xs btn-block">' . Lang::T('Not Online, Login now?') . '</a>');
|
||||
} else {
|
||||
die(Lang::T('Your account not connected to internet'));
|
||||
die(Lang::T('-'));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
|
@ -577,12 +577,7 @@ switch ($action) {
|
||||
if (file_exists($dvc)) {
|
||||
require_once $dvc;
|
||||
if ($userDiff) {
|
||||
$c['username'] = $oldusername;
|
||||
$exp = $p['plan_expired'];
|
||||
$p['plan_expired'] = 0;
|
||||
(new $p['device'])->remove_customer($c, $p);
|
||||
$c['username'] = $username;
|
||||
$p['plan_expired'] = $exp;
|
||||
(new $p['device'])->change_username($p, $oldusername, $username);
|
||||
}
|
||||
(new $p['device'])->add_customer($c, $p);
|
||||
} else {
|
||||
|
@ -9,7 +9,7 @@ _admin();
|
||||
$ui->assign('_title', Lang::T('Dashboard'));
|
||||
$ui->assign('_admin', $admin);
|
||||
|
||||
if(isset($_GET['refresh'])){
|
||||
if (isset($_GET['refresh'])) {
|
||||
$files = scandir($CACHE_PATH);
|
||||
foreach ($files as $file) {
|
||||
$ext = pathinfo($file, PATHINFO_EXTENSION);
|
||||
@ -21,20 +21,21 @@ if(isset($_GET['refresh'])){
|
||||
}
|
||||
|
||||
$reset_day = $config['reset_day'];
|
||||
if(empty($reset_day)){
|
||||
if (empty($reset_day)) {
|
||||
$reset_day = 1;
|
||||
}
|
||||
//first day of month
|
||||
if($reset_day >= date("d")){
|
||||
$first_day_month = date('Y-m-'.$reset_day);
|
||||
}else{
|
||||
$first_day_month = date('Y-m-'.$reset_day, strtotime("-1 MONTH"));
|
||||
if (date("d") >= $reset_day) {
|
||||
$start_date = date('Y-m-' . $reset_day);
|
||||
} else {
|
||||
$start_date = date('Y-m-' . $reset_day, strtotime("-1 MONTH"));
|
||||
}
|
||||
$mdate = date('Y-m-d');
|
||||
|
||||
$current_date = date('Y-m-d');
|
||||
$month_n = date('n');
|
||||
|
||||
$iday = ORM::for_table('tbl_transactions')
|
||||
->where('recharged_on', $mdate)
|
||||
->where('recharged_on', $current_date)
|
||||
->where_not_equal('method', 'Customer - Balance')
|
||||
->where_not_equal('method', 'Recharge Balance - Administrator')
|
||||
->sum('price');
|
||||
@ -44,7 +45,11 @@ if ($iday == '') {
|
||||
}
|
||||
$ui->assign('iday', $iday);
|
||||
|
||||
$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');
|
||||
$imonth = ORM::for_table('tbl_transactions')
|
||||
->where_not_equal('method', 'Customer - Balance')
|
||||
->where_not_equal('method', 'Recharge Balance - Administrator')
|
||||
->where_gte('recharged_on', $start_date)
|
||||
->where_lte('recharged_on', $current_date)->sum('price');
|
||||
if ($imonth == '') {
|
||||
$imonth = '0.00';
|
||||
}
|
||||
@ -72,13 +77,13 @@ $ui->assign('c_all', $c_all);
|
||||
if ($config['hide_uet'] != 'yes') {
|
||||
//user expire
|
||||
$query = ORM::for_table('tbl_user_recharges')
|
||||
->where_lte('expiration', $mdate)
|
||||
->where_lte('expiration', $current_date)
|
||||
->order_by_desc('expiration');
|
||||
$expire = Paginator::findMany($query);
|
||||
|
||||
// Get the total count of expired records for pagination
|
||||
$totalCount = ORM::for_table('tbl_user_recharges')
|
||||
->where_lte('expiration', $mdate)
|
||||
->where_lte('expiration', $current_date)
|
||||
->count();
|
||||
|
||||
// Pass the total count and current page to the paginator
|
||||
@ -200,7 +205,8 @@ if (file_exists($cacheMSfile) && time() - filemtime($cacheMSfile) < 43200) {
|
||||
}
|
||||
|
||||
// Assign the monthly sales data to Smarty
|
||||
$ui->assign('first_day_month',$first_day_month);
|
||||
$ui->assign('start_date', $start_date);
|
||||
$ui->assign('current_date', $current_date);
|
||||
$ui->assign('monthlySales', $monthlySales);
|
||||
$ui->assign('xfooter', '');
|
||||
$ui->assign('monthlyRegistered', $monthlyRegistered);
|
||||
|
@ -28,16 +28,56 @@ switch ($action) {
|
||||
|
||||
case 'print-by-date':
|
||||
$mdate = date('Y-m-d');
|
||||
$d = ORM::for_table('tbl_transactions');
|
||||
$d->where('recharged_on', $mdate);
|
||||
$d->order_by_desc('id');
|
||||
$x = $d->find_many();
|
||||
$types = ORM::for_table('tbl_transactions')->getEnum('type');
|
||||
$methods = array_column(ORM::for_table('tbl_transactions')->rawQuery("SELECT DISTINCT SUBSTRING_INDEX(`method`, ' - ', 1) as method FROM tbl_transactions;")->findArray(), 'method');
|
||||
$routers = array_column(ORM::for_table('tbl_transactions')->select('routers')->distinct('routers')->find_array(), 'routers');
|
||||
$plans = array_column(ORM::for_table('tbl_transactions')->select('plan_name')->distinct('plan_name')->find_array(), 'plan_name');
|
||||
$reset_day = $config['reset_day'];
|
||||
if (empty($reset_day)) {
|
||||
$reset_day = 1;
|
||||
}
|
||||
//first day of month
|
||||
if (date("d") >= $reset_day) {
|
||||
$start_date = date('Y-m-' . $reset_day);
|
||||
} else {
|
||||
$start_date = date('Y-m-' . $reset_day, strtotime("-1 MONTH"));
|
||||
}
|
||||
$tps = ($_GET['tps']) ? $_GET['tps'] : $types;
|
||||
$mts = ($_GET['mts']) ? $_GET['mts'] : $methods;
|
||||
$rts = ($_GET['rts']) ? $_GET['rts'] : $routers;
|
||||
$plns = ($_GET['plns']) ? $_GET['plns'] : $plans;
|
||||
$sd = _req('sd', $start_date);
|
||||
$ed = _req('ed', $mdate);
|
||||
$ts = _req('ts', '00:00:00');
|
||||
$te = _req('te', '23:59:59');
|
||||
|
||||
$dr = ORM::for_table('tbl_transactions');
|
||||
$dr->where('recharged_on', $mdate);
|
||||
$dr->order_by_desc('id');
|
||||
$xy = $dr->sum('price');
|
||||
$query = ORM::for_table('tbl_transactions')
|
||||
->whereRaw("UNIX_TIMESTAMP(CONCAT(`recharged_on`,' ',`recharged_time`)) >= " . strtotime("$sd $ts"))
|
||||
->whereRaw("UNIX_TIMESTAMP(CONCAT(`recharged_on`,' ',`recharged_time`)) <= " . strtotime("$ed $te"))
|
||||
->order_by_desc('id');
|
||||
if (count($tps) > 0) {
|
||||
$query->where_in('type', $tps);
|
||||
}
|
||||
if (count($mts) > 0) {
|
||||
if (count($mts) != count($methods)) {
|
||||
foreach ($mts as $mt) {
|
||||
$query->where_like('method', "$mt - %");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (count($rts) > 0) {
|
||||
$query->where_in('routers', $rts);
|
||||
}
|
||||
if (count($plns) > 0) {
|
||||
$query->where_in('plan_name', $plns);
|
||||
}
|
||||
$x = $query->find_array();
|
||||
$xy = $query->sum('price');
|
||||
|
||||
$ui->assign('sd', $sd);
|
||||
$ui->assign('ed', $ed);
|
||||
$ui->assign('ts', $ts);
|
||||
$ui->assign('te', $te);
|
||||
$ui->assign('d', $x);
|
||||
$ui->assign('dr', $xy);
|
||||
$ui->assign('mdate', $mdate);
|
||||
@ -48,16 +88,51 @@ switch ($action) {
|
||||
|
||||
case 'pdf-by-date':
|
||||
$mdate = date('Y-m-d');
|
||||
$types = ORM::for_table('tbl_transactions')->getEnum('type');
|
||||
$methods = array_column(ORM::for_table('tbl_transactions')->rawQuery("SELECT DISTINCT SUBSTRING_INDEX(`method`, ' - ', 1) as method FROM tbl_transactions;")->findArray(), 'method');
|
||||
$routers = array_column(ORM::for_table('tbl_transactions')->select('routers')->distinct('routers')->find_array(), 'routers');
|
||||
$plans = array_column(ORM::for_table('tbl_transactions')->select('plan_name')->distinct('plan_name')->find_array(), 'plan_name');
|
||||
$reset_day = $config['reset_day'];
|
||||
if (empty($reset_day)) {
|
||||
$reset_day = 1;
|
||||
}
|
||||
//first day of month
|
||||
if (date("d") >= $reset_day) {
|
||||
$start_date = date('Y-m-' . $reset_day);
|
||||
} else {
|
||||
$start_date = date('Y-m-' . $reset_day, strtotime("-1 MONTH"));
|
||||
}
|
||||
$tps = ($_GET['tps']) ? $_GET['tps'] : $types;
|
||||
$mts = ($_GET['mts']) ? $_GET['mts'] : $methods;
|
||||
$rts = ($_GET['rts']) ? $_GET['rts'] : $routers;
|
||||
$plns = ($_GET['plns']) ? $_GET['plns'] : $plans;
|
||||
$sd = _req('sd', $start_date);
|
||||
$ed = _req('ed', $mdate);
|
||||
$ts = _req('ts', '00:00:00');
|
||||
$te = _req('te', '23:59:59');
|
||||
|
||||
$d = ORM::for_table('tbl_transactions');
|
||||
$d->where('recharged_on', $mdate);
|
||||
$d->order_by_desc('id');
|
||||
$x = $d->find_many();
|
||||
|
||||
$dr = ORM::for_table('tbl_transactions');
|
||||
$dr->where('recharged_on', $mdate);
|
||||
$dr->order_by_desc('id');
|
||||
$xy = $dr->sum('price');
|
||||
$query = ORM::for_table('tbl_transactions')
|
||||
->whereRaw("UNIX_TIMESTAMP(CONCAT(`recharged_on`,' ',`recharged_time`)) >= " . strtotime("$sd $ts"))
|
||||
->whereRaw("UNIX_TIMESTAMP(CONCAT(`recharged_on`,' ',`recharged_time`)) <= " . strtotime("$ed $te"))
|
||||
->order_by_desc('id');
|
||||
if (count($tps) > 0) {
|
||||
$query->where_in('type', $tps);
|
||||
}
|
||||
if (count($mts) > 0) {
|
||||
if (count($mts) != count($methods)) {
|
||||
foreach ($mts as $mt) {
|
||||
$query->where_like('method', "$mt - %");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (count($rts) > 0) {
|
||||
$query->where_in('routers', $rts);
|
||||
}
|
||||
if (count($plns) > 0) {
|
||||
$query->where_in('plan_name', $plns);
|
||||
}
|
||||
$x = $query->find_array();
|
||||
$xy = $query->sum('price');
|
||||
|
||||
$title = ' Reports [' . $mdate . ']';
|
||||
$title = str_replace('-', ' ', $title);
|
||||
@ -79,7 +154,7 @@ switch ($action) {
|
||||
</div>
|
||||
<div id="logo"><img id="image" src="' . $logo . '" alt="logo" /></div>
|
||||
</div>
|
||||
<div id="header">' . Lang::T('All Transactions at Date') . ': ' . date($config['date_format'], strtotime($mdate)) . '</div>
|
||||
<div id="header">' . Lang::T('All Transactions at Date') . ': ' . Lang::dateAndTimeFormat($sd, $ts) .' - '. Lang::dateAndTimeFormat($ed, $te) . '</div>
|
||||
<table id="customers">
|
||||
<tr>
|
||||
<th>' . Lang::T('Username') . '</th>
|
||||
@ -98,8 +173,8 @@ switch ($action) {
|
||||
$plan_name = $value['plan_name'];
|
||||
$type = $value['type'];
|
||||
$price = $config['currency_code'] . ' ' . number_format($value['price'], 0, $config['dec_point'], $config['thousands_sep']);
|
||||
$recharged_on = date($config['date_format'], strtotime($value['recharged_on']));
|
||||
$expiration = date($config['date_format'], strtotime($value['expiration']));
|
||||
$recharged_on = Lang::dateAndTimeFormat($value['recharged_on'], $value['recharged_time']);
|
||||
$expiration = Lang::dateAndTimeFormat($value['expiration'], $value['time']);
|
||||
$time = $value['time'];
|
||||
$method = $value['method'];
|
||||
$routers = $value['routers'];
|
||||
@ -110,7 +185,7 @@ switch ($action) {
|
||||
<td>$type</td>
|
||||
<td align='right'>$price</td>
|
||||
<td>$recharged_on</td>
|
||||
<td>$expiration $time </td>
|
||||
<td>$expiration</td>
|
||||
<td>$method</td>
|
||||
<td>$routers</td>
|
||||
</tr>";
|
||||
@ -170,7 +245,7 @@ $style
|
||||
$html
|
||||
EOF;
|
||||
$mpdf->WriteHTML($nhtml);
|
||||
$mpdf->Output(date('Ymd_His') . '.pdf', 'D');
|
||||
$mpdf->Output('phpnuxbill_reports_'.date('Ymd_His') . '.pdf', 'D');
|
||||
} else {
|
||||
echo 'No Data';
|
||||
}
|
||||
|
@ -71,8 +71,8 @@ if (_post('send') == 'balance') {
|
||||
$d->pg_url_payment = 'balance';
|
||||
$d->status = 2;
|
||||
$d->save();
|
||||
Message::sendBalanceNotification($user['phonenumber'], $target['fullname'] . ' (' . $target['username'] . ')', $balance, ($user['balance'] - $balance), Lang::getNotifText('balance_send'), $config['user_notification_payment']);
|
||||
Message::sendBalanceNotification($target['phonenumber'], $user['fullname'] . ' (' . $user['username'] . ')', $balance, ($target['balance'] + $balance), Lang::getNotifText('balance_received'), $config['user_notification_payment']);
|
||||
Message::sendBalanceNotification($user, $balance, ($user['balance'] - $balance), Lang::getNotifText('balance_send'), $config['user_notification_payment']);
|
||||
Message::sendBalanceNotification($target, $balance, ($target['balance'] + $balance), Lang::getNotifText('balance_received'), $config['user_notification_payment']);
|
||||
Message::sendTelegram("#u$user[username] send balance to #u$target[username] \n" . Lang::moneyFormat($balance));
|
||||
r2(U . 'home', 's', Lang::T('Sending balance success'));
|
||||
}
|
||||
@ -210,7 +210,7 @@ if (isset($_GET['recharge']) && !empty($_GET['recharge'])) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_SESSION['nux-mac']) && !empty($_SESSION['nux-ip'])) {
|
||||
if (!empty($_SESSION['nux-mac']) && !empty($_SESSION['nux-ip'] && $_c['hs_auth_method'] != 'hchap')) {
|
||||
$ui->assign('nux_mac', $_SESSION['nux-mac']);
|
||||
$ui->assign('nux_ip', $_SESSION['nux-ip']);
|
||||
$bill = ORM::for_table('tbl_user_recharges')->where('id', $_GET['id'])->where('username', $user['username'])->findOne();
|
||||
@ -232,10 +232,68 @@ if (!empty($_SESSION['nux-mac']) && !empty($_SESSION['nux-ip'])) {
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_SESSION['nux-mac']) && !empty($_SESSION['nux-ip'] && !empty($_SESSION['nux-hostname']) && $_c['hs_auth_method'] == 'hchap')) {
|
||||
$apkurl = (((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'onoff')|| $_SERVER['SERVER_PORT'] == 443)?'https':'http').'://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||
$ui->assign('nux_mac', $_SESSION['nux-mac']);
|
||||
$ui->assign('nux_ip', $_SESSION['nux-ip']);
|
||||
$keys = explode('-', $_SESSION['nux-key']);
|
||||
$ui->assign('hostname', $_SESSION['nux-hostname']);
|
||||
$ui->assign('apkurl', $apkurl);
|
||||
$ui->assign('key1', $keys[0]);
|
||||
$ui->assign('key2', $keys[1]);
|
||||
$ui->assign('hchap', $_GET['hchap']);
|
||||
$ui->assign('logged', $_GET['logged']);
|
||||
if ($_app_stage != 'demo') {
|
||||
if ($_GET['mikrotik'] == 'login') {
|
||||
r2(U . 'home&hchap=true', 's', Lang::T('Login Request successfully'));
|
||||
}
|
||||
$getmsg = $_GET['msg'];
|
||||
///get auth notification from mikrotik
|
||||
if($getmsg == 'Connected') {
|
||||
$msg .= Lang::T($getmsg);
|
||||
r2(U . 'home&logged=1', 's', $msg);
|
||||
} else if($getmsg){
|
||||
$msg .= Lang::T($getmsg);
|
||||
r2(U . 'home', 's', $msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($_SESSION['nux-mac']) && !empty($_SESSION['nux-ip'] && !empty($_SESSION['nux-hostname']) && $_c['hs_auth_method'] == 'hchap')) {
|
||||
$apkurl = (((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'onoff')|| $_SERVER['SERVER_PORT'] == 443)?'https':'http').'://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
|
||||
$ui->assign('nux_mac', $_SESSION['nux-mac']);
|
||||
$ui->assign('nux_ip', $_SESSION['nux-ip']);
|
||||
$keys = explode('-', $_SESSION['nux-key']);
|
||||
$ui->assign('hostname', $_SESSION['nux-hostname']);
|
||||
$ui->assign('apkurl', $apkurl);
|
||||
$ui->assign('key1', $keys[0]);
|
||||
$ui->assign('key2', $keys[1]);
|
||||
$ui->assign('hchap', $_GET['hchap']);
|
||||
$ui->assign('logged', $_GET['logged']);
|
||||
if ($_app_stage != 'demo') {
|
||||
if ($_GET['mikrotik'] == 'login') {
|
||||
r2(U . 'home&hchap=true', 's', Lang::T('Login Request successfully'));
|
||||
}
|
||||
$getmsg = $_GET['msg'];
|
||||
///get auth notification from mikrotik
|
||||
if($getmsg == 'Connected') {
|
||||
$msg .= Lang::T($getmsg);
|
||||
r2(U . 'home&logged=1', 's', $msg);
|
||||
} else if($getmsg){
|
||||
$msg .= Lang::T($getmsg);
|
||||
r2(U . 'home', 's', $msg);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$ui->assign('unpaid', ORM::for_table('tbl_payment_gateway')
|
||||
->where('username', $user['username'])
|
||||
->where('status', 1)
|
||||
->find_one());
|
||||
$ui->assign('code', alphanumeric(_get('code'), "-"));
|
||||
|
||||
$abills = User::getAttributes("Bill");
|
||||
$ui->assign('abills', $abills);
|
||||
|
||||
run_hook('view_customer_dashboard'); #HOOK
|
||||
$ui->display('user-dashboard.tpl');
|
||||
|
@ -56,134 +56,236 @@ switch ($do) {
|
||||
break;
|
||||
|
||||
case 'activation':
|
||||
$voucher = _post('voucher');
|
||||
$username = _post('username');
|
||||
$v1 = ORM::for_table('tbl_voucher')->where('code', $voucher)->find_one();
|
||||
if ($v1) {
|
||||
// voucher exists, check customer exists or not
|
||||
$user = ORM::for_table('tbl_customers')->where('username', $username)->find_one();
|
||||
if (!$user) {
|
||||
$d = ORM::for_table('tbl_customers')->create();
|
||||
$d->username = alphanumeric($username, "+_.@-");
|
||||
$d->password = $voucher;
|
||||
$d->fullname = '';
|
||||
$d->address = '';
|
||||
$d->email = '';
|
||||
$d->phonenumber = (strlen($username) < 21) ? $username : '';
|
||||
if ($d->save()) {
|
||||
$user = ORM::for_table('tbl_customers')->where('username', $username)->find_one($d->id());
|
||||
if (!$user) {
|
||||
r2(U . 'login', 'e', Lang::T('Voucher activation failed'));
|
||||
}
|
||||
} else {
|
||||
_alert(Lang::T('Login Successful'), 'success', "dashboard");
|
||||
r2(U . 'login', 'e', Lang::T('Voucher activation failed') . '.');
|
||||
if (!empty(_post('voucher_only'))) {
|
||||
$voucher = _post('voucher_only');
|
||||
$tur = ORM::for_table('tbl_user_recharges')
|
||||
->where('username', $voucher)
|
||||
->where('customer_id', '0') // Voucher Only will make customer ID as 0
|
||||
->find_one();
|
||||
if ($tur) {
|
||||
if ($tur['status'] == 'off') {
|
||||
_alert(Lang::T('Internet Voucher Expired'), 'danger', "login");
|
||||
}
|
||||
}
|
||||
if ($v1['status'] == 0) {
|
||||
$oldPass = $user['password'];
|
||||
// change customer password to voucher code
|
||||
$user->password = $voucher;
|
||||
$user->save();
|
||||
// voucher activation
|
||||
if (Package::rechargeUser($user['id'], $v1['routers'], $v1['id_plan'], "Voucher", $voucher)) {
|
||||
$v1->status = "1";
|
||||
$v1->user = $user['username'];
|
||||
$v1->save();
|
||||
$user->last_login = date('Y-m-d H:i:s');
|
||||
$user->save();
|
||||
// add customer to mikrotik
|
||||
if (!empty($_SESSION['nux-mac']) && !empty($_SESSION['nux-ip'])) {
|
||||
try {
|
||||
$p = ORM::for_table('tbl_plans')->where('id', $v1['id_plan'])->find_one();
|
||||
$dvc = Package::getDevice($p);
|
||||
if ($_app_stage != 'demo') {
|
||||
if (file_exists($dvc)) {
|
||||
require_once $dvc;
|
||||
(new $p['device'])->connect_customer($user, $_SESSION['nux-ip'], $_SESSION['nux-mac'], $v1['routers']);
|
||||
if (!empty($config['voucher_redirect'])) {
|
||||
r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, now you can login"));
|
||||
} else {
|
||||
r2(U . "login", 's', Lang::T("Voucher activation success, now you can login"));
|
||||
}
|
||||
} else {
|
||||
new Exception(Lang::T("Devices Not Found"));
|
||||
}
|
||||
}
|
||||
if (!empty($config['voucher_redirect'])) {
|
||||
r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, you are connected to internet"));
|
||||
$p = ORM::for_table('tbl_plans')->where('id', $tur['plan_id'])->find_one();
|
||||
if ($p) {
|
||||
$dvc = Package::getDevice($p);
|
||||
if ($_app_stage != 'demo') {
|
||||
if (file_exists($dvc)) {
|
||||
if (file_exists($dvc)) {
|
||||
require_once $dvc;
|
||||
$c = [
|
||||
'fullname' => "Voucher",
|
||||
'email' => '',
|
||||
'username' => $voucher,
|
||||
'password' => $voucher,
|
||||
];
|
||||
(new $p['device'])->add_customer($c, $p);
|
||||
} else {
|
||||
r2(U . "login", 's', Lang::T("Voucher activation success, you are connected to internet"));
|
||||
new Exception(Lang::T("Devices Not Found"));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
if (!empty($config['voucher_redirect'])) {
|
||||
r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, now you can login"));
|
||||
} else {
|
||||
r2(U . "login", 's', Lang::T("Voucher activation success, now you can login"));
|
||||
}
|
||||
} else {
|
||||
new Exception(Lang::T("Devices Not Found"));
|
||||
}
|
||||
}
|
||||
if (!empty($config['voucher_redirect'])) {
|
||||
r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, now you can login"));
|
||||
_alert(Lang::T("Voucher activation success, now you can login"), 'danger', $config['voucher_redirect']);
|
||||
} else {
|
||||
r2(U . "login", 's', Lang::T("Voucher activation success, now you can login"));
|
||||
r2(U . "login", 's', Lang::T("Voucher activation success, you are connected to internet"));
|
||||
}
|
||||
} else {
|
||||
// if failed to recharge, restore old password
|
||||
$user->password = $oldPass;
|
||||
$user->save();
|
||||
r2(U . 'login', 'e', Lang::T("Failed to activate voucher"));
|
||||
_alert(Lang::T('Internet Plan Expired'), 'danger', "login");
|
||||
}
|
||||
} else {
|
||||
// used voucher
|
||||
// check if voucher used by this username
|
||||
if ($v1['user'] == $user['username']) {
|
||||
$user->last_login = date('Y-m-d H:i:s');
|
||||
$user->save();
|
||||
if (!empty($_SESSION['nux-mac']) && !empty($_SESSION['nux-ip'])) {
|
||||
try {
|
||||
$p = ORM::for_table('tbl_plans')->where('id', $v1['id_plan'])->find_one();
|
||||
$dvc = Package::getDevice($p);
|
||||
if ($_app_stage != 'demo') {
|
||||
if (file_exists($dvc)) {
|
||||
require_once $dvc;
|
||||
(new $p['device'])->connect_customer($user, $_SESSION['nux-ip'], $_SESSION['nux-mac'], $v1['routers']);
|
||||
if (!empty($config['voucher_redirect'])) {
|
||||
r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, now you can login"));
|
||||
$v = ORM::for_table('tbl_voucher')->where('code', $voucher)->find_one();
|
||||
if (!$v) {
|
||||
_alert(Lang::T('Voucher invalid'), 'danger', "login");
|
||||
}
|
||||
if ($v['status'] == 0) {
|
||||
if (Package::rechargeUser(0, $v['routers'], $v['id_plan'], "Voucher", $voucher)) {
|
||||
$v->status = "1";
|
||||
$v->save();
|
||||
$tur = ORM::for_table('tbl_user_recharges')->where('username', $voucher)->find_one();
|
||||
if ($tur) {
|
||||
$p = ORM::for_table('tbl_plans')->where('id', $tur['plan_id'])->find_one();
|
||||
if ($p) {
|
||||
$dvc = Package::getDevice($p);
|
||||
if ($_app_stage != 'demo') {
|
||||
if (file_exists($dvc)) {
|
||||
if (file_exists($dvc)) {
|
||||
require_once $dvc;
|
||||
$c = [
|
||||
'fullname' => "Voucher",
|
||||
'email' => '',
|
||||
'username' => $voucher,
|
||||
'password' => $voucher,
|
||||
];
|
||||
(new $p['device'])->add_customer($c, $p);
|
||||
} else {
|
||||
new Exception(Lang::T("Devices Not Found"));
|
||||
}
|
||||
if (!empty($config['voucher_redirect'])) {
|
||||
r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, now you can login"));
|
||||
} else {
|
||||
r2(U . "login", 's', Lang::T("Voucher activation success, now you can login"));
|
||||
}
|
||||
} else {
|
||||
r2(U . "login", 's', Lang::T("Voucher activation success, now you can login"));
|
||||
new Exception(Lang::T("Devices Not Found"));
|
||||
}
|
||||
}
|
||||
if (!empty($config['voucher_redirect'])) {
|
||||
_alert(Lang::T("Voucher activation success, now you can login"), 'danger', $config['voucher_redirect']);
|
||||
} else {
|
||||
new Exception(Lang::T("Devices Not Found"));
|
||||
r2(U . "login", 's', Lang::T("Voucher activation success, you are connected to internet"));
|
||||
}
|
||||
} else {
|
||||
_alert(Lang::T('Internet Plan Expired'), 'danger', "login");
|
||||
}
|
||||
} else {
|
||||
_alert(Lang::T('Voucher activation failed'), 'danger', "login");
|
||||
}
|
||||
} else {
|
||||
_alert(Lang::T('Voucher activation failed'), 'danger', "login");
|
||||
}
|
||||
} else {
|
||||
_alert(Lang::T('Internet Voucher Expired'), 'danger', "login");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$voucher = _post('voucher');
|
||||
$username = _post('username');
|
||||
$v1 = ORM::for_table('tbl_voucher')->where('code', $voucher)->find_one();
|
||||
if ($v1) {
|
||||
// voucher exists, check customer exists or not
|
||||
$user = ORM::for_table('tbl_customers')->where('username', $username)->find_one();
|
||||
if (!$user) {
|
||||
$d = ORM::for_table('tbl_customers')->create();
|
||||
$d->username = alphanumeric($username, "+_.@-");
|
||||
$d->password = $voucher;
|
||||
$d->fullname = '';
|
||||
$d->address = '';
|
||||
$d->email = '';
|
||||
$d->phonenumber = (strlen($username) < 21) ? $username : '';
|
||||
if ($d->save()) {
|
||||
$user = ORM::for_table('tbl_customers')->where('username', $username)->find_one($d->id());
|
||||
if (!$user) {
|
||||
r2(U . 'login', 'e', Lang::T('Voucher activation failed'));
|
||||
}
|
||||
} else {
|
||||
_alert(Lang::T('Login Successful'), 'success', "dashboard");
|
||||
r2(U . 'login', 'e', Lang::T('Voucher activation failed') . '.');
|
||||
}
|
||||
}
|
||||
if ($v1['status'] == 0) {
|
||||
$oldPass = $user['password'];
|
||||
// change customer password to voucher code
|
||||
$user->password = $voucher;
|
||||
$user->save();
|
||||
// voucher activation
|
||||
if (Package::rechargeUser($user['id'], $v1['routers'], $v1['id_plan'], "Voucher", $voucher)) {
|
||||
$v1->status = "1";
|
||||
$v1->used_date = date('Y-m-d H:i:s');
|
||||
$v1->user = $user['username'];
|
||||
$v1->save();
|
||||
$user->last_login = date('Y-m-d H:i:s');
|
||||
$user->save();
|
||||
// add customer to mikrotik
|
||||
if (!empty($_SESSION['nux-mac']) && !empty($_SESSION['nux-ip'])) {
|
||||
try {
|
||||
$p = ORM::for_table('tbl_plans')->where('id', $v1['id_plan'])->find_one();
|
||||
$dvc = Package::getDevice($p);
|
||||
if ($_app_stage != 'demo') {
|
||||
if (file_exists($dvc)) {
|
||||
require_once $dvc;
|
||||
(new $p['device'])->connect_customer($user, $_SESSION['nux-ip'], $_SESSION['nux-mac'], $v1['routers']);
|
||||
if (!empty($config['voucher_redirect'])) {
|
||||
r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, now you can login"));
|
||||
} else {
|
||||
r2(U . "login", 's', Lang::T("Voucher activation success, now you can login"));
|
||||
}
|
||||
} else {
|
||||
new Exception(Lang::T("Devices Not Found"));
|
||||
}
|
||||
}
|
||||
if (!empty($config['voucher_redirect'])) {
|
||||
r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, you are connected to internet"));
|
||||
} else {
|
||||
r2(U . "login", 's', Lang::T("Voucher activation success, you are connected to internet"));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
if (!empty($config['voucher_redirect'])) {
|
||||
r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, now you can login"));
|
||||
} else {
|
||||
r2(U . "login", 's', Lang::T("Voucher activation success, now you can login"));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!empty($config['voucher_redirect'])) {
|
||||
r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, now you can login"));
|
||||
} else {
|
||||
r2(U . "login", 's', Lang::T("Voucher activation success, now you can login"));
|
||||
}
|
||||
} else {
|
||||
// if failed to recharge, restore old password
|
||||
$user->password = $oldPass;
|
||||
$user->save();
|
||||
r2(U . 'login', 'e', Lang::T("Failed to activate voucher"));
|
||||
}
|
||||
} else {
|
||||
// used voucher
|
||||
// check if voucher used by this username
|
||||
if ($v1['user'] == $user['username']) {
|
||||
$user->last_login = date('Y-m-d H:i:s');
|
||||
$user->save();
|
||||
if (!empty($_SESSION['nux-mac']) && !empty($_SESSION['nux-ip'])) {
|
||||
try {
|
||||
$p = ORM::for_table('tbl_plans')->where('id', $v1['id_plan'])->find_one();
|
||||
$dvc = Package::getDevice($p);
|
||||
if ($_app_stage != 'demo') {
|
||||
if (file_exists($dvc)) {
|
||||
require_once $dvc;
|
||||
(new $p['device'])->connect_customer($user, $_SESSION['nux-ip'], $_SESSION['nux-mac'], $v1['routers']);
|
||||
if (!empty($config['voucher_redirect'])) {
|
||||
r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, now you can login"));
|
||||
} else {
|
||||
r2(U . "login", 's', Lang::T("Voucher activation success, now you can login"));
|
||||
}
|
||||
} else {
|
||||
new Exception(Lang::T("Devices Not Found"));
|
||||
}
|
||||
}
|
||||
if (!empty($config['voucher_redirect'])) {
|
||||
r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, you are connected to internet"));
|
||||
} else {
|
||||
r2(U . "login", 's', Lang::T("Voucher activation success, now you can login"));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
if (!empty($config['voucher_redirect'])) {
|
||||
r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, now you can login"));
|
||||
} else {
|
||||
r2(U . "login", 's', Lang::T("Voucher activation success, now you can login"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!empty($config['voucher_redirect'])) {
|
||||
r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, you are connected to internet"));
|
||||
} else {
|
||||
r2(U . "login", 's', Lang::T("Voucher activation success, now you can login"));
|
||||
}
|
||||
} catch (Exception $e) {
|
||||
if (!empty($config['voucher_redirect'])) {
|
||||
r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, now you can login"));
|
||||
} else {
|
||||
r2(U . "login", 's', Lang::T("Voucher activation success, now you can login"));
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (!empty($config['voucher_redirect'])) {
|
||||
r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, you are connected to internet"));
|
||||
} else {
|
||||
r2(U . "login", 's', Lang::T("Voucher activation success, now you can login"));
|
||||
}
|
||||
// voucher used by other customer
|
||||
r2(U . 'login', 'e', Lang::T('Voucher Not Valid'));
|
||||
}
|
||||
} else {
|
||||
// voucher used by other customer
|
||||
r2(U . 'login', 'e', Lang::T('Voucher Not Valid'));
|
||||
}
|
||||
} else {
|
||||
_msglog('e', Lang::T('Invalid Username or Password'));
|
||||
r2(U . 'login');
|
||||
}
|
||||
} else {
|
||||
_msglog('e', Lang::T('Invalid Username or Password'));
|
||||
r2(U . 'login');
|
||||
}
|
||||
default:
|
||||
run_hook('customer_view_login'); #HOOK
|
||||
|
@ -322,6 +322,7 @@ switch ($action) {
|
||||
$d->status = 'on';
|
||||
}
|
||||
}
|
||||
// plan different then do something
|
||||
if ($oldPlanID != $id_plan) {
|
||||
$d->plan_id = $newPlan['id'];
|
||||
$d->namebp = $newPlan['name_plan'];
|
||||
@ -479,7 +480,10 @@ switch ($action) {
|
||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
|
||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||
}
|
||||
$d = ORM::for_table('tbl_voucher')->where_equal('status', '1')->findMany();
|
||||
$time3months = strtotime('-3 months');
|
||||
$d = ORM::for_table('tbl_voucher')->where_equal('status', '1')
|
||||
->where_raw("UNIX_TIMESTAMP(used_date) < $time3months")
|
||||
->findMany();
|
||||
if ($d) {
|
||||
$jml = 0;
|
||||
foreach ($d as $v) {
|
||||
@ -835,21 +839,33 @@ switch ($action) {
|
||||
//expired
|
||||
$expiration = date('Y-m-d', strtotime(" +$days day"));
|
||||
}
|
||||
$tur->expiration = $expiration;
|
||||
$tur->status = "on";
|
||||
$tur->save();
|
||||
App::setToken($stoken, $id);
|
||||
$c = ORM::for_table('tbl_customers')->findOne($tur['customer_id']);
|
||||
$p = ORM::for_table('tbl_plans')->find_one($d['plan_id']);
|
||||
$dvc = Package::getDevice($p);
|
||||
if ($_app_stage != 'demo') {
|
||||
if (file_exists($dvc)) {
|
||||
require_once $dvc;
|
||||
(new $p['device'])->add_customer($c, $p);
|
||||
if ($c) {
|
||||
$p = ORM::for_table('tbl_plans')->find_one($tur['plan_id']);
|
||||
if ($p) {
|
||||
$dvc = Package::getDevice($p);
|
||||
if ($_app_stage != 'demo') {
|
||||
if (file_exists($dvc)) {
|
||||
require_once $dvc;
|
||||
(new $p['device'])->add_customer($c, $p);
|
||||
} else {
|
||||
new Exception(Lang::T("Devices Not Found"));
|
||||
}
|
||||
}
|
||||
$tur->expiration = $expiration;
|
||||
$tur->status = "on";
|
||||
$tur->save();
|
||||
} else {
|
||||
new Exception(Lang::T("Devices Not Found"));
|
||||
r2(U . 'plan', 's', "Plan not found");
|
||||
}
|
||||
} else {
|
||||
r2(U . 'plan', 's', "Customer not found");
|
||||
}
|
||||
Message::sendTelegram("#u$tur[username] #extend #" . $p['type'] . " \n" . $p['name_plan'] .
|
||||
"\nLocation: " . $p['routers'] .
|
||||
"\nCustomer: " . $c['fullname'] .
|
||||
"\nNew Expired: " . Lang::dateAndTimeFormat($expiration, $tur['time']));
|
||||
_log("$admin[fullname] extend Customer $tur[customer_id] $tur[username] for $days days", $admin['user_type'], $admin['id']);
|
||||
r2(U . 'plan', 's', "Extend until $expiration");
|
||||
} else {
|
||||
|
@ -41,18 +41,6 @@ switch ($action) {
|
||||
$ui->assign('q', $q);
|
||||
$ui->display('reports-activation.tpl');
|
||||
break;
|
||||
case 'daily-report':
|
||||
$query = ORM::for_table('tbl_transactions')->where('recharged_on', $mdate)->order_by_desc('id');
|
||||
$d = Paginator::findMany($query);
|
||||
$dr = $query->sum('price');
|
||||
|
||||
$ui->assign('d', $d);
|
||||
$ui->assign('dr', $dr);
|
||||
$ui->assign('mdate', $mdate);
|
||||
$ui->assign('mtime', $mtime);
|
||||
run_hook('view_daily_reports'); #HOOK
|
||||
$ui->display('reports-daily.tpl');
|
||||
break;
|
||||
|
||||
case 'by-period':
|
||||
$ui->assign('mdate', $mdate);
|
||||
@ -95,6 +83,77 @@ switch ($action) {
|
||||
$ui->display('reports-period-view.tpl');
|
||||
break;
|
||||
|
||||
case 'daily-report':
|
||||
default:
|
||||
$ui->display('a404.tpl');
|
||||
$types = ORM::for_table('tbl_transactions')->getEnum('type');
|
||||
$methods = array_column(ORM::for_table('tbl_transactions')->rawQuery("SELECT DISTINCT SUBSTRING_INDEX(`method`, ' - ', 1) as method FROM tbl_transactions;")->findArray(), 'method');
|
||||
$routers = array_column(ORM::for_table('tbl_transactions')->select('routers')->distinct('routers')->find_array(), 'routers');
|
||||
$plans = array_column(ORM::for_table('tbl_transactions')->select('plan_name')->distinct('plan_name')->find_array(), 'plan_name');
|
||||
$reset_day = $config['reset_day'];
|
||||
if (empty($reset_day)) {
|
||||
$reset_day = 1;
|
||||
}
|
||||
//first day of month
|
||||
if (date("d") >= $reset_day) {
|
||||
$start_date = date('Y-m-' . $reset_day);
|
||||
} else {
|
||||
$start_date = date('Y-m-' . $reset_day, strtotime("-1 MONTH"));
|
||||
}
|
||||
$tps = ($_GET['tps']) ? $_GET['tps'] : $types;
|
||||
$mts = ($_GET['mts']) ? $_GET['mts'] : $methods;
|
||||
$rts = ($_GET['rts']) ? $_GET['rts'] : $routers;
|
||||
$plns = ($_GET['plns']) ? $_GET['plns'] : $plans;
|
||||
$sd = _req('sd', $start_date);
|
||||
$ed = _req('ed', $mdate);
|
||||
$ts = _req('ts', '00:00:00');
|
||||
$te = _req('te', '23:59:59');
|
||||
$urlquery = str_replace('_route=reports&', '', $_SERVER['QUERY_STRING']);
|
||||
|
||||
|
||||
$query = ORM::for_table('tbl_transactions')
|
||||
->whereRaw("UNIX_TIMESTAMP(CONCAT(`recharged_on`,' ',`recharged_time`)) >= " . strtotime("$sd $ts"))
|
||||
->whereRaw("UNIX_TIMESTAMP(CONCAT(`recharged_on`,' ',`recharged_time`)) <= " . strtotime("$ed $te"))
|
||||
->order_by_desc('id');
|
||||
if (count($tps) > 0) {
|
||||
$query->where_in('type', $tps);
|
||||
}
|
||||
if (count($mts) > 0) {
|
||||
if (count($mts) != count($methods)) {
|
||||
foreach ($mts as $mt) {
|
||||
$query->where_like('method', "$mt - %");
|
||||
}
|
||||
}
|
||||
}
|
||||
if (count($rts) > 0) {
|
||||
$query->where_in('routers', $rts);
|
||||
}
|
||||
if (count($plns) > 0) {
|
||||
$query->where_in('plan_name', $plns);
|
||||
}
|
||||
$d = Paginator::findMany($query, [], 100, $urlquery);
|
||||
$dr = $query->sum('price');
|
||||
|
||||
$ui->assign('methods', $methods);
|
||||
$ui->assign('types', $types);
|
||||
$ui->assign('routers', $routers);
|
||||
$ui->assign('plans', $plans);
|
||||
$ui->assign('filter', $urlquery);
|
||||
|
||||
// time
|
||||
$ui->assign('sd', $sd);
|
||||
$ui->assign('ed', $ed);
|
||||
$ui->assign('ts', $ts);
|
||||
$ui->assign('te', $te);
|
||||
|
||||
$ui->assign('mts', $mts);
|
||||
$ui->assign('tps', $tps);
|
||||
$ui->assign('rts', $rts);
|
||||
$ui->assign('plns', $plns);
|
||||
|
||||
$ui->assign('d', $d);
|
||||
$ui->assign('dr', $dr);
|
||||
$ui->assign('mdate', $mdate);
|
||||
run_hook('view_daily_reports'); #HOOK
|
||||
$ui->display('reports-daily.tpl');
|
||||
break;
|
||||
}
|
||||
|
@ -12,6 +12,19 @@ $action = $routes['1'];
|
||||
$ui->assign('_admin', $admin);
|
||||
|
||||
switch ($action) {
|
||||
case 'docs':
|
||||
$d = ORM::for_table('tbl_appconfig')->where('setting', 'docs_clicked')->find_one();
|
||||
if ($d) {
|
||||
$d->value = 'yes';
|
||||
$d->save();
|
||||
} else {
|
||||
$d = ORM::for_table('tbl_appconfig')->create();
|
||||
$d->setting = 'docs_clicked';
|
||||
$d->value = 'yes';
|
||||
$d->save();
|
||||
}
|
||||
r2('./docs');
|
||||
break;
|
||||
case 'devices':
|
||||
$files = scandir($DEVICE_PATH);
|
||||
$devices = [];
|
||||
@ -111,9 +124,12 @@ switch ($action) {
|
||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||
}
|
||||
$company = _post('CompanyName');
|
||||
$custom_tax_rate = filter_var(_post('custom_tax_rate'), FILTER_SANITIZE_SPECIAL_CHARS);
|
||||
if (preg_match('/[^0-9.]/', $custom_tax_rate)) {
|
||||
r2(U . 'settings/app', 'e', 'Special characters are not allowed in tax rate');
|
||||
die();
|
||||
}
|
||||
run_hook('save_settings'); #HOOK
|
||||
|
||||
|
||||
if (!empty($_FILES['logo']['name'])) {
|
||||
if (function_exists('imagecreatetruecolor')) {
|
||||
if (file_exists($UPLOAD_PATH . DIRECTORY_SEPARATOR . 'logo.png')) unlink($UPLOAD_PATH . DIRECTORY_SEPARATOR . 'logo.png');
|
||||
|
@ -28,6 +28,7 @@ switch ($action) {
|
||||
if ($v1) {
|
||||
if (Package::rechargeUser($user['id'], $v1['routers'], $v1['id_plan'], "Voucher", $code)) {
|
||||
$v1->status = "1";
|
||||
$v1->used_date = date('Y-m-d H:i:s');
|
||||
$v1->user = $user['username'];
|
||||
$v1->save();
|
||||
r2(U . "voucher/list-activated", 's', Lang::T('Activation Vouchers Successfully'));
|
||||
|
@ -15,7 +15,7 @@ if (php_sapi_name() !== 'cli') {
|
||||
echo "<pre>";
|
||||
}
|
||||
|
||||
$d = ORM::for_table('tbl_user_recharges')->where('status', 'on')->find_many();
|
||||
$d = ORM::for_table('tbl_user_recharges')->where('status', 'on')->whereNotEqual('customer_id', '0')->find_many();
|
||||
|
||||
run_hook('cronjob_reminder'); #HOOK
|
||||
|
||||
|
@ -11,7 +11,7 @@ class Dummy {
|
||||
'author' => 'ibnu maksum',
|
||||
'url' => [
|
||||
'Github' => 'https://github.com/hotspotbilling/phpnuxbill/',
|
||||
'Telegram' => 'https://t.me/ibnux',
|
||||
'Telegram' => 'https://t.me/phpnuxbill',
|
||||
'Donate' => 'https://paypal.me/ibnux'
|
||||
]
|
||||
];
|
||||
@ -27,6 +27,12 @@ class Dummy {
|
||||
{
|
||||
}
|
||||
|
||||
// customer change username
|
||||
public function change_username($from, $to)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
// Add Plan to Mikrotik/Device
|
||||
function add_plan($plan)
|
||||
{
|
||||
|
@ -22,7 +22,7 @@ class MikrotikHotspot
|
||||
'author' => 'ibnux',
|
||||
'url' => [
|
||||
'Github' => 'https://github.com/hotspotbilling/phpnuxbill/',
|
||||
'Telegram' => 'https://t.me/ibnux',
|
||||
'Telegram' => 'https://t.me/phpnuxbill',
|
||||
'Donate' => 'https://paypal.me/ibnux'
|
||||
]
|
||||
];
|
||||
@ -51,6 +51,27 @@ class MikrotikHotspot
|
||||
$this->removeHotspotActiveUser($client, $customer['username']);
|
||||
}
|
||||
|
||||
// customer change username
|
||||
public function change_username($plan, $from, $to)
|
||||
{
|
||||
$mikrotik = $this->info($plan['routers']);
|
||||
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||
//check if customer exists
|
||||
$printRequest = new RouterOS\Request('/ip/hotspot/user/print');
|
||||
$printRequest->setArgument('.proplist', '.id');
|
||||
$printRequest->setQuery(RouterOS\Query::where('name', $from));
|
||||
$id = $client->sendSync($printRequest)->getProperty('.id');
|
||||
|
||||
if (!empty($cid)) {
|
||||
$setRequest = new RouterOS\Request('/ip/hotspot/user/set');
|
||||
$setRequest->setArgument('numbers', $id);
|
||||
$setRequest->setArgument('name', $to);
|
||||
$client->sendSync($setRequest);
|
||||
//disconnect then
|
||||
$this->removeHotspotActiveUser($client, $from);
|
||||
}
|
||||
}
|
||||
|
||||
function add_plan($plan)
|
||||
{
|
||||
$mikrotik = $this->info($plan['routers']);
|
||||
@ -67,8 +88,8 @@ class MikrotikHotspot
|
||||
$unitup = 'M';
|
||||
}
|
||||
$rate = $bw['rate_up'] . $unitup . "/" . $bw['rate_down'] . $unitdown;
|
||||
if(!empty(trim($bw['burst']))){
|
||||
$rate .= ' '.$bw['burst'];
|
||||
if (!empty(trim($bw['burst']))) {
|
||||
$rate .= ' ' . $bw['burst'];
|
||||
}
|
||||
$addRequest = new RouterOS\Request('/ip/hotspot/user/profile/add');
|
||||
$client->sendSync(
|
||||
@ -146,8 +167,8 @@ class MikrotikHotspot
|
||||
$unitup = 'M';
|
||||
}
|
||||
$rate = $bw['rate_up'] . $unitup . "/" . $bw['rate_down'] . $unitdown;
|
||||
if(!empty(trim($bw['burst']))){
|
||||
$rate .= ' '.$bw['burst'];
|
||||
if (!empty(trim($bw['burst']))) {
|
||||
$rate .= ' ' . $bw['burst'];
|
||||
}
|
||||
$setRequest = new RouterOS\Request('/ip/hotspot/user/profile/set');
|
||||
$client->sendSync(
|
||||
@ -229,7 +250,7 @@ class MikrotikHotspot
|
||||
->setArgument('name', $customer['username'])
|
||||
->setArgument('profile', $plan['name_plan'])
|
||||
->setArgument('password', $customer['password'])
|
||||
->setArgument('comment', $customer['fullname'])
|
||||
->setArgument('comment', $customer['fullname'] . ' | ' . implode(', ', User::getBillNames($customer['id'])))
|
||||
->setArgument('email', $customer['email'])
|
||||
->setArgument('limit-uptime', $timelimit)
|
||||
);
|
||||
@ -243,7 +264,7 @@ class MikrotikHotspot
|
||||
->setArgument('name', $customer['username'])
|
||||
->setArgument('profile', $plan['name_plan'])
|
||||
->setArgument('password', $customer['password'])
|
||||
->setArgument('comment', $customer['fullname'])
|
||||
->setArgument('comment', $customer['fullname'] . ' | ' . implode(', ', User::getBillNames($customer['id'])))
|
||||
->setArgument('email', $customer['email'])
|
||||
->setArgument('limit-bytes-total', $datalimit)
|
||||
);
|
||||
@ -261,7 +282,7 @@ class MikrotikHotspot
|
||||
->setArgument('name', $customer['username'])
|
||||
->setArgument('profile', $plan['name_plan'])
|
||||
->setArgument('password', $customer['password'])
|
||||
->setArgument('comment', $customer['fullname'])
|
||||
->setArgument('comment', $customer['fullname'] . ' | ' . implode(', ', User::getBillNames($customer['id'])))
|
||||
->setArgument('email', $customer['email'])
|
||||
->setArgument('limit-uptime', $timelimit)
|
||||
->setArgument('limit-bytes-total', $datalimit)
|
||||
@ -272,7 +293,7 @@ class MikrotikHotspot
|
||||
$addRequest
|
||||
->setArgument('name', $customer['username'])
|
||||
->setArgument('profile', $plan['name_plan'])
|
||||
->setArgument('comment', $customer['fullname'])
|
||||
->setArgument('comment', $customer['fullname'] . ' | ' . implode(', ', User::getBillNames($customer['id'])))
|
||||
->setArgument('email', $customer['email'])
|
||||
->setArgument('password', $customer['password'])
|
||||
);
|
||||
|
@ -21,7 +21,7 @@ class MikrotikPppoe
|
||||
'author' => 'ibnux',
|
||||
'url' => [
|
||||
'Github' => 'https://github.com/hotspotbilling/phpnuxbill/',
|
||||
'Telegram' => 'https://t.me/ibnux',
|
||||
'Telegram' => 'https://t.me/phpnuxbill',
|
||||
'Donate' => 'https://paypal.me/ibnux'
|
||||
]
|
||||
];
|
||||
@ -31,9 +31,28 @@ class MikrotikPppoe
|
||||
{
|
||||
$mikrotik = $this->info($plan['routers']);
|
||||
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||
$this->removePpoeUser($client, $customer['username']);
|
||||
$this->removePpoeActive($client, $customer['username']);
|
||||
$this->addPpoeUser($client, $plan, $customer);
|
||||
//check if customer exists
|
||||
$printRequest = new RouterOS\Request('/ppp/secret/print');
|
||||
$printRequest->setQuery(RouterOS\Query::where('name', $customer['username']));
|
||||
$cid = $client->sendSync($printRequest)->getProperty('.id');
|
||||
if (empty($cid)) {
|
||||
//customer not exists, add it
|
||||
$this->addPpoeUser($client, $plan, $customer);
|
||||
}else{
|
||||
if (!empty($customer['pppoe_password'])) {
|
||||
$pass = $customer['pppoe_password'];
|
||||
} else {
|
||||
$pass = $customer['password'];
|
||||
}
|
||||
$setRequest = new RouterOS\Request('/ppp/secret/set');
|
||||
$setRequest->setArgument('numbers', $cid);
|
||||
$setRequest->setArgument('profile', $plan['name_plan']);
|
||||
$setRequest->setArgument('comment', $customer['fullname'] . ' | ' . $customer['email'] . ' | ' . implode(', ', User::getBillNames($customer['id'])));
|
||||
$setRequest->setArgument('password', $pass);
|
||||
$client->sendSync($setRequest);
|
||||
//disconnect then
|
||||
//$this->removePpoeActive($client, $customer['username']);
|
||||
}
|
||||
}
|
||||
|
||||
function remove_customer($customer, $plan)
|
||||
@ -49,6 +68,25 @@ class MikrotikPppoe
|
||||
$this->removePpoeActive($client, $customer['username']);
|
||||
}
|
||||
|
||||
// customer change username
|
||||
public function change_username($plan, $from, $to)
|
||||
{
|
||||
$mikrotik = $this->info($plan['routers']);
|
||||
$client = $this->getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||
//check if customer exists
|
||||
$printRequest = new RouterOS\Request('/ppp/secret/print');
|
||||
$printRequest->setQuery(RouterOS\Query::where('name', $from));
|
||||
$cid = $client->sendSync($printRequest)->getProperty('.id');
|
||||
if (!empty($cid)) {
|
||||
$setRequest = new RouterOS\Request('/ppp/secret/set');
|
||||
$setRequest->setArgument('numbers', $cid);
|
||||
$setRequest->setArgument('name', $to);
|
||||
$client->sendSync($setRequest);
|
||||
//disconnect then
|
||||
$this->removePpoeActive($client, $from);
|
||||
}
|
||||
}
|
||||
|
||||
function add_plan($plan)
|
||||
{
|
||||
$mikrotik = $this->info($plan['routers']);
|
||||
@ -212,15 +250,6 @@ class MikrotikPppoe
|
||||
return $client->sendSync($printRequest)->getProperty('.id');
|
||||
}
|
||||
|
||||
|
||||
function connect_customer($customer, $ip, $mac_address, $router_name)
|
||||
{
|
||||
}
|
||||
|
||||
function disconnect_customer($customer, $router_name)
|
||||
{
|
||||
}
|
||||
|
||||
function info($name)
|
||||
{
|
||||
return ORM::for_table('tbl_routers')->where('name', $name)->find_one();
|
||||
@ -254,9 +283,6 @@ class MikrotikPppoe
|
||||
function addPpoeUser($client, $plan, $customer)
|
||||
{
|
||||
global $_app_stage;
|
||||
if ($_app_stage == 'demo') {
|
||||
return null;
|
||||
}
|
||||
$addRequest = new RouterOS\Request('/ppp/secret/add');
|
||||
if (!empty($customer['pppoe_password'])) {
|
||||
$pass = $customer['pppoe_password'];
|
||||
@ -268,7 +294,7 @@ class MikrotikPppoe
|
||||
->setArgument('name', $customer['username'])
|
||||
->setArgument('service', 'pppoe')
|
||||
->setArgument('profile', $plan['name_plan'])
|
||||
->setArgument('comment', $customer['fullname'] . ' | ' . $customer['email'])
|
||||
->setArgument('comment', $customer['fullname'] . ' | ' . $customer['email'] . ' | ' . implode(', ', User::getBillNames($customer['id'])))
|
||||
->setArgument('password', $pass)
|
||||
);
|
||||
}
|
||||
@ -276,9 +302,6 @@ class MikrotikPppoe
|
||||
function setPpoeUser($client, $user, $pass)
|
||||
{
|
||||
global $_app_stage;
|
||||
if ($_app_stage == 'demo') {
|
||||
return null;
|
||||
}
|
||||
$printRequest = new RouterOS\Request('/ppp/secret/print');
|
||||
$printRequest->setArgument('.proplist', '.id');
|
||||
$printRequest->setQuery(RouterOS\Query::where('name', $user));
|
||||
|
@ -20,7 +20,7 @@ class Radius
|
||||
'author' => 'ibnux',
|
||||
'url' => [
|
||||
'Github' => 'https://github.com/hotspotbilling/phpnuxbill/',
|
||||
'Telegram' => 'https://t.me/ibnux',
|
||||
'Telegram' => 'https://t.me/phpnuxbill',
|
||||
'Donate' => 'https://paypal.me/ibnux'
|
||||
]
|
||||
];
|
||||
@ -28,8 +28,15 @@ class Radius
|
||||
|
||||
function add_customer($customer, $plan)
|
||||
{
|
||||
global $b;
|
||||
$this->customerAddPlan($customer, $plan, $b['expiration'] . '' . $b['time']);
|
||||
$b = ORM::for_table('tbl_user_recharges')
|
||||
->where('customer_id', $customer['id'])
|
||||
->where('plan_id', $plan['id'])
|
||||
->where('status', 'on')
|
||||
->findMany();
|
||||
|
||||
if($b){
|
||||
$this->customerAddPlan($customer, $plan, $b['expiration'] . ' ' . $b['time']);
|
||||
}
|
||||
}
|
||||
|
||||
function remove_customer($customer, $plan)
|
||||
@ -42,6 +49,24 @@ class Radius
|
||||
}
|
||||
}
|
||||
|
||||
public function change_username($from, $to)
|
||||
{
|
||||
$c = $this->getTableCustomer()->where_equal('username', $from)->findMany();
|
||||
if ($c) {
|
||||
foreach ($c as $u) {
|
||||
$u->username = $to;
|
||||
$u->save();
|
||||
}
|
||||
}
|
||||
$c = $this->getTableUserPackage()->where_equal('username', $from)->findMany();
|
||||
if ($c) {
|
||||
foreach ($c as $u) {
|
||||
$u->username = $to;
|
||||
$u->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
function add_plan($plan)
|
||||
{
|
||||
$bw = ORM::for_table("tbl_bandwidth")->find_one($plan['id_bw']);
|
||||
@ -169,24 +194,6 @@ class Radius
|
||||
return $n->save();
|
||||
}
|
||||
|
||||
public function customerChangeUsername($from, $to)
|
||||
{
|
||||
$c = $this->getTableCustomer()->where_equal('username', $from)->findMany();
|
||||
if ($c) {
|
||||
foreach ($c as $u) {
|
||||
$u->username = $to;
|
||||
$u->save();
|
||||
}
|
||||
}
|
||||
$c = $this->getTableUserPackage()->where_equal('username', $from)->findMany();
|
||||
if ($c) {
|
||||
foreach ($c as $u) {
|
||||
$u->username = $to;
|
||||
$u->save();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function customerDeactivate($username, $radiusDisconnect = true)
|
||||
{ {
|
||||
global $radius_pass;
|
||||
@ -262,10 +269,6 @@ class Radius
|
||||
// Mikrotik Spesific
|
||||
$this->upsertCustomer($customer['username'], 'Max-Data', $datalimit);
|
||||
//$this->upsertCustomer($customer['username'], 'Mikrotik-Total-Limit', $datalimit);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
} else {
|
||||
//$this->delAtribute($this->getTableCustomer(), 'Max-Volume', 'username', $customer['username']);
|
||||
|
65
system/devices/RadiusRest.php
Normal file
65
system/devices/RadiusRest.php
Normal file
@ -0,0 +1,65 @@
|
||||
<?php
|
||||
|
||||
class RadiusRest {
|
||||
|
||||
// show Description
|
||||
function description()
|
||||
{
|
||||
return [
|
||||
'title' => 'Radius Rest API',
|
||||
'description' => 'This devices will handle Radius Connection using Rest API',
|
||||
'author' => 'ibnu maksum',
|
||||
'url' => [
|
||||
'Wiki Tutorial' => 'https://github.com/hotspotbilling/phpnuxbill/wiki/FreeRadius-Rest',
|
||||
'Telegram' => 'https://t.me/phpnuxbill',
|
||||
'Donate' => 'https://paypal.me/ibnux'
|
||||
]
|
||||
];
|
||||
}
|
||||
|
||||
// Add Customer to Mikrotik/Device
|
||||
function add_customer($customer, $plan)
|
||||
{
|
||||
}
|
||||
|
||||
// Remove Customer to Mikrotik/Device
|
||||
function remove_customer($customer, $plan)
|
||||
{
|
||||
}
|
||||
|
||||
// customer change username
|
||||
public function change_username($from, $to)
|
||||
{
|
||||
}
|
||||
|
||||
// Add Plan to Mikrotik/Device
|
||||
function add_plan($plan)
|
||||
{
|
||||
}
|
||||
|
||||
// Update Plan to Mikrotik/Device
|
||||
function update_plan($old_name, $plan)
|
||||
{
|
||||
}
|
||||
|
||||
// Remove Plan from Mikrotik/Device
|
||||
function remove_plan($plan)
|
||||
{
|
||||
}
|
||||
|
||||
// check if customer is online
|
||||
function online_customer($customer, $router_name)
|
||||
{
|
||||
}
|
||||
|
||||
// make customer online
|
||||
function connect_customer($customer, $ip, $mac_address, $router_name)
|
||||
{
|
||||
}
|
||||
|
||||
// make customer disconnect
|
||||
function disconnect_customer($customer, $router_name)
|
||||
{
|
||||
}
|
||||
|
||||
}
|
@ -33,6 +33,11 @@ class FileName {
|
||||
{
|
||||
}
|
||||
|
||||
// customer change username
|
||||
public function change_username($from, $to)
|
||||
{
|
||||
}
|
||||
|
||||
// Add Plan to Mikrotik/Device
|
||||
function add_plan($plan)
|
||||
{
|
||||
|
@ -1,219 +1,676 @@
|
||||
{
|
||||
"Recharge_Account": "Recharge Account",
|
||||
"Refill_Account": "Refill Account",
|
||||
"SuperAdmin": "SuperAdmin",
|
||||
"Change_Password": "Change Password",
|
||||
"My_Account": "My Account",
|
||||
"Logout": "Logout",
|
||||
"Dashboard": "Dashboard",
|
||||
"Customer": "Customer",
|
||||
"Lists": "Lists",
|
||||
"Location": "Location",
|
||||
"Services": "Services",
|
||||
"Active_Users": "Active Users",
|
||||
"Vouchers": "Vouchers",
|
||||
"Refill_Customer": "Refill Customer",
|
||||
"Recharge_Customer": "Recharge Customer",
|
||||
"Refill_Balance": "Refill Balance",
|
||||
"Internet_Plan": "Internet Plan",
|
||||
"Bandwidth": "Bandwidth",
|
||||
"Customer_Balance": "Customer Balance",
|
||||
"Reports": "Reports",
|
||||
"Daily_Reports": "Daily Reports",
|
||||
"Period_Reports": "Period Reports",
|
||||
"Activation_History": "Activation History",
|
||||
"Send_Message": "Send Message",
|
||||
"Single_Customer": "Single Customer",
|
||||
"Bulk_Customers": "Bulk Customers",
|
||||
"Network": "Network",
|
||||
"Routers": "Routers",
|
||||
"IP_Pool": "IP Pool",
|
||||
"Radius": "Radius",
|
||||
"Radius_NAS": "Radius NAS",
|
||||
"Static_Pages": "Static Pages",
|
||||
"Order_Voucher": "Order Voucher",
|
||||
"Voucher": "Voucher",
|
||||
"Log_in": "Login",
|
||||
"Register": "Register",
|
||||
"Announcement": "Announcement",
|
||||
"Customer_Announcement": "Customer Announcement",
|
||||
"Registration_Info": "Registration Info",
|
||||
"Privacy_Policy": "Privacy Policy",
|
||||
"Terms_and_Conditions": "Terms and Conditions",
|
||||
"Settings": "Settings",
|
||||
"General_Settings": "General Settings",
|
||||
"Localisation": "Localisation",
|
||||
"Maintenance_Mode": "Maintenance Mode",
|
||||
"User_Notification": "User Notification",
|
||||
"Administrator_Users": "Administrator Users",
|
||||
"Backup_Restore": "Backup\/Restore",
|
||||
"Payment_Gateway": "Payment Gateway",
|
||||
"Plugin_Manager": "Plugin Manager",
|
||||
"Logs": "Logs",
|
||||
"Community": "Community",
|
||||
"Select_Account": "Select Account",
|
||||
"Select_a_customer": "Select a customer",
|
||||
"Code_Voucher": "Code Voucher",
|
||||
"Enter_voucher_code_here": "Enter voucher code here",
|
||||
"Recharge": "Recharge",
|
||||
"Cancel": "Cancel",
|
||||
"Hotspot_Plans": "Hotspot Plans",
|
||||
"Search_by_Name": "Search by Name",
|
||||
"Search": "Search",
|
||||
"New_Service_Plan": "New Service Plan",
|
||||
"Expired": "Expired",
|
||||
"Name": "Name",
|
||||
"Type": "Type",
|
||||
"Category": "Category",
|
||||
"Price": "Price",
|
||||
"Validity": "Validity",
|
||||
"Time": "Time",
|
||||
"Data": "Data",
|
||||
"Device": "Device",
|
||||
"Date": "Date",
|
||||
"ID": "ID",
|
||||
"Voucher_not_found__please_buy_voucher_befor_register": "Voucher not found, please buy voucher befor register",
|
||||
"Register_Success__You_can_login_now": "Register Success! You can login now",
|
||||
"Log_in_to_Member_Panel": "Log in to Member Panel",
|
||||
"Register_as_Member": "Register as Member",
|
||||
"Enter_Admin_Area": "Enter Admin Area",
|
||||
"PHPNuxBill": "PHPNuxBill",
|
||||
"Username": "Username",
|
||||
"Password": "Password",
|
||||
"Passwords_does_not_match": "Passwords does not match",
|
||||
"Account_already_axist": "Account already axist",
|
||||
"Manage": "Manage",
|
||||
"Submit": "Submit",
|
||||
"Save_Changes": "Save Changes",
|
||||
"Cancel": "Cancel",
|
||||
"Edit": "Edit",
|
||||
"Delete": "Delete",
|
||||
"Prev": "Prev",
|
||||
"Next": "Next",
|
||||
"Welcome": "Welcome",
|
||||
"Data_Created_Successfully": "Data Created Successfully",
|
||||
"Data_Updated_Successfully": "Data Updated Successfully",
|
||||
"Data_Deleted_Successfully": "Data Deleted Successfully",
|
||||
"Static_Pages": "Static Pages",
|
||||
"Failed_to_save_page__make_sure_i_can_write_to_folder_pages___i_chmod_664_pages___html_i_": "Failed to save page, make sure i can write to folder pages, <i>chmod 664 pages\/*.html<i>",
|
||||
"Saving_page_success": "Saving page success",
|
||||
"Sometimes_you_need_to_refresh_3_times_until_content_change": "Sometimes you need to refresh 3 times until content change",
|
||||
"Dashboard": "Dashboard",
|
||||
"Search_Customers___": "Search Customers...",
|
||||
"My_Account": "My Account",
|
||||
"My_Profile": "My Profile",
|
||||
"Settings": "Settings",
|
||||
"Edit_Profile": "Edit Profile",
|
||||
"Change_Password": "Change Password",
|
||||
"Logout": "Logout",
|
||||
"Services": "Services",
|
||||
"Bandwidth_Plans": "Bandwidth Plans",
|
||||
"Bandwidth_Name": "Bandwidth Name",
|
||||
"New_Bandwidth": "New Bandwidth",
|
||||
"Edit_Bandwidth": "Edit Bandwidth",
|
||||
"Add_New_Bandwidth": "Add New Bandwidth",
|
||||
"Rate_Download": "Rate Download",
|
||||
"Rate_Upload": "Rate Upload",
|
||||
"Name_Bandwidth_Already_Exist": "Name Bandwidth Already Exist",
|
||||
"Hotspot_Plans": "Hotspot Plans",
|
||||
"PPPOE_Plans": "PPPOE Plans",
|
||||
"Plan_Name": "Plan Name",
|
||||
"Plan_Type": "Plan Type",
|
||||
"Bandwidth_Plans": "Bandwidth Plans",
|
||||
"Plan_Price": "Plan Price",
|
||||
"Plan_Validity": "Plan Validity",
|
||||
"Status": "Status",
|
||||
"Business": "Business",
|
||||
"Personal": "Personal",
|
||||
"Hap_Lite": "Hap Lite",
|
||||
"": "",
|
||||
"New_Service_Plan": "New Service Plan",
|
||||
"Add_Service_Plan": "Add Service Plan",
|
||||
"Cannot_be_change_after_saved": "Cannot be change after saved",
|
||||
"Edit_Service_Plan": "Edit Service Plan",
|
||||
"Name_Plan_Already_Exist": "Name Plan Already Exist",
|
||||
"Plan_Type": "Plan Type",
|
||||
"Plan_Price": "Plan Price",
|
||||
"Limit_Type": "Limit Type",
|
||||
"Unlimited": "Unlimited",
|
||||
"Limited": "Limited",
|
||||
"Limit_Type": "Limit Type",
|
||||
"Time_Limit": "Time Limit",
|
||||
"Data_Limit": "Data Limit",
|
||||
"Both_Limit": "Both Limit",
|
||||
"Hrs": "Hrs",
|
||||
"Mins": "Mins",
|
||||
"Bandwidth_Name": "Bandwidth Name",
|
||||
"Plan_Validity": "Plan Validity",
|
||||
"Select_Bandwidth": "Select Bandwidth",
|
||||
"Shared_Users": "Shared Users",
|
||||
"1_Period___1_Month__Expires_the_20th_of_each_month": "1 Period = 1 Month, Expires the 20th of each month",
|
||||
"Expired_Date": "Expired Date",
|
||||
"Router_Name": "Router Name",
|
||||
"Select_Routers": "Select Routers",
|
||||
"Save_Changes": "Save Changes",
|
||||
"Days": "Days",
|
||||
"Months": "Months",
|
||||
"Period": "Period",
|
||||
"New_Bandwidth": "New Bandwidth",
|
||||
"Rate": "Rate",
|
||||
"Burst": "Burst",
|
||||
"Balance_Plans": "Balance Plans",
|
||||
"New_Router": "New Router",
|
||||
"IP_Address": "IP Address",
|
||||
"Username": "Username",
|
||||
"Description": "Description",
|
||||
"Edit_Service_Plan": "Edit Service Plan",
|
||||
"Expired_Action": "Expired Action",
|
||||
"Optional": "Optional",
|
||||
"Expired_Internet_Plan": "Expired Internet Plan",
|
||||
"When_Expired__customer_will_be_move_to_selected_internet_plan": "When Expired, customer will be move to selected internet plan",
|
||||
"Data_Updated_Successfully": "Data Updated Successfully",
|
||||
"Plugin_Installer": "Plugin Installer",
|
||||
"Plugin": "Plugin",
|
||||
"Search_by_Username": "Search by Username",
|
||||
"Choose_User_Type_Sales_to_disable_access_to_Settings": "Choose User Type Sales to disable access to Settings",
|
||||
"Current_Password": "Current Password",
|
||||
"New_Password": "New Password",
|
||||
"Administrator": "Administrator",
|
||||
"Sales": "Sales",
|
||||
"Member": "Member",
|
||||
"Confirm_New_Password": "Confirm New Password",
|
||||
"Confirm_Password": "Confirm Password",
|
||||
"Full_Name": "Full Name",
|
||||
"User_Type": "User Type",
|
||||
"Address": "Address",
|
||||
"Created_On": "Created On",
|
||||
"Expires_On": "Expires On",
|
||||
"Phone_Number": "Phone Number",
|
||||
"User_deleted_Successfully": "User deleted Successfully",
|
||||
"Full_Administrator": "Full Administrator",
|
||||
"Keep_Blank_to_do_not_change_Password": "Keep Blank to do not change Password",
|
||||
"Keep_it_blank_if_you_do_not_want_to_show_currency_code": "Keep it blank if you do not want to show currency code",
|
||||
"Theme_Style": "Theme Style",
|
||||
"Theme_Color": "Theme Color",
|
||||
"Default_Language": "Default Language",
|
||||
"Network": "Network",
|
||||
"Routers": "Routers",
|
||||
"IP_Pool": "IP Pool",
|
||||
"New_Router": "New Router",
|
||||
"Add_Router": "Add Router",
|
||||
"Edit_Router": "Edit Router",
|
||||
"Router_Name": "Router Name",
|
||||
"IP_Address": "IP Address",
|
||||
"Router_Secret": "Router Secret",
|
||||
"Description": "Description",
|
||||
"IP_Router_Already_Exist": "IP Router Already Exist",
|
||||
"Name_Pool": "Name Pool",
|
||||
"Range_IP": "Range IP",
|
||||
"New_Pool": "New Pool",
|
||||
"Add_Pool": "Add Pool",
|
||||
"Edit_Pool": "Edit Pool",
|
||||
"Pool_Name_Already_Exist": "Pool Name Already Exist",
|
||||
"Refill_Account": "Refill Account",
|
||||
"Recharge_Account": "Recharge Account",
|
||||
"Select_Account": "Select Account",
|
||||
"Service_Plan": "Service Plan",
|
||||
"Recharge": "Recharge",
|
||||
"Method": "Method",
|
||||
"Extend": "Extend",
|
||||
"Account_Created_Successfully": "Account Created Successfully",
|
||||
"Database_Status": "Database Status",
|
||||
"Total_Database_Size": "Total Database Size",
|
||||
"Download_Database_Backup": "Download Database Backup",
|
||||
"Table_Name": "Table Name",
|
||||
"Rows": "Rows",
|
||||
"Size": "Size",
|
||||
"Customer": "Customer",
|
||||
"Add_New_Contact": "Add New Contact",
|
||||
"Edit_Contact": "Edit Contact",
|
||||
"List_Contact": "List Contact",
|
||||
"Manage_Contact": "Manage Contact",
|
||||
"Reports": "Reports",
|
||||
"Daily_Reports": "Daily Reports",
|
||||
"Period_Reports": "Period Reports",
|
||||
"All_Transactions": "All Transactions",
|
||||
"Total_Income": "Total Income",
|
||||
"All_Transactions_at_Date": "All Transactions at Date",
|
||||
"Export_for_Print": "Export for Print",
|
||||
"Print": "Print",
|
||||
"Export_to_PDF": "Export to PDF",
|
||||
"Click_Here_to_Print": "Click Here to Print",
|
||||
"You_can_use_html_tag": "You can use html tag",
|
||||
"Date_Format": "Date Format",
|
||||
"Income_Today": "Income Today",
|
||||
"Income_This_Month": "Income This Month",
|
||||
"Users_Active": "Users Active",
|
||||
"Total_Users": "Total Users",
|
||||
"Users": "Users",
|
||||
"Edit_User": "Edit User",
|
||||
"Last_Login": "Last Login",
|
||||
"Administrator_Users": "Administrator Users",
|
||||
"Manage_Administrator": "Manage Administrator",
|
||||
"Add_New_Administrator": "Add New Administrator",
|
||||
"Localisation": "Localisation",
|
||||
"Backup_Restore": "Backup\/Restore",
|
||||
"General_Settings": "General Settings",
|
||||
"Date": "Date",
|
||||
"Login_Successful": "Login Successful",
|
||||
"Failed_Login": "Failed Login",
|
||||
"Settings_Saved_Successfully": "Settings Saved Successfully",
|
||||
"User_Updated_Successfully": "User Updated Successfully",
|
||||
"User_Expired__Today": "User Expired, Today",
|
||||
"Activity_Log": "Activity Log",
|
||||
"View_Reports": "View Reports",
|
||||
"View_All": "View All",
|
||||
"Number_of_Vouchers": "Number of Vouchers",
|
||||
"Length_Code": "Length Code",
|
||||
"Code_Voucher": "Code Voucher",
|
||||
"Voucher": "Voucher",
|
||||
"Hotspot_Voucher": "Hotspot Voucher",
|
||||
"Status_Voucher": "Status Voucher",
|
||||
"Generated_By": "Generated By",
|
||||
"View": "View",
|
||||
"Buy_Balance": "Buy Balance",
|
||||
"Buy_Package": "Buy Package",
|
||||
"Order_History": "Order History",
|
||||
"List_Activated_Voucher": "List Activated Voucher",
|
||||
"Invoice": "Invoice",
|
||||
"Select_Plans": "Select Plans",
|
||||
"Add_Vouchers": "Add Vouchers",
|
||||
"Create_Vouchers_Successfully": "Create Vouchers Successfully",
|
||||
"Generate": "Generate",
|
||||
"Print_side_by_side__it_will_easy_to_cut": "Print side by side, it will easy to cut",
|
||||
"From_Date": "From Date",
|
||||
"To_Date": "To Date",
|
||||
"New_Service": "New Service",
|
||||
"Type": "Type",
|
||||
"Finish": "Finish",
|
||||
"Application_Name__Company_Name": "Application Name\/ Company Name",
|
||||
"This_Name_will_be_shown_on_the_Title": "This Name will be shown on the Title",
|
||||
"Company_Logo": "Company Logo",
|
||||
"Next": "Next",
|
||||
"Last": "Last",
|
||||
"Timezone": "Timezone",
|
||||
"Decimal_Point": "Decimal Point",
|
||||
"Thousands_Separator": "Thousands Separator",
|
||||
"Currency_Code": "Currency Code",
|
||||
"Order_Voucher": "Order Voucher",
|
||||
"Voucher_Activation": "Voucher Activation",
|
||||
"List_Activated_Voucher": "List Activated Voucher",
|
||||
"Enter_voucher_code_here": "Enter voucher code here",
|
||||
"Private_Message": "Private Message",
|
||||
"Inbox": "Inbox",
|
||||
"Outbox": "Outbox",
|
||||
"Compose": "Compose",
|
||||
"Send_to": "Send to",
|
||||
"Title": "Title",
|
||||
"Message": "Message",
|
||||
"Your_Account_Information": "Your Account Information",
|
||||
"Welcome_to_the_Panel_Members_page__on_this_page_you_can_": "Welcome to the Panel Members page, on this page you can:",
|
||||
"Invalid_Username_or_Password": "Invalid Username or Password",
|
||||
"You_do_not_have_permission_to_access_this_page": "You do not have permission to access this page",
|
||||
"Incorrect_Current_Password": "Incorrect Current Password",
|
||||
"Password_changed_successfully__Please_login_again": "Password changed successfully, Please login again",
|
||||
"All_field_is_required": "All field is required",
|
||||
"Voucher_Not_Valid": "Voucher Not Valid",
|
||||
"Activation_Vouchers_Successfully": "Activation Vouchers Successfully",
|
||||
"Data_Not_Found": "Data Not Found",
|
||||
"Search_by_Username": "Search by Username",
|
||||
"Search_by_Name": "Search by Name",
|
||||
"Search_by_Code_Voucher": "Search by Code Voucher",
|
||||
"Search": "Search",
|
||||
"Select_a_customer": "Select a customer",
|
||||
"Select_Routers": "Select Routers",
|
||||
"Select_Plans": "Select Plans",
|
||||
"Select_Pool": "Select Pool",
|
||||
"Hrs": "Hrs",
|
||||
"Mins": "Mins",
|
||||
"Days": "Days",
|
||||
"Months": "Months",
|
||||
"Add_Language": "Add Language",
|
||||
"Language_Name": "Language Name",
|
||||
"Folder_Name": "Folder Name",
|
||||
"Translator": "Translator",
|
||||
"Language_Name_Already_Exist": "Language Name Already Exist",
|
||||
"Payment_Gateway": "Payment Gateway",
|
||||
"Community": "Community",
|
||||
"1_user_can_be_used_for_many_devices_": "1 user can be used for many devices?",
|
||||
"Cannot_be_change_after_saved": "Cannot be change after saved",
|
||||
"Explain_Coverage_of_router": "Explain Coverage of router",
|
||||
"Name_of_Area_that_router_operated": "Name of Area that router operated",
|
||||
"Payment_Notification_URL__Recurring_Notification_URL__Pay_Account_Notification_URL": "Payment Notification URL, Recurring Notification URL, Pay Account Notification URL",
|
||||
"Finish_Redirect_URL__Unfinish_Redirect_URL__Error_Redirect_URL": "Finish Redirect URL, Unfinish Redirect URL, Error Redirect URL",
|
||||
"Status": "Status",
|
||||
"Plan_Not_found": "Plan Not found",
|
||||
"Failed_to_create_transaction_": "Failed to create transaction.",
|
||||
"Seller_has_not_yet_setup_Xendit_payment_gateway": "Seller has not yet setup Xendit payment gateway",
|
||||
"Admin_has_not_yet_setup_Xendit_payment_gateway__please_tell_admin": "Admin has not yet setup Xendit payment gateway, please tell admin",
|
||||
"You_already_have_unpaid_transaction__cancel_it_or_pay_it_": "You already have unpaid transaction, cancel it or pay it.",
|
||||
"Transaction_Not_found": "Transaction Not found",
|
||||
"Cancel_it_": "Cancel it?",
|
||||
"expired": "expired",
|
||||
"Check_for_Payment": "Check for Payment",
|
||||
"Transaction_still_unpaid_": "Transaction still unpaid.",
|
||||
"Paid_Date": "Paid Date",
|
||||
"Transaction_has_been_paid_": "Transaction has been paid.",
|
||||
"PAID": "PAID",
|
||||
"CANCELED": "CANCELED",
|
||||
"UNPAID": "UNPAID",
|
||||
"PAY_NOW": "PAY NOW",
|
||||
"Buy_Hotspot_Plan": "Buy Hotspot Plan",
|
||||
"Buy_PPOE_Plan": "Buy PPOE Plan",
|
||||
"Package": "Package",
|
||||
"Order_Internet_Package": "Order Internet Package",
|
||||
"Unknown_Command_": "Unknown Command.",
|
||||
"Checking_payment": "Checking payment",
|
||||
"Create_Transaction_Success": "Create Transaction Success",
|
||||
"You_have_unpaid_transaction": "You have unpaid transaction",
|
||||
"TripayPayment_Channel": "TripayPayment Channel",
|
||||
"Payment_Channel": "Payment Channel",
|
||||
"Payment_check_failed_": "Payment check failed.",
|
||||
"Order_Package": "Order Package",
|
||||
"Transactions": "Transactions",
|
||||
"Payments": "Payments",
|
||||
"History": "History",
|
||||
"Order_History": "Order History",
|
||||
"Gateway": "Gateway",
|
||||
"Date_Done": "Date Done",
|
||||
"Unpaid_Order": "Unpaid Order",
|
||||
"Payment_Gateway_Not_Found": "Payment Gateway Not Found",
|
||||
"Payment_Gateway_saved_successfully": "Payment Gateway saved successfully",
|
||||
"ORDER": "ORDER",
|
||||
"Package_History": "Package History",
|
||||
"Buy_History": "Buy History",
|
||||
"Activation_History": "Activation History",
|
||||
"Buy_Package": "Buy Package",
|
||||
"Email": "Email",
|
||||
"Company_Footer": "Company Footer",
|
||||
"Will_show_below_user_pages": "Will show below user pages",
|
||||
"Address": "Address",
|
||||
"You_can_use_html_tag": "You can use html tag",
|
||||
"Phone_Number": "Phone Number",
|
||||
"Invoice_Footer": "Invoice Footer",
|
||||
"Recharge_Using": "Recharge Using",
|
||||
"Cash": "Cash",
|
||||
"Bank_Transfer": "Bank Transfer",
|
||||
"Income_reset_date": "Income reset date",
|
||||
"Monthly_Registered_Customers": "Monthly Registered Customers",
|
||||
"Total_Monthly_Sales": "Total Monthly Sales",
|
||||
"All_Users_Insights": "All Users Insights",
|
||||
"Activity_Log": "Activity Log",
|
||||
"User_Expired__Today": "User Expired, Today",
|
||||
"Request_OTP": "Request OTP",
|
||||
"Verification_Code": "Verification Code",
|
||||
"SMS_Verification_Code": "SMS Verification Code",
|
||||
"Please_enter_your_email_address": "Please enter your email address",
|
||||
"Failed_to_create_Paypal_transaction_": "Failed to create Paypal transaction.",
|
||||
"Plugin": "Plugin",
|
||||
"Plugin_Manager": "Plugin Manager",
|
||||
"User_Notification": "User Notification",
|
||||
"Expired_Notification": "Expired Notification",
|
||||
"User_will_get_notification_when_package_expired": "User will get notification when package expired",
|
||||
"Expired_Notification_Message": "Expired Notification Message",
|
||||
"Payment_Notification": "Payment Notification",
|
||||
"User_will_get_invoice_notification_when_buy_package_or_package_refilled": "User will get invoice notification when buy package or package refilled",
|
||||
"Current_IP": "Current IP",
|
||||
"Current_MAC": "Current MAC",
|
||||
"Login_Status": "Login Status",
|
||||
"Login_Request_successfully": "Login Request successfully",
|
||||
"Logout_Request_successfully": "Logout Request successfully",
|
||||
"Disconnect_Internet_": "Disconnect Internet?",
|
||||
"Not_Online__Login_now_": "Not Online, Login now?",
|
||||
"You_are_Online__Logout_": "You are Online, Logout?",
|
||||
"Connect_to_Internet_": "Connect to Internet?",
|
||||
"Your_account_not_connected_to_internet": "Your account not connected to internet",
|
||||
"Failed_to_create_transaction__": "Failed to create transaction. ",
|
||||
"Failed_to_check_status_transaction__": "Failed to check status transaction. ",
|
||||
"Disable_Voucher": "Disable Voucher",
|
||||
"Voucher_activation_menu_will_be_hidden": "Voucher activation menu will be hidden",
|
||||
"Voucher_Format": "Voucher Format",
|
||||
"Disable_Registration": "Disable Registration",
|
||||
"Customer_just_Login_with_Phone_number_and_Voucher_Code__Voucher_will_be_password": "Customer just Login with Phone number and Voucher Code, Voucher will be password",
|
||||
"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",
|
||||
"Extend_Postpaid_Expiration": "Extend Postpaid Expiration",
|
||||
"Allow_Extend": "Allow Extend",
|
||||
"Extend_Days": "Extend Days",
|
||||
"Confirmation_Message": "Confirmation Message",
|
||||
"Balance": "Balance",
|
||||
"Balance_System": "Balance System",
|
||||
"Enable_System": "Enable System",
|
||||
"Customer_can_deposit_money_to_buy_voucher": "Customer can deposit money to buy voucher",
|
||||
"Allow_Transfer": "Allow Transfer",
|
||||
"Allow_balance_transfer_between_customers": "Allow balance transfer between customers",
|
||||
"Minimum_Balance_Transfer": "Minimum Balance Transfer",
|
||||
"Telegram_Notification": "Telegram Notification",
|
||||
"SMS_OTP_Registration": "SMS OTP Registration",
|
||||
"Whatsapp_Notification": "Whatsapp Notification",
|
||||
"Email_Notification": "Email Notification",
|
||||
"Expired_Notification": "Expired Notification",
|
||||
"User_will_get_notification_when_package_expired": "User will get notification when package expired",
|
||||
"Payment_Notification": "Payment Notification",
|
||||
"User_will_get_invoice_notification_when_buy_package_or_package_refilled": "User will get invoice notification when buy package or package refilled",
|
||||
"Reminder_Notification": "Reminder Notification",
|
||||
"Tawk_to_Chat_Widget": "Tawk.to Chat Widget",
|
||||
"This_Token_will_act_as_SuperAdmin_Admin": "This Token will act as SuperAdmin\/Admin",
|
||||
"Invoice": "Invoice",
|
||||
"Country_Code_Phone": "Country Code Phone",
|
||||
"Voucher_activation_menu_will_be_hidden": "Voucher activation menu will be hidden",
|
||||
"Customer_can_deposit_money_to_buy_voucher": "Customer can deposit money to buy voucher",
|
||||
"Allow_balance_transfer_between_customers": "Allow balance transfer between customers",
|
||||
"Reminder_Notification": "Reminder Notification",
|
||||
"Reminder_Notification_Message": "Reminder Notification Message",
|
||||
"Reminder_7_days": "Reminder 7 days",
|
||||
"Reminder_3_days": "Reminder 3 days",
|
||||
"Reminder_1_day": "Reminder 1 day",
|
||||
"PPPOE_Password": "PPPOE Password",
|
||||
"User_Cannot_change_this__only_admin__if_it_Empty_it_will_use_user_password": "User Cannot change this, only admin. if it Empty it will use user password",
|
||||
"Invoice_Balance_Message": "Invoice Balance Message",
|
||||
"Invoice_Notification_Payment": "Invoice Notification Payment",
|
||||
"Balance_Notification_Payment": "Balance Notification Payment",
|
||||
"Balance_Plans": "Balance Plans",
|
||||
"Buy_Balance": "Buy Balance",
|
||||
"Price": "Price",
|
||||
"Validity": "Validity",
|
||||
"Disable_auto_renewal_": "Disable auto renewal?",
|
||||
"Auto_Renewal_On": "Auto Renewal On",
|
||||
"Enable_auto_renewal_": "Enable auto renewal?",
|
||||
"Auto_Renewal_Off": "Auto Renewal Off",
|
||||
"Refill_Balance": "Refill Balance",
|
||||
"Invoice_Footer": "Invoice Footer",
|
||||
"Pay_With_Balance": "Pay With Balance",
|
||||
"Pay_this_with_Balance__your_active_package_will_be_overwrite": "Pay this with Balance? your active package will be overwrite",
|
||||
"Success_to_buy_package": "Success to buy package",
|
||||
"Auto_Renewal": "Auto Renewal",
|
||||
"View": "View",
|
||||
"Back": "Back",
|
||||
"Active": "Active",
|
||||
"Transfer_Balance": "Transfer Balance",
|
||||
"Send_your_balance_": "Send your balance?",
|
||||
"Send": "Send",
|
||||
"Cannot_send_to_yourself": "Cannot send to yourself",
|
||||
"Sending_balance_success": "Sending balance success",
|
||||
"From": "From",
|
||||
"To": "To",
|
||||
"insufficient_balance": "insufficient balance",
|
||||
"Send_Balance": "Send Balance",
|
||||
"Received_Balance": "Received Balance",
|
||||
"Minimum_Balance_Transfer": "Minimum Balance Transfer",
|
||||
"Minimum_Transfer": "Minimum Transfer",
|
||||
"Company_Logo": "Company Logo",
|
||||
"Expired_IP_Pool": "Expired IP Pool",
|
||||
"Proxy": "Proxy",
|
||||
"Proxy_Server": "Proxy Server",
|
||||
"Proxy_Server_Login": "Proxy Server Login",
|
||||
"Hotspot_Plan": "Hotspot Plan",
|
||||
"PPPOE_Plan": "PPPOE Plan",
|
||||
"UNKNOWN": "UNKNOWN",
|
||||
"Are_You_Sure_": "Are You Sure?",
|
||||
"Success_to_send_package": "Success to send package",
|
||||
"Target_has_active_plan__different_with_current_plant_": "Target has active plan, different with current plant.",
|
||||
"Recharge_a_friend": "Recharge a friend",
|
||||
"Buy_for_friend": "Buy for friend",
|
||||
"Buy_this_for_friend_account_": "Buy this for friend account?",
|
||||
"Review_package_before_recharge": "Review package before recharge",
|
||||
"Activate": "Activate",
|
||||
"Deactivate": "Deactivate",
|
||||
"Sync": "Sync",
|
||||
"Failed_to_create_PaymeTrust_transaction_": "Failed to create PaymeTrust transaction.",
|
||||
"Location": "Location",
|
||||
"Radius_Plans": "Radius Plans",
|
||||
"Change_title_in_user_Plan_order": "Change title in user Plan order",
|
||||
"Logs": "Logs",
|
||||
"Voucher_Format": "Voucher Format",
|
||||
"Resend_To_Customer": "Resend To Customer",
|
||||
"Your_friend_do_not_have_active_package": "Your friend do not have active package",
|
||||
"Service_Type": "Service Type",
|
||||
"Others": "Others",
|
||||
"PPPoE": "PPPoE",
|
||||
"Hotspot": "Hotspot",
|
||||
"Disable_Registration": "Disable Registration",
|
||||
"Customer_just_Login_with_Phone_number_and_Voucher_Code__Voucher_will_be_password": "Customer just Login with Phone number and Voucher Code, Voucher will be password",
|
||||
"Login___Activate_Voucher": "Login \/ Activate Voucher",
|
||||
"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",
|
||||
"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",
|
||||
"Monthly_Registered_Customers": "Monthly Registered Customers",
|
||||
"Total_Monthly_Sales": "Total Monthly Sales",
|
||||
"Active_Users": "Active Users",
|
||||
"All_Users_Insights": "All Users Insights",
|
||||
"SuperAdmin": "Super Admin",
|
||||
"Radius": "Radius",
|
||||
"Radius_NAS": "Radius NAS",
|
||||
"Translation": "Translation",
|
||||
"Translation_saved_Successfully": "Translation saved Successfully",
|
||||
"Language_Editor": "Language Editor",
|
||||
"year": "year",
|
||||
"month": "month",
|
||||
"week": "week",
|
||||
"day": "day",
|
||||
"hour": "hour",
|
||||
"minute": "minute",
|
||||
"second": "second",
|
||||
"Attributes": "Attributes",
|
||||
"Profile": "Profile",
|
||||
"Phone": "Phone",
|
||||
"City": "City",
|
||||
"Sub_District": "Sub District",
|
||||
"Ward": "Ward",
|
||||
"Credentials": "Credentials",
|
||||
"Agent": "Agent",
|
||||
"This_Token_will_act_as_SuperAdmin_Admin": "This Token will act as SuperAdmin\/Admin",
|
||||
"Login": "Login",
|
||||
"Expired_Action": "Expired Action",
|
||||
"Expired_Address_List_Name": "Expired Address List Name",
|
||||
"Address_List": "Address List",
|
||||
"Optional": "Optional",
|
||||
"Generated_By": "Generated By",
|
||||
"Admin": "Admin",
|
||||
"Password_should_be_minimum_6_characters": "Password should be minimum 6 characters",
|
||||
"Add_User": "Add User",
|
||||
"Send_Notification": "Send Notification",
|
||||
"Code": "Code",
|
||||
"Send_To_Customer": "Send To Customer",
|
||||
"Prev": "Prev",
|
||||
"Voucher_Not_Found": "Voucher Not Found",
|
||||
"Miscellaneous": "Miscellaneous",
|
||||
"OTP_Required": "OTP Required",
|
||||
"Change": "Change",
|
||||
"Change_Phone_Number": "Change Phone Number",
|
||||
"Current_Number": "Current Number",
|
||||
"New_Number": "New Number",
|
||||
"Input_your_phone_number": "Input your phone number",
|
||||
"OTP": "OTP",
|
||||
"Enter_OTP_that_was_sent_to_your_phone": "Enter OTP that was sent to your phone",
|
||||
"Update": "Update",
|
||||
"OTP_is_required_when_user_want_to_change_phone_number": "OTP is required when user want to change phone number",
|
||||
"Rate": "Rate",
|
||||
"Burst": "Burst",
|
||||
"Editing_Bandwidth_will_not_automatically_update_the_plan__you_need_to_edit_the_plan_then_save_again": "Editing Bandwidth will not automatically update the plan, you need to edit the plan then save again",
|
||||
"OTP_Method": "OTP Method",
|
||||
"SMS": "SMS",
|
||||
"WhatsApp": "WhatsApp",
|
||||
"SMS_and_WhatsApp": "SMS and WhatsApp",
|
||||
"The_method_which_OTP_will_be_sent_to_user": "The method which OTP will be sent to user",
|
||||
"Report_Viewer": "Report Viewer",
|
||||
"Super_Administrator": "Super Administrator",
|
||||
"Send_To": "Send To",
|
||||
"Resend": "Resend",
|
||||
"Alert": "Alert",
|
||||
"success": "success",
|
||||
"Click_Here": "Click Here",
|
||||
"danger": "danger",
|
||||
"Logout_Successful": "Logout Successful",
|
||||
"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",
|
||||
"Not_Found": "Not Found",
|
||||
"Cash": "Cash",
|
||||
"Payment_not_found": "Payment not found",
|
||||
"If_your_friend_have_Additional_Cost__you_will_pay_for_that_too": "If your friend have Additional Cost, you will pay for that too",
|
||||
"Cache_cleared_successfully_": "Cache cleared successfully!",
|
||||
"Paid": "Paid",
|
||||
"Send_Message": "Send Message",
|
||||
"Send_Personal_Message": "Send Personal Message",
|
||||
"Send_Via": "Send Via",
|
||||
"Compose_your_message___": "Compose your message...",
|
||||
"Use_placeholders_": "Use placeholders:",
|
||||
"Customer_Name": "Customer Name",
|
||||
"Customer_Username": "Customer Username",
|
||||
"Customer_Phone": "Customer Phone",
|
||||
"Your_Company_Name": "Your Company Name",
|
||||
"Message_Sent_Successfully": "Message Sent Successfully",
|
||||
"Send_Bulk_Message": "Send Bulk Message",
|
||||
"Group": "Group",
|
||||
"All_Customers": "All Customers",
|
||||
"New_Customers": "New Customers",
|
||||
"Expired_Customers": "Expired Customers",
|
||||
"Active_Customers": "Active Customers",
|
||||
"Map": "Map",
|
||||
"Customer_Location": "Customer Location",
|
||||
"Account_Type": "Account Type",
|
||||
"Coordinates": "Coordinates",
|
||||
"Latitude_and_Longitude_coordinates_for_map_must_be_separate_with_comma____": "Latitude and Longitude coordinates for map must be separate with comma ","",
|
||||
"Customer_Geo_Location_Information": "Customer Geo Location Information",
|
||||
"List": "List",
|
||||
"Lists": "Lists",
|
||||
"Single_Customer": "Single Customer",
|
||||
"Bulk_Customers": "Bulk Customers",
|
||||
"Message_per_time": "Message per time",
|
||||
"5_Messages": "5 Messages",
|
||||
"10_Messages": "10 Messages",
|
||||
"15_Messages": "15 Messages",
|
||||
"20_Messages": "20 Messages",
|
||||
"30_Messages": "30 Messages",
|
||||
"40_Messages": "40 Messages",
|
||||
"50_Messages": "50 Messages",
|
||||
"60_Messages": "60 Messages",
|
||||
"Use_20_and_above_if_you_are_sending_to_all_customers_to_avoid_server_time_out": "Use 20 and above if you are sending to all customers to avoid server time out",
|
||||
"Delay": "Delay",
|
||||
"No_Delay": "No Delay",
|
||||
"5_Seconds": "5 Seconds",
|
||||
"10_Seconds": "10 Seconds",
|
||||
"15_Seconds": "15 Seconds",
|
||||
"20_Seconds": "20 Seconds",
|
||||
"Use_at_least_5_secs_if_you_are_sending_to_all_customers_to_avoid_being_banned_by_your_message_provider": "Use at least 5 secs if you are sending to all customers to avoid being banned by your message provider",
|
||||
"Testing__if_checked_no_real_message_is_sent_": "Testing [if checked no real message is sent]",
|
||||
"All_fields_are_required": "All fields are required",
|
||||
"Personal": "Personal",
|
||||
"Email_Notification": "Email Notification",
|
||||
"Router_Name___Location": "Router Name \/ Location",
|
||||
"Plan_Category": "Plan Category",
|
||||
"ID": "ID",
|
||||
"Internet_Plan": "Internet Plan",
|
||||
"Privacy_Policy": "Privacy Policy",
|
||||
"Terms_and_Conditions": "Terms and Conditions",
|
||||
"Contact": "Contact",
|
||||
"will_be_replaced_with_Customer_Name": "will be replaced with Customer Name",
|
||||
"will_be_replaced_with_Customer_username": "will be replaced with Customer username",
|
||||
"will_be_replaced_with_Package_name": "will be replaced with Package name",
|
||||
"will_be_replaced_with_Package_price": "will be replaced with Package price",
|
||||
"additional_bills_for_customers": "additional bills for customers",
|
||||
"will_be_replaced_with_Expiration_date": "will be replaced with Expiration date",
|
||||
"Your_Company_Name_at_Settings": "Your Company Name at Settings",
|
||||
"Your_Company_Address_at_Settings": "Your Company Address at Settings",
|
||||
"Your_Company_Phone_at_Settings": "Your Company Phone at Settings",
|
||||
"Invoice_number": "Invoice number",
|
||||
"Date_invoice_created": "Date invoice created",
|
||||
"Payment_gateway_user_paid_from": "Payment gateway user paid from",
|
||||
"Payment_channel_user_paid_from": "Payment channel user paid from",
|
||||
"is_Hotspot_or_PPPOE": "is Hotspot or PPPOE",
|
||||
"Internet_Package": "Internet Package",
|
||||
"Internet_Package_Prices": "Internet Package Prices",
|
||||
"Receiver_name": "Receiver name",
|
||||
"Username_internet": "Username internet",
|
||||
"User_password": "User password",
|
||||
"Expired_datetime": "Expired datetime",
|
||||
"For_Notes_by_admin": "For Notes by admin",
|
||||
"Transaction_datetime": "Transaction datetime",
|
||||
"Balance_Before": "Balance Before",
|
||||
"Balance_After": "Balance After",
|
||||
"how_much_balance_have_been_send": "how much balance have been send",
|
||||
"Current_Balance": "Current Balance",
|
||||
"Sender_name": "Sender name",
|
||||
"how_much_balance_have_been_received": "how much balance have been received",
|
||||
"Extend_Postpaid_Expiration": "Extend Postpaid Expiration",
|
||||
"Allow_Extend": "Allow Extend",
|
||||
"Extend_Days": "Extend Days",
|
||||
"Confirmation_Message": "Confirmation Message",
|
||||
"You_are_already_logged_in": "You are already logged in",
|
||||
"Extend": "Extend",
|
||||
"Created___Expired": "Created \/ Expired",
|
||||
"Bank_Transfer": "Bank Transfer",
|
||||
"Recharge_Using": "Recharge Using",
|
||||
"ago": "ago",
|
||||
"Disabled": "Disabled",
|
||||
"Banned": "Banned",
|
||||
"Customer_cannot_login_again": "Customer cannot login again",
|
||||
"Customer_can_login_but_cannot_buy_internet_plan__Admin_cannot_recharge_customer": "Customer can login but cannot buy internet plan, Admin cannot recharge customer",
|
||||
"Don_t_forget_to_deactivate_all_active_plan_too": "Don't forget to deactivate all active plan too",
|
||||
"Ascending": "Ascending",
|
||||
"Descending": "Descending",
|
||||
"Created_Date": "Created Date",
|
||||
"Inactive": "Inactive",
|
||||
"Suspended": "Suspended",
|
||||
"Query": "Query",
|
||||
"Notes": "Notes",
|
||||
"This_account_status": "This account status",
|
||||
"Maintenance_Mode": "Maintenance Mode",
|
||||
"Maintenance_Mode_Settings": "Maintenance Mode Settings",
|
||||
"Status_": "Status:",
|
||||
"End_Date_": "End Date:",
|
||||
"Save": "Save",
|
||||
"Site_is_temporarily_unavailable_": "Site is temporarily unavailable.",
|
||||
"Scheduled_maintenance_is_currently_in_progress__Please_check_back_soon_": "Scheduled maintenance is currently in progress. Please check back soon.",
|
||||
"We_apologize_for_any_inconvenience_": "We apologize for any inconvenience.",
|
||||
"The": "The",
|
||||
"Team": "Team",
|
||||
"Extend_Package_Expiry": "Extend Package Expiry",
|
||||
"Yes": "Yes",
|
||||
"No": "No",
|
||||
"Yes": "Yes",
|
||||
"If_user_buy_same_internet_plan__expiry_date_will_extend": "If user buy same internet plan, expiry date will extend",
|
||||
"Tax_System": "Tax System",
|
||||
"Enable_Tax_System": "Enable Tax System",
|
||||
"Tax_will_be_calculated_in_Internet_Plan_Price": "Tax will be calculated in Internet Plan Price",
|
||||
"Tax_Rate": "Tax Rate",
|
||||
"0_5_": "0.5%",
|
||||
"1_": "1%",
|
||||
"1_5_": "1.5%",
|
||||
"2_": "2%",
|
||||
"5_": "5%",
|
||||
"10_": "10%",
|
||||
"Custom": "Custom",
|
||||
"Tax_Rates_in_percentage": "Tax Rates in percentage",
|
||||
"Custom_Tax_Rate": "Custom Tax Rate",
|
||||
"Enter_Custom_Tax_Rate": "Enter Custom Tax Rate",
|
||||
"Enter_the_custom_tax_rate__e_g___3_75_for_3_75__": "Enter the custom tax rate (e.g., 3.75 for 3.75%)",
|
||||
"Timezone": "Timezone",
|
||||
"Date_Format": "Date Format",
|
||||
"Default_Language": "Default Language",
|
||||
"Language_Editor": "Language Editor",
|
||||
"Decimal_Point": "Decimal Point",
|
||||
"Thousands_Separator": "Thousands Separator",
|
||||
"Currency_Code": "Currency Code",
|
||||
"Keep_it_blank_if_you_do_not_want_to_show_currency_code": "Keep it blank if you do not want to show currency code",
|
||||
"Country_Code_Phone": "Country Code Phone",
|
||||
"Change_title_in_user_Plan_order": "Change title in user Plan order"
|
||||
"Additional_Information": "Additional Information",
|
||||
"City_of_Resident": "City of Resident",
|
||||
"District": "District",
|
||||
"State": "State",
|
||||
"State_of_Resident": "State of Resident",
|
||||
"Zip": "Zip",
|
||||
"Zip_Code": "Zip Code",
|
||||
"Local_IP": "Local IP",
|
||||
"Device": "Device",
|
||||
"Expired_Internet_Plan": "Expired Internet Plan",
|
||||
"When_Expired__customer_will_be_move_to_selected_internet_plan": "When Expired, customer will be move to selected internet plan",
|
||||
"Plugin_Installer": "Plugin Installer",
|
||||
"Expired_Date": "Expired Date",
|
||||
"Expired": "Expired",
|
||||
"Time": "Time",
|
||||
"Data": "Data",
|
||||
"Category": "Category",
|
||||
"later": "later",
|
||||
"Package_Details": "Package Details",
|
||||
"Summary": "Summary",
|
||||
"Devices_Not_Found": "Devices Not Found",
|
||||
"Income_reset_date": "Income reset date",
|
||||
"Devices": "Devices",
|
||||
"Documentation": "Documentation",
|
||||
"Hotspot_Auth_Method": "Hotspot Auth Method",
|
||||
"Api": "Api",
|
||||
"Http_Chap": "Http-Chap",
|
||||
"Hotspot_Authentication_Method__Make_sure_you_have_changed_your_hotspot_login_page_": "Hotspot Authentication Method. Make sure you have changed your hotspot login page.",
|
||||
"Business": "Business",
|
||||
"Source": "Source",
|
||||
"Destination": "Destination",
|
||||
"Activate_Voucher": "Activate Voucher",
|
||||
"Voucher_invalid": "Voucher invalid",
|
||||
"Account_Not_Found": "Account Not Found",
|
||||
"Internet_Voucher_Expired": "Internet Voucher Expired",
|
||||
"": "",
|
||||
"Additional_Billing": "Additional Billing",
|
||||
"_": "-",
|
||||
"Used_Date": "Used Date",
|
||||
"Filter": "Filter",
|
||||
"Start_time": "Start time",
|
||||
"End_Time": "End Time",
|
||||
"Internet_Plans": "Internet Plans",
|
||||
"Methods": "Methods",
|
||||
"Hap_Lite": "Hap Lite",
|
||||
"balance": "balance",
|
||||
"radius": "radius",
|
||||
"Start_Date": "Start Date",
|
||||
"End_Date": "End Date"
|
||||
}
|
@ -561,5 +561,11 @@
|
||||
"Please_wait_1015_seconds_before_sending_another_SMS": "Harap tunggu 1015 detik sebelum mengirim SMS lainnya",
|
||||
"Phone_number_updated_successfully": "Nomor telepon berhasil diperbarui",
|
||||
"You_cannot_use_your_current_phone_number": "Anda tidak dapat menggunakan nomor telepon Anda saat ini",
|
||||
"Devices": "Perangkat"
|
||||
"Devices": "Perangkat",
|
||||
"Voucher_Prefix": "Awalan Voucher",
|
||||
"This_account_status": "Status akun ini",
|
||||
"Hotspot_Auth_Method": "Metode Otentikasi Hotspot",
|
||||
"Api": "Api",
|
||||
"Http_Chap": "Http-Bab",
|
||||
"Hotspot_Authentication_Method__Make_sure_you_have_changed_your_hotspot_login_page_": "Metode Otentikasi Hotspot. Pastikan Anda telah mengubah halaman login hotspot Anda."
|
||||
}
|
@ -120,5 +120,14 @@
|
||||
"2024.6.21" : [
|
||||
"ALTER TABLE `tbl_plans` ADD `on_login` TEXT NULL DEFAULT NULL AFTER `device`;",
|
||||
"ALTER TABLE `tbl_plans` ADD `on_logout` TEXT NULL DEFAULT NULL AFTER `on_login`;"
|
||||
],
|
||||
"2024.7.6" : [
|
||||
"CREATE TABLE IF NOT EXISTS `rad_acct` ( `id` bigint NOT NULL, `acctsessionid` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `username` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `realm` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `nasid` varchar(32) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `nasipaddress` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `nasportid` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, `nasporttype` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, `framedipaddress` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',`acctstatustype` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, `macaddr` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `dateAdded` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;",
|
||||
"ALTER TABLE `rad_acct` ADD PRIMARY KEY (`id`), ADD KEY `username` (`username`), ADD KEY `framedipaddress` (`framedipaddress`), ADD KEY `acctsessionid` (`acctsessionid`), ADD KEY `nasipaddress` (`nasipaddress`);",
|
||||
"ALTER TABLE `rad_acct` MODIFY `id` bigint NOT NULL AUTO_INCREMENT;"
|
||||
],
|
||||
"2024.7.24" : [
|
||||
"ALTER TABLE `tbl_voucher` ADD `used_date` DATETIME NULL DEFAULT NULL AFTER `status`;",
|
||||
"UPDATE `tbl_voucher` SET `used_date`=now() WHERE `status`=1;"
|
||||
]
|
||||
}
|
@ -476,6 +476,8 @@
|
||||
{/if}>Whatsapp</option>
|
||||
<option value="sms" {if $_c['user_notification_expired']=='sms' }selected="selected"
|
||||
{/if}>SMS</option>
|
||||
<option value="email" {if $_c['user_notification_expired']=='email' }selected="selected"
|
||||
{/if}>Email</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="help-block col-md-4">{Lang::T('User will get notification when package expired')}</p>
|
||||
@ -490,6 +492,8 @@
|
||||
{/if}>Whatsapp</option>
|
||||
<option value="sms" {if $_c['user_notification_payment']=='sms' }selected="selected"
|
||||
{/if}>SMS</option>
|
||||
<option value="email" {if $_c['user_notification_payment']=='email' }selected="selected"
|
||||
{/if}>Email</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="help-block col-md-4">
|
||||
@ -505,6 +509,8 @@
|
||||
{/if}>Whatsapp</option>
|
||||
<option value="sms" {if $_c['user_notification_reminder']=='sms' }selected="selected"
|
||||
{/if}>SMS</option>
|
||||
<option value="sms" {if $_c['user_notification_reminder']=='email' }selected="selected"
|
||||
{/if}>Email</option>
|
||||
</select>
|
||||
</div>
|
||||
</div>
|
||||
@ -580,6 +586,18 @@
|
||||
{Lang::T('Miscellaneous')}
|
||||
</div>
|
||||
<div class="panel-body">
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('New Version Notification')}</label>
|
||||
<div class="col-md-6">
|
||||
<select name="new_version_notify" id="new_version_notify" class="form-control">
|
||||
<option value="enable" {if $_c['new_version_notify']=='enable' }selected="selected" {/if}>{Lang::T('Enabled')}
|
||||
</option>
|
||||
<option value="disable" {if $_c['new_version_notify']=='disable' }selected="selected" {/if}>{Lang::T('Disabled')}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="help-block col-md-4">{Lang::T('This is to notify you when new updates is available')}</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('OTP Required')}</label>
|
||||
<div class="col-md-6">
|
||||
@ -621,6 +639,24 @@
|
||||
<p class="help-block col-md-4">
|
||||
{Lang::T('If user buy same internet plan, expiry date will extend')}</p>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<label class="col-md-2 control-label">{Lang::T('Hotspot Auth Method')}</label>
|
||||
<div class="col-md-6">
|
||||
<select name="hs_auth_method" id="auth_method" class="form-control">
|
||||
<option value="api" {if $_c['hs_auth_method']=='api' }selected="selected" {/if}>
|
||||
{Lang::T('Api')}
|
||||
</option>
|
||||
<option value="hchap" {if $_c['hs_auth_method']=='hchap' }selected="selected" {/if}>
|
||||
{Lang::T('Http-Chap')}
|
||||
</option>
|
||||
</select>
|
||||
</div>
|
||||
<p class="help-block col-md-4">
|
||||
{Lang::T('Hotspot Authentication Method. Make sure you have changed your hotspot login page.')}<br><a
|
||||
href="https://github.com/agstrxyz/phpnuxbill-login-hotspot" target="_blank">Download
|
||||
phpnuxbill-login-hotspot</a>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="panel-heading">
|
||||
|
@ -1,6 +1,5 @@
|
||||
{include file="sections/header.tpl"}
|
||||
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-3 col-xs-6">
|
||||
<div class="small-box bg-aqua">
|
||||
@ -22,7 +21,7 @@
|
||||
<h4><sup>{$_c['currency_code']}</sup>
|
||||
{number_format($imonth,0,$_c['dec_point'],$_c['thousands_sep'])}</h4>
|
||||
|
||||
<p title="from {$first_day_month}">{Lang::T('Income This Month')}</p>
|
||||
<p>{Lang::T('Income This Month')}</p>
|
||||
</div>
|
||||
<div class="icon">
|
||||
<i class="ion ion-stats-bars"></i>
|
||||
@ -60,6 +59,10 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ol class="breadcrumb">
|
||||
<li>{Lang::dateFormat($start_date)}</li>
|
||||
<li>{Lang::dateFormat($current_date)}</li>
|
||||
</ol>
|
||||
<div class="row">
|
||||
<div class="col-md-7">
|
||||
|
||||
@ -156,7 +159,8 @@
|
||||
<tr>
|
||||
<td><a href="{$_url}customers/viewu/{$expired['username']}">{$expired['username']}</a></td>
|
||||
<td><small data-toggle="tooltip" data-placement="top"
|
||||
title="{Lang::dateAndTimeFormat($expired['recharged_on'],$expired['recharged_time'])}">{Lang::timeElapsed($rem_started)}</small> /
|
||||
title="{Lang::dateAndTimeFormat($expired['recharged_on'],$expired['recharged_time'])}">{Lang::timeElapsed($rem_started)}</small>
|
||||
/
|
||||
<span data-toggle="tooltip" data-placement="top"
|
||||
title="{Lang::dateAndTimeFormat($expired['expiration'],$expired['time'])}">{Lang::timeElapsed($rem_exp)}</span>
|
||||
</td>
|
||||
@ -176,7 +180,7 @@
|
||||
<div class="col-md-5">
|
||||
{if $_c['hide_pg'] != 'yes'}
|
||||
<div class="panel panel-success panel-hovered mb20 activities">
|
||||
<div class="panel-heading">{Lang::T('Payment Gateway')}: {$_c['payment_gateway']}</div>
|
||||
<div class="panel-heading">{Lang::T('Payment Gateway')}: {str_replace(',',', ',$_c['payment_gateway'])}</div>
|
||||
</div>
|
||||
{/if}
|
||||
{if $_c['hide_aui'] != 'yes'}
|
||||
@ -372,42 +376,45 @@
|
||||
{/literal}
|
||||
{/if}
|
||||
</script>
|
||||
<script>
|
||||
window.addEventListener('DOMContentLoaded', function() {
|
||||
$.getJSON("./version.json?" + Math.random(), function(data) {
|
||||
var localVersion = data.version;
|
||||
$('#version').html('Version: ' + localVersion);
|
||||
$.getJSON(
|
||||
"https://raw.githubusercontent.com/hotspotbilling/phpnuxbill/master/version.json?" +
|
||||
Math
|
||||
.random(),
|
||||
function(data) {
|
||||
var latestVersion = data.version;
|
||||
if (localVersion !== latestVersion) {
|
||||
$('#version').html('Latest Version: ' + latestVersion);
|
||||
if(getCookie(latestVersion) != 'done'){
|
||||
Swal.fire({
|
||||
icon: 'info',
|
||||
title: "New Version Available\nVersion: "+latestVersion,
|
||||
toast: true,
|
||||
position: 'bottom-right',
|
||||
showConfirmButton: true,
|
||||
showCloseButton: true,
|
||||
timer: 30000,
|
||||
confirmButtonText: '<a href="{$_url}community#latestVersion" style="color: white;">Update Now</a>',
|
||||
timerProgressBar: true,
|
||||
didOpen: (toast) => {
|
||||
toast.addEventListener('mouseenter', Swal.stopTimer)
|
||||
toast.addEventListener('mouseleave', Swal.resumeTimer)
|
||||
}
|
||||
});
|
||||
setCookie(latestVersion, 'done', 7);
|
||||
{if $_c['new_version_notify'] != 'disable'}
|
||||
<script>
|
||||
window.addEventListener('DOMContentLoaded', function() {
|
||||
$.getJSON("./version.json?" + Math.random(), function(data) {
|
||||
var localVersion = data.version;
|
||||
$('#version').html('Version: ' + localVersion);
|
||||
$.getJSON(
|
||||
"https://raw.githubusercontent.com/hotspotbilling/phpnuxbill/master/version.json?" +
|
||||
Math
|
||||
.random(),
|
||||
function(data) {
|
||||
var latestVersion = data.version;
|
||||
if (localVersion !== latestVersion) {
|
||||
$('#version').html('Latest Version: ' + latestVersion);
|
||||
if (getCookie(latestVersion) != 'done') {
|
||||
Swal.fire({
|
||||
icon: 'info',
|
||||
title: "New Version Available\nVersion: " + latestVersion,
|
||||
toast: true,
|
||||
position: 'bottom-right',
|
||||
showConfirmButton: true,
|
||||
showCloseButton: true,
|
||||
timer: 30000,
|
||||
confirmButtonText: '<a href="{$_url}community#latestVersion" style="color: white;">Update Now</a>',
|
||||
timerProgressBar: true,
|
||||
didOpen: (toast) => {
|
||||
toast.addEventListener('mouseenter', Swal.stopTimer)
|
||||
toast.addEventListener('mouseleave', Swal
|
||||
.resumeTimer)
|
||||
}
|
||||
});
|
||||
setCookie(latestVersion, 'done', 7);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
});
|
||||
</script>
|
||||
});
|
||||
</script>
|
||||
{/if}
|
||||
|
||||
{include file="sections/footer.tpl"}
|
@ -248,20 +248,24 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">on-login / on-up</div>
|
||||
<div class="panel-body">
|
||||
<textarea class="form-control" id="code" name="on_login" style="font-family: 'Courier New', Courier, monospace;" rows="15">{$d['on_login']}</textarea>
|
||||
{if !$d['is_radius']}
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">on-login / on-up</div>
|
||||
<div class="panel-body">
|
||||
<textarea class="form-control" id="code" name="on_login"
|
||||
style="font-family: 'Courier New', Courier, monospace;" rows="15">{$d['on_login']}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">on-logout / on-down</div>
|
||||
<div class="panel-body">
|
||||
<textarea class="form-control" id="code2" name="on_logout"
|
||||
style="font-family: 'Courier New', Courier, monospace;" rows="15">{$d['on_logout']}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">on-logout / on-down</div>
|
||||
<div class="panel-body">
|
||||
<textarea class="form-control" id="code2" name="on_logout" style="font-family: 'Courier New', Courier, monospace;" rows="15">{$d['on_logout']}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-md-offset-2 col-md-9">
|
||||
@ -306,11 +310,17 @@
|
||||
{/literal}
|
||||
{/if}
|
||||
|
||||
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.js"></script>
|
||||
<script language="javascript" type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/mode/perl/perl.min.js"></script>
|
||||
<script language="javascript" type="text/javascript"
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.js"></script>
|
||||
<script language="javascript" type="text/javascript"
|
||||
src="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/mode/perl/perl.min.js"></script>
|
||||
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.css"></link>
|
||||
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/theme/abbott.min.css"></link>
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/codemirror.min.css">
|
||||
</link>
|
||||
<link rel="stylesheet" type="text/css"
|
||||
href="https://cdnjs.cloudflare.com/ajax/libs/codemirror/6.65.7/theme/abbott.min.css">
|
||||
</link>
|
||||
|
||||
<script>
|
||||
CodeMirror.fromTextArea(document.getElementById('code'), {
|
||||
|
@ -85,7 +85,13 @@
|
||||
<tbody>
|
||||
{foreach $d as $ds}
|
||||
<tr {if $ds['status']=='off'}class="danger" {/if}>
|
||||
<td><a href="{$_url}customers/viewu/{$ds['username']}">{$ds['username']}</a></td>
|
||||
<td>
|
||||
{if $ds['customer_id'] == '0'}
|
||||
<a href="{$_url}plan/voucher/&search={$ds['username']}">{$ds['username']}</a>
|
||||
{else}
|
||||
<a href="{$_url}customers/viewu/{$ds['username']}">{$ds['username']}</a>
|
||||
{/if}
|
||||
</td>
|
||||
{if $ds['type'] == 'Hotspot'}
|
||||
<td><a href="{$_url}services/edit/{$ds['plan_id']}">{$ds['namebp']}</a></td>
|
||||
{else}
|
||||
|
@ -184,22 +184,24 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">on-login / on-up</div>
|
||||
<div class="panel-body">
|
||||
<textarea class="form-control" id="code" name="on_login"
|
||||
style="font-family: 'Courier New', Courier, monospace;" rows="15">{$d['on_login']}</textarea>
|
||||
{if !$d['is_radius']}
|
||||
<div class="col-md-6">
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">on-login / on-up</div>
|
||||
<div class="panel-body">
|
||||
<textarea class="form-control" id="code" name="on_login"
|
||||
style="font-family: 'Courier New', Courier, monospace;" rows="15">{$d['on_login']}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">on-logout / on-down</div>
|
||||
<div class="panel-body">
|
||||
<textarea class="form-control" id="code2" name="on_logout"
|
||||
style="font-family: 'Courier New', Courier, monospace;" rows="15">{$d['on_logout']}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-primary panel-hovered panel-stacked mb30">
|
||||
<div class="panel-heading">on-logout / on-down</div>
|
||||
<div class="panel-body">
|
||||
<textarea class="form-control" id="code2" name="on_logout"
|
||||
style="font-family: 'Courier New', Courier, monospace;" rows="15">{$d['on_logout']}</textarea>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/if}
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<div class="col-lg-offset-2 col-lg-10">
|
||||
|
@ -22,7 +22,7 @@
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div id="printable">
|
||||
<h4>{Lang::T('All Transactions at Date')}: {date($_c['date_format'], strtotime($mdate))}</h4>
|
||||
<h4>{Lang::T('All Transactions at Date')}: {Lang::dateAndTimeFormat($sd, $ts)} - {Lang::dateAndTimeFormat($ed, $te)}</h4>
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-condensed table-bordered" style="background: #ffffff">
|
||||
<th class="text-center">{Lang::T('Username')}</th>
|
||||
@ -55,7 +55,7 @@
|
||||
<button type="button" id="actprint" class="btn btn-default btn-sm no-print">{Lang::T('Click Here to Print')}</button>
|
||||
</div>
|
||||
</div>
|
||||
<script src="ui/ui/scripts/jquery-1.10.2.js"></script>
|
||||
<script src="ui/ui/scripts/jquery.min.js"></script>
|
||||
<script src="ui/ui/scripts/bootstrap.min.js"></script>
|
||||
{if isset($xfooter)}
|
||||
{$xfooter}
|
||||
|
@ -55,7 +55,7 @@
|
||||
<button type="button" id="actprint" class="btn btn-default btn-sm no-print">{Lang::T('Click Here to Print')}</button>
|
||||
</div>
|
||||
</div>
|
||||
<script src="ui/ui/scripts/jquery-1.10.2.js"></script>
|
||||
<script src="ui/ui/scripts/jquery.min.js"></script>
|
||||
<script src="ui/ui/scripts/bootstrap.min.js"></script>
|
||||
{if isset($xfooter)}
|
||||
{$xfooter}
|
||||
|
@ -117,7 +117,7 @@
|
||||
{/foreach}
|
||||
</div>
|
||||
</page>
|
||||
<script src="ui/ui/scripts/jquery-1.10.2.js"></script>
|
||||
<script src="ui/ui/scripts/jquery.min.js"></script>
|
||||
{if isset($xfooter)}
|
||||
{$xfooter}
|
||||
{/if}
|
||||
|
@ -65,6 +65,10 @@
|
||||
</table>
|
||||
</div>
|
||||
{include file="pagination.tpl"}
|
||||
<div class="bs-callout bs-callout-info" id="callout-navbar-role">
|
||||
<h4>RADIUS REST</h4>
|
||||
<p>For Radius REST, you don't need to add NAS, NAS need to add to client.conf manually</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -1,29 +1,65 @@
|
||||
{include file="sections/header.tpl"}
|
||||
<!-- reports-daily -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="invoice-wrap">
|
||||
<div class="clearfix invoice-head">
|
||||
<h3 class="brand-logo text-uppercase text-bold left mt15">
|
||||
<span class="text">{Lang::T('Daily Reports')}</span>
|
||||
</h3>
|
||||
</div>
|
||||
<div class="clearfix invoice-subhead mb20">
|
||||
<div class="group clearfix left">
|
||||
<p class="text-bold mb5">{Lang::T('All Transactions at Date')}:</p>
|
||||
<p class="small">{date($_c['date_format'], strtotime($mdate))} {$mtime}</p>
|
||||
<div class="col-lg-3">
|
||||
<form method="get" class="form">
|
||||
<div class="box box-primary box-solid">
|
||||
<div class="box-header" onclick="showFilter()" style=" cursor: pointer;">
|
||||
<h3 class="box-title">{Lang::T('Filter')}</h3>
|
||||
</div>
|
||||
<div class="group clearfix right">
|
||||
<a href="{$_url}export/print-by-date" class="btn btn-default" target="_blank"><i
|
||||
class="ion ion-printer"></i>{Lang::T('Export for Print')}</a>
|
||||
<a href="{$_url}export/pdf-by-date" class="btn btn-default"><i
|
||||
class="fa fa-file-pdf-o"></i>{Lang::T('Export to PDF')}</a>
|
||||
<div id="filter_box" class="box-body hidden-xs hidden-sm hidden-md">
|
||||
<input type="hidden" name="_route" value="reports">
|
||||
<label>{Lang::T('Start Date')}</label>
|
||||
<input type="date" class="form-control" name="sd" value="{$sd}">
|
||||
<label>{Lang::T('Start time')}</label>
|
||||
<input type="time" class="form-control" name="ts" value="{$ts}">
|
||||
<label>{Lang::T('End Date')}</label>
|
||||
<input type="date" class="form-control" name="ed" value="{$ed}">
|
||||
<label>{Lang::T('End Time')}</label>
|
||||
<input type="time" class="form-control" name="te" value="{$te}">
|
||||
<label>{Lang::T('Type')}</label>
|
||||
<select class="form-control" name="tps[]" multiple>
|
||||
{foreach $types as $type}
|
||||
<option value="{$type}" {if in_array($type, $tps)}selected{/if}>{$type}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<label>{Lang::T('Internet Plans')}</label>
|
||||
<select class="form-control" name="plns[]" multiple>
|
||||
{foreach $plans as $plan}
|
||||
<option value="{$plan}" {if in_array($plan, $plns)}selected{/if}>{$plan}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<label>{Lang::T('Methods')}</label>
|
||||
<select class="form-control" name="mts[]" multiple>
|
||||
{foreach $methods as $method}
|
||||
<option value="{$method}" {if in_array($method, $mts)}selected{/if}>{$method}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<label>{Lang::T('Routers')}</label>
|
||||
<select class="form-control" name="rts[]" multiple>
|
||||
{foreach $routers as $router}
|
||||
<option value="{$router}" {if in_array($router, $rts)}selected{/if}>{Lang::T($router)}</option>
|
||||
{/foreach}
|
||||
</select>
|
||||
<input type="submit" class="btn btn-success btn-block">
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
<div class="col-lg-9">
|
||||
<div class="box box-primary box-solid">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>
|
||||
<a href="{$_url}export/print-by-date&{$filter}" class="btn btn-default" target="_blank"><i
|
||||
class="ion ion-printer"></i></a>
|
||||
<a href="{$_url}export/pdf-by-date&{$filter}" class="btn btn-default"><i
|
||||
class="fa fa-file-pdf-o"></i></a>
|
||||
</th>
|
||||
<th colspan="7"></th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{Lang::T('Username')}</th>
|
||||
<th>{Lang::T('Type')}</th>
|
||||
@ -48,19 +84,47 @@
|
||||
<td>{$ds['routers']}</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
<tr>
|
||||
<th>{Lang::T('Total')}</th>
|
||||
<td colspan="2"></td>
|
||||
<th class="text-right">{Lang::moneyFormat($dr)}</th>
|
||||
<td colspan="4"></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{include file="pagination.tpl"}
|
||||
|
||||
<div class="clearfix text-right total-sum mb10">
|
||||
<h4 class="text-uppercase text-bold">{Lang::T('Total Income')}:</h4>
|
||||
<h3 class="sum">{Lang::moneyFormat($dr)}</h3>
|
||||
<div class="box-footer">
|
||||
<p class="text-center small text-info">{Lang::T('All Transactions at Date')}:
|
||||
{Lang::dateAndTimeFormat($sd, $ts)} - {Lang::dateAndTimeFormat($ed, $te)}</p>
|
||||
</div>
|
||||
<p class="text-center small text-info">{Lang::T('All Transactions at Date')}:
|
||||
{date($_c['date_format'], strtotime($mdate))} {$mtime}</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
{include file="pagination.tpl"}
|
||||
|
||||
<div class="bs-callout bs-callout-warning bg-gray">
|
||||
<h4>Information</h4>
|
||||
<p>Export and Print will show all data without pagination.</p>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var isShow = false;
|
||||
|
||||
function showFilter() {
|
||||
if (isShow) {
|
||||
$("#filter_box").addClass("hidden-xs");
|
||||
$("#filter_box").addClass("hidden-sm");
|
||||
$("#filter_box").addClass("hidden-md");
|
||||
isShow = false;
|
||||
} else {
|
||||
// remove class
|
||||
$("#filter_box").removeClass("hidden-xs");
|
||||
$("#filter_box").removeClass("hidden-sm");
|
||||
$("#filter_box").removeClass("hidden-md");
|
||||
isShow = true;
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
{include file="sections/footer.tpl"}
|
@ -56,7 +56,7 @@
|
||||
<div class="form-group row">
|
||||
<label class="col-md-2 control-label"></label>
|
||||
<div class="col-md-6">
|
||||
<label><input type="checkbox" name="testIt" value="yes"> Test Connection</label>
|
||||
<label><input type="checkbox" checked name="testIt" value="yes"> Test Connection</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
@ -55,7 +55,7 @@
|
||||
<div class="form-group row">
|
||||
<label class="col-md-2 control-label"></label>
|
||||
<div class="col-md-6">
|
||||
<label><input type="checkbox" name="testIt" value="yes"> Test Connection</label>
|
||||
<label><input type="checkbox" checked name="testIt" value="yes"> Test Connection</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
|
217
ui/ui/scripts/md5.js
Normal file
217
ui/ui/scripts/md5.js
Normal file
@ -0,0 +1,217 @@
|
||||
/*
|
||||
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
|
||||
* Digest Algorithm, as defined in RFC 1321.
|
||||
* Version 1.1 Copyright (C) Paul Johnston 1999 - 2002.
|
||||
* Code also contributed by Greg Holt
|
||||
* See http://pajhome.org.uk/site/legal.html for details.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
|
||||
* to work around bugs in some JS interpreters.
|
||||
*/
|
||||
function safe_add(x, y)
|
||||
{
|
||||
var lsw = (x & 0xFFFF) + (y & 0xFFFF)
|
||||
var msw = (x >> 16) + (y >> 16) + (lsw >> 16)
|
||||
return (msw << 16) | (lsw & 0xFFFF)
|
||||
}
|
||||
|
||||
/*
|
||||
* Bitwise rotate a 32-bit number to the left.
|
||||
*/
|
||||
function rol(num, cnt)
|
||||
{
|
||||
return (num << cnt) | (num >>> (32 - cnt))
|
||||
}
|
||||
|
||||
/*
|
||||
* These functions implement the four basic operations the algorithm uses.
|
||||
*/
|
||||
function cmn(q, a, b, x, s, t)
|
||||
{
|
||||
return safe_add(rol(safe_add(safe_add(a, q), safe_add(x, t)), s), b)
|
||||
}
|
||||
function ff(a, b, c, d, x, s, t)
|
||||
{
|
||||
return cmn((b & c) | ((~b) & d), a, b, x, s, t)
|
||||
}
|
||||
function gg(a, b, c, d, x, s, t)
|
||||
{
|
||||
return cmn((b & d) | (c & (~d)), a, b, x, s, t)
|
||||
}
|
||||
function hh(a, b, c, d, x, s, t)
|
||||
{
|
||||
return cmn(b ^ c ^ d, a, b, x, s, t)
|
||||
}
|
||||
function ii(a, b, c, d, x, s, t)
|
||||
{
|
||||
return cmn(c ^ (b | (~d)), a, b, x, s, t)
|
||||
}
|
||||
|
||||
/*
|
||||
* Calculate the MD5 of an array of little-endian words, producing an array
|
||||
* of little-endian words.
|
||||
*/
|
||||
function coreMD5(x)
|
||||
{
|
||||
var a = 1732584193
|
||||
var b = -271733879
|
||||
var c = -1732584194
|
||||
var d = 271733878
|
||||
|
||||
for(i = 0; i < x.length; i += 16)
|
||||
{
|
||||
var olda = a
|
||||
var oldb = b
|
||||
var oldc = c
|
||||
var oldd = d
|
||||
|
||||
a = ff(a, b, c, d, x[i+ 0], 7 , -680876936)
|
||||
d = ff(d, a, b, c, x[i+ 1], 12, -389564586)
|
||||
c = ff(c, d, a, b, x[i+ 2], 17, 606105819)
|
||||
b = ff(b, c, d, a, x[i+ 3], 22, -1044525330)
|
||||
a = ff(a, b, c, d, x[i+ 4], 7 , -176418897)
|
||||
d = ff(d, a, b, c, x[i+ 5], 12, 1200080426)
|
||||
c = ff(c, d, a, b, x[i+ 6], 17, -1473231341)
|
||||
b = ff(b, c, d, a, x[i+ 7], 22, -45705983)
|
||||
a = ff(a, b, c, d, x[i+ 8], 7 , 1770035416)
|
||||
d = ff(d, a, b, c, x[i+ 9], 12, -1958414417)
|
||||
c = ff(c, d, a, b, x[i+10], 17, -42063)
|
||||
b = ff(b, c, d, a, x[i+11], 22, -1990404162)
|
||||
a = ff(a, b, c, d, x[i+12], 7 , 1804603682)
|
||||
d = ff(d, a, b, c, x[i+13], 12, -40341101)
|
||||
c = ff(c, d, a, b, x[i+14], 17, -1502002290)
|
||||
b = ff(b, c, d, a, x[i+15], 22, 1236535329)
|
||||
|
||||
a = gg(a, b, c, d, x[i+ 1], 5 , -165796510)
|
||||
d = gg(d, a, b, c, x[i+ 6], 9 , -1069501632)
|
||||
c = gg(c, d, a, b, x[i+11], 14, 643717713)
|
||||
b = gg(b, c, d, a, x[i+ 0], 20, -373897302)
|
||||
a = gg(a, b, c, d, x[i+ 5], 5 , -701558691)
|
||||
d = gg(d, a, b, c, x[i+10], 9 , 38016083)
|
||||
c = gg(c, d, a, b, x[i+15], 14, -660478335)
|
||||
b = gg(b, c, d, a, x[i+ 4], 20, -405537848)
|
||||
a = gg(a, b, c, d, x[i+ 9], 5 , 568446438)
|
||||
d = gg(d, a, b, c, x[i+14], 9 , -1019803690)
|
||||
c = gg(c, d, a, b, x[i+ 3], 14, -187363961)
|
||||
b = gg(b, c, d, a, x[i+ 8], 20, 1163531501)
|
||||
a = gg(a, b, c, d, x[i+13], 5 , -1444681467)
|
||||
d = gg(d, a, b, c, x[i+ 2], 9 , -51403784)
|
||||
c = gg(c, d, a, b, x[i+ 7], 14, 1735328473)
|
||||
b = gg(b, c, d, a, x[i+12], 20, -1926607734)
|
||||
|
||||
a = hh(a, b, c, d, x[i+ 5], 4 , -378558)
|
||||
d = hh(d, a, b, c, x[i+ 8], 11, -2022574463)
|
||||
c = hh(c, d, a, b, x[i+11], 16, 1839030562)
|
||||
b = hh(b, c, d, a, x[i+14], 23, -35309556)
|
||||
a = hh(a, b, c, d, x[i+ 1], 4 , -1530992060)
|
||||
d = hh(d, a, b, c, x[i+ 4], 11, 1272893353)
|
||||
c = hh(c, d, a, b, x[i+ 7], 16, -155497632)
|
||||
b = hh(b, c, d, a, x[i+10], 23, -1094730640)
|
||||
a = hh(a, b, c, d, x[i+13], 4 , 681279174)
|
||||
d = hh(d, a, b, c, x[i+ 0], 11, -358537222)
|
||||
c = hh(c, d, a, b, x[i+ 3], 16, -722521979)
|
||||
b = hh(b, c, d, a, x[i+ 6], 23, 76029189)
|
||||
a = hh(a, b, c, d, x[i+ 9], 4 , -640364487)
|
||||
d = hh(d, a, b, c, x[i+12], 11, -421815835)
|
||||
c = hh(c, d, a, b, x[i+15], 16, 530742520)
|
||||
b = hh(b, c, d, a, x[i+ 2], 23, -995338651)
|
||||
|
||||
a = ii(a, b, c, d, x[i+ 0], 6 , -198630844)
|
||||
d = ii(d, a, b, c, x[i+ 7], 10, 1126891415)
|
||||
c = ii(c, d, a, b, x[i+14], 15, -1416354905)
|
||||
b = ii(b, c, d, a, x[i+ 5], 21, -57434055)
|
||||
a = ii(a, b, c, d, x[i+12], 6 , 1700485571)
|
||||
d = ii(d, a, b, c, x[i+ 3], 10, -1894986606)
|
||||
c = ii(c, d, a, b, x[i+10], 15, -1051523)
|
||||
b = ii(b, c, d, a, x[i+ 1], 21, -2054922799)
|
||||
a = ii(a, b, c, d, x[i+ 8], 6 , 1873313359)
|
||||
d = ii(d, a, b, c, x[i+15], 10, -30611744)
|
||||
c = ii(c, d, a, b, x[i+ 6], 15, -1560198380)
|
||||
b = ii(b, c, d, a, x[i+13], 21, 1309151649)
|
||||
a = ii(a, b, c, d, x[i+ 4], 6 , -145523070)
|
||||
d = ii(d, a, b, c, x[i+11], 10, -1120210379)
|
||||
c = ii(c, d, a, b, x[i+ 2], 15, 718787259)
|
||||
b = ii(b, c, d, a, x[i+ 9], 21, -343485551)
|
||||
|
||||
a = safe_add(a, olda)
|
||||
b = safe_add(b, oldb)
|
||||
c = safe_add(c, oldc)
|
||||
d = safe_add(d, oldd)
|
||||
}
|
||||
return [a, b, c, d]
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert an array of little-endian words to a hex string.
|
||||
*/
|
||||
function binl2hex(binarray)
|
||||
{
|
||||
var hex_tab = "0123456789abcdef"
|
||||
var str = ""
|
||||
for(var i = 0; i < binarray.length * 4; i++)
|
||||
{
|
||||
str += hex_tab.charAt((binarray[i>>2] >> ((i%4)*8+4)) & 0xF) +
|
||||
hex_tab.charAt((binarray[i>>2] >> ((i%4)*8)) & 0xF)
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert an array of little-endian words to a base64 encoded string.
|
||||
*/
|
||||
function binl2b64(binarray)
|
||||
{
|
||||
var tab = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"
|
||||
var str = ""
|
||||
for(var i = 0; i < binarray.length * 32; i += 6)
|
||||
{
|
||||
str += tab.charAt(((binarray[i>>5] << (i%32)) & 0x3F) |
|
||||
((binarray[i>>5+1] >> (32-i%32)) & 0x3F))
|
||||
}
|
||||
return str
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert an 8-bit character string to a sequence of 16-word blocks, stored
|
||||
* as an array, and append appropriate padding for MD4/5 calculation.
|
||||
* If any of the characters are >255, the high byte is silently ignored.
|
||||
*/
|
||||
function str2binl(str)
|
||||
{
|
||||
var nblk = ((str.length + 8) >> 6) + 1 // number of 16-word blocks
|
||||
var blks = new Array(nblk * 16)
|
||||
for(var i = 0; i < nblk * 16; i++) blks[i] = 0
|
||||
for(var i = 0; i < str.length; i++)
|
||||
blks[i>>2] |= (str.charCodeAt(i) & 0xFF) << ((i%4) * 8)
|
||||
blks[i>>2] |= 0x80 << ((i%4) * 8)
|
||||
blks[nblk*16-2] = str.length * 8
|
||||
return blks
|
||||
}
|
||||
|
||||
/*
|
||||
* Convert a wide-character string to a sequence of 16-word blocks, stored as
|
||||
* an array, and append appropriate padding for MD4/5 calculation.
|
||||
*/
|
||||
function strw2binl(str)
|
||||
{
|
||||
var nblk = ((str.length + 4) >> 5) + 1 // number of 16-word blocks
|
||||
var blks = new Array(nblk * 16)
|
||||
for(var i = 0; i < nblk * 16; i++) blks[i] = 0
|
||||
for(var i = 0; i < str.length; i++)
|
||||
blks[i>>1] |= str.charCodeAt(i) << ((i%2) * 16)
|
||||
blks[i>>1] |= 0x80 << ((i%2) * 16)
|
||||
blks[nblk*16-2] = str.length * 16
|
||||
return blks
|
||||
}
|
||||
|
||||
/*
|
||||
* External interface
|
||||
*/
|
||||
function hexMD5 (str) { return binl2hex(coreMD5( str2binl(str))) }
|
||||
function hexMD5w(str) { return binl2hex(coreMD5(strw2binl(str))) }
|
||||
function b64MD5 (str) { return binl2b64(coreMD5( str2binl(str))) }
|
||||
function b64MD5w(str) { return binl2b64(coreMD5(strw2binl(str))) }
|
||||
/* Backward compatibility */
|
||||
function calcMD5(str) { return binl2hex(coreMD5( str2binl(str))) }
|
@ -154,32 +154,40 @@
|
||||
margin-bottom: 5px
|
||||
}
|
||||
|
||||
.bs-callout p:last-child{
|
||||
margin-bottom:0
|
||||
.bs-callout p:last-child {
|
||||
margin-bottom: 0
|
||||
}
|
||||
.bs-callout code{
|
||||
border-radius:3px
|
||||
|
||||
.bs-callout code {
|
||||
border-radius: 3px
|
||||
}
|
||||
.bs-callout+.bs-callout{
|
||||
margin-top:-5px
|
||||
|
||||
.bs-callout+.bs-callout {
|
||||
margin-top: -5px
|
||||
}
|
||||
.bs-callout-danger{
|
||||
border-left-color:#ce4844
|
||||
|
||||
.bs-callout-danger {
|
||||
border-left-color: #ce4844
|
||||
}
|
||||
.bs-callout-danger h4{
|
||||
color:#ce4844
|
||||
|
||||
.bs-callout-danger h4 {
|
||||
color: #ce4844
|
||||
}
|
||||
.bs-callout-warning{
|
||||
border-left-color:#aa6708
|
||||
|
||||
.bs-callout-warning {
|
||||
border-left-color: #aa6708
|
||||
}
|
||||
.bs-callout-warning h4{
|
||||
color:#aa6708
|
||||
|
||||
.bs-callout-warning h4 {
|
||||
color: #aa6708
|
||||
}
|
||||
.bs-callout-info{
|
||||
border-left-color:#1b809e
|
||||
|
||||
.bs-callout-info {
|
||||
border-left-color: #1b809e
|
||||
}
|
||||
.bs-callout-info h4{
|
||||
color:#1b809e
|
||||
|
||||
.bs-callout-info h4 {
|
||||
color: #1b809e
|
||||
}
|
||||
</style>
|
||||
{if isset($xheader)}
|
||||
@ -328,10 +336,8 @@
|
||||
</span>
|
||||
</a>
|
||||
<ul class="treeview-menu">
|
||||
<li {if $_routes[1] eq 'daily-report' }class="active" {/if}><a
|
||||
href="{$_url}reports/daily-report">{Lang::T('Daily Reports')}</a></li>
|
||||
<li {if $_routes[1] eq 'by-period' }class="active" {/if}><a
|
||||
href="{$_url}reports/by-period">{Lang::T('Period Reports')}</a></li>
|
||||
<li {if $_system_menu eq 'reports' }class="active" {/if}><a
|
||||
href="{$_url}reports">{Lang::T('Daily Reports')}</a></li>
|
||||
<li {if $_routes[1] eq 'activation' }class="active" {/if}><a
|
||||
href="{$_url}reports/activation">{Lang::T('Activation History')}</a></li>
|
||||
{$_MENU_REPORTS}
|
||||
@ -434,7 +440,7 @@
|
||||
<li {if $_routes[1] eq 'notifications' }class="active" {/if}><a
|
||||
href="{$_url}settings/notifications">{Lang::T('User Notification')}</a></li>
|
||||
<li {if $_routes[1] eq 'devices' }class="active" {/if}><a
|
||||
href="{$_url}settings/devices">{Lang::T('Devices')}</a></li>
|
||||
href="{$_url}settings/devices">{Lang::T('Devices')}</a></li>
|
||||
{/if}
|
||||
{if in_array($_admin['user_type'],['SuperAdmin','Admin','Agent'])}
|
||||
<li {if $_routes[1] eq 'users' }class="active" {/if}><a
|
||||
@ -478,12 +484,23 @@
|
||||
</li>
|
||||
{/if}
|
||||
{$_MENU_AFTER_LOGS}
|
||||
<li {if $_system_menu eq 'community' }class="active" {/if}>
|
||||
<a href="{$_url}community">
|
||||
<i class="ion ion-chatboxes"></i>
|
||||
<span class="text">{Lang::T('Community')}</span>
|
||||
</a>
|
||||
</li>
|
||||
{if in_array($_admin['user_type'],['SuperAdmin','Admin'])}
|
||||
<li {if $_system_menu eq 'community' }class="active" {/if}>
|
||||
<a href="{if $_c['docs_clicked'] != 'yes'}{$_url}settings/docs{else}./docs/{/if}">
|
||||
<i class="ion ion-ios-bookmarks"></i>
|
||||
<span class="text">{Lang::T('Documentation')}</span>
|
||||
{if $_c['docs_clicked'] != 'yes'}
|
||||
<span class="pull-right-container"><small class="label pull-right bg-green">New</small></span>
|
||||
{/if}
|
||||
</a>
|
||||
</li>
|
||||
<li {if $_system_menu eq 'community' }class="active" {/if}>
|
||||
<a href="{$_url}community">
|
||||
<i class="ion ion-chatboxes"></i>
|
||||
<span class="text">{Lang::T('Community')}</span>
|
||||
</a>
|
||||
</li>
|
||||
{/if}
|
||||
{$_MENU_AFTER_COMMUNITY}
|
||||
</ul>
|
||||
</section>
|
||||
|
@ -106,6 +106,36 @@
|
||||
</tr>
|
||||
{/if}
|
||||
</table>
|
||||
{if $abills && count($abills)>0}
|
||||
<div class="box-header">
|
||||
<h3 class="box-title">{Lang::T('Additional Billing')}</h3>
|
||||
</div>
|
||||
<table class="table table-bordered table-striped table-bordered table-hover mb-0"
|
||||
style="margin-bottom: 0px;">
|
||||
{assign var="total" value=0}
|
||||
{foreach $abills as $k => $v}
|
||||
<tr>
|
||||
<td class="small text-success text-uppercase text-normal">{str_replace(' Bill', '', $k)}</td>
|
||||
<td class="small mb15">
|
||||
{if strpos($v, ':') === false}
|
||||
{Lang::moneyFormat($v)}
|
||||
<sup title="recurring">∞</sup>
|
||||
{assign var="total" value=$v+$total}
|
||||
{else}
|
||||
{assign var="exp" value=explode(':',$v)}
|
||||
{Lang::moneyFormat($exp[0])}
|
||||
<sup title="{$exp[1]} more times">{$exp[1]}x</sup>
|
||||
{assign var="total" value=$exp[0]+$total}
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/foreach}
|
||||
<tr>
|
||||
<td class="small text-success text-uppercase text-normal"><b>{Lang::T('Total')}</b></td>
|
||||
<td class="small mb15"><b>{Lang::moneyFormat($total)}</b></td>
|
||||
</tr>
|
||||
</table>
|
||||
{/if}
|
||||
</div>
|
||||
{if $_bills}
|
||||
<div class="box box-primary box-solid">
|
||||
@ -167,7 +197,7 @@
|
||||
<td class="small mb15">{$nux_mac}</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on' && $_bill['routers'] != 'radius'}
|
||||
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on' && $_bill['routers'] != 'radius' && $_c['hs_auth_method'] != 'hchap'}
|
||||
<tr>
|
||||
<td class="small text-primary text-uppercase text-normal">{Lang::T('Login Status')}</td>
|
||||
<td class="small mb15" id="login_status_{$_bill['id']}">
|
||||
@ -175,6 +205,21 @@
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on' && $_c['hs_auth_method'] == 'hchap'}
|
||||
<tr>
|
||||
<td class="small text-primary text-uppercase text-normal">{Lang::T('Login Status')}</td>
|
||||
<td class="small mb15">
|
||||
{if $logged == '1'}
|
||||
<a href="http://{$hostname}/status"
|
||||
class="btn btn-success btn-xs btn-block">{Lang::T('You are Online, Check Status')}</a>
|
||||
{else}
|
||||
<a href="{$_url}home&mikrotik=login"
|
||||
onclick="return confirm('{Lang::T('Connect to Internet')}')"
|
||||
class="btn btn-danger btn-xs btn-block">{Lang::T('Not Online, Login now?')}</a>
|
||||
{/if}
|
||||
</td>
|
||||
</tr>
|
||||
{/if}
|
||||
<tr>
|
||||
<td class="small text-primary text-uppercase text-normal">
|
||||
{if $_bill['status'] == 'on'}
|
||||
@ -210,7 +255,7 @@
|
||||
{/if}
|
||||
{if $_bills}
|
||||
{foreach $_bills as $_bill}
|
||||
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on'}
|
||||
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on' && $_c['hs_auth_method'] != 'hchap'}
|
||||
<script>
|
||||
setTimeout(() => {
|
||||
$.ajax({
|
||||
@ -320,4 +365,17 @@
|
||||
{/if}
|
||||
</div>
|
||||
</div>
|
||||
{if isset($hostname) && $hchap == 'true' && $_c['hs_auth_method'] == 'hchap'}
|
||||
<script type="text/javascript" src="/ui/ui/scripts/md5.js"></script>
|
||||
<script type="text/javascript">
|
||||
var hostname = "http://{$hostname}/login";
|
||||
var user = "{$_user['username']}";
|
||||
var pass = "{$_user['password']}";
|
||||
var dst = "{$apkurl}";
|
||||
var authdly = "2";
|
||||
var key = hexMD5('{$key1}' + pass + '{$key2}');
|
||||
var auth = hostname + '?username=' + user + '&dst=' + dst + '&password=' + key;
|
||||
document.write('<meta http-equiv="refresh" target="_blank" content="' + authdly + '; url=' + auth + '">');
|
||||
</script>
|
||||
{/if}
|
||||
{include file="sections/user-footer.tpl"}
|
@ -60,10 +60,12 @@
|
||||
<div class="form-group">
|
||||
<label>{Lang::T('Enter voucher code here')}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="voucher" name="voucher" required value="{$code}"
|
||||
placeholder="{Lang::T('Enter voucher code here')}">
|
||||
<input type="text" class="form-control" id="voucher" name="voucher" required
|
||||
value="{$code}" placeholder="{Lang::T('Enter voucher code here')}">
|
||||
<span class="input-group-btn">
|
||||
<a class="btn btn-default" href="{APP_URL}/scan/?back={urlencode($_url)}{urlencode("login&code=")}"><i class="glyphicon glyphicon-qrcode"></i></a>
|
||||
<a class="btn btn-default"
|
||||
href="{APP_URL}/scan/?back={urlencode($_url)}{urlencode("login&code=")}"><i
|
||||
class="glyphicon glyphicon-qrcode"></i></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
@ -73,15 +75,40 @@
|
||||
class="btn btn-primary">{Lang::T('Login / Activate Voucher')}</button>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<center>
|
||||
<a href="./pages/Privacy_Policy.html" target="_blank">Privacy</a>
|
||||
•
|
||||
<a href="./pages/Terms_of_Conditions.html" target="_blank">ToC</a>
|
||||
</center>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<div class="panel panel-primary">
|
||||
<div class="panel-heading">{Lang::T('Activate Voucher')}</div>
|
||||
<div class="panel-body">
|
||||
<form action="{$_url}login/activation" method="post">
|
||||
<div class="form-group">
|
||||
<label>{Lang::T('Enter voucher code here')}</label>
|
||||
<div class="input-group">
|
||||
<input type="text" class="form-control" id="voucher_only" name="voucher_only" required
|
||||
value="{$code}" placeholder="{Lang::T('Enter voucher code here')}">
|
||||
<span class="input-group-btn">
|
||||
<a class="btn btn-default"
|
||||
href="{APP_URL}/scan/?back={urlencode($_url)}{urlencode("login&code=")}"><i
|
||||
class="glyphicon glyphicon-qrcode"></i></a>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="btn-group btn-group-justified mb15">
|
||||
<div class="btn-group">
|
||||
<button type="submit"
|
||||
class="btn btn-primary">{Lang::T('Activate Voucher')}</button>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<center>
|
||||
<a href="./pages/Privacy_Policy.html" target="_blank">Privacy</a>
|
||||
•
|
||||
<a href="./pages/Terms_of_Conditions.html" target="_blank">ToC</a>
|
||||
</center>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -19,8 +19,8 @@
|
||||
{if in_array($_admin['user_type'],['SuperAdmin','Admin'])}
|
||||
<div class="btn-group pull-right">
|
||||
<a class="btn btn-danger btn-xs" title="Remove used Voucher" href="{$_url}plan/remove-voucher"
|
||||
onclick="return confirm('Delete all used voucher code?')"><span class="glyphicon glyphicon-trash"
|
||||
aria-hidden="true"></span> Delete All</a>
|
||||
onclick="return confirm('Delete all used voucher code more than 3 months?')"><span class="glyphicon glyphicon-trash"
|
||||
aria-hidden="true"></span> Delete > 3 Months</a>
|
||||
</div>
|
||||
{/if}
|
||||
|
||||
@ -95,6 +95,7 @@
|
||||
<th>{Lang::T('Code Voucher')}</th>
|
||||
<th>{Lang::T('Status Voucher')}</th>
|
||||
<th>{Lang::T('Customer')}</th>
|
||||
<th>{Lang::T('Used Date')}</th>
|
||||
<th>{Lang::T('Generated By')}</th>
|
||||
<th>{Lang::T('Manage')}</th>
|
||||
</tr>
|
||||
@ -116,6 +117,7 @@
|
||||
<td>{if $ds['user'] eq '0'} -
|
||||
{else}<a href="{$_url}customers/viewu/{$ds['user']}">{$ds['user']}</a>
|
||||
{/if}</td>
|
||||
<td>{if $ds['used_date']}{Lang::dateTimeFormat($ds['used_date'])}{/if}</td>
|
||||
<td>{if $ds['generated_by']}
|
||||
<a href="{$_url}settings/users-view/{$ds['generated_by']}">{$admins[$ds['generated_by']]}</a>
|
||||
{else} -
|
||||
|
@ -1,3 +1,3 @@
|
||||
{
|
||||
"version": "2024.6.25"
|
||||
"version": "2024.7.24"
|
||||
}
|
Reference in New Issue
Block a user