Compare commits

...

107 Commits

Author SHA1 Message Date
f6e5bac86a Merge pull request #20 from hotspotbilling/Development
Fix old deprecated code
2023-03-12 10:26:36 +07:00
9f09909616 2023.3.12 2023-03-12 10:25:38 +07:00
bbc830de26 fix old deprecated code 2023-03-12 10:24:31 +07:00
b0cac9510d Merge pull request #18 from hotspotbilling/Development
Plugin Installer
2023-03-08 13:03:57 +07:00
b0542ab8be plugin manager 2023-03-08 11:08:56 +07:00
2155c3adae 2023.3.6 2023-03-06 14:57:36 +07:00
51984401d2 bold 2023-03-06 14:57:06 +07:00
fc6a5a26eb add new install 2023-03-06 14:52:09 +07:00
ec45d59a68 change sending message 2023-03-06 14:51:36 +07:00
ba85ed6d0e change text 2023-03-06 14:51:24 +07:00
41c3628eeb add new lang text 2023-03-06 14:51:13 +07:00
26be14bf0e add new lang text 2023-03-06 14:51:05 +07:00
1315621259 check notification 2023-03-06 14:50:55 +07:00
b10cfa2a8e add expired notification 2023-03-06 14:49:44 +07:00
3130310d9c add notification settings 2023-03-06 14:49:26 +07:00
6042538d8e Move send SMS/Wa/Telegram to class 2023-03-06 14:48:05 +07:00
976300bac7 Plugin Manager, install belum 2023-01-31 14:26:49 +07:00
d526ceb6bc Fix delete 2023-01-31 09:14:02 +07:00
d5f29a5c74 update readme 2022-12-14 15:57:20 +07:00
50e55744ec Merge pull request #12 from hotspotbilling/Development
Fixing some code to be able integrate with paypal payment gateway
2022-12-14 15:33:01 +07:00
b69552b44a add sponsors 2022-12-14 15:22:30 +07:00
51b5dbd6f7 Version 2022.12.14 2022-12-14 15:18:39 +07:00
ada4bc8b51 add translation 2022-12-14 15:08:49 +07:00
f3363856f3 Check user email and Desc History 2022-12-14 15:08:42 +07:00
376a3448b6 add postData 2022-12-14 15:08:23 +07:00
660f186004 WhatsappGateway Info 2022-12-14 15:08:14 +07:00
35667e9459 Fix registration info 2022-12-13 15:14:27 +07:00
4fe47612eb Merge pull request #4 from hotspotbilling/Development
rename sql
2022-11-18 14:22:01 +07:00
d777921fbd rename sql 2022-11-18 14:16:00 +07:00
fdbef99985 Merge pull request #3 from hotspotbilling/Development
Change design
2022-11-17 12:42:42 +07:00
7651697ae7 change table 2022-11-17 12:36:32 +07:00
1afa84e36f fixlogin and panel-primary 2022-10-17 11:57:39 +07:00
a2a3a7f0a6 hotspotbilling/phpnuxbill 2022-10-16 14:50:24 +07:00
a7e8335297 admin change to adminlte 2022-10-16 14:48:21 +07:00
9015d519c1 change to adminlte 2 2022-10-15 23:18:24 +07:00
98fe44d8aa tapi mau ganti ke paper admin aja 2022-10-13 15:19:51 +07:00
79c7ad1d98 bulma started 2022-10-13 14:00:54 +07:00
565f481a65 fix menu ? 2022-10-12 16:51:29 +07:00
658aa73540 add random anti cache 2022-10-10 10:50:13 +07:00
d7bdec6f29 check version 2022-10-10 10:49:01 +07:00
4f300df828 version file 2022-10-10 10:26:05 +07:00
e477bc90cc Fix Mobile Nav not open when cliecked 2022-10-09 19:43:48 +07:00
6033901886 masuk radius 2022-10-05 10:51:18 +07:00
0ca2dc2029 update install 2022-10-04 10:06:38 +07:00
ef7d122464 update readme and install files 2022-10-04 10:06:28 +07:00
89e0dd9380 Fix Pools 2022-10-03 11:03:56 +07:00
d7d9d9efa1 $_c ke $config 2022-09-21 14:15:00 +07:00
e7e32475cc add templat dir 2022-09-19 16:57:09 +07:00
3ff2e31ccf delete payment gateway 2022-09-19 10:45:50 +07:00
d5c3c23794 payment gateway not included 2022-09-19 10:45:37 +07:00
335c5e524b move config.php and install to root 2022-09-19 09:31:35 +07:00
ac813ca132 simplified Mikrotik Connection 2022-09-18 00:52:39 +07:00
e6f8826490 add hook 2022-09-18 00:00:40 +07:00
742e0df1f2 add menu hook 2022-09-17 22:34:55 +07:00
1c63cd674c no themes 2022-09-17 21:05:24 +07:00
b943a73cb4 fix separator with DIRECTORY_SEPARATOR 2022-09-17 21:03:47 +07:00
0b02b070d3 Merge remote-tracking branch 'origin/master' into Development 2022-09-16 14:21:03 +07:00
a502919165 fix installation 2022-09-16 14:20:42 +07:00
3f92e39185 Create FUNDING.yml 2022-09-16 14:00:22 +07:00
6c69dacdef Merge pull request #39 from ibnux/Development
- Add Router check before save
- Add Telegram Notification for Admin
- Username must phone number
- Add SMS and Whatsapp Notification, this will force user to validate their phone number
- Add Payment Gateway
- Enable and Disable Router/Plan
- Add Tawk.to chat support
2022-09-16 13:57:34 +07:00
1c18f6091d fix payment gateway and table 2022-09-16 11:38:03 +07:00
b6204a5f94 fix recharge 2022-09-16 11:19:53 +07:00
061224b469 plugin system for payment gateway 2022-09-16 11:05:33 +07:00
0bd6c9e3c7 add merge spanish lang 2022-09-15 11:51:02 +07:00
665e05deed Merge remote-tracking branch 'origin/master' into Development 2022-09-15 11:48:48 +07:00
3fa4282848 update README 2022-09-15 11:45:43 +07:00
4906768a02 Merge pull request #35 from alucard2303/patch-3
Update phpmixbill.sql for Spanish language
2022-09-14 19:11:16 +07:00
a860708a10 Merge pull request #34 from alucard2303/patch-2
Spanish language
2022-09-14 19:10:26 +07:00
cef6e2a2f6 Duitku ok 2022-09-14 16:54:29 +07:00
8a8c7f897f change to pg- and add duitku 2022-09-14 15:58:12 +07:00
48350941e9 add untranslated language 2022-09-11 11:04:41 +07:00
4067f3fa9a change table structure 2022-09-11 11:04:31 +07:00
3653fcbf87 fix history 2022-09-11 11:02:55 +07:00
9ca2933b5d get unpaid 2022-09-11 11:02:30 +07:00
98b592c8a9 fix wrong name 2022-09-11 11:02:21 +07:00
4d84efcf83 change menu, show history, show unpaid 2022-09-11 11:02:10 +07:00
9154c10c45 Lang class 2022-09-10 16:08:10 +07:00
a7fd02df12 order Button 2022-09-10 16:06:38 +07:00
4a6ea093c1 Payment Gateway Tripay done 2022-09-10 16:01:51 +07:00
5ce70b972b Drop Midtrans 2022-09-10 12:20:45 +07:00
71e8b8e22f midtrans succes paid, but will be drop 2022-09-10 12:17:38 +07:00
dd46273a04 midtrans pay, but not yet validated 2022-09-09 16:46:39 +07:00
e9d67ce220 make update script 2022-09-09 09:53:21 +07:00
46e534af6c without sales text 2022-09-08 17:11:15 +07:00
8d7b1c6ff0 xendit without callback OK 2022-09-08 17:09:21 +07:00
65666ac998 latest structure 2022-09-08 16:32:12 +07:00
99f9f73a70 dont show disabled plan and routers 2022-09-08 14:00:46 +07:00
6afcdfe1fa page Editor 2022-09-08 10:54:35 +07:00
4fa341d854 Enable disable router and plan 2022-09-08 10:43:46 +07:00
464f41ef16 Persiapan Radius Mode 2022-09-07 16:11:35 +07:00
19f79680ff Hashtag for telegram 2022-09-07 15:28:59 +07:00
6c64d0944f walled garden example 2022-09-07 15:09:56 +07:00
40d77bba7b add tawk to and example walled garden 2022-09-07 15:07:40 +07:00
b7394762b3 update tabel installer 2022-09-07 14:50:02 +07:00
a84095b13b SMS OTP registration 2022-09-07 14:44:20 +07:00
8b7001b5ef tripay pg and list channels 2022-09-07 14:44:04 +07:00
41aa9f74ea change template, no themes 2022-09-06 10:31:33 +07:00
deecd28cf7 set payment gateway 2022-09-06 10:31:22 +07:00
9dd85dc38e Change Header 2022-09-05 15:12:00 +07:00
e6eff99632 Minutes and Hour Plan Validity 2022-09-05 15:11:22 +07:00
ba83833e94 notif recharge to user 2022-09-02 15:44:22 +07:00
a0dc6c7274 notif to telegram 2022-09-01 15:35:54 +07:00
dd116ee248 Registration no need has voucher 2022-09-01 14:52:32 +07:00
719e7deb93 Update phpmixbill.sql 2022-08-28 19:34:44 -05:00
15ecd120e1 Create common.lan.php 2022-08-28 19:19:06 -05:00
eb3c84d333 change pages 2022-08-24 11:40:26 +07:00
6eaede3c6e Show error, and fix IP Port custom 2022-08-23 16:33:21 +07:00
293 changed files with 9873 additions and 22695 deletions

4
.github/FUNDING.yml vendored Normal file
View File

@ -0,0 +1,4 @@
# These are supported funding model platforms
github: ibnux
custom: ['https://paypal.me/ibnux','https://trakteer.id/ibnux']

17
.gitignore vendored
View File

@ -1,6 +1,19 @@
system/config.php
config.php
.DS_Store
.vscode/
ui/compiled/*.php
ui/cache/*.php
test.php
test.php
pages/
system/cache/**
system/plugin/*
!system/cache/index.html
!system/plugin/index.html
system/paymentgateway/ui/**
system/paymentgateway/**
!system/paymentgateway/ui/
!system/paymentgateway/ui/index.html
!system/paymentgateway/index.html
!system/plugin/ui/
system/plugin/ui/*
!system/plugin/ui/index.html

136
README.md
View File

@ -1,86 +1,132 @@
# PHP Mikrotik Billing
----
# PHPNuxBill - Mikrotik Billing
![N|phpmixbill](http://4.bp.blogspot.com/-3OWL5OI7pqU/VjocUDdzMDI/AAAAAAAAAiA/s_XJN0_mDlk/s640/Screenshot_8.png)
## Feature
----
This project maintained by [@ibnux](https://twitter.com/ibnux)
Aplikasi ini dikelola oleh [@ibnux](https://twitter.com/ibnux)
----
Download [Mikrotik Login Template](https://github.com/ibnux/phpmixbill-mikrotik-login-template)
Features:
----
- Voucher Generator and Print
- Self registration, user must have voucher before registration
- Self registration
- Multi Router Mikrotik
- Hotspot & PPPOE
- Easy Installation
- Multi Language
- Payment Gateway Midtrans, Xendit and Tripay
- SMS validation for login
- Whatsapp Notification to Consumer
- Telegram Notification for Admin
TODOS:
----
## Payment Gateway
- SMS Notification to user
- send receipt via SMS or EMAIL
- Social Media Login
- [Tripay.com](https://github.com/hotspotbilling/phpnuxbill-tripay) | Indonesia
- [Xendit.com](https://github.com/hotspotbilling/phpnuxbill-xendit) | Indonesia and Philippine ( Philippine not tested )
- [Duitku.com](https://github.com/hotspotbilling/phpnuxbill-duitku) | Indonesia
Installation
----
See [WIKI](https://github.com/ibnux/phpmixbill/wiki/Instalation)
Click link to download
baca [WIKI](https://github.com/ibnux/phpmixbill/wiki/Instalation)
Goto Discussionif you want another Payment Gateway
System Requirements
----
Most current web servers with PHP & MySQL installed will be capable of running PHPMixBill
Some documentation
## System Requirements
Most current web servers with PHP & MySQL installed will be capable of running PHPNuxBill
Minimum Requirements
- Linux or Windows OS
- PHP Version 5.3+
- PHP Version 7.2+
- Both PDO & MySQLi Support
- GD2 Image Library
- CURL support
- MySQL Version 4.1.x and above
can be Installed in Raspberry Pi Device.
The problem with windows is hard to set cronjob, better Linux
JASA
----
Terima jasa instalasi PHPMIXBILL beserta mikrotiknya.
## Installation
Via Team Viewer maupun Barang dibeli dari saya dan tinggal pakai.
### Git Clone
1. Unit Mikrotik Router
2. Raspberry Pi Server (RasPi + Casing + Memory 4GB + Adaptor)
clone this repository or download zip or release
Jasa kurang lebih Rp. 500.000, belum termasuk ongkir dan harga perangkat, Gratis Tanya Jawab via Messenger (Jika lagi senggang).
1. Rename **pages_template** to **pages**
2. Rename **config.sample.php** to **config.php** and make it writeable (chmod 777)
3. make writeable folder **ui/cache/** and **ui/compiled**
4. Open web and run installation
5. set [cronjob](https://github.com/hotspotbilling/phpnuxbill/wiki/Cron-Jobs) or scheduller for **system/cron.php**
6. make **config.php** unwriteable (chmod 644)
hubungi ibnux di [Twitter](https://twitter.com/ibnux) atau di [facebook](https://facebook.com/ibnumaksum)
### Composer install
Go to directory you want to install
Install Composer in your system
License
----
```bash
# Debian/Ubuntu
sudo apt install composer
# Centos/Redhat
sudo yum install composer
```
install on curent directory
```bash
composer create-project hotspotbilling/phpnuxbill .
```
install on new directory
```bash
composer create-project hotspotbilling/phpnuxbill phpnuxbill
```
## Manual Installation
1. Download project from [Master Branch](https://github.com/hotspotbilling/phpnuxbill/archive/refs/heads/master.zip) or from [Release](https://github.com/hotspotbilling/phpnuxbill/releases)
2. unzip and upload it to server
3. Rename **pages_template** to **pages**
4. Rename **config.sample.php** to **config.php** and make it writeable (chmod 777)
5. make writeable folder **ui/cache/** and **ui/compiled**
6. Open web and run installation
7. set [cronjob](https://github.com/hotspotbilling/phpnuxbill/wiki/Cron-Jobs) or scheduller for **system/cron.php**
8. make **config.php** unwriteable (chmod 644)
## UPDGRADE
for old version, below Version 6, backup **system/config.php**, delete all file except folder **pages**, upload all new files, put **config.php** in root folder (not in system folder), got to folder **/install** and run Update.
for version 6 above, just replace all files, using filezilla can choose overwrite if different file size or time.
or git pull if you use git clone
## RADIUS system
Still on development
## Paid Support
Start from Rp 500.000 or $50
[Telegram](https://t.me/ibnux)
[Website](https://ibnux.net/layanan)
## License
GNU General Public License version 2 or later
see LICENSE file
## Donate to ibnux
Donate to ibnux
----
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6RBNGRJMZVV7C)
[![Donate](https://img.shields.io/badge/Donate-PayPal-green.svg)](https://paypal.me/ibnux)
BCA: 5410454825
Mandiri: 163-000-1855-793
a.n Ibnu Maksum
## SPONSORS
- [mlink.id](https://mlink.id)
- [https://github.com/sonyinside](https://github.com/sonyinside)

View File

@ -1,11 +1,6 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
header('location: ../index.php?_route=admin/');

16
composer.json Normal file
View File

@ -0,0 +1,16 @@
{
"name": "hotspotbilling/phpnuxbill",
"type": "template",
"description": "PHPNuxBill a Hotspot Billing Software.",
"keywords": ["template"],
"homepage": "https://github.com/hotspotbilling/phpnuxbill",
"license": "MIT",
"authors": [
{
"name": "ibnux",
"email": "me@ibnux.net",
"homepage": "https://ibnux.net",
"role": "Developer"
}
]
}

View File

@ -1,9 +1,9 @@
<?php
$db_host = "localhost"; # Database Host
$db_port = ""; # Database Port. Keep it blank if you are un sure.
$db_user = "root"; # Database Username
$db_password = ""; # Database Password
$db_name = "phpmixbill"; # Database Name
define('APP_URL', 'http://localhost/phpmixbill'); # Application URL.
#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
<?php
$db_host = "localhost"; # Database Host
$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.
#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

View File

@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PHPMIXBILL - Voucher management for Mikrotik Hotspot</title>
<title>PHPNUXBILL - Voucher management for Mikrotik Hotspot</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
@ -35,28 +35,28 @@
<div class="container">
<div class="starter-template">
<h1>PHP PHPMIXBILL</h1>
<h1>PHP PHPNUXBILL</h1>
<p class="lead">Aplikasi manajemen Voucher Hotspot untuk Mikrotik</p>
<div class="btn-group btn-group-justified" role="group">
<a href="https://github.com/ibnux/phpmixbill/releases" class="btn btn-primary">Download</a>
<a href="https://github.com/ibnux/phpmixbill" class="btn btn-success">Source</a>
<a href="https://github.com/hotspotbilling/phpnuxbill/releases" class="btn btn-primary">Download</a>
<a href="https://github.com/hotspotbilling/phpnuxbill" class="btn btn-success">Source</a>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="panel panel-hovered mb20 panel-default">
<div class="panel panel-hovered mb20 panel-primary">
<div class="panel-heading">Public Disquss</div>
<div class="panel-body">
<div id="disqus_thread"></div>
<script>
var disqus_config = function () {
this.page.url = "https://ibnux.github.io/phpmixbill/diskusi.html"; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = "phpmixbill"; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
this.page.url = "https://github.com/hotspotbilling/phpnuxbill/diskusi.html"; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = "phpnuxbill"; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://phpmixbill.disqus.com/embed.js';
s.src = 'https://phpnuxbill.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();

View File

@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>PHPMIXBILL - Voucher management for Mikrotik Hotspot</title>
<title>PHPNUXBILL - Voucher management for Mikrotik Hotspot</title>
<!-- Latest compiled and minified CSS -->
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" integrity="sha384-BVYiiSIFeK1dGmJRAkycuHAHRg32OmUcww7on3RYdg4Va+PmSTsz/K68vbdEjh4u" crossorigin="anonymous">
@ -36,12 +36,12 @@
<div class="container">
<div class="starter-template">
<h1>PHPMIXBILL</h1>
<h1>PHPNUXBILL</h1>
<p class="lead">Aplikasi manajemen Voucher Hotspot untuk Mikrotik</p>
<div class="btn-group btn-group-justified" role="group">
<a href="https://github.com/ibnux/phpmixbill/releases" class="btn btn-primary">Download</a>
<a href="https://github.com/ibnux/phpmixbill" class="btn btn-success">Source</a>
<a href="https://ibnux.github.io/phpmixbill/diskusi.html" class="btn btn-info">Disquss</a>
<a href="https://github.com/hotspotbilling/phpnuxbill/releases" class="btn btn-primary">Download</a>
<a href="https://github.com/hotspotbilling/phpnuxbill" class="btn btn-success">Source</a>
<a href="https://github.com/hotspotbilling/phpnuxbill/discussions" class="btn btn-info">Discussions</a>
</div>
</div>

View File

@ -1,14 +1,7 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
//ini_set('display_errors', 1);
//ini_set('display_startup_errors', 1);
//error_reporting(E_ALL);
require ('system/boot.php');
App::_run();

View File

Before

Width:  |  Height:  |  Size: 6.6 KiB

After

Width:  |  Height:  |  Size: 6.6 KiB

View File

Before

Width:  |  Height:  |  Size: 8.1 KiB

After

Width:  |  Height:  |  Size: 8.1 KiB

60
install/index.php Normal file
View File

@ -0,0 +1,60 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>PHPNuxBill Installer</title>
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type='text/css' href='css/style.css' rel='stylesheet' />
<link href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body style='background-color: #FBFBFB;'>
<div id='main-container'>
<div class='header'>
<div class="header-box wrapper">
<div class="hd-logo"><a href="#"><img src="img/logo.png" alt="Logo" /></a></div>
</div>
</div>
<!-- contents area start -->
<div class="row">
<div class="col-md-12">
<h4> PHPNuxBill Installer </h4>
<h5>Please Read Before Continue</h5>
<p><strong>Informasi Aplikasi</strong><br>
Application Name: PHPNuxBill <br>
Release Date: 30/10/2015<br>
By: PHPNuxBill [ <a href="https://github.com/hotspotbilling/phpnuxbill" target="_blank">https://github.com/hotspotbilling/phpnuxbill</a> ]<br>
Donasi Paypal: <b>me@ibnux.et</b><br>
<br>
<strong>Syarat Penggunaan:</strong><br>
Syarat Penggunaan ini berlaku untuk semua versi.<br><br>
<ul>
<li>Silahkan Anda menggunakan aplikasi ini dengan bijak, Anda dapat mendesain ulang script maupun tampilan pada
aplikasi ini sesuai dengan kebutuhan anda, memperbayak jumlah copy atau mendistribusikan aplikasi ini.
Dengan catatan tidak menghapus link developer.</li>
<li>Tidak ada garansi dari kami jika anda mengalami error atau merasa rugi ketika menggunakan aplikasi ini,
Anda hanya dapat memberikan feedback yang berisi laporan error, dengan syarat dan ketentuan yang berlaku.</li>
<li>Semua yang terkait biaya atau donasi apapun versi-nya, Anda dapat update seumur hidup atau selama aplikasi
ini masih dikembangkan. Mohon jangan salah pengertian bahwa kami tim pengembang mengkomersilkan produk ini
dan anda membeli produk kami.</li>
<li>Aplikasi ini bersifat sosial untuk dapat dikembangkan bersama. Karena itu kami juga mengundang relawan-relawan
yang mau menjadi pengembangkan aplikasi ini.</li>
<li>Penulis berhak setiap saat untuk mengubah ketentuan Syarat Penggunaan tanpa pemberitahuan sebelumnya.</li>
</ul>
</div>
<div class="col-md-12"><br>
<a href="step2.php" class="btn btn-primary">Accept &amp; Continue</a>
</div>
</div>
<!-- contents area end -->
</div>
<div class="footer">Copyright &copy; 2021 PHPNuxBill. All Rights Reserved<br /><br /></div>
</body>
</html>

619
install/phpnuxbill.sql Normal file
View File

@ -0,0 +1,619 @@
--
-- Database: `phpnuxbill`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_appconfig`
--
CREATE TABLE
`tbl_appconfig` (
`id` int(11) NOT NULL,
`setting` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`value` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_bandwidth`
--
CREATE TABLE
`tbl_bandwidth` (
`id` int(10) UNSIGNED NOT NULL,
`name_bw` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`rate_down` int(10) UNSIGNED NOT NULL,
`rate_down_unit` enum('Kbps', 'Mbps') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`rate_up` int(10) UNSIGNED NOT NULL,
`rate_up_unit` enum('Kbps', 'Mbps') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_customers`
--
CREATE TABLE
`tbl_customers` (
`id` int(10) NOT NULL,
`username` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`password` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`fullname` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`address` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
`phonenumber` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0',
`email` varchar(128) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '1',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`last_login` datetime DEFAULT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_language`
--
CREATE TABLE
`tbl_language` (
`id` int(10) NOT NULL,
`name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`folder` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`author` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_logs`
--
CREATE TABLE
`tbl_logs` (
`id` int(10) NOT NULL,
`date` datetime DEFAULT NULL,
`type` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`description` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`userid` int(10) NOT NULL,
`ip` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_message`
--
CREATE TABLE
`tbl_message` (
`id` int(10) NOT NULL,
`from_user` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`to_user` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`title` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`message` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`status` enum('0', '1') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0',
`date` datetime NOT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_payment_gateway`
--
CREATE TABLE
`tbl_payment_gateway` (
`id` int(11) NOT NULL,
`username` varchar(32) COLLATE utf8mb4_general_ci NOT NULL,
`gateway` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'xendit | midtrans',
`gateway_trx_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`plan_id` int(11) NOT NULL,
`plan_name` varchar(40) COLLATE utf8mb4_general_ci NOT NULL,
`routers_id` int(11) NOT NULL,
`routers` varchar(32) COLLATE utf8mb4_general_ci NOT NULL,
`price` varchar(40) COLLATE utf8mb4_general_ci NOT NULL,
`pg_url_payment` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`payment_method` varchar(64) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`payment_channel` varchar(64) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`pg_request` text COLLATE utf8mb4_general_ci,
`pg_paid_response` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
`expired_date` datetime DEFAULT NULL,
`created_date` datetime NOT NULL,
`paid_date` datetime DEFAULT NULL,
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1 unpaid 2 paid 3 failed 4 canceled'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_plans`
--
CREATE TABLE
`tbl_plans` (
`id` int(10) NOT NULL,
`name_plan` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`id_bw` int(10) NOT NULL,
`price` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`type` enum('Hotspot', 'PPPOE') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`typebp` enum('Unlimited', 'Limited') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`limit_type` enum(
'Time_Limit',
'Data_Limit',
'Both_Limit'
) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`time_limit` int(10) UNSIGNED DEFAULT NULL,
`time_unit` enum('Mins', 'Hrs') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`data_limit` int(10) UNSIGNED DEFAULT NULL,
`data_unit` enum('MB', 'GB') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`validity` int(10) NOT NULL,
`validity_unit` enum('Mins', 'Hrs', 'Days', 'Months') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`shared_users` int(10) DEFAULT NULL,
`routers` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`pool` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0 disabled\r\n'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_pool`
--
CREATE TABLE
`tbl_pool` (
`id` int(10) NOT NULL,
`pool_name` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`range_ip` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`routers` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_routers`
--
CREATE TABLE
`tbl_routers` (
`id` int(10) NOT NULL,
`name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`ip_address` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`password` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`description` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0 disabled'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_transactions`
--
CREATE TABLE
`tbl_transactions` (
`id` int(10) NOT NULL,
`invoice` varchar(25) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`username` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`plan_name` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`price` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`recharged_on` date NOT NULL,
`expiration` date NOT NULL,
`time` time NOT NULL,
`method` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`routers` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`type` enum('Hotspot', 'PPPOE') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_users`
--
CREATE TABLE
`tbl_users` (
`id` int(10) UNSIGNED NOT NULL,
`username` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`fullname` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`password` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`user_type` enum('Admin', 'Sales') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`status` enum('Active', 'Inactive') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'Active',
`last_login` datetime DEFAULT NULL,
`creationdate` datetime NOT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_user_recharges`
--
CREATE TABLE
`tbl_user_recharges` (
`id` int(10) NOT NULL,
`customer_id` int(10) NOT NULL,
`username` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`plan_id` int(10) NOT NULL,
`namebp` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`recharged_on` date NOT NULL,
`expiration` date NOT NULL,
`time` time NOT NULL,
`status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`method` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`routers` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`type` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_voucher`
--
CREATE TABLE
`tbl_voucher` (
`id` int(10) NOT NULL,
`type` enum('Hotspot', 'PPPOE') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`routers` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`id_plan` int(10) NOT NULL,
`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
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
--
-- Indexes for dumped tables
--
--
-- Indeks untuk tabel `tbl_appconfig`
--
ALTER TABLE `tbl_appconfig` ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_bandwidth`
--
ALTER TABLE `tbl_bandwidth` ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_customers`
--
ALTER TABLE `tbl_customers` ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_language`
--
ALTER TABLE `tbl_language` ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_logs`
--
ALTER TABLE `tbl_logs` ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_message`
--
ALTER TABLE `tbl_message` ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_payment_gateway`
--
ALTER TABLE `tbl_payment_gateway` ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_plans`
--
ALTER TABLE `tbl_plans` ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_pool`
--
ALTER TABLE `tbl_pool` ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_routers`
--
ALTER TABLE `tbl_routers` ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_transactions`
--
ALTER TABLE `tbl_transactions` ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_users`
--
ALTER TABLE `tbl_users` ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_user_recharges`
--
ALTER TABLE `tbl_user_recharges` ADD PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_voucher`
--
ALTER TABLE `tbl_voucher` ADD PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT untuk tabel yang dibuang
--
--
-- AUTO_INCREMENT untuk tabel `tbl_appconfig`
--
ALTER TABLE
`tbl_appconfig` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_bandwidth`
--
ALTER TABLE
`tbl_bandwidth` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_customers`
--
ALTER TABLE
`tbl_customers` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_language`
--
ALTER TABLE
`tbl_language` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_logs`
--
ALTER TABLE `tbl_logs` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_message`
--
ALTER TABLE
`tbl_message` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_payment_gateway`
--
ALTER TABLE
`tbl_payment_gateway` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_plans`
--
ALTER TABLE
`tbl_plans` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_pool`
--
ALTER TABLE `tbl_pool` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_routers`
--
ALTER TABLE
`tbl_routers` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_transactions`
--
ALTER TABLE
`tbl_transactions` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_users`
--
ALTER TABLE
`tbl_users` MODIFY `id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_user_recharges`
--
ALTER TABLE
`tbl_user_recharges` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_voucher`
--
ALTER TABLE
`tbl_voucher` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT;
COMMIT;
--
-- Dumping data untuk tabel `tbl_appconfig`
--
INSERT INTO
`tbl_appconfig` (`id`, `setting`, `value`)
VALUES (1, 'CompanyName', 'PHPNuxBill'), (2, 'currency_code', 'Rp.'), (3, 'language', 'indonesia'), (4, 'show-logo', '1'), (5, 'nstyle', 'blue'), (6, 'timezone', 'Asia/Jakarta'), (7, 'dec_point', ','), (8, 'thousands_sep', '.'), (9, 'rtl', '0'), (10, 'address', ''), (11, 'phone', ''), (12, 'date_format', 'd M Y'), (13, 'note', 'Thank you...');
--
-- Dumping data untuk tabel `tbl_users`
--
INSERT INTO
`tbl_users` (
`id`,
`username`,
`fullname`,
`password`,
`user_type`,
`status`,
`last_login`,
`creationdate`
)
VALUES (
1,
'admin',
'Administrator',
'd033e22ae348aeb5660fc2140aec35850c4da997',
'Admin',
'Active',
'2022-09-06 16:09:50',
'2014-06-23 01:43:07'
);
--
-- Dumping data untuk tabel `tbl_language`
--
INSERT INTO
`tbl_language` (
`id`,
`name`,
`folder`,
`author`
)
VALUES (
1,
'Indonesia',
'indonesia',
'Ismail Marzuqi'
), (
2,
'English',
'english',
'Ismail Marzuqi'
), (
3,
'Spanish',
'spanish',
'Luis Hernandez'
), (
4,
'Türkçe',
'turkish',
'Goktug Bogac Ogel'
);

70
install/step2.php Normal file
View File

@ -0,0 +1,70 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>PHPNuxBill Installer</title>
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type='text/css' href='css/style.css' rel='stylesheet' />
<link type='text/css' href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body style='background-color: #FBFBFB;'>
<div id='main-container'>
<div class='header'>
<div class="header-box wrapper">
<div class="hd-logo"><a href="#"><img src="img/logo.png" alt="Logo" /></a></div>
</div>
</div>
<div class="span12">
<h4> PHPNuxBill Installer </h4>
<?php
$passed = '';
$ltext = '';
if (version_compare(PHP_VERSION, '7.2.0') >= 0) {
$ltext .= 'To Run PHPNuxBill You need at least PHP version 7.2.0, Your PHP Version is: ' . PHP_VERSION . " Tested <strong>---PASSED---</strong><br/>";
$passed .= '1';
} else {
$ltext .= 'To Run PHPNuxBill You need at least PHP version 7.2.0, Your PHP Version is: ' . PHP_VERSION . " Tested <strong>---FAILED---</strong><br/>";
$passed .= '0';
}
if (extension_loaded('PDO')) {
$ltext .= 'PDO is installed on your server: ' . "Tested <strong>---PASSED---</strong><br/>";
$passed .= '1';
} else {
$ltext = 'PDO is installed on your server: ' . "Tested <strong>---FAILED---</strong><br/>";
$passed .= '0';
}
if (extension_loaded('pdo_mysql')) {
$ltext .= 'PDO MySQL driver is enabled on your server: ' . "Tested <strong>---PASSED---</strong><br/>";
$passed .= '1';
} else {
$ltext .= 'PDO MySQL driver is not enabled on your server: ' . "Tested <strong>---FAILED---</strong><br/>";
$passed .= '0';
}
if ($passed == '111') {
echo ("<br/> $ltext <br/> Great! System Test Completed. You can run PHPNuxBill on your server. Click Continue For Next Step.
<br><br>
<a href=\"step3.php\" class=\"btn btn-primary\">Continue</a><br><br><a href=\"update.php\" class=\"btn btn-primary\">Update System</a>");
} else {
echo ("<br/> $ltext <br/> Sorry. The requirements of PHPNuxBill is not available on your server.
Please contact with us- iesien22@yahoo.com with this code- $passed Or contact with your server administrator
<br><br>
<a href=\"#\" class=\"btn btn-primary disabled\">Correct The Problem To Continue</a>");
}
?>
</div>
</div>
<div class="footer">Copyright &copy; 2021 PHPNuxBill. All Rights Reserved<br /><br /></div>
</body>
</html>

View File

@ -1,72 +1,72 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>PHPMixBill Installer</title>
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type='text/css' href='css/style.css' rel='stylesheet'/>
<link type='text/css' href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body style='background-color: #FBFBFB;'>
<div id='main-container'>
<div class='header'>
<div class="header-box wrapper">
<div class="hd-logo"><a href="#"><img src="img/logo.png" alt="Logo"/></a></div>
</div>
</div>
<div class="span12">
<h4> PHPMixBill Installer </h4>
<?php
if (isset($_GET['_error']) && ($_GET['_error']) == '1') {
echo '<h4 style="color: red;"> Unable to Connect Database, Please make sure database info is correct and try again ! </h4>';
}
$cururl = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$appurl = str_replace('/install/step3.php', '', $cururl);
$appurl = str_replace('?_error=1', '', $appurl);
$appurl = str_replace('/system', '', $appurl);
?>
<form action="step4.php" method="post">
<fieldset>
<legend>Database Connection &amp Site config</legend>
<div class="form-group">
<label for="appurl">Application URL</label>
<input type="text" class="form-control" id="appurl" name="appurl" value="<?php echo $appurl; ?>">
<span class='help-block'>Application url without trailing slash at the end of url (e.g. http://172.16.10.10). Please keep default, if you are unsure.</span>
</div>
<div class="form-group">
<label for="dbhost">Database Host</label>
<input type="text" class="form-control" id="dbhost" name="dbhost">
</div>
<div class="form-group">
<label for="dbuser">Database Username</label>
<input type="text" class="form-control" id="dbuser" name="dbuser">
</div>
<div class="form-group">
<label for="dbpass">Database Password</label>
<input type="text" class="form-control" id="dbpass" name="dbpass">
</div>
<div class="form-group">
<label for="dbname">Database Name</label>
<input type="text" class="form-control" id="dbname" name="dbname">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</fieldset>
</form>
</div>
</div>
<div class="footer">Copyright &copy; 2021 PHPMixBill. All Rights Reserved<br/><br/></div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head>
<title>PHPNuxBill Installer</title>
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type='text/css' href='css/style.css' rel='stylesheet'/>
<link type='text/css' href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body style='background-color: #FBFBFB;'>
<div id='main-container'>
<div class='header'>
<div class="header-box wrapper">
<div class="hd-logo"><a href="#"><img src="img/logo.png" alt="Logo"/></a></div>
</div>
</div>
<div class="span12">
<h4> PHPNuxBill Installer </h4>
<?php
if (isset($_GET['_error']) && ($_GET['_error']) == '1') {
echo '<h4 style="color: red;"> Unable to Connect Database, Please make sure database info is correct and try again ! </h4>';
}//
$cururl = (((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')|| $_SERVER['SERVER_PORT'] == 443)?'https':'http').'://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$appurl = str_replace('/install/step3.php', '', $cururl);
$appurl = str_replace('?_error=1', '', $appurl);
$appurl = str_replace('/system', '', $appurl);
?>
<form action="step4.php" method="post">
<fieldset>
<legend>Database Connection &amp Site config</legend>
<div class="form-group">
<label for="appurl">Application URL</label>
<input type="text" class="form-control" id="appurl" name="appurl" value="<?php echo $appurl; ?>">
<span class='help-block'>Application url without trailing slash at the end of url (e.g. http://172.16.10.10). Please keep default, if you are unsure.</span>
</div>
<div class="form-group">
<label for="dbhost">Database Host</label>
<input type="text" class="form-control" id="dbhost" name="dbhost">
</div>
<div class="form-group">
<label for="dbuser">Database Username</label>
<input type="text" class="form-control" id="dbuser" name="dbuser">
</div>
<div class="form-group">
<label for="dbpass">Database Password</label>
<input type="text" class="form-control" id="dbpass" name="dbpass">
</div>
<div class="form-group">
<label for="dbname">Database Name</label>
<input type="text" class="form-control" id="dbname" name="dbname">
</div>
<button type="submit" class="btn btn-primary">Submit</button>
</fieldset>
</form>
</div>
</div>
<div class="footer">Copyright &copy; 2021 PHPNuxBill. All Rights Reserved<br/><br/></div>
</body>
</html>

View File

@ -1,107 +1,122 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
**/
//error_reporting (0);
$appurl = $_POST['appurl'];
$db_host = $_POST['dbhost'];
$db_user = $_POST['dbuser'];
$db_password = $_POST['dbpass'];
$db_name = $_POST['dbname'];
$cn = '0';
try{
$dbh = new pdo( "mysql:host=$db_host;dbname=$db_name",
"$db_user",
"$db_password",
array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
$cn = '1';
}
catch(PDOException $ex){
$cn = '0';
}
if ($cn == '1') {
$input = '<?php
$db_host = \'' . $db_host . '\';
$db_user = \'' . $db_user . '\';
$db_password = \'' . $db_password . '\';
$db_name = \'' . $db_name . '\';
define(\'APP_URL\', \'' . $appurl . '\');
$_app_stage = \'Live\';';
$wConfig = "../config.php";
$fh = fopen($wConfig, 'w') or die("Can't create config file, your server does not support 'fopen' function,
please create a file named - config.php with following contents- <br/>$input");
fwrite($fh, $input);
fclose($fh);
$sql = file_get_contents('phpmixbill.sql');
$qr = $dbh->exec($sql);
} else {
header("location: step3.php?_error=1");
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>PHPMixBill Installer</title>
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type='text/css' href='css/style.css' rel='stylesheet'/>
<link type='text/css' href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body style='background-color: #FBFBFB;'>
<div id='main-container'>
<div class='header'>
<div class="header-box wrapper">
<div class="hd-logo"><a href="#"><img src="img/logo.png" alt="Logo"/></a></div>
</div>
</div>
<div class="span12">
<h4> PHPMixBill Installer </h4>
<?php
if ($cn == '1') {
?>
<p><strong>Config File Created and Database Imported.</strong><br></p>
<form action="step5.php" method="post">
<fieldset>
<legend>Click Continue</legend>
<button type='submit' class='btn btn-primary'>Continue</button>
</fieldset>
</form>
<?php
} elseif ($cn == '2') {
?>
<p> MySQL Connection was successfull. An error occured while adding data on MySQL. Unsuccessfull
Installation. Please refer manual installation in the website github.com/ibnux/phpmixbill or Contact phpmixbill@ibnux.com for
helping on installation</p>
<?php
} else {
?>
<p> MySQL Connection Failed.</p>
<?php
}
?>
</div>
</div>
<div class="footer">Copyright &copy; 2021 PHPMixBill. All Rights Reserved<br/><br/></div>
</body>
</html>
<?php
/**
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
//error_reporting (0);
$appurl = $_POST['appurl'];
$db_host = $_POST['dbhost'];
$db_user = $_POST['dbuser'];
$db_password = $_POST['dbpass'];
$db_name = $_POST['dbname'];
$cn = '0';
try{
$dbh = new pdo( "mysql:host=$db_host;dbname=$db_name",
"$db_user",
"$db_password",
array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
$cn = '1';
}
catch(PDOException $ex){
$cn = '0';
}
if ($cn == '1') {
$input = '<?php
define(\'APP_URL\', \'' . $appurl . '\');
$_app_stage = \'Live\';
// Database PHPNuxBill
$db_host = \'' . $db_host . '\';
$db_user = \'' . $db_user . '\';
$db_password = \'' . $db_password . '\';
$db_name = \'' . $db_name . '\';
// Database Radius
$radius_host = \'' . $db_host . '\';
$radius_user = \'' . $db_user . '\';
$radius_pass = \'' . $db_password . '\';
$radius_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);
}
';
$wConfig = "../config.php";
$fh = fopen($wConfig, 'w') or die("Can't create config file, your server does not support 'fopen' function,
please create a file named - config.php with following contents- <br/>$input");
fwrite($fh, $input);
fclose($fh);
$sql = file_get_contents('phpnuxbill.sql');
$qr = $dbh->exec($sql);
} else {
header("location: step3.php?_error=1");
exit;
}
?>
<!DOCTYPE html>
<html lang="en">
<head>
<title>PHPNuxBill Installer</title>
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type='text/css' href='css/style.css' rel='stylesheet'/>
<link type='text/css' href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body style='background-color: #FBFBFB;'>
<div id='main-container'>
<div class='header'>
<div class="header-box wrapper">
<div class="hd-logo"><a href="#"><img src="img/logo.png" alt="Logo"/></a></div>
</div>
</div>
<div class="span12">
<h4> PHPNuxBill Installer </h4>
<?php
if ($cn == '1') {
?>
<p><strong>Config File Created and Database Imported.</strong><br></p>
<form action="step5.php" method="post">
<fieldset>
<legend>Click Continue</legend>
<button type='submit' class='btn btn-primary'>Continue</button>
</fieldset>
</form>
<?php
} elseif ($cn == '2') {
?>
<p> MySQL Connection was successfull. An error occured while adding data on MySQL. Unsuccessfull
Installation. Please refer manual installation in the website github.com/ibnux/phpnuxbill or Contact phpnuxbill@ibnux.com for
helping on installation</p>
<?php
} else {
?>
<p> MySQL Connection Failed.</p>
<?php
}
?>
</div>
</div>
<div class="footer">Copyright &copy; 2021 PHPNuxBill. All Rights Reserved<br/><br/></div>
</body>
</html>

View File

@ -1,46 +1,46 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>PHPMixBill Installer</title>
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type='text/css' href='css/style.css' rel='stylesheet'/>
<link type='text/css' href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body style='background-color: #FBFBFB;'>
<div id='main-container'>
<div class='header'>
<div class="header-box wrapper">
<div class="hd-logo"><a href="#"><img src="img/logo.png" alt="Logo"/></a></div>
</div>
</div>
<div class="span12">
<h4> PHPMixBill Installer </h4>
<p>
<strong>Congratulations!</strong><br>
You have just install PHPMixBill !<br>
To Login Admin Portal:<br>
Use this link -
<?php
$cururl = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$appurl = str_replace('/install/step5.php', '', $cururl);
$appurl = str_replace('/system', '', $appurl);
echo '<a href="' . $appurl . '/admin">' . $appurl . '/admin</a>';
?>
<br>
Username: admin<br>
Password: 123456<br>
For security, Delete the <b>install</b> directory inside system folder.
</p>
</div>
</div>
<div class="footer">Copyright &copy; 2021 PHPMixBill. All Rights Reserved<br/><br/></div>
</body>
<!DOCTYPE html>
<html lang="en">
<head>
<title>PHPNuxBill Installer</title>
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type='text/css' href='css/style.css' rel='stylesheet'/>
<link type='text/css' href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body style='background-color: #FBFBFB;'>
<div id='main-container'>
<div class='header'>
<div class="header-box wrapper">
<div class="hd-logo"><a href="#"><img src="img/logo.png" alt="Logo"/></a></div>
</div>
</div>
<div class="span12">
<h4> PHPNuxBill Installer </h4>
<p>
<strong>Congratulations!</strong><br>
You have just install PHPNuxBill !<br>
To Login Admin Portal:<br>
Use this link -
<?php
$cururl = (((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] !== 'off')|| $_SERVER['SERVER_PORT'] == 443)?'https':'http').'://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'];
$appurl = str_replace('/install/step5.php', '', $cururl);
$appurl = str_replace('/system', '', $appurl);
echo '<a href="' . $appurl . '/admin">' . $appurl . '/admin</a>';
?>
<br>
Username: admin<br>
Password: admin<br>
For security, Delete the <b>install</b> directory inside system folder.
</p>
</div>
</div>
<div class="footer">Copyright &copy; 2021 PHPNuxBill. All Rights Reserved<br/><br/></div>
</body>
</html>

109
install/update.php Normal file
View File

@ -0,0 +1,109 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>PHPNuxBill Updaters</title>
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type='text/css' href='css/style.css' rel='stylesheet' />
<link type='text/css' href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body style='background-color: #FBFBFB;'>
<div id='main-container'>
<div class='header'>
<div class="header-box wrapper">
<div class="hd-logo"><a href="#"><img src="img/logo.png" alt="Logo" /></a></div>
</div>
</div>
<div class="span12">
<h4> PHPNuxBill Updater </h4>
<pre><?php
include '../config.php';
try{
$dbh = new pdo( "mysql:host=$db_host;dbname=$db_name",
"$db_user",
"$db_password",
array(PDO::ATTR_ERRMODE => PDO::ERRMODE_EXCEPTION));
echo "CREATE TABLE `tbl_payment_gateway` (
`id` int(11) NOT NULL,
`username` varchar(32) COLLATE utf8mb4_general_ci NOT NULL,
`gateway` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'xendit | midtrans',
`gateway_trx_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`plan_id` int(11) NOT NULL,
`plan_name` varchar(40) COLLATE utf8mb4_general_ci NOT NULL,
`routers_id` int(11) NOT NULL,
`routers` varchar(32) COLLATE utf8mb4_general_ci NOT NULL,
`price` varchar(40) COLLATE utf8mb4_general_ci NOT NULL,
`pg_url_payment` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`payment_method` varchar(32) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`payment_channel` varchar(32) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`pg_request` text COLLATE utf8mb4_general_ci,
`pg_paid_response` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
`expired_date` datetime DEFAULT NULL,
`created_date` datetime NOT NULL,
`paid_date` datetime DEFAULT NULL,
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1 unpaid 2 paid 3 failed 4 canceled'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;\n\n";
$dbh->exec("CREATE TABLE
`tbl_payment_gateway` (
`id` int(11) NOT NULL,
`username` varchar(32) COLLATE utf8mb4_general_ci NOT NULL,
`gateway` varchar(32) COLLATE utf8mb4_general_ci NOT NULL COMMENT 'xendit | midtrans',
`gateway_trx_id` varchar(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`plan_id` int(11) NOT NULL,
`plan_name` varchar(40) COLLATE utf8mb4_general_ci NOT NULL,
`routers_id` int(11) NOT NULL,
`routers` varchar(32) COLLATE utf8mb4_general_ci NOT NULL,
`price` varchar(40) COLLATE utf8mb4_general_ci NOT NULL,
`pg_url_payment` varchar(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`payment_method` varchar(32) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`payment_channel` varchar(32) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`pg_request` text COLLATE utf8mb4_general_ci,
`pg_paid_response` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
`expired_date` datetime DEFAULT NULL,
`created_date` datetime NOT NULL,
`paid_date` datetime DEFAULT NULL,
`status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '1 unpaid 2 paid 3 failed 4 canceled'
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;");
echo "ALTER TABLE `tbl_payment_gateway` ADD PRIMARY KEY (`id`);\n\n";
$dbh->exec("ALTER TABLE `tbl_payment_gateway` ADD PRIMARY KEY (`id`);");
echo "ALTER TABLE `tbl_payment_gateway` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;\n\n";
$dbh->exec("ALTER TABLE `tbl_payment_gateway` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;");
echo "ALTER TABLE `tbl_customers` ADD `email` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' AFTER `phonenumber`;\n\n";
$dbh->exec("ALTER TABLE `tbl_customers` ADD `email` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' AFTER `phonenumber`;");
echo "ALTER TABLE `tbl_plans` CHANGE `validity_unit` `validity_unit` ENUM('Mins','Hrs','Days','Months') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;\n\n";
$dbh->exec("ALTER TABLE `tbl_plans` CHANGE `validity_unit` `validity_unit` ENUM('Mins','Hrs','Days','Months') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL");
echo "ALTER TABLE `tbl_plans` ADD `enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0 disabled' AFTER `pool`;\n\n";
$dbh->exec("ALTER TABLE `tbl_plans` ADD `enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0 disabled' AFTER `pool`;");
echo "ALTER TABLE `tbl_routers` ADD `enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0 disabled' AFTER `description`;\n\n";
$dbh->exec("ALTER TABLE `tbl_routers` ADD `enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0 disabled' AFTER `description`;");
echo "ALTER TABLE `tbl_routers` CHANGE `description` `description` VARCHAR(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL;";
$dbh->exec("ALTER TABLE `tbl_routers` CHANGE `description` `description` VARCHAR(256) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT NULL;");
echo "ALTER TABLE `tbl_user_recharges` CHANGE `method` `method` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '';\n\n";
$dbh->exec("ALTER TABLE `tbl_user_recharges` CHANGE `method` `method` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '';");
echo "ALTER TABLE `tbl_transactions` CHANGE `method` `method` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;\n\n";
$dbh->exec("ALTER TABLE `tbl_transactions` CHANGE `method` `method` VARCHAR(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;");
echo "Success update database for new system <a href='/admin/'>Back To Home</a>";
}catch(PDOException $ex){
echo "Error Failed to connect to database: ".$ex->getMessage()."\n";
}
?></pre>
</div>
</div>
<div class="footer">Copyright &copy; 2021 PHPNuxBill. All Rights Reserved<br /><br /></div>
</body>
</html>

View File

@ -1,11 +1,6 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
Class Admin{

View File

@ -1,14 +1,9 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
Class App{
class App{
public static function _run(){
return true;
}

56
system/autoload/File.php Normal file
View File

@ -0,0 +1,56 @@
<?php
class File
{
public static function copyFolder($from, $to, $exclude = [])
{
echo "copyFolder($from, $to);<br>";
$files = scandir($from);
print_r($files);
foreach ($files as $file) {
if (is_file($from . $file) && !in_array($file, $exclude)) {
if (file_exists($to . $file)) unlink($to . $file);
rename($from . $file, $to . $file);
echo "rename($from$file, $to$file);<br>";
} else if (is_dir($from . $file) && !in_array($file, ['.', '..'])) {
if (!file_exists($to . $file)) {
echo "mkdir($to$file);;<br>";
mkdir($to . $file);
}
echo "File::copyFolder($from$file, $to$file);<br>";
File::copyFolder($from . $file . DIRECTORY_SEPARATOR, $to . $file . DIRECTORY_SEPARATOR);
}
}
}
public static function deleteFolder($path)
{
$files = scandir($path);
foreach ($files as $file) {
if (is_file($path . $file)) {
echo "unlink($path$file);<br>";
unlink($path . $file);
} else if (is_dir($path . $file) && !in_array($file, ['.', '..'])) {
File::deleteFolder($path . $file . DIRECTORY_SEPARATOR);
echo "rmdir($path$file);<br>";
rmdir($path . $file);
}
}
echo "rmdir($path);<br>";
rmdir($path);
}
/**
* file path fixer
*
* @access public
* @param string $path
* @return string
*/
public static function pathFixer($path)
{
return str_replace("/", DIRECTORY_SEPARATOR, $path);
}
}

View File

@ -0,0 +1,48 @@
<?php
$menu_registered = array();
/**
* Register for global menu
* @param string name Name of the menu
* @param bool admin true if for admin and false for customer
* @param string function function to run after menu clicks
* @param string position position of menu, use AFTER_ for root menu |
* Admin/Sales menu: AFTER_DASHBOARD, CUSTOMERS, PREPAID, SERVICES, REPORTS, VOUCHER, AFTER_ORDER, NETWORK, SETTINGS, AFTER_PAYMENTGATEWAY
* | Customer menu: AFTER_DASHBOARD, ORDER, HISTORY, ACCOUNTS
* @param string icon from ion icon, ion-person, only for AFTER_
*/
function register_menu($name, $admin, $function, $position, $icon = '')
{
global $menu_registered;
$menu_registered[] = [
"name" => $name,
"admin" => $admin,
"position" => $position,
"icon" => $icon,
"function" => $function
];
}
$hook_registered = array();
function register_hook($action, $function){
$hook_registered[] = [
'action' => $action,
'function' => $function
];
}
function run_hook($action){
global $hook_registered;
foreach($hook_registered as $hook){
if($hook['action'] == $action){
if(function_exists($hook['function'])){
call_user_func($hook['function']);
}
}
}
}

65
system/autoload/Http.php Normal file
View File

@ -0,0 +1,65 @@
<?php
/**
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
class Http
{
public static function getData($url, $headers)
{
$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_HTTPHEADER, $headers);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec($ch);
curl_close($ch);
return $server_output;
}
public static function postJsonData($url, $array_post, $headers = [], $basic = null)
{
$headers[] = 'Content-Type: application/json';
$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_VERBOSE, false);
curl_setopt($ch, CURLINFO_HEADER_OUT, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($array_post));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
if (!empty($basic)) {
curl_setopt($ch, CURLOPT_USERPWD, $basic);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec($ch);
curl_close($ch);
return $server_output;
}
public static function postData($url, $array_post, $headers = [], $basic = null)
{
$headers[] = 'Content-Type: application/x-www-form-urlencoded';
$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_VERBOSE, false);
curl_setopt($ch, CURLINFO_HEADER_OUT, false);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($array_post));
curl_setopt($ch, CURLOPT_HTTPHEADER, $headers);
if (!empty($basic)) {
curl_setopt($ch, CURLOPT_USERPWD, $basic);
}
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
$server_output = curl_exec($ch);
curl_close($ch);
return $server_output;
}
}

15
system/autoload/Lang.php Normal file
View File

@ -0,0 +1,15 @@
<?php
/**
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
class Lang {
public static function T($var) {
return Lang($var);
}
public static function htmlspecialchars($var) {
return htmlspecialchars($var);
}
}

View File

@ -0,0 +1,58 @@
<?php
/**
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
class Message
{
public static function sendTelegram($txt)
{
global $config;
run_hook('send_telegram'); #HOOK
if (!empty($config['telegram_bot']) && !empty($config['telegram_target_id'])) {
file_get_contents('https://api.telegram.org/bot' . $config['telegram_bot'] . '/sendMessage?chat_id=' . $config['telegram_target_id'] . '&text=' . urlencode($txt));
}
}
public static function sendSMS($phone, $txt)
{
global $config;
run_hook('send_sms'); #HOOK
if (!empty($config['sms_url'])) {
$smsurl = str_replace('[number]', urlencode($phone), $config['sms_url']);
$smsurl = str_replace('[text]', urlencode($txt), $smsurl);
file_get_contents($smsurl);
}
}
public static function sendWhatsapp($phone, $txt)
{
global $config;
run_hook('send_whatsapp'); #HOOK
if (!empty($config['wa_url'])) {
$waurl = str_replace('[number]', urlencode($phone), $config['wa_url']);
$waurl = str_replace('[text]', urlencode($txt), $waurl);
file_get_contents($waurl);
}
}
public static function sendExpiredNotification($phone, $name, $package, $textExpired, $via)
{
if (
!empty($phone) && strlen($phone) > 5
&& !empty($textExpired) && in_array($via, ['sms', 'wa'])
) {
$msg = str_replace('[[name]]', "*$name*", $textExpired);
$msg = str_replace('[[package]]', "*$package*", $msg);
if ($via == 'sms') {
Message::sendSMS($phone, $msg);
} else if ($via == 'wa') {
Message::sendWhatsapp($phone, $msg);
}
}
}
}

View File

@ -0,0 +1,317 @@
<?php
use PEAR2\Net\RouterOS;
class Mikrotik
{
public static function info($name){
$d = ORM::for_table('tbl_routers')->where('name',$name)->find_one();
return $d;
}
public static function getClient($ip, $user, $pass)
{
try {
$iport = explode(":", $ip);
return new RouterOS\Client($iport[0], $user, $pass, ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die("Unable to connect to the router.<br>" . $e->getMessage());
}
}
public static function addHotspotPlan($client, $name, $sharedusers, $rate){
$addRequest = new RouterOS\Request('/ip/hotspot/user/profile/add');
$client->sendSync(
$addRequest
->setArgument('name', $name)
->setArgument('shared-users', $sharedusers)
->setArgument('rate-limit', $rate)
);
}
public static function setHotspotPlan($client, $name, $sharedusers, $rate){
$printRequest = new RouterOS\Request(
'/ip hotspot user profile print .proplist=name',
RouterOS\Query::where('name', $name)
);
$profileName = $client->sendSync($printRequest)->getProperty('name');
$setRequest = new RouterOS\Request('/ip/hotspot/user/profile/set');
$client(
$setRequest
->setArgument('numbers', $profileName)
->setArgument('shared-users', $sharedusers)
->setArgument('rate-limit', $rate)
);
}
public static function removeHotspotPlan($client, $name){
$printRequest = new RouterOS\Request(
'/ip hotspot user profile print .proplist=name',
RouterOS\Query::where('name', $name)
);
$profileName = $client->sendSync($printRequest)->getProperty('name');
$removeRequest = new RouterOS\Request('/ip/hotspot/user/profile/remove');
$client(
$removeRequest
->setArgument('numbers', $profileName)
);
}
public static function removeHotspotUser($client, $username)
{
$printRequest = new RouterOS\Request(
'/ip hotspot user print .proplist=name',
RouterOS\Query::where('name', $username)
);
$userName = $client->sendSync($printRequest)->getProperty('name');
$removeRequest = new RouterOS\Request('/ip/hotspot/user/remove');
$client(
$removeRequest
->setArgument('numbers', $userName)
);
}
public static function addHotspotUser($client, $plan, $customer)
{
$addRequest = new RouterOS\Request('/ip/hotspot/user/add');
if ($plan['typebp'] == "Limited") {
if ($plan['limit_type'] == "Time_Limit") {
if ($plan['time_unit'] == 'Hrs')
$timelimit = $plan['time_limit'] . ":00:00";
else
$timelimit = "00:" . $plan['time_limit'] . ":00";
$client->sendSync(
$addRequest
->setArgument('name', $customer['username'])
->setArgument('profile', $plan['name_plan'])
->setArgument('password', $customer['password'])
->setArgument('limit-uptime', $timelimit)
);
} else if ($plan['limit_type'] == "Data_Limit") {
if ($plan['data_unit'] == 'GB')
$datalimit = $plan['data_limit'] . "000000000";
else
$datalimit = $plan['data_limit'] . "000000";
$client->sendSync(
$addRequest
->setArgument('name', $customer['username'])
->setArgument('profile', $plan['name_plan'])
->setArgument('password', $customer['password'])
->setArgument('limit-bytes-total', $datalimit)
);
} else if ($plan['limit_type'] == "Both_Limit") {
if ($plan['time_unit'] == 'Hrs')
$timelimit = $plan['time_limit'] . ":00:00";
else
$timelimit = "00:" . $plan['time_limit'] . ":00";
if ($plan['data_unit'] == 'GB')
$datalimit = $plan['data_limit'] . "000000000";
else
$datalimit = $plan['data_limit'] . "000000";
$client->sendSync(
$addRequest
->setArgument('name', $customer['username'])
->setArgument('profile', $plan['name_plan'])
->setArgument('password', $customer['password'])
->setArgument('limit-uptime', $timelimit)
->setArgument('limit-bytes-total', $datalimit)
);
}
} else {
$client->sendSync(
$addRequest
->setArgument('name', $customer['username'])
->setArgument('profile', $plan['name_plan'])
->setArgument('password', $customer['password'])
);
}
}
public static function setHotspotUser($client, $user, $pass, $nuser= null){
$printRequest = new RouterOS\Request('/ip/hotspot/user/print');
$printRequest->setArgument('.proplist', '.id');
$printRequest->setQuery(RouterOS\Query::where('name', $user));
$id = $client->sendSync($printRequest)->getProperty('.id');
$setRequest = new RouterOS\Request('/ip/hotspot/user/set');
$setRequest->setArgument('numbers', $id);
$setRequest->setArgument('password', $pass);
$client->sendSync($setRequest);
}
public static function removeHotspotActiveUser($client, $username)
{
$onlineRequest = new RouterOS\Request('/ip/hotspot/active/print');
$onlineRequest->setArgument('.proplist', '.id');
$onlineRequest->setQuery(RouterOS\Query::where('user', $username));
$id = $client->sendSync($onlineRequest)->getProperty('.id');
$removeRequest = new RouterOS\Request('/ip/hotspot/active/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
}
public static function setHotspotLimitUptime($client, $username)
{
$printRequest = new RouterOS\Request('/ip/hotspot/user/print');
$printRequest->setArgument('.proplist', '.id');
$printRequest->setQuery(RouterOS\Query::where('name', $username));
$id = $client->sendSync($printRequest)->getProperty('.id');
$setRequest = new RouterOS\Request('/ip/hotspot/user/set');
$setRequest->setArgument('numbers', $id);
$setRequest->setArgument('limit-uptime', '00:00:05');
$client->sendSync($setRequest);
}
public static function removePpoeUser($client, $username)
{
$printRequest = new RouterOS\Request(
'/ppp secret print .proplist=name',
RouterOS\Query::where('name', $username)
);
$userName = $client->sendSync($printRequest)->getProperty('name');
$removeRequest = new RouterOS\Request('/ppp/secret/remove');
$client(
$removeRequest
->setArgument('numbers', $userName)
);
}
public static function addPpoeUser($client, $plan, $customer)
{
$addRequest = new RouterOS\Request('/ppp/secret/add');
$client->sendSync(
$addRequest
->setArgument('name', $customer['username'])
->setArgument('service', 'pppoe')
->setArgument('profile', $plan['name_plan'])
->setArgument('password', $customer['password'])
);
}
public static function setPpoeUser($client, $user, $pass, $nuser= null){
$printRequest = new RouterOS\Request('/ppp/secret/print');
$printRequest->setArgument('.proplist', '.id');
$printRequest->setQuery(RouterOS\Query::where('name', $user['username']));
$id = $client->sendSync($printRequest)->getProperty('.id');
$setRequest = new RouterOS\Request('/ppp/secret/set');
$setRequest->setArgument('numbers', $id);
$setRequest->setArgument('password', $pass);
$client->sendSync($setRequest);
}
public static function disablePpoeUser($client, $username)
{
$printRequest = new RouterOS\Request('/ppp/secret/print');
$printRequest->setArgument('.proplist', '.id');
$printRequest->setQuery(RouterOS\Query::where('name', $username));
$id = $client->sendSync($printRequest)->getProperty('.id');
$setRequest = new RouterOS\Request('/ppp/secret/disable');
$setRequest->setArgument('numbers', $id);
$client->sendSync($setRequest);
}
public static function removePpoeActive($client, $username)
{
$onlineRequest = new RouterOS\Request('/ppp/active/print');
$onlineRequest->setArgument('.proplist', '.id');
$onlineRequest->setQuery(RouterOS\Query::where('name', $username));
$id = $client->sendSync($onlineRequest)->getProperty('.id');
$removeRequest = new RouterOS\Request('/ppp/active/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
}
public static function removePool($client, $name){
$printRequest = new RouterOS\Request(
'/ip pool print .proplist=name',
RouterOS\Query::where('name', $name)
);
$poolName = $client->sendSync($printRequest)->getProperty('name');
$removeRequest = new RouterOS\Request('/ip/pool/remove');
$client($removeRequest
->setArgument('numbers', $poolName)
);
}
public static function addPool($client, $name, $ip_address){
$addRequest = new RouterOS\Request('/ip/pool/add');
$client->sendSync($addRequest
->setArgument('name', $name)
->setArgument('ranges', $ip_address)
);
}
public static function setPool($client, $name, $ip_address){
$printRequest = new RouterOS\Request(
'/ip pool print .proplist=name',
RouterOS\Query::where('name', $name)
);
$poolName = $client->sendSync($printRequest)->getProperty('name');
if(empty($poolName)){
self::addPool($client, $name, $ip_address);
}else{
$setRequest = new RouterOS\Request('/ip/pool/set');
$client(
$setRequest
->setArgument('numbers', $poolName)
->setArgument('ranges', $ip_address)
);
}
}
public static function addPpoePlan($client, $name, $pool, $rate){
$addRequest = new RouterOS\Request('/ppp/profile/add');
$client->sendSync(
$addRequest
->setArgument('name', $name)
->setArgument('local-address', $pool)
->setArgument('remote-address', $pool)
->setArgument('rate-limit', $rate)
);
}
public static function setPpoePlan($client, $name, $pool, $rate){
$printRequest = new RouterOS\Request(
'/ppp profile print .proplist=name',
RouterOS\Query::where('name', $name)
);
$profileName = $client->sendSync($printRequest)->getProperty('name');
if(empty($profileName)){
self::addPpoePlan($client, $name, $pool, $rate);
}else{
$setRequest = new RouterOS\Request('/ppp/profile/set');
$client(
$setRequest
->setArgument('numbers', $profileName)
->setArgument('local-address', $pool)
->setArgument('remote-address', $pool)
->setArgument('rate-limit', $rate)
);
}
}
public static function removePpoePlan($client, $name){
$printRequest = new RouterOS\Request(
'/ppp profile print .proplist=name',
RouterOS\Query::where('name', $name)
);
$profileName = $client->sendSync($printRequest)->getProperty('name');
$removeRequest = new RouterOS\Request('/ppp/profile/remove');
$client(
$removeRequest
->setArgument('numbers', $profileName)
);
}
}

226
system/autoload/Package.php Normal file
View File

@ -0,0 +1,226 @@
<?php
/**
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
use PEAR2\Net\RouterOS;
class Package
{
/**
* @param int $id_customer String user identifier
* @param string $router_name router name for this package
* @param int $plan_id plan id for this package
* @param string $gateway payment gateway name
* @param string $channel channel payment gateway
* @return boolean
*/
public static function rechargeUser($id_customer, $router_name, $plan_id, $gateway, $channel)
{
global $_c, $_L;
$date_now = date("Y-m-d H:i:s");
$date_only = date("Y-m-d");
$time = date("H:i:s");
if ($id_customer == '' or $router_name == '' or $plan_id == '') {
return false;
}
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
$p = ORM::for_table('tbl_plans')->where('id', $plan_id)->where('enabled', '1')->find_one();
$b = ORM::for_table('tbl_user_recharges')->where('customer_id', $id_customer)->find_one();
$mikrotik = Mikrotik::info($router_name);
if ($p['validity_unit'] == 'Months') {
$date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' month'));
} else if ($p['validity_unit'] == 'Days') {
$date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' day'));
} else if ($p['validity_unit'] == 'Hrs') {
$datetime = explode(' ', date("Y-m-d H:i:s", strtotime('+' . $p['validity'] . ' hour')));
$date_exp = $datetime[0];
$time = $datetime[1];
} else if ($p['validity_unit'] == 'Mins') {
$datetime = explode(' ', date("Y-m-d H:i:s", strtotime('+' . $p['validity'] . ' minute')));
$date_exp = $datetime[0];
$time = $datetime[1];
}
if ($p['type'] == 'Hotspot') {
if ($b) {
if (!$_c['radius_mode']) {
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::removeHotspotUser($client, $c['username']);
Mikrotik::addHotspotUser($client, $p, $c);
}
$b->customer_id = $id_customer;
$b->username = $c['username'];
$b->plan_id = $plan_id;
$b->namebp = $p['name_plan'];
$b->recharged_on = $date_only;
$b->expiration = $date_exp;
$b->time = $time;
$b->status = "on";
$b->method = "$gateway - $channel";
$b->routers = $router_name;
$b->type = "Hotspot";
$b->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . _raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "$gateway - $channel";
$t->routers = $router_name;
$t->type = "Hotspot";
$t->save();
} else {
if (!$_c['radius_mode']) {
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::addHotspotUser($client, $p, $c);
}
$d = ORM::for_table('tbl_user_recharges')->create();
$d->customer_id = $id_customer;
$d->username = $c['username'];
$d->plan_id = $plan_id;
$d->namebp = $p['name_plan'];
$d->recharged_on = $date_only;
$d->expiration = $date_exp;
$d->time = $time;
$d->status = "on";
$d->method = "$gateway - $channel";
$d->routers = $router_name;
$d->type = "Hotspot";
$d->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . _raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "$gateway - $channel";
$t->routers = $router_name;
$t->type = "Hotspot";
$t->save();
}
Message::sendTelegram("#u$c[username] #buy #Hotspot \n" . $p['name_plan'] .
"\nRouter: " . $router_name .
"\nGateway: " . $gateway .
"\nChannel: " . $channel .
"\nPrice: " . $p['price']);
} else {
if ($b) {
if (!$_c['radius_mode']) {
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::removePpoeUser($client, $c['username']);
Mikrotik::addPpoeUser($client, $p, $c);
}
$b->customer_id = $id_customer;
$b->username = $c['username'];
$b->plan_id = $plan_id;
$b->namebp = $p['name_plan'];
$b->recharged_on = $date_only;
$b->expiration = $date_exp;
$b->time = $time;
$b->status = "on";
$b->method = "$gateway - $channel";
$b->routers = $router_name;
$b->type = "PPPOE";
$b->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . _raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "$gateway - $channel";
$t->routers = $router_name;
$t->type = "PPPOE";
$t->save();
} else {
if (!$_c['radius_mode']) {
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::addPpoeUser($client, $p, $c);
}
$d = ORM::for_table('tbl_user_recharges')->create();
$d->customer_id = $id_customer;
$d->username = $c['username'];
$d->plan_id = $plan_id;
$d->namebp = $p['name_plan'];
$d->recharged_on = $date_only;
$d->expiration = $date_exp;
$d->time = $time;
$d->status = "on";
$d->method = "$gateway - $channel";
$d->routers = $router_name;
$d->type = "PPPOE";
$d->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . _raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "$gateway - $channel";
$t->routers = $router_name;
$t->type = "PPPOE";
$t->save();
}
Message::sendTelegram("#u$c[username] #buy #PPPOE \n" . $p['name_plan'] .
"\nRouter: " . $router_name .
"\nGateway: " . $gateway .
"\nChannel: " . $channel .
"\nPrice: " . $p['price']);
}
$in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one();
$msg = "*$_c[CompanyName]*\n" .
"$_c[address]\n" .
"$_c[phone]\n" .
"\n\n" .
"INVOICE: *$in[invoice]*\n" .
"$_L[Date] : $date_now\n" .
"$gateway $channel\n" .
"\n\n" .
"$_L[Type] : *$in[type]*\n" .
"$_L[Plan_Name] : *$in[plan_name]*\n" .
"$_L[Plan_Price] : *$_c[currency_code] " . number_format($in['price'], 2, $_c['dec_point'], $_c['thousands_sep']) . "*\n\n" .
"$_L[Username] : *$in[username]*\n" .
"$_L[Password] : **********\n\n" .
"$_L[Created_On] :\n*" . date($_c['date_format'], strtotime($in['recharged_on'])) . " $in[time]*\n" .
"$_L[Expires_On] :\n*" . date($_c['date_format'], strtotime($in['expiration'])) . " $in[time]*\n" .
"\n\n" .
"$_c[note]";
if ($_c['user_notification_payment'] == 'sms') {
Message::sendSMS($c['phonenumber'], $msg);
} else if ($_c['user_notification_payment'] == 'wa') {
Message::sendWhatsapp($c['phonenumber'], $msg);
}
return true;
}
}

View File

@ -1,11 +1,6 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
Class Paginator

View File

@ -1,11 +1,7 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/

View File

@ -0,0 +1,5 @@
<?php
class Radius {
}

View File

@ -1,16 +0,0 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
**/
Class Router{
public static function _info($name){
$d = ORM::for_table('tbl_routers')->where('name',$name)->find_one();
return $d;
}
}

View File

@ -1,11 +1,6 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
class Timezone {

View File

@ -1,11 +1,6 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
Class User{

View File

@ -1,17 +1,14 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
**/
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
/**
* Validator class
*/
class Validator{
class Validator
{
/**
* String text finder
@ -21,14 +18,15 @@ class Validator{
* @param array $hits
* @return void
*/
private static function textHit($string, $exclude=""){
if(empty($exclude)) return false;
if(is_array($exclude)){
foreach($exclude as $text){
if(strstr($string, $text)) return true;
private static function textHit($string, $exclude = "")
{
if (empty($exclude)) return false;
if (is_array($exclude)) {
foreach ($exclude as $text) {
if (strstr($string, $text)) return true;
}
}else{
if(strstr($string, $exclude)) return true;
} else {
if (strstr($string, $exclude)) return true;
}
return false;
}
@ -42,9 +40,10 @@ class Validator{
* @param int $min
* @return bool
*/
private static function numberBetween($integer, $max=null, $min=0){
if(is_numeric($min) && $integer <= $min) return false;
if(is_numeric($max) && $integer >= $max) return false;
private static function numberBetween($integer, $max = null, $min = 0)
{
if (is_numeric($min) && $integer <= $min) return false;
if (is_numeric($max) && $integer >= $max) return false;
return true;
}
@ -56,8 +55,9 @@ class Validator{
* @param array $exclude
* @return bool
*/
public static function Email($string, $exclude=""){
if(self::textHit($string, $exclude)) return false;
public static function Email($string, $exclude = "")
{
if (self::textHit($string, $exclude)) return false;
return (bool)preg_match("/^([a-z0-9])(([-a-z0-9._])*([a-z0-9]))*\@([a-z0-9])(([a-z0-9-])*([a-z0-9]))+(\.([a-z0-9])([-a-z0-9_-])?([a-z0-9])+)+$/i", $string);
}
@ -68,8 +68,9 @@ class Validator{
* @param strin $string
* @return bool
*/
public static function Url($string, $exclude=""){
if(self::textHit($string, $exclude)) return false;
public static function Url($string, $exclude = "")
{
if (self::textHit($string, $exclude)) return false;
return (bool)preg_match("/^(http|https|ftp):\/\/([A-Z0-9][A-Z0-9_-]*(?:\.[A-Z0-9][A-Z0-9_-]*)+):?(\d+)?\/?/i", $string);
}
@ -80,7 +81,8 @@ class Validator{
* @param string $string
* @return void
*/
public static function Ip($string){
public static function Ip($string)
{
return (bool)preg_match("/^(1?\d{1,2}|2([0-4]\d|5[0-5]))(\.(1?\d{1,2}|2([0-4]\d|5[0-5]))){3}$/", $string);
}
@ -93,9 +95,10 @@ class Validator{
* @param int $min
* @return bool
*/
public static function Number($integer, $max=null, $min=0){
if(preg_match("/^\-?\+?[0-9e1-9]+$/",$integer)){
if(!self::numberBetween($integer, $max, $min)) return false;
public static function Number($integer, $max = null, $min = 0)
{
if (preg_match("/^\-?\+?[0-9e1-9]+$/", $integer)) {
if (!self::numberBetween($integer, $max, $min)) return false;
return true;
}
return false;
@ -108,8 +111,9 @@ class Validator{
* @param int $integer
* @return bool
*/
public static function UnsignedNumber($integer){
return (bool)preg_match("/^\+?[0-9]+$/",$integer);
public static function UnsignedNumber($integer)
{
return (bool)preg_match("/^\+?[0-9]+$/", $integer);
}
/**
@ -119,8 +123,9 @@ class Validator{
* @param string $string
* @return bool
*/
public static function Float($string){
return (bool)($string==strval(floatval($string)))? true : false;
public static function Float($string)
{
return (bool)($string == strval(floatval($string))) ? true : false;
}
/**
@ -130,7 +135,8 @@ class Validator{
* @param string $string
* @return void
*/
public static function Alpha($string){
public static function Alpha($string)
{
return (bool)preg_match("/^[a-zA-Z]+$/", $string);
}
@ -141,7 +147,8 @@ class Validator{
* @param string $string
* @return void
*/
public static function AlphaNumeric($string){
public static function AlphaNumeric($string)
{
return (bool)preg_match("/^[0-9a-zA-Z]+$/", $string);
}
@ -153,7 +160,8 @@ class Validator{
* @param array $allowed
* @return void
*/
public static function Chars($string, $allowed=array("a-z")){
public static function Chars($string, $allowed = array("a-z"))
{
return (bool)preg_match("/^[" . implode("", $allowed) . "]+$/", $string);
}
@ -166,9 +174,10 @@ class Validator{
* @param int $min
* @return bool
*/
public static function Length($string, $max=null, $min=0){
public static function Length($string, $max = null, $min = 0)
{
$length = strlen($string);
if(!self::numberBetween($length, $max, $min)) return false;
if (!self::numberBetween($length, $max, $min)) return false;
return true;
}
@ -179,7 +188,8 @@ class Validator{
* @param string $string
* @return void
*/
public static function HexColor($string){
public static function HexColor($string)
{
return (bool)preg_match("/^(#)?([0-9a-f]{1,2}){3}$/i", $string);
}
@ -196,7 +206,8 @@ class Validator{
* @param string $string
* @return bool
*/
public static function Date($string){
public static function Date($string)
{
$date = date('Y', strtotime($string));
return ($date == "1970" || $date == '') ? false : true;
}
@ -209,9 +220,10 @@ class Validator{
* @param int $age
* @return bool
*/
public static function OlderThan($string, $age){
public static function OlderThan($string, $age)
{
$date = date('Y', strtotime($string));
if($date == "1970" || $date == '') return false;
if ($date == "1970" || $date == '') return false;
return (date('Y') - $date) > $age ? true : false;
}
@ -222,7 +234,8 @@ class Validator{
* @param string $string
* @return bool
*/
public static function Xml($string){
public static function Xml($string)
{
$Xml = @simplexml_load_string($string);
return ($Xml === false) ? false : true;
}
@ -236,7 +249,8 @@ class Validator{
* @param int $min
* @return bool
*/
public static function FilesizeBetween($file, $max=null, $min=0){
public static function FilesizeBetween($file, $max = null, $min = 0)
{
$filesize = filesize($file);
return self::numberBetween($filesize, $max, $min);
}
@ -252,10 +266,11 @@ class Validator{
* @param int $min_height
* @return void
*/
public static function ImageSizeBetween($image, $max_width="", $min_width=0, $max_height="", $min_height=0){
public static function ImageSizeBetween($image, $max_width = "", $min_width = 0, $max_height = "", $min_height = 0)
{
$size = getimagesize($image);
if(!self::numberBetween($size[0], $max_width, $min_width)) return false;
if(!self::numberBetween($size[1], $max_height, $min_height)) return false;
if (!self::numberBetween($size[0], $max_width, $min_width)) return false;
if (!self::numberBetween($size[1], $max_height, $min_height)) return false;
return true;
}
@ -266,8 +281,10 @@ class Validator{
* @param string $phone
* @return bool
*/
public static function Phone($phone){
$formats = array( '###-###-####',
public static function Phone($phone)
{
$formats = array(
'###-###-####',
'####-###-###',
'(###) ###-###',
'####-####-####',
@ -276,9 +293,10 @@ class Validator{
'###-###-###',
'#####-###-###',
'##########',
'####-##-##-##');
'####-##-##-##'
);
$format = trim(preg_replace("/[0-9]/", "#", $phone));
return (bool)in_array($format, $formats);
}
}
}

View File

@ -1,11 +1,7 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
session_start();
@ -21,12 +17,13 @@ function r2($to, $ntype = 'e', $msg = '')
exit;
}
if (file_exists('system/config.php')) {
require('system/config.php');
if (file_exists('config.php')) {
require('config.php');
} else {
r2('system/install');
r2('install');
}
function safedata($value)
{
$value = trim($value);
@ -51,6 +48,7 @@ function _get($param, $defvalue = '')
}
}
require('system/orm.php');
ORM::configure("mysql:host=$db_host;dbname=$db_name");
@ -58,7 +56,9 @@ ORM::configure('username', $db_user);
ORM::configure('password', $db_password);
ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'));
ORM::configure('return_result_sets', true);
ORM::configure('logging', true);
if($_app_stage != 'Live'){
ORM::configure('logging', true);
}
$result = ORM::for_table('tbl_appconfig')->find_many();
foreach ($result as $value) {
@ -68,6 +68,14 @@ foreach ($result as $value) {
date_default_timezone_set($config['timezone']);
$_c = $config;
if($config['radius_mode']){
ORM::configure("mysql:host=$radius_host;dbname=$radius_name", null, 'radius');
ORM::configure('username', $radius_user, 'radius');
ORM::configure('password', $radius_password, 'radius');
ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'), 'radius');
ORM::configure('return_result_sets', true, 'radius');
}
function _notify($msg, $type = 'e')
{
$_SESSION['ntype'] = $type;
@ -75,18 +83,19 @@ function _notify($msg, $type = 'e')
}
require_once('system/vendors/smarty/libs/Smarty.class.php');
$_theme = APP_URL . '/ui/theme/' . $config['theme'];
$lan_file = 'system/lan/' . $config['language'] . '/common.lan.php';
require($lan_file);
$ui = new Smarty();
$ui->setTemplateDir('ui/theme/' . $config['theme'] . '/');
$ui->setTemplateDir('ui/ui/');
$ui->addTemplateDir('system/paymentgateway/ui/', 'pg');
$ui->addTemplateDir('system/plugin/ui/', 'plugin');
$ui->setCompileDir('ui/compiled/');
$ui->setConfigDir('ui/conf/');
$ui->setCacheDir('ui/cache/');
$ui->assign('app_url', APP_URL);
$ui->assign('_domain', str_replace('www.', '', parse_url(APP_URL, PHP_URL_HOST)));
define('U', APP_URL . '/index.php?_route=');
$ui->assign('_url', APP_URL . '/index.php?_route=');
$ui->assign('_theme', $_theme);
$ui->assign('_path', __DIR__);
$ui->assign('_c', $config);
$ui->assign('_L', $_L);
@ -119,53 +128,69 @@ if (isset($_SESSION['notify'])) {
unset($_SESSION['ntype']);
}
include "autoload/Hookers.php";
//register all plugin
foreach (glob("system/plugin/*.php") as $filename)
{
include $filename;
}
// on some server, it getting error because of slash is backwards
function _autoloader($class)
{
if (strpos($class, '_') !== false) {
$class = str_replace('_', '/', $class);
if (file_exists('autoload/' . $class . '.php')) {
include 'autoload/' . $class . '.php';
$class = str_replace('_', DIRECTORY_SEPARATOR, $class);
if (file_exists('autoload' . DIRECTORY_SEPARATOR . $class . '.php')) {
include 'autoload' . DIRECTORY_SEPARATOR . $class . '.php';
} else {
$class = str_replace("\\", "/", $class);
if (file_exists(__DIR__ . '/autoload/' . $class . '.php'))
include __DIR__ . '/autoload/' . $class . '.php';
$class = str_replace("\\", DIRECTORY_SEPARATOR, $class);
if (file_exists(__DIR__ . DIRECTORY_SEPARATOR . 'autoload' . DIRECTORY_SEPARATOR . $class . '.php'))
include __DIR__ . DIRECTORY_SEPARATOR . 'autoload' . DIRECTORY_SEPARATOR . $class . '.php';
}
} else {
if (file_exists('autoload/' . $class . '.php')) {
include 'autoload/' . $class . '.php';
if (file_exists('autoload' . DIRECTORY_SEPARATOR . $class . '.php')) {
include 'autoload' . DIRECTORY_SEPARATOR . $class . '.php';
} else {
$class = str_replace("\\", "/", $class);
if (file_exists(__DIR__ . '/autoload/' . $class . '.php'))
include __DIR__ . '/autoload/' . $class . '.php';
$class = str_replace("\\", DIRECTORY_SEPARATOR, $class);
if (file_exists(__DIR__ . DIRECTORY_SEPARATOR . 'autoload' . DIRECTORY_SEPARATOR . $class . '.php'))
include __DIR__ . DIRECTORY_SEPARATOR . 'autoload' . DIRECTORY_SEPARATOR . $class . '.php';
}
}
}
spl_autoload_register('_autoloader');
function _auth()
function _auth($login = true)
{
if (isset($_SESSION['uid'])) {
return true;
} else {
r2(U . 'login');
if ($login) {
r2(U . 'login');
} else {
return false;
}
}
}
function _admin()
function _admin($login = true)
{
if (isset($_SESSION['aid'])) {
return true;
} else {
r2(U . 'login');
if ($login) {
r2(U . 'login');
} else {
return false;
}
}
}
function _raid($l)
{
$r = substr(str_shuffle(str_repeat('0123456789', $l)), 0, $l);
return $r;
return substr(str_shuffle(str_repeat('0123456789', $l)), 0, $l);
}
function _log($description, $type = '', $userid = '0')
@ -179,6 +204,47 @@ function _log($description, $type = '', $userid = '0')
$d->save();
}
function Lang($key)
{
global $_L, $lan_file;
if (!empty($_L[$key])) {
return $_L[$key];
}
$val = $key;
$key = alphanumeric($key, " ");
if (!empty($_L[$key])) {
return $_L[$key];
} else if (!empty($_L[str_replace(' ', '_', $key)])) {
return $_L[str_replace(' ', '_', $key)];
} else {
$key = str_replace(' ', '_', $key);
file_put_contents($lan_file, "$" . "_L['$key'] = '" . addslashes($val) . "';\n", FILE_APPEND);
return $val;
}
}
function alphanumeric($str, $tambahan = "")
{
return preg_replace("/[^a-zA-Z0-9" . $tambahan . "]+/", "", $str);
}
function sendTelegram($txt)
{
Message::sendTelegram($txt);
}
function sendSMS($phone, $txt)
{
Message::sendSMS($phone, $txt);
}
function sendWhatsapp($phone, $txt)
{
Message::sendWhatsapp($phone, $txt);
}
function time_elapsed_string($datetime, $full = false)
{
$now = new DateTime;
@ -212,13 +278,39 @@ function time_elapsed_string($datetime, $full = false)
// Routing Engine
$req = _get('_route');
$routes = explode('/', $req);
$handler = $routes['0'];
$ui->assign('_routes', $routes);
$handler = $routes[0];
if ($handler == '') {
$handler = 'default';
}
$sys_render = 'system/controllers/' . $handler . '.php';
if (file_exists($sys_render)) {
$menus = array();
// "name" => $name,
// "admin" => $admin,
// "position" => $position,
// "function" => $function
$ui->assign('_system_menu', $routes[0]);
foreach ($menu_registered as $menu) {
if($menu['admin'] && _admin(false)) {
$menus[$menu['position']] .= '<li'.(($routes[1]==$menu['function'])?' class="active"':'').'><a href="'.U.'plugin/'.$menu['function'].'">';
if(!empty($menu['icon'])){
$menus[$menu['position']] .= '<i class="'.$menu['icon'].'"></i>';
}
$menus[$menu['position']] .= '<span class="text">'.$menu['name'].'</span></a></li>';
}else if(!$menu['admin'] && _auth(false)) {
$menus[$menu['position']] .= '<li'.(($routes[1]==$menu['function'])?' class="active"':'').'><a href="'.U.'plugin/'.$menu['function'].'">';
if(!empty($menu['icon'])){
$menus[$menu['position']] .= '<i class="'.$menu['icon'].'"></i>';
}
$menus[$menu['position']] .= '<span class="text">'.$menu['name'].'</span></a></li>';
}
}
foreach ($menus as $k => $v) {
$ui->assign('_MENU_'.$k, $v);
}
unset($menus, $menu_registered);
include($sys_render);
} else {
exit("$sys_render");
r2(U.'dashboard', 'e', 'not found');
}

0
system/cache/index.html vendored Normal file
View File

View File

@ -1,14 +1,9 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
_auth();
$ui->assign('_title', $_L['My_Account'].'- '. $config['CompanyName']);
$ui->assign('_title', $_L['My_Account']);
$ui->assign('_system_menu', 'accounts');
$action = $routes['1'];
@ -19,20 +14,22 @@ use PEAR2\Net\RouterOS;
require_once 'system/autoload/PEAR2/Autoload.php';
switch ($action) {
case 'change-password':
run_hook('customer_view_change_password'); #HOOK
$ui->display('user-change-password.tpl');
break;
case 'change-password-post':
$password = _post('password');
run_hook('customer_change_password'); #HOOK
if($password != ''){
$d = ORM::for_table('tbl_customers')->where('username',$user['username'])->find_one();
if($d){
$d_pass = $d['password'];
$npass = _post('npass');
$cnpass = _post('cnpass');
if(Password::_uverify($password,$d_pass) == true){
if(!Validator::Length($npass,15,2)){
r2(U.'accounts/change-password','e','New Password must be 3 to 14 character');
@ -43,85 +40,45 @@ switch ($action) {
$c = ORM::for_table('tbl_user_recharges')->where('username',$user['username'])->find_one();
if ($c){
$mikrotik = Router::_info($c['routers']);
$mikrotik = Mikrotik::info($c['routers']);
if($c['type'] == 'Hotspot'){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$printRequest = new RouterOS\Request('/ip/hotspot/user/print');
$printRequest->setArgument('.proplist', '.id');
$printRequest->setQuery(RouterOS\Query::where('name', $user['username']));
$id = $client->sendSync($printRequest)->getProperty('.id');
$setRequest = new RouterOS\Request('/ip/hotspot/user/set');
$setRequest->setArgument('numbers', $id);
$setRequest->setArgument('password', $npass);
$client->sendSync($setRequest);
//remove hotspot active
$onlineRequest = new RouterOS\Request('/ip/hotspot/active/print');
$onlineRequest->setArgument('.proplist', '.id');
$onlineRequest->setQuery(RouterOS\Query::where('user', $user['username']));
$id = $client->sendSync($onlineRequest)->getProperty('.id');
$removeRequest = new RouterOS\Request('/ip/hotspot/active/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
if(!$config['radius_mode']){
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::setHotspotUser($client,$c['username'],$npass);
Mikrotik::removeHotspotActiveUser($client,$user['username']);
}
$d->password = $npass;
$d->save();
_msglog('s',$_L['Password_Changed_Successfully']);
_log('['.$user['username'].']: Password changed successfully','User',$user['id']);
r2(U.'login');
}else{
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$printRequest = new RouterOS\Request('/ppp/secret/print');
$printRequest->setArgument('.proplist', '.id');
$printRequest->setQuery(RouterOS\Query::where('name', $user['username']));
$id = $client->sendSync($printRequest)->getProperty('.id');
$setRequest = new RouterOS\Request('/ppp/secret/set');
$setRequest->setArgument('numbers', $id);
$setRequest->setArgument('password', $npass);
$client->sendSync($setRequest);
//remove pppoe active
$onlineRequest = new RouterOS\Request('/ppp/active/print');
$onlineRequest->setArgument('.proplist', '.id');
$onlineRequest->setQuery(RouterOS\Query::where('name', $user['username']));
$id = $client->sendSync($onlineRequest)->getProperty('.id');
$removeRequest = new RouterOS\Request('/ppp/active/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
}else{
if(!$config['radius_mode']){
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::setPpoeUser($client,$c['username'],$npass);
Mikrotik::removePpoeActive($client,$user['username']);
}
$d->password = $npass;
$d->save();
_msglog('s',$_L['Password_Changed_Successfully']);
_log('['.$user['username'].']: Password changed successfully','User',$user['id']);
r2(U.'login');
}
}else{
$d->password = $npass;
$d->save();
_msglog('s',$_L['Password_Changed_Successfully']);
_log('['.$user['username'].']: Password changed successfully','User',$user['id']);
r2(U.'login');
}
}else{
r2(U.'accounts/change-password','e',$_L['Incorrect_Current_Password']);
}
@ -134,10 +91,11 @@ switch ($action) {
break;
case 'profile':
$id = $_SESSION['uid'];
$d = ORM::for_table('tbl_customers')->find_one($id);
if($d){
run_hook('customer_view_edit_profile'); #HOOK
$ui->assign('d',$d);
$ui->display('user-profile.tpl');
}else{
@ -148,8 +106,9 @@ switch ($action) {
case 'edit-profile-post':
$fullname = _post('fullname');
$address = _post('address');
$email = _post('email');
$phonenumber = _post('phonenumber');
run_hook('customer_edit_profile'); #HOOK
$msg = '';
if(Validator::Length($fullname,31,2) == false){
$msg .= 'Full Name should be between 3 to 30 characters'. '<br>';
@ -157,7 +116,7 @@ switch ($action) {
if(Validator::UnsignedNumber($phonenumber) == false){
$msg .= 'Phone Number must be a number'. '<br>';
}
$id = _post('id');
$d = ORM::for_table('tbl_customers')->find_one($id);
if($d){
@ -168,16 +127,17 @@ switch ($action) {
if($msg == ''){
$d->fullname = $fullname;
$d->address = $address;
$d->email = $email;
$d->phonenumber = $phonenumber;
$d->save();
_log('['.$user['username'].']: '.$_L['User_Updated_Successfully'],'User',$user['id']);
r2(U . 'accounts/profile', 's', $_L['User_Updated_Successfully']);
}else{
r2(U . 'accounts/profile', 'e', $msg);
}
break;
default:
echo 'action not defined';
}

View File

@ -1,54 +1,46 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
**/
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
if (isset($routes['1'])) {
$do = $routes['1'];
} else {
$do = 'login-display';
}
switch($do){
switch ($do) {
case 'post':
$username = _post('username');
$password = _post('password');
if($username != '' AND $password != ''){
$d = ORM::for_table('tbl_users')->where('username',$username)->find_one();
if($d){
$d_pass = $d['password'];
if(Password::_verify($password,$d_pass) == true){
$_SESSION['aid'] = $d['id'];
$d->last_login = date('Y-m-d H:i:s');
$d->save();
_log($username .' '. $_L['Login_Successful'],'Admin',$d['id']);
r2(U.'dashboard');
}else{
_msglog('e',$_L['Invalid_Username_or_Password']);
_log($username .' '. $_L['Failed_Login'],'Admin');
r2(U.'admin');
}
}else{
_msglog('e',$_L['Invalid_Username_or_Password']);
r2(U.'admin');
}
}else{
_msglog('e',$_L['Invalid_Username_or_Password']);
r2(U.'admin');
}
$username = _post('username');
$password = _post('password');
run_hook('admin_login'); #HOOK
if ($username != '' and $password != '') {
$d = ORM::for_table('tbl_users')->where('username', $username)->find_one();
if ($d) {
$d_pass = $d['password'];
if (Password::_verify($password, $d_pass) == true) {
$_SESSION['aid'] = $d['id'];
$d->last_login = date('Y-m-d H:i:s');
$d->save();
_log($username . ' ' . $_L['Login_Successful'], 'Admin', $d['id']);
r2(U . 'dashboard');
} else {
_msglog('e', $_L['Invalid_Username_or_Password']);
_log($username . ' ' . $_L['Failed_Login'], 'Admin');
r2(U . 'admin');
}
} else {
_msglog('e', $_L['Invalid_Username_or_Password']);
r2(U . 'admin');
}
} else {
_msglog('e', $_L['Invalid_Username_or_Password']);
r2(U . 'admin');
}
break;
case 'login-display':
$ui->display('admin.tpl');
break;
default:
$ui->display('admin.tpl');
run_hook('view_login'); #HOOK
$ui->display('admin-login.tpl');
break;
}

View File

@ -1,14 +1,11 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
* used for ajax
**/
_admin();
$ui->assign('_title', $_L['Network'].' - '. $config['CompanyName']);
$ui->assign('_title', $_L['Network']);
$ui->assign('_system_menu', 'network');
$action = $routes['1'];
@ -20,26 +17,25 @@ switch ($action) {
$routers = _get('routers');
$d = ORM::for_table('tbl_pool')->where('routers', $routers)->find_many();
$ui->assign('d',$d);
$ui->display('autoload-pool.tpl');
break;
case 'server':
$d = ORM::for_table('tbl_routers')->find_many();
$d = ORM::for_table('tbl_routers')->where('enabled', '1')->find_many();
$ui->assign('d',$d);
$ui->display('autoload-server.tpl');
break;
case 'plan':
$server = _post('server');
$jenis = _post('jenis');
$d = ORM::for_table('tbl_plans')->where('routers', $server)->where('type', $jenis)->find_many();
$d = ORM::for_table('tbl_plans')->where('routers', $server)->where('type', $jenis)->where('enabled', '1')->find_many();
$ui->assign('d',$d);
$ui->display('autoload.tpl');
break;
default:
echo 'action not defined';
}

View File

@ -1,14 +1,9 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
_admin();
$ui->assign('_title', $_L['Bandwidth_Plans'].' - '. $config['CompanyName']);
$ui->assign('_title', $_L['Bandwidth_Plans']);
$ui->assign('_system_menu', 'services');
$action = $routes['1'];
@ -22,7 +17,7 @@ if($admin['user_type'] != 'Admin' AND $admin['user_type'] != 'Sales'){
switch ($action) {
case 'list':
$ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/bandwidth.js"></script>');
run_hook('view_list_bandwidth'); #HOOK
$name = _post('name');
if ($name != ''){
$paginator = Paginator::bootstrap('tbl_bandwidth','name_bw','%'.$name.'%');
@ -31,18 +26,20 @@ switch ($action) {
$paginator = Paginator::bootstrap('tbl_bandwidth');
$d = ORM::for_table('tbl_bandwidth')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many();
}
$ui->assign('d',$d);
$ui->assign('paginator',$paginator);
$ui->display('bandwidth.tpl');
break;
case 'add':
run_hook('view_add_bandwidth'); #HOOK
$ui->display('bandwidth-add.tpl');
break;
case 'edit':
$id = $routes['2'];
run_hook('view_edit_bandwith'); #HOOK
$d = ORM::for_table('tbl_bandwidth')->find_one($id);
if($d){
$ui->assign('d',$d);
@ -54,6 +51,7 @@ switch ($action) {
case 'delete':
$id = $routes['2'];
run_hook('delete_bandwidth'); #HOOK
$d = ORM::for_table('tbl_bandwidth')->find_one($id);
if($d){
$d->delete();
@ -67,12 +65,12 @@ switch ($action) {
$rate_down_unit = _post('rate_down_unit');
$rate_up = _post('rate_up');
$rate_up_unit = _post('rate_up_unit');
run_hook('add_bandwidth'); #HOOK
$msg = '';
if(Validator::Length($name,16,4) == false){
$msg .= 'Name should be between 5 to 15 characters'. '<br>';
}
if($rate_down_unit == 'Kbps'){ $unit_rate_down = $rate_down * 1024; }else{ $unit_rate_down = $rate_down * 1048576; }
if($rate_up_unit == 'Kbps'){ $unit_rate_up = $min_up * 1024; }else{ $unit_rate_up = $min_up * 1048576; }
@ -89,7 +87,7 @@ switch ($action) {
$d->rate_up = $rate_up;
$d->rate_up_unit = $rate_up_unit;
$d->save();
r2(U . 'bandwidth/list', 's', $_L['Created_Successfully']);
}else{
r2(U . 'bandwidth/add', 'e', $msg);
@ -102,7 +100,7 @@ switch ($action) {
$rate_down_unit = _post('rate_down_unit');
$rate_up = _post('rate_up');
$rate_up_unit = _post('rate_up_unit');
run_hook('edit_bandwidth'); #HOOK
$msg = '';
if(Validator::Length($name,16,4) == false){
$msg .= 'Name should be between 5 to 15 characters'. '<br>';
@ -129,7 +127,7 @@ switch ($action) {
$d->rate_up = $rate_up;
$d->rate_up_unit = $rate_up_unit;
$d->save();
r2(U . 'bandwidth/list', 's', $_L['Updated_Successfully']);
}else{
r2(U . 'bandwidth/edit/'.$id, 'e', $msg);

View File

@ -0,0 +1,20 @@
<?php
/**
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
$action = $routes['1'];
if(file_exists('system/paymentgateway/'.$action.'.php')){
include 'system/paymentgateway/'.$action.'.php';
if(function_exists($action.'_payment_notification')){
run_hook('callback_payment_notification'); #HOOK
call_user_func($action.'_payment_notification');
die();
}
}
header('HTTP/1.1 404 Not Found');
echo 'Not Found';

View File

@ -0,0 +1,13 @@
<?php
/**
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
_admin();
$ui->assign('_title', 'Community');
$ui->assign('_system_menu', 'community');
$action = $routes['1'];
$admin = Admin::_info();
$ui->assign('_admin', $admin);
$ui->display('community.tpl');

View File

@ -1,14 +1,11 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
**/
**/
_admin();
$ui->assign('_title', $_L['Customers'].' - '. $config['CompanyName']);
$ui->assign('_title', $_L['Customers']);
$ui->assign('_system_menu', 'customers');
$action = $routes['1'];
@ -16,118 +13,91 @@ $admin = Admin::_info();
$ui->assign('_admin', $admin);
use PEAR2\Net\RouterOS;
require_once 'system/autoload/PEAR2/Autoload.php';
if($admin['user_type'] != 'Admin' AND $admin['user_type'] != 'Sales'){
r2(U."dashboard",'e',$_L['Do_Not_Access']);
if ($admin['user_type'] != 'Admin' and $admin['user_type'] != 'Sales') {
r2(U . "dashboard", 'e', $_L['Do_Not_Access']);
}
switch ($action) {
case 'list':
$ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/customers.js"></script>');
$username = _post('username');
if ($username != ''){
$paginator = Paginator::bootstrap('tbl_customers','username','%'.$username.'%');
$d = ORM::for_table('tbl_customers')->where_like('username','%'.$username.'%')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many();
}else{
$paginator = Paginator::bootstrap('tbl_customers');
$d = ORM::for_table('tbl_customers')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many();
}
$ui->assign('d',$d);
$ui->assign('paginator',$paginator);
$username = _post('username');
run_hook('list_customers'); #HOOK
if ($username != '') {
$paginator = Paginator::bootstrap('tbl_customers', 'username', '%' . $username . '%');
$d = ORM::for_table('tbl_customers')->where_like('username', '%' . $username . '%')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many();
} else {
$paginator = Paginator::bootstrap('tbl_customers');
$d = ORM::for_table('tbl_customers')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many();
}
$ui->assign('d', $d);
$ui->assign('paginator', $paginator);
$ui->display('customers.tpl');
break;
case 'add':
run_hook('view_add_customer'); #HOOK
$ui->display('customers-add.tpl');
break;
case 'edit':
$id = $routes['2'];
run_hook('edit_customer'); #HOOK
$d = ORM::for_table('tbl_customers')->find_one($id);
if($d){
$ui->assign('d',$d);
if ($d) {
$ui->assign('d', $d);
$ui->display('customers-edit.tpl');
}else{
} else {
r2(U . 'customers/list', 'e', $_L['Account_Not_Found']);
}
break;
case 'delete':
$id = $routes['2'];
run_hook('delete_customer'); #HOOK
$d = ORM::for_table('tbl_customers')->find_one($id);
if($d){
$c = ORM::for_table('tbl_user_recharges')->where('username',$d['username'])->find_one();
if ($c){
$mikrotik = Router::_info($c['routers']);
if($c['type'] == 'Hotspot'){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$printRequest = new RouterOS\Request('/ip/hotspot/user/print');
$printRequest->setArgument('.proplist', '.id');
$printRequest->setQuery(RouterOS\Query::where('name', $c['username']));
$id = $client->sendSync($printRequest)->getProperty('.id');
$setRequest = new RouterOS\Request('/ip/hotspot/user/remove');
$setRequest->setArgument('numbers', $id);
$client->sendSync($setRequest);
//remove hotspot active
$onlineRequest = new RouterOS\Request('/ip/hotspot/active/print');
$onlineRequest->setArgument('.proplist', '.id');
$onlineRequest->setQuery(RouterOS\Query::where('user', $c['username']));
$id = $client->sendSync($onlineRequest)->getProperty('.id');
if ($d) {
$c = ORM::for_table('tbl_user_recharges')->where('username', $d['username'])->find_one();
if ($c) {
$mikrotik = Mikrotik::info($c['routers']);
if ($c['type'] == 'Hotspot') {
if(!$config['radius_mode']){
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::removeHotspotUser($client,$c['username']);
Mikrotik::removeHotspotActiveUser($client,$user['username']);
}
} else {
if(!$config['radius_mode']){
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::removePpoeUser($client,$c['username']);
Mikrotik::removePpoeActive($client,$user['username']);
}
}
try {
$d->delete();
} catch (Exception $e) {
} catch(Throwable $e){
}
try {
$c->delete();
} catch (Exception $e) {
}
} else {
try {
$d->delete();
} catch (Exception $e) {
} catch(Throwable $e){
}
try {
$c->delete();
} catch (Exception $e) {
} catch(Throwable $e){
}
}
$removeRequest = new RouterOS\Request('/ip/hotspot/active/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
}else{
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$printRequest = new RouterOS\Request('/ppp/secret/print');
$printRequest->setArgument('.proplist', '.id');
$printRequest->setQuery(RouterOS\Query::where('name', $c['username']));
$id = $client->sendSync($printRequest)->getProperty('.id');
$setRequest = new RouterOS\Request('/ppp/secret/remove');
$setRequest->setArgument('numbers', $id);
$client->sendSync($setRequest);
//remove pppoe active
$onlineRequest = new RouterOS\Request('/ppp/active/print');
$onlineRequest->setArgument('.proplist', '.id');
$onlineRequest->setQuery(RouterOS\Query::where('name', $c['username']));
$id = $client->sendSync($onlineRequest)->getProperty('.id');
$removeRequest = new RouterOS\Request('/ppp/active/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
}
try{
$d->delete();
}catch(Exception $e){}
try{
$c->delete();
}catch(Exception $e){}
}else{
try{
$d->delete();
}catch(Exception $e){}
try{
$c->delete();
}catch(Exception $e){}
}
r2(U . 'customers/list', 's', $_L['User_Delete_Ok']);
}
break;
@ -138,38 +108,37 @@ switch ($action) {
$password = _post('password');
$cpassword = _post('cpassword');
$address = _post('address');
$phonenumber = _post('phonenumber');
$phonenumber = _post('phonenumber');
run_hook('add_customer'); #HOOK
$msg = '';
if(Validator::Length($username,35,2) == false){
$msg .= 'Username should be between 3 to 55 characters'. '<br>';
if (Validator::Length($username, 35, 2) == false) {
$msg .= 'Username should be between 3 to 55 characters' . '<br>';
}
if(Validator::Length($fullname,36,2) == false){
$msg .= 'Full Name should be between 3 to 25 characters'. '<br>';
if (Validator::Length($fullname, 36, 2) == false) {
$msg .= 'Full Name should be between 3 to 25 characters' . '<br>';
}
if(!Validator::Length($password,35,2)){
$msg .= 'Password should be between 3 to 35 characters'. '<br>';
if (!Validator::Length($password, 35, 2)) {
$msg .= 'Password should be between 3 to 35 characters' . '<br>';
}
if($password != $cpassword){
$msg .= 'Passwords does not match'. '<br>';
if ($password != $cpassword) {
$msg .= 'Passwords does not match' . '<br>';
}
$d = ORM::for_table('tbl_customers')->where('username',$username)->find_one();
if($d){
$msg .= $_L['account_already_exist']. '<br>';
$d = ORM::for_table('tbl_customers')->where('username', $username)->find_one();
if ($d) {
$msg .= $_L['account_already_exist'] . '<br>';
}
if($msg == ''){
if ($msg == '') {
$d = ORM::for_table('tbl_customers')->create();
$d->username = $username;
$d->password = $password;
$d->fullname = $fullname;
$d->address = $address;
$d->phonenumber = $phonenumber;
$d->phonenumber = $username;
$d->save();
r2(U . 'customers/list', 's', $_L['account_created_successfully']);
}else{
} else {
r2(U . 'customers/add', 'e', $msg);
}
break;
@ -180,126 +149,84 @@ switch ($action) {
$password = _post('password');
$cpassword = _post('cpassword');
$address = _post('address');
$phonenumber = _post('phonenumber');
$phonenumber = _post('phonenumber');
run_hook('edit_customer'); #HOOK
$msg = '';
if(Validator::Length($username,16,2) == false){
$msg .= 'Username should be between 3 to 15 characters'. '<br>';
if (Validator::Length($username, 16, 2) == false) {
$msg .= 'Username should be between 3 to 15 characters' . '<br>';
}
if(Validator::Length($fullname,26,2) == false){
$msg .= 'Full Name should be between 3 to 25 characters'. '<br>';
if (Validator::Length($fullname, 26, 2) == false) {
$msg .= 'Full Name should be between 3 to 25 characters' . '<br>';
}
if($password != ''){
if(!Validator::Length($password,15,2)){
$msg .= 'Password should be between 3 to 15 characters'. '<br>';
if ($password != '') {
if (!Validator::Length($password, 15, 2)) {
$msg .= 'Password should be between 3 to 15 characters' . '<br>';
}
if($password != $cpassword){
$msg .= 'Passwords does not match'. '<br>';
if ($password != $cpassword) {
$msg .= 'Passwords does not match' . '<br>';
}
}
$id = _post('id');
$d = ORM::for_table('tbl_customers')->find_one($id);
if($d){
}else{
$msg .= $_L['Data_Not_Found']. '<br>';
if (!$d) {
$msg .= $_L['Data_Not_Found'] . '<br>';
}
if($d['username'] != $username){
$c = ORM::for_table('tbl_customers')->where('username',$username)->find_one();
if($c){
$msg .= $_L['account_already_exist']. '<br>';
if ($d['username'] != $username) {
$c = ORM::for_table('tbl_customers')->where('username', $username)->find_one();
if ($c) {
$msg .= $_L['account_already_exist'] . '<br>';
}
}
if($msg == ''){
$c = ORM::for_table('tbl_user_recharges')->where('username',$username)->find_one();
if ($c){
$mikrotik = Router::_info($c['routers']);
if($c['type'] == 'Hotspot'){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$printRequest = new RouterOS\Request('/ip/hotspot/user/print');
$printRequest->setArgument('.proplist', '.id');
$printRequest->setQuery(RouterOS\Query::where('name', $c['username']));
$id = $client->sendSync($printRequest)->getProperty('.id');
$setRequest = new RouterOS\Request('/ip/hotspot/user/set');
$setRequest->setArgument('numbers', $id);
$setRequest->setArgument('password', $password);
$client->sendSync($setRequest);
//remove hotspot active
$onlineRequest = new RouterOS\Request('/ip/hotspot/active/print');
$onlineRequest->setArgument('.proplist', '.id');
$onlineRequest->setQuery(RouterOS\Query::where('user', $c['username']));
$id = $client->sendSync($onlineRequest)->getProperty('.id');
if ($msg == '') {
$c = ORM::for_table('tbl_user_recharges')->where('username', $username)->find_one();
if ($c) {
$mikrotik = Mikrotik::info($c['routers']);
if ($c['type'] == 'Hotspot') {
if(!$config['radius_mode']){
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::setHotspotUser($client,$c['username'],$password);
Mikrotik::removeHotspotActiveUser($client,$user['username']);
}
$removeRequest = new RouterOS\Request('/ip/hotspot/active/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
$d->password = $password;
$d->save();
}else{
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$printRequest = new RouterOS\Request('/ppp/secret/print');
$printRequest->setArgument('.proplist', '.id');
$printRequest->setQuery(RouterOS\Query::where('name', $c['username']));
$id = $client->sendSync($printRequest)->getProperty('.id');
$setRequest = new RouterOS\Request('/ppp/secret/set');
$setRequest->setArgument('numbers', $id);
$setRequest->setArgument('password', $password);
$client->sendSync($setRequest);
//remove pppoe active
$onlineRequest = new RouterOS\Request('/ppp/active/print');
$onlineRequest->setArgument('.proplist', '.id');
$onlineRequest->setQuery(RouterOS\Query::where('name', $c['username']));
$id = $client->sendSync($onlineRequest)->getProperty('.id');
$d->password = $password;
$d->save();
} else {
if(!$config['radius_mode']){
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::setPpoeUser($client,$c['username'],$password);
Mikrotik::removePpoeActive($client,$user['username']);
}
$removeRequest = new RouterOS\Request('/ppp/active/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
$d->password = $password;
$d->save();
}
$d->username = $username;
if($password != ''){
$d->password = $password;
}
$d->fullname = $fullname;
$d->address = $address;
$d->phonenumber = $phonenumber;
$d->save();
}else{
$d->username = $username;
if($password != ''){
$d->password = $password;
}
$d->fullname = $fullname;
$d->address = $address;
$d->phonenumber = $phonenumber;
$d->save();
}
$d->password = $password;
$d->save();
}
$d->username = $username;
if ($password != '') {
$d->password = $password;
}
$d->fullname = $fullname;
$d->address = $address;
$d->phonenumber = $phonenumber;
$d->save();
} else {
$d->username = $username;
if ($password != '') {
$d->password = $password;
}
$d->fullname = $fullname;
$d->address = $address;
$d->phonenumber = $phonenumber;
$d->save();
}
r2(U . 'customers/list', 's', 'User Updated Successfully');
}else{
r2(U . 'customers/edit/'.$id, 'e', $msg);
} else {
r2(U . 'customers/edit/' . $id, 'e', $msg);
}
break;
default:
echo 'action not defined';
}
r2(U . 'customers/list', 'e', 'action not defined');
}

View File

@ -1,18 +1,12 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
_admin();
$ui->assign('_title', $_L['Dashboard'].' - '. $config['CompanyName']);
$ui->assign('_title', $_L['Dashboard']);
$admin = Admin::_info();
$ui->assign('_admin', $admin);
if($admin['user_type'] != 'Admin' AND $admin['user_type'] != 'Sales'){
if(!in_array($admin['user_type'],['Admin','Sales'])){
r2(U."home",'e',$_L['Do_Not_Access']);
}
@ -77,4 +71,5 @@ foreach($tmp as $plan){
$ui->assign('stocks',$stocks);
$ui->assign('plans',$plans);
run_hook('view_dashboard'); #HOOK
$ui->display('dashboard.tpl');

View File

@ -1,11 +1,6 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
r2(APP_URL.'/index.php?_route=dashboard');

View File

@ -1,23 +0,0 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* Ibnu Maksum <me@ibnux.net>
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* @donate PayPal: me@ibnux.net
**/
_admin();
$ui->assign('_title', 'Disquss - '. $config['CompanyName']);
$ui->assign('_system_menu', 'disquss');
$admin = Admin::_info();
$ui->assign('_admin', $admin);
if($admin['user_type'] != 'Admin' AND $admin['user_type'] != 'Sales'){
r2(U."dashboard",'e',$_L['Do_Not_Access']);
}
switch ($action) {
default:
$ui->display('disquss.tpl');
}

View File

@ -1,14 +1,9 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
_admin();
$ui->assign('_title', $_L['Reports'].'- '. $config['CompanyName']);
$ui->assign('_title', $_L['Reports']);
$ui->assign('_sysfrm_menu', 'reports');
$action = $routes['1'];
@ -35,33 +30,33 @@ switch ($action) {
$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');
$ui->assign('d',$x);
$ui->assign('dr',$xy);
$ui->assign('mdate',$mdate);
$ui->assign('recharged_on',$mdate);
run_hook('print_by_date'); #HOOK
$ui->display('print-by-date.tpl');
break;
case 'pdf-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();
$dr = ORM::for_table('tbl_transactions');
$dr->where('recharged_on', $mdate);
$dr->order_by_desc('id');
$xy = $dr->sum('price');
$title = ' Reports ['.$mdate.']';
$title = str_replace('-',' ',$title);
@ -75,7 +70,7 @@ switch ($action) {
</div>
<div id="logo"><img id="image" src="system/uploads/logo.png" alt="logo" /></div>
</div>
<div id="header">'.$_L['All_Transactions_at_Date'].': '. date($_c['date_format'], strtotime($mdate)).'</div>
<div id="header">'.$_L['All_Transactions_at_Date'].': '. date($config['date_format'], strtotime($mdate)).'</div>
<table id="customers">
<tr>
<th>'.$_L['Username'].'</th>
@ -89,11 +84,11 @@ switch ($action) {
</tr>';
$c = true;
foreach ($x as $value) {
$username = $value['username'];
$plan_name = $value['plan_name'];
$type = $value['type'];
$price = $_c['currency_code'].' '. number_format($value['price'],0,$_c['dec_point'],$_c['thousands_sep']);
$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']));
$time = $value['time'];
@ -113,8 +108,8 @@ switch ($action) {
}
$html .= '</table>
<h4 class="text-uppercase text-bold">'.$_L['Total_Income'].':</h4>
<h3 class="sum">'.$_c['currency_code'].' '.number_format($xy,2,$_c['dec_point'],$_c['thousands_sep']).'</h3>';
<h3 class="sum">'.$config['currency_code'].' '.number_format($xy,2,$config['dec_point'],$config['thousands_sep']).'</h3>';
run_hook('print_pdf_by_date'); #HOOK
define('_MPDF_PATH','system/vendors/mpdf/');
require('system/vendors/mpdf/mpdf.php');
@ -135,7 +130,7 @@ switch ($action) {
#address { width: 300px; float: left; }
#logo { text-align: right; float: right; position: relative; margin-top: 15px; border: 5px solid #fff; overflow: hidden; }
#customers
{
font-family: Helvetica, sans-serif;
@ -176,61 +171,61 @@ EOF;
}
break;
case 'print-by-period':
$fdate = _post('fdate');
$tdate = _post('tdate');
$stype = _post('stype');
$d = ORM::for_table('tbl_transactions');
if ($stype != ''){
$d->where('type', $stype);
}
$d->where_gte('recharged_on', $fdate);
$d->where_lte('recharged_on', $tdate);
$d->order_by_desc('id');
$x = $d->find_many();
$dr = ORM::for_table('tbl_transactions');
if ($stype != ''){
$dr->where('type', $stype);
}
$dr->where_gte('recharged_on', $fdate);
$dr->where_lte('recharged_on', $tdate);
$xy = $dr->sum('price');
$ui->assign('d',$x);
$ui->assign('dr',$xy);
$ui->assign('fdate',$fdate);
$ui->assign('tdate',$tdate);
$ui->assign('stype',$stype);
run_hook('print_by_period'); #HOOK
$ui->display('print-by-period.tpl');
break;
case 'pdf-by-period':
$fdate = _post('fdate');
$tdate = _post('tdate');
$stype = _post('stype');
$d = ORM::for_table('tbl_transactions');
if ($stype != ''){
$d->where('type', $stype);
}
$d->where_gte('recharged_on', $fdate);
$d->where_lte('recharged_on', $tdate);
$d->order_by_desc('id');
$x = $d->find_many();
$dr = ORM::for_table('tbl_transactions');
if ($stype != ''){
$dr->where('type', $stype);
}
$dr->where_gte('recharged_on', $fdate);
$dr->where_lte('recharged_on', $tdate);
$xy = $dr->sum('price');
@ -248,7 +243,7 @@ EOF;
</div>
<div id="logo"><img id="image" src="system/uploads/logo.png" alt="logo" /></div>
</div>
<div id="header">'.$_L['All_Transactions_at_Date'].': '.date( $_c['date_format'], strtotime($fdate)).' - ' .date( $_c['date_format'], strtotime($tdate)).'</div>
<div id="header">'.$_L['All_Transactions_at_Date'].': '.date( $config['date_format'], strtotime($fdate)).' - ' .date( $config['date_format'], strtotime($tdate)).'</div>
<table id="customers">
<tr>
<th>'.$_L['Username'].'</th>
@ -262,11 +257,11 @@ EOF;
</tr>';
$c = true;
foreach ($x as $value) {
$username = $value['username'];
$plan_name = $value['plan_name'];
$type = $value['type'];
$price = $_c['currency_code'].' '. number_format($value['price'],0,$_c['dec_point'],$_c['thousands_sep']);
$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']));
$time = $value['time'];
@ -286,8 +281,9 @@ EOF;
}
$html .= '</table>
<h4 class="text-uppercase text-bold">'.$_L['Total_Income'].':</h4>
<h3 class="sum">'.$_c['currency_code'].' '.number_format($xy,2,$_c['dec_point'],$_c['thousands_sep']).'</h3>';
<h3 class="sum">'.$config['currency_code'].' '.number_format($xy,2,$config['dec_point'],$config['thousands_sep']).'</h3>';
run_hook('pdf_by_period'); #HOOK
define('_MPDF_PATH','system/vendors/mpdf/');
require('system/vendors/mpdf/mpdf.php');
@ -308,7 +304,7 @@ EOF;
#address { width: 300px; float: left; }
#logo { text-align: right; float: right; position: relative; margin-top: 15px; border: 5px solid #fff; overflow: hidden; }
#customers
{
font-family: Helvetica, sans-serif;
@ -349,7 +345,7 @@ EOF;
}
break;
default:
echo 'action not defined';
}

View File

@ -1,14 +1,10 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
**/
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
_auth();
$ui->assign('_title', $_L['Dashboard'].' - '. $config['CompanyName']);
$ui->assign('_title', $_L['Dashboard']);
$user = User::_info();
$ui->assign('_user', $user);
@ -17,4 +13,10 @@ $ui->assign('_user', $user);
$bill = User::_billing();
$ui->assign('_bill', $bill);
$ui->display('user-dashboard.tpl');
$ui->assign('unpaid', ORM::for_table('tbl_payment_gateway')
->where('username', $user['username'])
->where('status', 1)
->find_one());
run_hook('view_customer_dashboard'); #HOOK
$ui->display('user-dashboard.tpl');

View File

@ -1,12 +1,9 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
**/
**/
if (isset($routes['1'])) {
$do = $routes['1'];
@ -14,42 +11,39 @@ if (isset($routes['1'])) {
$do = 'login-display';
}
switch($do){
switch ($do) {
case 'post':
$username = _post('username');
$password = _post('password');
if($username != '' AND $password != ''){
$d = ORM::for_table('tbl_customers')->where('username',$username)->find_one();
if($d){
$d_pass = $d['password'];
if(Password::_uverify($password,$d_pass) == true){
$_SESSION['uid'] = $d['id'];
$d->last_login = date('Y-m-d H:i:s');
$d->save();
_log($username .' '. $_L['Login_Successful'],'User',$d['id']);
r2(U.'home');
}else{
_msglog('e',$_L['Invalid_Username_or_Password']);
_log($username .' '. $_L['Failed_Login'],'User');
r2(U.'login');
}
}else{
_msglog('e',$_L['Invalid_Username_or_Password']);
r2(U.'login');
}
}else{
_msglog('e',$_L['Invalid_Username_or_Password']);
r2(U.'login');
}
$username = _post('username');
$password = _post('password');
run_hook('customer_login'); #HOOK
if ($username != '' and $password != '') {
$d = ORM::for_table('tbl_customers')->where('username', $username)->find_one();
if ($d) {
$d_pass = $d['password'];
if (Password::_uverify($password, $d_pass) == true) {
$_SESSION['uid'] = $d['id'];
$d->last_login = date('Y-m-d H:i:s');
$d->save();
_log($username . ' ' . $_L['Login_Successful'], 'User', $d['id']);
r2(U . 'home');
} else {
_msglog('e', $_L['Invalid_Username_or_Password']);
_log($username . ' ' . $_L['Failed_Login'], 'User');
r2(U . 'login');
}
} else {
_msglog('e', $_L['Invalid_Username_or_Password']);
r2(U . 'login');
}
} else {
_msglog('e', $_L['Invalid_Username_or_Password']);
r2(U . 'login');
}
break;
case 'login-display':
$ui->display('login.tpl');
break;
default:
$ui->display('login.tpl');
run_hook('customer_view_login'); #HOOK
$ui->display('user-login.tpl');
break;
}

View File

@ -1,12 +1,8 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
run_hook('customer_logout'); #HOOK
if (session_status() == PHP_SESSION_NONE) session_start();
session_destroy();
header('location: index.php');

View File

@ -1,21 +0,0 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
**/
_admin();
$ui->assign('_title', $_L['Private_Message'].'- '. $config['CompanyName']);
$ui->assign('_system_menu', 'message');
$action = $routes['1'];
$admin = Admin::_info();
$ui->assign('_admin', $admin);
switch ($action) {
default:
$ui->display('a404.tpl');
}

View File

@ -0,0 +1,176 @@
<?php
/**
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
_auth();
$action = $routes['1'];
$user = User::_info();
$ui->assign('_user', $user);
switch ($action) {
case 'voucher':
$ui->assign('_system_menu', 'voucher');
$ui->assign('_title', $_L['Order_Voucher']);
run_hook('customer_view_order'); #HOOK
$ui->display('user-order.tpl');
break;
case 'history':
$ui->assign('_system_menu', 'history');
$d = ORM::for_table('tbl_payment_gateway')
->where('username', $user['username'])
->order_by_desc('id')
->find_many();
$paginator = Paginator::bootstrap('tbl_payment_gateway', 'username', $user['username']);
$ui->assign('paginator', $paginator);
$ui->assign('d', $d);
$ui->assign('_title', Lang::T('Order History'));
run_hook('customer_view_order_history'); #HOOK
$ui->display('user-orderHistory.tpl');
break;
case 'package':
if(empty($user['email'])){
r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address"));
}
$ui->assign('_title', 'Order Plan');
$ui->assign('_system_menu', 'package');
$routers = ORM::for_table('tbl_routers')->find_many();
$plans = ORM::for_table('tbl_plans')->where('enabled', '1')->find_many();
$ui->assign('routers', $routers);
$ui->assign('plans', $plans);
run_hook('customer_view_order_plan'); #HOOK
$ui->display('user-orderPlan.tpl');
break;
case 'unpaid':
$d = ORM::for_table('tbl_payment_gateway')
->where('username', $user['username'])
->where('status', 1)
->find_one();
run_hook('customer_find_unpaid'); #HOOK
if ($d) {
if (empty($d['pg_url_payment'])) {
r2(U . "order/buy/" . $trx['routers_id'] . '/' . $trx['plan_id'], 'w', Lang::T("Checking payment"));
} else {
r2(U . "order/view/" . $d['id'] . '/check/', 's', Lang::T("You have unpaid transaction"));
}
} else {
r2(U . "order/package/", 's', Lang::T("You have no unpaid transaction"));
}
case 'view':
$trxid = $routes['2'] * 1;
$trx = ORM::for_table('tbl_payment_gateway')
->where('username', $user['username'])
->find_one($trxid);
run_hook('customer_view_payment'); #HOOK
// jika tidak ditemukan, berarti punya orang lain
if (empty($trx)) {
r2(U . "order/package", 'w', Lang::T("Payment not found"));
}
// jika url kosong, balikin ke buy
if (empty($trx['pg_url_payment'])) {
r2(U . "order/buy/" . $trx['routers_id'] . '/' . $trx['plan_id'], 'w', Lang::T("Checking payment"));
}
if ($routes['3'] == 'check') {
if (!file_exists('system/paymentgateway/' . $trx['gateway'] . '.php')) {
r2(U . 'order/view/' . $trxid, 'e', Lang::T("No Payment Gateway Available"));
}
run_hook('customer_check_payment_status'); #HOOK
include 'system/paymentgateway/' . $trx['gateway'] . '.php';
call_user_func($trx['gateway'] . '_validate_config');
call_user_func($config['payment_gateway'] . '_get_status', $trx, $user);
} else if ($routes['3'] == 'cancel') {
run_hook('customer_cancel_payment'); #HOOK
$trx->pg_paid_response = '{}';
$trx->status = 4;
$trx->paid_date = date('Y-m-d H:i:s');
$trx->save();
$trx = ORM::for_table('tbl_payment_gateway')
->where('username', $user['username'])
->find_one($trxid);
if ('midtrans' == $trx['gateway']) {
//Hapus invoice link
}
}
if (empty($trx)) {
r2(U . "home", 'e', Lang::T("Transaction Not found"));
}
$router = ORM::for_table('tbl_routers')->find_one($trx['routers_id']);
$plan = ORM::for_table('tbl_plans')->find_one($trx['plan_id']);
$bandw = ORM::for_table('tbl_bandwidth')->find_one($plan['id_bw']);
$ui->assign('trx', $trx);
$ui->assign('router', $router);
$ui->assign('plan', $plan);
$ui->assign('bandw', $bandw);
$ui->assign('_title', 'TRX #' . $trxid);
$ui->display('user-orderView.tpl');
break;
case 'buy':
if(empty($user['email'])){
r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address"));
}
if ($config['payment_gateway'] == 'none') {
r2(U . 'home', 'e', Lang::T("No Payment Gateway Available"));
}
if (!file_exists('system/paymentgateway/' . $config['payment_gateway'] . '.php')) {
r2(U . 'home', 'e', Lang::T("No Payment Gateway Available"));
}
run_hook('customer_buy_plan'); #HOOK
include 'system/paymentgateway/' . $config['payment_gateway'] . '.php';
call_user_func($config['payment_gateway'] . '_validate_config');
$router = ORM::for_table('tbl_routers')->where('enabled', '1')->find_one($routes['2'] * 1);
$plan = ORM::for_table('tbl_plans')->where('enabled', '1')->find_one($routes['3'] * 1);
if (empty($router) || empty($plan)) {
r2(U . $back, 'e', Lang::T("Plan Not found"));
}
$d = ORM::for_table('tbl_payment_gateway')
->where('username', $user['username'])
->where('status', 1)
->find_one();
if ($d) {
if ($d['pg_url_payment']) {
r2(U . "order/view/" . $d['id'], 'w', Lang::T("You already have unpaid transaction, cancel it or pay it."));
} else {
if ($config['payment_gateway'] == $d['gateway']) {
$id = $d['id'];
} else {
$d->status = 4;
$d->save();
}
}
}
if (empty($id)) {
$d = ORM::for_table('tbl_payment_gateway')->create();
$d->username = $user['username'];
$d->gateway = $config['payment_gateway'];
$d->plan_id = $plan['id'];
$d->plan_name = $plan['name_plan'];
$d->routers_id = $router['id'];
$d->routers = $router['name'];
$d->price = $plan['price'];
$d->created_date = date('Y-m-d H:i:s');
$d->status = 1;
$d->save();
$id = $d->id();
} else {
$d->username = $user['username'];
$d->gateway = $config['payment_gateway'];
$d->plan_id = $plan['id'];
$d->plan_name = $plan['name_plan'];
$d->routers_id = $router['id'];
$d->routers = $router['name'];
$d->price = $plan['price'];
$d->created_date = date('Y-m-d H:i:s');
$d->status = 1;
$d->save();
}
if (!$id) {
r2(U . "order/package/" . $d['id'], 'e', Lang::T("Failed to create Transaction.."));
} else {
call_user_func($config['payment_gateway'] . '_create_transaction', $d, $user);
}
break;
default:
$ui->display('404.tpl');
}

View File

@ -1,14 +1,9 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
_auth();
$ui->assign('_title', $_L['Order_Voucher'].'- '. $config['CompanyName']);
$ui->assign('_title', $_L['Order_Voucher']);
$ui->assign('_system_menu', 'order');
$action = $routes['1'];
@ -18,6 +13,7 @@ $ui->assign('_user', $user);
if(file_exists(__DIR__."/../../pages/".str_replace(".","",$action).".html")){
$ui->assign("PageFile",$action);
$ui->assign("pageHeader",$action);
run_hook('customer_view_page'); #HOOK
$ui->display('user-pages.tpl');
}else
$ui->display('404.tpl');

View File

@ -1,14 +1,9 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
_admin();
$ui->assign('_title', 'Pages - '. $config['CompanyName']);
$ui->assign('_title', 'Pages');
$ui->assign('_system_menu', 'pages');
$action = $routes['1'];
@ -18,6 +13,7 @@ $ui->assign('_admin', $admin);
if(strpos($action,"-post")===false){
$path = __DIR__."/../../pages/".str_replace(".","",$action).".html";
//echo $path;
run_hook('view_edit_pages'); #HOOK
if(file_exists($path)){
$html = file_get_contents($path);
$ui->assign("htmls",str_replace(["<div","</div>"],"",$html));
@ -32,6 +28,7 @@ if(strpos($action,"-post")===false){
$path = __DIR__."/../../pages/".str_replace(".","",$action).".html";
if(file_exists($path)){
$html = _post("html");
run_hook('save_pages'); #HOOK
if(file_put_contents($path, str_replace(["<div","</div>"],"",$html))){
r2(U . 'pages/'.$action, 's', $_L['Success_Save_Page']);
}else{

View File

@ -0,0 +1,55 @@
<?php
/**
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
_admin();
$ui->assign('_system_menu', 'paymentgateway');
$action = alphanumeric($routes['1']);
$admin = Admin::_info();
$ui->assign('_admin', $admin);
if(file_exists('system/paymentgateway/'.$action.'.php')){
include 'system/paymentgateway/'.$action.'.php';
if ($_SERVER['REQUEST_METHOD'] === 'POST') {
if(function_exists($action.'_save_config')){
call_user_func($action.'_save_config');
}else{
$ui->display('a404.tpl');
}
}else{
if(function_exists($action.'_show_config')){
call_user_func($action.'_show_config');
}else{
$ui->display('a404.tpl');
}
}
}else{
if(!empty($action)){
r2(U . 'paymentgateway', 'w', Lang::T('Payment Gateway Not Found'));
}else{
$files = scandir('system/paymentgateway/');
foreach($files as $file){
if(pathinfo($file, PATHINFO_EXTENSION)=='php'){
$pgs[] = str_replace('.php','',$file);
}
}
if(isset($_POST['payment_gateway'])){
$payment_gateway = _post('payment_gateway');
$d = ORM::for_table('tbl_appconfig')->where('setting', 'payment_gateway')->find_one();
if($d){
$d->value = $payment_gateway;
$d->save();
}else{
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'payment_gateway';
$d->value = $payment_gateway;
$d->save();
}
r2(U . 'paymentgateway', 's', Lang::T('Payment Gateway saved successfully'));
}
$ui->assign('_title', 'Payment Gateway Settings');
$ui->assign('pgs', $pgs);
$ui->display('paymentgateway.tpl');
}
}

View File

@ -0,0 +1,7 @@
<?php
if(function_exists($routes[1])){
call_user_func($routes[1]);
}else{
r2(U.'dashboard', 'e', 'Function not found');
}

View File

@ -0,0 +1,124 @@
<?php
/**
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
_admin();
$ui->assign('_title', $_L['Plugin Manager']);
$ui->assign('_system_menu', 'settings');
$plugin_repository = 'https://hotspotbilling.github.io/Plugin-Repository/repository.json';
$action = $routes['1'];
$admin = Admin::_info();
$ui->assign('_admin', $admin);
if ($admin['user_type'] != 'Admin') {
r2(U . "dashboard", 'e', $_L['Do_Not_Access']);
}
$cache = File::pathFixer('system/cache/plugin_repository.json');
if (file_exists($cache) && time() - filemtime($cache) > (24 * 60 * 60)) {
$json = json_decode(file_get_contents($cache), true);
} else {
$data = file_get_contents($plugin_repository);
file_put_contents($cache, $data);
$json = json_decode($data, true);
}
switch ($action) {
case 'install':
if(!is_writeable(File::pathFixer('system/cache/'))){
r2(U . "pluginmanager", 'e', 'Folder system/cache/ is not writable');
}
if(!is_writeable(File::pathFixer('system/plugin/'))){
r2(U . "pluginmanager", 'e', 'Folder system/plugin/ is not writable');
}
set_time_limit(-1);
$tipe = $routes['2'];
$plugin = $routes['3'];
$file = File::pathFixer('system/cache/') . $plugin . '.zip';
if (file_exists($file)) unlink($file);
if ($tipe == 'plugin') {
foreach ($json['plugins'] as $plg) {
if ($plg['id'] == $plugin) {
$fp = fopen($file, 'w+');
$ch = curl_init($plg['github'].'/archive/refs/heads/master.zip');
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_exec($ch);
curl_close($ch);
fclose($fp);
$zip = new ZipArchive();
$zip->open($file);
$zip->extractTo(File::pathFixer('system/cache/'));
$zip->close();
$folder = File::pathFixer('system/cache/' . $plugin.'-main/');
if(!file_exists($folder)){
$folder = File::pathFixer('system/cache/' . $plugin.'-master/');
}
if(!file_exists($folder)){
r2(U . "pluginmanager", 'e', 'Extracted Folder is unknown');
}
File::copyFolder($folder, File::pathFixer('system/plugin/'), ['README.md','LICENSE']);
File::deleteFolder($folder);
unlink($file);
r2(U . "pluginmanager", 's', 'Plugin '.$plugin.' has been installed');
break;
}
}
break;
} else if ($tipe == 'payment') {
foreach ($json['payment_gateway'] as $plg) {
if ($plg['id'] == $plugin) {
$fp = fopen($file, 'w+');
$ch = curl_init($plg['github'].'/archive/refs/heads/master.zip');
curl_setopt($ch, CURLOPT_POST, 0);
curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15);
curl_setopt($ch, CURLOPT_TIMEOUT, 15);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true);
curl_setopt($ch, CURLOPT_FILE, $fp);
curl_exec($ch);
curl_close($ch);
fclose($fp);
$zip = new ZipArchive();
$zip->open($file);
$zip->extractTo(File::pathFixer('system/cache/'));
$zip->close();
$folder = File::pathFixer('system/cache/' . $plugin.'-main/');
if(!file_exists($folder)){
$folder = File::pathFixer('system/cache/' . $plugin.'-master/');
}
if(!file_exists($folder)){
r2(U . "pluginmanager", 'e', 'Extracted Folder is unknown');
}
File::copyFolder($folder, File::pathFixer('system/paymentgateway/'), ['README.md','LICENSE']);
File::deleteFolder($folder);
unlink($file);
r2(U . "paymentgateway", 's', 'Payment Gateway '.$plugin.' has been installed');
break;
}
}
break;
}
default:
if (class_exists('ZipArchive')) {
$zipExt = true;
} else {
$zipExt = false;
}
$ui->assign('zipExt', $zipExt);
$ui->assign('plugins', $json['plugins']);
$ui->assign('pgs', $json['payment_gateway']);
$ui->display('plugin-manager.tpl');
}

View File

@ -1,21 +0,0 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
**/
_auth();
$ui->assign('_title', $_L['Private_Message'].'- '. $config['CompanyName']);
$ui->assign('_system_menu', 'pm');
$action = $routes['1'];
$user = User::_info();
$ui->assign('_user', $user);
switch ($action) {
default:
$ui->display('404.tpl');
}

View File

@ -1,87 +1,74 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
**/
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
_admin();
$ui->assign('_title', $_L['Network'].' - '. $config['CompanyName']);
$ui->assign('_title', $_L['Network']);
$ui->assign('_system_menu', 'network');
$action = $routes['1'];
$admin = Admin::_info();
$ui->assign('_admin', $admin);
if($admin['user_type'] != 'Admin'){
r2(U."dashboard",'e',$_L['Do_Not_Access']);
if ($admin['user_type'] != 'Admin') {
r2(U . "dashboard", 'e', $_L['Do_Not_Access']);
}
use PEAR2\Net\RouterOS;
require_once 'system/autoload/PEAR2/Autoload.php';
switch ($action) {
case 'list':
$ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/pool.js"></script>');
$name = _post('name');
if ($name != ''){
$paginator = Paginator::bootstrap('tbl_pool','pool_name','%'.$name.'%');
$d = ORM::for_table('tbl_pool')->where_like('pool_name','%'.$name.'%')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many();
}else{
$paginator = Paginator::bootstrap('tbl_pool');
$d = ORM::for_table('tbl_pool')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many();
}
$ui->assign('d',$d);
$ui->assign('paginator',$paginator);
$ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/pool.js"></script>');
$name = _post('name');
if ($name != '') {
$paginator = Paginator::bootstrap('tbl_pool', 'pool_name', '%' . $name . '%');
$d = ORM::for_table('tbl_pool')->where_like('pool_name', '%' . $name . '%')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many();
} else {
$paginator = Paginator::bootstrap('tbl_pool');
$d = ORM::for_table('tbl_pool')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many();
}
$ui->assign('d', $d);
$ui->assign('paginator', $paginator);
run_hook('view_pool'); #HOOK
$ui->display('pool.tpl');
break;
case 'add':
$r = ORM::for_table('tbl_routers')->find_many();
$ui->assign('r',$r);
$ui->display('pool-add.tpl');
$r = ORM::for_table('tbl_routers')->find_many();
$ui->assign('r', $r);
run_hook('view_add_pool'); #HOOK
$ui->display('pool-add.tpl');
break;
case 'edit':
$id = $routes['2'];
$d = ORM::for_table('tbl_pool')->find_one($id);
if($d){
$ui->assign('d',$d);
if ($d) {
$ui->assign('d', $d);
run_hook('view_edit_pool'); #HOOK
$ui->display('pool-edit.tpl');
}else{
} else {
r2(U . 'pool/list', 'e', $_L['Account_Not_Found']);
}
break;
case 'delete':
$id = $routes['2'];
run_hook('delete_pool'); #HOOK
$d = ORM::for_table('tbl_pool')->find_one($id);
$mikrotik = Router::_info($d['routers']);
if($d){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$printRequest = new RouterOS\Request(
'/ip pool print .proplist=name',
RouterOS\Query::where('name', $d['pool_name'])
);
$poolName = $client->sendSync($printRequest)->getProperty('name');
$removeRequest = new RouterOS\Request('/ip/pool/remove');
$client($removeRequest
->setArgument('numbers', $poolName)
);
$mikrotik = Mikrotik::info($d['routers']);
if ($d) {
if (!$config['radius_mode']) {
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::removePool($client, $d['pool_name']);
}
$d->delete();
r2(U . 'pool/list', 's', $_L['Delete_Successfully']);
}
break;
@ -89,97 +76,74 @@ switch ($action) {
case 'add-post':
$name = _post('name');
$ip_address = _post('ip_address');
$routers = _post('routers');
$routers = _post('routers');
run_hook('add_pool'); #HOOK
$msg = '';
if(Validator::Length($name,30,2) == false){
$msg .= 'Name should be between 3 to 30 characters'. '<br>';
if (Validator::Length($name, 30, 2) == false) {
$msg .= 'Name should be between 3 to 30 characters' . '<br>';
}
if ($ip_address == '' OR $routers == ''){
$msg .= $_L['All_field_is_required']. '<br>';
}
$d = ORM::for_table('tbl_pool')->where('pool_name',$name)->find_one();
if($d){
$msg .= $_L['Pool_already_exist']. '<br>';
if ($ip_address == '' or $routers == '') {
$msg .= $_L['All_field_is_required'] . '<br>';
}
$mikrotik = Router::_info($routers);
if($msg == ''){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$addRequest = new RouterOS\Request('/ip/pool/add');
$client->sendSync($addRequest
->setArgument('name', $name)
->setArgument('ranges', $ip_address)
);
$d = ORM::for_table('tbl_pool')->where('pool_name', $name)->find_one();
if ($d) {
$msg .= $_L['Pool_already_exist'] . '<br>';
}
$mikrotik = Mikrotik::info($routers);
if ($msg == '') {
if (!$config['radius_mode']) {
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::addPool($client, $name, $ip_address);
}
$b = ORM::for_table('tbl_pool')->create();
$b->pool_name = $name;
$b->range_ip = $ip_address;
$b->routers = $routers;
$b->routers = $routers;
$b->save();
r2(U . 'pool/list', 's', $_L['Created_Successfully']);
}else{
} else {
r2(U . 'pool/add', 'e', $msg);
}
break;
case 'edit-post':
$name = _post('name');
$ip_address = _post('ip_address');
$routers = _post('routers');
run_hook('edit_pool'); #HOOK
$msg = '';
if(Validator::Length($name,30,2) == false){
$msg .= 'Name should be between 3 to 30 characters'. '<br>';
if ($ip_address == '' or $routers == '') {
$msg .= $_L['All_field_is_required'] . '<br>';
}
if ($ip_address == '' OR $routers == ''){
$msg .= $_L['All_field_is_required']. '<br>';
}
$id = _post('id');
$d = ORM::for_table('tbl_pool')->find_one($id);
if($d){
}else{
$msg .= $_L['Data_Not_Found']. '<br>';
if ($d) {
} else {
$msg .= $_L['Data_Not_Found'] . '<br>';
}
$mikrotik = Router::_info($routers);
if($msg == ''){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$printRequest = new RouterOS\Request(
'/ip pool print .proplist=name',
RouterOS\Query::where('name', $name)
);
$poolName = $client->sendSync($printRequest)->getProperty('name');
$setRequest = new RouterOS\Request('/ip/pool/set');
$client($setRequest
->setArgument('numbers', $poolName)
->setArgument('ranges', $ip_address)
);
$d->pool_name = $name;
$mikrotik = Mikrotik::info($routers);
if ($msg == '') {
if (!$config['radius_mode']) {
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::setPool($client, $d['pool_name'], $ip_address);
}
$d->range_ip = $ip_address;
$d->routers = $routers;
$d->routers = $routers;
$d->save();
r2(U . 'pool/list', 's', $_L['Updated_Successfully']);
}else{
r2(U . 'pool/edit/'.$id, 'e', $msg);
} else {
r2(U . 'pool/edit/' . $id, 'e', $msg);
}
break;
default:
echo 'action not defined';
}
}

View File

@ -1,13 +1,13 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
**/
_admin();
$ui->assign('_title', $_L['Recharge_Account'] . ' - ' . $config['CompanyName']);
$ui->assign('_title', $_L['Recharge_Account']);
$ui->assign('_system_menu', 'prepaid');
$action = $routes['1'];
@ -37,17 +37,18 @@ switch ($action) {
$ui->assign('d', $d);
$ui->assign('paginator', $paginator);
run_hook('view_list_billing'); #HOOK
$ui->display('prepaid.tpl');
break;
case 'recharge':
$c = ORM::for_table('tbl_customers')->find_many();
$ui->assign('c', $c);
$p = ORM::for_table('tbl_plans')->find_many();
$p = ORM::for_table('tbl_plans')->where('enabled', '1')->find_many();
$ui->assign('p', $p);
$r = ORM::for_table('tbl_routers')->find_many();
$r = ORM::for_table('tbl_routers')->where('enabled', '1')->find_many();
$ui->assign('r', $r);
run_hook('view_recharge'); #HOOK
$ui->display('recharge.tpl');
break;
@ -57,11 +58,11 @@ switch ($action) {
$c = ORM::for_table('tbl_customers')->find_many();
$ui->assign('c', $c);
$p = ORM::for_table('tbl_plans')->find_many();
$p = ORM::for_table('tbl_plans')->where('enabled', '1')->find_many();
$ui->assign('p', $p);
$r = ORM::for_table('tbl_routers')->find_many();
$r = ORM::for_table('tbl_routers')->where('enabled', '1')->find_many();
$ui->assign('r', $r);
run_hook('view_recharge_customer'); #HOOK
$ui->display('recharge-user.tpl');
break;
@ -82,85 +83,30 @@ switch ($action) {
if ($msg == '') {
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
$p = ORM::for_table('tbl_plans')->where('id', $plan)->find_one();
$p = ORM::for_table('tbl_plans')->where('id', $plan)->where('enabled', '1')->find_one();
$b = ORM::for_table('tbl_user_recharges')->where('customer_id', $id_customer)->find_one();
$mikrotik = Router::_info($server);
$date_exp = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") + $p['validity'], date("Y")));
$mikrotik = Mikrotik::info($server);
if($p['validity_unit']=='Months'){
$date_exp = date("Y-m-d", strtotime('+'.$p['validity'].' month'));
}else if($p['validity_unit']=='Days'){
$date_exp = date("Y-m-d", strtotime('+'.$p['validity'].' day'));
}else if($p['validity_unit']=='Hrs'){
$datetime = explode(' ',date("Y-m-d H:i:s", strtotime('+'.$p['validity'].' hour')));
$date_exp = $datetime[0];
$time = $datetime[1];
}else if($p['validity_unit']=='Mins'){
$datetime = explode(' ',date("Y-m-d H:i:s", strtotime('+'.$p['validity'].' minute')));
$date_exp = $datetime[0];
$time = $datetime[1];
}
run_hook('recharge_customer'); #HOOK
if ($type == 'Hotspot') {
if ($b) {
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$printRequest = new RouterOS\Request(
'/ip hotspot user print .proplist=name',
RouterOS\Query::where('name', $c['username'])
);
$userName = $client->sendSync($printRequest)->getProperty('name');
$removeRequest = new RouterOS\Request('/ip/hotspot/user/remove');
$client(
$removeRequest
->setArgument('numbers', $userName)
);
/* iBNuX Added:
* Time limit to Mikrotik
* 'Time_Limit', 'Data_Limit', 'Both_Limit'
*/
$addRequest = new RouterOS\Request('/ip/hotspot/user/add');
if ($p['typebp'] == "Limited") {
if ($p['limit_type'] == "Time_Limit") {
if ($p['time_unit'] == 'Hrs')
$timelimit = $p['time_limit'] . ":00:00";
else
$timelimit = "00:" . $p['time_limit'] . ":00";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
);
} else if ($p['limit_type'] == "Data_Limit") {
if ($p['data_unit'] == 'GB')
$datalimit = $p['data_limit'] . "000000000";
else
$datalimit = $p['data_limit'] . "000000";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-bytes-total', $datalimit)
);
} else if ($p['limit_type'] == "Both_Limit") {
if ($p['time_unit'] == 'Hrs')
$timelimit = $p['time_limit'] . ":00:00";
else
$timelimit = "00:" . $p['time_limit'] . ":00";
if ($p['data_unit'] == 'GB')
$datalimit = $p['data_limit'] . "000000000";
else
$datalimit = $p['data_limit'] . "000000";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
->setArgument('limit-bytes-total', $datalimit)
);
}
} else {
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
if(!$config['radius_mode']){
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::removeHotspotUser($client,$c['username']);
Mikrotik::addHotspotUser($client,$p,$c);
}
$b->customer_id = $id_customer;
@ -190,67 +136,9 @@ switch ($action) {
$t->type = "Hotspot";
$t->save();
} else {
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
/* iBNuX Added:
* Time limit to Mikrotik
* 'Time_Limit', 'Data_Limit', 'Both_Limit'
*/
$addRequest = new RouterOS\Request('/ip/hotspot/user/add');
if ($p['typebp'] == "Limited") {
if ($p['limit_type'] == "Time_Limit") {
if ($p['time_unit'] == 'Hrs')
$timelimit = $p['time_limit'] . ":00:00";
else
$timelimit = "00:" . $p['time_limit'] . ":00";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
);
} else if ($p['limit_type'] == "Data_Limit") {
if ($p['data_unit'] == 'GB')
$datalimit = $p['data_limit'] . "000000000";
else
$datalimit = $p['data_limit'] . "000000";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-bytes-total', $datalimit)
);
} else if ($p['limit_type'] == "Both_Limit") {
if ($p['time_unit'] == 'Hrs')
$timelimit = $p['time_limit'] . ":00:00";
else
$timelimit = "00:" . $p['time_limit'] . ":00";
if ($p['data_unit'] == 'GB')
$datalimit = $p['data_limit'] . "000000000";
else
$datalimit = $p['data_limit'] . "000000";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
->setArgument('limit-bytes-total', $datalimit)
);
}
} else {
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
if(!$config['radius_mode']){
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::addHotspotUser($client,$p,$c);
}
$d = ORM::for_table('tbl_user_recharges')->create();
@ -281,34 +169,17 @@ switch ($action) {
$t->type = "Hotspot";
$t->save();
}
Message::sendTelegram( "$admin[fullname] #Recharge Voucher #Hotspot for #u$c[username]\n".$p['name_plan'].
"\nRouter: ".$server.
"\nPrice: ".$p['price']);
} else {
if ($b) {
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
if(!$config['radius_mode']){
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::removePpoeUser($client,$c['username']);
Mikrotik::addPpoeUser($client,$p,$c);
}
$printRequest = new RouterOS\Request(
'/ppp secret print .proplist=name',
RouterOS\Query::where('name', $c['username'])
);
$userName = $client->sendSync($printRequest)->getProperty('name');
$removeRequest = new RouterOS\Request('/ppp/secret/remove');
$client(
$removeRequest
->setArgument('numbers', $userName)
);
$addRequest = new RouterOS\Request('/ppp/secret/add');
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('service', 'pppoe')
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
$b->customer_id = $id_customer;
$b->username = $c['username'];
@ -337,19 +208,10 @@ switch ($action) {
$t->type = "PPPOE";
$t->save();
} else {
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
if(!$config['radius_mode']){
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::addPpoeUser($client,$p,$c);
}
$addRequest = new RouterOS\Request('/ppp/secret/add');
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('service', 'pppoe')
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
$d = ORM::for_table('tbl_user_recharges')->create();
$d->customer_id = $id_customer;
@ -379,10 +241,38 @@ switch ($action) {
$t->type = "PPPOE";
$t->save();
}
Message::sendTelegram( "$admin[fullname] #Recharge Voucher #PPPOE for #u$c[username]\n".$p['name_plan'].
"\nRouter: ".$server.
"\nPrice: ".$p['price']);
}
$in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one();
$ui->assign('in', $in);
$msg = "*$config[CompanyName]*\n".
"$config[address]\n".
"$config[phone]\n".
"\n\n".
"INVOICE: *$in[invoice]*\n".
"$_L[Date] : $date_now\n".
"$_L[Sales] : $admin[fullname]\n".
"\n\n".
"$_L[Type] : *$in[type]*\n".
"$_L[Plan_Name] : *$in[plan_name]*\n".
"$_L[Plan_Price] : *$config[currency_code] ".number_format($in['price'],2,$config['dec_point'],$config['thousands_sep'])."*\n\n".
"$_L[Username] : *$in[username]*\n".
"$_L[Password] : **********\n\n".
"$_L[Created_On] :\n*".date($config['date_format'], strtotime($in['recharged_on']))." $in[time]*\n".
"$_L[Expires_On] :\n*".date($config['date_format'], strtotime($in['expiration']))." $in[time]*\n".
"\n\n".
"$config[note]";
if ($_c['user_notification_payment'] == 'sms') {
Message::sendSMS($c['phonenumber'], $msg);
} else if ($_c['user_notification_payment'] == 'wa') {
Message::sendWhatsapp($c['phonenumber'], $msg);
}
$ui->assign('date', $date_now);
$ui->display('invoice.tpl');
} else {
@ -398,18 +288,18 @@ switch ($action) {
$ui->assign('d', $d);
$ui->assign('date', $date_now);
run_hook('print_invoice'); #HOOK
$ui->display('invoice-print.tpl');
break;
break;
case 'edit':
$id = $routes['2'];
$d = ORM::for_table('tbl_user_recharges')->find_one($id);
if ($d) {
$ui->assign('d', $d);
$p = ORM::for_table('tbl_plans')->find_many();
$p = ORM::for_table('tbl_plans')->where('enabled', '1')->find_many();
$ui->assign('p', $p);
run_hook('view_edit_customer_plan'); #HOOK
$ui->display('prepaid-edit.tpl');
} else {
r2(U . 'services/list', 'e', $_L['Account_Not_Found']);
@ -420,43 +310,21 @@ switch ($action) {
$id = $routes['2'];
$d = ORM::for_table('tbl_user_recharges')->find_one($id);
$mikrotik = Router::_info($d['routers']);
$mikrotik = Mikrotik::info($d['routers']);
if ($d) {
run_hook('delete_customer_active_plan'); #HOOK
if ($d['type'] == 'Hotspot') {
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
if(!$config['radius_mode']){
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::removeHotspotUser($client,$c['username']);
}
$printRequest = new RouterOS\Request(
'/ip hotspot user print .proplist=name',
RouterOS\Query::where('name', $d['username'])
);
$userName = $client->sendSync($printRequest)->getProperty('name');
$removeRequest = new RouterOS\Request('/ip/hotspot/user/remove');
$client(
$removeRequest
->setArgument('numbers', $userName)
);
$d->delete();
} else {
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
if(!$config['radius_mode']){
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::removePpoeUser($client,$c['username']);
}
$printRequest = new RouterOS\Request(
'/ppp secret print .proplist=name',
RouterOS\Query::where('name', $d['username'])
);
$userName = $client->sendSync($printRequest)->getProperty('name');
$removeRequest = new RouterOS\Request('/ppp/secret/remove');
$client(
$removeRequest
->setArgument('numbers', $userName)
);
$d->delete();
}
r2(U . 'prepaid/list', 's', $_L['Delete_Successfully']);
@ -477,12 +345,13 @@ switch ($action) {
}
if ($msg == '') {
run_hook('edit_customer_plan'); #HOOK
$d->username = $username;
$d->plan_id = $id_plan;
$d->recharged_on = $recharged_on;
$d->expiration = $expiration;
$d->save();
//TODO set mikrotik for editedd plan
r2(U . 'prepaid/list', 's', $_L['Updated_Successfully']);
} else {
r2(U . 'prepaid/edit/' . $id, 'e', $msg);
@ -496,7 +365,7 @@ switch ($action) {
if ($code != '') {
$ui->assign('code', $code);
$paginator = Paginator::bootstrap('tbl_voucher', 'code', '%' . $code . '%');
$d = ORM::for_table('tbl_plans')
$d = ORM::for_table('tbl_plans')->where('enabled', '1')
->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan'))
->where_like('tbl_plans.code', '%' . $code . '%')
->offset($paginator['startpoint'])
@ -504,7 +373,7 @@ switch ($action) {
->find_many();
} else {
$paginator = Paginator::bootstrap('tbl_voucher');
$d = ORM::for_table('tbl_plans')
$d = ORM::for_table('tbl_plans')->where('enabled', '1')
->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan'))
->offset($paginator['startpoint'])
->limit($paginator['limit'])->find_many();
@ -512,6 +381,7 @@ switch ($action) {
$ui->assign('d', $d);
$ui->assign('paginator', $paginator);
run_hook('view_list_voucher'); #HOOK
$ui->display('voucher.tpl');
break;
@ -519,11 +389,11 @@ switch ($action) {
$c = ORM::for_table('tbl_customers')->find_many();
$ui->assign('c', $c);
$p = ORM::for_table('tbl_plans')->find_many();
$p = ORM::for_table('tbl_plans')->where('enabled', '1')->find_many();
$ui->assign('p', $p);
$r = ORM::for_table('tbl_routers')->find_many();
$r = ORM::for_table('tbl_routers')->where('enabled', '1')->find_many();
$ui->assign('r', $r);
run_hook('view_add_voucher'); #HOOK
$ui->display('voucher-add.tpl');
break;
@ -587,7 +457,7 @@ switch ($action) {
->count();
}
$ui->assign('_title', $_L['Voucher_Hotspot'] . ' - ' . $config['CompanyName']);
$ui->assign('_title', $_L['Voucher_Hotspot']);
$ui->assign('from_id', $from_id);
$ui->assign('pagebreak', $pagebreak);
@ -601,7 +471,7 @@ switch ($action) {
//for counting pagebreak
$ui->assign('jml', 0);
run_hook('view_print_voucher'); #HOOK
$ui->display('print-voucher.tpl');
break;
case 'voucher-post':
@ -622,9 +492,10 @@ switch ($action) {
$msg .= 'The Length Code must be a number' . '<br>';
}
if ($msg == '') {
run_hook('create_voucher'); #HOOK
for ($i = 0; $i < $numbervoucher; $i++) {
$code = strtoupper(substr(md5(time() . rand(10000, 99999)), 0, $lengthcode));
//TODO: IMPLEMENT Voucher Generator
$d = ORM::for_table('tbl_voucher')->create();
$d->type = $type;
$d->routers = $server;
@ -643,7 +514,7 @@ switch ($action) {
case 'voucher-delete':
$id = $routes['2'];
run_hook('delete_voucher'); #HOOK
$d = ORM::for_table('tbl_voucher')->find_one($id);
if ($d) {
$d->delete();
@ -652,11 +523,11 @@ switch ($action) {
break;
case 'refill':
$ui->assign('xfooter', '<script type="text/javascript" src="' . $_theme . '/scripts/form-elements.init.js"></script>');
$ui->assign('xfooter', '<script type="text/javascript" src="ui/ui/scripts/form-elements.init.js"></script>');
$c = ORM::for_table('tbl_customers')->find_many();
$ui->assign('c', $c);
run_hook('view_refill'); #HOOK
$ui->display('refill.tpl');
break;
@ -675,82 +546,29 @@ switch ($action) {
$date_only = date("Y-m-d");
$time = date("H:i:s");
$mikrotik = Router::_info($v1['routers']);
$date_exp = date("Y-m-d", mktime(0, 0, 0, date("m"), date("d") + $p['validity'], date("Y")));
$mikrotik = Mikrotik::info($v1['routers']);
if($p['validity_unit']=='Months'){
$date_exp = date("Y-m-d", strtotime('+'.$p['validity'].' month'));
}else if($p['validity_unit']=='Days'){
$date_exp = date("Y-m-d", strtotime('+'.$p['validity'].' day'));
}else if($p['validity_unit']=='Hrs'){
$datetime = explode(' ',date("Y-m-d H:i:s", strtotime('+'.$p['validity'].' hour')));
$date_exp = $datetime[0];
$time = $datetime[1];
}else if($p['validity_unit']=='Mins'){
$datetime = explode(' ',date("Y-m-d H:i:s", strtotime('+'.$p['validity'].' minute')));
$date_exp = $datetime[0];
$time = $datetime[1];
}
run_hook('refill_customer'); #HOOK
if ($v1) {
if ($v1['type'] == 'Hotspot') {
if ($b) {
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$printRequest = new RouterOS\Request(
'/ip hotspot user print .proplist=name',
RouterOS\Query::where('name', $c['username'])
);
$userName = $client->sendSync($printRequest)->getProperty('name');
$removeRequest = new RouterOS\Request('/ip/hotspot/user/remove');
$client(
$removeRequest
->setArgument('numbers', $userName)
);
/* iBNuX Added:
* Time limit to Mikrotik
* 'Time_Limit', 'Data_Limit', 'Both_Limit'
*/
$addRequest = new RouterOS\Request('/ip/hotspot/user/add');
if ($p['typebp'] == "Limited") {
if ($p['limit_type'] == "Time_Limit") {
if ($p['time_unit'] == 'Hrs')
$timelimit = $p['time_limit'] . ":00:00";
else
$timelimit = "00:" . $p['time_limit'] . ":00";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
);
} else if ($p['limit_type'] == "Data_Limit") {
if ($p['data_unit'] == 'GB')
$datalimit = $p['data_limit'] . "000000000";
else
$datalimit = $p['data_limit'] . "000000";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-bytes-total', $datalimit)
);
} else if ($p['limit_type'] == "Both_Limit") {
if ($p['time_unit'] == 'Hrs')
$timelimit = $p['time_limit'] . ":00:00";
else
$timelimit = "00:" . $p['time_limit'] . ":00";
if ($p['data_unit'] == 'GB')
$datalimit = $p['data_limit'] . "000000000";
else
$datalimit = $p['data_limit'] . "000000";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
->setArgument('limit-bytes-total', $datalimit)
);
}
} else {
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
if(!$config['radius_mode']){
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::removeHotspotUser($client,$c['username']);
Mikrotik::addHotspotUser($client,$p,$c);
}
$b->customer_id = $user;
@ -780,66 +598,9 @@ switch ($action) {
$t->type = "Hotspot";
$t->save();
} else {
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
/* iBNuX Added:
* Time limit to Mikrotik
* 'Time_Limit', 'Data_Limit', 'Both_Limit'
*/
$addRequest = new RouterOS\Request('/ip/hotspot/user/add');
if ($p['typebp'] == "Limited") {
if ($p['limit_type'] == "Time_Limit") {
if ($p['time_unit'] == 'Hrs')
$timelimit = $p['time_limit'] . ":00:00";
else
$timelimit = "00:" . $p['time_limit'] . ":00";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
);
} else if ($p['limit_type'] == "Data_Limit") {
if ($p['data_unit'] == 'GB')
$datalimit = $p['data_limit'] . "000000000";
else
$datalimit = $p['data_limit'] . "000000";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-bytes-total', $datalimit)
);
} else if ($p['limit_type'] == "Both_Limit") {
if ($p['time_unit'] == 'Hrs')
$timelimit = $p['time_limit'] . ":00:00";
else
$timelimit = "00:" . $p['time_limit'] . ":00";
if ($p['data_unit'] == 'GB')
$datalimit = $p['data_limit'] . "000000000";
else
$datalimit = $p['data_limit'] . "000000";
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
->setArgument('limit-bytes-total', $datalimit)
);
}
} else {
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
if(!$config['radius_mode']){
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::addHotspotUser($client,$p,$c);
}
$d = ORM::for_table('tbl_user_recharges')->create();
@ -874,33 +635,18 @@ switch ($action) {
$v1->status = "1";
$v1->user = $c['username'];
$v1->save();
Message::sendTelegram( "$admin[fullname] #Refill #Voucher #Hotspot for #u$c[username]\n".$p['name_plan'].
"\nCode: ".$code.
"\nRouter: ".$v1['routers'].
"\nPrice: ".$p['price']);
} else {
if ($b) {
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
if(!$config['radius_mode']){
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::removePpoeUser($client,$c['username']);
Mikrotik::addPpoeUser($client,$p,$c);
}
$printRequest = new RouterOS\Request(
'/ppp secret print .proplist=name',
RouterOS\Query::where('name', $c['username'])
);
$userName = $client->sendSync($printRequest)->getProperty('name');
$removeRequest = new RouterOS\Request('/ppp/secret/remove');
$client(
$removeRequest
->setArgument('numbers', $userName)
);
$addRequest = new RouterOS\Request('/ppp/secret/add');
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('service', 'pppoe')
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
$b->customer_id = $user;
$b->username = $c['username'];
@ -929,19 +675,10 @@ switch ($action) {
$t->type = "PPPOE";
$t->save();
} else {
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
if(!$config['radius_mode']){
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::addPpoeUser($client,$p,$c);
}
$addRequest = new RouterOS\Request('/ppp/secret/add');
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('service', 'pppoe')
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
$d = ORM::for_table('tbl_user_recharges')->create();
$d->customer_id = $user;
@ -975,10 +712,40 @@ switch ($action) {
$v1->status = "1";
$v1->user = $c['username'];
$v1->save();
Message::sendTelegram( "$admin[fullname] Refill #Voucher #PPPOE for #u$c[username]\n".$p['name_plan'].
"\nCode: ".$code.
"\nRouter: ".$v1['routers'].
"\nPrice: ".$p['price']);
}
$in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one();
$ui->assign('in', $in);
$msg = "*$config[CompanyName]*\n".
"$config[address]\n".
"$config[phone]\n".
"\n\n".
"INVOICE: *$in[invoice]*\n".
"$_L[Date] : $date_now\n".
"$_L[Sales] : $admin[fullname]\n".
"\n\n".
"$_L[Type] : *$in[type]*\n".
"$_L[Plan_Name] : *$in[plan_name]*\n".
"$_L[Plan_Price] : *$config[currency_code] ".number_format($in['price'],2,$config['dec_point'],$config['thousands_sep'])."*\n\n".
"$_L[Username] : *$in[username]*\n".
"$_L[Password] : **********\n\n".
"$_L[Created_On] :\n*".date($config['date_format'], strtotime($in['recharged_on']))." $in[time]*\n".
"$_L[Expires_On] :\n*".date($config['date_format'], strtotime($in['expiration']))." $in[time]*\n".
"\n\n".
"$config[note]";
if ($_c['user_notification_payment'] == 'sms') {
Message::sendSMS($c['phonenumber'], $msg);
} else if ($_c['user_notification_payment'] == 'wa') {
Message::sendWhatsapp($c['phonenumber'], $msg);
}
$ui->assign('date', $date_now);
$ui->display('invoice.tpl');
} else {

View File

@ -1,281 +1,157 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* created by iBNuX
**/
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
*
* created by iBNuX
**/
if (isset($routes['1'])) {
$do = $routes['1'];
} else {
$do = 'register-display';
}
use PEAR2\Net\RouterOS;
require_once 'system/autoload/PEAR2/Autoload.php';
switch($do){
$otpPath = 'system/cache/sms/';
switch ($do) {
case 'post':
$username = _post('username');
$otp_code = _post('otp_code');
$username = _post('username');
$fullname = _post('fullname');
$password = _post('password');
$cpassword = _post('cpassword');
$address = _post('address');
$phonenumber = _post('phonenumber');
$code = _post('kodevoucher');
$v1 = ORM::for_table('tbl_voucher')->where('code',$code)->where('status',0)->find_one();
if ($v1){
$msg = '';
if(Validator::Length($username,35,2) == false){
$msg .= 'Username should be between 3 to 55 characters'. '<br>';
}
if(Validator::Length($fullname,36,2) == false){
$msg .= 'Full Name should be between 3 to 25 characters'. '<br>';
}
if(!Validator::Length($password,35,2)){
$msg .= 'Password should be between 3 to 35 characters'. '<br>';
$phonenumber = _post('username');
$msg = '';
if (Validator::Length($username, 35, 2) == false) {
$msg .= 'Username should be between 3 to 55 characters' . '<br>';
}
if (Validator::Length($fullname, 36, 2) == false) {
$msg .= 'Full Name should be between 3 to 25 characters' . '<br>';
}
if (!Validator::Length($password, 35, 2)) {
$msg .= 'Password should be between 3 to 35 characters' . '<br>';
}
if ($password != $cpassword) {
$msg .= $_L['PasswordsNotMatch'] . '<br>';
}
}
if($password != $cpassword){
$msg .= $_L['PasswordsNotMatch']. '<br>';
}
$d = ORM::for_table('tbl_customers')->where('username',$username)->find_one();
if($d){
$msg .= $_L['account_already_exist']. '<br>';
}
if($msg == ''){
$d = ORM::for_table('tbl_customers')->create();
$d->username = $username;
$d->password = $password;
$d->fullname = $fullname;
$d->address = $address;
$d->phonenumber = $phonenumber;
if($d->save()){
$user = $d->id();
//check voucher plan
$p = ORM::for_table('tbl_plans')->find_one($v1['id_plan']);
$c = ORM::for_table('tbl_customers')->find_one($user);
$p = ORM::for_table('tbl_plans')->find_one($v1['id_plan']);
$date_now = date("Y-m-d H:i:s");
$date_only = date("Y-m-d");
$time = date("H:i:s");
$mikrotik = Router::_info($v1['routers']);
$date_exp = date("Y-m-d", mktime(0,0,0,date("m"),date("d") + $p['validity'],date("Y")));
if($v1['type'] == 'Hotspot'){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
/* iBNuX Added:
* Time limit to Mikrotik
* 'Time_Limit', 'Data_Limit', 'Both_Limit'
*/
$addRequest = new RouterOS\Request('/ip/hotspot/user/add');
if($p['typebp']=="Limited"){
if($p['limit_type']=="Time_Limit"){
if($p['time_unit']=='Hrs')
$timelimit = $p['time_limit'].":00:00";
else
$timelimit = "00:".$p['time_limit'].":00";
$client->sendSync($addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
);
}else if($p['limit_type']=="Data_Limit"){
if($p['data_unit']=='GB')
$datalimit = $p['data_limit']."000000000";
else
$datalimit = $p['data_limit']."000000";
$client->sendSync($addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-bytes-total', $datalimit)
);
}else if($p['limit_type']=="Both_Limit"){
if($p['time_unit']=='Hrs')
$timelimit = $p['time_limit'].":00:00";
else
$timelimit = "00:".$p['time_limit'].":00";
if($p['data_unit']=='GB')
$datalimit = $p['data_limit']."000000000";
else
$datalimit = $p['data_limit']."000000";
$client->sendSync($addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
->setArgument('limit-bytes-total', $datalimit)
);
}
}else{
$client->sendSync($addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
}
$d = ORM::for_table('tbl_user_recharges')->create();
$d->customer_id = $user;
$d->username = $c['username'];
$d->plan_id = $v1['id_plan'];
$d->namebp = $p['name_plan'];
$d->recharged_on = $date_only;
$d->expiration = $date_exp;
$d->time = $time;
$d->status = "on";
$d->method = "voucher";
$d->routers = $v1['routers'];
$d->type = "Hotspot";
$d->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-"._raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "voucher";
$t->routers = $v1['routers'];
$t->type = "Hotspot";
$t->save();
$v1->status = "1";
$v1->user = $c['username'];
$v1->save();
}else{
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$addRequest = new RouterOS\Request('/ppp/secret/add');
$client->sendSync($addRequest
->setArgument('name', $c['username'])
->setArgument('service', 'pppoe')
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
$d = ORM::for_table('tbl_user_recharges')->create();
$d->customer_id = $user;
$d->username = $c['username'];
$d->plan_id = $v1['id_plan'];
$d->namebp = $p['name_plan'];
$d->recharged_on = $date_only;
$d->expiration = $date_exp;
$d->time = $time;
$d->status = "on";
$d->method = "voucher";
$d->routers = $v1['routers'];
$d->type = "PPPOE";
$d->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-"._raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "voucher";
$t->routers = $v1['routers'];
$t->type = "PPPOE";
$t->save();
$v1->status = "1";
$v1->user = $c['username'];
$v1->save();
}
r2(U . 'login', 's', $_L['Register_Success']);
}else{
$ui->assign('username', $username);
$ui->assign('fullname', $fullname);
$ui->assign('address', $address);
$ui->assign('phonenumber', $phonenumber);
$ui->assign('notify','<div class="alert alert-danger">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">×</span>
</button>
<div>Failed to register</div></div>');
$ui->display('register.tpl');
}
//r2(U . 'register', 's', $_L['account_created_successfully']);
}else{
$ui->assign('username', $username);
$ui->assign('fullname', $fullname);
$ui->assign('address', $address);
$ui->assign('phonenumber', $phonenumber);
$ui->assign('notify','<div class="alert alert-danger">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">×</span>
</button>
<div>'.$msg.'</div></div>');
$ui->display('register.tpl');
}
}else{
$ui->assign('username', $username);
$ui->assign('fullname', $fullname);
$ui->assign('address', $address);
$ui->assign('phonenumber', $phonenumber);
$ui->assign('notify','<div class="alert alert-danger">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">×</span>
</button>
<div>'.$_L['Voucher_Not_Valid'].'</div></div>');
$ui->display('register.tpl');
//r2(U . 'register', 'e', $_L['Voucher_Not_Valid']);
}
/*$password = _post('password');
if($username != '' AND $password != ''){
$d = ORM::for_table('tbl_customers')->where('username',$username)->find_one();
if($d){
$d_pass = $d['password'];
if(Password::_uverify($password,$d_pass) == true){
$_SESSION['uid'] = $d['id'];
$d->last_login = date('Y-m-d H:i:s');
$d->save();
_log($username .' '. $_L['Login_Successful'],'User',$d['id']);
r2(U.'home');
}else{
_msglog('e',$_L['Invalid_Username_or_Password']);
_log($username .' '. $_L['Failed_Login'],'User');
r2(U.'login');
}
}else{
_msglog('e',$_L['Invalid_Username_or_Password']);
r2(U.'login');
}
}else{
_msglog('e',$_L['Invalid_Username_or_Password']);
r2(U.'login');
}*/
if(!empty($config['sms_url'])){
$otpPath .= sha1($username.$db_password).".txt";
run_hook('validate_otp'); #HOOK
if(file_exists($otpPath) && time()-filemtime($otpPath)>300){
unlink($otpPath);
r2(U . 'register', 's', 'Verification code expired');
}else if(file_exists($otpPath)){
$code = file_get_contents($otpPath);
if($code!=$otp_code){
$ui->assign('username', $username);
$ui->assign('fullname', $fullname);
$ui->assign('address', $address);
$ui->assign('phonenumber', $phonenumber);
$ui->assign('notify', '<div class="alert alert-success">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">×</span>
</button>
<div>Verification code is Wrong</div></div>');
$ui->display('register-otp.tpl');
exit();
}else{
unlink($otpPath);
}
}else{
r2(U . 'register', 's', 'No Verification code');
}
}
$d = ORM::for_table('tbl_customers')->where('username', $username)->find_one();
if ($d) {
$msg .= $_L['account_already_exist'] . '<br>';
}
if ($msg == '') {
run_hook('register_user'); #HOOK
$d = ORM::for_table('tbl_customers')->create();
$d->username = $username;
$d->password = $password;
$d->fullname = $fullname;
$d->address = $address;
$d->phonenumber = $phonenumber;
if ($d->save()) {
$user = $d->id();
r2(U . 'login', 's', $_L['Register_Success']);
} else {
$ui->assign('username', $username);
$ui->assign('fullname', $fullname);
$ui->assign('address', $address);
$ui->assign('phonenumber', $phonenumber);
$ui->assign('notify', '<div class="alert alert-danger">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">×</span>
</button>
<div>Failed to register</div></div>');
run_hook('view_otp_register'); #HOOK
$ui->display('register-rotp.tpl');
}
} else {
$ui->assign('username', $username);
$ui->assign('fullname', $fullname);
$ui->assign('address', $address);
$ui->assign('phonenumber', $phonenumber);
$ui->assign('notify', '<div class="alert alert-danger">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">×</span>
</button>
<div>' . $msg . '</div></div>');
$ui->display('register.tpl');
}
break;
default:
$ui->assign('username', "");
$ui->assign('fullname', "");
$ui->assign('address', "");
$ui->assign('phonenumber', "");
$ui->display('register.tpl');
if(!empty($config['sms_url'])){
$username = _post('username');
if(!empty($username)){
$d = ORM::for_table('tbl_customers')->where('username', $username)->find_one();
if ($d) {
r2(U . 'register', 's', $_L['account_already_exist']);
}
if(!file_exists($otpPath)){
mkdir($otpPath);
touch($otpPath.'index.html');
}
$otpPath .= sha1($username.$db_password).".txt";
if(file_exists($otpPath) && time()-filemtime($otpPath)<120){
$ui->assign('username', $username);
$ui->assign('notify', '<div class="alert alert-success">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">×</span>
</button>
<div>Please wait '.(120-(time()-filemtime($otpPath))).' seconds before sending another SMS</div></div>');
$ui->display('register-otp.tpl');
}else{
$otp = rand(100000,999999);
file_put_contents($otpPath, $otp);
Message::sendSMS($username,$config['CompanyName']."\nYour Verification code are: $otp");
$ui->assign('username', $username);
$ui->assign('notify', '<div class="alert alert-success">
<button type="button" class="close" data-dismiss="alert">
<span aria-hidden="true">×</span>
</button>
<div>Verification code has been sent to your phone</div></div>');
$ui->display('register-otp.tpl');
}
}else{
run_hook('view_otp_register'); #HOOK
$ui->display('register-rotp.tpl');
}
}else{
$ui->assign('username', "");
$ui->assign('fullname', "");
$ui->assign('address', "");
$ui->assign('otp', false);
run_hook('view_register'); #HOOK
$ui->display('register.tpl');
}
break;
}

View File

@ -1,14 +1,9 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
_admin();
$ui->assign('_title', $_L['Reports'].' - '. $config['CompanyName']);
$ui->assign('_title', $_L['Reports']);
$ui->assign('_system_menu', 'reports');
$action = $routes['1'];
@ -28,61 +23,62 @@ $before_30_days = date('Y-m-d', strtotime('today - 30 days'));
$month_n = date('n');
switch ($action) {
case 'by-date':
case 'daily-report':
$paginator = Paginator::bootstrap('tbl_transactions','recharged_on',$mdate);
$d = ORM::for_table('tbl_transactions')->where('recharged_on',$mdate)->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many();
$dr = ORM::for_table('tbl_transactions')->where('recharged_on',$mdate)->sum('price');
$ui->assign('d',$d);
$ui->assign('dr',$dr);
$ui->assign('mdate',$mdate);
$ui->assign('mtime',$mtime);
$ui->assign('paginator',$paginator);
run_hook('view_daily_reports'); #HOOK
$ui->display('reports-daily.tpl');
break;
case 'by-period':
$ui->assign('mdate',$mdate);
$ui->assign('mtime',$mtime);
$ui->assign('tdate', $tdate);
run_hook('view_reports_by_period'); #HOOK
$ui->display('reports-period.tpl');
break;
case 'period-view':
$fdate = _post('fdate');
$tdate = _post('tdate');
$stype = _post('stype');
$d = ORM::for_table('tbl_transactions');
if ($stype != ''){
$d->where('type', $stype);
}
$d->where_gte('recharged_on', $fdate);
$d->where_lte('recharged_on', $tdate);
$d->order_by_desc('id');
$x = $d->find_many();
$dr = ORM::for_table('tbl_transactions');
if ($stype != ''){
$dr->where('type', $stype);
}
$dr->where_gte('recharged_on', $fdate);
$dr->where_lte('recharged_on', $tdate);
$xy = $dr->sum('price');
$ui->assign('d',$x);
$ui->assign('dr',$xy);
$ui->assign('fdate',$fdate);
$ui->assign('tdate',$tdate);
$ui->assign('stype',$stype);
run_hook('view_reports_period'); #HOOK
$ui->display('reports-period-view.tpl');
break;
default:
echo 'action not defined';
}

View File

@ -1,20 +1,19 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
_admin();
$ui->assign('_title', $_L['Network'].' - '. $config['CompanyName']);
$ui->assign('_title', $_L['Network']);
$ui->assign('_system_menu', 'network');
$action = $routes['1'];
$admin = Admin::_info();
$ui->assign('_admin', $admin);
use PEAR2\Net\RouterOS;
require_once 'system/autoload/PEAR2/Autoload.php';
if($admin['user_type'] != 'Admin'){
r2(U."dashboard",'e',$_L['Do_Not_Access']);
}
@ -22,7 +21,7 @@ if($admin['user_type'] != 'Admin'){
switch ($action) {
case 'list':
$ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/routers.js"></script>');
$name = _post('name');
if ($name != ''){
$paginator = Paginator::bootstrap('tbl_routers','name','%'.$name.'%');
@ -31,15 +30,15 @@ switch ($action) {
$paginator = Paginator::bootstrap('tbl_routers');
$d = ORM::for_table('tbl_routers')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many();
}
$ui->assign('d',$d);
$ui->assign('paginator',$paginator);
run_hook('view_list_routers'); #HOOK
$ui->display('routers.tpl');
break;
case 'add':
$d = ORM::for_table('tbl_routers')->find_many();
$ui->assign('d',$d);
run_hook('view_add_routers'); #HOOK
$ui->display('routers-add.tpl');
break;
@ -48,6 +47,7 @@ switch ($action) {
$d = ORM::for_table('tbl_routers')->find_one($id);
if($d){
$ui->assign('d',$d);
run_hook('view_router_edit'); #HOOK
$ui->display('routers-edit.tpl');
}else{
r2(U . 'routers/list', 'e', $_L['Account_Not_Found']);
@ -56,7 +56,7 @@ switch ($action) {
case 'delete':
$id = $routes['2'];
run_hook('router_delete'); #HOOK
$d = ORM::for_table('tbl_routers')->find_one($id);
if($d){
$d->delete();
@ -70,7 +70,8 @@ switch ($action) {
$username = _post('username');
$password = _post('password');
$description = _post('description');
$enabled = _post('enabled')*1;
$msg = '';
if(Validator::Length($name,30,4) == false){
$msg .= 'Name should be between 5 to 30 characters'. '<br>';
@ -78,19 +79,25 @@ switch ($action) {
if ($ip_address == '' OR $username == ''){
$msg .= $_L['All_field_is_required']. '<br>';
}
$d = ORM::for_table('tbl_routers')->where('ip_address',$ip_address)->find_one();
if($d){
$msg .= $_L['Router_already_exist']. '<br>';
}
if(!$config['radius_mode']){
Mikrotik::getClient($ip_address,$username,$password);
}
if($msg == ''){
run_hook('add_router'); #HOOK
$d = ORM::for_table('tbl_routers')->create();
$d->name = $name;
$d->ip_address = $ip_address;
$d->username = $username;
$d->password = $password;
$d->description = $description;
$d->enabled = $enabled;
$d->save();
r2(U . 'routers/list', 's', $_L['Created_Successfully']);
@ -106,7 +113,7 @@ switch ($action) {
$username = _post('username');
$password = _post('password');
$description = _post('description');
$enabled = $_POST['enabled']*1;
$msg = '';
if(Validator::Length($name,30,4) == false){
$msg .= 'Name should be between 5 to 30 characters'. '<br>';
@ -124,19 +131,55 @@ switch ($action) {
}
if($d['name'] != $name){
$c = ORM::for_table('tbl_routers')->where('ip_address',$ip_address)->find_one();
$c = ORM::for_table('tbl_routers')->where('name',$name)->where_not_equal('id',$id)->find_one();
if($c){
$msg .= $_L['Router_already_exist']. '<br>';
$msg .= 'Name Already Exists<br>';
}
}
$oldname = $d['name'];
if($d['ip_address'] != $ip_address){
$c = ORM::for_table('tbl_routers')->where('ip_address',$ip_address)->where_not_equal('id',$id)->find_one();
if($c){
$msg .= 'IP Already Exists<br>';
}
}
if(!$config['radius_mode']){
Mikrotik::getClient($ip_address,$username,$password);
}
if($msg == ''){
run_hook('router_edit'); #HOOK
$d->name = $name;
$d->ip_address = $ip_address;
$d->username = $username;
$d->password = $password;
$d->description = $description;
$d->enabled = $enabled;
$d->save();
if($name!=$oldname){
$p = ORM::for_table('tbl_plans')->where('routers',$oldname)->find_result_set();
$p->set('routers',$name);
$p->save();
$p = ORM::for_table('tbl_payment_gateway')->where('routers',$oldname)->find_result_set();
$p->set('routers',$name);
$p->save();
$p = ORM::for_table('tbl_pool')->where('routers',$oldname)->find_result_set();
$p->set('routers',$name);
$p->save();
$p = ORM::for_table('tbl_transactions')->where('routers',$oldname)->find_result_set();
$p->set('routers',$name);
$p->save();
$p = ORM::for_table('tbl_user_recharges')->where('routers',$oldname)->find_result_set();
$p->set('routers',$name);
$p->save();
$p = ORM::for_table('tbl_voucher')->where('routers',$oldname)->find_result_set();
$p->set('routers',$name);
$p->save();
}
r2(U . 'routers/list', 's', $_L['Updated_Successfully']);
}else{
r2(U . 'routers/edit/'.$id, 'e', $msg);

View File

@ -1,94 +1,83 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
**/
**/
_admin();
$ui->assign('_title', $_L['Hotspot_Plans'].' - '. $config['CompanyName']);
$ui->assign('_title', $_L['Hotspot_Plans']);
$ui->assign('_system_menu', 'services');
$action = $routes['1'];
$admin = Admin::_info();
$ui->assign('_admin', $admin);
if($admin['user_type'] != 'Admin' AND $admin['user_type'] != 'Sales'){
r2(U."dashboard",'e',$_L['Do_Not_Access']);
if ($admin['user_type'] != 'Admin' and $admin['user_type'] != 'Sales') {
r2(U . "dashboard", 'e', $_L['Do_Not_Access']);
}
use PEAR2\Net\RouterOS;
require_once 'system/autoload/PEAR2/Autoload.php';
switch ($action) {
case 'hotspot':
$ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/hotspot.js"></script>');
$ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/hotspot.js"></script>');
$name = _post('name');
if ($name != ''){
$paginator = Paginator::bootstrap('tbl_plans','name_plan','%'.$name.'%','type','Hotspot');
$d = ORM::for_table('tbl_bandwidth')->join('tbl_plans', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))->where('tbl_plans.type','Hotspot')->where_like('tbl_plans.name_plan','%'.$name.'%')->offset($paginator['startpoint'])->limit($paginator['limit'])->find_many();
}else{
$paginator = Paginator::bootstrap('tbl_plans','type','Hotspot');
$d = ORM::for_table('tbl_bandwidth')->join('tbl_plans', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))->where('tbl_plans.type','Hotspot')->offset($paginator['startpoint'])->limit($paginator['limit'])->find_many();
}
$name = _post('name');
if ($name != '') {
$paginator = Paginator::bootstrap('tbl_plans', 'name_plan', '%' . $name . '%', 'type', 'Hotspot');
$d = ORM::for_table('tbl_bandwidth')->join('tbl_plans', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))->where('tbl_plans.type', 'Hotspot')->where_like('tbl_plans.name_plan', '%' . $name . '%')->offset($paginator['startpoint'])->limit($paginator['limit'])->find_many();
} else {
$paginator = Paginator::bootstrap('tbl_plans', 'type', 'Hotspot');
$d = ORM::for_table('tbl_bandwidth')->join('tbl_plans', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))->where('tbl_plans.type', 'Hotspot')->offset($paginator['startpoint'])->limit($paginator['limit'])->find_many();
}
$ui->assign('d',$d);
$ui->assign('paginator',$paginator);
$ui->assign('d', $d);
$ui->assign('paginator', $paginator);
run_hook('view_list_plans'); #HOOK
$ui->display('hotspot.tpl');
break;
case 'add':
$d = ORM::for_table('tbl_bandwidth')->find_many();
$ui->assign('d',$d);
$r = ORM::for_table('tbl_routers')->find_many();
$ui->assign('r',$r);
$d = ORM::for_table('tbl_bandwidth')->find_many();
$ui->assign('d', $d);
$r = ORM::for_table('tbl_routers')->find_many();
$ui->assign('r', $r);
run_hook('view_add_plan'); #HOOK
$ui->display('hotspot-add.tpl');
break;
case 'edit':
$id = $routes['2'];
$d = ORM::for_table('tbl_plans')->find_one($id);
if($d){
$ui->assign('d',$d);
$b = ORM::for_table('tbl_bandwidth')->find_many();
$ui->assign('b',$b);
$r = ORM::for_table('tbl_routers')->find_many();
$ui->assign('r',$r);
if ($d) {
$ui->assign('d', $d);
$b = ORM::for_table('tbl_bandwidth')->find_many();
$ui->assign('b', $b);
$r = ORM::for_table('tbl_routers')->find_many();
$ui->assign('r', $r);
run_hook('view_edit_plan'); #HOOK
$ui->display('hotspot-edit.tpl');
}else{
} else {
r2(U . 'services/hotspot', 'e', $_L['Account_Not_Found']);
}
break;
case 'delete':
$id = $routes['2'];
$d = ORM::for_table('tbl_plans')->find_one($id);
if($d){
$mikrotik = Router::_info($d['routers']);
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$printRequest = new RouterOS\Request(
'/ip hotspot user profile print .proplist=name',
RouterOS\Query::where('name', $d['name_plan'])
);
$profileName = $client->sendSync($printRequest)->getProperty('name');
$removeRequest = new RouterOS\Request('/ip/hotspot/user/profile/remove');
$client($removeRequest
->setArgument('numbers', $profileName)
);
if ($d) {
run_hook('delete_plan'); #HOOK
if(!$config['radius_mode']){
$mikrotik = Mikrotik::info($d['routers']);
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::removeHotspotPlan($client,$d['name_plan']);
}
$d->delete();
r2(U . 'services/hotspot', 's', $_L['Delete_Successfully']);
}
break;
@ -96,224 +85,216 @@ switch ($action) {
case 'add-post':
$name = _post('name');
$typebp = _post('typebp');
$limit_type = _post('limit_type');
$time_limit = _post('time_limit');
$time_unit = _post('time_unit');
$data_limit = _post('data_limit');
$data_unit = _post('data_unit');
$id_bw = _post('id_bw');
$price = _post('pricebp');
$sharedusers = _post('sharedusers');
$limit_type = _post('limit_type');
$time_limit = _post('time_limit');
$time_unit = _post('time_unit');
$data_limit = _post('data_limit');
$data_unit = _post('data_unit');
$id_bw = _post('id_bw');
$price = _post('pricebp');
$sharedusers = _post('sharedusers');
$validity = _post('validity');
$validity_unit = _post('validity_unit');
$routers = _post('routers');
$validity_unit = _post('validity_unit');
$routers = _post('routers');
$enabled = _post('enabled')*1;
$msg = '';
if(Validator::UnsignedNumber($validity) == false){
$msg .= 'The validity must be a number'. '<br>';
if (Validator::UnsignedNumber($validity) == false) {
$msg .= 'The validity must be a number' . '<br>';
}
if(Validator::UnsignedNumber($price) == false){
$msg .= 'The price must be a number'. '<br>';
if (Validator::UnsignedNumber($price) == false) {
$msg .= 'The price must be a number' . '<br>';
}
if ($name == '' OR $id_bw == '' OR $price == '' OR $validity == '' OR $routers == ''){
$msg .= $_L['All_field_is_required']. '<br>';
}
$d = ORM::for_table('tbl_plans')->where('name_plan',$name)->where('type','Hotspot')->find_one();
if($d){
$msg .= $_L['Plan_already_exist']. '<br>';
if ($name == '' or $id_bw == '' or $price == '' or $validity == '' or $routers == '') {
$msg .= $_L['All_field_is_required'] . '<br>';
}
if($msg == ''){
$b = ORM::for_table('tbl_bandwidth')->where('id',$id_bw)->find_one();
if($b['rate_down_unit'] == 'Kbps'){ $unitdown = 'K'; }else{ $unitdown = 'M'; }
if($b['rate_up_unit'] == 'Kbps'){ $unitup = 'K'; }else{ $unitup = 'M'; }
$rate = $b['rate_up'].$unitup."/".$b['rate_down'].$unitdown;
$d = ORM::for_table('tbl_plans')->where('name_plan', $name)->where('type', 'Hotspot')->find_one();
if ($d) {
$msg .= $_L['Plan_already_exist'] . '<br>';
}
run_hook('add_plan'); #HOOK
if ($msg == '') {
$b = ORM::for_table('tbl_bandwidth')->where('id', $id_bw)->find_one();
if ($b['rate_down_unit'] == 'Kbps') {
$unitdown = 'K';
} else {
$unitdown = 'M';
}
if ($b['rate_up_unit'] == 'Kbps') {
$unitup = 'K';
} else {
$unitup = 'M';
}
$rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown;
if(!$config['radius_mode']){
$mikrotik = Mikrotik::info($routers);
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::addHotspotPlan($client, $name, $sharedusers, $rate);
}
$mikrotik = Router::_info($routers);
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$addRequest = new RouterOS\Request('/ip/hotspot/user/profile/add');
$client->sendSync($addRequest
->setArgument('name', $name)
->setArgument('shared-users', $sharedusers)
->setArgument('rate-limit', $rate)
);
$d = ORM::for_table('tbl_plans')->create();
$d->name_plan = $name;
$d->id_bw = $id_bw;
$d->price = $price;
$d->type = 'Hotspot';
$d->type = 'Hotspot';
$d->typebp = $typebp;
$d->limit_type = $limit_type;
$d->time_limit = $time_limit;
$d->time_unit = $time_unit;
$d->data_limit = $data_limit;
$d->data_unit = $data_unit;
$d->validity = $validity;
$d->limit_type = $limit_type;
$d->time_limit = $time_limit;
$d->time_unit = $time_unit;
$d->data_limit = $data_limit;
$d->data_unit = $data_unit;
$d->validity = $validity;
$d->validity_unit = $validity_unit;
$d->shared_users = $sharedusers;
$d->routers = $routers;
$d->shared_users = $sharedusers;
$d->routers = $routers;
$d->enabled = $enabled;
$d->save();
r2(U . 'services/hotspot', 's', $_L['Created_Successfully']);
}else{
} else {
r2(U . 'services/add', 'e', $msg);
}
break;
case 'edit-post':
$id = _post('id');
$id = _post('id');
$name = _post('name');
$id_bw = _post('id_bw');
$typebp = _post('typebp');
$typebp = _post('typebp');
$price = _post('price');
$limit_type = _post('limit_type');
$time_limit = _post('time_limit');
$time_unit = _post('time_unit');
$data_limit = _post('data_limit');
$data_unit = _post('data_unit');
$sharedusers = _post('sharedusers');
$limit_type = _post('limit_type');
$time_limit = _post('time_limit');
$time_unit = _post('time_unit');
$data_limit = _post('data_limit');
$data_unit = _post('data_unit');
$sharedusers = _post('sharedusers');
$validity = _post('validity');
$validity_unit = _post('validity_unit');
$routers = _post('routers');
$validity_unit = _post('validity_unit');
$routers = _post('routers');
$enabled = _post('enabled')*1;
$msg = '';
if(Validator::UnsignedNumber($validity) == false){
$msg .= 'The validity must be a number'. '<br>';
if (Validator::UnsignedNumber($validity) == false) {
$msg .= 'The validity must be a number' . '<br>';
}
if(Validator::UnsignedNumber($price) == false){
$msg .= 'The price must be a number'. '<br>';
if (Validator::UnsignedNumber($price) == false) {
$msg .= 'The price must be a number' . '<br>';
}
if ($name == '' OR $id_bw == '' OR $price == '' OR $validity == '' OR $routers == ''){
$msg .= $_L['All_field_is_required']. '<br>';
}
$d = ORM::for_table('tbl_plans')->where('id',$id)->find_one();
if($d){
}else{
$msg .= $_L['Data_Not_Found']. '<br>';
if ($name == '' or $id_bw == '' or $price == '' or $validity == '' or $routers == '') {
$msg .= $_L['All_field_is_required'] . '<br>';
}
if($msg == ''){
$b = ORM::for_table('tbl_bandwidth')->where('id',$id_bw)->find_one();
if($b['rate_down_unit'] == 'Kbps'){ $unitdown = 'K'; }else{ $unitdown = 'M'; }
if($b['rate_up_unit'] == 'Kbps'){ $unitup = 'K'; }else{ $unitup = 'M'; }
$rate = $b['rate_up'].$unitup."/".$b['rate_down'].$unitdown;
$mikrotik = Router::_info($routers);
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$printRequest = new RouterOS\Request(
'/ip hotspot user profile print .proplist=name',
RouterOS\Query::where('name', $name)
);
$profileName = $client->sendSync($printRequest)->getProperty('name');
$setRequest = new RouterOS\Request('/ip/hotspot/user/profile/set');
$client($setRequest
->setArgument('numbers', $profileName)
->setArgument('shared-users', $sharedusers)
->setArgument('rate-limit', $rate)
);
$d = ORM::for_table('tbl_plans')->where('id', $id)->find_one();
if ($d) {
} else {
$msg .= $_L['Data_Not_Found'] . '<br>';
}
run_hook('edit_plan'); #HOOK
if ($msg == '') {
$b = ORM::for_table('tbl_bandwidth')->where('id', $id_bw)->find_one();
if ($b['rate_down_unit'] == 'Kbps') {
$unitdown = 'K';
} else {
$unitdown = 'M';
}
if ($b['rate_up_unit'] == 'Kbps') {
$unitup = 'K';
} else {
$unitup = 'M';
}
$rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown;
if(!$config['radius_mode']){
$mikrotik = Mikrotik::info($routers);
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::setHotspotPlan($client, $name, $sharedusers, $rate);
}
$d->name_plan = $name;
$d->id_bw = $id_bw;
$d->price = $price;
$d->typebp = $typebp;
$d->limit_type = $limit_type;
$d->time_limit = $time_limit;
$d->time_unit = $time_unit;
$d->data_limit = $data_limit;
$d->data_unit = $data_unit;
$d->validity = $validity;
$d->limit_type = $limit_type;
$d->time_limit = $time_limit;
$d->time_unit = $time_unit;
$d->data_limit = $data_limit;
$d->data_unit = $data_unit;
$d->validity = $validity;
$d->validity_unit = $validity_unit;
$d->shared_users = $sharedusers;
$d->routers = $routers;
$d->shared_users = $sharedusers;
$d->routers = $routers;
$d->enabled = $enabled;
$d->save();
r2(U . 'services/hotspot', 's', $_L['Updated_Successfully']);
}else{
r2(U . 'services/edit/'.$id, 'e', $msg);
} else {
r2(U . 'services/edit/' . $id, 'e', $msg);
}
break;
case 'pppoe':
$ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/pppoe.js"></script>');
$name = _post('name');
if ($name != ''){
$paginator = Paginator::bootstrap('tbl_plans','name_plan','%'.$name.'%','type','Hotspot');
$d = ORM::for_table('tbl_bandwidth')->join('tbl_plans', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))->where('tbl_plans.type','PPPOE')->where_like('tbl_plans.name_plan','%'.$name.'%')->offset($paginator['startpoint'])->limit($paginator['limit'])->find_many();
}else{
$paginator = Paginator::bootstrap('tbl_plans','type','Hotspot');
$d = ORM::for_table('tbl_bandwidth')->join('tbl_plans', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))->where('tbl_plans.type','PPPOE')->offset($paginator['startpoint'])->limit($paginator['limit'])->find_many();
}
$ui->assign('d',$d);
$ui->assign('paginator',$paginator);
$ui->assign('xfooter', '<script type="text/javascript" src="ui/lib/c/pppoe.js"></script>');
$name = _post('name');
if ($name != '') {
$paginator = Paginator::bootstrap('tbl_plans', 'name_plan', '%' . $name . '%', 'type', 'Hotspot');
$d = ORM::for_table('tbl_bandwidth')->join('tbl_plans', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))->where('tbl_plans.type', 'PPPOE')->where_like('tbl_plans.name_plan', '%' . $name . '%')->offset($paginator['startpoint'])->limit($paginator['limit'])->find_many();
} else {
$paginator = Paginator::bootstrap('tbl_plans', 'type', 'Hotspot');
$d = ORM::for_table('tbl_bandwidth')->join('tbl_plans', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))->where('tbl_plans.type', 'PPPOE')->offset($paginator['startpoint'])->limit($paginator['limit'])->find_many();
}
$ui->assign('d', $d);
$ui->assign('paginator', $paginator);
run_hook('view_list_ppoe'); #HOOK
$ui->display('pppoe.tpl');
break;
case 'pppoe-add':
$d = ORM::for_table('tbl_bandwidth')->find_many();
$ui->assign('d',$d);
$p = ORM::for_table('tbl_pool')->find_many();
$ui->assign('p',$p);
$r = ORM::for_table('tbl_routers')->find_many();
$ui->assign('r',$r);
$d = ORM::for_table('tbl_bandwidth')->find_many();
$ui->assign('d', $d);
$p = ORM::for_table('tbl_pool')->find_many();
$ui->assign('p', $p);
$r = ORM::for_table('tbl_routers')->find_many();
$ui->assign('r', $r);
run_hook('view_add_ppoe'); #HOOK
$ui->display('pppoe-add.tpl');
break;
case 'pppoe-edit':
$id = $routes['2'];
$d = ORM::for_table('tbl_plans')->find_one($id);
if($d){
$ui->assign('d',$d);
$b = ORM::for_table('tbl_bandwidth')->find_many();
$ui->assign('b',$b);
$p = ORM::for_table('tbl_pool')->find_many();
$ui->assign('p',$p);
$r = ORM::for_table('tbl_routers')->find_many();
$ui->assign('r',$r);
if ($d) {
$ui->assign('d', $d);
$b = ORM::for_table('tbl_bandwidth')->find_many();
$ui->assign('b', $b);
$p = ORM::for_table('tbl_pool')->find_many();
$ui->assign('p', $p);
$r = ORM::for_table('tbl_routers')->find_many();
$ui->assign('r', $r);
run_hook('view_edit_ppoe'); #HOOK
$ui->display('pppoe-edit.tpl');
}else{
} else {
r2(U . 'services/pppoe', 'e', $_L['Account_Not_Found']);
}
break;
case 'pppoe-delete':
$id = $routes['2'];
$d = ORM::for_table('tbl_plans')->find_one($id);
if($d){
$mikrotik = Router::_info($d['routers']);
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$printRequest = new RouterOS\Request(
'/ppp profile print .proplist=name',
RouterOS\Query::where('name', $d['name_plan'])
);
$profileName = $client->sendSync($printRequest)->getProperty('name');
$removeRequest = new RouterOS\Request('/ppp/profile/remove');
$client($removeRequest
->setArgument('numbers', $profileName)
);
if ($d) {
run_hook('delete_ppoe'); #HOOK
if(!$config['radius_mode']){
$mikrotik = Mikrotik::info($d['routers']);
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::removePpoePlan($client, $d['name_plan']);
}
$d->delete();
r2(U . 'services/pppoe', 's', $_L['Delete_Successfully']);
@ -322,134 +303,132 @@ switch ($action) {
case 'pppoe-add-post':
$name = _post('name_plan');
$id_bw = _post('id_bw');
$price = _post('price');
$id_bw = _post('id_bw');
$price = _post('price');
$validity = _post('validity');
$validity_unit = _post('validity_unit');
$routers = _post('routers');
$pool = _post('pool_name');
$validity_unit = _post('validity_unit');
$routers = _post('routers');
$pool = _post('pool_name');
$enabled = _post('enabled')*1;
$msg = '';
if(Validator::UnsignedNumber($validity) == false){
$msg .= 'The validity must be a number'. '<br>';
if (Validator::UnsignedNumber($validity) == false) {
$msg .= 'The validity must be a number' . '<br>';
}
if(Validator::UnsignedNumber($price) == false){
$msg .= 'The price must be a number'. '<br>';
if (Validator::UnsignedNumber($price) == false) {
$msg .= 'The price must be a number' . '<br>';
}
if ($name == '' OR $id_bw == '' OR $price == '' OR $validity == '' OR $routers == '' OR $pool == ''){
$msg .= $_L['All_field_is_required']. '<br>';
}
$d = ORM::for_table('tbl_plans')->where('name_plan',$name)->find_one();
if($d){
$msg .= $_L['Plan_already_exist']. '<br>';
if ($name == '' or $id_bw == '' or $price == '' or $validity == '' or $routers == '' or $pool == '') {
$msg .= $_L['All_field_is_required'] . '<br>';
}
if($msg == ''){
$b = ORM::for_table('tbl_bandwidth')->where('id',$id_bw)->find_one();
if($b['rate_down_unit'] == 'Kbps'){ $unitdown = 'K'; }else{ $unitdown = 'M'; }
if($b['rate_up_unit'] == 'Kbps'){ $unitup = 'K'; }else{ $unitup = 'M'; }
$rate = $b['rate_up'].$unitup."/".$b['rate_down'].$unitdown;
$mikrotik = Router::_info($routers);
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$addRequest = new RouterOS\Request('/ppp/profile/add');
$client->sendSync($addRequest
->setArgument('name', $name)
->setArgument('local-address', $pool)
->setArgument('remote-address', $pool)
->setArgument('rate-limit', $rate)
);
$d = ORM::for_table('tbl_plans')->where('name_plan', $name)->find_one();
if ($d) {
$msg .= $_L['Plan_already_exist'] . '<br>';
}
run_hook('add_ppoe'); #HOOK
if ($msg == '') {
$b = ORM::for_table('tbl_bandwidth')->where('id', $id_bw)->find_one();
if ($b['rate_down_unit'] == 'Kbps') {
$unitdown = 'K';
} else {
$unitdown = 'M';
}
if ($b['rate_up_unit'] == 'Kbps') {
$unitup = 'K';
} else {
$unitup = 'M';
}
$rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown;
if(!$config['radius_mode']){
$mikrotik = Mikrotik::info($routers);
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::addPpoePlan($client, $name, $pool, $rate);
}
$d = ORM::for_table('tbl_plans')->create();
$d->type = 'PPPOE';
$d->name_plan = $name;
$d->name_plan = $name;
$d->id_bw = $id_bw;
$d->price = $price;
$d->validity = $validity;
$d->validity = $validity;
$d->validity_unit = $validity_unit;
$d->routers = $routers;
$d->pool = $pool;
$d->routers = $routers;
$d->pool = $pool;
$d->enabled = $enabled;
$d->save();
r2(U . 'services/pppoe', 's', $_L['Created_Successfully']);
}else{
} else {
r2(U . 'services/pppoe-add', 'e', $msg);
}
break;
case 'edit-pppoe-post':
$id = _post('id');
$id = _post('id');
$name = _post('name_plan');
$id_bw = _post('id_bw');
$price = _post('price');
$id_bw = _post('id_bw');
$price = _post('price');
$validity = _post('validity');
$validity_unit = _post('validity_unit');
$routers = _post('routers');
$pool = _post('pool_name');
$validity_unit = _post('validity_unit');
$routers = _post('routers');
$pool = _post('pool_name');
$enabled = _post('enabled')*1;
$msg = '';
if(Validator::UnsignedNumber($validity) == false){
$msg .= 'The validity must be a number'. '<br>';
if (Validator::UnsignedNumber($validity) == false) {
$msg .= 'The validity must be a number' . '<br>';
}
if(Validator::UnsignedNumber($price) == false){
$msg .= 'The price must be a number'. '<br>';
if (Validator::UnsignedNumber($price) == false) {
$msg .= 'The price must be a number' . '<br>';
}
if ($name == '' OR $id_bw == '' OR $price == '' OR $validity == '' OR $routers == '' OR $pool == ''){
$msg .= $_L['All_field_is_required']. '<br>';
}
$d = ORM::for_table('tbl_plans')->where('id',$id)->find_one();
if($d){
}else{
$msg .= $_L['Data_Not_Found']. '<br>';
if ($name == '' or $id_bw == '' or $price == '' or $validity == '' or $routers == '' or $pool == '') {
$msg .= $_L['All_field_is_required'] . '<br>';
}
if($msg == ''){
$b = ORM::for_table('tbl_bandwidth')->where('id',$id_bw)->find_one();
if($b['rate_down_unit'] == 'Kbps'){ $unitdown = 'K'; }else{ $unitdown = 'M'; }
if($b['rate_up_unit'] == 'Kbps'){ $unitup = 'K'; }else{ $unitup = 'M'; }
$rate = $b['rate_up'].$unitup."/".$b['rate_down'].$unitdown;
$mikrotik = Router::_info($routers);
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$printRequest = new RouterOS\Request(
'/ppp profile print .proplist=name',
RouterOS\Query::where('name', $name)
);
$profileName = $client->sendSync($printRequest)->getProperty('name');
$setRequest = new RouterOS\Request('/ppp/profile/set');
$client($setRequest
->setArgument('numbers', $profileName)
->setArgument('local-address', $pool)
->setArgument('remote-address', $pool)
->setArgument('rate-limit', $rate)
);
$d = ORM::for_table('tbl_plans')->where('id', $id)->find_one();
if ($d) {
} else {
$msg .= $_L['Data_Not_Found'] . '<br>';
}
run_hook('edit_ppoe'); #HOOK
if ($msg == '') {
$b = ORM::for_table('tbl_bandwidth')->where('id', $id_bw)->find_one();
if ($b['rate_down_unit'] == 'Kbps') {
$unitdown = 'K';
} else {
$unitdown = 'M';
}
if ($b['rate_up_unit'] == 'Kbps') {
$unitup = 'K';
} else {
$unitup = 'M';
}
$rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown;
if(!$config['radius_mode']){
$mikrotik = Mikrotik::info($routers);
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::setPpoePlan($client, $name, $pool, $rate);
}
$d->name_plan = $name;
$d->id_bw = $id_bw;
$d->price = $price;
$d->validity = $validity;
$d->validity = $validity;
$d->validity_unit = $validity_unit;
$d->routers = $routers;
$d->pool = $pool;
$d->routers = $routers;
$d->pool = $pool;
$d->enabled = $enabled;
$d->save();
r2(U . 'services/pppoe', 's', $_L['Updated_Successfully']);
}else{
r2(U . 'services/pppoe-edit/'.$id, 'e', $msg);
} else {
r2(U . 'services/pppoe-edit/' . $id, 'e', $msg);
}
break;
default:
echo 'action not defined';
}
}

View File

@ -1,15 +1,11 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
_admin();
$ui->assign('_title', $_L['Settings'] . '- ' . $config['CompanyName']);
$ui->assign('_title', $_L['Settings']);
$ui->assign('_system_menu', 'settings');
$action = $routes['1'];
@ -21,7 +17,7 @@ switch ($action) {
if ($admin['user_type'] != 'Admin') {
r2(U . "dashboard", 'e', $_L['Do_Not_Access']);
}
run_hook('view_app_settings'); #HOOK
$ui->display('app-settings.tpl');
break;
@ -35,6 +31,7 @@ switch ($action) {
$timezonelist = Timezone::timezoneList();
$ui->assign('tlist', $timezonelist);
$ui->assign('xjq', ' $("#tzone").select2(); ');
run_hook('view_localisation'); #HOOK
$ui->display('app-localisation.tpl');
break;
@ -56,6 +53,7 @@ switch ($action) {
$ui->assign('d', $d);
$ui->assign('paginator', $paginator);
run_hook('view_list_admin'); #HOOK
$ui->display('users.tpl');
break;
@ -63,7 +61,7 @@ switch ($action) {
if ($admin['user_type'] != 'Admin') {
r2(U . "dashboard", 'e', $_L['Do_Not_Access']);
}
run_hook('view_add_admin'); #HOOK
$ui->display('users-add.tpl');
break;
@ -76,6 +74,7 @@ switch ($action) {
$d = ORM::for_table('tbl_users')->find_one($id);
if ($d) {
$ui->assign('d', $d);
run_hook('view_edit_admin'); #HOOK
$ui->display('users-edit.tpl');
} else {
r2(U . 'settings/users', 'e', $_L['Account_Not_Found']);
@ -93,6 +92,7 @@ switch ($action) {
}
$d = ORM::for_table('tbl_users')->find_one($id);
if ($d) {
run_hook('delete_admin'); #HOOK
$d->delete();
r2(U . 'settings/users', 's', $_L['User_Delete_Ok']);
} else {
@ -125,6 +125,7 @@ switch ($action) {
$msg .= $_L['account_already_exist'] . '<br>';
}
$date_now = date("Y-m-d H:i:s");
run_hook('add_admin'); #HOOK
if ($msg == '') {
$password = Password::_crypt($password);
$d = ORM::for_table('tbl_users')->create();
@ -179,7 +180,7 @@ switch ($action) {
$msg .= $_L['account_already_exist'] . '<br>';
}
}
run_hook('edit_admin'); #HOOK
if ($msg == '') {
$d->username = $username;
if ($password != '') {
@ -204,9 +205,19 @@ switch ($action) {
case 'app-post':
$company = _post('company');
$theme = _post('theme');
$footer = _post('footer');
$telegram_bot = _post('telegram_bot');
$telegram_target_id = _post('telegram_target_id');
$sms_url = _post('sms_url');
$wa_url = _post('wa_url');
$user_notification_expired = _post('user_notification_expired');
$user_notification_expired_text = _post('user_notification_expired_text');
$user_notification_payment = _post('user_notification_payment');
$address = _post('address');
if ($company == '' or $theme == '' or $address == '') {
$tawkto = _post('tawkto');
$radius_mode = _post('radius_mode')*1;
run_hook('save_settings'); #HOOK
if ($company == '') {
r2(U . 'settings/app', 'e', $_L['All_field_is_required']);
} else {
$d = ORM::for_table('tbl_appconfig')->where('setting', 'CompanyName')->find_one();
@ -222,9 +233,116 @@ switch ($action) {
$d->value = $phone;
$d->save();
$d = ORM::for_table('tbl_appconfig')->where('setting', 'theme')->find_one();
$d->value = $theme;
$d->save();
$d = ORM::for_table('tbl_appconfig')->where('setting', 'CompanyFooter')->find_one();
if($d){
$d->value = $footer;
$d->save();
}else{
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'CompanyFooter';
$d->value = $footer;
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'telegram_bot')->find_one();
if($d){
$d->value = $telegram_bot;
$d->save();
}else{
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'telegram_bot';
$d->value = $telegram_bot;
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'telegram_target_id')->find_one();
if($d){
$d->value = $telegram_target_id;
$d->save();
}else{
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'telegram_target_id';
$d->value = $telegram_target_id;
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'sms_url')->find_one();
if($d){
$d->value = $sms_url;
$d->save();
}else{
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'sms_url';
$d->value = $sms_url;
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'wa_url')->find_one();
if($d){
$d->value = $wa_url;
$d->save();
}else{
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'wa_url';
$d->value = $wa_url;
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'user_notification_expired')->find_one();
if($d){
$d->value = $user_notification_expired;
$d->save();
}else{
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'user_notification_expired';
$d->value = $user_notification_expired;
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'user_notification_expired_text')->find_one();
if($d){
$d->value = $user_notification_expired_text;
$d->save();
}else{
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'user_notification_expired_text';
$d->value = $user_notification_expired_text;
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'user_notification_payment')->find_one();
if($d){
$d->value = $user_notification_payment;
$d->save();
}else{
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'user_notification_payment';
$d->value = $user_notification_payment;
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'tawkto')->find_one();
if($d){
$d->value = $tawkto;
$d->save();
}else{
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'tawkto';
$d->value = $tawkto;
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'radius_mode')->find_one();
if($d){
$d->value = $radius_mode;
$d->save();
}else{
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'radius_mode';
$d->value = $radius_mode;
$d->save();
}
$note = _post('note');
$d = ORM::for_table('tbl_appconfig')->where('setting', 'note')->find_one();
@ -241,6 +359,7 @@ switch ($action) {
$tzone = _post('tzone');
$date_format = _post('date_format');
$lan = _post('lan');
run_hook('save_localisation'); #HOOK
if ($tzone == '' or $date_format == '' or $lan == '') {
r2(U . 'settings/app', 'e', $_L['All_field_is_required']);
} else {
@ -284,7 +403,7 @@ switch ($action) {
if ($admin['user_type'] != 'Admin' and $admin['user_type'] != 'Sales') {
r2(U . "dashboard", 'e', $_L['Do_Not_Access']);
}
run_hook('view_change_password'); #HOOK
$ui->display('change-password.tpl');
break;
@ -292,6 +411,7 @@ switch ($action) {
$password = _post('password');
if ($password != '') {
$d = ORM::for_table('tbl_users')->where('username', $admin['username'])->find_one();
run_hook('change_password'); #HOOK
if ($d) {
$d_pass = $d['password'];
if (Password::_verify($password, $d_pass) == true) {
@ -345,6 +465,7 @@ switch ($action) {
$ui->assign('tables', $tables);
$ui->assign('dbsize', $mbytes);
run_hook('view_database'); #HOOK
$ui->display('dbstatus.tpl');
}
break;
@ -355,6 +476,7 @@ switch ($action) {
}
try {
run_hook('backup_database'); #HOOK
$mysqli = new mysqli($db_host, $db_user, $db_password, $db_name);
if ($mysqli->connect_errno) {
throw new Exception("Failed to connect to MySQL: " . $mysqli->connect_error);
@ -442,7 +564,7 @@ switch ($action) {
if ($admin['user_type'] != 'Admin') {
r2(U . "dashboard", 'e', $_L['Do_Not_Access']);
}
run_hook('view_add_language'); #HOOK
$ui->display('language-add.tpl');
break;
@ -459,6 +581,7 @@ switch ($action) {
if ($d) {
$msg .= $_L['Lang_already_exist'] . '<br>';
}
run_hook('save_language'); #HOOK
if ($msg == '') {
$b = ORM::for_table('tbl_language')->create();
$b->name = $name;

View File

@ -1,14 +1,11 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
**/
**/
_auth();
$ui->assign('_title', $_L['Voucher'].'- '. $config['CompanyName']);
$ui->assign('_title', $_L['Voucher']);
$ui->assign('_system_menu', 'voucher');
$action = $routes['1'];
@ -16,335 +13,217 @@ $user = User::_info();
$ui->assign('_user', $user);
use PEAR2\Net\RouterOS;
require_once 'system/autoload/PEAR2/Autoload.php';
switch ($action) {
case 'activation':
run_hook('view_activate_voucher'); #HOOK
$ui->display('user-activation.tpl');
break;
case 'activation-post':
$code = _post('code');
$v1 = ORM::for_table('tbl_voucher')->where('code',$code)->where('status',0)->find_one();
$c = ORM::for_table('tbl_customers')->find_one($user['id']);
$p = ORM::for_table('tbl_plans')->find_one($v1['id_plan']);
$b = ORM::for_table('tbl_user_recharges')->where('customer_id',$user['id'])->find_one();
$date_now = date("Y-m-d H:i:s");
$date_only = date("Y-m-d");
$time = date("H:i:s");
$mikrotik = Router::_info($v1['routers']);
$date_exp = date("Y-m-d", mktime(0,0,0,date("m"),date("d") + $p['validity'],date("Y")));
$v1 = ORM::for_table('tbl_voucher')->where('code', $code)->where('status', 0)->find_one();
if ($v1){
if($v1['type'] == 'Hotspot'){
if($b){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$printRequest = new RouterOS\Request('/ip/hotspot/user/print');
$printRequest->setArgument('.proplist', '.id');
$printRequest->setQuery(RouterOS\Query::where('name', $c['username']));
$id = $client->sendSync($printRequest)->getProperty('.id');
$setRequest = new RouterOS\Request('/ip/hotspot/user/remove');
$setRequest->setArgument('numbers', $id);
$client->sendSync($setRequest);
/* iBNuX Added:
* Time limit to Mikrotik
* 'Time_Limit', 'Data_Limit', 'Both_Limit'
*/
$addRequest = new RouterOS\Request('/ip/hotspot/user/add');
if($p['typebp']=="Limited"){
if($p['limit_type']=="Time_Limit"){
if($p['time_unit']=='Hrs')
$timelimit = $p['time_limit'].":00:00";
else
$timelimit = "00:".$p['time_limit'].":00";
$client->sendSync($addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
);
}else if($p['limit_type']=="Data_Limit"){
if($p['data_unit']=='GB')
$datalimit = $p['data_limit']."000000000";
else
$datalimit = $p['data_limit']."000000";
$client->sendSync($addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-bytes-total', $datalimit)
);
}else if($p['limit_type']=="Both_Limit"){
if($p['time_unit']=='Hrs')
$timelimit = $p['time_limit'].":00:00";
else
$timelimit = "00:".$p['time_limit'].":00";
if($p['data_unit']=='GB')
$datalimit = $p['data_limit']."000000000";
else
$datalimit = $p['data_limit']."000000";
$client->sendSync($addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
->setArgument('limit-bytes-total', $datalimit)
);
}
}else{
$client->sendSync($addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
}
$b->customer_id = $user['id'];
$b->username = $c['username'];
$b->plan_id = $v1['id_plan'];
$b->namebp = $p['name_plan'];
$b->recharged_on = $date_only;
$b->expiration = $date_exp;
$b->time = $time;
$b->status = "on";
$b->method = "voucher";
$b->routers = $v1['routers'];
$b->type = "Hotspot";
$b->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-"._raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "voucher";
$t->routers = $v1['routers'];
$t->type = "Hotspot";
$t->save();
}else{
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
/* iBNuX Added:
* Time limit to Mikrotik
* 'Time_Limit', 'Data_Limit', 'Both_Limit'
*/
$addRequest = new RouterOS\Request('/ip/hotspot/user/add');
if($p['typebp']=="Limited"){
if($p['limit_type']=="Time_Limit"){
if($p['time_unit']=='Hrs')
$timelimit = $p['time_limit'].":00:00";
else
$timelimit = "00:".$p['time_limit'].":00";
$client->sendSync($addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
);
}else if($p['limit_type']=="Data_Limit"){
if($p['data_unit']=='GB')
$datalimit = $p['data_limit']."000000000";
else
$datalimit = $p['data_limit']."000000";
$client->sendSync($addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-bytes-total', $datalimit)
);
}else if($p['limit_type']=="Both_Limit"){
if($p['time_unit']=='Hrs')
$timelimit = $p['time_limit'].":00:00";
else
$timelimit = "00:".$p['time_limit'].":00";
if($p['data_unit']=='GB')
$datalimit = $p['data_limit']."000000000";
else
$datalimit = $p['data_limit']."000000";
$client->sendSync($addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
->setArgument('limit-uptime', $timelimit)
->setArgument('limit-bytes-total', $datalimit)
);
}
}else{
$client->sendSync($addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
}
$d = ORM::for_table('tbl_user_recharges')->create();
$d->customer_id = $user['id'];
$d->username = $c['username'];
$d->plan_id = $v1['id_plan'];
$d->namebp = $p['name_plan'];
$d->recharged_on = $date_only;
$d->expiration = $date_exp;
$d->time = $time;
$d->status = "on";
$d->method = "voucher";
$d->routers = $v1['routers'];
$d->type = "Hotspot";
$d->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-"._raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "voucher";
$t->routers = $v1['routers'];
$t->type = "Hotspot";
$t->save();
}
$v1->status = "1";
$v1->user = $c['username'];
$v1->save();
}else{
if($b){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$printRequest = new RouterOS\Request('/ppp/secret/print');
$printRequest->setArgument('.proplist', '.id');
$printRequest->setQuery(RouterOS\Query::where('name', $c['username']));
$id = $client->sendSync($printRequest)->getProperty('.id');
$setRequest = new RouterOS\Request('/ppp/secret/remove');
$setRequest->setArgument('numbers', $id);
$client->sendSync($setRequest);
$addRequest = new RouterOS\Request('/ppp/secret/add');
$client->sendSync($addRequest
->setArgument('name', $c['username'])
->setArgument('service', 'pppoe')
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
$b->customer_id = $user['id'];
$b->username = $c['username'];
$b->plan_id = $v1['id_plan'];
$b->namebp = $p['name_plan'];
$b->recharged_on = $date_only;
$b->expiration = $date_exp;
$b->time = $time;
$b->status = "on";
$b->method = "voucher";
$b->routers = $v1['routers'];
$b->type = "PPPOE";
$b->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-"._raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "voucher";
$t->routers = $v1['routers'];
$t->type = "PPPOE";
$t->save();
}else{
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$addRequest = new RouterOS\Request('/ppp/secret/add');
$client->sendSync($addRequest
->setArgument('name', $c['username'])
->setArgument('service', 'pppoe')
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
$d = ORM::for_table('tbl_user_recharges')->create();
$d->customer_id = $user['id'];
$d->username = $c['username'];
$d->plan_id = $v1['id_plan'];
$d->namebp = $p['name_plan'];
$d->recharged_on = $date_only;
$d->expiration = $date_exp;
$d->time = $time;
$d->status = "on";
$d->method = "voucher";
$d->routers = $v1['routers'];
$d->type = "PPPOE";
$d->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-"._raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "voucher";
$t->routers = $v1['routers'];
$t->type = "PPPOE";
$t->save();
}
$v1->status = "1";
$v1->user = $c['username'];
$v1->save();
}
r2(U."voucher/list-activated",'s',$_L['Activation_Vouchers_Successfully']);
}else{
r2(U . 'voucher/activation', 'e', $_L['Voucher_Not_Valid']);
}
$c = ORM::for_table('tbl_customers')->find_one($user['id']);
$p = ORM::for_table('tbl_plans')->find_one($v1['id_plan']);
$b = ORM::for_table('tbl_user_recharges')->where('customer_id', $user['id'])->find_one();
$date_now = date("Y-m-d H:i:s");
$date_only = date("Y-m-d");
$time = date("H:i:s");
$mikrotik = Mikrotik::info($v1['routers']);
if ($p['validity_unit'] == 'Months') {
$date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' month'));
} else if ($p['validity_unit'] == 'Days') {
$date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' day'));
} else if ($p['validity_unit'] == 'Hrs') {
$datetime = explode(' ', date("Y-m-d H:i:s", strtotime('+' . $p['validity'] . ' hour')));
$date_exp = $datetime[0];
$time = $datetime[1];
} else if ($p['validity_unit'] == 'Mins') {
$datetime = explode(' ', date("Y-m-d H:i:s", strtotime('+' . $p['validity'] . ' minute')));
$date_exp = $datetime[0];
$time = $datetime[1];
}
run_hook('customer_activate_voucher'); #HOOK
if ($v1) {
if ($v1['type'] == 'Hotspot') {
if ($b) {
if (!$config['radius_mode']) {
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::removeHotspotUser($client, $c['username']);
Mikrotik::addHotspotUser($client, $p, $c);
}
$b->customer_id = $user['id'];
$b->username = $c['username'];
$b->plan_id = $v1['id_plan'];
$b->namebp = $p['name_plan'];
$b->recharged_on = $date_only;
$b->expiration = $date_exp;
$b->time = $time;
$b->status = "on";
$b->method = "voucher";
$b->routers = $v1['routers'];
$b->type = "Hotspot";
$b->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . _raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "voucher";
$t->routers = $v1['routers'];
$t->type = "Hotspot";
$t->save();
} else {
if (!$config['radius_mode']) {
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::addHotspotUser($client, $p, $c);
}
$d = ORM::for_table('tbl_user_recharges')->create();
$d->customer_id = $user['id'];
$d->username = $c['username'];
$d->plan_id = $v1['id_plan'];
$d->namebp = $p['name_plan'];
$d->recharged_on = $date_only;
$d->expiration = $date_exp;
$d->time = $time;
$d->status = "on";
$d->method = "voucher";
$d->routers = $v1['routers'];
$d->type = "Hotspot";
$d->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . _raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "voucher";
$t->routers = $v1['routers'];
$t->type = "Hotspot";
$t->save();
}
$v1->status = "1";
$v1->user = $c['username'];
$v1->save();
// Telegram to Admin
Message::sendTelegram('#u' . $c['username'] . " Activate #Voucher #Hotspot\n" . $p['name_plan'] .
"\nCode: " . $code .
"\nRouter: " . $v1['routers'] .
"\nPrice: " . $p['price']);
} else {
if ($b) {
if (!$config['radius_mode']) {
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::removePpoeUser($client, $c['username']);
Mikrotik::addPpoeUser($client, $p, $c);
}
$b->customer_id = $user['id'];
$b->username = $c['username'];
$b->plan_id = $v1['id_plan'];
$b->namebp = $p['name_plan'];
$b->recharged_on = $date_only;
$b->expiration = $date_exp;
$b->time = $time;
$b->status = "on";
$b->method = "voucher";
$b->routers = $v1['routers'];
$b->type = "PPPOE";
$b->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . _raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "voucher";
$t->routers = $v1['routers'];
$t->type = "PPPOE";
$t->save();
} else {
if (!$config['radius_mode']) {
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
Mikrotik::addPpoeUser($client, $p, $c);
}
$d = ORM::for_table('tbl_user_recharges')->create();
$d->customer_id = $user['id'];
$d->username = $c['username'];
$d->plan_id = $v1['id_plan'];
$d->namebp = $p['name_plan'];
$d->recharged_on = $date_only;
$d->expiration = $date_exp;
$d->time = $time;
$d->status = "on";
$d->method = "voucher";
$d->routers = $v1['routers'];
$d->type = "PPPOE";
$d->save();
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = "INV-" . _raid(5);
$t->username = $c['username'];
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "voucher";
$t->routers = $v1['routers'];
$t->type = "PPPOE";
$t->save();
}
$v1->status = "1";
$v1->user = $c['username'];
$v1->save();
// Telegram to Admin
Message::sendTelegram('#u' . $c['username'] . " Activate #Voucher #PPPOE\n" . $p['name_plan'] .
"\nCode: " . $code .
"\nRouter: " . $v1['routers'] .
"\nPrice: " . $p['price']);
}
r2(U . "voucher/list-activated", 's', $_L['Activation_Vouchers_Successfully']);
} else {
r2(U . 'voucher/activation', 'e', $_L['Voucher_Not_Valid']);
}
break;
case 'list-activated':
$paginator = Paginator::bootstrap('tbl_transactions','username',$user['username']);
$d = ORM::for_table('tbl_transactions')->where('username',$user['username'])->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many();
$ui->assign('d',$d);
$ui->assign('paginator',$paginator);
$ui->display('user-activation-list.tpl');
$ui->assign('_system_menu', 'list-activated');
$paginator = Paginator::bootstrap('tbl_transactions', 'username', $user['username']);
$d = ORM::for_table('tbl_transactions')->where('username', $user['username'])->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many();
$ui->assign('d', $d);
$ui->assign('paginator', $paginator);
run_hook('customer_view_activation_list'); #HOOK
$ui->display('user-activation-list.tpl');
break;
default:
$ui->display('404.tpl');
}
}

View File

@ -1,17 +1,12 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
* @license GNU General Public License version 2 or later; see LICENSE.txt
**/
require('config.php');
require('../config.php');
require('orm.php');
use PEAR2\Net\RouterOS;
require_once 'autoload/PEAR2/Autoload.php';
ORM::configure("mysql:host=$db_host;dbname=$db_name");
@ -20,93 +15,92 @@ ORM::configure('password', $db_password);
ORM::configure('return_result_sets', true);
ORM::configure('logging', true);
include "autoload/Hookers.php";
//register all plugin
foreach (glob("system/plugin/*.php") as $filename) {
include $filename;
}
// on some server, it getting error because of slash is backwards
function _autoloader($class)
{
if (strpos($class, '_') !== false) {
$class = str_replace('_', DIRECTORY_SEPARATOR, $class);
if (file_exists('autoload' . DIRECTORY_SEPARATOR . $class . '.php')) {
include 'autoload' . DIRECTORY_SEPARATOR . $class . '.php';
} else {
$class = str_replace("\\", DIRECTORY_SEPARATOR, $class);
if (file_exists(__DIR__ . DIRECTORY_SEPARATOR . 'autoload' . DIRECTORY_SEPARATOR . $class . '.php'))
include __DIR__ . DIRECTORY_SEPARATOR . 'autoload' . DIRECTORY_SEPARATOR . $class . '.php';
}
} else {
if (file_exists('autoload' . DIRECTORY_SEPARATOR . $class . '.php')) {
include 'autoload' . DIRECTORY_SEPARATOR . $class . '.php';
} else {
$class = str_replace("\\", DIRECTORY_SEPARATOR, $class);
if (file_exists(__DIR__ . DIRECTORY_SEPARATOR . 'autoload' . DIRECTORY_SEPARATOR . $class . '.php'))
include __DIR__ . DIRECTORY_SEPARATOR . 'autoload' . DIRECTORY_SEPARATOR . $class . '.php';
}
}
}
spl_autoload_register('_autoloader');
$result = ORM::for_table('tbl_appconfig')->find_many();
foreach($result as $value){
$config[$value['setting']]=$value['value'];
foreach ($result as $value) {
$config[$value['setting']] = $value['value'];
}
date_default_timezone_set($config['timezone']);
$d = ORM::for_table('tbl_user_recharges')->where('status','on')->find_many();
$textExpired = $config['user_notification_expired_text'];
foreach ($d as $ds){
if($ds['type'] == 'Hotspot'){
$date_now = strtotime(date("Y-m-d H:i:s"));
$expiration = strtotime($ds['expiration'].' '.$ds['time']);
echo $ds['expiration']." : ".$ds['username'];
if ($date_now >= $expiration){
echo " : EXPIRED \r\n";
$u = ORM::for_table('tbl_user_recharges')->where('id',$ds['id'])->find_one();
$c = ORM::for_table('tbl_customers')->where('id',$ds['customer_id'])->find_one();
$m = ORM::for_table('tbl_routers')->where('name',$ds['routers'])->find_one();
$d = ORM::for_table('tbl_user_recharges')->where('status', 'on')->find_many();
try {
$client = new RouterOS\Client($m['ip_address'], $m['username'], $m['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
run_hook('cronjob'); #HOOK
$printRequest = new RouterOS\Request('/ip/hotspot/user/print');
$printRequest->setArgument('.proplist', '.id');
$printRequest->setQuery(RouterOS\Query::where('name', $c['username']));
$id = $client->sendSync($printRequest)->getProperty('.id');
foreach ($d as $ds) {
if ($ds['type'] == 'Hotspot') {
$date_now = strtotime(date("Y-m-d H:i:s"));
$expiration = strtotime($ds['expiration'] . ' ' . $ds['time']);
echo $ds['expiration'] . " : " . $ds['username'];
if ($date_now >= $expiration) {
echo " : EXPIRED \r\n";
$u = ORM::for_table('tbl_user_recharges')->where('id', $ds['id'])->find_one();
$c = ORM::for_table('tbl_customers')->where('id', $ds['customer_id'])->find_one();
$m = ORM::for_table('tbl_routers')->where('name', $ds['routers'])->find_one();
$setRequest = new RouterOS\Request('/ip/hotspot/user/set');
$setRequest->setArgument('numbers', $id);
$setRequest->setArgument('limit-uptime', '00:00:05');
$client->sendSync($setRequest);
if (!$_c['radius_mode']) {
$client = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']);
Mikrotik::setHotspotLimitUptime($client, $c['username']);
Mikrotik::removeHotspotActiveUser($client, $c['username']);
Message::sendExpiredNotification($c['phonenumber'], $c['fullname'], $u['namebp'], $textExpired, $config['user_notification_expired']);
}
//update database user dengan status off
$u->status = 'off';
$u->save();
} else echo " : ACTIVE \r\n";
} else {
$date_now = strtotime(date("Y-m-d H:i:s"));
$expiration = strtotime($ds['expiration'] . ' ' . $ds['time']);
echo $ds['expiration'] . " : " . $ds['username'];
if ($date_now >= $expiration) {
echo " : EXPIRED \r\n";
$u = ORM::for_table('tbl_user_recharges')->where('id', $ds['id'])->find_one();
$c = ORM::for_table('tbl_customers')->where('id', $ds['customer_id'])->find_one();
$m = ORM::for_table('tbl_routers')->where('name', $ds['routers'])->find_one();
//remove hotspot active
$onlineRequest = new RouterOS\Request('/ip/hotspot/active/print');
$onlineRequest->setArgument('.proplist', '.id');
$onlineRequest->setQuery(RouterOS\Query::where('user', $c['username']));
$id = $client->sendSync($onlineRequest)->getProperty('.id');
if (!$_c['radius_mode']) {
$client = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']);
Mikrotik::disablePpoeUser($client, $c['username']);
Mikrotik::removePpoeActive($client, $c['username']);
Message::sendExpiredNotification($c['phonenumber'], $c['fullname'], $u['namebp'], $textExpired, $config['user_notification_expired']);
}
$removeRequest = new RouterOS\Request('/ip/hotspot/active/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
//update database user dengan status off
$u->status = 'off';
$u->save();
}else
echo " : ACTIVE \r\n";
}else{
$date_now = strtotime(date("Y-m-d H:i:s"));
$expiration = strtotime($ds['expiration'].' '.$ds['time']);
echo $ds['expiration']." : ".$ds['username'];
if ($date_now >= $expiration){
echo " : EXPIRED \r\n";
$u = ORM::for_table('tbl_user_recharges')->where('id',$ds['id'])->find_one();
$c = ORM::for_table('tbl_customers')->where('id',$ds['customer_id'])->find_one();
$m = ORM::for_table('tbl_routers')->where('name',$ds['routers'])->find_one();
try {
$client = new RouterOS\Client($m['ip_address'], $m['username'], $m['password']);
} catch (Exception $e) {
die('Unable to connect to the router.');
}
$printRequest = new RouterOS\Request('/ppp/secret/print');
$printRequest->setArgument('.proplist', '.id');
$printRequest->setQuery(RouterOS\Query::where('name', $c['username']));
$id = $client->sendSync($printRequest)->getProperty('.id');
$setRequest = new RouterOS\Request('/ppp/secret/disable');
$setRequest->setArgument('numbers', $id);
$client->sendSync($setRequest);
//remove hotspot active
$onlineRequest = new RouterOS\Request('/ppp/active/print');
$onlineRequest->setArgument('.proplist', '.id');
$onlineRequest->setQuery(RouterOS\Query::where('name', $c['username']));
$id = $client->sendSync($onlineRequest)->getProperty('.id');
$removeRequest = new RouterOS\Request('/ppp/active/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
$u->status = 'off';
$u->save();
}else
echo " : ACTIVE \r\n";
}
$u->status = 'off';
$u->save();
} else echo " : ACTIVE \r\n";
}
}

View File

@ -1,59 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>PHPMixBill Installer</title>
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.png">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type='text/css' href='css/style.css' rel='stylesheet'/>
<link href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body style='background-color: #FBFBFB;'>
<div id='main-container'>
<div class='header'>
<div class="header-box wrapper">
<div class="hd-logo"><a href="#"><img src="img/logo.png" alt="Logo"/></a></div>
</div>
</div>
<!-- contents area start -->
<div class="row">
<div class="col-md-12">
<h4> PHPMixBill Installer </h4>
<h5>Please Read Before Continue</h5>
<p><strong>Informasi Aplikasi</strong><br>
Application Name: PHPMixBill <br>
Release Date: 30/10/2015<br>
By: PHPMixBill [ <a href="https://github.com/ibnux/phpmixbill" target="_blank">https://github.com/ibnux/phpmixbill</a> ]<br>
Donasi Paypal: <b>me@ibnux.et</b><br>
<br>
<strong>Syarat Penggunaan:</strong><br>
Syarat Penggunaan ini berlaku untuk semua versi.<br><br>
<ul>
<li>Silahkan Anda menggunakan aplikasi ini dengan bijak, Anda dapat mendesain ulang script maupun tampilan pada
aplikasi ini sesuai dengan kebutuhan anda, memperbayak jumlah copy atau mendistribusikan aplikasi ini.
Dengan catatan tidak menghapus link developer.</li>
<li>Tidak ada garansi dari kami jika anda mengalami error atau merasa rugi ketika menggunakan aplikasi ini,
Anda hanya dapat memberikan feedback yang berisi laporan error, dengan syarat dan ketentuan yang berlaku.</li>
<li>Semua yang terkait biaya atau donasi apapun versi-nya, Anda dapat update seumur hidup atau selama aplikasi
ini masih dikembangkan. Mohon jangan salah pengertian bahwa kami tim pengembang mengkomersilkan produk ini
dan anda membeli produk kami.</li>
<li>Aplikasi ini bersifat sosial untuk dapat dikembangkan bersama. Karena itu kami juga mengundang relawan-relawan
yang mau menjadi pengembangkan aplikasi ini.</li>
<li>Penulis berhak setiap saat untuk mengubah ketentuan Syarat Penggunaan tanpa pemberitahuan sebelumnya.</li>
</ul>
</div>
<div class="col-md-12"><br>
<a href="step2.php" class="btn btn-primary">Accept &amp; Continue</a>
</div>
</div>
<!-- contents area end -->
</div>
<div class="footer">Copyright &copy; 2021 PHPMixBill. All Rights Reserved<br/><br/></div>
</body>
</html>

View File

@ -1,438 +0,0 @@
--
-- Database: `phpmixbill`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_appconfig`
--
DROP TABLE IF EXISTS `tbl_appconfig`;
CREATE TABLE `tbl_appconfig` (
`id` int(11) NOT NULL,
`setting` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`value` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
--
-- Dumping data untuk tabel `tbl_appconfig`
--
INSERT INTO
`tbl_appconfig` (`id`, `setting`, `value`)
VALUES
(1, 'CompanyName', 'PHPMixBill'),
(2, 'theme', 'default'),
(3, 'currency_code', 'Rp.'),
(4, 'language', 'english'),
(5, 'show-logo', '1'),
(6, 'nstyle', 'blue'),
(7, 'timezone', 'Asia/Jakarta'),
(8, 'dec_point', ','),
(9, 'thousands_sep', '.'),
(10, 'rtl', '0'),
(11, 'address', ''),
(12, 'phone', ''),
(13, 'date_format', 'd M Y'),
(14, 'note', 'Thank you...');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_bandwidth`
--
DROP TABLE IF EXISTS `tbl_bandwidth`;
CREATE TABLE `tbl_bandwidth` (
`id` int(10) UNSIGNED NOT NULL,
`name_bw` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`rate_down` int(10) UNSIGNED NOT NULL,
`rate_down_unit` enum('Kbps', 'Mbps') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`rate_up` int(10) UNSIGNED NOT NULL,
`rate_up_unit` enum('Kbps', 'Mbps') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_customers`
--
DROP TABLE IF EXISTS `tbl_customers`;
CREATE TABLE `tbl_customers` (
`id` int(10) NOT NULL,
`username` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`password` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`fullname` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`address` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci,
`phonenumber` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT '0',
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
`last_login` datetime DEFAULT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_language`
--
DROP TABLE IF EXISTS `tbl_language`;
CREATE TABLE `tbl_language` (
`id` int(10) NOT NULL,
`name` varchar(32) COLLATE utf8mb4_general_ci NOT NULL,
`folder` varchar(32) COLLATE utf8mb4_general_ci NOT NULL,
`author` varchar(60) COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
--
-- Dumping data untuk tabel `tbl_language`
--
INSERT INTO
`tbl_language` (`id`, `name`, `folder`, `author`)
VALUES
(1, 'Indonesia', 'indonesia', 'Ismail Marzuqi'),
(2, 'English', 'english', 'Ismail Marzuqi'),
(4, 'Türkçe', 'turkish', 'Goktug Bogac Ogel');
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_logs`
--
DROP TABLE IF EXISTS `tbl_logs`;
CREATE TABLE `tbl_logs` (
`id` int(10) NOT NULL,
`date` datetime DEFAULT NULL,
`type` varchar(50) COLLATE utf8mb4_general_ci NOT NULL,
`description` mediumtext COLLATE utf8mb4_general_ci NOT NULL,
`userid` int(10) NOT NULL,
`ip` mediumtext COLLATE utf8mb4_general_ci NOT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_message`
--
DROP TABLE IF EXISTS `tbl_message`;
CREATE TABLE `tbl_message` (
`id` int(10) NOT NULL,
`from_user` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`to_user` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`title` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`message` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`status` enum('0', '1') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0',
`date` datetime NOT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_plans`
--
DROP TABLE IF EXISTS `tbl_plans`;
CREATE TABLE `tbl_plans` (
`id` int(10) NOT NULL,
`name_plan` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`id_bw` int(10) NOT NULL,
`price` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`type` enum('Hotspot', 'PPPOE') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`typebp` enum('Unlimited', 'Limited') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`limit_type` enum('Time_Limit', 'Data_Limit', 'Both_Limit') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`time_limit` int(10) UNSIGNED DEFAULT NULL,
`time_unit` enum('Mins', 'Hrs') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`data_limit` int(10) UNSIGNED DEFAULT NULL,
`data_unit` enum('MB', 'GB') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL,
`validity` int(10) NOT NULL,
`validity_unit` enum('Days', 'Months') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`shared_users` int(10) DEFAULT NULL,
`routers` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`pool` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_pool`
--
DROP TABLE IF EXISTS `tbl_pool`;
CREATE TABLE `tbl_pool` (
`id` int(10) NOT NULL,
`pool_name` varchar(40) COLLATE utf8mb4_general_ci NOT NULL,
`range_ip` varchar(40) COLLATE utf8mb4_general_ci NOT NULL,
`routers` varchar(40) COLLATE utf8mb4_general_ci NOT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_routers`
--
DROP TABLE IF EXISTS `tbl_routers`;
CREATE TABLE `tbl_routers` (
`id` int(10) NOT NULL,
`name` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`ip_address` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`username` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`password` varchar(60) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`description` varchar(50) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_transactions`
--
DROP TABLE IF EXISTS `tbl_transactions`;
CREATE TABLE `tbl_transactions` (
`id` int(10) NOT NULL,
`invoice` varchar(25) COLLATE utf8mb4_general_ci NOT NULL,
`username` varchar(32) COLLATE utf8mb4_general_ci NOT NULL,
`plan_name` varchar(40) COLLATE utf8mb4_general_ci NOT NULL,
`price` varchar(40) COLLATE utf8mb4_general_ci NOT NULL,
`recharged_on` date NOT NULL,
`expiration` date NOT NULL,
`time` time NOT NULL,
`method` enum('voucher', 'admin') COLLATE utf8mb4_general_ci NOT NULL,
`routers` varchar(32) COLLATE utf8mb4_general_ci NOT NULL,
`type` enum('Hotspot', 'PPPOE') COLLATE utf8mb4_general_ci NOT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_users`
--
DROP TABLE IF EXISTS `tbl_users`;
CREATE TABLE `tbl_users` (
`id` int(10) UNSIGNED NOT NULL,
`username` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`fullname` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '',
`password` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`user_type` enum('Admin', 'Sales') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`status` enum('Active', 'Inactive') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'Active',
`last_login` datetime DEFAULT NULL,
`creationdate` datetime NOT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
--
-- Dumping data untuk tabel `tbl_users`
--
INSERT INTO
`tbl_users` (
`id`,
`username`,
`fullname`,
`password`,
`user_type`,
`status`,
`last_login`,
`creationdate`
)
VALUES
(
1,
'admin',
'Administrator',
'7c4a8d09ca3762af61e59520943dc26494f8941b',
'Admin',
'Active',
'2015-10-30 18:27:02',
'2014-06-23 01:43:07'
);
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_user_recharges`
--
DROP TABLE IF EXISTS `tbl_user_recharges`;
CREATE TABLE `tbl_user_recharges` (
`id` int(10) NOT NULL,
`customer_id` int(10) NOT NULL,
`username` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`plan_id` int(10) NOT NULL,
`namebp` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`recharged_on` date NOT NULL,
`expiration` date NOT NULL,
`time` time NOT NULL,
`status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`method` enum('voucher', 'admin') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`routers` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`type` varchar(15) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_voucher`
--
DROP TABLE IF EXISTS `tbl_voucher`;
CREATE TABLE `tbl_voucher` (
`id` int(10) NOT NULL,
`type` enum('Hotspot', 'PPPOE') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`routers` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`id_plan` int(10) NOT NULL,
`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
) ENGINE = InnoDB DEFAULT CHARSET = utf8mb4 COLLATE = utf8mb4_general_ci;
--
-- Indexes for dumped tables
--
--
-- Indeks untuk tabel `tbl_appconfig`
--
ALTER TABLE
`tbl_appconfig`
ADD
PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_bandwidth`
--
ALTER TABLE
`tbl_bandwidth`
ADD
PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_customers`
--
ALTER TABLE
`tbl_customers`
ADD
PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_language`
--
ALTER TABLE
`tbl_language`
ADD
PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_logs`
--
ALTER TABLE
`tbl_logs`
ADD
PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_message`
--
ALTER TABLE
`tbl_message`
ADD
PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_plans`
--
ALTER TABLE
`tbl_plans`
ADD
PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_pool`
--
ALTER TABLE
`tbl_pool`
ADD
PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_routers`
--
ALTER TABLE
`tbl_routers`
ADD
PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_transactions`
--
ALTER TABLE
`tbl_transactions`
ADD
PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_users`
--
ALTER TABLE
`tbl_users`
ADD
PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_user_recharges`
--
ALTER TABLE
`tbl_user_recharges`
ADD
PRIMARY KEY (`id`);
--
-- Indeks untuk tabel `tbl_voucher`
--
ALTER TABLE
`tbl_voucher`
ADD
PRIMARY KEY (`id`);
--
-- AUTO_INCREMENT untuk tabel yang dibuang
--
--
-- AUTO_INCREMENT untuk tabel `tbl_appconfig`
--
ALTER TABLE
`tbl_appconfig`
MODIFY
`id` int(11) NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT = 15;
--
-- AUTO_INCREMENT untuk tabel `tbl_bandwidth`
--
ALTER TABLE
`tbl_bandwidth`
MODIFY
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_customers`
--
ALTER TABLE
`tbl_customers`
MODIFY
`id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_language`
--
ALTER TABLE
`tbl_language`
MODIFY
`id` int(10) NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT = 5;
--
-- AUTO_INCREMENT untuk tabel `tbl_logs`
--
ALTER TABLE
`tbl_logs`
MODIFY
`id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_message`
--
ALTER TABLE
`tbl_message`
MODIFY
`id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_plans`
--
ALTER TABLE
`tbl_plans`
MODIFY
`id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_pool`
--
ALTER TABLE
`tbl_pool`
MODIFY
`id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_routers`
--
ALTER TABLE
`tbl_routers`
MODIFY
`id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_transactions`
--
ALTER TABLE
`tbl_transactions`
MODIFY
`id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_users`
--
ALTER TABLE
`tbl_users`
MODIFY
`id` int(10) UNSIGNED NOT NULL AUTO_INCREMENT,
AUTO_INCREMENT = 2;
--
-- AUTO_INCREMENT untuk tabel `tbl_user_recharges`
--
ALTER TABLE
`tbl_user_recharges`
MODIFY
`id` int(10) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT untuk tabel `tbl_voucher`
--
ALTER TABLE
`tbl_voucher`
MODIFY
`id` int(10) NOT NULL AUTO_INCREMENT;
COMMIT;

View File

@ -1,71 +0,0 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>PHPMixBill Installer</title>
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<!--[if lt IE 9]>
<script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link type='text/css' href='css/style.css' rel='stylesheet'/>
<link type='text/css' href="css/bootstrap.min.css" rel="stylesheet">
</head>
<body style='background-color: #FBFBFB;'>
<div id='main-container'>
<div class='header'>
<div class="header-box wrapper">
<div class="hd-logo"><a href="#"><img src="img/logo.png" alt="Logo"/></a></div>
</div>
</div>
<div class="span12">
<h4> PHPMixBill Installer </h4>
<?php
$passed = '';
$ltext = '';
if (version_compare(PHP_VERSION, '5.2.0') >= 0) {
$ltext .= 'To Run PHPMixBill You need at least PHP version 5.2.0, Your PHP Version is: ' . PHP_VERSION . " Tested <strong>---PASSED---</strong><br/>";
$passed .= '1';
} else {
$ltext .= 'To Run PHPMixBill You need at least PHP version 5.2.0, Your PHP Version is: ' . PHP_VERSION . " Tested <strong>---FAILED---</strong><br/>";
$passed .= '0';
}
if (extension_loaded('PDO')) {
$ltext .= 'PDO is installed on your server: ' . "Tested <strong>---PASSED---</strong><br/>";
$passed .= '1';
} else {
$ltext = 'PDO is installed on your server: ' . "Tested <strong>---FAILED---</strong><br/>";
$passed .= '0';
}
if (extension_loaded('pdo_mysql')) {
$ltext .= 'PDO MySQL driver is enabled on your server: ' . "Tested <strong>---PASSED---</strong><br/>";
$passed .= '1';
} else {
$ltext .= 'PDO MySQL driver is not enabled on your server: ' . "Tested <strong>---FAILED---</strong><br/>";
$passed .= '0';
}
if ($passed == '111') {
echo("<br/> $ltext <br/> Great! System Test Completed. You can run PHPMixBill on your server. Click Continue For Next Step.
<br><br>
<a href=\"step3.php\" class=\"btn btn-primary\">Continue</a>");
} else {
echo("<br/> $ltext <br/> Sorry. The requirements of PHPMixBill is not available on your server.
Please contact with us- iesien22@yahoo.com with this code- $passed Or contact with your server administrator
<br><br>
<a href=\"#\" class=\"btn btn-primary disabled\">Correct The Problem To Continue</a>");
}
?>
</div>
</div>
<div class="footer">Copyright &copy; 2021 PHPMixBill. All Rights Reserved<br/><br/></div>
</body>
</html>

View File

@ -3,7 +3,7 @@
-----------------------------------
Language Name: English
Contributor: Ismail Marzuqi
Web: www.phpmixbill.com
Web: www.phpnuxbill.com
Email: iesien22@yahoo.com
2017
@ -21,7 +21,7 @@ $_L['Register_Success'] = 'Register Success! You can login now';
$_L['Sign_In_Member'] = 'Log in to Member Panel';
$_L['Register_Member'] = 'Register as Member';
$_L['Sign_In_Admin'] = 'Masuk ke Admin Panel';
$_L['Logo'] = 'PHPMixBill';
$_L['Logo'] = 'PHPNuxBill';
$_L['Username'] = 'Username';
$_L['Password'] = 'Password';
$_L['PasswordsNotMatch'] = 'Passwords does not match';
@ -217,9 +217,9 @@ $_L['Title'] = 'Title';
$_L['Message'] = 'Message';
$_L['Account_Information'] = 'Your Account Information';
$_L['Welcome_Text_User'] = 'Welcome to the Panel Members page, on this page you can:';
$_L['Welcome_Text_Admin'] = '<b>PHPMixBill</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/ibnux/phpmixbill" target="_blank">in here</a>';
$_L['Welcome_Text_Admin'] = '<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>';
//update
//update
$_L['Invalid_Username_or_Password'] = 'Invalid Username or Password';
$_L['Do_Not_Access'] = 'You do not have permission to access this page';
$_L['Incorrect_Current_Password'] = 'Incorrect Current Password';
@ -247,3 +247,50 @@ $_L['Folder_Lang'] = 'Folder Name';
$_L['Translator'] = 'Translator';
$_L['Lang_already_exist'] = 'Language Name Already Exist';
$_L['Payment_Gateway'] = 'Payment Gateway';
$_L['Community'] = 'Community';
$_L['1_user_can_be_used_for_many_devices'] = '1 user can be used for many devices?';
$_L['Cannot_be_change_after_saved'] = 'Cannot be change after saved';
$_L['Explain_Coverage_of_router'] = 'Jelaskan Cakupan wilayah hotspot';
$_L['Name_of_Area_that_router_operated'] = 'Nama Lokasi/Wilayah Router beroperasi';
$_L['Payment_Notification_URL_Recurring_Notification_URL_Pay_Account_Notification_URL'] = 'Payment Notification URL, Recurring Notification URL, Pay Account Notification URL';
$_L['Finish_Redirect_URL_Unfinish_Redirect_URL_Error_Redirect_URL'] = 'Finish Redirect URL, Unfinish Redirect URL, Error Redirect URL';
$_L['Status'] = 'Status';
$_L['Plan_Not_found'] = 'Plan Not found';
$_L['Failed_to_create_transaction'] = 'Failed to create transaction.';
$_L['Seller_has_not_yet_setup_Xendit_payment_gateway'] = 'Seller has not yet setup Xendit payment gateway';
$_L['Admin_has_not_yet_setup_Xendit_payment_gateway_please_tell_admin'] = 'Admin has not yet setup Xendit payment gateway, please tell admin';
$_L['Buy_this_your_active_package_will_be_overwrite'] = 'Buy this? your active package will be overwrite';
$_L['You_already_have_unpaid_transaction_cancel_it_or_pay_it'] = 'You already have unpaid transaction, cancel it or pay it.';
$_L['Transaction_Not_found'] = 'Transaction Not found';
$_L['Cancel_it'] = 'Cancel it?';
$_L['expired'] = 'expired';
$_L['Check_for_Payment'] = 'Check for Payment';
$_L['Transaction_still_unpaid'] = 'Transaction still unpaid.';
$_L['Paid_Date'] = 'Paid Date';
$_L['Transaction_has_been_paid'] = 'Transaction has been paid.';
$_L['PAID'] = 'PAID';
$_L['CANCELED'] = 'CANCELED';
$_L['UNPAID'] = 'UNPAID';
$_L['PAY_NOW'] = 'PAY NOW';
$_L['Buy_Hotspot_Plan'] = 'Buy Hotspot Plan';
$_L['Buy_PPOE_Plan'] = 'Buy PPOE Plan';
$_L['Package'] = 'Package';
$_L['Order_Internet_Package'] = 'Order Internet Package';
$_L['Unknown_Command'] = 'Unknown Command.';
$_L['Checking_payment'] = 'Checking payment';
$_L['Create_Transaction_Success'] = 'Create Transaction Success';
$_L['You_have_unpaid_transaction'] = 'You have unpaid transaction';
$_L['TripayPayment_Channel'] = 'TripayPayment Channel';
$_L['Payment_Channel'] = 'Payment Channel';
$_L['Payment_check_failed'] = 'Payment check failed.';
$_L['Order_Package'] = 'Order Package';
$_L['Transactions'] = 'Transactions';
$_L['Payments'] = 'Payments';
$_L['History'] = 'History';
$_L['Order_History'] = 'Order History';
$_L['Gateway'] = 'Gateway';
$_L['Date_Done'] = 'Date Done';
$_L['Unpaid_Order'] = 'Unpaid Order';

View File

@ -3,7 +3,7 @@
-----------------------------------
Language Name: Indonesia
Contributor: Ismail Marzuqi
Web: www.phpmixbill.com
Web: www.phpnuxbill.com
Email: iesien22@yahoo.com
2017
@ -12,7 +12,7 @@ Contributor: Ibnu Maksum (@ibnux)
------------------------------------
*/
$_L['Login'] = 'Masuk';
$_L['Login'] = 'Masuk';
$_L['Register'] = 'Daftar';
$_L['Announcement'] = 'Pengumuman';
$_L['Registration_Info'] = 'Info Pendaftaran';
@ -21,7 +21,7 @@ $_L['Register_Success'] = 'Pendaftaran sukses!<br>silahkan masuk';
$_L['Sign_In_Member'] = 'Masuk ke Member Panel';
$_L['Register_Member'] = 'Mendaftar sebagai pelanggan<br>pastikan anda sudah membeli voucher';
$_L['Sign_In_Admin'] = 'Masuk ke Admin Panel';
$_L['Logo'] = 'PHPMixBill';
$_L['Logo'] = 'PHPNuxBill';
$_L['Username'] = 'Username';
$_L['Password'] = 'Password';
$_L['PasswordsNotMatch'] = 'Sandi tidak sama';
@ -216,7 +216,7 @@ $_L['Title'] = 'Title';
$_L['Message'] = 'Message';
$_L['Account_Information'] = 'Informasi Akun Anda';
$_L['Welcome_Text_User'] = 'Selamat datang di Member Panel, disini Anda dapat mengetahui:';
$_L['Welcome_Text_Admin'] = '<b>PHPMixBill</b> adalah sebuah aplikasi billing Hotspot dan PPPOE untuk Mikrotik dengan menggunakan bahasa pemograman PHP dan menggunakan API Mikrotik sebagai komunikasi dengan router. Jika aplikasi ini sangat berguna bagi bisnis Anda silahkan Anda donasi berapapun.<br>Pantau proyek <a href="https://github.com/ibnux/phpmixbill" target="_blank">disini</a>';
$_L['Welcome_Text_Admin'] = '<b>PHPNuxBill</b> adalah sebuah aplikasi billing Hotspot dan PPPOE untuk Mikrotik dengan menggunakan bahasa pemograman PHP dan menggunakan API Mikrotik sebagai komunikasi dengan router. Jika aplikasi ini sangat berguna bagi bisnis Anda silahkan Anda donasi berapapun.<br>Pantau proyek <a href="https://github.com/hotspotbilling/phpnuxbill" target="_blank">disini</a>';
//update
$_L['Invalid_Username_or_Password'] = 'Username atau Password Salah';
@ -244,3 +244,75 @@ $_L['Name_Lang'] = 'Nama Bahasa';
$_L['Folder_Lang'] = 'Nama Folder';
$_L['Translator'] = 'Translator';
$_L['Lang_already_exist'] = 'Nama bahasa sudah ada';
$_L['Payment_Gateway'] = 'Payment Gateway';
$_L['Community'] = 'Community';
$_L['1_user_can_be_used_for_many_devices'] = '1 user can be used for many devices?';
$_L['Cannot_be_change_after_saved'] = 'Cannot be change after saved';
$_L['Explain_Coverage_of_router'] = 'Jelaskan Cakupan wilayah hotspot';
$_L['Name_of_Area_that_router_operated'] = 'Nama Lokasi/Wilayah Router beroperasi';
$_L['Payment_Notification_URL_Recurring_Notification_URL_Pay_Account_Notification_URL'] = 'Payment Notification URL, Recurring Notification URL, Pay Account Notification URL';
$_L['Finish_Redirect_URL_Unfinish_Redirect_URL_Error_Redirect_URL'] = 'Finish Redirect URL, Unfinish Redirect URL, Error Redirect URL';
$_L['Status'] = 'Status';
$_L['Plan_Not_found'] = 'Plan Not found';
$_L['Failed_to_create_transaction'] = 'Failed to create transaction.';
$_L['Seller_has_not_yet_setup_Xendit_payment_gateway'] = 'Seller has not yet setup Xendit payment gateway';
$_L['Admin_has_not_yet_setup_Xendit_payment_gateway_please_tell_admin'] = 'Admin has not yet setup Xendit payment gateway, please tell admin';
$_L['Buy_this_your_active_package_will_be_overwrite'] = 'Buy this? your active package will be overwrite';
$_L['You_already_have_unpaid_transaction_cancel_it_or_pay_it'] = 'You already have unpaid transaction, cancel it or pay it.';
$_L['Transaction_Not_found'] = 'Transaction Not found';
$_L['Cancel_it'] = 'Cancel it?';
$_L['expired'] = 'expired';
$_L['Check_for_Payment'] = 'Check for Payment';
$_L['Transaction_still_unpaid'] = 'Transaction still unpaid.';
$_L['Paid_Date'] = 'Paid Date';
$_L['Transaction_has_been_paid'] = 'Transaction has been paid.';
$_L['PAID'] = 'PAID';
$_L['CANCELED'] = 'CANCELED';
$_L['UNPAID'] = 'UNPAID';
$_L['PAY_NOW'] = 'PAY NOW';
$_L['Buy_Hotspot_Plan'] = 'Buy Hotspot Plan';
$_L['Buy_PPOE_Plan'] = 'Buy PPOE Plan';
$_L['Package'] = 'Package';
$_L['Order_Internet_Package'] = 'Order Internet Package';
$_L['Unknown_Command'] = 'Unknown Command.';
$_L['Checking_payment'] = 'Checking payment';
$_L['Create_Transaction_Success'] = 'Create Transaction Success';
$_L['You_have_unpaid_transaction'] = 'You have unpaid transaction';
$_L['TripayPayment_Channel'] = 'TripayPayment Channel';
$_L['Payment_Channel'] = 'Payment Channel';
$_L['Payment_check_failed'] = 'Payment check failed.';
$_L['Order_Package'] = 'Order Package';
$_L['Transactions'] = 'Transactions';
$_L['Payments'] = 'Payments';
$_L['History'] = 'History';
$_L['Order_History'] = 'Order History';
$_L['Gateway'] = 'Gateway';
$_L['Date_Done'] = 'Date Done';
$_L['Unpaid_Order'] = 'Unpaid Order';
$_L['Payment_Gateway_Not_Found'] = 'Payment Gateway Not Found';
$_L['Payment_Gateway_saved_successfully'] = 'Payment Gateway saved successfully';
$_L['ORDER'] = 'ORDER';
$_L['Package_History'] = 'Package History';
$_L['Buy_History'] = 'Buy History';
$_L['Activation_History'] = 'Activation History';
$_L['Buy_Package'] = 'Buy Package';
$_L['Email'] = 'Email';
$_L['Company_Footer'] = 'Company Footer';
$_L['Will_show_below_user_pages'] = 'Will show below user pages';
$_L['Request_OTP'] = 'Request OTP';
$_L['Verification_Code'] = 'Verification Code';
$_L['SMS_Verification_Code'] = 'SMS Verification Code';
$_L['Please_enter_your_email_address'] = 'Please enter your email address';
$_L['Failed_to_create_Paypal_transaction'] = 'Failed to create Paypal transaction.';
$_L['Plugin'] = 'Plugin';
$_L['Plugin_Manager'] = 'Plugin Manager';
$_L['Plugin_Manager'] = 'Plugin Manager';
$_L['User_Notification'] = 'User Notification';
$_L['Expired_Notification'] = 'Expired Notification';
$_L['User_will_get_notification_when_package_expired'] = 'User will get notification when package expired';
$_L['Expired_Notification_Message'] = 'Expired Notification Message';
$_L['bnameb_will_be_replaced_with_Customer_Name_bpackageb_will_be_replaced_with_Package_name'] = '<b>[[name]]</b> will be replaced with Customer Name. <b>[[package]]</b> will be replaced with Package name.';
$_L['Payment_Notification'] = 'Payment Notification';
$_L['User_will_get_invoice_notification_when_buy_package_or_package_refilled'] = 'User will get invoice notification when buy package or package refilled';

View File

@ -0,0 +1,297 @@
<?php
/*
-----------------------------------
Language Name: Spanish
Contributor: Ing.Luis E. Hernandez
Web: www.phpnuxbill.com
Email: contacto.webland@gmail.com
2022
Contributor: Alucard (@alucard)
------------------------------------
*/
$_L['Login'] = 'Entrar';
$_L['Register'] = 'Registro';
$_L['Announcement'] = 'Anuncio';
$_L['Registration_Info'] = 'Información de registro';
$_L['Register_Voucher_Failed'] = 'Cupón no encontrado, compre el cupón antes de registrarse';
$_L['Register_Success'] = '¡Registro exitoso! Puedes iniciar sesión ahora';
$_L['Sign_In_Member'] = 'Log in to Member Panel';
$_L['Register_Member'] = 'Regístrese como miembro';
$_L['Sign_In_Admin'] = 'Panel de administración';
$_L['Logo'] = 'DIGITAL-RED';
$_L['Username'] = 'Usuario';
$_L['Password'] = 'Contraseña';
$_L['PasswordsNotMatch'] = 'Las contraseñas no coinciden';
$_L['account_already_exist'] = 'La cuenta ya existe';
$_L['Manage'] = 'Administrar';
$_L['Submit'] = 'Enviar';
$_L['Save'] = 'Guardar cambios';
$_L['Cancel'] = 'Cancelar';
$_L['Edit'] = 'Editar';
$_L['Delete'] = 'Eliminar';
$_L['Welcome'] = 'Bienvenido';
$_L['Created_Successfully'] = 'Datos creados con éxito';
$_L['Updated_Successfully'] = 'Datos actualizados con éxito';
$_L['Delete_Successfully'] = 'Datos eliminados con éxito';
$_L['Static_Pages'] = "Páginas estáticas";
$_L['Failed_Save_Page'] = "No se pudo guardar la página, asegúrese de que pueda escribir en las páginas de la carpeta, <i>chmod 664 pages/*.html<i>";
$_L['Success_Save_Page'] = "Guardando el éxito de la página";
$_L['Info_Page'] = "A veces es necesario actualizar 3 veces hasta que cambie el contenido";
$_L['Dashboard'] = 'Dashboard';
$_L['Search_Contact'] = 'Buscar clientes...';
$_L['My_Account'] = 'Mi cuenta';
$_L['My_Profile'] = 'Mi perfil';
$_L['Settings'] = 'Ajustes';
$_L['Edit_Profile'] = 'Editar perfil';
$_L['Change_Password'] = 'Cambia la contraseña';
$_L['Logout'] = 'Cerrar sesión';
$_L['Services'] = 'Servicios';
$_L['Bandwidth_Plans'] = 'Planes de velocidad';
$_L['BW_Name'] = 'Nombre de ancho de banda';
$_L['New_Bandwidth'] = 'Nuevo ancho de banda';
$_L['Edit_Bandwidth'] = 'Editar ancho de banda';
$_L['Add_Bandwidth'] = 'Agregar nuevo ancho de banda';
$_L['Rate_Download'] = 'Tarifa Descarga';
$_L['Rate_Upload'] = 'Tasa de subida';
$_L['BW_already_exist'] = 'El ancho de banda del nombre ya existe';
$_L['Hotspot_Plans'] = 'Planes de Hotspot';
$_L['PPPOE_Plans'] = 'Planes PPPOE';
$_L['Plan_Name'] = 'Nombre';
$_L['New_Plan'] = 'Nuevo plan de servicio';
$_L['Add_Plan'] = 'Agregar plan de servicio';
$_L['Edit_Plan'] = 'Editar plan de servicio';
$_L['Plan_already_exist'] = 'Nombre El plan ya existe';
$_L['Plan_Type'] = 'Tipo de plan';
$_L['Plan_Price'] = 'Precio del plan';
$_L['Limit_Type'] = 'Tipo de límite';
$_L['Unlimited'] = 'Ilimitado';
$_L['Limited'] = 'Limitado';
$_L['Time_Limit'] = 'Límite de tiempo';
$_L['Data_Limit'] = 'Límite de datos';
$_L['Both_Limit'] = 'Ambos Límite';
$_L['Plan_Validity'] = 'Validez del Plan';
$_L['Select_BW'] = 'Seleccionar ancho de banda';
$_L['Shared_Users'] = 'Usuarios compartidos';
$_L['user_type_help'] = 'Elija Ventas de tipo de usuario para deshabilitar el acceso a la Configuración';
$_L['Current_Password'] = 'Contraseña actual';
$_L['New_Password'] = 'Nueva contraseña';
$_L['Administrator'] = 'Administrador';
$_L['Sales'] = 'Ventas';
$_L['Member'] = 'Usuario';
$_L['Confirm_New_Password'] = 'Confirmar nueva contraseña';
$_L['Confirm_Password'] = 'Confirmar contraseña';
$_L['Full_Name'] = 'Nombre completo';
$_L['User_Type'] = 'Tipo de usuario';
$_L['Address'] = 'Dirección';
$_L['Created_On'] = 'Creado en';
$_L['Expires_On'] = 'Expira el';
$_L['Phone_Number'] = 'Número de teléfono';
$_L['User_Delete_Ok'] = 'Usuario eliminado con éxito';
$_L['Full_Administrator'] = 'Administrador completo';
$_L['password_change_help'] = 'Mantener en blanco para no cambiar la contraseña';
$_L['currency_help'] = 'Manténgalo en blanco si no desea mostrar el código de moneda';
$_L['Theme_Style'] = 'Estilo de tema';
$_L['Theme_Color'] = 'Color del tema';
$_L['Default_Language'] = 'Idioma predeterminado';
$_L['Network'] = 'Red';
$_L['Routers'] = 'Routers';
$_L['Pool'] = 'IP Pool';
$_L['New_Router'] = 'Nuevo Router';
$_L['Add_Router'] = 'Agregar Router';
$_L['Edit_Router'] = 'Editar Router';
$_L['Router_Name'] = 'Nombre del Router';
$_L['IP_Address'] = 'Direccion IP';
$_L['Router_Secret'] = 'Contraseña Router';
$_L['Description'] = 'Descripcion';
$_L['Router_already_exist'] = 'El enrutador IP ya existe';
$_L['Pool_Name'] = 'Nombre del Pool';
$_L['Range_IP'] = 'Rango de IP';
$_L['New_Pool'] = 'Nuevo Pool';
$_L['Add_Pool'] = 'Agregar Pool';
$_L['Edit_Pool'] = 'Editar Pool';
$_L['Pool_already_exist'] = 'Nombre del Pool ya existe';
$_L['Prepaid'] = 'Prepago';
$_L['Prepaid_User'] = 'Usuarios prepago';
$_L['Prepaid_Vouchers'] = 'Fichas prepago';
$_L['Refill_Account'] = 'Recargar Ficha';
$_L['Recharge_Account'] = 'Recargar Cuenta';
$_L['Select_Account'] = 'Seleccionar cuenta';
$_L['Service_Plan'] = 'Plan de servicio';
$_L['Recharge'] = 'Recargar';
$_L['Method'] = 'Método';
$_L['account_created_successfully'] = 'Cuenta creada con éxito';
$_L['Database_Status'] = 'Estado de la base de datos';
$_L['Total_Database_Size'] = 'Tamaño total de la base de datos';
$_L['Download_Database_Backup'] = 'Descargar copia de seguridad de la base de datos';
$_L['Table_Name'] = 'Nombre de la tabla';
$_L['Rows'] = 'Filas';
$_L['Size'] = 'Tamaño';
$_L['Customers'] = 'Clientes';
$_L['Add_Contact'] = 'Añadir nuevo contacto';
$_L['Edit_Contact'] = 'Editar contacto';
$_L['List_Contact'] = 'Lista de contactos';
$_L['Manage_Accounts'] = 'Administrar contacto';
$_L['Reports'] = 'Reportes';
$_L['Daily_Report'] = 'Reportes diarios';
$_L['Period_Reports'] = 'Informes del período';
$_L['All_Transactions'] = 'Todas las transacciones';
$_L['Total_Income'] = 'Ingresos totales';
$_L['All_Transactions_at_Date'] = 'Todas las transacciones en la fecha';
$_L['Total_Income'] = 'Ingresos totales';
$_L['Export_for_Print'] = 'Exportar para imprimir';
$_L['Print'] = 'Impresión';
$_L['Export_to_PDF'] = 'Exportar a PDF';
$_L['Click_Here_to_Print'] = 'Haga clic aquí para imprimir';
$_L['You_can_use_html_tag'] = 'Puedes usar la etiqueta html';
$_L['Date_Format'] = 'Formato de fecha';
$_L['Income_Today'] = 'Ingresos hoy';
$_L['Income_This_Month'] = 'Ingresos este mes';
$_L['Users_Active'] = 'Usuarios activos';
$_L['Total_Users'] = 'Total de usuarios';
$_L['Users'] = 'Usuarios';
$_L['Edit_User'] = 'Editar usuario';
$_L['Last_Login'] = 'Último acceso';
$_L['Administrator_Users'] = 'Usuarios administradores';
$_L['Manage_Administrator'] = 'Administrar administrador';
$_L['Add_New_Administrator'] = 'Agregar nuevo administrador';
$_L['Localisation'] = 'Localización';
$_L['Backup_Restore'] = 'Copia de seguridad/restauracion';
$_L['General_Settings'] = 'Configuración general';
$_L['Date'] = 'Fecha';
$_L['Login_Successful'] = 'Inicio de sesión exitoso';
$_L['Failed_Login'] = 'Inicio de sesión fallido';
$_L['Settings_Saved_Successfully'] = 'Configuración guardada con éxito';
$_L['User_Updated_Successfully'] = 'Usuario actualizado con éxito';
$_L['User_Expired_Today'] = 'Usuario vencido, hoy';
$_L['Activity_Log'] = 'Registro de actividades';
$_L['View_Reports'] = 'Ver los informes';
$_L['View_All'] = 'Ver todo';
$_L['Number_of_Vouchers'] = 'Número de Fichas';
$_L['Length_Code'] = 'Longitud de codigo';
$_L['Code_Voucher'] = 'Cupón de Ficha';
$_L['Voucher'] = 'Ficha';
$_L['Voucher_Hotspot'] = 'Ficha Hotspot';
$_L['Status_Voucher'] = 'Estatado de Ficha';
$_L['Add_Voucher'] = 'Agregar Ficha';
$_L['Voucher_Successfully'] = 'Crear Ficha con éxito';
$_L['Generate'] = 'Generar';
$_L['Print_Info'] = 'Imprimir uno al lado del otro, será fácil de cortar';
$_L['From_Date'] = 'Partir de la fecha';
$_L['To_Date'] = 'Hasta la fecha';
$_L['New_Service'] = 'Nuevo servicio';
$_L['Type'] = 'Tipo';
$_L['Finish'] = 'Finalizar';
$_L['App_Name'] = 'Nombre de la aplicación/ Nombre de la empresa';
$_L['App_Name_Help_Text'] = 'Este nombre se mostrará en el título';
$_L['Next'] = 'Siguiente';
$_L['Last'] = 'Atras';
$_L['Timezone'] = 'Zona horaria';
$_L['Decimal_Point'] = 'Punto decimal';
$_L['Thousands_Separator'] = 'Separador de miles';
$_L['Currency_Code'] = 'Código de moneda';
$_L['Order_Voucher'] = 'Comprobante de pedido';
$_L['Voucher_Activation'] = 'Activación de Fichas';
$_L['List_Activated_Voucher'] = 'Lista de Fichas activados';
$_L['Enter_Voucher_Code'] = 'Ingrese el código de la Ficha aquí';
$_L['Private_Message'] = 'Mensaje privado';
$_L['Inbox'] = 'Bandeja de entrada';
$_L['Outbox'] = 'Bandeja de salida';
$_L['Compose'] = 'Componer';
$_L['Send_to'] = 'Enviar a';
$_L['Title'] = 'Título';
$_L['Message'] = 'Mensaje';
$_L['Account_Information'] = 'Información de su cuenta';
$_L['Welcome_Text_User'] = 'Bienvenido a la página de Miembros del Panel, en esta página puede:';
$_L['Welcome_Text_Admin'] = '<b>MIKRO-RED</b> es un punto de acceso de facturación y PPPOE para Mikrotik que utiliza PHP y la API de Mikrotik para comunicarse con el enrutador. Si obtiene más ganancias con esta aplicación, por favor dónenos.<br>Ver proyecto <a href="https://github.com/hotspotbilling/phpnuxbill" target="_blank">aqui</a>';
//update
$_L['Invalid_Username_or_Password'] = 'Usuario o contraseña invalido';
$_L['Do_Not_Access'] = 'Usted no tiene permiso para acceder a esta página';
$_L['Incorrect_Current_Password'] = 'IContraseña actual incorrecta';
$_L['Password_Changed_Successfully'] = 'Contraseña cambiada con éxito, por favor inicie sesión de nuevo';
$_L['All_field_is_required'] = 'Todo el campo es requerido';
$_L['Voucher_Not_Valid'] = 'Ficha no válida';
$_L['Activation_Vouchers_Successfully'] = 'Fichas de activación con éxito';
$_L['Data_Not_Found'] = 'Datos no encontrados';
$_L['Search_by_Username'] = 'Buscar por nombre de usuario';
$_L['Search_by_Name'] = 'Buscar por nombre';
$_L['Search_by_Code'] = 'Búsqueda por código de Ficha';
$_L['Search'] = 'Búsqueda';
$_L['Select_Customer'] = 'Seleccione un cliente';
$_L['Select_Routers'] = 'Seleccionar enrutadores';
$_L['Select_Plans'] = 'Seleccionar planes';
$_L['Select_Pool'] = 'Seleccionar Pool';
$_L['Hrs'] = 'Hrs';
$_L['Mins'] = 'Mins';
$_L['Days'] = 'Dias';
$_L['Months'] = 'Meses';
$_L['Add_Language'] = 'Agregar idioma';
$_L['Name_Lang'] = 'Nombre del lenguaje';
$_L['Folder_Lang'] = 'Nombre de la carpeta';
$_L['Translator'] = 'Traducir';
$_L['Lang_already_exist'] = 'El nombre del idioma ya existe';
$_L['Payment_Gateway'] = 'Payment Gateway';
$_L['Community'] = 'Community';
$_L['1_user_can_be_used_for_many_devices'] = '1 user can be used for many devices?';
$_L['Cannot_be_change_after_saved'] = 'Cannot be change after saved';
$_L['Explain_Coverage_of_router'] = 'Jelaskan Cakupan wilayah hotspot';
$_L['Name_of_Area_that_router_operated'] = 'Nama Lokasi/Wilayah Router beroperasi';
$_L['Payment_Notification_URL_Recurring_Notification_URL_Pay_Account_Notification_URL'] = 'Payment Notification URL, Recurring Notification URL, Pay Account Notification URL';
$_L['Finish_Redirect_URL_Unfinish_Redirect_URL_Error_Redirect_URL'] = 'Finish Redirect URL, Unfinish Redirect URL, Error Redirect URL';
$_L['Status'] = 'Status';
$_L['Plan_Not_found'] = 'Plan Not found';
$_L['Failed_to_create_transaction'] = 'Failed to create transaction.';
$_L['Seller_has_not_yet_setup_Xendit_payment_gateway'] = 'Seller has not yet setup Xendit payment gateway';
$_L['Admin_has_not_yet_setup_Xendit_payment_gateway_please_tell_admin'] = 'Admin has not yet setup Xendit payment gateway, please tell admin';
$_L['Buy_this_your_active_package_will_be_overwrite'] = 'Buy this? your active package will be overwrite';
$_L['You_already_have_unpaid_transaction_cancel_it_or_pay_it'] = 'You already have unpaid transaction, cancel it or pay it.';
$_L['Transaction_Not_found'] = 'Transaction Not found';
$_L['Cancel_it'] = 'Cancel it?';
$_L['expired'] = 'expired';
$_L['Check_for_Payment'] = 'Check for Payment';
$_L['Transaction_still_unpaid'] = 'Transaction still unpaid.';
$_L['Paid_Date'] = 'Paid Date';
$_L['Transaction_has_been_paid'] = 'Transaction has been paid.';
$_L['PAID'] = 'PAID';
$_L['CANCELED'] = 'CANCELED';
$_L['UNPAID'] = 'UNPAID';
$_L['PAY_NOW'] = 'PAY NOW';
$_L['Buy_Hotspot_Plan'] = 'Buy Hotspot Plan';
$_L['Buy_PPOE_Plan'] = 'Buy PPOE Plan';
$_L['Package'] = 'Package';
$_L['Order_Internet_Package'] = 'Order Internet Package';
$_L['Unknown_Command'] = 'Unknown Command.';
$_L['Checking_payment'] = 'Checking payment';
$_L['Create_Transaction_Success'] = 'Create Transaction Success';
$_L['You_have_unpaid_transaction'] = 'You have unpaid transaction';
$_L['TripayPayment_Channel'] = 'TripayPayment Channel';
$_L['Payment_Channel'] = 'Payment Channel';
$_L['Payment_check_failed'] = 'Payment check failed.';
$_L['Order_Package'] = 'Order Package';
$_L['Transactions'] = 'Transactions';
$_L['Payments'] = 'Payments';
$_L['History'] = 'History';
$_L['Order_History'] = 'Order History';
$_L['Gateway'] = 'Gateway';
$_L['Date_Done'] = 'Date Done';
$_L['Unpaid_Order'] = 'Unpaid Order';

View File

@ -3,7 +3,7 @@
-----------------------------------
Language Name: Turkish
Contributor: Goktug Bogac OGEL
Web:
Web:
Email: goktugogel@gmail.com
------------------------------------
*/
@ -16,7 +16,7 @@ $_L['Register_Success'] = 'Kayıt Başarılı! Şimdi giriş yapabilirsiniz ';
$_L['Sign_In_Member'] = 'Üye Paneli\'ne giriş yapın';
$_L['Register_Member'] = 'Üye olarak kayıt ol';
$_L['Sign_In_Admin'] = 'Yönetici Paneli Girişi';
$_L['Logo'] = 'PHPMixBill';
$_L['Logo'] = 'PHPNuxBill';
$_L['Username'] = 'Kullanıcı adı';
$_L['Password'] = 'Parola';
$_L['PasswordsNotMatch'] = 'Parolalar eşleşmiyor';
@ -196,7 +196,7 @@ $_L['Title'] = 'Başlık';
$_L['Message'] = 'Mesaj';
$_L['Account_Information'] = 'Hesap Bilgileriniz';
$_L['Welcome_Text_User'] = 'Panel Üyeleri sayfasına hoş geldiniz, bu sayfada şunları yapabilirsiniz:';
$_L['Welcome_Text_Admin'] = '<b> PHPMixBill </ b>, PHP ve Mikrotik API kullanılarak Mikrotik için bir faturalandırma Hotspot ve PPPOE olup, yönlendiriciyle iletişim kurar. Bu uygulamayla daha fazla kazanç elde ederseniz, lütfen bize bağış yapın. <br> Projeyi <a href="https://github.com/ibnux/phpmixbill" target="_blank"> buradan izleyin </a> ';
$_L['Welcome_Text_Admin'] = '<b> PHPNuxBill </ b>, PHP ve Mikrotik API kullanılarak Mikrotik için bir faturalandırma Hotspot ve PPPOE olup, yönlendiriciyle iletişim kurar. Bu uygulamayla daha fazla kazanç elde ederseniz, lütfen bize bağış yapın. <br> Projeyi <a href="https://github.com/hotspotbilling/phpnuxbill" target="_blank"> buradan izleyin </a> ';
$_L['Invalid_Username_or_Password'] = 'Geçersiz kullanıcı adı veya şifre';
$_L['Do_Not_Access'] = 'Bu sayfaya erişim izniniz yok';
$_L['Incorrect_Current_Password'] = 'Yanlış Geçerli Şifre';
@ -221,4 +221,51 @@ $_L['Add_Language'] = 'Dil Ekle';
$_L['Name_Lang'] = 'Dil adı';
$_L['Folder_Lang'] = 'Klasör adı';
$_L['Translator'] = 'Çevirmen';
$_L['Lang_already_exist'] = 'Dil Adı Zaten Var';
$_L['Lang_already_exist'] = 'Dil Adı Zaten Var';
$_L['Payment_Gateway'] = 'Payment Gateway';
$_L['Community'] = 'Community';
$_L['1_user_can_be_used_for_many_devices'] = '1 user can be used for many devices?';
$_L['Cannot_be_change_after_saved'] = 'Cannot be change after saved';
$_L['Explain_Coverage_of_router'] = 'Jelaskan Cakupan wilayah hotspot';
$_L['Name_of_Area_that_router_operated'] = 'Nama Lokasi/Wilayah Router beroperasi';
$_L['Payment_Notification_URL_Recurring_Notification_URL_Pay_Account_Notification_URL'] = 'Payment Notification URL, Recurring Notification URL, Pay Account Notification URL';
$_L['Finish_Redirect_URL_Unfinish_Redirect_URL_Error_Redirect_URL'] = 'Finish Redirect URL, Unfinish Redirect URL, Error Redirect URL';
$_L['Status'] = 'Status';
$_L['Plan_Not_found'] = 'Plan Not found';
$_L['Failed_to_create_transaction'] = 'Failed to create transaction.';
$_L['Seller_has_not_yet_setup_Xendit_payment_gateway'] = 'Seller has not yet setup Xendit payment gateway';
$_L['Admin_has_not_yet_setup_Xendit_payment_gateway_please_tell_admin'] = 'Admin has not yet setup Xendit payment gateway, please tell admin';
$_L['Buy_this_your_active_package_will_be_overwrite'] = 'Buy this? your active package will be overwrite';
$_L['You_already_have_unpaid_transaction_cancel_it_or_pay_it'] = 'You already have unpaid transaction, cancel it or pay it.';
$_L['Transaction_Not_found'] = 'Transaction Not found';
$_L['Cancel_it'] = 'Cancel it?';
$_L['expired'] = 'expired';
$_L['Check_for_Payment'] = 'Check for Payment';
$_L['Transaction_still_unpaid'] = 'Transaction still unpaid.';
$_L['Paid_Date'] = 'Paid Date';
$_L['Transaction_has_been_paid'] = 'Transaction has been paid.';
$_L['PAID'] = 'PAID';
$_L['CANCELED'] = 'CANCELED';
$_L['UNPAID'] = 'UNPAID';
$_L['PAY_NOW'] = 'PAY NOW';
$_L['Buy_Hotspot_Plan'] = 'Buy Hotspot Plan';
$_L['Buy_PPOE_Plan'] = 'Buy PPOE Plan';
$_L['Package'] = 'Package';
$_L['Order_Internet_Package'] = 'Order Internet Package';
$_L['Unknown_Command'] = 'Unknown Command.';
$_L['Checking_payment'] = 'Checking payment';
$_L['Create_Transaction_Success'] = 'Create Transaction Success';
$_L['You_have_unpaid_transaction'] = 'You have unpaid transaction';
$_L['TripayPayment_Channel'] = 'TripayPayment Channel';
$_L['Payment_Channel'] = 'Payment Channel';
$_L['Payment_check_failed'] = 'Payment check failed.';
$_L['Order_Package'] = 'Order Package';
$_L['Transactions'] = 'Transactions';
$_L['Payments'] = 'Payments';
$_L['History'] = 'History';
$_L['Order_History'] = 'Order History';
$_L['Gateway'] = 'Gateway';
$_L['Date_Done'] = 'Date Done';
$_L['Unpaid_Order'] = 'Unpaid Order';

View File

View File

0
system/plugin/index.html Normal file
View File

View File

26
system/radius.php Normal file
View File

@ -0,0 +1,26 @@
<?php
/**
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
if(php_sapi_name() !== 'cli'){
die("RUN ON COMMAND LINE ONLY BY RADIUS ENGINE");
}
require(__DIR__.'/../config.php');
require(__DIR__.'/orm.php');
use PEAR2\Net\RouterOS;
require_once 'autoload/PEAR2/Autoload.php';
ORM::configure("mysql:host=$db_host;dbname=$db_name");
ORM::configure('username', $db_user);
ORM::configure('password', $db_password);
ORM::configure('return_result_sets', true);
ORM::configure('logging', true);
$result = ORM::for_table('tbl_appconfig')->find_many();
foreach($result as $value){
$config[$value['setting']]=$value['value'];
}
date_default_timezone_set($config['timezone']);

View File

View File

@ -2890,8 +2890,8 @@
0DCF;SINHALA VOWEL SIGN AELA-PILLA;Mc;0;L;;;;;N;;;;;
0DD0;SINHALA VOWEL SIGN KETTI AEDA-PILLA;Mc;0;L;;;;;N;;;;;
0DD1;SINHALA VOWEL SIGN DIGA AEDA-PILLA;Mc;0;L;;;;;N;;;;;
0DD2;SINHALA VOWEL SIGN KETTI IS-PILLA;Mn;0;NSM;;;;;N;;;;;
0DD3;SINHALA VOWEL SIGN DIGA IS-PILLA;Mn;0;NSM;;;;;N;;;;;
0DD2;SINHALA VOWEL SIGN KETTI table-PILLA;Mn;0;NSM;;;;;N;;;;;
0DD3;SINHALA VOWEL SIGN DIGA table-PILLA;Mn;0;NSM;;;;;N;;;;;
0DD4;SINHALA VOWEL SIGN KETTI PAA-PILLA;Mn;0;NSM;;;;;N;;;;;
0DD6;SINHALA VOWEL SIGN DIGA PAA-PILLA;Mn;0;NSM;;;;;N;;;;;
0DD8;SINHALA VOWEL SIGN GAETTA-PILLA;Mc;0;L;;;;;N;;;;;

View File

@ -1,72 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>{$_title} - {$_L['Login']}</title>
<link rel="shortcut icon" href="{$_theme}/images/logo.png" type="image/x-icon" />
<!-- Icons -->
<link rel="stylesheet" href="{$_theme}/fonts/ionicons/css/ionicons.min.css">
<link rel="stylesheet" href="{$_theme}/fonts/font-awesome/css/font-awesome.min.css">
<!-- Plugins -->
<link rel="stylesheet" href="{$_theme}/styles/plugins/waves.css">
<link rel="stylesheet" href="{$_theme}/styles/plugins/perfect-scrollbar.css">
<!-- Css/Less Stylesheets -->
<link rel="stylesheet" href="{$_theme}/styles/bootstrap.min.css">
<link rel="stylesheet" href="{$_theme}/styles/main.min.css">
<!-- <link href='http://fonts.googleapis.com/css?family=Roboto:400,500,700,300' rel='stylesheet' type='text/css'> -->
<!-- Match Media polyfill for IE9 -->
<!--[if IE 9]> <script src="{$_theme}/scripts/ie/matchMedia.js"></script> <![endif]-->
</head>
<body id="app" class="app off-canvas body-full">
<div class="main-container clearfix">
<div class="content-container" id="content">
<div class="page page-auth">
<div class="auth-container">
<div class="form-head mb20">
<h1 class="site-logo h2 mb5 mt5 text-center text-uppercase text-bold">{$_L['Logo']}</h1>
<h5 class="text-normal h5 text-center">{$_L['Sign_In_Admin']}</h5>
</div>
{if isset($notify)}
{$notify}
{/if}
<div class="form-container">
<form class="form-horizontal" action="{$_url}admin/post" method="post">
<div class="md-input-container md-float-label">
<input type="text" name="username" class="md-input">
<label>{$_L['Username']}</label>
</div>
<div class="md-input-container md-float-label">
<input type="password" name="password" class="md-input">
<label>{$_L['Password']}</label>
</div>
<div class="clearfix">
<div class="ui-checkbox ui-checkbox-primary right">
<label>
<input type="checkbox">
<span>Remember me</span>
</label>
</div>
</div>
<div class="btn-group btn-group-justified mb15">
<div class="btn-group">
<button type="submit" class="btn btn-success">{$_L['Login']}</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
<script src="scripts/vendors.js"></script>
</body>
</html>

View File

@ -1,57 +0,0 @@
{include file="sections/header.tpl"}
<div class="row">
<div class="col-sm-12 col-md-12">
<div class="panel panel-default panel-hovered panel-stacked mb30">
<div class="panel-heading">{$_L['General_Settings']}</div>
<div class="panel-body">
<form class="form-horizontal" method="post" role="form" action="{$_url}settings/app-post" >
<div class="form-group">
<label class="col-md-2 control-label">{$_L['App_Name']}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="company" name="company" value="{$_c['CompanyName']}">
<span class="help-block">{$_L['App_Name_Help_Text']}</span>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{$_L['Address']}</label>
<div class="col-md-6">
<textarea class="form-control" id="address" name="address" rows="3">{$_c['address']}</textarea>
<span class="help-block">{$_L['You_can_use_html_tag']}</span>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{$_L['Phone_Number']}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="phone" name="phone" value="{$_c['phone']}">
</div>
</div>
<div class="form-group hidden">
<label class="col-md-2 control-label">Theme</label>
<div class="col-md-6">
<select name="theme" id="theme" class="form-control">
<option value="default" {if $_c['theme'] eq 'default'}selected="selected" {/if}>Default</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">Note Invoice</label>
<div class="col-md-6">
<textarea class="form-control" id="note" name="note" rows="3">{$_c['note']}</textarea>
<span class="help-block">{$_L['You_can_use_html_tag']}</span>
</div>
</div>
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<button class="btn btn-primary waves-effect waves-light" type="submit">{$_L['Save']}</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

View File

@ -1,57 +0,0 @@
{include file="sections/header.tpl"}
<div class="row">
<div class="col-sm-12">
<div class="panel panel-hovered mb20 panel-default">
<div class="panel-heading">{$_L['Bandwidth_Plans']}</div>
<div class="panel-body">
<div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
<div class="col-md-8">
<form id="site-search" method="post" action="{$_url}bandwidth/list/">
<div class="input-group">
<div class="input-group-addon">
<span class="fa fa-search"></span>
</div>
<input type="text" name="name" class="form-control" placeholder="{$_L['Search_by_Name']}...">
<div class="input-group-btn">
<button class="btn btn-success">{$_L['Search']}</button>
</div>
</div>
</form>
</div>
<div class="col-md-4">
<a href="{$_url}bandwidth/add" class="btn btn-primary btn-block waves-effect"><i class="ion ion-android-add"> </i> {$_L['New_Bandwidth']}</a>
</div>&nbsp;
</div>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>{$_L['BW_Name']}</th>
<th>{$_L['Rate_Download']}</th>
<th>{$_L['Rate_Upload']}</th>
<th>{$_L['Manage']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['name_bw']}</td>
<td>{$ds['rate_down']} {$ds['rate_down_unit']}</td>
<td>{$ds['rate_up']} {$ds['rate_up_unit']}</td>
<td>
<a href="{$_url}bandwidth/edit/{$ds['id']}" class="btn btn-sm btn-warning">{$_L['Edit']}</a>
<a href="{$_url}bandwidth/delete/{$ds['id']}" id="{$ds['id']}" class="btn btn-danger btn-sm cdelete">{$_L['Delete']}</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
{$paginator['contents']}
</div>
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

View File

@ -1,60 +0,0 @@
{include file="sections/header.tpl"}
<div class="row">
<div class="col-sm-12">
<div class="panel panel-hovered mb20 panel-default">
<div class="panel-heading">{$_L['Manage_Accounts']}</div>
<div class="panel-body">
<div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
<div class="col-md-8">
<form id="site-search" method="post" action="{$_url}customers/list/">
<div class="input-group">
<div class="input-group-addon">
<span class="fa fa-search"></span>
</div>
<input type="text" name="username" class="form-control" placeholder="{$_L['Search_by_Username']}...">
<div class="input-group-btn">
<button class="btn btn-success">{$_L['Search']}</button>
</div>
</div>
</form>
</div>
<div class="col-md-4">
<a href="{$_url}customers/add" class="btn btn-primary btn-block waves-effect"><i class="ion ion-android-add"> </i> {$_L['Add_Contact']}</a>
</div>&nbsp;
</div>
<table class="table table-bordered table-striped">
<thead>
<tr>
<th>{$_L['Username']}</th>
<th>{$_L['Full_Name']}</th>
<th>{$_L['Phone_Number']}</th>
<th>{$_L['Created_On']}</th>
<th>{$_L['Recharge']}</th>
<th>{$_L['Manage']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td>{$ds['fullname']}</td>
<td>{$ds['phonenumber']}</td>
<td>{$ds['created_at']}</td>
<td align="center"><a href="{$_url}prepaid/recharge-user/{$ds['id']}" id="{$ds['id']}" class="btn btn-primary btn-sm">{$_L['Recharge']}</a></td>
<td align="center">
<a href="{$_url}customers/edit/{$ds['id']}" class="btn btn-warning btn-sm">{$_L['Edit']}</a>
<a href="{$_url}customers/delete/{$ds['id']}" id="{$ds['id']}" class="btn btn-danger btn-sm cdelete">{$_L['Delete']}</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
{$paginator['contents']}
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

View File

@ -1,214 +0,0 @@
{include file="sections/header.tpl"}
{if ($_admin['user_type']) eq 'Admin' || ($_admin['user_type']) eq 'Sales'}
<div class="row hidden">
<div class="col-md-12">
<div class="dash-head clearfix mt15 mb20">
<div class="left">
<h4 class="mb5 text-light">Dashboard</h4>
<p class="small"></p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-3 col-sm-6">
<div class="panel panel-default mb20 mini-box panel-hovered">
<div class="panel-body">
<div class="clearfix">
<div class="info left">
<h4 class="mt0 text-primary text-bold">{$_c['currency_code']} {number_format($iday,0,$_c['dec_point'],$_c['thousands_sep'])}</h4>
<h5 class="text-light mb0">{$_L['Income_Today']}</h5>
</div>
<div class="right ion ion-ios-pricetags-outline icon"></div>
</div>
</div>
<div class="panel-footer clearfix panel-footer-sm panel-footer-primary">
<p class="mt0 mb0 right"><a class="text-putih" href="{$_url}reports/by-date">{$_L['View_Reports']}</a></p>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="panel panel-default mb20 mini-box panel-hovered">
<div class="panel-body">
<div class="clearfix">
<div class="info left">
<h4 class="mt0 text-success text-bold">{$_c['currency_code']} {number_format($imonth,0,$_c['dec_point'],$_c['thousands_sep'])}</h4>
<h5 class="text-light mb0">{$_L['Income_This_Month']}</h5>
</div>
<div class="right ion ion-social-usd icon"></div>
</div>
</div>
<div class="panel-footer clearfix panel-footer-sm panel-footer-success">
<p class="mt0 mb0 right"><a class="text-putih" href="{$_url}reports/by-period">{$_L['View_Reports']}</a></p>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="panel panel-default mb20 mini-box panel-hovered">
<div class="panel-body">
<div class="clearfix">
<div class="info left">
<h4 class="mt0 text-info text-bold">{$u_act}</h4>
<h5 class="text-light mb0">{$_L['Users_Active']}</h5>
</div>
<div class="right ion ion-android-contact icon"></div>
</div>
</div>
<div class="panel-footer clearfix panel-footer-sm panel-footer-info">
<p class="mt0 mb0 right"><a class="text-putih" href="{$_url}prepaid/list">{$_L['View_All']}</a></p>
</div>
</div>
</div>
<div class="col-md-3 col-sm-6">
<div class="panel panel-default mb20 mini-box panel-hovered">
<div class="panel-body">
<div class="clearfix">
<div class="info left">
<h4 class="mt0 text-pink text-bold">{$u_all}</h4>
<h5 class="text-light mb0">{$_L['Total_Users']}</h5>
</div>
<div class="right ion ion-android-contacts icon"></div>
</div>
</div>
<div class="panel-footer clearfix panel-footer-sm panel-footer-pink">
<p class="mt0 mb0 right"><a class="text-putih" href="{$_url}customers/list">{$_L['View_All']}</a></p>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-md-7">
<div class="panel panel-default mb20 panel-hovered project-stats table-responsive">
<div class="panel-heading">Vouchers Stock</div>
<div class="panel-body">
<table class="table">
<thead>
<tr>
<th>{$_L['Plan_Name']}</th>
<th>unused</th>
<th>used</th>
</tr>
</thead>
<tbody>
{foreach $plans as $stok}
<tr>
<td>{$stok['name_plan']}</td>
<td>{$stok['unused']}</td>
<td>{$stok['used']}</td>
</tr>
</tbody>
{/foreach}
<tr>
<td>Total</td>
<td>{$stocks['unused']}</td>
<td>{$stocks['used']}</td>
</tr>
</table>
</div>
</div>
<div class="panel panel-default mb20 panel-hovered project-stats table-responsive">
<div class="panel-heading">{$_L['User_Expired_Today']}</div>
<div class="panel-body">
<table class="table">
<thead>
<tr>
<th>Id</th>
<th>{$_L['Username']}</th>
<th>{$_L['Created_On']}</th>
<th>{$_L['Expires_On']}</th>
</tr>
</thead>
<tbody>
{$no = 1}
{foreach $expire as $expired}
<tr>
<td>{$no++}</td>
<td>{$expired['username']}</td>
<td>{date($_c['date_format'], strtotime($expired['recharged_on']))} {$expired['time']}</td>
<td>{date($_c['date_format'], strtotime($expired['expiration']))} {$expired['time']}</td>
</tr>
</tbody>
{/foreach}
</table>
</div>
</div>
</div>
<div class="col-md-5">
<div class="panel panel-default panel-hovered mb20 activities">
<div class="panel-heading">{$_L['Activity_Log']}</div>
<div class="panel-body">
<ul class="list-unstyled">
{foreach $dlog as $dlogs}
<li class="primary">
<span class="point"></span>
<span class="time small text-muted">{time_elapsed_string($dlogs['date'],true)}</span>
<p>{$dlogs['description']}</p>
</li>
{/foreach}
</ul>
</div>
</div>
<div class="panel panel-default panel-hovered mb20 activities">
<div class="panel-heading">PHPMIXBILL</div>
<div class="panel-body">
{$_L['Welcome_Text_Admin']}
</div>
</div>
</div>
</div>
{else}
<div class="row">
<div class="col-md-12">
<div class="dash-head clearfix mt15 mb20">
<div class="left">
<h4 class="mb5 text-light">{$_L['Welcome']}, {$_user['fullname']}</h4>
<p>{$_L['Welcome_Text_User']}</p>
<ul>
<li> {$_L['Account_Information']}</li>
<li> <a href="{$_url}voucher/activation">{$_L['Voucher_Activation']}</a></li>
<li> <a href="{$_url}voucher/list-activated">{$_L['List_Activated_Voucher']}</a></li>
<li> <a href="{$_url}accounts/change-password">{$_L['Change_Password']}</a></li>
<li> {$_L['Order_Voucher']}</li>
<li> {$_L['Private_Message']}</li>
</ul>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<div class="panel mb20 panel-primary panel-hovered">
<div class="panel-heading">{$_L['Account_Information']}</div>
<div class="panel-body">
<div class="row">
<div class="col-sm-3">
<p class="small text-success text-uppercase text-normal">{$_L['Username']}</p>
<p class="small mb15">{$_bill['username']}</p>
</div>
<div class="col-sm-3">
<p class="small text-primary text-uppercase text-normal">{$_L['Plan_Name']}</p>
<p class="small mb15">{$_bill['namebp']}</p>
</div>
<div class="col-sm-3">
<p class="small text-info text-uppercase text-normal">{$_L['Created_On']}</p>
<p class="small mb15">{date($_c['date_format'], strtotime($_bill['recharged_on']))} {$_bill['time']}</p>
</div>
<div class="col-sm-3">
<p class="small text-danger text-uppercase text-normal">{$_L['Expires_On']}</p>
<p class="small mb15">{date($_c['date_format'], strtotime($_bill['expiration']))} {$_bill['time']}</p>
</div>
</div>
</div>
</div>
</div>
</div>
{/if}
{include file="sections/footer.tpl"}

View File

@ -1,27 +0,0 @@
{include file="sections/header.tpl"}
<div class="row">
<div class="col-sm-12">
<div class="panel panel-hovered mb20 panel-default">
<div class="panel-heading">Public Disquss</div>
<div class="panel-body">
<div id="disqus_thread"></div>
<script>
var disqus_config = function () {
this.page.url = "https://ibnux.github.io/phpmixbill/diskusi.html"; // Replace PAGE_URL with your page's canonical URL variable
this.page.identifier = "phpmixbill"; // Replace PAGE_IDENTIFIER with your page's unique identifier variable
};
(function() { // DON'T EDIT BELOW THIS LINE
var d = document, s = d.createElement('script');
s.src = 'https://phpmixbill.disqus.com/embed.js';
s.setAttribute('data-timestamp', +new Date());
(d.head || d.body).appendChild(s);
})();
</script>
<noscript>Please enable JavaScript to view the <a href="https://disqus.com/?ref_noscript">comments powered by Disqus.</a></noscript>
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

View File

@ -1,120 +0,0 @@
{include file="sections/header.tpl"}
<div class="row">
<div class="col-sm-12 col-md-12">
<div class="panel panel-default panel-hovered panel-stacked mb30">
<div class="panel-heading">{$_L['Add_Plan']}</div>
<div class="panel-body">
<form class="form-horizontal" method="post" role="form" action="{$_url}services/add-post" >
<div class="form-group">
<label class="col-md-2 control-label">{$_L['Plan_Name']}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="name" name="name">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{$_L['Plan_Type']}</label>
<div class="col-md-10">
<input type="radio" id="Unlimited" name="typebp" value="Unlimited" checked> {$_L['Unlimited']}
<input type="radio" id="Limited" name="typebp" value="Limited"> {$_L['Limited']}
</div>
</div>
<div style="display:none;" id="Type">
<div class="form-group">
<label class="col-md-2 control-label">{$_L['Limit_Type']}</label>
<div class="col-md-10">
<input type="radio" id="Time_Limit" name="limit_type" value="Time_Limit" checked> {$_L['Time_Limit']}
<input type="radio" id="Data_Limit" name="limit_type" value="Data_Limit"> {$_L['Data_Limit']}
<input type="radio" id="Both_Limit" name="limit_type" value="Both_Limit"> {$_L['Both_Limit']}
</div>
</div>
</div>
<div style="display:none;" id="TimeLimit">
<div class="form-group">
<label class="col-md-2 control-label">{$_L['Time_Limit']}</label>
<div class="col-md-4">
<input type="text" class="form-control" id="time_limit" name="time_limit" value="0">
</div>
<div class="col-md-2">
<select class="form-control" id="time_unit" name="time_unit">
<option value="Hrs">{$_L['Hrs']}</option>
<option value="Mins">{$_L['Mins']}</option>
</select>
</div>
</div>
</div>
<div style="display:none;" id="DataLimit">
<div class="form-group">
<label class="col-md-2 control-label">{$_L['Data_Limit']}</label>
<div class="col-md-4">
<input type="text" class="form-control" id="data_limit" name="data_limit" value="0">
</div>
<div class="col-md-2">
<select class="form-control" id="data_unit" name="data_unit">
<option value="MB">MBs</option>
<option value="GB">GBs</option>
</select>
</div>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{$_L['BW_Name']}</label>
<div class="col-md-6">
<select id="id_bw" name="id_bw" class="form-control">
<option value="">{$_L['Select_BW']}...</option>
{foreach $d as $ds}
<option value="{$ds['id']}">{$ds['name_bw']}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{$_L['Plan_Price']}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="pricebp" name="pricebp">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{$_L['Shared_Users']}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="sharedusers" name="sharedusers" value="1">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{$_L['Plan_Validity']}</label>
<div class="col-md-4">
<input type="text" class="form-control" id="validity" name="validity">
</div>
<div class="col-md-2">
<select class="form-control" id="validity_unit" name="validity_unit">
<option value="Days">{$_L['Days']}</option>
<option value="Months">{$_L['Months']}</option>
</select>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{$_L['Router_Name']}</label>
<div class="col-md-6">
<select id="routers" name="routers" class="form-control">
{foreach $r as $rs}
<option value="{$rs['name']}">{$rs['name']}</option>
{/foreach}
</select>
</div>
</div>
<div class="form-group">
<div class="col-lg-offset-2 col-lg-10">
<button class="btn btn-success waves-effect waves-light" type="submit">{$_L['Save']}</button>
Or <a href="{$_url}services/hotspot">{$_L['Cancel']}</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

View File

@ -1,67 +0,0 @@
{include file="sections/header.tpl"}
<div class="row">
<div class="col-sm-12">
<div class="panel panel-hovered mb20 panel-default">
<div class="panel-heading">{$_L['Hotspot_Plans']}</div>
<div class="panel-body">
<div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
<div class="col-md-8">
<form id="site-search" method="post" action="{$_url}services/hotspot/">
<div class="input-group">
<div class="input-group-addon">
<span class="fa fa-search"></span>
</div>
<input type="text" name="name" class="form-control" placeholder="{$_L['Search_by_Name']}...">
<div class="input-group-btn">
<button class="btn btn-success">{$_L['Search']}</button>
</div>
</div>
</form>
</div>
<div class="col-md-4">
<a href="{$_url}services/add" class="btn btn-primary btn-block waves-effect"><i class="ion ion-android-add"> </i> {$_L['New_Plan']}</a>
</div>&nbsp;
</div>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>{$_L['Plan_Name']}</th>
<th>{$_L['Plan_Type']}</th>
<th>{$_L['Bandwidth_Plans']}</th>
<th>{$_L['Plan_Price']}</th>
<th>{$_L['Time_Limit']}</th>
<th>{$_L['Data_Limit']}</th>
<th>{$_L['Plan_Validity']}</th>
<th>{$_L['Routers']}</th>
<th>{$_L['Manage']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['name_plan']}</td>
<td>{$ds['typebp']}</td>
<td>{$ds['name_bw']}</td>
<td>{$ds['price']}</td>
<td>{$ds['time_limit']} {$ds['time_unit']}</td>
<td>{$ds['data_limit']} {$ds['data_unit']}</td>
<td>{$ds['validity']} {$ds['validity_unit']}</td>
<td>{$ds['routers']}</td>
<td>
<a href="{$_url}services/edit/{$ds['id']}" class="btn btn-warning btn-sm">{$_L['Edit']}</a>
<a href="{$_url}services/delete/{$ds['id']}" id="{$ds['id']}" class="btn btn-danger btn-sm cdelete">{$_L['Delete']}</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
{$paginator['contents']}
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

View File

@ -1,82 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>{$_title} - {$_L['Login']}</title>
<link rel="shortcut icon" href="{$_theme}/images/logo.png" type="image/x-icon" />
<!-- Css/Less Stylesheets -->
<link rel="stylesheet" href="{$_theme}/styles/bootstrap.min.css">
<link rel="stylesheet" href="{$_theme}/styles/main.min.css">
<!-- <link href='http://fonts.googleapis.com/css?family=Roboto:400,500,700,300' rel='stylesheet' type='text/css'> -->
<!-- Match Media polyfill for IE9 -->
<!--[if IE 9]> <script src="{$_theme}/scripts/ie/matchMedia.js"></script> <![endif]-->
</head>
<body>
<div class="container">
<div class="hidden-xs" style="height:150px"></div>
<div class="form-head mb20">
<h1 class="site-logo h2 mb5 mt5 text-center text-uppercase text-bold" style="text-shadow: 2px 2px 4px #757575;">{$_c['CompanyName']}</h1>
<hr>
</div>
{if isset($notify)}
<div class="row">
<div class="col-md-6 col-md-offset-3">
{$notify}
</div>
</div>
{/if}
<div class="row">
<div class="col-md-4 col-md-offset-2">
<div class="panel panel-default">
<div class="panel-heading">{$_L['Announcement']}</div>
<div class="panel-body" style="height:296px;max-height:296px;overflow:scroll;">
{include file="$_path/../pages/Announcement.html"}
</div>
</div>
</div>
<div class="col-md-4">
<div class="panel panel-default">
<div class="panel-heading">{$_L['Sign_In_Member']}</div>
<div class="panel-body" style="height:296px;max-height:296px;">
<div class="form-container">
<form class="form-horizontal" action="{$_url}login/post" method="post">
<div class="md-input-container md-float-label">
<input type="text" name="username" placeholder="{$_L['Phone_Number']}" class="md-input">
<label>{$_L['Username']}</label>
</div>
<div class="md-input-container md-float-label">
<input type="password" name="password" placeholder="{$_L['Password']}" class="md-input">
<label>{$_L['Password']}</label>
</div>
<div class="clearfix hidden">
<div class="ui-checkbox ui-checkbox-primary right">
<label>
<input type="checkbox">
<span>Remember me</span>
</label>
</div>
</div>
<div class="btn-group btn-group-justified mb15">
<div class="btn-group">
<button type="submit" class="btn btn-primary">{$_L['Login']}</button>
</div>
<div class="btn-group">
<a href="{$_url}register" class="btn btn-success">{$_L['Register']}</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
</div>
</div>
<script src="scripts/vendors.js"></script>
</body>
</html>

Some files were not shown because too many files have changed in this diff Show More