Merge branch 'hotspotbilling:master' into master

This commit is contained in:
Focuslinkstech 2024-08-14 14:26:44 +01:00 committed by GitHub
commit baab016135
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
12 changed files with 114 additions and 67 deletions

1
.gitignore vendored
View File

@ -52,3 +52,4 @@ docker-compose.yml
docs/**
!docs/*.html
!docs/*.md
.htaccess

View File

@ -12,3 +12,11 @@
Order Allow,Deny
Allow from all
</Files>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f
RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d
RewriteRule ^(.*)$ index.php [QSA,L]

View File

@ -100,3 +100,10 @@ a.n Ibnu Maksum
- [mlink.id](https://mlink.id)
- [https://github.com/sonyinside](https://github.com/sonyinside)
## Thanks
We appreciate all people who are participating in this project.
<a href="https://github.com/hotspotbilling/phpnuxbill/graphs/contributors">
<img src="https://contrib.rocks/image?repo=hotspotbilling/phpnuxbill" />
</a>

View File

@ -233,7 +233,7 @@ try {
$v->status = "1";
$v->used_date = date('Y-m-d H:i:s');
$v->save();
$tur = ORM::for_table('tbl_user_recharges')->whereRaw("BINARY `code` = '$username'")->find_one();
$tur = ORM::for_table('tbl_user_recharges')->whereRaw("BINARY `username` = '$username'")->find_one();
if ($tur) {
process_radiust_rest($tur, $code);
} else {
@ -264,7 +264,7 @@ try {
}
header("HTTP/1.1 200 ok");
$d = ORM::for_table('rad_acct')
->whereRaw("BINARY `code` = '$username'")
->whereRaw("BINARY `username` = '$username'")
->where('acctstatustype', _post('acctStatusType'))
->findOne();
if (!$d) {
@ -275,7 +275,7 @@ try {
if (_post('acctStatusType') == 'Stop') {
// log in the Start only
$start = ORM::for_table('rad_acct')
->whereRaw("BINARY `code` = '$username'")
->whereRaw("BINARY `username` = '$username'")
->where('acctstatustype', 'Start')
->findOne();
if (!$start) {
@ -288,6 +288,17 @@ try {
$start->acctOutputOctets = 0;
$start->acctInputOctets = 0;
}
$start->acctsessionid = _post('acctSessionId');
$start->username = $username;
$start->realm = _post('realm');
$start->nasipaddress = _post('nasip');
$start->nasid = _post('nasid');
$start->nasportid = _post('nasPortId');
$start->nasporttype = _post('nasPortType');
$start->framedipaddress = _post('framedIPAddress');
$start->acctstatustype = _post('acctStatusType');
$start->macaddr = _post('macAddr');
$start->dateAdded = date('Y-m-d H:i:s');
$start->save();
$d->acctOutputOctets = 0;
$d->acctInputOctets = 0;
@ -313,7 +324,7 @@ try {
$d->dateAdded = date('Y-m-d H:i:s');
$d->save();
if ($d->acctstatustype == 'Start') {
$tur = ORM::for_table('tbl_user_recharges')->whereRaw("BINARY `code` = '$username'")->where('status', 'on')->where('routers', 'radius')->find_one();
$tur = ORM::for_table('tbl_user_recharges')->whereRaw("BINARY `username` = '$username'")->where('status', 'on')->where('routers', 'radius')->find_one();
$plan = ORM::for_table('tbl_plans')->where('id', $tur['plan_id'])->find_one();
if ($plan['limit_type'] == "Data_Limit" || $plan['limit_type'] == "Both_Limit") {
$totalUsage = $d['acctOutputOctets'] + $d['acctInputOctets'];
@ -392,7 +403,7 @@ function process_radiust_rest($tur, $code)
if ($plan['typebp'] == "Limited") {
if ($plan['limit_type'] == "Data_Limit" || $plan['limit_type'] == "Both_Limit") {
$raddact = ORM::for_table('rad_acct')->whereRaw("BINARY `code` = '$tur[username]'")->where('acctstatustype', 'Start')->find_one();
$raddact = ORM::for_table('rad_acct')->whereRaw("BINARY `username` = '$tur[username]'")->where('acctstatustype', 'Start')->find_one();
$totalUsage = intval($raddact['acctOutputOctets']) + intval($raddact['acctInputOctets']);
$attrs['reply:Mikrotik-Total-Limit'] = Text::convertDataUnit($plan['data_limit'], $plan['data_unit']) - $totalUsage;
if ($attrs['reply:Mikrotik-Total-Limit'] < 0) {

View File

@ -43,7 +43,7 @@ $ui->setConfigDir(File::pathFixer($UI_PATH . '/conf/'));
$ui->setCacheDir(File::pathFixer($UI_PATH . '/cache/'));
$ui->assign('app_url', APP_URL);
$ui->assign('_domain', str_replace('www.', '', parse_url(APP_URL, PHP_URL_HOST)));
$ui->assign('_url', APP_URL . '/index.php?_route=');
$ui->assign('_url', APP_URL . '/?_route=');
$ui->assign('_path', __DIR__);
$ui->assign('_c', $config);
$ui->assign('UPLOAD_PATH', str_replace($root_path, '', $UPLOAD_PATH));
@ -66,8 +66,12 @@ if (isset($_SESSION['notify'])) {
unset($_SESSION['ntype']);
}
// Routing Engine
$req = _get('_route');
if(!isset($_GET['_route'])) {
$req = ltrim(parse_url($_SERVER['REQUEST_URI'])['path'], '/');
}else{
// Routing Engine
$req = _get('_route');
}
$routes = explode('/', $req);
$ui->assign('_routes', $routes);
$handler = $routes[0];

View File

@ -701,5 +701,6 @@
"Failed_to_buy_package": "Failed to buy package",
"New_Voucher_Created": "New Voucher Created",
"New_Voucher_for_10mbps_Created": "New Voucher for 10mbps Created",
"Show_Chart": "Show Chart"
"Show_Chart": "Show Chart",
"": ""
}

View File

@ -15,14 +15,14 @@
<tbody>
{foreach $masters as $data}
<tr>
<td>{nl2br($data['commit']['message'])}</td>
<td>{Lang::dateTimeFormat(str_replace(['Z','T'],'',$data['commit']['author']['date']))}</td>
<td>
<a href="/update.php?update_url=https://github.com/hotspotbilling/phpnuxbill/archive/{$data['sha']}.zip"
class="btn btn-sm btn-primary">
update
install
</a>
</td>
<td>{nl2br($data['commit']['message'])}</td>
</tr>
{/foreach}
</tbody>
@ -40,14 +40,14 @@
<tbody>
{foreach $devs as $data}
<tr>
<td>{nl2br($data['commit']['message'])}</td>
<td>{Lang::dateTimeFormat(str_replace(['Z','T'],'',$data['commit']['author']['date']))}</td>
<td>
<a href="/update.php?update_url=https://github.com/hotspotbilling/phpnuxbill/archive/{$data['sha']}.zip"
class="btn btn-sm btn-primary">
update
install
</a>
</td>
<td>{nl2br($data['commit']['message'])}</td>
</tr>
{/foreach}
</tbody>

View File

@ -1,9 +1,24 @@
{include file="sections/header.tpl"}
<center><a href="https://s.id/standwithpalestine" target="_blank"><img src="https://raw.githubusercontent.com/Safouene1/support-palestine-banner/master/banner-support.svg" class="img-responsive"></a></center>
<center><a href="https://s.id/standwithpalestine" target="_blank"><img
src="https://raw.githubusercontent.com/Safouene1/support-palestine-banner/master/banner-support.svg"
class="img-responsive"></a></center>
<br><br>
<div class="row">
<div class="col-sm-6">
<div class="box box-hovered mb20 box-primary">
<div class="box-header">
<h3 class="box-title">Contributors</h3>
</div>
<div class="box-body">
<a href="https://github.com/hotspotbilling/phpnuxbill/graphs/contributors" target="_blank">
<img src="https://contrib.rocks/image?repo=hotspotbilling/phpnuxbill&columns=10" width="100%" />
</a>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="box box-hovered mb20 box-primary">
<div class="box-header">
@ -20,8 +35,6 @@
</div>
</div>
</div>
</div>
<div class="col-sm-6">
<div class="box box-hovered mb20 box-primary">
<div class="box-header">
<h3 class="box-title">Feedback</h3>
@ -144,7 +157,9 @@
<h3 class="box-title">PHPNUXBILL</h3>
</div>
<div class="box-body">
<b>PHPNuxBill</b> is a billing Hotspot and PPPOE for Mikrotik using PHP and Mikrotik API to comunicate with router. If you get more profit with this application, please donate us.<br>Watch project <a href="https://github.com/hotspotbilling/phpnuxbill" target="_blank">in here</a>
<b>PHPNuxBill</b> is a billing Hotspot and PPPOE for Mikrotik using PHP and Mikrotik API to comunicate
with router. If you get more profit with this application, please donate us.<br>Watch project <a
href="https://github.com/hotspotbilling/phpnuxbill" target="_blank">in here</a>
</div>
<div class="box-footer" id="currentVersion">ver</div>
<div class="box-footer" id="latestVersion">ver</div>
@ -154,7 +169,8 @@
<a href="https://github.com/hotspotbilling/phpnuxbill/archive/refs/heads/master.zip" target="_blank"
class="btn btn-warning btn-sm btn-block text-black">Download Latest Version</a>
</div>
<center><a href="{$_url}community/rollback" class="btn btn-link btn-sm btn-block">Select Old Version</a></center>
<center><a href="{$_url}community/rollback" class="btn btn-link btn-sm btn-block">Select Old Version</a>
</center>
</div>
<div class="box-footer">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
@ -165,7 +181,8 @@
</div>
</div>
<div class="box-footer">
If you Download manual the update file, sometime update change database, after uploading, click this button to update database structure.
If you Download manual the update file, sometime update change database, after uploading, click this
button to update database structure.
<a href="./update.php?step=4" class="btn btn-default btn-sm btn-block">Update Database</a>
</div>
</div>

View File

@ -7,12 +7,12 @@
target="_blank">AdminLTE</a>
</footer>
</div>
<script src="ui/ui/scripts/jquery.min.js"></script>
<script src="ui/ui/scripts/bootstrap.min.js"></script>
<script src="ui/ui/scripts/adminlte.min.js"></script>
<script src="ui/ui/scripts/plugins/select2.min.js"></script>
<script src="ui/ui/scripts/pace.min.js"></script>
<script src="ui/ui/scripts/custom.js"></script>
<script src="{$app_url}/ui/ui/scripts/jquery.min.js"></script>
<script src="{$app_url}/ui/ui/scripts/bootstrap.min.js"></script>
<script src="{$app_url}/ui/ui/scripts/adminlte.min.js"></script>
<script src="{$app_url}/ui/ui/scripts/plugins/select2.min.js"></script>
<script src="{$app_url}/ui/ui/scripts/pace.min.js"></script>
<script src="{$app_url}/ui/ui/scripts/custom.js"></script>
{if isset($xfooter)}
{$xfooter}

View File

@ -5,18 +5,18 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>{$_title} - {$_c['CompanyName']}</title>
<link rel="shortcut icon" href="ui/ui/images/logo.png" type="image/x-icon" />
<link rel="shortcut icon" href="{$app_url}/ui/ui/images/logo.png" type="image/x-icon" />
<link rel="stylesheet" href="ui/ui/styles/bootstrap.min.css">
<link rel="stylesheet" href="{$app_url}/ui/ui/styles/bootstrap.min.css">
<link rel="stylesheet" href="ui/ui/fonts/ionicons/css/ionicons.min.css">
<link rel="stylesheet" href="ui/ui/fonts/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="ui/ui/styles/modern-AdminLTE.min.css">
<link rel="stylesheet" href="ui/ui/styles/select2.min.css" />
<link rel="stylesheet" href="ui/ui/styles/select2-bootstrap.min.css" />
<link rel="stylesheet" href="ui/ui/styles/sweetalert2.min.css" />
<link rel="stylesheet" href="ui/ui/styles/plugins/pace.css" />
<script src="ui/ui/scripts/sweetalert2.all.min.js"></script>
<link rel="stylesheet" href="{$app_url}/ui/ui/fonts/ionicons/css/ionicons.min.css">
<link rel="stylesheet" href="{$app_url}/ui/ui/fonts/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="{$app_url}/ui/ui/styles/modern-AdminLTE.min.css">
<link rel="stylesheet" href="{$app_url}/ui/ui/styles/select2.min.css" />
<link rel="stylesheet" href="{$app_url}/ui/ui/styles/select2-bootstrap.min.css" />
<link rel="stylesheet" href="{$app_url}/ui/ui/styles/sweetalert2.min.css" />
<link rel="stylesheet" href="{$app_url}/ui/ui/styles/plugins/pace.css" />
<script src="{$app_url}/ui/ui/scripts/sweetalert2.all.min.js"></script>
<style>
::-moz-selection {
/* Code for Firefox */

View File

@ -40,14 +40,12 @@
</div>
</div>
<script src="{$app_url}/ui/ui/scripts/jquery.min.js"></script>
<script src="{$app_url}/ui/ui/scripts/bootstrap.min.js"></script>
<script src="{$app_url}/ui/ui/scripts/adminlte.min.js"></script>
<script src="ui/ui/scripts/jquery.min.js"></script>
<script src="ui/ui/scripts/bootstrap.min.js"></script>
<script src="ui/ui/scripts/adminlte.min.js"></script>
<script src="ui/ui/scripts/plugins/select2.min.js"></script>
<script src="ui/ui/scripts/custom.js?v=2"></script>
<script src="{$app_url}/ui/ui/scripts/plugins/select2.min.js"></script>
<script src="{$app_url}/ui/ui/scripts/custom.js?v=2"></script>
{if isset($xfooter)}
{$xfooter}

View File

@ -5,15 +5,15 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>{$_title} - {$_c['CompanyName']}</title>
<link rel="shortcut icon" href="ui/ui/images/logo.png" type="image/x-icon" />
<link rel="shortcut icon" href="{$app_url}ui/ui/images/logo.png" type="image/x-icon" />
<link rel="stylesheet" href="ui/ui/styles/bootstrap.min.css">
<link rel="stylesheet" href="{$app_url}ui/ui/styles/bootstrap.min.css">
<link rel="stylesheet" href="ui/ui/fonts/ionicons/css/ionicons.min.css">
<link rel="stylesheet" href="ui/ui/fonts/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="ui/ui/styles/modern-AdminLTE.min.css">
<link rel="stylesheet" href="ui/ui/styles/sweetalert2.min.css" />
<script src="ui/ui/scripts/sweetalert2.all.min.js"></script>
<link rel="stylesheet" href="{$app_url}ui/ui/fonts/ionicons/css/ionicons.min.css">
<link rel="stylesheet" href="{$app_url}ui/ui/fonts/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="{$app_url}ui/ui/styles/modern-AdminLTE.min.css">
<link rel="stylesheet" href="{$app_url}ui/ui/styles/sweetalert2.min.css" />
<script src="{$app_url}ui/ui/scripts/sweetalert2.all.min.js"></script>
<style>
@ -77,7 +77,7 @@
<body class="hold-transition modern-skin-dark sidebar-mini">
<div class="wrapper">
<header class="main-header" style="position:fixed; width: 100%">
<a href="{$_url}home" class="logo">
<a href="{$app_url}home" class="logo">
<span class="logo-mini"><b>N</b>uX</span>
<span class="logo-lg">{$_c['CompanyName']}</span>
</a>
@ -90,14 +90,14 @@
<li class="dropdown notifications-menu">
<a href="#" class="dropdown-toggle" data-toggle="dropdown" aria-expanded="false">
<i class="fa fa-envelope-o"></i>
<span class="label label-warning" api-get-text="{$_url}autoload_user/inbox_unread"></span>
<span class="label label-warning" api-get-text="{$app_url}autoload_user/inbox_unread"></span>
</a>
<ul class="dropdown-menu">
<li>
<!-- inner menu: contains the actual data -->
<ul class="menu" api-get-text="{$_url}autoload_user/inbox"></ul>
<ul class="menu" api-get-text="{$app_url}autoload_user/inbox"></ul>
</li>
<li class="footer"><a href="{$_url}mail">{Lang::T('Inbox')}</a></li>
<li class="footer"><a href="{$app_url}mail">{Lang::T('Inbox')}</a></li>
</ul>
</li>
<li class="dropdown user user-menu">
@ -127,18 +127,18 @@
<li class="user-body">
<div class="row">
<div class="col-xs-7 text-center text-sm">
<a href="{$_url}accounts/change-password"><i class="ion ion-settings"></i>
<a href="{$app_url}accounts/change-password"><i class="ion ion-settings"></i>
{Lang::T('Change Password')}</a>
</div>
<div class="col-xs-5 text-center text-sm">
<a href="{$_url}accounts/profile"><i class="ion ion-person"></i>
<a href="{$app_url}accounts/profile"><i class="ion ion-person"></i>
{Lang::T('My Account')}</a>
</div>
</div>
</li>
<li class="user-footer">
<div class="pull-right">
<a href="{$_url}logout" class="btn btn-default btn-flat"><i
<a href="{$app_url}logout" class="btn btn-default btn-flat"><i
class="ion ion-power"></i> {Lang::T('Logout')}</a>
</div>
</li>
@ -153,14 +153,14 @@
<section class="sidebar">
<ul class="sidebar-menu" data-widget="tree">
<li {if $_system_menu eq 'home'}class="active" {/if}>
<a href="{$_url}home">
<a href="{$app_url}home">
<i class="ion ion-monitor"></i>
<span>{Lang::T('Dashboard')}</span>
</a>
</li>
{$_MENU_AFTER_DASHBOARD}
<li {if $_system_menu eq 'inbox'}class="active" {/if}>
<a href="{$_url}mail">
<a href="{$app_url}mail">
<i class="fa fa-envelope"></i>
<span>{Lang::T('Inbox')}</span>
</a>
@ -168,7 +168,7 @@
{$_MENU_AFTER_INBOX}
{if $_c['disable_voucher'] != 'yes'}
<li {if $_system_menu eq 'voucher'}class="active" {/if}>
<a href="{$_url}voucher/activation">
<a href="{$app_url}voucher/activation">
<i class="fa fa-ticket"></i>
<span>{Lang::T('Voucher')}</span>
</a>
@ -177,20 +177,20 @@
{if $_c['payment_gateway'] != 'none' or $_c['payment_gateway'] == '' }
{if $_c['enable_balance'] == 'yes'}
<li {if $_system_menu eq 'balance'}class="active" {/if}>
<a href="{$_url}order/balance">
<a href="{$app_url}order/balance">
<i class="ion ion-ios-cart"></i>
<span>{Lang::T('Buy Balance')}</span>
</a>
</li>
{/if}
<li {if $_system_menu eq 'package'}class="active" {/if}>
<a href="{$_url}order/package">
<a href="{$app_url}order/package">
<i class="ion ion-ios-cart"></i>
<span>{Lang::T('Buy Package')}</span>
</a>
</li>
<li {if $_system_menu eq 'history'}class="active" {/if}>
<a href="{$_url}order/history">
<a href="{$app_url}order/history">
<i class="fa fa-file-text"></i>
<span>{Lang::T('Order History')}</span>
</a>
@ -198,7 +198,7 @@
{/if}
{$_MENU_AFTER_ORDER}
<li {if $_system_menu eq 'list-activated'}class="active" {/if}>
<a href="{$_url}voucher/list-activated">
<a href="{$app_url}voucher/list-activated">
<i class="fa fa-list-alt"></i>
<span>{Lang::T('Activation History')}</span>
</a>