Compare commits

...

51 Commits
5.3 ... 6.0

Author SHA1 Message Date
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
90a08cb731 wrong hash default 2022-04-23 01:24:28 +07:00
5df998874a '/ppp/active/print' 2022-04-23 01:13:17 +07:00
239 changed files with 9868 additions and 6584 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']

1
.gitignore vendored
View File

@ -4,3 +4,4 @@ system/config.php
ui/compiled/*.php
ui/cache/*.php
test.php
pages/

View File

@ -1,83 +1,72 @@
# PHP 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
- Multi Router Mikrotik
- Hotspot & PPPOE
- Easy Installation
- Multi Language
- RADIUS
- 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 | Indonesia
- Xendit.com | Indonesia and Philippine ( Philippine not tested )
- Duitku.com | Indonesia
## Installation
- Rename **pages_template** to **pages**
- make writeable **system** folder or create file **system/config.php** and make it writeable
- make writeable folder **ui/cache/** and **ui/compiled**
- Open webs and run installation
- set cronjobs or scheduller for **system/cron.php**
Radius system need to set radius to use **system/radius.php** you can ask me for paid support.
Installation
----
See [WIKI](https://github.com/ibnux/phpmixbill/wiki/Instalation)
baca [WIKI](https://github.com/ibnux/phpmixbill/wiki/Instalation)
System Requirements
----
## System Requirements
Most current web servers with PHP & MySQL installed will be capable of running PHPMixBill
Minimum Requirements
- Linux or Windows OS
- PHP Version 5.3+
- PHP Version 7.0+
- 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.
## Paid Support
Via Team Viewer maupun Barang dibeli dari saya dan tinggal pakai.
Start from Rp 500.000 or $50
1. Unit Mikrotik Router
2. Raspberry Pi Server (RasPi + Casing + Memory 4GB + Adaptor)
[Telegram](https://t.me/ibnux)
Jasa kurang lebih Rp. 500.000, belum termasuk ongkir dan harga perangkat, Gratis Tanya Jawab via Messenger (Jika lagi senggang).
[Website](https://ibnux.net/layanan)
hubungi ibnux di [Twitter](https://twitter.com/ibnux) atau di [facebook](https://facebook.com/ibnumaksum)
License
----
## 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

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
**/
header('location: ../index.php?_route=admin/');

View File

@ -41,7 +41,7 @@
<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/ibnux/phpmixbill/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
**/
//ini_set('display_errors', 1);
//ini_set('display_startup_errors', 1);
//error_reporting(E_ALL);
require ('system/boot.php');
App::_run();

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
**/
Class Admin{

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
**/
Class App{

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

@ -0,0 +1,43 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
**/
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;
}
}

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

@ -0,0 +1,11 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
**/
class Lang {
public static function T($var) {
return Lang($var);
}
}

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

@ -0,0 +1,386 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
**/
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 = Router::_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']) {
try {
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die("Unable to connect to the router.<br>" . $e->getMessage());
}
$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'])
);
}
}
$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']) {
try {
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die("Unable to connect to the router.<br>" . $e->getMessage());
}
/* 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 = $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();
}
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']) {
try {
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die("Unable to connect to the router.<br>" . $e->getMessage());
}
$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'];
$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']) {
try {
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die("Unable to connect to the router.<br>" . $e->getMessage());
}
$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;
$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();
}
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();
sendWhatsapp($c['username'], "*$_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]");
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
**/
Class Paginator

View File

@ -3,10 +3,6 @@
/**
* 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 Password

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
**/
Class Router{

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
**/
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
**/
Class User{

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
**/
/**

View File

@ -3,10 +3,6 @@
/**
* 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
**/
session_start();
function r2($to, $ntype = 'e', $msg = '')
@ -51,6 +47,7 @@ function _get($param, $defvalue = '')
}
}
require('system/orm.php');
ORM::configure("mysql:host=$db_host;dbname=$db_name");
@ -75,15 +72,16 @@ function _notify($msg, $type = 'e')
}
require_once('system/vendors/smarty/libs/Smarty.class.php');
$_theme = APP_URL . '/ui/theme/' . $config['theme'];
$_theme = APP_URL . '/ui/ui';
$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->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);
@ -179,6 +177,60 @@ 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)
{
global $_c;
if(!empty($_c['telegram_bot']) && !empty($_c['telegram_target_id'])){
file_get_contents('https://api.telegram.org/bot'.$_c['telegram_bot'].'/sendMessage?chat_id='.$_c['telegram_target_id'].'&text=' . urlencode($txt));
}
}
function sendSMS($phone, $txt)
{
global $_c;
if(!empty($_c['sms_url'])){
$smsurl = str_replace('[number]',urlencode($phone),$_c['sms_url']);
$smsurl = str_replace('[text]',urlencode($txt),$smsurl);
file_get_contents($smsurl);
}
}
function sendWhatsapp($phone, $txt)
{
global $_c;
if(!empty($_c['wa_url'])){
$waurl = str_replace('[number]',urlencode($phone),$_c['wa_url']);
$waurl = str_replace('[text]',urlencode($txt),$waurl);
file_get_contents($waurl);
}
}
function time_elapsed_string($datetime, $full = false)
{
$now = new DateTime;
@ -220,5 +272,26 @@ $sys_render = 'system/controllers/' . $handler . '.php';
if (file_exists($sys_render)) {
include($sys_render);
} else {
exit("$sys_render");
header("HTTP/1.0 404 Not Found");
exit("<pre>
___ ___ ___
| | | | | |
|_ | | |_ |
|_|___| |_|
_____ _ _____ _
| | |___| |_ | __|___ _ _ ___ _| |
| | | | . | _| | __| . | | | | . |
|_|___|___|_| |__| |___|___|_|_|___|
_ ______ ____ _____ ____ ____
(_) |_ _ \ |_ \|_ _| |_ _||_ _|
__ | |_) | | \ | | __ _ \ \ / /
[ | | __'. | |\ \| | [ | | | > `' <
| | _| |__) |_| |_\ |_ | \_/ |, _/ /'`\ \_
[___]|_______/|_____|\____|'.__.'_/|____||____|
</pre>");
}

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
**/
_auth();
$ui->assign('_title', $_L['My_Account'].'- '. $config['CompanyName']);
@ -45,10 +40,12 @@ switch ($action) {
if ($c){
$mikrotik = Router::_info($c['routers']);
if($c['type'] == 'Hotspot'){
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":",$mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'],($iport[1])?$iport[1]:null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$printRequest = new RouterOS\Request('/ip/hotspot/user/print');
$printRequest->setArgument('.proplist', '.id');
@ -69,7 +66,7 @@ switch ($action) {
$removeRequest = new RouterOS\Request('/ip/hotspot/active/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
}
$d->password = $npass;
$d->save();
@ -79,10 +76,12 @@ switch ($action) {
r2(U.'login');
}else{
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":",$mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'],($iport[1])?$iport[1]:null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$printRequest = new RouterOS\Request('/ppp/secret/print');
$printRequest->setArgument('.proplist', '.id');
@ -103,7 +102,7 @@ switch ($action) {
$removeRequest = new RouterOS\Request('/ppp/active/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
}
$d->password = $npass;
$d->save();

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
**/
if (isset($routes['1'])) {
$do = $routes['1'];

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
**/
_admin();
$ui->assign('_title', $_L['Network'].' - '. $config['CompanyName']);
@ -25,7 +20,7 @@ switch ($action) {
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');
@ -34,7 +29,7 @@ switch ($action) {
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');

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
**/
_admin();
$ui->assign('_title', $_L['Bandwidth_Plans'].' - '. $config['CompanyName']);

View File

@ -0,0 +1,28 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
**/
_auth();
$ui->assign('_system_menu', 'order');
$action = $routes['1'];
$user = User::_info();
$ui->assign('_user', $user);
require('system/autoload/Paymentgateway.php');
require('system/autoload/Recharge.php');
switch ($action) {
case 'xendit':
echo "done";
break;
case 'midtrans':
echo "done";
break;
case 'tripay':
echo '{"success": true}';
break;
default:
echo "not found";
}

View File

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

View File

@ -1,11 +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
**/
_admin();
$ui->assign('_title', $_L['Customers'] . ' - ' . $config['CompanyName']);
@ -16,9 +13,10 @@ $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'){
if ($admin['user_type'] != 'Admin' and $admin['user_type'] != 'Sales') {
r2(U . "dashboard", 'e', $_L['Do_Not_Access']);
}
@ -63,10 +61,12 @@ switch ($action) {
if ($c) {
$mikrotik = Router::_info($c['routers']);
if ($c['type'] == 'Hotspot') {
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>" . $e->getMessage());
}
$printRequest = new RouterOS\Request('/ip/hotspot/user/print');
$printRequest->setArgument('.proplist', '.id');
@ -86,13 +86,14 @@ switch ($action) {
$removeRequest = new RouterOS\Request('/ip/hotspot/active/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
}
} else {
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>" . $e->getMessage());
}
$printRequest = new RouterOS\Request('/ppp/secret/print');
$printRequest->setArgument('.proplist', '.id');
@ -113,19 +114,24 @@ switch ($action) {
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
}
}
try {
$d->delete();
}catch(Exception $e){}
} catch (Exception $e) {
}
try {
$c->delete();
}catch(Exception $e){}
} catch (Exception $e) {
}
} else {
try {
$d->delete();
}catch(Exception $e){}
} catch (Exception $e) {
}
try {
$c->delete();
}catch(Exception $e){}
} catch (Exception $e) {
}
}
r2(U . 'customers/list', 's', $_L['User_Delete_Ok']);
@ -149,7 +155,6 @@ switch ($action) {
}
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>';
@ -166,7 +171,7 @@ switch ($action) {
$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 {
@ -192,7 +197,6 @@ switch ($action) {
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>';
@ -201,9 +205,7 @@ switch ($action) {
$id = _post('id');
$d = ORM::for_table('tbl_customers')->find_one($id);
if($d){
}else{
if (!$d) {
$msg .= $_L['Data_Not_Found'] . '<br>';
}
@ -219,10 +221,12 @@ switch ($action) {
if ($c) {
$mikrotik = Router::_info($c['routers']);
if ($c['type'] == 'Hotspot') {
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>" . $e->getMessage());
}
$printRequest = new RouterOS\Request('/ip/hotspot/user/print');
$printRequest->setArgument('.proplist', '.id');
@ -243,15 +247,17 @@ switch ($action) {
$removeRequest = new RouterOS\Request('/ip/hotspot/active/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
}
$d->password = $password;
$d->save();
} else {
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>" . $e->getMessage());
}
$printRequest = new RouterOS\Request('/ppp/secret/print');
$printRequest->setArgument('.proplist', '.id');
@ -272,6 +278,7 @@ switch ($action) {
$removeRequest = new RouterOS\Request('/ppp/active/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
}
$d->password = $password;
$d->save();

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
**/
_admin();
$ui->assign('_title', $_L['Dashboard'].' - '. $config['CompanyName']);

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
**/
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,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
**/
_admin();
$ui->assign('_title', $_L['Reports'].'- '. $config['CompanyName']);

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
**/
_auth();
$ui->assign('_title', $_L['Dashboard'] . ' - ' . $config['CompanyName']);
@ -17,4 +13,10 @@ $ui->assign('_user', $user);
$bill = User::_billing();
$ui->assign('_bill', $bill);
$ui->assign('unpaid', ORM::for_table('tbl_payment_gateway')
->where('username', $user['username'])
->where('status', 1)
->find_one());
$ui->display('user-dashboard.tpl');

View File

@ -1,11 +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
**/
if (isset($routes['1'])) {
@ -18,7 +15,7 @@ switch($do){
case 'post':
$username = _post('username');
$password = _post('password');
if($username != '' AND $password != ''){
if ($username != '' and $password != '') {
$d = ORM::for_table('tbl_customers')->where('username', $username)->find_one();
if ($d) {
$d_pass = $d['password'];
@ -52,4 +49,3 @@ switch($do){
$ui->display('login.tpl');
break;
}

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
**/
if (session_status() == PHP_SESSION_NONE) session_start();
session_destroy();

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
**/
_admin();
$ui->assign('_title', $_L['Private_Message'].'- '. $config['CompanyName']);

View File

@ -0,0 +1,159 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
**/
_auth();
$ui->assign('_system_menu', 'order');
$action = $routes['1'];
$user = User::_info();
$ui->assign('_user', $user);
switch ($action) {
case 'voucher':
$ui->assign('_title', $_L['Order_Voucher'] . ' - ' . $config['CompanyName']);
$ui->display('user-order.tpl');
break;
case 'history':
$d = ORM::for_table('tbl_payment_gateway')
->where('username', $user['username'])
->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') . ' - ' . $config['CompanyName']);
$ui->display('user-orderHistory.tpl');
break;
case 'package':
$ui->assign('_title', 'Order PPOE Internet - ' . $config['CompanyName']);
$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);
$ui->display('user-orderPackage.tpl');
break;
case 'unpaid':
$d = ORM::for_table('tbl_payment_gateway')
->where('username', $user['username'])
->where('status', 1)
->find_one();
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);
// 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"));
}
include 'system/paymentgateway/' . $trx['gateway'] . '.php';
call_user_func($trx['gateway'] . '_validate_config');
call_user_func($_c['payment_gateway'] . '_get_status', $trx, $user);
} else if ($routes['3'] == 'cancel') {
$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 . ' - ' . $config['CompanyName']);
$ui->display('user-orderView.tpl');
break;
case 'buy':
if ($_c['payment_gateway'] == 'none') {
r2(U . 'home', 'e', Lang::T("No Payment Gateway Available"));
}
if (!file_exists('system/paymentgateway/' . $_c['payment_gateway'] . '.php')) {
r2(U . 'home', 'e', Lang::T("No Payment Gateway Available"));
}
include 'system/paymentgateway/' . $_c['payment_gateway'] . '.php';
call_user_func($_c['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 ($_c['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 = $_c['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 = $_c['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($_c['payment_gateway'] . '_create_transaction', $d, $user);
}
break;
default:
$ui->display('404.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
**/
_auth();
$ui->assign('_title', $_L['Order_Voucher'].'- '. $config['CompanyName']);

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
**/
_admin();
$ui->assign('_title', 'Pages - '. $config['CompanyName']);

View File

@ -0,0 +1,55 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
**/
_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 - '. $config['CompanyName']);
$ui->assign('pgs', $pgs);
$ui->display('paymentgateway.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
**/
_auth();
$ui->assign('_title', $_L['Private_Message'].'- '. $config['CompanyName']);

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
**/
_admin();
$ui->assign('_title', $_L['Network'].' - '. $config['CompanyName']);
@ -64,10 +59,12 @@ switch ($action) {
$d = ORM::for_table('tbl_pool')->find_one($id);
$mikrotik = Router::_info($d['routers']);
if($d){
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":",$mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'],($iport[1])?$iport[1]:null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$printRequest = new RouterOS\Request(
'/ip pool print .proplist=name',
@ -79,6 +76,7 @@ switch ($action) {
$client($removeRequest
->setArgument('numbers', $poolName)
);
}
$d->delete();
@ -105,16 +103,19 @@ switch ($action) {
}
$mikrotik = Router::_info($routers);
if($msg == ''){
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":",$mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'],($iport[1])?$iport[1]:null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$addRequest = new RouterOS\Request('/ip/pool/add');
$client->sendSync($addRequest
->setArgument('name', $name)
->setArgument('ranges', $ip_address)
);
}
$b = ORM::for_table('tbl_pool')->create();
$b->pool_name = $name;
@ -152,10 +153,12 @@ switch ($action) {
$mikrotik = Router::_info($routers);
if($msg == ''){
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":",$mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'],($iport[1])?$iport[1]:null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$printRequest = new RouterOS\Request(
'/ip pool print .proplist=name',
@ -168,6 +171,7 @@ switch ($action) {
->setArgument('numbers', $poolName)
->setArgument('ranges', $ip_address)
);
}
$d->pool_name = $name;
$d->range_ip = $ip_address;

View File

@ -43,9 +43,9 @@ switch ($action) {
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);
$ui->display('recharge.tpl');
@ -57,9 +57,9 @@ 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);
$ui->display('recharge-user.tpl');
@ -82,18 +82,32 @@ 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")));
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 ($type == 'Hotspot') {
if ($b) {
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$printRequest = new RouterOS\Request(
@ -162,6 +176,7 @@ switch ($action) {
->setArgument('password', $c['password'])
);
}
}
$b->customer_id = $id_customer;
$b->username = $c['username'];
@ -190,10 +205,12 @@ switch ($action) {
$t->type = "Hotspot";
$t->save();
} else {
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
/* iBNuX Added:
@ -252,6 +269,7 @@ switch ($action) {
->setArgument('password', $c['password'])
);
}
}
$d = ORM::for_table('tbl_user_recharges')->create();
$d->customer_id = $id_customer;
@ -281,13 +299,18 @@ switch ($action) {
$t->type = "Hotspot";
$t->save();
}
sendTelegram( "$admin[fullname] #Recharge Voucher #Hotspot for #u$c[username]\n".$p['name_plan'].
"\nRouter: ".$server.
"\nPrice: ".$p['price']);
} else {
if ($b) {
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$printRequest = new RouterOS\Request(
'/ppp secret print .proplist=name',
@ -309,6 +332,7 @@ switch ($action) {
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
}
$b->customer_id = $id_customer;
$b->username = $c['username'];
@ -337,10 +361,12 @@ switch ($action) {
$t->type = "PPPOE";
$t->save();
} else {
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$addRequest = new RouterOS\Request('/ppp/secret/add');
$client->sendSync(
@ -350,6 +376,7 @@ switch ($action) {
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
}
$d = ORM::for_table('tbl_user_recharges')->create();
$d->customer_id = $id_customer;
@ -379,10 +406,33 @@ switch ($action) {
$t->type = "PPPOE";
$t->save();
}
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);
sendWhatsapp($c['username'], "*$_c[CompanyName]*\n".
"$_c[address]\n".
"$_c[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] : *$_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]");
$ui->assign('date', $date_now);
$ui->display('invoice.tpl');
} else {
@ -407,7 +457,7 @@ switch ($action) {
$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);
$ui->display('prepaid-edit.tpl');
@ -423,10 +473,12 @@ switch ($action) {
$mikrotik = Router::_info($d['routers']);
if ($d) {
if ($d['type'] == 'Hotspot') {
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$printRequest = new RouterOS\Request(
'/ip hotspot user print .proplist=name',
@ -438,13 +490,16 @@ switch ($action) {
$removeRequest
->setArgument('numbers', $userName)
);
}
$d->delete();
} else {
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$printRequest = new RouterOS\Request(
'/ppp secret print .proplist=name',
@ -457,6 +512,7 @@ switch ($action) {
$removeRequest
->setArgument('numbers', $userName)
);
}
$d->delete();
}
r2(U . 'prepaid/list', 's', $_L['Delete_Successfully']);
@ -496,7 +552,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 +560,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();
@ -519,9 +575,9 @@ 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);
$ui->display('voucher-add.tpl');
@ -676,15 +732,30 @@ switch ($action) {
$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($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 ($v1) {
if ($v1['type'] == 'Hotspot') {
if ($b) {
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$printRequest = new RouterOS\Request(
'/ip hotspot user print .proplist=name',
@ -752,6 +823,7 @@ switch ($action) {
->setArgument('password', $c['password'])
);
}
}
$b->customer_id = $user;
$b->username = $c['username'];
@ -780,10 +852,12 @@ switch ($action) {
$t->type = "Hotspot";
$t->save();
} else {
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
/* iBNuX Added:
* Time limit to Mikrotik
@ -841,6 +915,7 @@ switch ($action) {
->setArgument('password', $c['password'])
);
}
}
$d = ORM::for_table('tbl_user_recharges')->create();
$d->customer_id = $user;
@ -874,12 +949,19 @@ switch ($action) {
$v1->status = "1";
$v1->user = $c['username'];
$v1->save();
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) {
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$printRequest = new RouterOS\Request(
'/ppp secret print .proplist=name',
@ -901,6 +983,7 @@ switch ($action) {
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
}
$b->customer_id = $user;
$b->username = $c['username'];
@ -929,10 +1012,12 @@ switch ($action) {
$t->type = "PPPOE";
$t->save();
} else {
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$addRequest = new RouterOS\Request('/ppp/secret/add');
$client->sendSync(
@ -942,6 +1027,7 @@ switch ($action) {
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
);
}
$d = ORM::for_table('tbl_user_recharges')->create();
$d->customer_id = $user;
@ -975,10 +1061,35 @@ switch ($action) {
$v1->status = "1";
$v1->user = $c['username'];
$v1->save();
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);
sendWhatsapp($c['username'], "*$_c[CompanyName]*\n".
"$_c[address]\n".
"$_c[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] : *$_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]");
$ui->assign('date', $date_now);
$ui->display('invoice.tpl');
} else {

View File

@ -1,4 +1,5 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
* @copyright Copyright (C) 2014-2015 PHP Mikrotik Billing
@ -12,21 +13,22 @@ if (isset($routes['1'])) {
} else {
$do = 'register-display';
}
use PEAR2\Net\RouterOS;
require_once 'system/autoload/PEAR2/Autoload.php';
$otpPath = 'system/uploads/sms/';
switch ($do) {
case 'post':
$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){
$phonenumber = _post('username');
$msg = '';
if (Validator::Length($username, 35, 2) == false) {
$msg .= 'Username should be between 3 to 55 characters' . '<br>';
@ -36,12 +38,37 @@ switch($do){
}
if (!Validator::Length($password, 35, 2)) {
$msg .= 'Password should be between 3 to 35 characters' . '<br>';
}
if ($password != $cpassword) {
$msg .= $_L['PasswordsNotMatch'] . '<br>';
}
if(!empty($_c['sms_url'])){
$otpPath .= sha1($username.$db_password).".txt";
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>';
@ -55,155 +82,6 @@ switch($do){
$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);
@ -215,9 +93,8 @@ switch($do){
<span aria-hidden="true">×</span>
</button>
<div>Failed to register</div></div>');
$ui->display('register.tpl');
r2(U . 'register', 's', 'Failed to register');
}
//r2(U . 'register', 's', $_L['account_created_successfully']);
} else {
$ui->assign('username', $username);
$ui->assign('fullname', $fullname);
@ -230,52 +107,50 @@ switch($do){
<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');
}*/
break;
default:
if(!empty($_c['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);
sendSMS($username,$_c['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{
$ui->display('register-rotp.tpl');
}
}else{
$ui->assign('username', "");
$ui->assign('fullname', "");
$ui->assign('address', "");
$ui->assign('phonenumber', "");
$ui->assign('otp', false);
$ui->display('register.tpl');
}
break;
}

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
**/
_admin();
$ui->assign('_title', $_L['Reports'].' - '. $config['CompanyName']);

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
**/
_admin();
$ui->assign('_title', $_L['Network'].' - '. $config['CompanyName']);
@ -15,6 +10,10 @@ $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']);
}
@ -70,6 +69,7 @@ switch ($action) {
$username = _post('username');
$password = _post('password');
$description = _post('description');
$enabled = _post('enabled')*1;
$msg = '';
if(Validator::Length($name,30,4) == false){
@ -84,6 +84,15 @@ switch ($action) {
$msg .= $_L['Router_already_exist']. '<br>';
}
if(!$_c['radius_mode']){
try {
$iport = explode(":", $ip_address);
$client = new RouterOS\Client($iport[0], $username, $password, ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
$msg .= "Unable to connect to the router.<br>".$e->getMessage().'<br>';
}
}
if($msg == ''){
$d = ORM::for_table('tbl_routers')->create();
$d->name = $name;
@ -91,6 +100,7 @@ switch ($action) {
$d->username = $username;
$d->password = $password;
$d->description = $description;
$d->enabled = $enabled;
$d->save();
r2(U . 'routers/list', 's', $_L['Created_Successfully']);
@ -106,7 +116,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,11 +134,30 @@ 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(!$_c['radius_mode']){
try {
$iport = explode(":", $ip_address);
$client = new RouterOS\Client($iport[0], $username, $password, ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
$msg .= "Unable to connect to the router.<br>".$e->getMessage().'<br>';
}
}
if($msg == ''){
$d->name = $name;
@ -136,7 +165,28 @@ switch ($action) {
$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,11 +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
**/
_admin();
$ui->assign('_title', $_L['Hotspot_Plans'] . ' - ' . $config['CompanyName']);
@ -15,11 +12,12 @@ $action = $routes['1'];
$admin = Admin::_info();
$ui->assign('_admin', $admin);
if($admin['user_type'] != 'Admin' AND $admin['user_type'] != 'Sales'){
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) {
@ -70,11 +68,13 @@ switch ($action) {
$d = ORM::for_table('tbl_plans')->find_one($id);
if ($d) {
if(!$_c['radius_mode']){
$mikrotik = Router::_info($d['routers']);
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$printRequest = new RouterOS\Request(
'/ip hotspot user profile print .proplist=name',
@ -83,9 +83,11 @@ switch ($action) {
$profileName = $client->sendSync($printRequest)->getProperty('name');
$removeRequest = new RouterOS\Request('/ip/hotspot/user/profile/remove');
$client($removeRequest
$client(
$removeRequest
->setArgument('numbers', $profileName)
);
}
$d->delete();
@ -107,6 +109,7 @@ switch ($action) {
$validity = _post('validity');
$validity_unit = _post('validity_unit');
$routers = _post('routers');
$enabled = _post('enabled')*1;
$msg = '';
if (Validator::UnsignedNumber($validity) == false) {
@ -115,7 +118,7 @@ switch ($action) {
if (Validator::UnsignedNumber($price) == false) {
$msg .= 'The price must be a number' . '<br>';
}
if ($name == '' OR $id_bw == '' OR $price == '' OR $validity == '' OR $routers == ''){
if ($name == '' or $id_bw == '' or $price == '' or $validity == '' or $routers == '') {
$msg .= $_L['All_field_is_required'] . '<br>';
}
@ -126,22 +129,34 @@ switch ($action) {
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'; }
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(!$_c['radius_mode']){
$mikrotik = Router::_info($routers);
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$addRequest = new RouterOS\Request('/ip/hotspot/user/profile/add');
$client->sendSync($addRequest
$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;
@ -158,6 +173,7 @@ switch ($action) {
$d->validity_unit = $validity_unit;
$d->shared_users = $sharedusers;
$d->routers = $routers;
$d->enabled = $enabled;
$d->save();
r2(U . 'services/hotspot', 's', $_L['Created_Successfully']);
@ -182,6 +198,7 @@ switch ($action) {
$validity = _post('validity');
$validity_unit = _post('validity_unit');
$routers = _post('routers');
$enabled = _post('enabled')*1;
$msg = '';
if (Validator::UnsignedNumber($validity) == false) {
@ -190,7 +207,7 @@ switch ($action) {
if (Validator::UnsignedNumber($price) == false) {
$msg .= 'The price must be a number' . '<br>';
}
if ($name == '' OR $id_bw == '' OR $price == '' OR $validity == '' OR $routers == ''){
if ($name == '' or $id_bw == '' or $price == '' or $validity == '' or $routers == '') {
$msg .= $_L['All_field_is_required'] . '<br>';
}
@ -202,15 +219,25 @@ switch ($action) {
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'; }
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(!$_c['radius_mode']){
$mikrotik = Router::_info($routers);
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$printRequest = new RouterOS\Request(
'/ip hotspot user profile print .proplist=name',
@ -219,11 +246,13 @@ switch ($action) {
$profileName = $client->sendSync($printRequest)->getProperty('name');
$setRequest = new RouterOS\Request('/ip/hotspot/user/profile/set');
$client($setRequest
$client(
$setRequest
->setArgument('numbers', $profileName)
->setArgument('shared-users', $sharedusers)
->setArgument('rate-limit', $rate)
);
}
$d->name_plan = $name;
$d->id_bw = $id_bw;
@ -238,6 +267,7 @@ switch ($action) {
$d->validity_unit = $validity_unit;
$d->shared_users = $sharedusers;
$d->routers = $routers;
$d->enabled = $enabled;
$d->save();
r2(U . 'services/hotspot', 's', $_L['Updated_Successfully']);
@ -297,11 +327,13 @@ switch ($action) {
$d = ORM::for_table('tbl_plans')->find_one($id);
if ($d) {
if(!$_c['radius_mode']){
$mikrotik = Router::_info($d['routers']);
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$printRequest = new RouterOS\Request(
'/ppp profile print .proplist=name',
@ -310,10 +342,11 @@ switch ($action) {
$profileName = $client->sendSync($printRequest)->getProperty('name');
$removeRequest = new RouterOS\Request('/ppp/profile/remove');
$client($removeRequest
$client(
$removeRequest
->setArgument('numbers', $profileName)
);
}
$d->delete();
r2(U . 'services/pppoe', 's', $_L['Delete_Successfully']);
@ -328,6 +361,7 @@ switch ($action) {
$validity_unit = _post('validity_unit');
$routers = _post('routers');
$pool = _post('pool_name');
$enabled = _post('enabled')*1;
$msg = '';
if (Validator::UnsignedNumber($validity) == false) {
@ -336,7 +370,7 @@ switch ($action) {
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 == ''){
if ($name == '' or $id_bw == '' or $price == '' or $validity == '' or $routers == '' or $pool == '') {
$msg .= $_L['All_field_is_required'] . '<br>';
}
@ -347,23 +381,35 @@ switch ($action) {
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'; }
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(!$_c['radius_mode']){
$mikrotik = Router::_info($routers);
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$addRequest = new RouterOS\Request('/ppp/profile/add');
$client->sendSync($addRequest
$client->sendSync(
$addRequest
->setArgument('name', $name)
->setArgument('local-address', $pool)
->setArgument('remote-address', $pool)
->setArgument('rate-limit', $rate)
);
}
$d = ORM::for_table('tbl_plans')->create();
$d->type = 'PPPOE';
@ -374,6 +420,7 @@ switch ($action) {
$d->validity_unit = $validity_unit;
$d->routers = $routers;
$d->pool = $pool;
$d->enabled = $enabled;
$d->save();
r2(U . 'services/pppoe', 's', $_L['Created_Successfully']);
@ -391,6 +438,7 @@ switch ($action) {
$validity_unit = _post('validity_unit');
$routers = _post('routers');
$pool = _post('pool_name');
$enabled = _post('enabled')*1;
$msg = '';
if (Validator::UnsignedNumber($validity) == false) {
@ -399,7 +447,7 @@ switch ($action) {
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 == ''){
if ($name == '' or $id_bw == '' or $price == '' or $validity == '' or $routers == '' or $pool == '') {
$msg .= $_L['All_field_is_required'] . '<br>';
}
@ -411,15 +459,25 @@ switch ($action) {
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'; }
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(!$_c['radius_mode']){
$mikrotik = Router::_info($routers);
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$printRequest = new RouterOS\Request(
'/ppp profile print .proplist=name',
@ -428,12 +486,14 @@ switch ($action) {
$profileName = $client->sendSync($printRequest)->getProperty('name');
$setRequest = new RouterOS\Request('/ppp/profile/set');
$client($setRequest
$client(
$setRequest
->setArgument('numbers', $profileName)
->setArgument('local-address', $pool)
->setArgument('remote-address', $pool)
->setArgument('rate-limit', $rate)
);
}
$d->name_plan = $name;
$d->id_bw = $id_bw;
@ -442,6 +502,7 @@ switch ($action) {
$d->validity_unit = $validity_unit;
$d->routers = $routers;
$d->pool = $pool;
$d->enabled = $enabled;
$d->save();
r2(U . 'services/pppoe', 's', $_L['Updated_Successfully']);

View File

@ -3,10 +3,6 @@
/**
* 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['Settings'] . '- ' . $config['CompanyName']);
@ -204,9 +200,14 @@ switch ($action) {
case 'app-post':
$company = _post('company');
$theme = _post('theme');
$telegram_bot = _post('telegram_bot');
$telegram_target_id = _post('telegram_target_id');
$sms_url = _post('sms_url');
$wa_url = _post('wa_url');
$address = _post('address');
if ($company == '' or $theme == '' or $address == '') {
$tawkto = _post('tawkto');
$radius_mode = _post('radius_mode')*1;
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 +223,72 @@ switch ($action) {
$d->value = $phone;
$d->save();
$d = ORM::for_table('tbl_appconfig')->where('setting', 'theme')->find_one();
$d->value = $theme;
$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', '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();

View File

@ -1,11 +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
**/
_auth();
$ui->assign('_title', $_L['Voucher'] . '- ' . $config['CompanyName']);
@ -16,6 +13,7 @@ $user = User::_info();
$ui->assign('_user', $user);
use PEAR2\Net\RouterOS;
require_once 'system/autoload/PEAR2/Autoload.php';
switch ($action) {
@ -38,15 +36,28 @@ switch ($action) {
$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($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 ($v1) {
if ($v1['type'] == 'Hotspot') {
if ($b) {
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$printRequest = new RouterOS\Request('/ip/hotspot/user/print');
$printRequest->setArgument('.proplist', '.id');
@ -68,7 +79,8 @@ switch ($action) {
$timelimit = $p['time_limit'] . ":00:00";
else
$timelimit = "00:" . $p['time_limit'] . ":00";
$client->sendSync($addRequest
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
@ -79,7 +91,8 @@ switch ($action) {
$datalimit = $p['data_limit'] . "000000000";
else
$datalimit = $p['data_limit'] . "000000";
$client->sendSync($addRequest
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
@ -94,7 +107,8 @@ switch ($action) {
$datalimit = $p['data_limit'] . "000000000";
else
$datalimit = $p['data_limit'] . "000000";
$client->sendSync($addRequest
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
@ -103,13 +117,14 @@ switch ($action) {
);
}
} else {
$client->sendSync($addRequest
$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'];
@ -136,12 +151,13 @@ switch ($action) {
$t->routers = $v1['routers'];
$t->type = "Hotspot";
$t->save();
} else {
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
/* iBNuX Added:
* Time limit to Mikrotik
@ -154,7 +170,8 @@ switch ($action) {
$timelimit = $p['time_limit'] . ":00:00";
else
$timelimit = "00:" . $p['time_limit'] . ":00";
$client->sendSync($addRequest
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
@ -165,7 +182,8 @@ switch ($action) {
$datalimit = $p['data_limit'] . "000000000";
else
$datalimit = $p['data_limit'] . "000000";
$client->sendSync($addRequest
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
@ -180,7 +198,8 @@ switch ($action) {
$datalimit = $p['data_limit'] . "000000000";
else
$datalimit = $p['data_limit'] . "000000";
$client->sendSync($addRequest
$client->sendSync(
$addRequest
->setArgument('name', $c['username'])
->setArgument('profile', $p['name_plan'])
->setArgument('password', $c['password'])
@ -189,12 +208,14 @@ switch ($action) {
);
}
} else {
$client->sendSync($addRequest
$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'];
@ -223,19 +244,24 @@ switch ($action) {
$t->routers = $v1['routers'];
$t->type = "Hotspot";
$t->save();
}
$v1->status = "1";
$v1->user = $c['username'];
$v1->save();
// Telegram to Admin
sendTelegram( '#u'.$c['username']." Activate #Voucher #Hotspot\n".$p['name_plan'].
"\nCode: ".$code.
"\nRouter: ".$v1['routers'].
"\nPrice: ".$p['price']);
} else {
if ($b) {
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$printRequest = new RouterOS\Request('/ppp/secret/print');
$printRequest->setArgument('.proplist', '.id');
@ -247,12 +273,14 @@ switch ($action) {
$client->sendSync($setRequest);
$addRequest = new RouterOS\Request('/ppp/secret/add');
$client->sendSync($addRequest
$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'];
@ -280,20 +308,23 @@ switch ($action) {
$t->routers = $v1['routers'];
$t->type = "PPPOE";
$t->save();
} else {
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
$iport = explode(":", $mikrotik['ip_address']);
$client = new RouterOS\Client($iport[0], $mikrotik['username'], $mikrotik['password'], ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$addRequest = new RouterOS\Request('/ppp/secret/add');
$client->sendSync($addRequest
$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'];
@ -327,6 +358,11 @@ switch ($action) {
$v1->status = "1";
$v1->user = $c['username'];
$v1->save();
// Telegram to Admin
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']);

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
**/
require('config.php');
@ -39,10 +34,12 @@ foreach ($d as $ds){
$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();
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($m['ip_address'], $m['username'], $m['password']);
$iport = explode(":",$m['ip_address']);
$client = new RouterOS\Client($iport[0], $m['username'], $m['password'],($iport[1])?$iport[1]:null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$printRequest = new RouterOS\Request('/ip/hotspot/user/print');
@ -64,12 +61,12 @@ foreach ($d as $ds){
$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 echo " : ACTIVE \r\n";
}else{
$date_now = strtotime(date("Y-m-d H:i:s"));
$expiration = strtotime($ds['expiration'].' '.$ds['time']);
@ -80,10 +77,12 @@ foreach ($d as $ds){
$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();
if(!$_c['radius_mode']){
try {
$client = new RouterOS\Client($m['ip_address'], $m['username'], $m['password']);
$iport = explode(":",$m['ip_address']);
$client = new RouterOS\Client($iport[0], $m['username'], $m['password'],($iport[1])?$iport[1]:null);
} catch (Exception $e) {
die('Unable to connect to the router.');
die("Unable to connect to the router.<br>".$e->getMessage());
}
$printRequest = new RouterOS\Request('/ppp/secret/print');
$printRequest->setArgument('.proplist', '.id');
@ -95,7 +94,7 @@ foreach ($d as $ds){
$client->sendSync($setRequest);
//remove hotspot active
$onlineRequest = new RouterOS\Request('/ppp/secret/print');
$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');
@ -103,12 +102,10 @@ foreach ($d as $ds){
$removeRequest = new RouterOS\Request('/ppp/active/remove');
$removeRequest->setArgument('numbers', $id);
$client->sendSync($removeRequest);
}
$u->status = 'off';
$u->save();
}else
echo " : ACTIVE \r\n";
}else echo " : ACTIVE \r\n";
}
}
?>

View File

@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>PHPMixBill Installer</title>
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.png">
@ -55,5 +56,5 @@
</div>
<div class="footer">Copyright &copy; 2021 PHPMixBill. All Rights Reserved<br /><br /></div>
</body>
</html>
</html>

View File

@ -1,42 +1,34 @@
--
-- Database: `phpmixbill`
--
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_appconfig`
--
DROP TABLE IF EXISTS `tbl_appconfig`;
CREATE TABLE `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` (
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,
@ -44,60 +36,72 @@ CREATE TABLE `tbl_bandwidth` (
`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` (
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`
--
DROP TABLE IF EXISTS `tbl_language`;
CREATE TABLE `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
`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;
--
-- 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` (
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,
`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 COLLATE utf8mb4_general_ci 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`
--
DROP TABLE IF EXISTS `tbl_message`;
CREATE TABLE `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,
@ -106,77 +110,138 @@ CREATE TABLE `tbl_message` (
`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`
--
DROP TABLE IF EXISTS `tbl_plans`;
CREATE TABLE `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,
`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,
`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
`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`
--
DROP TABLE IF EXISTS `tbl_pool`;
CREATE TABLE `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
`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`
--
DROP TABLE IF EXISTS `tbl_routers`;
CREATE TABLE `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
`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`
--
DROP TABLE IF EXISTS `tbl_transactions`;
CREATE TABLE `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,
`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` 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
`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`
--
DROP TABLE IF EXISTS `tbl_users`;
CREATE TABLE `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 '',
@ -186,9 +251,316 @@ CREATE TABLE `tbl_users` (
`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', 'PHPMixBill'), (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`,
@ -200,239 +572,48 @@ INSERT INTO
`last_login`,
`creationdate`
)
VALUES
(
VALUES (
1,
'admin',
'Administrator',
'YWRtaW46ODNlNDA2MGUtNzhlMS00ZmU1LTk5NzctYWVlY2NkNDZhMmI4',
'd033e22ae348aeb5660fc2140aec35850c4da997',
'Admin',
'Active',
'2015-10-30 18:27:02',
'2022-09-06 16:09:50',
'2014-06-23 01:43:07'
);
-- --------------------------------------------------------
--
-- Struktur dari tabel `tbl_user_recharges`
-- Dumping data untuk tabel `tbl_language`
--
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;
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'
);

View File

@ -1,5 +1,6 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>PHPMixBill Installer</title>
<link rel="shortcut icon" type="image/x-icon" href="img/favicon.ico">
@ -26,14 +27,12 @@
<?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/>";
if (version_compare(PHP_VERSION, '7.2.0') >= 0) {
$ltext .= 'To Run PHPMixBill 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 PHPMixBill You need at least PHP version 5.2.0, Your PHP Version is: ' . PHP_VERSION . " Tested <strong>---FAILED---</strong><br/>";
$ltext .= 'To Run PHPMixBill 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')) {
@ -55,7 +54,7 @@
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>");
<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 PHPMixBill is not available on your server.
Please contact with us- iesien22@yahoo.com with this code- $passed Or contact with your server administrator
@ -67,5 +66,5 @@
</div>
<div class="footer">Copyright &copy; 2021 PHPMixBill. All Rights Reserved<br /><br /></div>
</body>
</html>
</html>

View File

@ -26,7 +26,7 @@
<?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);

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
**/
//error_reporting (0);
$appurl = $_POST['appurl'];

109
system/install/update.php Normal file
View File

@ -0,0 +1,109 @@
<!DOCTYPE html>
<html lang="en">
<head>
<title>PHPMixBill 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> PHPMixBill 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 PHPMixBill. All Rights Reserved<br /><br /></div>
</body>
</html>

View File

@ -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

@ -244,3 +244,52 @@ $_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';

View File

@ -0,0 +1,297 @@
<?php
/*
-----------------------------------
Language Name: Spanish
Contributor: Ing.Luis E. Hernandez
Web: www.phpmixbill.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/ibnux/phpmixbill" 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

@ -222,3 +222,50 @@ $_L['Name_Lang'] = 'Dil adı';
$_L['Folder_Lang'] = 'Klasör adı';
$_L['Translator'] = 'Çevirmen';
$_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

@ -0,0 +1,90 @@
[
{
"id": "BC",
"name": "BCA"
},
{
"id": "M2",
"name": "Mandiri"
},
{
"id": "VA",
"name": "Maybank"
},
{
"id": "I1",
"name": "BNI"
},
{
"id": "B1",
"name": "CIMB Niaga"
},
{
"id": "BT",
"name": "Permata Bank"
},
{
"id": "A1",
"name": "ATM Bersama"
},
{
"id": "AG",
"name": "Artha Graha"
},
{
"id": "BR",
"name": "BRIVA"
},
{
"id": "S1",
"name": "Bank Sahabat Sampoerna"
},
{
"id": "OV",
"name": "OVO"
},
{
"id": "SA",
"name": "Shopee Pay"
},
{
"id": "LF",
"name": "LinkAja Apps (Fixed Fee)"
},
{
"id": "LA",
"name": "LinkAja Apps (Percentage Fee)"
},
{
"id": "DA",
"name": "DANA"
},
{
"id": "SP",
"name": "QRIS Shopee Pay"
},
{
"id": "LQ",
"name": "QRIS LinkAja"
},
{
"id": "NQ",
"name": "QRIS Nobu"
},
{
"id": "FT",
"name": "Pegadaian/ALFA/Pos"
},
{
"id": "A2",
"name": "POS Indonesia"
},
{
"id": "IR",
"name": "Indomaret"
},
{
"id": "VC",
"name": "Credit Card (Visa / Master Card / JCB)"
}
]

View File

@ -0,0 +1,66 @@
[
{
"id": "credit_card",
"name": "Credit Card"
},
{
"id": "bca_va",
"name": "BCA"
},
{
"id": "permata_va",
"name": "Permata"
},
{
"id": "bni_va",
"name": "BNI"
},
{
"id": "bri_va",
"name": "BRI"
},
{
"id": "echannel",
"name": "Mandiri Bill"
},
{
"id": "gopay",
"name": "Gopay"
},
{
"id": "bca_klikbca",
"name": "KLIKBCA"
},
{
"id": "bca_klikpay",
"name": "BCA KLIKPAY"
},
{
"id": "cimb_clicks",
"name": "CIMB Clicks"
},
{
"id": "danamon_online",
"name": "Danamon"
},
{
"id": "bri_epay",
"name": "BRImo"
},
{
"id": "indomaret",
"name": "Indomaret"
},
{
"id": "alfamart",
"name": "Alfamart"
},
{
"id": "ShopeePay",
"name": "ShopeePay"
},
{
"id": "uob_ezpay",
"name": "UOB EZ Pay"
}
]

View File

@ -0,0 +1,74 @@
[
{
"id": "PERMATAVA",
"name": "Permata Bank"
},
{
"id": "MYBVA",
"name": "Maybank"
},
{
"id": "BNIVA",
"name": "BNI"
},
{
"id": "BRIVA",
"name": "BRI"
},
{
"id": "MANDIRIVA",
"name": "Mandiri"
},
{
"id": "BCAVA",
"name": "BCA"
},
{
"id": "SMSVA",
"name": "Sinarmas"
},
{
"id": "MUAMALATVA",
"name": "Muamalat"
},
{
"id": "SAMPOERNAVA",
"name": "Sahabat Sampoerna"
},
{
"id": "BSIVA",
"name": "BSI"
},
{
"id": "ALFAMART",
"name": "Alfamart "
},
{
"id": "INDOMARET",
"name": "Indomaret "
},
{
"id": "ALFAMIDI",
"name": "Alfamidi "
},
{
"id": "OVO",
"name": "OVO"
},
{
"id": "QRIS",
"name": "QRIS by ShopeePay"
},
{
"id": "QRISC",
"name": "QRIS (Customizable)"
},
{
"id": "QRIS2",
"name": "QRIS"
},
{
"id": "SHOPEEPAY",
"name": "ShopeePay "
}
]

View File

@ -0,0 +1,66 @@
[
{
"id": "CREDIT_CARD",
"name": "CREDIT CARD"
},
{
"id": "PERMATA",
"name": "Permata Bank"
},
{
"id": "BNI",
"name": "BNI"
},
{
"id": "BRI",
"name": "BRI"
},
{
"id": "MANDIRI",
"name": "Mandiri"
},
{
"id": "BCA",
"name": "BCA"
},
{
"id": "BSI",
"name": "BSI"
},
{
"id": "DD_BRI",
"name": "Direct Debit BRI"
},
{
"id": "DD_BCA_KLIKPAY",
"name": "Direct Debit BCA KLIKPAY"
},
{
"id": "ALFAMART",
"name": "Alfamart "
},
{
"id": "INDOMARET",
"name": "Indomaret "
},
{
"id": "OVO",
"name": "OVO"
},
{
"id": "DANA",
"name": "DANA"
},
{
"id": "LINKAJA",
"name": "LinkAja"
},
{
"id": "SHOPEEPAY",
"name": "ShopeePay "
},
{
"id": "QRIS",
"name": "QRIS"
}
]

View File

@ -0,0 +1,170 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
*
* Payment Gateway duitku.com
**/
function duitku_validate_config()
{
global $config;
if (empty($config['duitku_merchant_key'])) {
sendTelegram("Duitku payment gateway not configured");
r2(U . 'order/package', 'w', Lang::T("Admin has not yet setup Duitku payment gateway, please tell admin"));
}
}
function duitku_show_config()
{
global $ui, $config;
$ui->assign('_title', 'Duitku - Payment Gateway - ' . $config['CompanyName']);
$ui->assign('channels', json_decode(file_get_contents('system/paymentgateway/channel_duitku.json'), true));
$ui->display('pg-duitku.tpl');
}
function duitku_save_config()
{
global $admin;
$duitku_merchant_id = _post('duitku_merchant_id');
$duitku_merchant_key = _post('duitku_merchant_key');
$d = ORM::for_table('tbl_appconfig')->where('setting', 'duitku_merchant_id')->find_one();
if ($d) {
$d->value = $duitku_merchant_id;
$d->save();
} else {
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'duitku_merchant_id';
$d->value = $duitku_merchant_id;
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'duitku_merchant_key')->find_one();
if ($d) {
$d->value = $duitku_merchant_key;
$d->save();
} else {
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'duitku_merchant_key';
$d->value = $duitku_merchant_key;
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'duitku_channel')->find_one();
if ($d) {
$d->value = implode(',', $_POST['duitku_channel']);
$d->save();
} else {
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'duitku_channel';
$d->value = implode(',', $_POST['duitku_channel']);
$d->save();
}
_log('[' . $admin['username'] . ']: Duitku ' . Lang::T('Settings_Saved_Successfully'), 'Admin', $admin['id']);
r2(U . 'paymentgateway/duitku', 's', Lang::T('Settings_Saved_Successfully'));
}
function duitku_create_transaction($trx, $user)
{
global $config, $routes, $ui;
$channels = json_decode(file_get_contents('system/paymentgateway/channel_duitku.json'), true);
if (!in_array($routes[4], explode(",", $config['duitku_channel']))) {
$ui->assign('_title', 'Duitku Channel - ' . $config['CompanyName']);
$ui->assign('channels', $channels);
$ui->assign('duitku_channels', explode(",", $config['duitku_channel']));
$ui->assign('path', $routes['2'] . '/' . $routes['3']);
$ui->display('duitku_channel.tpl');
die();
}
$json = [
'paymentMethod' => $routes[4],
'paymentAmount' => $trx['price'],
'merchantCode' => $config['duitku_merchant_id'],
'merchantOrderId' => $trx['id'],
'productDetails' => $trx['plan_name'],
'merchantUserInfo' => $user['fullname'],
'customerVaName' => $user['fullname'],
'email' => (empty($user['email'])) ? $user['username'] . '@' . $_SERVER['HTTP_HOST'] : $user['email'],
'phoneNumber' => $user['phonenumber'],
'itemDetails' => [
[
'name' => $trx['plan_name'],
'price' => $trx['price'],
'quantity' => 1
]
],
'returnUrl' => U . 'order/view/' . $trx['id'] . '/check',
'signature' => md5($config['duitku_merchant_id'] . $trx['id'] . $trx['price'] . $config['duitku_merchant_key'])
];
$result = json_decode(Http::postJsonData(duitku_get_server() . 'v2/inquiry', $json), true);
if (empty($result['paymentUrl'])) {
sendTelegram("Duitku payment failed\n\n" . json_encode($result, JSON_PRETTY_PRINT));
r2(U . 'order/package', 'e', Lang::T("Failed to create transaction."));
}
$d = ORM::for_table('tbl_payment_gateway')
->where('username', $user['username'])
->where('status', 1)
->find_one();
$d->gateway_trx_id = $result['reference'];
$d->pg_url_payment = $result['paymentUrl'];
$d->payment_method = $routes['4'];
foreach ($channels as $channel) {
if ($channel['id'] == $routes['4']) {
$d->payment_channel = $channel['name'];
break;
}
}
$d->pg_request = json_encode($result);
$d->expired_date = date('Y-m-d H:i:s', strtotime("+1 day"));
$d->save();
r2(U . "order/view/" . $d['id'], 's', Lang::T("Create Transaction Success"));
}
function duitku_get_status($trx, $user)
{
global $config;
$json = [
'merchantCode' => $config['duitku_merchant_id'],
'merchantOrderId' => $trx['id'],
'signature' => md5($config['duitku_merchant_id'] . $trx['id'] . $config['duitku_merchant_key'])
];
$result = json_decode(Http::postJsonData(duitku_get_server() . 'transactionStatus', $json), true);
if ($result['reference'] != $trx['gateway_trx_id']) {
sendTelegram("Duitku payment status failed\n\n" . json_encode($result, JSON_PRETTY_PRINT));
r2(U . "order/view/" . $trx['id'], 'w', Lang::T("Payment check failed."));
}
if ($result['statusCode'] == '01') {
r2(U . "order/view/" . $trx['id'], 'w', Lang::T("Transaction still unpaid."));
} else if ($result['statusCode'] == '00' && $trx['status'] != 2) {
if (!Package::rechargeUser($user['id'], $trx['routers'], $trx['plan_id'], $trx['gateway'], $trx['payment_channel'])) {
r2(U . "order/view/" . $trx['id'], 'd', Lang::T("Failed to activate your Package, try again later."));
}
$trx->pg_paid_response = json_encode($result);
$trx->paid_date = date('Y-m-d H:i:s');
$trx->status = 2;
$trx->save();
r2(U . "order/view/" . $trx['id'], 's', Lang::T("Transaction has been paid."));
} else if ($result['statusCode'] == '02') {
$trx->pg_paid_response = json_encode($result);
$trx->status = 3;
$trx->save();
r2(U . "order/view/" . $trx['id'], 'd', Lang::T("Transaction expired or Failed."));
} else if ($trx['status'] == 2) {
r2(U . "order/view/" . $trx['id'], 'd', Lang::T("Transaction has been paid.."));
}
}
function duitku_get_server()
{
global $_app_stage;
if ($_app_stage == 'Live') {
return 'https://passport.duitku.com/webapi/api/merchant/';
} else {
return 'https://sandbox.duitku.com/webapi/api/merchant/';
}
}

View File

@ -0,0 +1,172 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
*
* Payment Gateway tripay.com
**/
function duitku_validate_config()
{
global $config;
if (empty($config['tripay_secret_key'])) {
sendTelegram("Tripay payment gateway not configured");
r2(U . 'order/package', 'w', Lang::T("Admin has not yet setup Tripay payment gateway, please tell admin"));
}
}
function tripay_show_config()
{
global $ui, $config;
$ui->assign('_title', 'Tripay - Payment Gateway - ' . $config['CompanyName']);
$ui->assign('channels', json_decode(file_get_contents('system/paymentgateway/channel_tripay.json'), true));
$ui->display('pg-tripay.tpl');
}
function tripay_save_config()
{
global $admin, $_L;
$tripay_merchant = _post('tripay_merchant');
$tripay_api_key = _post('tripay_api_key');
$tripay_secret_key = _post('tripay_secret_key');
$d = ORM::for_table('tbl_appconfig')->where('setting', 'tripay_merchant')->find_one();
if ($d) {
$d->value = $tripay_merchant;
$d->save();
} else {
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'tripay_merchant';
$d->value = $tripay_merchant;
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'tripay_api_key')->find_one();
if ($d) {
$d->value = $tripay_api_key;
$d->save();
} else {
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'tripay_api_key';
$d->value = $tripay_api_key;
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'tripay_secret_key')->find_one();
if ($d) {
$d->value = $tripay_secret_key;
$d->save();
} else {
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'tripay_secret_key';
$d->value = $tripay_secret_key;
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'tripay_channel')->find_one();
if ($d) {
$d->value = implode(',', $_POST['tripay_channel']);
$d->save();
} else {
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'tripay_channel';
$d->value = implode(',', $_POST['tripay_channel']);
$d->save();
}
_log('[' . $admin['username'] . ']: Tripay ' . $_L['Settings_Saved_Successfully'] . json_encode($_POST['tripay_channel']), 'Admin', $admin['id']);
r2(U . 'paymentgateway/tripay', 's', $_L['Settings_Saved_Successfully']);
}
function tripay_create_transaction($trx, $user)
{
global $config, $routes, $ui;
$channels = json_decode(file_get_contents('system/paymentgateway/channel_tripay.json'), true);
if (!in_array($routes[4], explode(",", $config['tripay_channel']))) {
$ui->assign('_title', 'Tripay Channel - ' . $config['CompanyName']);
$ui->assign('channels', $channels);
$ui->assign('tripay_channels', explode(",", $config['tripay_channel']));
$ui->assign('path', $routes[2] . '/' . $routes[3]);
$ui->display('tripay_channel.tpl');
die();
}
$json = [
'method' => $routes[4],
'amount' => $trx['price'],
'merchant_ref' => $trx['id'],
'customer_name' => $user['fullname'],
'customer_email' => (empty($user['email'])) ? $user['username'] . '@' . $_SERVER['HTTP_HOST'] : $user['email'],
'customer_phone' => $user['phonenumber'],
'order_items' => [
[
'name' => $trx['plan_name'],
'price' => $trx['price'],
'quantity' => 1
]
],
'return_url' => U . 'order/view/' . $trx['id'] . '/check',
'signature' => hash_hmac('sha256', $config['tripay_merchant'] . $trx['id'] . $trx['price'], $config['tripay_secret_key'])
];
$result = json_decode(Http::postJsonData(tripay_get_server() . 'transaction/create', $json, ['Authorization: Bearer ' . $config['tripay_api_key']]), true);
if ($result['success'] != 1) {
sendTelegram("Tripay payment failed\n\n" . json_encode($result, JSON_PRETTY_PRINT));
r2(U . 'order/package', 'e', Lang::T("Failed to create transaction."));
}
$d = ORM::for_table('tbl_payment_gateway')
->where('username', $user['username'])
->where('status', 1)
->find_one();
$d->gateway_trx_id = $result['data']['reference'];
$d->pg_url_payment = $result['data']['checkout_url'];
$d->pg_request = json_encode($result);
$d->expired_date = date('Y-m-d H:i:s', $result['data']['expired_time']);
$d->save();
r2(U . "order/view/" . $d['id'], 's', Lang::T("Create Transaction Success"));
}
function tripay_get_status($trx, $user)
{
global $config;
$result = json_decode(Http::getData(tripay_get_server() . 'transaction/detail?' . http_build_query(['reference' => $trx['gateway_trx_id']]), [
'Authorization: Bearer ' . $config['tripay_api_key']
]), true);
if ($result['success'] != 1) {
sendTelegram("Tripay payment status failed\n\n" . json_encode($result, JSON_PRETTY_PRINT));
r2(U . "order/view/" . $trx['id'], 'w', Lang::T("Payment check failed."));
}
$result = $result['data'];
if ($result['status'] == 'UNPAID') {
r2(U . "order/view/" . $trx['id'], 'w', Lang::T("Transaction still unpaid."));
} else if (in_array($result['status'], ['PAID', 'SETTLED']) && $trx['status'] != 2) {
if (!Package::rechargeUser($user['id'], $trx['routers'], $trx['plan_id'], $trx['gateway'], $result['payment_name'])) {
r2(U . "order/view/" . $trx['id'], 'd', Lang::T("Failed to activate your Package, try again later."));
}
$trx->pg_paid_response = json_encode($result);
$trx->payment_method = $result['payment_method'];
$trx->payment_channel = $result['payment_name'];
$trx->paid_date = date('Y-m-d H:i:s', $result['paid_at']);
$trx->status = 2;
$trx->save();
r2(U . "order/view/" . $trx['id'], 's', Lang::T("Transaction has been paid."));
} else if (in_array($result['status'], ['EXPIRED', 'FAILED', 'REFUND'])) {
$trx->pg_paid_response = json_encode($result);
$trx->status = 3;
$trx->save();
r2(U . "order/view/" . $trx['id'], 'd', Lang::T("Transaction expired."));
} else if ($trx['status'] == 2) {
r2(U . "order/view/" . $trx['id'], 'd', Lang::T("Transaction has been paid.."));
}
}
function tripay_get_server()
{
global $_app_stage;
if ($_app_stage == 'Live') {
return 'https://tripay.co.id/api/';
} else {
return 'https://tripay.co.id/api-sandbox/';
}
}

View File

@ -0,0 +1,150 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
*
* Payment Gateway xendit.com
**/
function xendit_validate_config()
{
global $config;
if (empty($config['xendit_secret_key']) || empty($config['xendit_verification_token'])) {
sendTelegram("Xendit payment gateway not configured");
r2(U . 'order/package', 'w', Lang::T("Admin has not yet setup Xendit payment gateway, please tell admin"));
}
}
function xendit_show_config()
{
global $ui, $config;
$ui->assign('_title', 'Xendit - Payment Gateway - ' . $config['CompanyName']);
$ui->assign('channels', json_decode(file_get_contents('system/paymentgateway/channel_xendit.json'), true));
$ui->display('pg-xendit.tpl');
}
function xendit_save_config()
{
global $admin, $_L;
$xendit_secret_key = _post('xendit_secret_key');
$xendit_verification_token = _post('xendit_verification_token');
$d = ORM::for_table('tbl_appconfig')->where('setting', 'xendit_secret_key')->find_one();
if ($d) {
$d->value = $xendit_secret_key;
$d->save();
} else {
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'xendit_secret_key';
$d->value = $xendit_secret_key;
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'xendit_verification_token')->find_one();
if ($d) {
$d->value = $xendit_verification_token;
$d->save();
} else {
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'xendit_verification_token';
$d->value = $xendit_verification_token;
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'xendit_channel')->find_one();
if ($d) {
$d->value = implode(',', $_POST['xendit_channel']);
$d->save();
} else {
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'xendit_channel';
$d->value = implode(',', $_POST['xendit_channel']);
$d->save();
}
_log('[' . $admin['username'] . ']: Xendit ' . $_L['Settings_Saved_Successfully'], 'Admin', $admin['id']);
r2(U . 'paymentgateway/xendit', 's', $_L['Settings_Saved_Successfully']);
}
function xendit_create_transaction($trx, $user)
{
global $config;
$json = [
'external_id' => $trx['id'],
'amount' => $trx['price'],
'description' => $trx['plan_name'],
'customer' => [
'mobile_number' => $user['phonenumber'],
],
'customer_notification_preference' => [
'invoice_created' => ['whatsapp', 'sms'],
'invoice_reminder' => ['whatsapp', 'sms'],
'invoice_paid' => ['whatsapp', 'sms'],
'invoice_expired' => ['whatsapp', 'sms']
],
'payment_methods ' => explode(',', $config['xendit_channel']),
'success_redirect_url' => U . 'order/view/' . $trx['id'] . '/check',
'failure_redirect_url' => U . 'order/view/' . $trx['id'] . '/check'
];
$result = json_decode(Http::postJsonData(xendit_get_server() . 'invoices', $json, ['Authorization: Basic ' . base64_encode($config['xendit_secret_key'] . ':')]), true);
if (!$result['id']) {
r2(U . 'order/package', 'e', Lang::T("Failed to create transaction."));
}
$d = ORM::for_table('tbl_payment_gateway')
->where('username', $user['username'])
->where('status', 1)
->find_one();
$d->gateway_trx_id = $result['id'];
$d->pg_url_payment = $result['invoice_url'];
$d->pg_request = json_encode($result);
$d->expired_date = date('Y-m-d H:i:s', strtotime($result['expiry_date']));
$d->save();
header('Location: ' . $result['invoice_url']);
exit();
}
function xendit_get_status($trx, $user)
{
global $config;
$result = json_decode(Http::getData(xendit_get_server() . 'invoices/' . $trx['gateway_trx_id'], [
'Authorization: Basic ' . base64_encode($config['xendit_secret_key'] . ':')
]), true);
if ($result['status'] == 'PENDING') {
r2(U . "order/view/" . $trx['id'], 'w', Lang::T("Transaction still unpaid."));
} else if (in_array($result['status'], ['PAID', 'SETTLED']) && $trx['status'] != 2) {
if (!Package::rechargeUser($user['id'], $trx['routers'], $trx['plan_id'], $trx['gateway'], $result['payment_channel'])) {
r2(U . "order/view/" . $trx['id'], 'd', Lang::T("Failed to activate your Package, try again later."));
}
$trx->pg_paid_response = json_encode($result);
$trx->payment_method = $result['payment_method'];
$trx->payment_channel = $result['payment_channel'];
$trx->paid_date = date('Y-m-d H:i:s', strtotime($result['updated']));
$trx->status = 2;
$trx->save();
r2(U . "order/view/" . $trx['id'], 's', Lang::T("Transaction has been paid."));
} else if ($result['status'] == 'EXPIRED') {
$trx->pg_paid_response = json_encode($result);
$trx->status = 3;
$trx->save();
r2(U . "order/view/" . $trx['id'], 'd', Lang::T("Transaction expired."));
} else if ($trx['status'] == 2) {
r2(U . "order/view/" . $trx['id'], 'd', Lang::T("Transaction has been paid.."));
}else{
sendTelegram("xendit_get_status: unknown result\n\n".json_encode($result, JSON_PRETTY_PRINT));
r2(U . "order/view/" . $trx['id'], 'd', Lang::T("Unknown Command."));
}
}
function xendit_get_server()
{
global $_app_stage;
if ($_app_stage == 'Live') {
return 'https://api.xendit.co/v2/';
} else {
return 'https://api.xendit.co/v2/';
}
}

26
system/radius.php Normal file
View File

@ -0,0 +1,26 @@
<?php
/**
* PHP Mikrotik Billing (https://ibnux.github.io/phpmixbill/)
**/
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

@ -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,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,40 +0,0 @@
{include file="sections/header.tpl"}
<div class="row">
<div class="col-sm-12">
<div class="panel mb20 panel-primary panel-hovered">
<div class="panel-heading">{$_L[$pageHeader]}</div>
<div id="myNicPanel" style="width: 100%;"></div>
<div id="panel-edit" class="panel-body">{$htmls}</div>
{if $writeable}
<div class="panel-footer">
<a href="javascript:saveIt()" class="btn btn-primary btn-block">SAVE</a>
<br>
<p class="help-block">{$_L['Info_Page']}</p>
</div>
{else}
<div class="panel-footer">
{$_L['Failed_Save_Page']}
</div>
{/if}
</div>
</div>
</div>
<form id="formpages" class="hidden" method="post" role="form" action="{$_url}pages/{$pageHeader}-post" >
<textarea name="html" id="html"></textarea>
</form>
<script src="{$_theme}/scripts/nicEdit.js"></script>
<script type="text/javascript">
var myNicEditor
bkLib.onDomLoaded(function() {
myNicEditor = new nicEditor();
myNicEditor.setPanel('myNicPanel');
myNicEditor.addInstance('panel-edit');
});
function saveIt(){
//alert(document.getElementById('panel-edit').innerHTML);
document.getElementById('html').value = nicEditors.findEditor('panel-edit').getContent()
document.getElementById('formpages').submit();
}
</script>
{include file="sections/footer.tpl"}

View File

@ -1,59 +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['Pool']}</div>
<div class="panel-body">
<div class="md-whiteframe-z1 mb20 text-center" style="padding: 15px">
<div class="col-md-8">
<form id="site-search" method="post" action="{$_url}pool/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}pool/add" class="btn btn-primary btn-block waves-effect"><i class="ion ion-android-add"> </i> {$_L['New_Pool']}</a>
</div>&nbsp;
</div>
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>#</th>
<th>{$_L['Pool_Name']}</th>
<th>{$_L['Range_IP']}</th>
<th>{$_L['Routers']}</th>
<th>{$_L['Manage']}</th>
</tr>
</thead>
<tbody>
{$no = 1}
{foreach $d as $ds}
<tr>
<td align="center">{$no++}</td>
<td>{$ds['pool_name']}</td>
<td>{$ds['range_ip']}</td>
<td>{$ds['routers']}</td>
<td align="center">
<a href="{$_url}pool/edit/{$ds['id']}" class="btn btn-warning btn-sm">{$_L['Edit']}</a>
<a href="{$_url}pool/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,62 +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['PPPOE_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/pppoe/">
<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/pppoe-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['Bandwidth_Plans']}</th>
<th>{$_L['Plan_Price']}</th>
<th>{$_L['Plan_Validity']}</th>
<th>{$_L['Pool']}</th>
<th>{$_L['Routers']}</th>
<th>{$_L['Manage']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['name_plan']}</td>
<td>{$ds['name_bw']}</td>
<td>{$ds['price']}</td>
<td>{$ds['validity']} {$ds['validity_unit']}</td>
<td>{$ds['pool']}</td>
<td>{$ds['routers']}</td>
<td>
<a href="{$_url}services/pppoe-edit/{$ds['id']}" class="btn btn-warning btn-sm">{$_L['Edit']}</a>
<a href="{$_url}services/pppoe-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,65 +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['Prepaid_User']}</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}prepaid/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}prepaid/recharge" class="btn btn-primary btn-block waves-effect"><i class="ion ion-android-add"> </i> {$_L['Recharge_Account']}</a>
</div>&nbsp;
</div>
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th>{$_L['Username']}</th>
<th>{$_L['Plan_Name']}</th>
<th>{$_L['Type']}</th>
<th>{$_L['Created_On']}</th>
<th>{$_L['Expires_On']}</th>
<th>{$_L['Method']}</th>
<th>{$_L['Routers']}</th>
<th>{$_L['Manage']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td>{$ds['namebp']}</td>
<td>{$ds['type']}</td>
<td>{$ds['recharged_on']} {$ds['time']}</td>
<td>{$ds['expiration']} {$ds['time']}</td>
<td>{$ds['method']}</td>
<td>{$ds['routers']}</td>
<td>
<a href="{$_url}prepaid/edit/{$ds['id']}" class="btn btn-warning btn-sm">{$_L['Edit']}</a>
<a href="{$_url}prepaid/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,72 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>{$_title}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="{$_theme}/styles/bootstrap.min.css" rel="stylesheet">
<link rel="shortcut icon" type="image/x-icon" href="{$_theme}/images/favicon.ico">
<style type="text/css">
@media print
{
.no-print, .no-print *
{
display: none !important;
}
}
</style>
</head>
<body>
<div class="row">
<div class="col-md-12">
<div id="printable">
<h4>{$_L['All_Transactions_at_Date']}: {date($_c['date_format'], strtotime($mdate))}</h4>
<table class="table table-condensed table-bordered" style="background: #ffffff">
<th class="text-center">{$_L['Username']}</th>
<th class="text-center">{$_L['Plan_Name']}</th>
<th class="text-center">{$_L['Type']}</th>
<th class="text-center">{$_L['Plan_Price']}</th>
<th class="text-center">{$_L['Created_On']}</th>
<th class="text-center">{$_L['Expires_On']}</th>
<th class="text-center">{$_L['Method']}</th>
<th class="text-center">{$_L['Routers']}</th>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td class="text-center">{$ds['plan_name']}</td>
<td class="text-center">{$ds['type']}</td>
<td class="text-right">{$_c['currency_code']} {number_format($ds['price'],2,$_c['dec_point'],$_c['thousands_sep'])}</td>
<td>{date($_c['date_format'], strtotime($ds['recharged_on']))} {$ds['time']}</td>
<td>{date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}</td>
<td class="text-center">{$ds['method']}</td>
<td class="text-center">{$ds['routers']}</td>
</tr>
{/foreach}
</table>
<div class="clearfix text-right total-sum mb10">
<h4 class="text-uppercase text-bold">{$_L['Total_Income']}:</h4>
<h3 class="sum">{$_c['currency_code']} {number_format($dr,2,$_c['dec_point'],$_c['thousands_sep'])}</h3>
</div>
</div>
<button type="button" id="actprint" class="btn btn-default btn-sm no-print">{$_L['Click_Here_to_Print']}</button>
</div>
</div>
<script src="{$_theme}/scripts/jquery-1.10.2.js"></script>
<script src="{$_theme}/scripts/bootstrap.min.js"></script>
{if isset($xfooter)}
{$xfooter}
{/if}
<script>
jQuery(document).ready(function() {
// initiate layout and plugins
$("#actprint").click(function() {
window.print();
return false;
});
});
</script>
</body>
</html>

View File

@ -1,72 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>{$_title}</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="{$_theme}/styles/bootstrap.min.css" rel="stylesheet">
<link rel="shortcut icon" type="image/x-icon" href="{$_theme}/images/favicon.ico">
<style type="text/css">
@media print
{
.no-print, .no-print *
{
display: none !important;
}
}
</style>
</head>
<body>
<div class="row">
<div class="col-md-12">
<div id="printable">
<h4>{$_L['All_Transactions_at_Date']}: {date( $_c['date_format'], strtotime($fdate))} - {date( $_c['date_format'], strtotime($tdate))}</h4>
<table class="table table-condensed table-bordered" style="background: #ffffff">
<th class="text-center">{$_L['Username']}</th>
<th class="text-center">{$_L['Plan_Name']}</th>
<th class="text-center">{$_L['Type']}</th>
<th class="text-center">{$_L['Plan_Price']}</th>
<th class="text-center">{$_L['Created_On']}</th>
<th class="text-center">{$_L['Expires_On']}</th>
<th class="text-center">{$_L['Method']}</th>
<th class="text-center">{$_L['Routers']}</th>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td class="text-center">{$ds['plan_name']}</td>
<td class="text-center">{$ds['type']}</td>
<td class="text-right">{$_c['currency_code']} {number_format($ds['price'],2,$_c['dec_point'],$_c['thousands_sep'])}</td>
<td>{date($_c['date_format'], strtotime($ds['recharged_on']))} {$ds['time']}</td>
<td>{date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}</td>
<td class="text-center">{$ds['method']}</td>
<td class="text-center">{$ds['routers']}</td>
</tr>
{/foreach}
</table>
<div class="clearfix text-right total-sum mb10">
<h4 class="text-uppercase text-bold">{$_L['Total_Income']}:</h4>
<h3 class="sum">{$_c['currency_code']} {number_format($dr,2,$_c['dec_point'],$_c['thousands_sep'])}</h3>
</div>
</div>
<button type="button" id="actprint" class="btn btn-default btn-sm no-print">{$_L['Click_Here_to_Print']}</button>
</div>
</div>
<script src="{$_theme}/scripts/jquery-1.10.2.js"></script>
<script src="{$_theme}/scripts/bootstrap.min.js"></script>
{if isset($xfooter)}
{$xfooter}
{/if}
<script>
jQuery(document).ready(function() {
// initiate layout and plugins
$("#actprint").click(function() {
window.print();
return false;
});
});
</script>
</body>
</html>

View File

@ -1,61 +0,0 @@
{include file="sections/header.tpl"}
<div class="row">
<div class="col-md-12">
<div class="invoice-wrap">
<div class="clearfix invoice-head">
<h3 class="brand-logo text-uppercase text-bold left mt15">
<span class="text">{$_L['Daily_Report']}</span>
</h3>
</div>
<div class="clearfix invoice-subhead mb20">
<div class="group clearfix left">
<p class="text-bold mb5">{$_L['All_Transactions_at_Date']}:</p>
<p class="small">{date($_c['date_format'], strtotime($mdate))} {$mtime}</p>
</div>
<div class="group clearfix right">
<a href="{$_url}export/print-by-date" class="btn btn-default" target="_blank"><i class="ion ion-printer"></i>{$_L['Export_for_Print']}</a>
<a href="{$_url}export/pdf-by-date" class="btn btn-default"><i class="fa fa-file-pdf-o"></i>{$_L['Export_to_PDF']}</a>
</div>
</div>
<table class="table table-bordered invoice-table mb10">
<thead>
<tr>
<th>{$_L['Username']}</th>
<th>{$_L['Type']}</th>
<th>{$_L['Plan_Name']}</th>
<th>{$_L['Plan_Price']}</th>
<th>{$_L['Created_On']}</th>
<th>{$_L['Expires_On']}</th>
<th>{$_L['Method']}</th>
<th>{$_L['Routers']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td>{$ds['type']}</td>
<td>{$ds['plan_name']}</td>
<td class="text-right">{$_c['currency_code']} {number_format($ds['price'],2,$_c['dec_point'],$_c['thousands_sep'])}</td>
<td>{date($_c['date_format'], strtotime($ds['recharged_on']))} {$ds['time']}</td>
<td>{date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}</td>
<td>{$ds['method']}</td>
<td>{$ds['routers']}</td>
</tr>
{/foreach}
</tbody>
</table>
{$paginator['contents']}
<div class="clearfix text-right total-sum mb10">
<h4 class="text-uppercase text-bold">{$_L['Total_Income']}:</h4>
<h3 class="sum">{$_c['currency_code']} {number_format($dr,2,$_c['dec_point'],$_c['thousands_sep'])}</h3>
</div>
<p class="text-center small text-info">{$_L['All_Transactions_at_Date']}: {date($_c['date_format'], strtotime($mdate))} {$mtime}</p>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

View File

@ -1,69 +0,0 @@
{include file="sections/header.tpl"}
<div class="row">
<div class="col-md-12">
<div class="invoice-wrap">
<div class="clearfix invoice-head">
<h3 class="brand-logo text-uppercase text-bold left mt15">
<span class="text">{$_L['Daily_Report']}</span>
</h3>
</div>
<div class="clearfix invoice-subhead mb20">
<div class="group clearfix left">
<p class="text-bold mb5">{$_L['All_Transactions_at_Date']}:</p>
<p class="small">{$stype} [{date( $_c['date_format'], strtotime($fdate))} - {date( $_c['date_format'], strtotime($tdate))}]</p>
</div>
<div class="group clearfix right">
<form method="post" action="{$_url}export/print-by-period" target="_blank">
<input type="hidden" name="fdate" value="{$fdate}">
<input type="hidden" name="tdate" value="{$tdate}">
<input type="hidden" name="stype" value="{$stype}">
<button type="submit" class="btn btn-default"><i class="fa fa-print"></i> {$_L['Export_for_Print']}</button>
</form>
<form method="post" action="{$_url}export/pdf-by-period" target="_blank">
<input type="hidden" name="fdate" value="{$fdate}">
<input type="hidden" name="tdate" value="{$tdate}">
<input type="hidden" name="stype" value="{$stype}">
<button type="submit" class="btn btn-default"><i class="fa fa-file-pdf-o"></i> {$_L['Export_to_PDF']}</button>
</form>
</div>
</div>
<table class="table table-bordered invoice-table mb10">
<thead>
<tr>
<th>{$_L['Username']}</th>
<th>{$_L['Type']}</th>
<th>{$_L['Plan_Name']}</th>
<th>{$_L['Plan_Price']}</th>
<th>{$_L['Created_On']}</th>
<th>{$_L['Expires_On']}</th>
<th>{$_L['Method']}</th>
<th>{$_L['Routers']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td>{$ds['type']}</td>
<td>{$ds['plan_name']}</td>
<td class="text-right">{$_c['currency_code']} {number_format($ds['price'],0,$_c['dec_point'],$_c['thousands_sep'])}</td>
<td>{date($_c['date_format'], strtotime($ds['recharged_on']))} {$ds['time']}</td>
<td>{date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}</td>
<td>{$ds['method']}</td>
<td>{$ds['routers']}</td>
</tr>
{/foreach}
</tbody>
</table>
<div class="clearfix text-right total-sum mb10">
<h4 class="text-uppercase text-bold">{$_L['Total_Income']}:</h4>
<h3 class="sum">{$_c['currency_code']} {number_format($dr,2,$_c['dec_point'],$_c['thousands_sep'])}</h3>
</div>
<p class="text-center small text-info">{$stype} [{date( $_c['date_format'], strtotime($fdate))} - {date( $_c['date_format'], strtotime($tdate))}]</p>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

View File

@ -1,55 +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_Router']}</div>
<div class="panel-body">
<form class="form-horizontal" method="post" role="form" action="{$_url}routers/add-post" >
<div class="form-group">
<label class="col-md-2 control-label">{$_L['Router_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['IP_Address']}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="ip_address" name="ip_address">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{$_L['Username']}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="username" name="username">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{$_L['Router_Secret']}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="password" name="password">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{$_L['Description']}</label>
<div class="col-md-6">
<textarea class="form-control" id="description" name="description"></textarea>
</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>
Or <a href="{$_url}routers/list">{$_L['Cancel']}</a>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

View File

@ -1,55 +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['Edit_Router']}</div>
<div class="panel-body">
<form class="form-horizontal" method="post" role="form" action="{$_url}routers/edit-post" >
<input type="hidden" name="id" value="{$d['id']}">
<div class="form-group">
<label class="col-md-2 control-label">{$_L['Router_Name']}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="name" name="name" value="{$d['name']}">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{$_L['IP_Address']}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="ip_address" name="ip_address" value="{$d['ip_address']}">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{$_L['Username']}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="username" name="username" value="{$d['username']}">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{$_L['Router_Secret']}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="password" name="password" value="{$d['password']}">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{$_L['Description']}</label>
<div class="col-md-6">
<textarea class="form-control" id="description" name="description">{$d['description']}</textarea>
</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>
Or <a href="{$_url}routers/list">{$_L['Cancel']}</a>
</div>
</div>
</form>
</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['Routers']}</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}routers/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}routers/add" class="btn btn-primary btn-block waves-effect"><i class="ion ion-android-add"> </i> {$_L['New_Router']}</a>
</div>&nbsp;
</div>
<div class="table-responsive">
<table class="table table-striped table-bordered">
<thead>
<tr>
<th>{$_L['Router_Name']}</th>
<th>{$_L['IP_Address']}</th>
<th>{$_L['Username']}</th>
<th>{$_L['Description']}</th>
<th>{$_L['Manage']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['name']}</td>
<td>{$ds['ip_address']}</td>
<td>{$ds['username']}</td>
<td>{$ds['description']}</td>
<td>
<a href="{$_url}routers/edit/{$ds['id']}" class="btn btn-warning btn-sm">{$_L['Edit']}</a>
<a href="{$_url}routers/delete/{$ds['id']}" id="{$ds['id']}" class="btn btn-danger btn-sm cdelete">{$_L['Delete']}</a>
</td>
</tr>
{/foreach}
</tbody>
</table>
</div>
{$paginator['contents']}
</div>
</div>
</div>
</div>
{include file="sections/footer.tpl"}

View File

@ -1,40 +0,0 @@
{include file="sections/user-header.tpl"}
<div class="row">
<div class="col-sm-12">
<div class="panel mb20 panel-hovered panel-default">
<div class="panel-heading">{$_L['List_Activated_Voucher']}</div>
<div class="panel-body">
<table id="datatable" class="table table-striped table-bordered">
<thead>
<tr>
<th>{$_L['Username']}</th>
<th>{$_L['Plan_Name']}</th>
<th>{$_L['Type']}</th>
<th>{$_L['Created_On']}</th>
<th>{$_L['Expires_On']}</th>
<th>{$_L['Method']}</th>
</tr>
</thead>
<tbody>
{foreach $d as $ds}
<tr>
<td>{$ds['username']}</td>
<td>{$ds['plan_name']}</td>
<td>{$ds['type']}</td>
<td class="text-success">{date($_c['date_format'], strtotime($ds['recharged_on']))} {$ds['time']}</td>
<td class="text-danger">{date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}</td>
<td>{$ds['method']}</td>
</tr>
{/foreach}
</tbody>
</table>
{$paginator['contents']}
</div>
</div>
</div>
</div>
{include file="sections/user-footer.tpl"}

View File

@ -1,79 +0,0 @@
{include file="sections/user-header.tpl"}
<div class="row">
<div class="col-md-6">
<div class="panel panel-default">
<div class="panel-heading">{$_L['Welcome']}, {$_user['fullname']}</div>
<div class="panel-body" style="height:296px;max-height:296px;overflow:scroll;">
<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 class="col-md-6">
<br class="visible-xs-inline visible-sm-inline">
<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>
<br>
<div class="row">
<div class="col-sm-6">
<div class="panel panel-default table-condensed">
<div class="panel-heading">{$_L['Account_Information']}</div>
<table class="table table-striped table-bordered">
<tr>
<td class="small text-success text-uppercase text-normal">{$_L['Username']}</td>
<td class="small mb15">{$_bill['username']}</td>
</tr>
<tr>
<td class="small text-primary text-uppercase text-normal">{$_L['Plan_Name']}</td>
<td class="small mb15">{$_bill['namebp']}</td>
</tr>
<tr>
<td class="small text-info text-uppercase text-normal">{$_L['Created_On']}</td>
<td class="small mb15">{if $_bill['time'] ne ''}{date($_c['date_format'], strtotime($_bill['recharged_on']))} {$_bill['time']}{/if}&nbsp;</td>
</tr>
<tr>
<td class="small text-danger text-uppercase text-normal">{$_L['Expires_On']}</td>
<td class="small mb15">{if $_bill['time'] ne ''}{date($_c['date_format'], strtotime($_bill['expiration']))} {$_bill['time']}{/if}&nbsp;</td>
</tr>
</table>
</div>
</div>
<div class="col-sm-6">
<br class="visible-xs-inline visible-sm-inline">
<div class="panel panel-primary panel-hovered panel-stacked mb30">
<div class="panel-heading">{$_L['Voucher_Activation']}</div>
<div class="panel-body">
<form class="form-horizontal" method="post" role="form" action="{$_url}voucher/activation-post" >
<div class="form-group">
<label class="col-md-4 control-label">{$_L['Code_Voucher']}</label>
<div class="col-md-6">
<input type="text" class="form-control" id="code" name="code" placeholder="{$_L['Enter_Voucher_Code']}">
</div>
</div>
<div class="form-group">
<div align="center">
<button class="btn btn-success waves-effect waves-light" type="submit">{$_L['Recharge']}</button>
</div>
</div>
</form>
</div>
</div>
</div>
</div>
{include file="sections/user-footer.tpl"}

View File

@ -1,8 +0,0 @@
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -1,8 +0,0 @@
<html>
<head>
<title>403 Forbidden</title>
</head>
<body>
<p>Directory access is forbidden.</p>
</body>
</html>

View File

@ -18,7 +18,6 @@
<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]-->

119
ui/ui/app-settings.tpl Normal file
View File

@ -0,0 +1,119 @@
{include file="sections/header.tpl"}
<form class="form-horizontal" method="post" role="form" action="{$_url}settings/app-post" >
<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">
<div class="form-group">
<label class="col-md-2 control-label">{$_L['App_Name']}</label>
<div class="col-md-6">
<input type="text" required 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">Radius Mode?</label>
<div class="col-md-6">
<select name="radius_mode" id="radius_mode" class="form-control">
<option value="0">No</option>
<option value="1" {if $_c['radius_mode']}selected="selected" {/if}>Yes</option>
</select>
<p class="help-block">Still on Testing.</p>
<p class="help-block">Changing from Radius will not add existing user to Mikrotik Hotspot.</p>
<p class="help-block">With Radius user can use Hotspot or PPOE.</p>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">APP URL</label>
<div class="col-md-6">
<input type="text" readonly class="form-control" value="{$app_url}">
<p class="help-block">system/config.php</p>
</div>
</div>
</div>
<div class="panel-heading">Telegram Notification</div>
<div class="panel-body">
<div class="form-group">
<label class="col-md-2 control-label">Telegram Bot Token</label>
<div class="col-md-6">
<input type="text" class="form-control" id="telegram_bot" name="telegram_bot" value="{$_c['telegram_bot']}" placeholder="123456:asdasgdkuasghddlashdashldhalskdklasd">
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">Telegram Target ID</label>
<div class="col-md-6">
<input type="text" class="form-control" id="telegram_target_id" name="telegram_target_id" value="{$_c['telegram_target_id']}" placeholder="12345678">
</div>
</div>
</div>
<div class="panel-heading">SMS OTP Registration</div>
<div class="panel-body">
<div class="form-group">
<label class="col-md-2 control-label">SMS Server URL</label>
<div class="col-md-6">
<input type="text" class="form-control" id="sms_url" name="sms_url" value="{$_c['sms_url']}" placeholder="https://domain/?param_number=[number]&param_text=[text]&secret=">
<p class="help-block">Must include <b>[text]</b> &amp; <b>[number]</b>, it will be replaced.</p>
</div>
</div>
</div>
<div class="panel-heading">Whatsapp Notification</div>
<div class="panel-body">
<div class="form-group">
<label class="col-md-2 control-label">Whatsapp Server URL</label>
<div class="col-md-6">
<input type="text" class="form-control" id="wa_url" name="wa_url" value="{$_c['wa_url']}" placeholder="https://domain/?param_number=[number]&param_text=[text]&secret=">
<p class="help-block">Must include <b>[text]</b> &amp; <b>[number]</b>, it will be replaced.</p>
</div>
</div>
</div>
<div class="panel-heading">Tawk.to Chat Widget</div>
<div class="panel-body">
<div class="form-group">
<label class="col-md-2 control-label">https://tawk.to/chat/</label>
<div class="col-md-6">
<input type="text" class="form-control" id="tawkto" name="tawkto" value="{$_c['tawkto']}" placeholder="62f1ca7037898912e961f5/1ga07df">
<p class="help-block">From Direct Chat Link.</p>
<pre>/ip hotspot walled-garden
add dst-host=tawk.to
add dst-host=*.tawk.to</pre>
</div>
</div>
</div>
<div class="panel-heading">Invoice</div>
<div class="panel-body">
<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>
</div>
<pre>/ip hotspot walled-garden
add dst-host={$_domain}
add dst-host=*.{$_domain}</pre>
</div>
</div>
</div>
</form>
{include file="sections/footer.tpl"}

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