diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index ddf5243b..7b218b6f 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -7,6 +7,9 @@ assignees: ibnux --- +Please Remember, this project is free and open source, and @ibnux don't get any money from this project, and if you post something not a bug, just you dont understand how to install it, you will get blocked from this Repository. +Post it in Discussion if you don't understand. Except you pay for $50 for support + **Describe the bug** A clear and concise description of what the bug is. Error connecting to router is not a bug, is your router port is not accessable, ask community for help, go to discussion or telegram group diff --git a/.github/ISSUE_TEMPLATE/feature_request.md b/.github/ISSUE_TEMPLATE/feature_request.md index bbcbbe7d..b995353c 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.md +++ b/.github/ISSUE_TEMPLATE/feature_request.md @@ -7,6 +7,8 @@ assignees: '' --- +Please Remember, this project is free and open source, and @ibnux don't get any money from this project, any Feature Request will cost you $50-$5000 + **Is your feature request related to a problem? Please describe.** A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] diff --git a/.gitignore b/.gitignore index d4ac02b4..07267b56 100644 --- a/.gitignore +++ b/.gitignore @@ -1,9 +1,11 @@ config.php .DS_Store .vscode/ +ui/ui/compiled ui/compiled/*.php ui/cache/*.php test.php +sms.php pages/ system/cache/** system/plugin/* @@ -28,4 +30,13 @@ system/uploads/system/** !system/uploads/system/index.html ui/themes/** !ui/themes/index.html -!ui/themes/README.md \ No newline at end of file +!ui/themes/README.md +scanLang.php +system/lan/** +!system/lan/index.html +!system/lan/indonesia.json +!system/lan/spanish.json +!system/lan/turkish.json +!system/lan/english.json +!system/lan/country.json +*.zip \ No newline at end of file diff --git a/.htaccess_firewall b/.htaccess_firewall new file mode 100644 index 00000000..5d37c58f --- /dev/null +++ b/.htaccess_firewall @@ -0,0 +1,14 @@ + + Order Deny,Allow + Deny from all + + + + Order Allow,Deny + Allow from all + + + + Order Allow,Deny + Allow from all + \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 0cb9563e..785537da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,259 @@ # CHANGELOG +## 2024.3.26 + +- Change paginator, to make easy customization using pagination.tpl + +## 2024.3.25 + +- Fix maps on HTTP +- Fix Cancel payment + +## 2024.3.23 + +- Maps full height +- Show Get Directions instead Coordinates +- Maps Label always show + +## 2024.3.22 + +- Fix Broadcast Message by @Focuslinkstech +- Add Location Picker + +## 2024.3.20 + +- Fixing some bugs + +## 2024.3.19 + +- Add Customer Type Personal or Bussiness by @pro-cms +- Fix Broadcast Message by @Focuslinkstech +- Add Customer Geolocation by @Focuslinkstech +- Change Customer Menu + +## 2024.3.18 + +- Add Broadcasting SMS by @Focuslinkstech +- Fix Notification with Bills + +## 2024.3.16 + +- Fix Zero Charging +- Fix Disconnect Customer from Radius without loop by @Gerandonk + +## 2024.3.15 + +- Fix Customer View to list active Plan +- Additional Bill using Customer Attributes + +## 2024.3.14 + +- Add Note to Invoices +- Add Additional Bill +- View Invoice from Customer side + +## 2024.3.13 + +- Postpaid System +- Additional Cost + +## 2024.3.12 + +- Check if Validity Period, so calculate price will not affected other validity +- Add firewall using .htaccess for apache only +- Multiple Payment Gateway by @Focuslinkstech +- Fix Logic Multiple Payment gateway +- Fix delete Attribute +- Allow Delete Payment Gateway +- Allow Delete Plugin + +## 2024.3.6 + +- change attributes view + +## 2024.3.4 + +- add [[username]] for reminder +- fix agent show when editing +- fix password admin when sending notification +- add file exists for pages + +## 2024.3.3 + +- Change loading button by @Focuslinkstech +- Add Customer Announcements by @Gerandonk +- Add PPPOE Period Validity by @Gerandonk + +## 2024.2.29 + +- Fix Hook Functionality +- Change Customer Menu + +## 2024.2.28 + +- Fix Buy Plan with Balance +- Add Expired date for reminder + +## 2024.2.27 + +- fix path notification +- redirect to dashboard if already login + +## 2024.2.26 + +- Clean Unused JS and CSS +- Add some Authorization check +- Custom Path for folder +- fix some bugs + +## 2024.2.23 + +- Integrate with PhpNuxBill Printer +- Fix Invoice +- add admin ID in transaction + +## 2024.2.22 + +- Add Loading when click submit +- link to settings when hide widget + +## 2024.2.21 + +- Fix SQL Installer +- remove multiple space in language +- Change Phone Number require OTP by @Focuslinkstech +- Change burst Form +- Delete Table Responsive, first Column Freeze + +## 2024.2.20 + +- Fix list admin +- Burst Limit +- Pace Loading by @Focuslinkstech + +## 2024.2.19 + +- Start API Development +- Multiple Admin Level +- Customer Attributes by @Focuslinkstech +- Radius Menu + +## 2024.2.13 + +- Auto translate language +- change language structur to json +- save collapse menu + +## 2024.2.12 + +- Admin Level : SuperAdmin,Admin,Report,Agent,Sales +- Export Customers to CSV +- Session using Cookie + +## 2024.2.7 + +- Hide Dashboard content + +## 2024.2.6 + +- Cache graph for faster opening graph + +## 2024.2.5 + +- Admin Dashboard Update + - Add Monthly Registered Customers + - Total Monthly Sales + - Active Users + +## 2024.2.2 + +- Fix edit plan for user + +## 2024.1.24 + +- Add Send test for SMS, Whatsapp and Telegram + +## 2024.1.19 + +- Paid Plugin, Theme, and payment gateway marketplace using codecanyon.net +- Fix Plugin manager List + +## 2024.1.18 + +- fix(mikrotik): set pool $poolId always empty + +## 2024.1.17 + +- Add minor change, for plugin, menu can have notifications by @Focuslinkstech + +## 2024.1.16 + +- Add yellow color to table for plan not allowed to purchase +- Fix Radius pool select +- add price to reminder notification +- Support thermal printer for invoice + +## 2024.1.15 + +- Fix cron job for Plan only for admin by @Focuslinkstech + +## 2024.1.11 + +- Add Plan only for admin by @Focuslinkstech +- Fix Plugin Manager + +## 2024.1.9 + +- Add Prefix when generate Voucher + +## 2024.1.8 + +- User Expired Order by Expired Date + +## 2024.1.2 + +- Pagination User Expired by @Focuslinkstech + +## 2023.12.21 + +- Modern AdminLTE by @sabtech254 +- Update user-dashboard.tpl by @Focuslinkstech + +## 2023.12.19 + +- Fix Search Customer +- Disable Registration, Customer just activate voucher Code, and the voucher will be their password +- Remove all used voucher codes + +## 2023.12.18 + +- Split sms to 160 characters only for Mikrotik Modem + +## 2023.12.14 + +- Can send SMS using Mikrotik with Modem Installed +- Add Customer Type, so Customer can only show their PPPOE or Hotspot Package or both + +## 2023.11.17 + +- Error details not show in Customer + +## 2023.11.15 + +- Customer Multi Router package +- Fix edit package, Admin can change Customer to another router + +## 2023.11.9 + +- fix bug variable in cron +- fix update plan + +## 2023.10.27 + +- Backup and restore database +- Fix checking radius client + ## 2023.10.25 - fix wrong file check in cron, error only for newly installed @@ -115,7 +368,7 @@ Customer can be move to expired pool after plan expired by cron - Fix PDF Export by Period - Add pppoe_password for Customer, this pppoe_password only admin can change - Country Code Number Settings -- Customer Meta Table for Custom Fields +- Customer Meta Table for Customers Attributess - Fix Add and Edit Customer Form for admin - add Notification Message Editor - cron reminder diff --git a/README.md b/README.md index 3ced30b9..ff80cf01 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,13 @@ +[![ReadMeSupportPalestine](https://raw.githubusercontent.com/Safouene1/support-palestine-banner/master/banner-project.svg)](https://s.id/standwithpalestine) + # PHPNuxBill - PHP Mikrotik Billing ![PHPNuxBill](install/img/logo.png) -![StandWithPalestine](https://raw.githubusercontent.com/Safouene1/support-palestine-banner/master/StandWithPalestine.svg) - ## Feature - Voucher Generator and Print +- FreeRadius - Self registration - User Balance - Auto Renewal Package using Balance @@ -14,7 +15,7 @@ - Hotspot & PPPOE - Easy Installation - Multi Language -- Payment Gateway Midtrans, Xendit and Tripay +- Payment Gateway - SMS validation for login - Whatsapp Notification to Consumer - Telegram Notification for Admin @@ -35,7 +36,7 @@ Most current web servers with PHP & MySQL installed will be capable of running P Minimum Requirements - Linux or Windows OS -- PHP Version 7.4 +- Minimum PHP Version 7.4 - Both PDO & MySQLi Support - PHP-GD2 Image Library - PHP-CURL diff --git a/init.php b/init.php new file mode 100644 index 00000000..24dd9048 --- /dev/null +++ b/init.php @@ -0,0 +1,262 @@ +find_many(); +foreach ($result as $value) { + $config[$value['setting']] = $value['value']; +} +$_c = $config; +if (empty($http_proxy) && !empty($config['http_proxy'])) { + $http_proxy = $config['http_proxy']; + if (empty($http_proxyauth) && !empty($config['http_proxyauth'])) { + $http_proxyauth = $config['http_proxyauth']; + } +} +date_default_timezone_set($config['timezone']); + +if ((!empty($radius_user) && $config['radius_enable']) || _post('radius_enable')) { + ORM::configure("mysql:host=$radius_host;dbname=$radius_name", null, 'radius'); + ORM::configure('username', $radius_user, 'radius'); + ORM::configure('password', $radius_pass, 'radius'); + ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'), 'radius'); + ORM::configure('return_result_sets', true, 'radius'); +} + + +if (empty($config['language'])) { + $config['language'] = 'english'; +} +$lan_file = $root_path . File::pathFixer('system/lan/' . $config['language'] . '.json'); +if (file_exists($lan_file)) { + $_L = json_decode(file_get_contents($lan_file), true); + $_SESSION['Lang'] = $_L; +} else { + $_L['author'] = 'Auto Generated by iBNuX Script'; + $_SESSION['Lang'] = $_L; + file_put_contents($lan_file, json_encode($_L)); +} + + +function safedata($value) +{ + $value = trim($value); + return $value; +} + +function _post($param, $defvalue = '') +{ + if (!isset($_POST[$param])) { + return $defvalue; + } else { + return safedata($_POST[$param]); + } +} + +function _get($param, $defvalue = '') +{ + if (!isset($_GET[$param])) { + return $defvalue; + } else { + return safedata($_GET[$param]); + } +} + +function _req($param, $defvalue = '') +{ + if (!isset($_REQUEST[$param])) { + return $defvalue; + } else { + return safedata($_REQUEST[$param]); + } +} + + +function _auth($login = true) +{ + if (User::getID()) { + return true; + } else { + if ($login) { + r2(U . 'login'); + } else { + return false; + } + } +} + +function _admin($login = true) +{ + if (Admin::getID()) { + return true; + } else { + if ($login) { + r2(U . 'login'); + } else { + return false; + } + } +} + + +function _log($description, $type = '', $userid = '0') +{ + $d = ORM::for_table('tbl_logs')->create(); + $d->date = date('Y-m-d H:i:s'); + $d->type = $type; + $d->description = $description; + $d->userid = $userid; + $d->ip = $_SERVER["REMOTE_ADDR"]; + $d->save(); +} + +function Lang($key) +{ + return Lang::T($key); +} + +function alphanumeric($str, $tambahan = "") +{ + return preg_replace("/[^a-zA-Z0-9" . $tambahan . "]+/", "", $str); +} + + +function sendTelegram($txt) +{ + Message::sendTelegram($txt); +} + +function sendSMS($phone, $txt) +{ + Message::sendSMS($phone, $txt); +} + +function sendWhatsapp($phone, $txt) +{ + Message::sendWhatsapp($phone, $txt); +} + +function r2($to, $ntype = 'e', $msg = '') +{ + if ($msg == '') { + header("location: $to"); + exit; + } + $_SESSION['ntype'] = $ntype; + $_SESSION['notify'] = $msg; + header("location: $to"); + exit; +} + +function _alert($text, $type = 'success', $url = "home", $time = 3) +{ + global $ui; + if (!isset($ui)) return; + if (strlen($url) > 4) { + if (substr($url, 0, 4) != "http") { + $url = U . $url; + } + } else { + $url = U . $url; + } + $ui->assign('text', $text); + $ui->assign('type', $type); + $ui->assign('time', $time); + $ui->assign('url', $url); + $ui->display('alert.tpl'); + die(); +} + + +if (!isset($api_secret)) { + $api_secret = $db_password; +} diff --git a/install/phpnuxbill.sql b/install/phpnuxbill.sql index ece02bcf..0d41fd30 100644 --- a/install/phpnuxbill.sql +++ b/install/phpnuxbill.sql @@ -21,24 +21,20 @@ 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, - `pppoe_password` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '1' COMMENT 'For PPPOE Login', + `pppoe_password` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'For PPPOE Login', `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', + `coordinates` VARCHAR(50) NOT NULL DEFAULT '' COMMENT 'Latitude and Longitude coordinates', `balance` decimal(15,2) NOT NULL DEFAULT '0.00' COMMENT 'For Money Deposit', + `service_type` ENUM('Hotspot','PPPoE','Others') DEFAULT 'Others' COMMENT 'For selecting user type', + `account_type` ENUM('Business', 'Personal') DEFAULT 'Personal' COMMENT 'For selecting account type', `auto_renewal` tinyint(1) NOT NULL DEFAULT '1' COMMENT 'Auto renewall using balance', `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `last_login` datetime DEFAULT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; -DROP TABLE IF EXISTS `tbl_customers_meta`; -CREATE TABLE `tbl_customers_meta` ( - `id` int(11) NOT NULL, - `customer_id` int(11) NOT NULL, - `meta_key` varchar(64) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', - `meta_value` longtext COLLATE utf8mb4_general_ci -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; DROP TABLE IF EXISTS `tbl_logs`; CREATE TABLE `tbl_logs` ( @@ -85,25 +81,27 @@ CREATE TABLE `tbl_payment_gateway` ( DROP TABLE IF EXISTS `tbl_plans`; CREATE TABLE `tbl_plans` ( - `id` int(10) NOT NULL, - `name_plan` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `id_bw` int(10) NOT NULL, - `price` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `type` enum('Hotspot','PPPOE','Balance') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `typebp` enum('Unlimited','Limited') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, - `limit_type` enum('Time_Limit','Data_Limit','Both_Limit') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, - `time_limit` int(10) UNSIGNED DEFAULT NULL, - `time_unit` enum('Mins','Hrs') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, - `data_limit` int(10) UNSIGNED DEFAULT NULL, - `data_unit` enum('MB','GB') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, - `validity` int(10) NOT NULL, - `validity_unit` enum('Mins','Hrs','Days','Months') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `shared_users` int(10) DEFAULT NULL, - `routers` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `is_radius` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1 is radius', - `pool` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, - `pool_expired` varchar(40) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', - `enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0 disabled\r\n' + `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','Balance') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `typebp` enum('Unlimited','Limited') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `limit_type` enum('Time_Limit','Data_Limit','Both_Limit') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `time_limit` int(10) UNSIGNED DEFAULT NULL, + `time_unit` enum('Mins','Hrs') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `data_limit` int(10) UNSIGNED DEFAULT NULL, + `data_unit` enum('MB','GB') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `validity` int(10) NOT NULL, + `validity_unit` enum('Mins','Hrs','Days','Months','Period') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `shared_users` int(10) DEFAULT NULL, + `routers` varchar(32) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `is_radius` tinyint(1) NOT NULL DEFAULT '0' COMMENT '1 is radius', + `pool` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci DEFAULT NULL, + `pool_expired` varchar(40) COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', + `enabled` tinyint(1) NOT NULL DEFAULT '1' COMMENT '0 disabled', + `allow_purchase` enum('yes','no') DEFAULT 'yes' COMMENT 'allow to show package in buy package page', + `plan_type` ENUM('Business', 'Personal') DEFAULT 'Personal' COMMENT 'For switching plan according to user type' ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; DROP TABLE IF EXISTS `tbl_pool`; @@ -147,7 +145,7 @@ CREATE TABLE `tbl_users` ( `username` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `fullname` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `password` mediumtext CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, - `user_type` enum('Admin','Sales') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, + `user_type` enum('SuperAdmin','Admin','Report','Agent','Sales') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL, `status` enum('Active','Inactive') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT 'Active', `last_login` datetime DEFAULT NULL, `creationdate` datetime NOT NULL @@ -186,7 +184,6 @@ CREATE TABLE `tb_languages` ( `id` int(11) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; - ALTER TABLE `tbl_appconfig` ADD PRIMARY KEY (`id`); @@ -196,9 +193,6 @@ ALTER TABLE `tbl_bandwidth` ALTER TABLE `tbl_customers` ADD PRIMARY KEY (`id`); -ALTER TABLE `tbl_customers_meta` - ADD PRIMARY KEY (`id`); - ALTER TABLE `tbl_logs` ADD PRIMARY KEY (`id`); @@ -239,9 +233,6 @@ ALTER TABLE `tbl_bandwidth` ALTER TABLE `tbl_customers` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT; -ALTER TABLE `tbl_customers_meta` - MODIFY `id` int(11) NOT NULL AUTO_INCREMENT; - ALTER TABLE `tbl_logs` MODIFY `id` int(10) NOT NULL AUTO_INCREMENT; @@ -280,7 +271,7 @@ ALTER TABLE `tbl_voucher` INSERT INTO `tbl_appconfig` (`id`, `setting`, `value`) -VALUES (1, 'CompanyName', 'PHPNuxBill'), (2, 'currency_code', 'Rp.'), (3, 'language', 'indonesia'), (4, 'show-logo', '1'), (5, 'nstyle', 'blue'), (6, 'timezone', 'Asia/Jakarta'), (7, 'dec_point', ','), (8, 'thousands_sep', '.'), (9, 'rtl', '0'), (10, 'address', ''), (11, 'phone', ''), (12, 'date_format', 'd M Y'), (13, 'note', 'Thank you...'); +VALUES (1, 'CompanyName', 'PHPNuxBill'), (2, 'currency_code', 'Rp.'), (3, 'language', 'english'), (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...'); -- @@ -304,8 +295,29 @@ VALUES ( 'admin', 'Administrator', 'd033e22ae348aeb5660fc2140aec35850c4da997', - 'Admin', + 'SuperAdmin', 'Active', '2022-09-06 16:09:50', '2014-06-23 01:43:07' - ); \ No newline at end of file + ); + +DROP TABLE IF EXISTS `tbl_customers_fields`; +CREATE TABLE tbl_customers_fields ( + id INT PRIMARY KEY AUTO_INCREMENT, + customer_id INT NOT NULL, + field_name VARCHAR(255) NOT NULL, + field_value VARCHAR(255) NOT NULL, + FOREIGN KEY (customer_id) REFERENCES tbl_customers(id) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; + +ALTER TABLE `tbl_voucher` ADD `generated_by` INT NOT NULL DEFAULT '0' COMMENT 'id admin' AFTER `status`; +ALTER TABLE `tbl_users` ADD `root` INT NOT NULL DEFAULT '0' COMMENT 'for sub account' AFTER `id`; +ALTER TABLE `tbl_users` CHANGE `password` `password` VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL; +ALTER TABLE `tbl_users` ADD `phone` VARCHAR(32) NOT NULL DEFAULT '' AFTER `password`, ADD `email` VARCHAR(128) NOT NULL DEFAULT '' AFTER `phone`, ADD `city` VARCHAR(64) NOT NULL DEFAULT '' COMMENT 'kota' AFTER `email`, ADD `subdistrict` VARCHAR(64) NOT NULL DEFAULT '' COMMENT 'kecamatan' AFTER `city`, ADD `ward` VARCHAR(64) NOT NULL DEFAULT '' COMMENT 'kelurahan' AFTER `subdistrict`; +ALTER TABLE `tbl_customers` ADD `created_by` INT NOT NULL DEFAULT '0' AFTER `auto_renewal`; +ALTER TABLE `tbl_plans` ADD `list_expired` VARCHAR(32) NOT NULL DEFAULT '' COMMENT 'address list' AFTER `pool_expired`; +ALTER TABLE `tbl_bandwidth` ADD `burst` VARCHAR(128) NOT NULL DEFAULT '' AFTER `rate_up_unit`; +ALTER TABLE `tbl_transactions` ADD `admin_id` INT NOT NULL DEFAULT '1' AFTER `type`; +ALTER TABLE `tbl_user_recharges` ADD `admin_id` INT NOT NULL DEFAULT '1' AFTER `type`; +ALTER TABLE `tbl_plans` CHANGE `allow_purchase` `prepaid` ENUM('yes','no') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'yes' COMMENT 'is prepaid'; +ALTER TABLE `tbl_transactions` ADD `note` VARCHAR(256) NOT NULL DEFAULT '' COMMENT 'for note' AFTER `type`; diff --git a/install/radius.sql b/install/radius.sql index fbe9879d..475da5b6 100644 --- a/install/radius.sql +++ b/install/radius.sql @@ -102,6 +102,13 @@ CREATE TABLE `radusergroup` ( ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci; +DROP TABLE IF EXISTS `nasreload`; +CREATE TABLE `nasreload` ( + nasipaddress varchar(15) NOT NULL, + reloadtime datetime NOT NULL, + PRIMARY KEY (nasipaddress) +) ENGINE = INNODB; + ALTER TABLE `nas` ADD PRIMARY KEY (`id`), ADD KEY `nasname` (`nasname`); diff --git a/install/step4.php b/install/step4.php index d5ced38f..1f8f1645 100644 --- a/install/step4.php +++ b/install/step4.php @@ -25,7 +25,7 @@ try { } if ($cn == '1') { - if ($_POST['radius'] == 'yes') { + if (isset($_POST['radius']) && $_POST['radius'] == 'yes') { $input = 'exec($sql); - if ($_POST['radius'] == 'yes') { + if (isset($_POST['radius']) && $_POST['radius'] == 'yes') { $sql = file_get_contents('radius.sql'); $qrs = $dbh->exec($sql); } diff --git a/pages_template/Announcement.html b/pages_template/Announcement.html index 3f0a6c99..4eec3810 100644 --- a/pages_template/Announcement.html +++ b/pages_template/Announcement.html @@ -1 +1,3 @@ -Pengumuman!!
Besok libur

Announcement!!
Tomorrow holiday
\ No newline at end of file +Pengumuman!!
Besok libur

Announcement!!
Tomorrow holiday

+
+This Announcement is for Login Page. \ No newline at end of file diff --git a/pages_template/Announcement_Customer.html b/pages_template/Announcement_Customer.html new file mode 100644 index 00000000..4eaa8063 --- /dev/null +++ b/pages_template/Announcement_Customer.html @@ -0,0 +1,8 @@ +Pengumuman Pelanggan!!
+Besok libur
+
+Customer Announcement!!
+Tomorrow holiday
+
+
+This Announcement is for Customer Dashboard \ No newline at end of file diff --git a/system/.htaccess b/system/.htaccess new file mode 100644 index 00000000..5fd3ff11 --- /dev/null +++ b/system/.htaccess @@ -0,0 +1,19 @@ + + Order Deny,Allow + Deny from all + + + + Order Allow,Deny + Allow from all + + + + Order Allow,Deny + Allow from all + + + + Order Allow,Deny + Allow from all + \ No newline at end of file diff --git a/system/api.php b/system/api.php new file mode 100644 index 00000000..cbcccf9e --- /dev/null +++ b/system/api.php @@ -0,0 +1,107 @@ +assign[$key] = $value; + } + + function get($key, ) + { + if(isset($this->assign[$key])){ + return $this->assign[$key]; + } + return ''; + } +}; + +$req = _get('r'); +# a/c.id.time.md5 +# md5(a/c.id.time.$api_secret) +$token = _get('token'); +$routes = explode('/', $req); +$handler = $routes[0]; + +if(empty($token)){ + showResult(false, Lang::T("Token is invalid")); +} + +if($token == $config['api_key']){ + $admin = ORM::for_table('tbl_users')->where('user_type','SuperAdmin')->find_one($id); + if(empty($admin)){ + $admin = ORM::for_table('tbl_users')->where('user_type','Admin')->find_one($id); + if(empty($admin)){ + showResult(false, Lang::T("Token is invalid")); + } + } +}else{ + # validate token + list($tipe, $uid, $time, $md5) = explode('.', $token); + if ($md5 != md5($uid . '.' . $time . '.' . $api_secret)) { + showResult(false, Lang::T("Token is invalid")); + } + + #cek token expiration + if ($time != 0 && time() > $time) { + showResult(false, Lang::T("Token Expired"), [], ['login' => true]); + } + + if($tipe=='a'){ + $_SESSION['aid'] = $uid; + }else if($tipe=='c'){ + $_SESSION['uid'] = $uid; + }else{ + showResult(false, Lang::T("Unknown Token"), [], ['login' => true]); + } +} + +if(!isset($handler) || empty($handler)){ + showResult(true, Lang::T("Token is valid")); +} + + +if($handler == 'isValid'){ + showResult(true, Lang::T("Token is valid")); +} + +function showResult($success, $message = '', $result = [], $meta = []) +{ + header("Content-Type: Application/json; charset=utf-8"); + die(json_encode(array('success' => $success, 'message' => $message, 'result' => $result, 'meta' => $meta))); +} + +try { + $sys_render = File::pathFixer($root_path.'system/controllers/' . $handler . '.php'); + if (file_exists($sys_render)) { + include($sys_render); + }else{ + showResult(false, Lang::T('Command not found')); + } +} catch (Exception $e) { + showResult(false, $e->getMessage()); +} diff --git a/system/autoload/Admin.php b/system/autoload/Admin.php index 1d9edcb4..cab30813 100644 --- a/system/autoload/Admin.php +++ b/system/autoload/Admin.php @@ -1,14 +1,57 @@ find_one($id); - return $d; +class Admin +{ + + public static function getID() + { + global $db_password; + if (isset($_SESSION['aid'])) { + return $_SESSION['aid']; + } else if (isset($_COOKIE['aid'])) { + // id.time.sha1 + $tmp = explode('.', $_COOKIE['aid']); + if (sha1($tmp[0] . '.' . $tmp[1] . '.' . $db_password) == $tmp[2]) { + if (time() - $tmp[1] < 86400 * 7) { + $_SESSION['aid'] = $tmp[0]; + return $tmp[0]; + } + } + } + return 0; } -} \ No newline at end of file + + public static function setCookie($aid) + { + global $db_password; + if (isset($aid)) { + $time = time(); + setcookie('aid', $aid . '.' . $time . '.' . sha1($aid . '.' . $time . '.' . $db_password), time() + 86400 * 7); + } + } + + public static function removeCookie() + { + if (isset($_COOKIE['aid'])) { + setcookie('aid', '', time() - 86400); + } + } + + public static function _info($id = 0) + { + if (empty($id) && $id == 0) { + $id = Admin::getID(); + } + if ($id) { + return ORM::for_table('tbl_users')->find_one($id); + } else { + return null; + } + } +} diff --git a/system/autoload/Hookers.php b/system/autoload/Hookers.php index 58d89fc0..f15d0a96 100644 --- a/system/autoload/Hookers.php +++ b/system/autoload/Hookers.php @@ -16,8 +16,11 @@ $menu_registered = array(); * Admin/Sales menu: AFTER_DASHBOARD, CUSTOMERS, PREPAID, SERVICES, REPORTS, VOUCHER, AFTER_ORDER, NETWORK, SETTINGS, AFTER_PAYMENTGATEWAY * | Customer menu: AFTER_DASHBOARD, ORDER, HISTORY, ACCOUNTS * @param string icon from ion icon, ion-person, only for AFTER_ + * @param string label for showing label or number of notification or update + * @param string color Label color + * @param string auth authorization ['SuperAdmin', 'Admin', 'Report', 'Agent', 'Sales'] will only show in this user, empty array for all users */ -function register_menu($name, $admin, $function, $position, $icon = '') +function register_menu($name, $admin, $function, $position, $icon = '', $label = '', $color = 'success', $auth = []) { global $menu_registered; $menu_registered[] = [ @@ -25,13 +28,17 @@ function register_menu($name, $admin, $function, $position, $icon = '') "admin" => $admin, "position" => $position, "icon" => $icon, - "function" => $function + "function" => $function, + "label" => $label, + "color" => $color, + "auth" => $auth ]; } $hook_registered = array(); function register_hook($action, $function){ + global $hook_registered; $hook_registered[] = [ 'action' => $action, 'function' => $function @@ -48,4 +55,3 @@ function run_hook($action){ } } } - diff --git a/system/autoload/Lang.php b/system/autoload/Lang.php index 6736c700..385bb06a 100644 --- a/system/autoload/Lang.php +++ b/system/autoload/Lang.php @@ -8,9 +8,50 @@ class Lang { - public static function T($var) + public static function T($key) { - return Lang($var); + global $_L, $lan_file, $config; + $_L = $_SESSION['Lang']; + $key = preg_replace('/\s+/', ' ', $key); + if (!empty($_L[$key])) { + return $_L[$key]; + } + $val = $key; + $key = Lang::sanitize($key); + if (isset($_L[$key])) { + return $_L[$key]; + } else if (isset($_L[$key])) { + return $_L[$key]; + } else { + $iso = Lang::getIsoLang()[$config['language']]; + if (empty($iso)) { + return $val; + } + if (!empty($iso) && !empty($val)) { + $temp = Lang::translate($val, $iso); + if (!empty($temp)) { + $val = $temp; + } + } + $_L[$key] = $val; + $_SESSION['Lang'][$key] = $val; + file_put_contents($lan_file, json_encode($_SESSION['Lang'], JSON_PRETTY_PRINT)); + return $val; + } + } + + public static function sanitize($str) + { + return preg_replace("/[^A-Za-z0-9]/", '_', $str);; + } + + public static function getIsoLang() + { + global $isolang; + if (empty($isolang) || count($isolang) == 0) { + $isolang = json_decode(file_get_contents(File::pathFixer("system/lan/country.json")), true); + } + return $isolang; } public static function htmlspecialchars($var) @@ -56,6 +97,37 @@ class Lang return date($config['date_format'] . ' H:i', strtotime("$date $time")); } + public static function timeElapsed($datetime, $full = false) + { + $now = new DateTime; + $ago = new DateTime($datetime); + $diff = $now->diff($ago); + + $diff->w = floor($diff->d / 7); + $diff->d -= $diff->w * 7; + + $string = array( + 'y' => Lang::T('year'), + 'm' => Lang::T('month'), + 'w' => Lang::T('week'), + 'd' => Lang::T('day'), + 'h' => Lang::T('hour'), + 'i' => Lang::T('minute'), + 's' => Lang::T('second'), + ); + foreach ($string as $k => &$v) { + if ($diff->$k) { + $v = $diff->$k . ' ' . $v . ($diff->$k > 1 ? 's' : ''); + } else { + unset($string[$k]); + } + } + + if (!$full) + $string = array_slice($string, 0, 1); + return $string ? implode(', ', $string) . ' ago' : 'just now'; + } + public static function nl2br($text) { return nl2br($text); @@ -87,16 +159,88 @@ class Lang return ucwords(str_replace('_', ' ', $text)); } - public static function randomUpLowCase($text){ + public static function randomUpLowCase($text) + { $jml = strlen($text); $result = ''; - for($i = 0; $i < $jml;$i++){ - if(rand(0,99)%2){ - $result .= strtolower(substr($text,$i,1)); - }else{ - $result .= substr($text,$i,1); + for ($i = 0; $i < $jml; $i++) { + if (rand(0, 99) % 2) { + $result .= strtolower(substr($text, $i, 1)); + } else { + $result .= substr($text, $i, 1); } } return $result; } + + /** + * $pad_type + * 0 Left + * 1 right + * 2 center + * */ + public static function pad($text, $pad_string = ' ', $pad_type = 0) + { + global $config; + $cols = 37; + if ($config['printer_cols']) { + $cols = $config['printer_cols']; + } + $text = trim($text); + $texts = explode("\n", $text); + if (count($texts) > 1) { + $text = ''; + foreach ($texts as $t) { + $text .= self::pad(trim($t), $pad_string, $pad_type) . "\n"; + } + return $text; + } else { + return str_pad(trim($text), $cols, $pad_string, $pad_type); + } + } + + public static function pads($textLeft, $textRight, $pad_string = ' ') + { + global $config; + $cols = 37; + if ($config['printer_cols']) { + $cols = $config['printer_cols']; + } + return $textLeft . str_pad($textRight, $cols - strlen($textLeft), $pad_string, 0); + } + + public static function translate($txt, $to = 'id') + { + $ch = curl_init(); + curl_setopt($ch, CURLOPT_URL, "https://translate.google.com/m?hl=en&sl=en&tl=$to&ie=UTF-8&prev=_m&q=" . urlencode($txt)); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); + curl_setopt($ch, CURLOPT_USERAGENT, "Mozilla/5.0 (iPhone; CPU OS 13_5 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) FxiOS/28.1 Mobile/15E148 Safari/605.1.15"); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 2); + curl_setopt($ch, CURLOPT_TIMEOUT, 5); + curl_setopt($ch, CURLOPT_HEADER, 0); + $hasil = curl_exec($ch); + curl_close($ch); + $temp = explode('
', $hasil); + if (count($temp) > 0) { + $temp = explode("create(); + $d->date = date('Y-m-d H:i:s'); + $d->type = $type; + $d->description = $description; + $d->userid = $userid; + $d->ip = (empty($username)) ? $_SERVER["REMOTE_ADDR"] : $username; + $d->save(); + } + + public static function arrayToText($array, $start = '', $result = '') + { + foreach ($array as $k => $v) { + if (is_array($v)) { + $result = Log::arrayToText($v, "$start$k.", $result); + } else { + $result .= $start.$k ." : ". strval($v) ."\n"; + } + } + return $result; + } +} \ No newline at end of file diff --git a/system/autoload/Message.php b/system/autoload/Message.php index aab67ed2..b4c3cccc 100644 --- a/system/autoload/Message.php +++ b/system/autoload/Message.php @@ -5,6 +5,12 @@ * by https://t.me/ibnux **/ +use PHPMailer\PHPMailer\PHPMailer; +use PHPMailer\PHPMailer\Exception; +use PHPMailer\PHPMailer\SMTP; +require $root_path . 'system/autoload/mail/Exception.php'; +require $root_path . 'system/autoload/mail/PHPMailer.php'; +require $root_path . 'system/autoload/mail/SMTP.php'; class Message { @@ -14,7 +20,7 @@ class Message global $config; run_hook('send_telegram'); #HOOK if (!empty($config['telegram_bot']) && !empty($config['telegram_target_id'])) { - Http::getData('https://api.telegram.org/bot' . $config['telegram_bot'] . '/sendMessage?chat_id=' . $config['telegram_target_id'] . '&text=' . urlencode($txt)); + return Http::getData('https://api.telegram.org/bot' . $config['telegram_bot'] . '/sendMessage?chat_id=' . $config['telegram_target_id'] . '&text=' . urlencode($txt)); } } @@ -24,9 +30,34 @@ class Message global $config; run_hook('send_sms'); #HOOK if (!empty($config['sms_url'])) { - $smsurl = str_replace('[number]', urlencode($phone), $config['sms_url']); - $smsurl = str_replace('[text]', urlencode($txt), $smsurl); - Http::getData($smsurl); + if (strlen($config['sms_url']) > 4 && substr($config['sms_url'], 0, 4) != "http") { + if (strlen($txt) > 160) { + $txts = str_split($txt, 160); + try { + $mikrotik = Mikrotik::info($config['sms_url']); + $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); + foreach ($txts as $txt) { + Mikrotik::sendSMS($client, $phone, $txt); + } + } catch (Exception $e) { + // ignore, add to logs + _log("Failed to send SMS using Mikrotik.\n" . $e->getMessage(), 'SMS', 0); + } + } else { + try { + $mikrotik = Mikrotik::info($config['sms_url']); + $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); + Mikrotik::sendSMS($client, $phone, $txt); + } catch (Exception $e) { + // ignore, add to logs + _log("Failed to send SMS using Mikrotik.\n" . $e->getMessage(), 'SMS', 0); + } + } + } else { + $smsurl = str_replace('[number]', urlencode($phone), $config['sms_url']); + $smsurl = str_replace('[text]', urlencode($txt), $smsurl); + return Http::getData($smsurl); + } } } @@ -35,24 +66,68 @@ class Message global $config; run_hook('send_whatsapp'); #HOOK if (!empty($config['wa_url'])) { - $waurl = str_replace('[number]', urlencode($phone), $config['wa_url']); + $waurl = str_replace('[number]', urlencode(Lang::phoneFormat($phone)), $config['wa_url']); $waurl = str_replace('[text]', urlencode($txt), $waurl); - Http::getData($waurl); + return Http::getData($waurl); } } - public static function sendPackageNotification($phone, $name, $package, $message, $via) + public static function sendEmail($to, $subject, $body) { - $msg = str_replace('[[name]]', "*$name*", $message); - $msg = str_replace('[[package]]', "*$package*", $msg); + global $config; + run_hook('send_email'); #HOOK + if (empty($config['smtp_host'])) { + $attr = ""; + if (!empty($config['mail_from'])) { + $attr .= "From: " . $config['mail_from'] . "\r\n"; + } + if (!empty($config['mail_reply_to'])) { + $attr .= "Reply-To: " . $config['mail_reply_to'] . "\r\n"; + } + mail($to, $subject, $body, $attr); + } else { + $mail = new PHPMailer(); + $mail->isSMTP(); + $mail->SMTPDebug = SMTP::DEBUG_SERVER; + $mail->Host = $config['smtp_host']; + $mail->SMTPAuth = true; + $mail->Username = $config['smtp_user']; + $mail->Password = $config['smtp_pass']; + $mail->SMTPSecure = $config['smtp_ssltls']; + $mail->Port = $config['smtp_port']; + if (!empty($config['mail_from'])) { + $mail->setFrom($config['mail_from']); + } + if (!empty($config['mail_reply_to'])) { + $mail->addReplyTo($config['mail_reply_to']); + } + $mail->isHTML(false); + $mail->addAddress($to); + $mail->Subject = $subject; + $mail->Body = $body; + $mail->send(); + die(); + } + } + + public static function sendPackageNotification($customer, $package, $price, $message, $via) + { + global $u; + $msg = str_replace('[[name]]', $customer['fullname'], $message); + $msg = str_replace('[[username]]', $customer['username'], $msg); + $msg = str_replace('[[package]]', $package, $msg); + $msg = str_replace('[[price]]', $price, $msg); + if ($u) { + $msg = str_replace('[[expired_date]]', Lang::dateAndTimeFormat($u['expiration'], $u['time']), $msg); + } if ( - !empty($phone) && strlen($phone) > 5 + !empty($customer['phonenumber']) && strlen($customer['phonenumber']) > 5 && !empty($message) && in_array($via, ['sms', 'wa']) ) { if ($via == 'sms') { - Message::sendSMS($phone, $msg); + Message::sendSMS($customer['phonenumber'], $msg); } else if ($via == 'wa') { - Message::sendWhatsapp($phone, $msg); + Message::sendWhatsapp($customer['phonenumber'], $msg); } } return "$via: $msg"; @@ -60,9 +135,9 @@ class Message public static function sendBalanceNotification($phone, $name, $balance, $balance_now, $message, $via) { - $msg = str_replace('[[name]]', "*$name*", $message); + $msg = str_replace('[[name]]', $name, $message); $msg = str_replace('[[current_balance]]', Lang::moneyFormat($balance_now), $msg); - $msg = str_replace('[[balance]]', "*" . Lang::moneyFormat($balance) . "*", $msg); + $msg = str_replace('[[balance]]', Lang::moneyFormat($balance), $msg); if ( !empty($phone) && strlen($phone) > 5 && !empty($message) && in_array($via, ['sms', 'wa']) @@ -76,7 +151,8 @@ class Message return "$via: $msg"; } - public static function sendInvoice($cust, $trx){ + public static function sendInvoice($cust, $trx) + { global $config; $textInvoice = Lang::getNotifText('invoice_paid'); $textInvoice = str_replace('[[company_name]]', $config['CompanyName'], $textInvoice); @@ -84,14 +160,21 @@ class Message $textInvoice = str_replace('[[phone]]', $config['phone'], $textInvoice); $textInvoice = str_replace('[[invoice]]', $trx['invoice'], $textInvoice); $textInvoice = str_replace('[[date]]', Lang::dateAndTimeFormat($trx['recharged_on'], $trx['recharged_time']), $textInvoice); - $textInvoice = str_replace('[[payment_gateway]]', $config['gateway'], $textInvoice); - $textInvoice = str_replace('[[payment_channel]]', $config['channel'], $textInvoice); + if (!empty($trx['note'])) { + $textInvoice = str_replace('[[note]]', $trx['note'], $textInvoice); + } + $gc = explode("-", $trx['method']); + $textInvoice = str_replace('[[payment_gateway]]', trim($gc[0]), $textInvoice); + $textInvoice = str_replace('[[payment_channel]]', trim($gc[1]), $textInvoice); $textInvoice = str_replace('[[type]]', $trx['type'], $textInvoice); $textInvoice = str_replace('[[plan_name]]', $trx['plan_name'], $textInvoice); $textInvoice = str_replace('[[plan_price]]', Lang::moneyFormat($trx['price']), $textInvoice); $textInvoice = str_replace('[[name]]', $cust['fullname'], $textInvoice); + $textInvoice = str_replace('[[note]]', $cust['note'], $textInvoice); $textInvoice = str_replace('[[user_name]]', $trx['username'], $textInvoice); $textInvoice = str_replace('[[user_password]]', $cust['password'], $textInvoice); + $textInvoice = str_replace('[[username]]', $trx['username'], $textInvoice); + $textInvoice = str_replace('[[password]]', $cust['password'], $textInvoice); $textInvoice = str_replace('[[expired_date]]', Lang::dateAndTimeFormat($trx['expiration'], $trx['time']), $textInvoice); $textInvoice = str_replace('[[footer]]', $config['note'], $textInvoice); diff --git a/system/autoload/Mikrotik.php b/system/autoload/Mikrotik.php index 8c89a170..d917582a 100644 --- a/system/autoload/Mikrotik.php +++ b/system/autoload/Mikrotik.php @@ -1,4 +1,5 @@ assign("error_title", "Mikrotik Connection Error"); - // $ui->assign("error_message", "Unable to connect to the router : $ip
" . $e->getMessage() . '
' . $e->getTraceAsString() . '
'); - // $ui->display('router-error.tpl'); - // die(); - // } + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } + $iport = explode(":", $ip); + return new RouterOS\Client($iport[0], $user, $pass, ($iport[1]) ? $iport[1] : null); } public static function isUserLogin($client, $username) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $printRequest = new RouterOS\Request( '/ip hotspot active print', RouterOS\Query::where('user', $username) @@ -38,6 +39,10 @@ class Mikrotik public static function logMeIn($client, $user, $pass, $ip, $mac) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $addRequest = new RouterOS\Request('/ip/hotspot/active/login'); $client->sendSync( $addRequest @@ -50,13 +55,17 @@ class Mikrotik public static function logMeOut($client, $user) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $printRequest = new RouterOS\Request( '/ip hotspot active print', RouterOS\Query::where('user', $user) ); $id = $client->sendSync($printRequest)->getProperty('.id'); $removeRequest = new RouterOS\Request('/ip/hotspot/active/remove'); - $client( + $client->sendSync( $removeRequest ->setArgument('numbers', $id) ); @@ -64,6 +73,10 @@ class Mikrotik public static function addHotspotPlan($client, $name, $sharedusers, $rate) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $addRequest = new RouterOS\Request('/ip/hotspot/user/profile/add'); $client->sendSync( $addRequest @@ -75,6 +88,10 @@ class Mikrotik public static function setHotspotPlan($client, $name, $sharedusers, $rate) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $printRequest = new RouterOS\Request( '/ip hotspot user profile print .proplist=.id', RouterOS\Query::where('name', $name) @@ -84,7 +101,7 @@ class Mikrotik Mikrotik::addHotspotPlan($client, $name, $sharedusers, $rate); } else { $setRequest = new RouterOS\Request('/ip/hotspot/user/profile/set'); - $client( + $client->sendSync( $setRequest ->setArgument('numbers', $profileID) ->setArgument('shared-users', $sharedusers) @@ -95,6 +112,10 @@ class Mikrotik public static function setHotspotExpiredPlan($client, $name, $pool) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $printRequest = new RouterOS\Request( '/ip hotspot user profile print .proplist=.id', RouterOS\Query::where('name', $name) @@ -111,7 +132,7 @@ class Mikrotik ); } else { $setRequest = new RouterOS\Request('/ip/hotspot/user/profile/set'); - $client( + $client->sendSync( $setRequest ->setArgument('numbers', $profileID) ->setArgument('shared-users', 3) @@ -123,6 +144,10 @@ class Mikrotik public static function removeHotspotPlan($client, $name) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $printRequest = new RouterOS\Request( '/ip hotspot user profile print .proplist=.id', RouterOS\Query::where('name', $name) @@ -130,7 +155,7 @@ class Mikrotik $profileID = $client->sendSync($printRequest)->getProperty('.id'); $removeRequest = new RouterOS\Request('/ip/hotspot/user/profile/remove'); - $client( + $client->sendSync( $removeRequest ->setArgument('numbers', $profileID) ); @@ -138,13 +163,17 @@ class Mikrotik public static function removeHotspotUser($client, $username) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $printRequest = new RouterOS\Request( '/ip hotspot user print .proplist=.id', RouterOS\Query::where('name', $username) ); $userID = $client->sendSync($printRequest)->getProperty('.id'); $removeRequest = new RouterOS\Request('/ip/hotspot/user/remove'); - $client( + $client->sendSync( $removeRequest ->setArgument('numbers', $userID) ); @@ -152,6 +181,10 @@ class Mikrotik public static function addHotspotUser($client, $plan, $customer) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $addRequest = new RouterOS\Request('/ip/hotspot/user/add'); if ($plan['typebp'] == "Limited") { if ($plan['limit_type'] == "Time_Limit") { @@ -216,6 +249,10 @@ class Mikrotik public static function setHotspotUser($client, $user, $pass) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $printRequest = new RouterOS\Request('/ip/hotspot/user/print'); $printRequest->setArgument('.proplist', '.id'); $printRequest->setQuery(RouterOS\Query::where('name', $user)); @@ -229,6 +266,10 @@ class Mikrotik public static function setHotspotUserPackage($client, $user, $plan) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $printRequest = new RouterOS\Request('/ip/hotspot/user/print'); $printRequest->setArgument('.proplist', '.id'); $printRequest->setQuery(RouterOS\Query::where('name', $user)); @@ -242,6 +283,10 @@ class Mikrotik public static function removeHotspotActiveUser($client, $username) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $onlineRequest = new RouterOS\Request('/ip/hotspot/active/print'); $onlineRequest->setArgument('.proplist', '.id'); $onlineRequest->setQuery(RouterOS\Query::where('user', $username)); @@ -254,7 +299,10 @@ class Mikrotik public static function removePpoeUser($client, $username) { - + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $printRequest = new RouterOS\Request('/ppp/secret/print'); //$printRequest->setArgument('.proplist', '.id'); $printRequest->setQuery(RouterOS\Query::where('name', $username)); @@ -266,6 +314,10 @@ class Mikrotik public static function addPpoeUser($client, $plan, $customer) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $addRequest = new RouterOS\Request('/ppp/secret/add'); if (!empty($customer['pppoe_password'])) { $pass = $customer['pppoe_password']; @@ -284,6 +336,10 @@ class Mikrotik public static function setPpoeUser($client, $user, $pass) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $printRequest = new RouterOS\Request('/ppp/secret/print'); $printRequest->setArgument('.proplist', '.id'); $printRequest->setQuery(RouterOS\Query::where('name', $user)); @@ -297,6 +353,10 @@ class Mikrotik public static function setPpoeUserPlan($client, $user, $plan) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $printRequest = new RouterOS\Request('/ppp/secret/print'); $printRequest->setArgument('.proplist', '.id'); $printRequest->setQuery(RouterOS\Query::where('name', $user)); @@ -310,6 +370,10 @@ class Mikrotik public static function removePpoeActive($client, $username) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $onlineRequest = new RouterOS\Request('/ppp/active/print'); $onlineRequest->setArgument('.proplist', '.id'); $onlineRequest->setQuery(RouterOS\Query::where('name', $username)); @@ -322,6 +386,10 @@ class Mikrotik public static function removePool($client, $name) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $printRequest = new RouterOS\Request( '/ip pool print .proplist=.id', RouterOS\Query::where('name', $name) @@ -329,7 +397,7 @@ class Mikrotik $poolID = $client->sendSync($printRequest)->getProperty('.id'); $removeRequest = new RouterOS\Request('/ip/pool/remove'); - $client( + $client->sendSync( $removeRequest ->setArgument('numbers', $poolID) ); @@ -337,6 +405,10 @@ class Mikrotik public static function addPool($client, $name, $ip_address) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $addRequest = new RouterOS\Request('/ip/pool/add'); $client->sendSync( $addRequest @@ -347,17 +419,21 @@ class Mikrotik public static function setPool($client, $name, $ip_address) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $printRequest = new RouterOS\Request( '/ip pool print .proplist=.id', RouterOS\Query::where('name', $name) ); - $poolID = $client->sendSync($printRequest)->getProperty('id'); + $poolID = $client->sendSync($printRequest)->getProperty('.id'); if (empty($poolID)) { self::addPool($client, $name, $ip_address); } else { $setRequest = new RouterOS\Request('/ip/pool/set'); - $client( + $client->sendSync( $setRequest ->setArgument('numbers', $poolID) ->setArgument('ranges', $ip_address) @@ -368,6 +444,10 @@ class Mikrotik public static function addPpoePlan($client, $name, $pool, $rate) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $addRequest = new RouterOS\Request('/ppp/profile/add'); $client->sendSync( $addRequest @@ -380,6 +460,10 @@ class Mikrotik public static function setPpoePlan($client, $name, $pool, $rate) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $printRequest = new RouterOS\Request( '/ppp profile print .proplist=.id', RouterOS\Query::where('name', $name) @@ -389,7 +473,7 @@ class Mikrotik self::addPpoePlan($client, $name, $pool, $rate); } else { $setRequest = new RouterOS\Request('/ppp/profile/set'); - $client( + $client->sendSync( $setRequest ->setArgument('numbers', $profileID) ->setArgument('local-address', $pool) @@ -401,6 +485,10 @@ class Mikrotik public static function removePpoePlan($client, $name) { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } $printRequest = new RouterOS\Request( '/ppp profile print .proplist=.id', RouterOS\Query::where('name', $name) @@ -408,9 +496,67 @@ class Mikrotik $profileID = $client->sendSync($printRequest)->getProperty('.id'); $removeRequest = new RouterOS\Request('/ppp/profile/remove'); - $client( + $client->sendSync( $removeRequest ->setArgument('numbers', $profileID) ); } + + public static function sendSMS($client, $to, $message) + { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } + $smsRequest = new RouterOS\Request('/tool sms send'); + $smsRequest + ->setArgument('phone-number', $to) + ->setArgument('message', $message); + $client->sendSync($smsRequest); + } + + public static function getIpHotspotUser($client, $username){ + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } + $printRequest = new RouterOS\Request( + '/ip hotspot active print', + RouterOS\Query::where('user', $username) + ); + return $client->sendSync($printRequest)->getProperty('address'); + } + + public static function addIpToAddressList($client, $ip, $listName, $comment = '') + { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } + $addRequest = new RouterOS\Request('/ip/firewall/address-list/add'); + $client->sendSync( + $addRequest + ->setArgument('address', $ip) + ->setArgument('comment', $comment) + ->setArgument('list', $listName) + ); + } + + public static function removeIpFromAddressList($client, $ip) + { + global $_app_stage; + if ($_app_stage == 'demo') { + return null; + } + $printRequest = new RouterOS\Request( + '/ip firewall address-list print .proplist=.id', + RouterOS\Query::where('address', $ip) + ); + $id = $client->sendSync($printRequest)->getProperty('.id'); + $removeRequest = new RouterOS\Request('/ip/firewall/address-list/remove'); + $client->sendSync( + $removeRequest + ->setArgument('numbers', $id) + ); + } } diff --git a/system/autoload/Package.php b/system/autoload/Package.php index df986a7d..af4a11d8 100644 --- a/system/autoload/Package.php +++ b/system/autoload/Package.php @@ -17,9 +17,9 @@ class Package * @param string $channel channel payment gateway * @return boolean */ - public static function rechargeUser($id_customer, $router_name, $plan_id, $gateway, $channel) + public static function rechargeUser($id_customer, $router_name, $plan_id, $gateway, $channel, $note = '') { - global $_c; + global $config, $admin, $c, $p, $b, $t, $d, $zero; $date_now = date("Y-m-d H:i:s"); $date_only = date("Y-m-d"); $time_only = date("H:i:s"); @@ -30,11 +30,53 @@ class Package } $c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one(); - $p = ORM::for_table('tbl_plans')->where('id', $plan_id)->where('enabled', '1')->find_one(); + $p = ORM::for_table('tbl_plans')->where('id', $plan_id)->find_one(); + + $add_cost = 0; + $bills = []; + // Zero cost recharge + if (isset($zero) && $zero == 1) { + $p['price'] = 0; + } else { + // Additional cost + list($bills, $add_cost) = User::getBills($id_customer); + if ($add_cost > 0 && $router_name != 'balance') { + foreach ($bills as $k => $v) { + $note .= $k . " : " . Lang::moneyFormat($v) . "\n"; + } + $note .= $p['name_plan'] . " : " . Lang::moneyFormat($p['price']) . "\n"; + } + } + + + if (!$p['enabled']) { + if (!isset($admin) || !isset($admin['id']) || empty($admin['id'])) { + r2(U . 'home', 'e', Lang::T('Plan Not found')); + } + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + r2(U . 'dashboard', 'e', Lang::T('Plan Not found')); + } + } + + if ($p['validity_unit'] == 'Period') { + $day_exp = User::getAttribute("Expired Date", $c['id']); //ORM::for_table('tbl_customers_fields')->where('field_name', 'Expired Date')->where('customer_id', $c['id'])->find_one(); + if (!$day_exp) { + $day_exp = 20; + // $day_exp = date('d', strtotime($c['created_at'])); + // if (empty($day_exp) || $day_exp > 28) { + // $day_exp = 1; + // } + $f = ORM::for_table('tbl_customers_fields')->create(); + $f->customer_id = $c['id']; + $f->field_name = 'Expired Date'; + $f->field_value = $day_exp; + $f->save(); + } + } if ($router_name == 'balance') { // insert table transactions - $inv = "INV-" . Package::_raid(5); + $inv = "INV-" . Package::_raid(); $t = ORM::for_table('tbl_transactions')->create(); $t->invoice = $inv; $t->username = $c['username']; @@ -47,6 +89,11 @@ class Package $t->method = "$gateway - $channel"; $t->routers = $router_name; $t->type = "Balance"; + if ($admin) { + $t->admin_id = ($admin['id']) ? $admin['id'] : '0'; + } else { + $t->admin_id = '0'; + } $t->save(); $balance_before = $c['balance']; @@ -54,38 +101,76 @@ class Package $balance = $c['balance'] + $p['price']; $textInvoice = Lang::getNotifText('invoice_balance'); - $textInvoice = str_replace('[[company_name]]', $_c['CompanyName'], $textInvoice); - $textInvoice = str_replace('[[address]]', $_c['address'], $textInvoice); - $textInvoice = str_replace('[[phone]]', $_c['phone'], $textInvoice); + $textInvoice = str_replace('[[company_name]]', $config['CompanyName'], $textInvoice); + $textInvoice = str_replace('[[address]]', $config['address'], $textInvoice); + $textInvoice = str_replace('[[phone]]', $config['phone'], $textInvoice); $textInvoice = str_replace('[[invoice]]', $inv, $textInvoice); $textInvoice = str_replace('[[date]]', Lang::dateTimeFormat($date_now), $textInvoice); - $textInvoice = str_replace('[[payment_gateway]]', $_c['gateway'], $textInvoice); - $textInvoice = str_replace('[[payment_channel]]', $_c['channel'], $textInvoice); + $textInvoice = str_replace('[[payment_gateway]]', $gateway, $textInvoice); + $textInvoice = str_replace('[[payment_channel]]', $channel, $textInvoice); $textInvoice = str_replace('[[type]]', 'Balance', $textInvoice); $textInvoice = str_replace('[[plan_name]]', $p['name_plan'], $textInvoice); $textInvoice = str_replace('[[plan_price]]', Lang::moneyFormat($p['price']), $textInvoice); $textInvoice = str_replace('[[name]]', $c['fullname'], $textInvoice); $textInvoice = str_replace('[[user_name]]', $c['username'], $textInvoice); $textInvoice = str_replace('[[user_password]]', $c['password'], $textInvoice); - $textInvoice = str_replace('[[footer]]', $_c['note'], $textInvoice); + $textInvoice = str_replace('[[footer]]', $config['note'], $textInvoice); $textInvoice = str_replace('[[balance_before]]', Lang::moneyFormat($balance_before), $textInvoice); $textInvoice = str_replace('[[balance]]', Lang::moneyFormat($balance), $textInvoice); - if ($_c['user_notification_payment'] == 'sms') { + if ($config['user_notification_payment'] == 'sms') { Message::sendSMS($c['phonenumber'], $textInvoice); - } else if ($_c['user_notification_payment'] == 'wa') { + } else if ($config['user_notification_payment'] == 'wa') { Message::sendWhatsapp($c['phonenumber'], $textInvoice); } return true; } + /** + * 1 Customer only can have 1 PPPOE and 1 Hotspot Plan, 1 prepaid and 1 postpaid + */ + $b = ORM::for_table('tbl_user_recharges') + ->select('tbl_user_recharges.id', 'id') + ->select('customer_id') + ->select('username') + ->select('plan_id') + ->select('namebp') + ->select('recharged_on') + ->select('recharged_time') + ->select('expiration') + ->select('time') + ->select('status') + ->select('method') + ->select('tbl_user_recharges.routers', 'routers') + ->select('tbl_user_recharges.type', 'type') + ->select('admin_id') + ->select('prepaid') + ->where('customer_id', $id_customer) + ->where('tbl_user_recharges.routers', $router_name) + ->where('tbl_user_recharges.Type', $p['type']) + ->where('prepaid', $p['prepaid']) + ->join('tbl_plans', array('tbl_plans.id', '=', 'tbl_user_recharges.plan_id')) + ->find_one(); + + run_hook("recharge_user"); - $b = ORM::for_table('tbl_user_recharges')->where('customer_id', $id_customer)->find_one(); $mikrotik = Mikrotik::info($router_name); if ($p['validity_unit'] == 'Months') { $date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' month')); + } else if ($p['validity_unit'] == 'Period') { + $date_tmp = date("Y-m-$day_exp", strtotime('+' . $p['validity'] . ' month')); + $dt1 = new DateTime("$date_only"); + $dt2 = new DateTime("$date_tmp"); + $diff = $dt2->diff($dt1); + $sum = $diff->format("%a"); // => 453 + if ($sum >= 35 * $p['validity']) { + $date_exp = date("Y-m-$day_exp", strtotime('+0 month')); + } else { + $date_exp = date("Y-m-$day_exp", strtotime('+' . $p['validity'] . ' month')); + }; + $time = date("23:59:00"); } else if ($p['validity_unit'] == 'Days') { $date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' day')); } else if ($p['validity_unit'] == 'Hrs') { @@ -100,22 +185,14 @@ class Package if ($p['type'] == 'Hotspot') { if ($b) { - if ($p['is_radius']) { - Radius::customerAddPlan($c, $p, "$date_exp $time"); - }else{ - $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); - Mikrotik::removeHotspotUser($client, $c['username']); - Mikrotik::removePpoeUser($client, $c['username']); - Mikrotik::removeHotspotActiveUser($client, $c['username']); - Mikrotik::removePpoeActive($client, $c['username']); - Mikrotik::addHotspotUser($client, $p, $c); - } - if ($b['namebp'] == $p['name_plan'] && $b['status'] == 'on') { // if it same internet plan, expired will extend if ($p['validity_unit'] == 'Months') { $date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months')); $time = $b['time']; + } else if ($p['validity_unit'] == 'Period') { + $date_exp = date("Y-m-$day_exp", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months')); + $time = date("23:59:00"); } else if ($p['validity_unit'] == 'Days') { $date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days')); $time = $b['time']; @@ -130,6 +207,15 @@ class Package } } + if ($p['is_radius']) { + Radius::customerAddPlan($c, $p, "$date_exp $time"); + } else { + $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); + Mikrotik::removeHotspotUser($client, $c['username']); + Mikrotik::removeHotspotActiveUser($client, $c['username']); + Mikrotik::addHotspotUser($client, $p, $c); + } + $b->customer_id = $id_customer; $b->username = $c['username']; $b->plan_id = $plan_id; @@ -142,31 +228,74 @@ class Package $b->method = "$gateway - $channel"; $b->routers = $router_name; $b->type = "Hotspot"; + if ($admin) { + $b->admin_id = ($admin['id']) ? $admin['id'] : '0'; + } else { + $b->admin_id = '0'; + } $b->save(); // insert table transactions $t = ORM::for_table('tbl_transactions')->create(); - $t->invoice = "INV-" . Package::_raid(5); + $t->invoice = "INV-" . Package::_raid(); $t->username = $c['username']; $t->plan_name = $p['name_plan']; - $t->price = $p['price']; + if ($p['validity_unit'] == 'Period') { + // Postpaid price from field + $add_inv = User::getAttribute("Invoice", $id_customer); + if (empty($add_inv) or $add_inv == 0) { + $t->price = $p['price'] + $add_cost; + } else { + $t->price = $add_inv + $add_cost; + } + } else { + $t->price = $p['price'] + $add_cost; + } $t->recharged_on = $date_only; $t->recharged_time = $time_only; $t->expiration = $date_exp; $t->time = $time; $t->method = "$gateway - $channel"; $t->routers = $router_name; + $t->note = $note; $t->type = "Hotspot"; + if ($admin) { + $t->admin_id = ($admin['id']) ? $admin['id'] : '0'; + } else { + $t->admin_id = '0'; + } $t->save(); + + if ($p['validity_unit'] == 'Period') { + // insert price to fields for invoice next month + $fl = ORM::for_table('tbl_customers_fields')->where('field_name', 'Invoice')->where('customer_id', $c['id'])->find_one(); + if (!$fl) { + $fl = ORM::for_table('tbl_customers_fields')->create(); + $fl->customer_id = $c['id']; + $fl->field_name = 'Invoice'; + $fl->field_value = $p['price']; + $fl->save(); + } else { + $fl->customer_id = $c['id']; + $fl->field_value = $p['price']; + $fl->save(); + } + } + + + Message::sendTelegram("#u$c[username] $c[fullname] #recharge #Hotspot \n" . $p['name_plan'] . + "\nRouter: " . $router_name . + "\nGateway: " . $gateway . + "\nChannel: " . $channel . + "\nPrice: " . Lang::moneyFormat($p['price'] + $add_cost) . + "\nNote:\n" . $note); } else { if ($p['is_radius']) { Radius::customerAddPlan($c, $p, "$date_exp $time"); - }else{ + } else { $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); Mikrotik::removeHotspotUser($client, $c['username']); - Mikrotik::removePpoeUser($client, $c['username']); Mikrotik::removeHotspotActiveUser($client, $c['username']); - Mikrotik::removePpoeActive($client, $c['username']); Mikrotik::addHotspotUser($client, $p, $c); } @@ -183,48 +312,83 @@ class Package $d->method = "$gateway - $channel"; $d->routers = $router_name; $d->type = "Hotspot"; + if ($admin) { + $d->admin_id = ($admin['id']) ? $admin['id'] : '0'; + } else { + $d->admin_id = '0'; + } $d->save(); // insert table transactions $t = ORM::for_table('tbl_transactions')->create(); - $t->invoice = "INV-" . Package::_raid(5); + $t->invoice = "INV-" . Package::_raid(); $t->username = $c['username']; $t->plan_name = $p['name_plan']; - $t->price = $p['price']; + if ($p['validity_unit'] == 'Period') { + // Postpaid price always zero for first time + $t->price = 0 + $add_cost; + } else { + $t->price = $p['price'] + $add_cost; + } $t->recharged_on = $date_only; $t->recharged_time = $time_only; $t->expiration = $date_exp; $t->time = $time; $t->method = "$gateway - $channel"; $t->routers = $router_name; + $t->note = $note; $t->type = "Hotspot"; + if ($admin) { + $t->admin_id = ($admin['id']) ? $admin['id'] : '0'; + } else { + $t->admin_id = '0'; + } $t->save(); + + if ($p['validity_unit'] == 'Period' && $p['price'] != 0) { + // insert price to fields for invoice next month + $fl = ORM::for_table('tbl_customers_fields')->where('field_name', 'Invoice')->where('customer_id', $c['id'])->find_one(); + if (!$fl) { + $fl = ORM::for_table('tbl_customers_fields')->create(); + $fl->customer_id = $c['id']; + $fl->field_name = 'Invoice'; + // Calculating Price + $sd = new DateTime("$date_only"); + $ed = new DateTime("$date_exp"); + $td = $ed->diff($sd); + $fd = $td->format("%a"); + $gi = ($p['price'] / (30 * $p['validity'])) * $fd; + if ($gi > $p['price']) { + $fl->field_value = $p['price']; + } else { + $fl->field_value = $gi; + } + $fl->save(); + } else { + $fl->customer_id = $c['id']; + $fl->field_value = $p['price']; + $fl->save(); + } + } + + Message::sendTelegram("#u$c[username] $c[fullname] #buy #Hotspot \n" . $p['name_plan'] . + "\nRouter: " . $router_name . + "\nGateway: " . $gateway . + "\nChannel: " . $channel . + "\nPrice: " . Lang::moneyFormat($p['price'] + $add_cost) . + "\nNote:\n" . $note); } - Message::sendTelegram("#u$c[username] #buy #Hotspot \n" . $p['name_plan'] . - "\nRouter: " . $router_name . - "\nGateway: " . $gateway . - "\nChannel: " . $channel . - "\nPrice: " . Lang::moneyFormat($p['price'])); } else { if ($b) { - if ($p['is_radius']) { - Radius::customerAddPlan($c, $p, "$date_exp $time"); - }else{ - $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); - Mikrotik::removeHotspotUser($client, $c['username']); - Mikrotik::removePpoeUser($client, $c['username']); - Mikrotik::removeHotspotActiveUser($client, $c['username']); - Mikrotik::removePpoeActive($client, $c['username']); - Mikrotik::addPpoeUser($client, $p, $c); - } - - if ($b['namebp'] == $p['name_plan'] && $b['status'] == 'on') { // if it same internet plan, expired will extend if ($p['validity_unit'] == 'Months') { $date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months')); $time = $b['time']; + } else if ($p['validity_unit'] == 'Period') { + $date_exp = date("Y-m-$day_exp", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months')); + $time = date("23:59:00"); } else if ($p['validity_unit'] == 'Days') { $date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days')); $time = $b['time']; @@ -239,6 +403,15 @@ class Package } } + if ($p['is_radius']) { + Radius::customerAddPlan($c, $p, "$date_exp $time"); + } else { + $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); + Mikrotik::removePpoeUser($client, $c['username']); + Mikrotik::removePpoeActive($client, $c['username']); + Mikrotik::addPpoeUser($client, $p, $c); + } + $b->customer_id = $id_customer; $b->username = $c['username']; $b->plan_id = $plan_id; @@ -251,30 +424,72 @@ class Package $b->method = "$gateway - $channel"; $b->routers = $router_name; $b->type = "PPPOE"; + if ($admin) { + $b->admin_id = ($admin['id']) ? $admin['id'] : '0'; + } else { + $b->admin_id = '0'; + } $b->save(); // insert table transactions $t = ORM::for_table('tbl_transactions')->create(); - $t->invoice = "INV-" . Package::_raid(5); + $t->invoice = "INV-" . Package::_raid(); $t->username = $c['username']; $t->plan_name = $p['name_plan']; - $t->price = $p['price']; + if ($p['validity_unit'] == 'Period') { + // Postpaid price from field + $add_inv = User::getAttribute("Invoice", $id_customer); + if (empty($add_inv) or $add_inv == 0) { + $t->price = $p['price'] + $add_cost; + } else { + $t->price = $add_inv + $add_cost; + } + } else { + $t->price = $p['price'] + $add_cost; + } $t->recharged_on = $date_only; $t->recharged_time = $time_only; $t->expiration = $date_exp; $t->time = $time; $t->method = "$gateway - $channel"; $t->routers = $router_name; + $t->note = $note; $t->type = "PPPOE"; + if ($admin) { + $t->admin_id = ($admin['id']) ? $admin['id'] : '0'; + } else { + $t->admin_id = '0'; + } $t->save(); + + if ($p['validity_unit'] == 'Period' && $p['price'] != 0) { + // insert price to fields for invoice next month + $fl = ORM::for_table('tbl_customers_fields')->where('field_name', 'Invoice')->where('customer_id', $c['id'])->find_one(); + if (!$fl) { + $fl = ORM::for_table('tbl_customers_fields')->create(); + $fl->customer_id = $c['id']; + $fl->field_name = 'Invoice'; + $fl->field_value = $p['price']; + $fl->save(); + } else { + $fl->customer_id = $c['id']; + $fl->field_value = $p['price']; + $fl->save(); + } + } + + Message::sendTelegram("#u$c[username] $c[fullname] #recharge #PPPOE \n" . $p['name_plan'] . + "\nRouter: " . $router_name . + "\nGateway: " . $gateway . + "\nChannel: " . $channel . + "\nPrice: " . Lang::moneyFormat($p['price'] + $add_cost) . + "\nNote:\n" . $note); } else { if ($p['is_radius']) { Radius::customerAddPlan($c, $p, "$date_exp $time"); - }else{ + } else { $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); - Mikrotik::removeHotspotUser($client, $c['username']); Mikrotik::removePpoeUser($client, $c['username']); - Mikrotik::removeHotspotActiveUser($client, $c['username']); Mikrotik::removePpoeActive($client, $c['username']); Mikrotik::addPpoeUser($client, $p, $c); } @@ -292,63 +507,140 @@ class Package $d->method = "$gateway - $channel"; $d->routers = $router_name; $d->type = "PPPOE"; + if ($admin) { + $d->admin_id = ($admin['id']) ? $admin['id'] : '0'; + } else { + $d->admin_id = '0'; + } $d->save(); // insert table transactions $t = ORM::for_table('tbl_transactions')->create(); - $t->invoice = "INV-" . Package::_raid(5); + $t->invoice = "INV-" . Package::_raid(); $t->username = $c['username']; $t->plan_name = $p['name_plan']; - $t->price = $p['price']; + if ($p['validity_unit'] == 'Period') { + // Postpaid price always zero for first time + $note = ''; + $bills = []; + $t->price = 0; + } else { + $t->price = $p['price'] + $add_cost; + } $t->recharged_on = $date_only; $t->recharged_time = $time_only; $t->expiration = $date_exp; $t->time = $time; $t->method = "$gateway - $channel"; + $t->note = $note; $t->routers = $router_name; + if ($admin) { + $t->admin_id = ($admin['id']) ? $admin['id'] : '0'; + } else { + $t->admin_id = '0'; + } $t->type = "PPPOE"; $t->save(); - } - Message::sendTelegram("#u$c[username] #buy #PPPOE \n" . $p['name_plan'] . - "\nRouter: " . $router_name . - "\nGateway: " . $gateway . - "\nChannel: " . $channel . - "\nPrice: " . Lang::moneyFormat($p['price'])); - } - $in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one(); - Message::sendInvoice($c, $in); + if ($p['validity_unit'] == 'Period' && $p['price'] != 0) { + // insert price to fields for invoice next month + $fl = ORM::for_table('tbl_customers_fields')->where('field_name', 'Invoice')->where('customer_id', $c['id'])->find_one(); + if (!$fl) { + $fl = ORM::for_table('tbl_customers_fields')->create(); + $fl->customer_id = $c['id']; + $fl->field_name = 'Invoice'; + // Calculating Price + $sd = new DateTime("$date_only"); + $ed = new DateTime("$date_exp"); + $td = $ed->diff($sd); + $fd = $td->format("%a"); + $gi = ($p['price'] / (30 * $p['validity'])) * $fd; + if ($gi > $p['price']) { + $fl->field_value = $p['price']; + } else { + $fl->field_value = $gi; + } + $fl->save(); + } else { + $fl->customer_id = $c['id']; + $fl->field_value = $p['price']; + $fl->save(); + } + } + + Message::sendTelegram("#u$c[username] $c[fullname] #buy #PPPOE \n" . $p['name_plan'] . + "\nRouter: " . $router_name . + "\nGateway: " . $gateway . + "\nChannel: " . $channel . + "\nPrice: " . Lang::moneyFormat($p['price'] + $add_cost) . + "\nNote:\n" . $note); + } + } + if (is_array($bills) && count($bills) > 0) { + User::billsPaid($bills, $id_customer); + } + run_hook("recharge_user_finish"); + Message::sendInvoice($c, $t); return true; } - public static function changeTo($username, $plan_id) + public static function changeTo($username, $plan_id, $from_id) { - global $_c; $c = ORM::for_table('tbl_customers')->where('username', $username)->find_one(); - $p = ORM::for_table('tbl_plans')->where('id', $plan_id)->where('enabled', '1')->find_one(); - $b = ORM::for_table('tbl_user_recharges')->where('customer_id', $c['id'])->find_one(); - $mikrotik = Mikrotik::info($p['routers']); + $p = ORM::for_table('tbl_plans')->where('id', $plan_id)->find_one(); + $b = ORM::for_table('tbl_user_recharges')->find_one($from_id); + if ($p['routers'] == $b['routers'] && $b['routers'] != 'radius') { + $mikrotik = Mikrotik::info($p['routers']); + } else { + $mikrotik = Mikrotik::info($b['routers']); + } + // delete first + if ($p['type'] == 'Hotspot') { + if ($b) { + if (!$p['is_radius']) { + $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); + Mikrotik::removeHotspotUser($client, $c['username']); + Mikrotik::removeHotspotActiveUser($client, $c['username']); + } + } else { + if (!$p['is_radius']) { + $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); + Mikrotik::removeHotspotUser($client, $c['username']); + Mikrotik::removeHotspotActiveUser($client, $c['username']); + } + } + } else { + if ($b) { + if (!$p['is_radius']) { + $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); + Mikrotik::removePpoeUser($client, $c['username']); + Mikrotik::removePpoeActive($client, $c['username']); + } + } else { + if (!$p['is_radius']) { + $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); + Mikrotik::removePpoeUser($client, $c['username']); + Mikrotik::removePpoeActive($client, $c['username']); + } + } + } + // call the next mikrotik + if ($p['routers'] != $b['routers'] && $p['routers'] != 'radius') { + $mikrotik = Mikrotik::info($p['routers']); + } if ($p['type'] == 'Hotspot') { if ($b) { if ($p['is_radius']) { - Radius::customerAddPlan($c, $p, $b['expiration'].''.$b['time']); - }else{ + Radius::customerAddPlan($c, $p, $b['expiration'] . '' . $b['time']); + } else { $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); - Mikrotik::removeHotspotUser($client, $c['username']); - Mikrotik::removePpoeUser($client, $c['username']); - Mikrotik::removeHotspotActiveUser($client, $c['username']); - Mikrotik::removePpoeActive($client, $c['username']); Mikrotik::addHotspotUser($client, $p, $c); } } else { if ($p['is_radius']) { - Radius::customerAddPlan($c, $p, $b['expiration'].''.$b['time']); - }else{ + Radius::customerAddPlan($c, $p, $b['expiration'] . '' . $b['time']); + } else { $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); - Mikrotik::removeHotspotUser($client, $c['username']); - Mikrotik::removePpoeUser($client, $c['username']); - Mikrotik::removeHotspotActiveUser($client, $c['username']); - Mikrotik::removePpoeActive($client, $c['username']); Mikrotik::addHotspotUser($client, $p, $c); } } @@ -356,23 +648,15 @@ class Package if ($b) { if ($p['is_radius']) { Radius::customerAddPlan($c, $p); - }else{ + } else { $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); - Mikrotik::removeHotspotUser($client, $c['username']); - Mikrotik::removePpoeUser($client, $c['username']); - Mikrotik::removeHotspotActiveUser($client, $c['username']); - Mikrotik::removePpoeActive($client, $c['username']); Mikrotik::addPpoeUser($client, $p, $c); } } else { if ($p['is_radius']) { Radius::customerAddPlan($c, $p); - }else{ + } else { $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); - Mikrotik::removeHotspotUser($client, $c['username']); - Mikrotik::removePpoeUser($client, $c['username']); - Mikrotik::removeHotspotActiveUser($client, $c['username']); - Mikrotik::removePpoeActive($client, $c['username']); Mikrotik::addPpoeUser($client, $p, $c); } } @@ -380,8 +664,114 @@ class Package } - public static function _raid($l) + public static function _raid() { - return substr(str_shuffle(str_repeat('0123456789', $l)), 0, $l); + return ORM::for_table('tbl_transactions')->max('id') + 1; + } + + /** + * @param in tbl_transactions + * @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 createInvoice($in) + { + global $config, $admin, $ui; + $date = Lang::dateAndTimeFormat($in['recharged_on'], $in['recharged_time']); + if ($admin['id'] != $in['admin_id'] && $in['admin_id'] > 0) { + $_admin = Admin::_info($in['admin_id']); + // if admin not deleted + if ($_admin) $admin = $_admin; + } else { + $admin['fullname'] = 'Customer'; + } + $note = ''; + //print + $invoice = Lang::pad($config['CompanyName'], ' ', 2) . "\n"; + $invoice .= Lang::pad($config['address'], ' ', 2) . "\n"; + $invoice .= Lang::pad($config['phone'], ' ', 2) . "\n"; + $invoice .= Lang::pad("", '=') . "\n"; + $invoice .= Lang::pads("Invoice", $in['invoice'], ' ') . "\n"; + $invoice .= Lang::pads(Lang::T('Date'), $date, ' ') . "\n"; + $invoice .= Lang::pads(Lang::T('Sales'), $admin['fullname'], ' ') . "\n"; + $invoice .= Lang::pad("", '=') . "\n"; + $invoice .= Lang::pads(Lang::T('Type'), $in['type'], ' ') . "\n"; + $invoice .= Lang::pads(Lang::T('Plan Name'), $in['plan_name'], ' ') . "\n"; + if (!empty($in['note'])) { + $in['note'] = str_replace("\r", "", $in['note']); + $tmp = explode("\n", $in['note']); + foreach ($tmp as $t) { + if (strpos($t, " : ") === false) { + if (!empty($t)) { + $note .= "$t\n"; + } + } else { + $tmp2 = explode(" : ", $t); + $invoice .= Lang::pads($tmp2[0], $tmp2[1], ' ') . "\n"; + } + } + } + $invoice .= Lang::pads(Lang::T('Total'), Lang::moneyFormat($in['price']), ' ') . "\n"; + $method = explode("-", $in['method']); + $invoice .= Lang::pads($method[0], $method[1], ' ') . "\n"; + if (!empty($note)) { + $invoice .= Lang::pad("", '=') . "\n"; + $invoice .= Lang::pad($note, ' ', 2) . "\n"; + } + $invoice .= Lang::pad("", '=') . "\n"; + $invoice .= Lang::pads(Lang::T('Username'), $in['username'], ' ') . "\n"; + $invoice .= Lang::pads(Lang::T('Password'), '**********', ' ') . "\n"; + if ($in['type'] != 'Balance') { + $invoice .= Lang::pads(Lang::T('Created On'), Lang::dateAndTimeFormat($in['recharged_on'], $in['recharged_time']), ' ') . "\n"; + $invoice .= Lang::pads(Lang::T('Expires On'), Lang::dateAndTimeFormat($in['expiration'], $in['time']), ' ') . "\n"; + } + $invoice .= Lang::pad("", '=') . "\n"; + $invoice .= Lang::pad($config['note'], ' ', 2) . "\n"; + $ui->assign('invoice', $invoice); + $config['printer_cols'] = 30; + //whatsapp + $invoice = Lang::pad($config['CompanyName'], ' ', 2) . "\n"; + $invoice .= Lang::pad($config['address'], ' ', 2) . "\n"; + $invoice .= Lang::pad($config['phone'], ' ', 2) . "\n"; + $invoice .= Lang::pad("", '=') . "\n"; + $invoice .= Lang::pads("Invoice", $in['invoice'], ' ') . "\n"; + $invoice .= Lang::pads(Lang::T('Date'), $date, ' ') . "\n"; + $invoice .= Lang::pads(Lang::T('Sales'), $admin['fullname'], ' ') . "\n"; + $invoice .= Lang::pad("", '=') . "\n"; + $invoice .= Lang::pads(Lang::T('Type'), $in['type'], ' ') . "\n"; + $invoice .= Lang::pads(Lang::T('Plan Name'), $in['plan_name'], ' ') . "\n"; + if (!empty($in['note'])) { + $invoice .= Lang::pad("", '=') . "\n"; + foreach ($tmp as $t) { + if (strpos($t, " : ") === false) { + if (!empty($t)) { + $invoice .= Lang::pad($t, ' ', 2) . "\n"; + } + } else { + $tmp2 = explode(" : ", $t); + $invoice .= Lang::pads($tmp2[0], $tmp2[1], ' ') . "\n"; + } + } + } + $invoice .= Lang::pads(Lang::T('Total'), Lang::moneyFormat($in['price']), ' ') . "\n"; + $invoice .= Lang::pads($method[0], $method[1], ' ') . "\n"; + if (!empty($note)) { + $invoice .= Lang::pad("", '=') . "\n"; + $invoice .= Lang::pad($note, ' ', 2) . "\n"; + } + $invoice .= Lang::pad("", '=') . "\n"; + $invoice .= Lang::pads(Lang::T('Username'), $in['username'], ' ') . "\n"; + $invoice .= Lang::pads(Lang::T('Password'), '**********', ' ') . "\n"; + if ($in['type'] != 'Balance') { + $invoice .= Lang::pads(Lang::T('Created On'), Lang::dateAndTimeFormat($in['recharged_on'], $in['recharged_time']), ' ') . "\n"; + $invoice .= Lang::pads(Lang::T('Expires On'), Lang::dateAndTimeFormat($in['expiration'], $in['time']), ' ') . "\n"; + } + $invoice .= Lang::pad("", '=') . "\n"; + $invoice .= Lang::pad($config['note'], ' ', 2) . "\n"; + $ui->assign('whatsapp', urlencode("```$invoice```")); + $ui->assign('in', $in); } } diff --git a/system/autoload/Paginator.php b/system/autoload/Paginator.php index ed48ba05..24766ae6 100644 --- a/system/autoload/Paginator.php +++ b/system/autoload/Paginator.php @@ -1,14 +1,82 @@ 0) { + $url .= '&' . http_build_query($search); + } + $url .= '&p='; + $totalReq = $query->count(); + $next = $page + 1; + $lastpage = ceil($totalReq / $per_page); + $lpm1 = $lastpage - 1; + $limit = $per_page; + $startpoint = ($page * $limit) - $limit; + if ($lastpage >= 1) { + $pages = []; + if ($lastpage < 7 + ($adjacents * 2)) { + for ($counter = 1; $counter <= $lastpage; $counter++) { + $pages[] = $counter; + } + } elseif ($lastpage > 5 + ($adjacents * 2)) { + if ($page < 1 + ($adjacents * 2)) { + for ($counter = 1; $counter < 4 + ($adjacents * 2); $counter++) { + $pages[] = $counter; + } + $pages[] = "..."; + $pages[] = $lpm1; + $pages[] = $lastpage; + } elseif ($lastpage - ($adjacents * 2) > $page && $page > ($adjacents * 2)) { + $pages[] = "1"; + $pages[] = "2"; + $pages[] = "..."; + for ($counter = $page - $adjacents; $counter <= $page + $adjacents; $counter++) { + $pages[] = $counter; + } + $pages[] = "..."; + $pages[] = $lpm1; + $pages[] = $lastpage; + } else { + $pages[] = "1"; + $pages[] = "2"; + $pages[] = "..."; + for ($counter = $lastpage - (2 + ($adjacents * 2)); $counter <= $lastpage; $counter++) { + $pages[] = $counter; + } + } + } + + $result = [ + 'count' => $lastpage, + 'limit' => $per_page, + 'startpoint' => $startpoint, + 'url' => $url, + 'page' => $page, + 'pages' => $pages, + 'prev' => ($page > 0) ? ($page - 1) : "0", + 'next' => ($page >= $lastpage) ? $lastpage : $page + 1 + ]; + if ($ui) { + $ui->assign('paginator', $result); + } + return $query->offset($startpoint)->limit($per_page)->find_many(); + } + } + + public static function build($table, $colVal = [], $query = '', $per_page = '10') { global $routes; global $_L; @@ -17,11 +85,15 @@ class Paginator $adjacents = "2"; $page = (int)(empty(_get('p')) ? 1 : _get('p')); $pagination = ""; - foreach($colVal as $k=>$v) { - if(strpos($v,'%') === false) { + foreach ($colVal as $k => $v) { + if (!is_array($v) && strpos($v, '%') === false) { $table = $table->where($k, $v); - }else{ - $table = $table->where_like($k, $v); + } else { + if (is_array($v)) { + $table = $table->where_in($k, $v); + } else { + $table = $table->where_like($k, $v); + } } } $totalReq = $table->count(); @@ -32,60 +104,60 @@ class Paginator $limit = $per_page; $startpoint = ($page * $limit) - $limit; if ($lastpage >= 1) { - $pagination .= '
- + - - - - - - - - + + + + + + + + '; $c = true; foreach ($x as $value) { @@ -116,7 +116,7 @@ switch ($action) { "; } $html .= '
' . $_L['Username'] . '' . $_L['Plan_Name'] . '' . $_L['Type'] . '' . $_L['Plan_Price'] . '' . $_L['Created_On'] . '' . $_L['Expires_On'] . '' . $_L['Method'] . '' . $_L['Routers'] . '' . Lang::T('Username') . '' . Lang::T('Plan Name') . '' . Lang::T('Type') . '' . Lang::T('Plan Price') . '' . Lang::T('Created On') . '' . Lang::T('Expires On') . '' . Lang::T('Method') . '' . Lang::T('Routers') . '
-

' . $_L['Total_Income'] . ':

+

' . Lang::T('Total Income') . ':

' . $config['currency_code'] . ' ' . number_format($xy, 2, $config['dec_point'], $config['thousands_sep']) . '

'; run_hook('print_pdf_by_date'); #HOOK @@ -170,7 +170,7 @@ $style $html EOF; $mpdf->WriteHTML($nhtml); - $mpdf->Output(date('Y-m-d') . Package::_raid(4) . '.pdf', 'D'); + $mpdf->Output(date('Ymd_His') . '.pdf', 'D'); } else { echo 'No Data'; } @@ -235,10 +235,12 @@ EOF; $title = ' Reports [' . $mdate . ']'; $title = str_replace('-', ' ', $title); - if(file_exists('system/uploads/logo.png')){ - $logo = 'system/uploads/logo.png'; - }else{ - $logo = 'system/uploads/logo.default.png'; + + $UPLOAD_URL_PATH = str_replace($root_path, '', $UPLOAD_PATH); + if (file_exists($UPLOAD_PATH . '/logo.png')) { + $logo = $UPLOAD_URL_PATH . '/logo.png'; + } else { + $logo = $UPLOAD_URL_PATH . '/logo.default.png'; } if ($x) { @@ -247,21 +249,21 @@ EOF;

' . $config['CompanyName'] . '

' . $config['address'] . '
- ' . $_L['Phone_Number'] . ': ' . $config['phone'] . '
+ ' . Lang::T('Phone Number') . ': ' . $config['phone'] . '
- + - + - - - - - - - - + + + + + + + + '; $c = true; foreach ($x as $value) { @@ -288,7 +290,7 @@ EOF; "; } $html .= '
' . $_L['Username'] . '' . $_L['Plan_Name'] . '' . $_L['Type'] . '' . $_L['Plan_Price'] . '' . $_L['Created_On'] . '' . $_L['Expires_On'] . '' . $_L['Method'] . '' . $_L['Routers'] . '' . Lang::T('Username') . '' . Lang::T('Plan Name') . '' . Lang::T('Type') . '' . Lang::T('Plan Price') . '' . Lang::T('Created On') . '' . Lang::T('Expires On') . '' . Lang::T('Method') . '' . Lang::T('Routers') . '
-

' . $_L['Total_Income'] . ':

+

' . Lang::T('Total Income') . ':

' . $config['currency_code'] . ' ' . number_format($xy, 2, $config['dec_point'], $config['thousands_sep']) . '

'; run_hook('pdf_by_period'); #HOOK @@ -342,7 +344,7 @@ $style $html EOF; $mpdf->WriteHTML($nhtml); - $mpdf->Output(date('Y-m-d') . Package::_raid(4) . '.pdf', 'D'); + $mpdf->Output(date('Ymd_His') . '.pdf', 'D'); } else { echo 'No Data'; } diff --git a/system/controllers/home.php b/system/controllers/home.php index cbe92eb6..da7cb2e9 100644 --- a/system/controllers/home.php +++ b/system/controllers/home.php @@ -6,7 +6,7 @@ **/ _auth(); -$ui->assign('_title', $_L['Dashboard']); +$ui->assign('_title', Lang::T('Dashboard')); $user = User::_info(); $ui->assign('_user', $user); @@ -84,33 +84,38 @@ if (_post('send') == 'balance') { if ($router) { r2(U . "order/send/$router[id]/$active[plan_id]&u=" . trim(_post('username')), 's', Lang::T('Review package before recharge')); } else { - r2(U . 'package/order', 'w', Lang::T('Your friend do not have active package')); + r2(U . 'home', 'w', Lang::T('Your friend do not have active package')); } } -//Client Page -$bill = User::_billing(); -$ui->assign('_bill', $bill); +$ui->assign('_bills', User::_billing()); -if(isset($_GET['recharge']) && $_GET['recharge'] == 1){ - $router = ORM::for_table('tbl_routers')->where('name', $bill['routers'])->find_one(); - if ($config['enable_balance'] == 'yes') { - $plan = ORM::for_table('tbl_plans')->find_one($bill['plan_id']); - if($user['balance']>$plan['price']){ - r2(U . "order/pay/$router[id]/$bill[plan_id]", 'e', 'Order Plan'); - }else{ +if (isset($_GET['recharge']) && !empty($_GET['recharge'])) { + $bill = ORM::for_table('tbl_user_recharges')->where('id', $_GET['recharge'])->where('username', $user['username'])->findOne(); + if ($bill) { + $router = ORM::for_table('tbl_routers')->where('name', $bill['routers'])->find_one(); + if ($config['enable_balance'] == 'yes') { + $plan = ORM::for_table('tbl_plans')->find_one($bill['plan_id']); + if(!$plan['enabled']){ + r2(U . "home", 'e', 'Plan is not exists'); + } + if ($user['balance'] > $plan['price']) { + r2(U . "order/pay/$router[id]/$bill[plan_id]", 'e', 'Order Plan'); + } else { + r2(U . "order/buy/$router[id]/$bill[plan_id]", 'e', 'Order Plan'); + } + } else { r2(U . "order/buy/$router[id]/$bill[plan_id]", 'e', 'Order Plan'); } - }else{ - r2(U . "order/buy/$router[id]/$bill[plan_id]", 'e', 'Order Plan'); } -}else if(isset($_GET['deactivate']) && $_GET['deactivate'] == 1){ +} else if (isset($_GET['deactivate']) && !empty($_GET['deactivate'])) { + $bill = ORM::for_table('tbl_user_recharges')->where('id', $_GET['deactivate'])->where('username', $user['username'])->findOne(); if ($bill) { $p = ORM::for_table('tbl_plans')->where('id', $bill['plan_id'])->find_one(); - if($p['is_radius']){ + if ($p['is_radius']) { Radius::customerDeactivate($user['username']); - }else{ - try{ + } else { + try { $mikrotik = Mikrotik::info($bill['routers']); $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); if ($bill['type'] == 'Hotspot') { @@ -120,7 +125,7 @@ if(isset($_GET['recharge']) && $_GET['recharge'] == 1){ Mikrotik::removePpoeUser($client, $bill['username']); Mikrotik::removePpoeActive($client, $bill['username']); } - }catch(Exception $e){ + } catch (Exception $e) { //ignore it maybe mikrotik has been deleted } } @@ -128,10 +133,10 @@ if(isset($_GET['recharge']) && $_GET['recharge'] == 1){ $bill->expiration = date('Y-m-d'); $bill->time = date('H:i:s'); $bill->save(); - _log('User ' . $bill['username'] . ' Deactivate '.$bill['namebp'], 'User', $bill['customer_id']); - Message::sendTelegram('User u' . $bill['username'] . ' Deactivate '.$bill['namebp']); - r2(U . 'home', 's', 'Success deactivate '.$bill['namebp']); - }else{ + _log('User ' . $bill['username'] . ' Deactivate ' . $bill['namebp'], 'User', $bill['customer_id']); + Message::sendTelegram('User u' . $bill['username'] . ' Deactivate ' . $bill['namebp']); + r2(U . 'home', 's', 'Success deactivate ' . $bill['namebp']); + } else { r2(U . 'home', 'e', 'No Active Plan'); } } @@ -139,6 +144,7 @@ if(isset($_GET['recharge']) && $_GET['recharge'] == 1){ if (!empty($_SESSION['nux-mac']) && !empty($_SESSION['nux-ip'])) { $ui->assign('nux_mac', $_SESSION['nux-mac']); $ui->assign('nux_ip', $_SESSION['nux-ip']); + $bill = ORM::for_table('tbl_user_recharges')->where('id', $_GET['id'])->where('username', $user['username'])->findOne(); if ($_GET['mikrotik'] == 'login') { $m = Mikrotik::info($bill['routers']); $c = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']); diff --git a/system/controllers/login.php b/system/controllers/login.php index 8a491dd6..15b5eaf0 100644 --- a/system/controllers/login.php +++ b/system/controllers/login.php @@ -5,6 +5,10 @@ * by https://t.me/ibnux **/ +if(User::getID()){ + r2(U.'home'); +} + if (isset($routes['1'])) { $do = $routes['1']; } else { @@ -22,28 +26,139 @@ switch ($do) { $d_pass = $d['password']; if (Password::_uverify($password, $d_pass) == true) { $_SESSION['uid'] = $d['id']; + User::setCookie($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'); + _log($username . ' ' . Lang::T('Login Successful'), 'User', $d['id']); + _alert(Lang::T('Login Successful'),'success', "home"); } else { - _msglog('e', $_L['Invalid_Username_or_Password']); - _log($username . ' ' . $_L['Failed_Login'], 'User'); + _msglog('e', Lang::T('Invalid Username or Password')); + _log($username . ' ' . Lang::T('Failed Login'), 'User'); r2(U . 'login'); } } else { - _msglog('e', $_L['Invalid_Username_or_Password']); + _msglog('e', Lang::T('Invalid Username or Password')); r2(U . 'login'); } } else { - _msglog('e', $_L['Invalid_Username_or_Password']); + _msglog('e', Lang::T('Invalid Username or Password')); r2(U . 'login'); } break; + case 'activation': + $voucher = _post('voucher'); + $username = _post('username'); + $v1 = ORM::for_table('tbl_voucher')->where('code', $voucher)->find_one(); + if ($v1) { + // voucher exists, check customer exists or not + $user = ORM::for_table('tbl_customers')->where('username', $username)->find_one(); + if (!$user) { + $d = ORM::for_table('tbl_customers')->create(); + $d->username = alphanumeric($username, "+_."); + $d->password = $voucher; + $d->fullname = ''; + $d->address = ''; + $d->email = ''; + $d->phonenumber = (strlen($username) < 21) ? $username : ''; + if ($d->save()) { + $user = ORM::for_table('tbl_customers')->where('username', $username)->find_one($d->id()); + if (!$user) { + r2(U . 'login', 'e', Lang::T('Voucher activation failed')); + } + } else { + _alert(Lang::T('Login Successful'),'success', "dashboard"); + r2(U . 'login', 'e', Lang::T('Voucher activation failed') . '.'); + } + } + if ($v1['status'] == 0) { + $oldPass = $user['password']; + // change customer password to voucher code + $user->password = $voucher; + $user->save(); + // voucher activation + if (Package::rechargeUser($user['id'], $v1['routers'], $v1['id_plan'], "Voucher", $voucher)) { + $v1->status = "1"; + $v1->user = $user['username']; + $v1->save(); + $user->last_login = date('Y-m-d H:i:s'); + $user->save(); + // add customer to mikrotik + if (!empty($_SESSION['nux-mac']) && !empty($_SESSION['nux-ip'])) { + try { + $m = Mikrotik::info($v1['routers']); + $c = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']); + Mikrotik::logMeIn($c, $user['username'], $user['password'], $_SESSION['nux-ip'], $_SESSION['nux-mac']); + if (!empty($config['voucher_redirect'])) { + r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, you are connected to internet")); + } else { + r2(U . "login", 's', Lang::T("Voucher activation success, you are connected to internet")); + } + } catch (Exception $e) { + if (!empty($config['voucher_redirect'])) { + r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, now you can login")); + } else { + r2(U . "login", 's', Lang::T("Voucher activation success, now you can login")); + } + } + } + if (!empty($config['voucher_redirect'])) { + r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, now you can login")); + } else { + r2(U . "login", 's', Lang::T("Voucher activation success, now you can login")); + } + } else { + // if failed to recharge, restore old password + $user->password = $oldPass; + $user->save(); + r2(U . 'login', 'e', Lang::T("Failed to activate voucher")); + } + } else { + // used voucher + // check if voucher used by this username + if ($v1['user'] == $user['username']) { + $user->last_login = date('Y-m-d H:i:s'); + $user->save(); + if (!empty($_SESSION['nux-mac']) && !empty($_SESSION['nux-ip'])) { + try { + $m = Mikrotik::info($v1['routers']); + $c = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']); + Mikrotik::logMeIn($c, $user['username'], $user['password'], $_SESSION['nux-ip'], $_SESSION['nux-mac']); + if (!empty($config['voucher_redirect'])) { + r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, you are connected to internet")); + } else { + r2(U . "login", 's', Lang::T("Voucher activation success, now you can login")); + } + } catch (Exception $e) { + if (!empty($config['voucher_redirect'])) { + r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, now you can login")); + } else { + r2(U . "login", 's', Lang::T("Voucher activation success, now you can login")); + } + } + } else { + if (!empty($config['voucher_redirect'])) { + r2($config['voucher_redirect'], 's', Lang::T("Voucher activation success, you are connected to internet")); + } else { + r2(U . "login", 's', Lang::T("Voucher activation success, now you can login")); + } + } + } else { + // voucher used by other customer + r2(U . 'login', 'e', Lang::T('Voucher Not Valid')); + } + } + } else { + _msglog('e', Lang::T('Invalid Username or Password')); + r2(U . 'login'); + } default: run_hook('customer_view_login'); #HOOK - $ui->display('user-login.tpl'); + if ($config['disable_registration'] == 'yes') { + $ui->display('user-login-noreg.tpl'); + } else { + $ui->display('user-login.tpl'); + } break; } diff --git a/system/controllers/logout.php b/system/controllers/logout.php index 0b069673..3db002ba 100644 --- a/system/controllers/logout.php +++ b/system/controllers/logout.php @@ -6,5 +6,7 @@ run_hook('customer_logout'); #HOOK if (session_status() == PHP_SESSION_NONE) session_start(); +Admin::removeCookie(); +User::removeCookie(); session_destroy(); -header('location: index.php'); \ No newline at end of file +_alert(Lang::T('Logout Successful'),'warning', "login"); \ No newline at end of file diff --git a/system/controllers/logs.php b/system/controllers/logs.php index 51936bad..ac4d1db2 100644 --- a/system/controllers/logs.php +++ b/system/controllers/logs.php @@ -10,11 +10,10 @@ $ui->assign('_title', 'PHPNuxBill Logs'); $ui->assign('_system_menu', 'logs'); $action = $routes['1']; -$admin = Admin::_info(); $ui->assign('_admin', $admin); -if ($admin['user_type'] != 'Admin') { - r2(U . "dashboard", 'e', $_L['Do_Not_Access']); +if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'),'danger', "dashboard"); } @@ -23,20 +22,19 @@ switch ($action) { $q = (_post('q') ? _post('q') : _get('q')); $keep = _post('keep'); if (!empty($keep)) { - ORM::raw_execute("DELETE FROM tbl_logs WHERE date < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL $keep DAY))"); + ORM::raw_execute("DELETE FROM tbl_logs WHERE UNIX_TIMESTAMP(date) < UNIX_TIMESTAMP(DATE_SUB(NOW(), INTERVAL $keep DAY))"); r2(U . "logs/list/", 's', "Delete logs older than $keep days"); } if ($q != '') { - $paginator = Paginator::build(ORM::for_table('tbl_logs'), ['description' => '%' . $q . '%'], $q); - $d = ORM::for_table('tbl_logs')->where_like('description', '%' . $q . '%')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many(); + $query = ORM::for_table('tbl_logs')->where_like('description', '%' . $q . '%')->order_by_desc('id'); + $d = Paginator::findMany($query, ['q' => $q]); } else { - $paginator = Paginator::build(ORM::for_table('tbl_logs')); - $d = ORM::for_table('tbl_logs')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many(); + $query = ORM::for_table('tbl_logs')->order_by_desc('id'); + $d = Paginator::findMany($query); } $ui->assign('d', $d); $ui->assign('q', $q); - $ui->assign('paginator', $paginator); $ui->display('logs.tpl'); break; case 'radius': @@ -47,16 +45,15 @@ switch ($action) { r2(U . "logs/radius/", 's', "Delete logs older than $keep days"); } if ($q != '') { - $paginator = Paginator::build(ORM::for_table('radpostauth', 'radius'), ['username' => '%' . $q . '%'], $q); - $d = ORM::for_table('radpostauth', 'radius')->where_like('username', '%' . $q . '%')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many(); + $query = ORM::for_table('radpostauth', 'radius')->where_like('username', '%' . $q . '%')->order_by_desc('id'); + $d = Paginator::findMany($query, ['q' => $q]); } else { - $paginator = Paginator::build(ORM::for_table('radpostauth', 'radius')); - $d = ORM::for_table('radpostauth', 'radius')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many(); + $query = ORM::for_table('radpostauth', 'radius')->order_by_desc('id'); + $d = Paginator::findMany($query); } $ui->assign('d', $d); $ui->assign('q', $q); - $ui->assign('paginator', $paginator); $ui->display('logs-radius.tpl'); break; diff --git a/system/controllers/map.php b/system/controllers/map.php new file mode 100644 index 00000000..526ed8ca --- /dev/null +++ b/system/controllers/map.php @@ -0,0 +1,48 @@ +assign('_system_menu', 'map'); + +$action = $routes['1']; +$ui->assign('_admin', $admin); + +if (empty($action)) { + $action = 'customer'; +} + +switch ($action) { + case 'customer': + + $c = ORM::for_table('tbl_customers')->find_many(); + $customerData = []; + + foreach ($c as $customer) { + if (!empty($customer->coordinates)) { + $customerData[] = [ + 'id' => $customer->id, + 'name' => $customer->fullname, + 'balance' => $customer->balance, + 'address' => $customer->address, + 'direction' => $customer->coordinates, + 'info' => Lang::T("Username") . ": " . $customer->username . " - " . Lang::T("Full Name") . ": " . $customer->fullname . " - " . Lang::T("Email") . ": " . $customer->email . " - " . Lang::T("Phone") . ": " . $customer->phonenumber . " - " . Lang::T("Service Type") . ": " . $customer->service_type, + 'coordinates' => '[' . $customer->coordinates . ']', + ]; + } + } + + $ui->assign('customers', $customerData); + $ui->assign('xheader', ''); + $ui->assign('_title', Lang::T('Customer Geo Location Information')); + $ui->assign('xfooter', ''); + $ui->display('customers-map.tpl'); + break; + + default: + r2(U . 'map/customer', 'e', 'action not defined'); + break; +} diff --git a/system/controllers/message.php b/system/controllers/message.php new file mode 100644 index 00000000..a4a1a197 --- /dev/null +++ b/system/controllers/message.php @@ -0,0 +1,238 @@ +assign('_title', Lang::T('Send Message')); +$ui->assign('_system_menu', 'message'); + +$action = $routes['1']; +$ui->assign('_admin', $admin); + +if (empty($action)) { + $action = 'send'; +} + +switch ($action) { + case 'send': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + + $select2_customer = << +document.addEventListener("DOMContentLoaded", function(event) { + $('#personSelect').select2({ + theme: "bootstrap", + ajax: { + url: function(params) { + if(params.term != undefined){ + return './index.php?_route=autoload/customer_select2&s='+params.term; + }else{ + return './index.php?_route=autoload/customer_select2'; + } + } + } + }); +}); + +EOT; + if (isset($routes['2']) && !empty($routes['2'])) { + $ui->assign('cust', ORM::for_table('tbl_customers')->find_one($routes['2'])); + } + $id = $routes['2']; + $ui->assign('id', $id); + $ui->assign('xfooter', $select2_customer); + $ui->display('message.tpl'); + break; + + case 'send-post': + // Check user permissions + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + + // Get form data + $id_customer = $_POST['id_customer']; + $message = $_POST['message']; + $via = $_POST['via']; + + // Check if fields are empty + if ($id_customer == '' or $message == '' or $via == '') { + r2(U . 'message/send', 'e', Lang::T('All field is required')); + } else { + // Get customer details from the database + $c = ORM::for_table('tbl_customers')->find_one($id_customer); + + // Replace placeholders in the message with actual values + $message = str_replace('[[name]]', $c['fullname'], $message); + $message = str_replace('[[user_name]]', $c['username'], $message); + $message = str_replace('[[phone]]', $c['phonenumber'], $message); + $message = str_replace('[[company_name]]', $config['CompanyName'], $message); + + + //Send the message + if ($via == 'sms' || $via == 'both') { + $smsSent = Message::sendSMS($c['phonenumber'], $message); + } + + if ($via == 'wa' || $via == 'both') { + $waSent = Message::sendWhatsapp($c['phonenumber'], $message); + } + + if (isset($smsSent) || isset($waSent)) { + r2(U . 'message/send', 's', Lang::T('Message Sent Successfully')); + } else { + r2(U . 'message/send', 'e', Lang::T('Failed to send message')); + } + } + break; + + case 'send_bulk': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + + // Get form data + $group = $_POST['group']; + $message = $_POST['message']; + $via = $_POST['via']; + $test = isset($_POST['test']) && $_POST['test'] === 'on' ? 'yes' : 'no'; + $batch = $_POST['batch']; + $delay = $_POST['delay']; + + // Initialize counters + $totalSMSSent = 0; + $totalSMSFailed = 0; + $totalWhatsappSent = 0; + $totalWhatsappFailed = 0; + $batchStatus = []; + + if (_req('send') == 'now') { + // Check if fields are empty + if ($group == '' || $message == '' || $via == '') { + r2(U . 'message/send_bulk', 'e', Lang::T('All fields are required')); + } else { + // Get customer details from the database based on the selected group + if ($group == 'all') { + $customers = ORM::for_table('tbl_customers')->find_many()->as_array(); + } elseif ($group == 'new') { + // Get customers created just a month ago + $customers = ORM::for_table('tbl_customers')->where_raw("DATE(created_at) >= DATE_SUB(CURDATE(), INTERVAL 1 MONTH)")->find_many()->as_array(); + } elseif ($group == 'expired') { + // Get expired user recharges where status is 'off' + $expired = ORM::for_table('tbl_user_recharges')->where('status', 'off')->find_many(); + $customer_ids = []; + foreach ($expired as $recharge) { + $customer_ids[] = $recharge->customer_id; + } + $customers = ORM::for_table('tbl_customers')->where_in('id', $customer_ids)->find_many()->as_array(); + } elseif ($group == 'active') { + // Get active user recharges where status is 'on' + $active = ORM::for_table('tbl_user_recharges')->where('status', 'on')->find_many(); + $customer_ids = []; + foreach ($active as $recharge) { + $customer_ids[] = $recharge->customer_id; + } + $customers = ORM::for_table('tbl_customers')->where_in('id', $customer_ids)->find_many()->as_array(); + } + + // Set the batch size + $batchSize = $batch; + + // Calculate the number of batches + $totalCustomers = count($customers); + $totalBatches = ceil($totalCustomers / $batchSize); + + // Loop through batches + for ($batchIndex = 0; $batchIndex < $totalBatches; $batchIndex++) { + // Get the starting and ending index for the current batch + $start = $batchIndex * $batchSize; + $end = min(($batchIndex + 1) * $batchSize, $totalCustomers); + $batchCustomers = array_slice($customers, $start, $end - $start); + + // Loop through customers in the current batch and send messages + foreach ($batchCustomers as $customer) { + // Create a copy of the original message for each customer and save it as currentMessage + $currentMessage = $message; + $currentMessage = str_replace('[[name]]', $customer['fullname'], $currentMessage); + $currentMessage = str_replace('[[user_name]]', $customer['username'], $currentMessage); + $currentMessage = str_replace('[[phone]]', $customer['phonenumber'], $currentMessage); + $currentMessage = str_replace('[[company_name]]', $config['CompanyName'], $currentMessage); + + // Send the message based on the selected method + if ($test === 'yes') { + // Only for testing, do not send messages to customers + $batchStatus[] = [ + 'name' => $customer['fullname'], + 'phone' => $customer['phonenumber'], + 'message' => $currentMessage, + 'status' => 'Test Mode - Message not sent' + ]; + } else { + // Send the actual messages + if ($via == 'sms' || $via == 'both') { + $smsSent = Message::sendSMS($customer['phonenumber'], $currentMessage); + if ($smsSent) { + $totalSMSSent++; + $batchStatus[] = [ + 'name' => $customer['fullname'], + 'phone' => $customer['phonenumber'], + 'message' => $currentMessage, + 'status' => 'SMS Message Sent' + ]; + } else { + $totalSMSFailed++; + $batchStatus[] = [ + 'name' => $customer['fullname'], + 'phone' => $customer['phonenumber'], + 'message' => $currentMessage, + 'status' => 'SMS Message Failed' + ]; + } + } + + if ($via == 'wa' || $via == 'both') { + $waSent = Message::sendWhatsapp($customer['phonenumber'], $currentMessage); + if ($waSent) { + $totalWhatsappSent++; + $batchStatus[] = [ + 'name' => $customer['fullname'], + 'phone' => $customer['phonenumber'], + 'message' => $currentMessage, + 'status' => 'WhatsApp Message Sent' + ]; + } else { + $totalWhatsappFailed++; + $batchStatus[] = [ + 'name' => $customer['fullname'], + 'phone' => $customer['phonenumber'], + 'message' => $currentMessage, + 'status' => 'WhatsApp Message Failed' + ]; + } + } + } + } + + // Introduce a delay between each batch + if ($batchIndex < $totalBatches - 1) { + sleep($delay); + } + } + } + } + $ui->assign('batchStatus', $batchStatus); + $ui->assign('totalSMSSent', $totalSMSSent); + $ui->assign('totalSMSFailed', $totalSMSFailed); + $ui->assign('totalWhatsappSent', $totalWhatsappSent); + $ui->assign('totalWhatsappFailed', $totalWhatsappFailed); + $ui->display('message-bulk.tpl'); + break; + + default: + r2(U . 'message/send_sms', 'e', 'action not defined'); +} diff --git a/system/controllers/order.php b/system/controllers/order.php index 3905596b..7a6d199c 100644 --- a/system/controllers/order.php +++ b/system/controllers/order.php @@ -13,69 +13,68 @@ $ui->assign('_user', $user); switch ($action) { case 'voucher': $ui->assign('_system_menu', 'voucher'); - $ui->assign('_title', $_L['Order_Voucher']); + $ui->assign('_title', Lang::T('Order Voucher')); run_hook('customer_view_order'); #HOOK $ui->display('user-order.tpl'); break; case 'history': $ui->assign('_system_menu', 'history'); - $paginator = Paginator::build(ORM::for_table('tbl_payment_gateway'),['username'=>$user['username']]); - $d = ORM::for_table('tbl_payment_gateway') - ->where('username', $user['username']) - ->order_by_desc('id') - ->offset($paginator['startpoint'])->limit($paginator['limit']) - ->find_many(); - $ui->assign('paginator', $paginator); + $query = ORM::for_table('tbl_payment_gateway')->where('username', $user['username'])->order_by_desc('id'); + $d = Paginator::findMany($query); $ui->assign('d', $d); $ui->assign('_title', Lang::T('Order History')); run_hook('customer_view_order_history'); #HOOK $ui->display('user-orderHistory.tpl'); break; - case 'balance': - if (strpos($user['email'], '@') === false) { - r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address")); - } - $ui->assign('_title', 'Top Up'); - $ui->assign('_system_menu', 'balance'); - $plans_balance = ORM::for_table('tbl_plans')->where('enabled', '1')->where('type', 'Balance')->find_many(); - $ui->assign('plans_balance', $plans_balance); - $ui->display('user-orderBalance.tpl'); - break; - case 'package': - if (strpos($user['email'], '@') === false) { - r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address")); - } - $ui->assign('_title', 'Order Plan'); - $ui->assign('_system_menu', 'package'); - if (!empty($_SESSION['nux-router'])) { - if ($_SESSION['nux-router'] == 'radius') { - $radius_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 1)->where('type', 'PPPOE')->find_many(); - $radius_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 1)->where('type', 'Hotspot')->find_many(); - } else { - $routers = ORM::for_table('tbl_routers')->where('id', $_SESSION['nux-router'])->find_many(); - $rs = []; - foreach ($routers as $r) { - $rs[] = $r['name']; - } - $plans_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where_in('routers', $rs)->where('is_radius', 0)->where('type', 'PPPOE')->find_many(); - $plans_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where_in('routers', $rs)->where('is_radius', 0)->where('type', 'Hotspot')->find_many(); - } + case 'balance': + if (strpos($user['email'], '@') === false) { + r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address")); + } + $ui->assign('_title', 'Top Up'); + $ui->assign('_system_menu', 'balance'); + $plans_balance = ORM::for_table('tbl_plans')->where('enabled', '1')->where('type', 'Balance')->where('prepaid', 'yes')->find_many(); + $ui->assign('plans_balance', $plans_balance); + $ui->display('user-orderBalance.tpl'); + break; + case 'package': + if (strpos($user['email'], '@') === false) { + r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address")); + } + $ui->assign('_title', 'Order Plan'); + $ui->assign('_system_menu', 'package'); + $account_type = $user['account_type']; + if(empty($account_type)){ + $account_type = 'Personal'; + } + if (!empty ($_SESSION['nux-router'])) { + if ($_SESSION['nux-router'] == 'radius') { + $radius_pppoe = ORM::for_table('tbl_plans')->where('plan_type', $account_type)->where('enabled', '1')->where('is_radius', 1)->where('type', 'PPPOE')->where('prepaid', 'yes')->find_many(); + $radius_hotspot = ORM::for_table('tbl_plans')->where('plan_type', $account_type)->where('enabled', '1')->where('is_radius', 1)->where('type', 'Hotspot')->where('prepaid', 'yes')->find_many(); } else { - $radius_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 1)->where('type', 'PPPOE')->find_many(); - $radius_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 1)->where('type', 'Hotspot')->find_many(); - - $routers = ORM::for_table('tbl_routers')->find_many(); - $plans_pppoe = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 0)->where('type', 'PPPOE')->find_many(); - $plans_hotspot = ORM::for_table('tbl_plans')->where('enabled', '1')->where('is_radius', 0)->where('type', 'Hotspot')->find_many(); + $routers = ORM::for_table('tbl_routers')->where('id', $_SESSION['nux-router'])->find_many(); + $rs = []; + foreach ($routers as $r) { + $rs[] = $r['name']; + } + $plans_pppoe = ORM::for_table('tbl_plans')->where('plan_type', $account_type)->where('enabled', '1')->where_in('routers', $rs)->where('is_radius', 0)->where('type', 'PPPOE')->where('prepaid', 'yes')->find_many(); + $plans_hotspot = ORM::for_table('tbl_plans')->where('plan_type', $account_type)->where('enabled', '1')->where_in('routers', $rs)->where('is_radius', 0)->where('type', 'Hotspot')->where('prepaid', 'yes')->find_many(); } - $ui->assign('routers', $routers); - $ui->assign('radius_pppoe', $radius_pppoe); - $ui->assign('radius_hotspot', $radius_hotspot); - $ui->assign('plans_pppoe', $plans_pppoe); - $ui->assign('plans_hotspot', $plans_hotspot); - run_hook('customer_view_order_plan'); #HOOK - $ui->display('user-orderPlan.tpl'); - break; + } else { + $radius_pppoe = ORM::for_table('tbl_plans')->where('plan_type', $account_type)->where('enabled', '1')->where('is_radius', 1)->where('type', 'PPPOE')->where('prepaid', 'yes')->find_many(); + $radius_hotspot = ORM::for_table('tbl_plans')->where('plan_type', $account_type)->where('enabled', '1')->where('is_radius', 1)->where('type', 'Hotspot')->where('prepaid', 'yes')->find_many(); + + $routers = ORM::for_table('tbl_routers')->find_many(); + $plans_pppoe = ORM::for_table('tbl_plans')->where('plan_type', $account_type)->where('enabled', '1')->where('is_radius', 0)->where('type', 'PPPOE')->where('prepaid', 'yes')->find_many(); + $plans_hotspot = ORM::for_table('tbl_plans')->where('plan_type', $account_type)->where('enabled', '1')->where('is_radius', 0)->where('type', 'Hotspot')->where('prepaid', 'yes')->find_many(); + } + $ui->assign('routers', $routers); + $ui->assign('radius_pppoe', $radius_pppoe); + $ui->assign('radius_hotspot', $radius_hotspot); + $ui->assign('plans_pppoe', $plans_pppoe); + $ui->assign('plans_hotspot', $plans_hotspot); + run_hook('customer_view_order_plan'); #HOOK + $ui->display('user-orderPlan.tpl'); + break; case 'unpaid': $d = ORM::for_table('tbl_payment_gateway') ->where('username', $user['username']) @@ -84,7 +83,7 @@ switch ($action) { run_hook('custome r_find_unpaid'); #HOOK if ($d) { - if (empty($d['pg_url_payment'])) { + 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")); @@ -100,21 +99,21 @@ switch ($action) { ->find_one($trxid); run_hook('customer_view_payment'); #HOOK // jika tidak ditemukan, berarti punya orang lain - if (empty($trx)) { + 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'])) { + // jika url kosong, balikin ke buy, kecuali cancel + if (empty ($trx['pg_url_payment']) && $routes['3'] != 'cancel') { r2(U . "order/buy/" . (($trx['routers_id'] == 0) ? $trx['routers'] : $trx['routers_id']) . '/' . $trx['plan_id'], 'w', Lang::T("Checking payment")); } if ($routes['3'] == 'check') { - if (!file_exists('system/paymentgateway/' . $trx['gateway'] . '.php')) { + if (!file_exists($PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $trx['gateway'] . '.php')) { r2(U . 'order/view/' . $trxid, 'e', Lang::T("No Payment Gateway Available")); } run_hook('customer_check_payment_status'); #HOOK - include 'system/paymentgateway/' . $trx['gateway'] . '.php'; + include $PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $trx['gateway'] . '.php'; call_user_func($trx['gateway'] . '_validate_config'); - call_user_func($config['payment_gateway'] . '_get_status', $trx, $user); + call_user_func($trx['gateway'] . '_get_status', $trx, $user); } else if ($routes['3'] == 'cancel') { run_hook('customer_cancel_payment'); #HOOK $trx->pg_paid_response = '{}'; @@ -124,16 +123,16 @@ switch ($action) { $trx = ORM::for_table('tbl_payment_gateway') ->where('username', $user['username']) ->find_one($trxid); - if ('midtrans' == $trx['gateway']) { - //Hapus invoice link - } } - if (empty($trx)) { + if (empty ($trx)) { r2(U . "order/package", 'e', Lang::T("Transaction Not found")); } - $router = ORM::for_table('tbl_routers')->find_one($trx['routers_id']); + $router = Mikrotik::info($trx['routers']); $plan = ORM::for_table('tbl_plans')->find_one($trx['plan_id']); $bandw = ORM::for_table('tbl_bandwidth')->find_one($plan['id_bw']); + list($bills, $add_cost) = User::getBills($id_customer); + $ui->assign('bills', $bills); + $ui->assign('add_cost', $add_cost); $ui->assign('trx', $trx); $ui->assign('router', $router); $ui->assign('plan', $plan); @@ -142,23 +141,27 @@ switch ($action) { $ui->display('user-orderView.tpl'); break; case 'pay': - if ($_c['enable_balance'] != 'yes' && $config['allow_balance_transfer'] != 'yes') { + if ($config['enable_balance'] != 'yes') { r2(U . "order/package", 'e', Lang::T("Balance not enabled")); } $plan = ORM::for_table('tbl_plans')->where('enabled', '1')->find_one($routes['3']); - if (empty($plan)) { + if (empty ($plan)) { r2(U . "order/package", 'e', Lang::T("Plan Not found")); } + if (!$plan['enabled']) { + r2(U . "home", 'e', 'Plan is not exists'); + } if ($routes['2'] == 'radius') { $router_name = 'radius'; } else { $router_name = $plan['routers']; } + list($bills, $add_cost) = User::getBills($id_customer); if ($plan && $plan['enabled'] && $user['balance'] >= $plan['price']) { if (Package::rechargeUser($user['id'], $router_name, $plan['id'], 'Customer', 'Balance')) { // if success, then get the balance - Balance::min($user['id'], $plan['price']); - r2(U . "home", 's', Lang::T("Success to buy package")); + Balance::min($user['id'], $plan['price'] + $add_cost); + r2(U . "voucher/invoice/", 's', Lang::T("Success to buy package")); } else { r2(U . "order/package", 'e', Lang::T("Failed to buy package")); Message::sendTelegram("Buy Package with Balance Failed\n\n#u$c[username] #buy \n" . $plan['name_plan'] . @@ -166,26 +169,35 @@ switch ($action) { "\nPrice: " . $p['price']); } } else { - echo "no renewall | plan enabled: $p[enabled] | User balance: $c[balance] | price $p[price]\n"; + r2(U . "home", 'e', 'Plan is not exists'); } break; case 'send': - if ($_c['enable_balance'] != 'yes') { + if ($config['enable_balance'] != 'yes') { r2(U . "order/package", 'e', Lang::T("Balance not enabled")); } $ui->assign('_title', Lang::T('Buy for friend')); $ui->assign('_system_menu', 'package'); $plan = ORM::for_table('tbl_plans')->find_one($routes['3']); - if (empty($plan)) { + if (empty ($plan)) { r2(U . "order/package", 'e', Lang::T("Plan Not found")); } + if (!$plan['enabled']) { + r2(U . "home", 'e', 'Plan is not exists'); + } if ($routes['2'] == 'radius') { $router_name = 'radius'; } else { $router_name = $plan['routers']; } - if (isset($_POST['send']) && $_POST['send'] == 'plan') { + if (isset ($_POST['send']) && $_POST['send'] == 'plan') { $target = ORM::for_table('tbl_customers')->where('username', _post('username'))->find_one(); + list($bills, $add_cost) = User::getBills($target['id']); + if (!empty ($add_cost)) { + $ui->assign('bills', $bills); + $ui->assign('add_cost', $add_cost); + $plan['price'] += $add_cost; + } if (!$target) { r2(U . 'home', 'd', Lang::T('Username not found')); } @@ -254,19 +266,49 @@ switch ($action) { $ui->assign('plan', $plan); $ui->display('user-sendPlan.tpl'); break; - case 'buy': + case 'gateway': + $ui->assign('_title', Lang::T('Select Payment Gateway')); + $ui->assign('_system_menu', 'package'); if (strpos($user['email'], '@') === false) { r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address")); } - if ($config['payment_gateway'] == 'none') { - r2(U . 'home', 'e', Lang::T("No Payment Gateway Available")); + $pgs = array_values(explode(',', $config['payment_gateway'])); + if (count($pgs) == 0) { + sendTelegram("Payment Gateway not set, please set it in Settings"); + _log(Lang::T("Payment Gateway not set, please set it in Settings")); + r2(U . "home", 'e', Lang::T("Failed to create Transaction..")); } - if (!file_exists('system/paymentgateway/' . $config['payment_gateway'] . '.php')) { - r2(U . 'home', 'e', Lang::T("No Payment Gateway Available")); + if (count($pgs) > 1) { + $ui->assign('pgs', $pgs); + //$ui->assign('pgs', $pgs); + $ui->assign('route2', $routes[2]); + $ui->assign('route3', $routes[3]); + + //$ui->assign('plan', $plan); + $ui->display('user-selectGateway.tpl'); + break; + } else { + if (empty ($pgs[0])) { + sendTelegram("Payment Gateway not set, please set it in Settings"); + _log(Lang::T("Payment Gateway not set, please set it in Settings")); + r2(U . "home", 'e', Lang::T("Failed to create Transaction..")); + } else { + $_POST['gateway'] = $pgs[0]; + } + } + case 'buy': + $gateway = _post('gateway'); + if (empty ($gateway) && !empty ($_SESSION['gateway'])) { + $gateway = $_SESSION['gateway']; + } else if (!empty ($gateway)) { + $_SESSION['gateway'] = $gateway; + } + if (empty ($gateway)) { + r2(U . 'order/gateway/' . $routes[2] . '/' . $routes[3], 'w', Lang::T("Please select Payment Gateway")); } run_hook('customer_buy_plan'); #HOOK - include 'system/paymentgateway/' . $config['payment_gateway'] . '.php'; - call_user_func($config['payment_gateway'] . '_validate_config'); + include $PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $gateway . '.php'; + call_user_func($gateway . '_validate_config'); if ($routes['2'] == 'radius') { $router['id'] = 0; @@ -278,7 +320,7 @@ switch ($action) { $router['name'] = 'balance'; } $plan = ORM::for_table('tbl_plans')->where('enabled', '1')->find_one($routes['3']); - if (empty($router) || empty($plan)) { + if (empty ($router) || empty ($plan)) { r2(U . "order/package", 'e', Lang::T("Plan Not found")); } $d = ORM::for_table('tbl_payment_gateway') @@ -289,7 +331,7 @@ switch ($action) { if ($d['pg_url_payment']) { r2(U . "order/view/" . $d['id'], 'w', Lang::T("You already have unpaid transaction, cancel it or pay it.")); } else { - if ($config['payment_gateway'] == $d['gateway']) { + if ($gateway == $d['gateway']) { $id = $d['id']; } else { $d->status = 4; @@ -297,27 +339,53 @@ switch ($action) { } } } - if (empty($id)) { + $add_cost = 0; + if ($router['name'] != 'balance') { + list($bills, $add_cost) = User::getBills($id_customer); + } + if (empty ($id)) { $d = ORM::for_table('tbl_payment_gateway')->create(); $d->username = $user['username']; - $d->gateway = $config['payment_gateway']; + $d->gateway = $gateway; $d->plan_id = $plan['id']; $d->plan_name = $plan['name_plan']; $d->routers_id = $router['id']; $d->routers = $router['name']; - $d->price = $plan['price']; + if ($plan['validity_unit'] == 'Period') { + // Postpaid price from field + $add_inv = User::getAttribute("Invoice", $id_customer); + if (empty ($add_inv) or $add_inv == 0) { + $d->price = ($plan['price'] + $add_cost); + } else { + $d->price = ($add_inv + $add_cost); + } + } else { + $d->price = ($plan['price'] + $add_cost); + } + //$d->price = ($plan['price'] + $add_cost); $d->created_date = date('Y-m-d H:i:s'); $d->status = 1; $d->save(); $id = $d->id(); } else { $d->username = $user['username']; - $d->gateway = $config['payment_gateway']; + $d->gateway = $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']; + if ($plan['validity_unit'] == 'Period') { + // Postpaid price from field + $add_inv = User::getAttribute("Invoice", $id_customer); + if (empty ($add_inv) or $add_inv == 0) { + $d->price = ($plan['price'] + $add_cost); + } else { + $d->price = ($add_inv + $add_cost); + } + } else { + $d->price = ($plan['price'] + $add_cost); + } + //$d->price = ($plan['price'] + $add_cost); $d->created_date = date('Y-m-d H:i:s'); $d->status = 1; $d->save(); @@ -325,7 +393,7 @@ switch ($action) { if (!$id) { r2(U . "order/package/" . $d['id'], 'e', Lang::T("Failed to create Transaction..")); } else { - call_user_func($config['payment_gateway'] . '_create_transaction', $d, $user); + call_user_func($gateway . '_create_transaction', $d, $user); } break; default: diff --git a/system/controllers/page.php b/system/controllers/page.php index 866246af..d1bd9ad9 100644 --- a/system/controllers/page.php +++ b/system/controllers/page.php @@ -5,7 +5,7 @@ **/ _auth(); -$ui->assign('_title', $_L['Order_Voucher']); +$ui->assign('_title', Lang::T('Order Voucher')); $ui->assign('_system_menu', 'order'); $action = $routes['1']; diff --git a/system/controllers/pages.php b/system/controllers/pages.php index d77f8edb..1d60dfab 100644 --- a/system/controllers/pages.php +++ b/system/controllers/pages.php @@ -9,10 +9,12 @@ $ui->assign('_title', 'Pages'); $ui->assign('_system_menu', 'pages'); $action = $routes['1']; -$admin = Admin::_info(); $ui->assign('_admin', $admin); if(strpos($action,"-reset")!==false){ + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'),'danger', "dashboard"); + } $action = str_replace("-reset","",$action); $path = "pages/".str_replace(".","",$action).".html"; $temp = "pages_template/".str_replace(".","",$action).".html"; @@ -25,6 +27,9 @@ if(strpos($action,"-reset")!==false){ } r2(U . 'pages/'.$action); }else if(strpos($action,"-post")===false){ + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'),'danger', "dashboard"); + } $path = "pages/".str_replace(".","",$action).".html"; //echo $path; run_hook('view_edit_pages'); #HOOK @@ -48,15 +53,18 @@ if(strpos($action,"-reset")!==false){ }else $ui->display('a404.tpl'); }else{ + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'),'danger', "dashboard"); + } $action = str_replace("-post","",$action); $path = "pages/".str_replace(".","",$action).".html"; if(file_exists($path)){ $html = _post("html"); run_hook('save_pages'); #HOOK if(file_put_contents($path, str_replace([""],"",$html))){ - r2(U . 'pages/'.$action, 's', $_L['Success_Save_Page']); + r2(U . 'pages/'.$action, 's', Lang::T("Saving page success")); }else{ - r2(U . 'pages/'.$action, 'e', $_L['Failed_Save_Page']); + r2(U . 'pages/'.$action, 'e', Lang::T("Failed to save page, make sure i can write to folder pages, chmod 664 pages/*.html")); } }else $ui->display('a404.tpl'); diff --git a/system/controllers/paymentgateway.php b/system/controllers/paymentgateway.php index 5aad90ac..7621b11b 100644 --- a/system/controllers/paymentgateway.php +++ b/system/controllers/paymentgateway.php @@ -1,4 +1,5 @@ assign('_system_menu', 'paymentgateway'); -$action = alphanumeric($routes['1']); -$admin = Admin::_info(); +$action = alphanumeric($routes[1]); $ui->assign('_admin', $admin); -if(file_exists('system/paymentgateway/'.$action.'.php')){ - include 'system/paymentgateway/'.$action.'.php'; +if ($action == 'delete') { + $pg = alphanumeric($routes[2]); + if (file_exists($PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $pg . '.php')) { + deleteFile($PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR, $pg); + } + r2(U . 'paymentgateway', 's', Lang::T('Payment Gateway Deleted')); +} + +if (_post('save') == 'actives') { + $pgs = ''; + if(is_array($_POST['pgs'])){ + $pgs = implode(',', $_POST['pgs']); + } + $d = ORM::for_table('tbl_appconfig')->where('setting', 'payment_gateway')->find_one(); + if ($d) { + $d->value = $pgs; + $d->save(); + } else { + $d = ORM::for_table('tbl_appconfig')->create(); + $d->setting = 'payment_gateway'; + $d->value = $pgs; + $d->save(); + } + r2(U . 'paymentgateway', 's', Lang::T('Payment Gateway saved successfully')); +} + +if (file_exists($PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $action . '.php')) { + include $PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $action . '.php'; if ($_SERVER['REQUEST_METHOD'] === 'POST') { - if(function_exists($action.'_save_config')){ - call_user_func($action.'_save_config'); - }else{ + 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{ + } else { + if (function_exists($action . '_show_config')) { + call_user_func($action . '_show_config'); + } else { $ui->display('a404.tpl'); } } -}else{ - if(!empty($action)){ +} 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); + } else { + $files = scandir($PAYMENTGATEWAY_PATH); + foreach ($files as $file) { + if (pathinfo($file, PATHINFO_EXTENSION) == 'php') { + $pgs[] = str_replace('.php', '', $file); } } - if(isset($_POST['payment_gateway'])){ - $payment_gateway = _post('payment_gateway'); - $d = ORM::for_table('tbl_appconfig')->where('setting', 'payment_gateway')->find_one(); - if($d){ - $d->value = $payment_gateway; - $d->save(); - }else{ - $d = ORM::for_table('tbl_appconfig')->create(); - $d->setting = 'payment_gateway'; - $d->value = $payment_gateway; - $d->save(); - } - r2(U . 'paymentgateway', 's', Lang::T('Payment Gateway saved successfully')); - } $ui->assign('_title', 'Payment Gateway Settings'); $ui->assign('pgs', $pgs); + $ui->assign('actives', explode(',', $config['payment_gateway'])); $ui->display('paymentgateway.tpl'); } -} \ No newline at end of file +} + + +function deleteFile($path, $name) +{ + $files = scandir($path); + foreach ($files as $file) { + if (is_file($path . $file) && strpos($file, $name) !== false) { + unlink($path . $file); + } else if (is_dir($path . $file) && !in_array($file, ['.', '..'])) { + deleteFile($path . $file . DIRECTORY_SEPARATOR, $name); + } + } +} diff --git a/system/controllers/plan.php b/system/controllers/plan.php new file mode 100644 index 00000000..e2996ee8 --- /dev/null +++ b/system/controllers/plan.php @@ -0,0 +1,757 @@ +assign('_title', Lang::T('Recharge Account')); +$ui->assign('_system_menu', 'plan'); + +$action = $routes['1']; +$ui->assign('_admin', $admin); + +$select2_customer = << +document.addEventListener("DOMContentLoaded", function(event) { + $('#personSelect').select2({ + theme: "bootstrap", + ajax: { + url: function(params) { + if(params.term != undefined){ + return './index.php?_route=autoload/customer_select2&s='+params.term; + }else{ + return './index.php?_route=autoload/customer_select2'; + } + } + } + }); +}); + +EOT; + +switch ($action) { + case 'sync': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + set_time_limit(-1); + $plans = ORM::for_table('tbl_user_recharges')->where('status', 'on')->find_many(); + $log = ''; + $router = ''; + foreach ($plans as $plan) { + if ($router != $plan['routers'] && $plan['routers'] != 'radius') { + $mikrotik = Mikrotik::info($plan['routers']); + $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); + $router = $plan['routers']; + } + $p = ORM::for_table('tbl_plans')->findOne($plan['plan_id']); + $c = ORM::for_table('tbl_customers')->findOne($plan['customer_id']); + if ($plan['routers'] == 'radius') { + Radius::customerAddPlan($c, $p, $plan['expiration'] . ' ' . $plan['time']); + } else { + if ($plan['type'] == 'Hotspot') { + Mikrotik::addHotspotUser($client, $p, $c); + } else if ($plan['type'] == 'PPPOE') { + Mikrotik::addPpoeUser($client, $p, $c); + } + } + $log .= "DONE : $plan[username], $plan[namebp], $plan[type], $plan[routers]
"; + } + if ($isApi) { + showResult(true, $log); + } + r2(U . 'plan/list', 's', $log); + case 'list': + $ui->assign('xfooter', ''); + $ui->assign('_title', Lang::T('Customer')); + $search = _post('search'); + if ($search != '') { + $query = ORM::for_table('tbl_user_recharges')->where_like('username', '%' . $search . '%')->order_by_desc('id'); + $d = Paginator::findMany($query, ['search' => $search]); + } else { + $query = ORM::for_table('tbl_user_recharges')->order_by_desc('id'); + $d = Paginator::findMany($query); + } + run_hook('view_list_billing'); #HOOK + if ($isApi) { + showResult(true, $action, $d, ['search' => $search]); + } + $ui->assign('d', $d); + $ui->assign('search', $search); + $ui->display('plan.tpl'); + break; + + case 'recharge': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $ui->assign('xfooter', $select2_customer); + if (isset($routes['2']) && !empty($routes['2'])) { + $ui->assign('cust', ORM::for_table('tbl_customers')->find_one($routes['2'])); + } + run_hook('view_recharge'); #HOOK + $ui->display('recharge.tpl'); + break; + + case 'recharge-confirm': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $id_customer = _post('id_customer'); + $server = _post('server'); + $planId = _post('plan'); + $using = _post('using'); + + $msg = ''; + if ($id_customer == '' or $server == '' or $planId == '' or $using == '') { + $msg .= Lang::T('All field is required') . '
'; + } + + if ($msg == '') { + $gateway = 'Recharge'; + $channel = $admin['fullname']; + $cust = User::_info($id_customer); + $plan = ORM::for_table('tbl_plans')->find_one($planId); + list($bills, $add_cost) = User::getBills($id_customer); + if ($using == 'balance' && $config['enable_balance'] == 'yes') { + if (!$cust) { + r2(U . 'plan/recharge', 'e', Lang::T('Customer not found')); + } + if (!$plan) { + r2(U . 'plan/recharge', 'e', Lang::T('Plan not found')); + } + if ($cust['balance'] < ($plan['price'] + $add_cost)) { + r2(U . 'plan/recharge', 'e', Lang::T('insufficient balance')); + } + $gateway = 'Recharge Balance'; + } + if ($using == 'zero') { + $zero = 1; + $gateway = 'Recharge Zero'; + } + $ui->assign('bills', $bills); + $ui->assign('add_cost', $add_cost); + $ui->assign('cust', $cust); + $ui->assign('gateway', $gateway); + $ui->assign('channel', $channel); + $ui->assign('server', $server); + $ui->assign('using', $using); + $ui->assign('plan', $plan); + $ui->display('recharge-confirm.tpl'); + } else { + r2(U . 'plan/recharge', 'e', $msg); + } + break; + + case 'recharge-post': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $id_customer = _post('id_customer'); + $server = _post('server'); + $planId = _post('plan'); + $using = _post('using'); + + $msg = ''; + if ($id_customer == '' or $server == '' or $planId == '' or $using == '') { + $msg .= Lang::T('All field is required') . '
'; + } + + if ($msg == '') { + $gateway = 'Recharge'; + $channel = $admin['fullname']; + $cust = User::_info($id_customer); + list($bills, $add_cost) = User::getBills($id_customer); + if ($using == 'balance' && $config['enable_balance'] == 'yes') { + $plan = ORM::for_table('tbl_plans')->find_one($planId); + if (!$cust) { + r2(U . 'plan/recharge', 'e', Lang::T('Customer not found')); + } + if (!$plan) { + r2(U . 'plan/recharge', 'e', Lang::T('Plan not found')); + } + if ($cust['balance'] < ($plan['price'] + $add_cost)) { + r2(U . 'plan/recharge', 'e', Lang::T('insufficient balance')); + } + $gateway = 'Recharge Balance'; + } + if ($using == 'zero') { + $add_cost = 0; + $zero = 1; + $gateway = 'Recharge Zero'; + } + if (Package::rechargeUser($id_customer, $server, $planId, $gateway, $channel)) { + if ($using == 'balance') { + Balance::min($cust['id'], $plan['price'] + $add_cost); + } + $in = ORM::for_table('tbl_transactions')->where('username', $cust['username'])->order_by_desc('id')->find_one(); + Package::createInvoice($in); + $ui->display('invoice.tpl'); + _log('[' . $admin['username'] . ']: ' . 'Recharge ' . $cust['username'] . ' [' . $in['plan_name'] . '][' . Lang::moneyFormat($in['price']) . ']', $admin['user_type'], $admin['id']); + } else { + r2(U . 'plan/recharge', 'e', "Failed to recharge account"); + } + } else { + r2(U . 'plan/recharge', 'e', $msg); + } + break; + + case 'view': + $id = $routes['2']; + $in = ORM::for_table('tbl_transactions')->where('id', $id)->find_one(); + $ui->assign('in', $in); + if (!empty($routes['3']) && $routes['3'] == 'send') { + $c = ORM::for_table('tbl_customers')->where('username', $in['username'])->find_one(); + if ($c) { + Message::sendInvoice($c, $in); + r2(U . 'plan/view/' . $id, 's', "Success send to customer"); + } + r2(U . 'plan/view/' . $id, 'd', "Customer not found"); + } + Package::createInvoice($in); + $ui->assign('_title', 'View Invoice'); + $ui->display('invoice.tpl'); + break; + + + case 'print': + $content = $_POST['content']; + if (!empty($content)) { + if ($_POST['nux'] == 'print') { + //header("Location: nux://print?text=".urlencode($content)); + $ui->assign('nuxprint', "nux://print?text=" . urlencode($content)); + } + $ui->assign('content', $content); + } else { + $id = _post('id'); + $d = ORM::for_table('tbl_transactions')->where('id', $id)->find_one(); + $ui->assign('in', $d); + $ui->assign('date', Lang::dateAndTimeFormat($d['recharged_on'], $d['recharged_time'])); + } + + run_hook('print_invoice'); #HOOK + $ui->display('invoice-print.tpl'); + break; + + case 'edit': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $id = $routes['2']; + $d = ORM::for_table('tbl_user_recharges')->find_one($id); + if ($d) { + $ui->assign('d', $d); + if (in_array($admin['user_type'], array('SuperAdmin', 'Admin'))) { + $p = ORM::for_table('tbl_plans')->where_not_equal('type', 'Balance')->find_many(); + } else { + $p = ORM::for_table('tbl_plans')->where('enabled', '1')->where_not_equal('type', 'Balance')->find_many(); + } + $ui->assign('p', $p); + run_hook('view_edit_customer_plan'); #HOOK + $ui->assign('_title', 'Edit Plan'); + $ui->display('plan-edit.tpl'); + } else { + r2(U . 'plan/list', 'e', $_L['Account_Not_Found']); + } + break; + + case 'delete': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $id = $routes['2']; + $d = ORM::for_table('tbl_user_recharges')->find_one($id); + if ($d) { + run_hook('delete_customer_active_plan'); #HOOK + $p = ORM::for_table('tbl_plans')->find_one($d['plan_id']); + if ($p['is_radius']) { + Radius::customerDeactivate($d['username']); + } else { + $mikrotik = Mikrotik::info($d['routers']); + if ($d['type'] == 'Hotspot') { + $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); + Mikrotik::removeHotspotUser($client, $d['username']); + Mikrotik::removeHotspotActiveUser($client, $d['username']); + } else { + $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); + Mikrotik::removePpoeUser($client, $d['username']); + Mikrotik::removePpoeActive($client, $d['username']); + } + } + $d->delete(); + _log('[' . $admin['username'] . ']: ' . 'Delete Plan for Customer ' . $c['username'] . ' [' . $in['plan_name'] . '][' . Lang::moneyFormat($in['price']) . ']', $admin['user_type'], $admin['id']); + r2(U . 'plan/list', 's', Lang::T('Data Deleted Successfully')); + } + break; + + case 'edit-post': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $username = _post('username'); + $id_plan = _post('id_plan'); + $recharged_on = _post('recharged_on'); + $expiration = _post('expiration'); + $time = _post('time'); + + $id = _post('id'); + $d = ORM::for_table('tbl_user_recharges')->find_one($id); + if ($d) { + } else { + $msg .= Lang::T('Data Not Found') . '
'; + } + $p = ORM::for_table('tbl_plans')->where('id', $id_plan)->where('enabled', '1')->find_one(); + if ($d) { + } else { + $msg .= ' Plan Not Found
'; + } + if ($msg == '') { + run_hook('edit_customer_plan'); #HOOK + $d->username = $username; + $d->plan_id = $id_plan; + $d->namebp = $p['name_plan']; + //$d->recharged_on = $recharged_on; + $d->expiration = $expiration; + $d->time = $time; + if ($d['status'] == 'off') { + if (strtotime($expiration . ' ' . $time) > time()) { + $d->status = 'on'; + } + } + if ($p['is_radius']) { + $d->routers = 'radius'; + } else { + $d->routers = $p['routers']; + } + $d->save(); + if ($d['status'] == 'on') { + Package::changeTo($username, $id_plan, $id); + } + _log('[' . $admin['username'] . ']: ' . 'Edit Plan for Customer ' . $d['username'] . ' to [' . $d['namebp'] . '][' . Lang::moneyFormat($p['price']) . ']', $admin['user_type'], $admin['id']); + r2(U . 'plan/list', 's', Lang::T('Data Updated Successfully')); + } else { + r2(U . 'plan/edit/' . $id, 'e', $msg); + } + break; + + case 'voucher': + $ui->assign('_title', Lang::T('Vouchers')); + $limit = 10; + $page = _get('p', 0); + $pageNow = $page * $limit; + $search = _req('search'); + if ($search != '') { + if (in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + $d = ORM::for_table('tbl_plans')->where('enabled', '1') + ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) + ->where_like('tbl_voucher.code', '%' . $search . '%') + ->offset($pageNow) + ->limit($limit) + ->findArray(); + } else if ($admin['user_type'] == 'Agent') { + $sales = []; + $sls = ORM::for_table('tbl_users')->select('id')->where('root', $admin['id'])->findArray(); + foreach ($sls as $s) { + $sales[] = $s['id']; + } + $sales[] = $admin['id']; + $d = ORM::for_table('tbl_plans') + ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) + ->where_in('generated_by', $sales) + ->where_like('tbl_voucher.code', '%' . $search . '%') + ->offset($pageNow) + ->limit($limit) + ->findArray(); + } + } else { + if (in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + $d = ORM::for_table('tbl_plans')->where('enabled', '1') + ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) + ->offset($pageNow) + ->limit($limit) + ->findArray(); + } else if ($admin['user_type'] == 'Agent') { + $sales = []; + $sls = ORM::for_table('tbl_users')->select('id')->where('root', $admin['id'])->findArray(); + foreach ($sls as $s) { + $sales[] = $s['id']; + } + $sales[] = $admin['id']; + $d = ORM::for_table('tbl_plans') + ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) + ->where_in('generated_by', $sales) + ->offset($pageNow) + ->limit($limit) + ->findArray(); + } + } + // extract admin + $admins = []; + foreach ($d as $k) { + if (!empty($k['generated_by'])) { + $admins[] = $k['generated_by']; + } + } + if (count($admins) > 0) { + $adms = ORM::for_table('tbl_users')->where_in('id', $admins)->find_many(); + unset($admins); + foreach ($adms as $adm) { + $tipe = $adm['user_type']; + if ($tipe == 'Sales') { + $tipe = ' [S]'; + } else if ($tipe == 'Agent') { + $tipe = ' [A]'; + } else { + $tipe == ''; + } + $admins[$adm['id']] = $adm['fullname'] . $tipe; + } + } + $ui->assign('admins', $admins); + $ui->assign('d', $d); + $ui->assign('search', $search); + $ui->assign('page', $page); + run_hook('view_list_voucher'); #HOOK + $ui->display('voucher.tpl'); + break; + + case 'add-voucher': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $ui->assign('_title', Lang::T('Add Vouchers')); + $c = ORM::for_table('tbl_customers')->find_many(); + $ui->assign('c', $c); + $p = ORM::for_table('tbl_plans')->where('enabled', '1')->find_many(); + $ui->assign('p', $p); + $r = ORM::for_table('tbl_routers')->where('enabled', '1')->find_many(); + $ui->assign('r', $r); + run_hook('view_add_voucher'); #HOOK + $ui->display('voucher-add.tpl'); + break; + + case 'remove-voucher': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $d = ORM::for_table('tbl_voucher')->where_equal('status', '1')->findMany(); + if ($d) { + $jml = 0; + foreach ($d as $v) { + if (!ORM::for_table('tbl_user_recharges')->where_equal("method", 'Voucher - ' . $v['code'])->findOne()) { + $v->delete(); + $jml++; + } + } + r2(U . 'plan/voucher', 's', "$jml " . Lang::T('Data Deleted Successfully')); + } + case 'print-voucher': + $from_id = _post('from_id'); + $planid = _post('planid'); + $pagebreak = _post('pagebreak'); + $limit = _post('limit'); + $vpl = _post('vpl'); + if (empty($vpl)) { + $vpl = 3; + } + if ($pagebreak < 1) $pagebreak = 12; + + if ($limit < 1) $limit = $pagebreak * 2; + if (empty($from_id)) { + $from_id = 0; + } + + if ($from_id > 0 && $planid > 0) { + $v = ORM::for_table('tbl_plans') + ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) + ->where('tbl_voucher.status', '0') + ->where('tbl_plans.id', $planid) + ->where_gt('tbl_voucher.id', $from_id) + ->limit($limit); + $vc = ORM::for_table('tbl_plans') + ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) + ->where('tbl_voucher.status', '0') + ->where('tbl_plans.id', $planid) + ->where_gt('tbl_voucher.id', $from_id); + } else if ($from_id == 0 && $planid > 0) { + $v = ORM::for_table('tbl_plans') + ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) + ->where('tbl_voucher.status', '0') + ->where('tbl_plans.id', $planid) + ->limit($limit); + $vc = ORM::for_table('tbl_plans') + ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) + ->where('tbl_voucher.status', '0') + ->where('tbl_plans.id', $planid); + } else if ($from_id > 0 && $planid == 0) { + $v = ORM::for_table('tbl_plans') + ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) + ->where('tbl_voucher.status', '0') + ->where_gt('tbl_voucher.id', $from_id) + ->limit($limit); + $vc = ORM::for_table('tbl_plans') + ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) + ->where('tbl_voucher.status', '0') + ->where_gt('tbl_voucher.id', $from_id); + } else { + $v = ORM::for_table('tbl_plans') + ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) + ->where('tbl_voucher.status', '0') + ->limit($limit); + $vc = ORM::for_table('tbl_plans') + ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) + ->where('tbl_voucher.status', '0'); + } + if (in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + $v = $v->find_many(); + $vc = $vc->count(); + } else { + $sales = []; + $sls = ORM::for_table('tbl_users')->select('id')->where('root', $admin['id'])->findArray(); + foreach ($sls as $s) { + $sales[] = $s['id']; + } + $sales[] = $admin['id']; + $v = $v->where_in('generated_by', $sales)->find_many(); + $vc = $vc->where_in('generated_by', $sales)->count(); + } + $template = file_get_contents("pages/Voucher.html"); + $template = str_replace('[[company_name]]', $config['CompanyName'], $template); + + $ui->assign('_title', Lang::T('Hotspot Voucher')); + $ui->assign('from_id', $from_id); + $ui->assign('vpl', $vpl); + $ui->assign('pagebreak', $pagebreak); + + $plans = ORM::for_table('tbl_plans')->find_many(); + $ui->assign('plans', $plans); + $ui->assign('limit', $limit); + $ui->assign('planid', $planid); + + $voucher = []; + $n = 1; + foreach ($v as $vs) { + $temp = $template; + $temp = str_replace('[[qrcode]]', '', $temp); + $temp = str_replace('[[price]]', Lang::moneyFormat($vs['price']), $temp); + $temp = str_replace('[[voucher_code]]', $vs['code'], $temp); + $temp = str_replace('[[plan]]', $vs['name_plan'], $temp); + $temp = str_replace('[[counter]]', $n, $temp); + $voucher[] = $temp; + $n++; + } + + $ui->assign('voucher', $voucher); + $ui->assign('vc', $vc); + + //for counting pagebreak + $ui->assign('jml', 0); + run_hook('view_print_voucher'); #HOOK + $ui->display('print-voucher.tpl'); + break; + case 'voucher-post': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $type = _post('type'); + $plan = _post('plan'); + $voucher_format = _post('voucher_format'); + $prefix = _post('prefix'); + $server = _post('server'); + $numbervoucher = _post('numbervoucher'); + $lengthcode = _post('lengthcode'); + + $msg = ''; + if ($type == '' or $plan == '' or $server == '' or $numbervoucher == '' or $lengthcode == '') { + $msg .= Lang::T('All field is required') . '
'; + } + if (Validator::UnsignedNumber($numbervoucher) == false) { + $msg .= 'The Number of Vouchers must be a number' . '
'; + } + if (Validator::UnsignedNumber($lengthcode) == false) { + $msg .= 'The Length Code must be a number' . '
'; + } + if ($msg == '') { + if (!empty($prefix)) { + $d = ORM::for_table('tbl_appconfig')->where('setting', 'voucher_prefix')->find_one(); + if ($d) { + $d->value = $prefix; + $d->save(); + } else { + $d = ORM::for_table('tbl_appconfig')->create(); + $d->setting = 'voucher_prefix'; + $d->value = $prefix; + $d->save(); + } + } + run_hook('create_voucher'); #HOOK + for ($i = 0; $i < $numbervoucher; $i++) { + $code = strtoupper(substr(md5(time() . rand(10000, 99999)), 0, $lengthcode)); + if ($voucher_format == 'low') { + $code = strtolower($code); + } else if ($voucher_format == 'rand') { + $code = Lang::randomUpLowCase($code); + } + $d = ORM::for_table('tbl_voucher')->create(); + $d->type = $type; + $d->routers = $server; + $d->id_plan = $plan; + $d->code = $prefix . $code; + $d->user = '0'; + $d->status = '0'; + $d->generated_by = $admin['id']; + $d->save(); + } + if ($numbervoucher == 1) { + r2(U . 'plan/voucher-view/' . $d->id(), 's', Lang::T('Create Vouchers Successfully')); + } + + r2(U . 'plan/voucher', 's', Lang::T('Create Vouchers Successfully')); + } else { + r2(U . 'plan/add-voucher/' . $id, 'e', $msg); + } + break; + + case 'voucher-view': + $id = $routes[2]; + if (in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + $voucher = ORM::for_table('tbl_voucher')->find_one($id); + } else { + $sales = []; + $sls = ORM::for_table('tbl_users')->select('id')->where('root', $admin['id'])->findArray(); + foreach ($sls as $s) { + $sales[] = $s['id']; + } + $sales[] = $admin['id']; + $voucher = ORM::for_table('tbl_voucher') + ->find_one($id); + if (!in_array($voucher['generated_by'], $sales)) { + r2(U . 'plan/voucher/', 'e', Lang::T('Voucher Not Found')); + } + } + if (!$voucher) { + r2(U . 'plan/voucher/', 'e', Lang::T('Voucher Not Found')); + } + $plan = ORM::for_table('tbl_plans')->find_one($d['id_plan']); + if ($voucher && $plan) { + $content = Lang::pad($config['CompanyName'], ' ', 2) . "\n"; + $content .= Lang::pad($config['address'], ' ', 2) . "\n"; + $content .= Lang::pad($config['phone'], ' ', 2) . "\n"; + $content .= Lang::pad("", '=') . "\n"; + $content .= Lang::pads('ID', $voucher['id'], ' ') . "\n"; + $content .= Lang::pads(Lang::T('Code'), $voucher['code'], ' ') . "\n"; + $content .= Lang::pads(Lang::T('Plan Name'), $plan['name_plan'], ' ') . "\n"; + $content .= Lang::pads(Lang::T('Type'), $voucher['type'], ' ') . "\n"; + $content .= Lang::pads(Lang::T('Plan Price'), Lang::moneyFormat($plan['price']), ' ') . "\n"; + $content .= Lang::pads(Lang::T('Sales'), $admin['fullname'] . ' #' . $admin['id'], ' ') . "\n"; + $content .= Lang::pad("", '=') . "\n"; + $content .= Lang::pad($config['note'], ' ', 2) . "\n"; + $ui->assign('print', $content); + $config['printer_cols'] = 30; + $content = Lang::pad($config['CompanyName'], ' ', 2) . "\n"; + $content .= Lang::pad($config['address'], ' ', 2) . "\n"; + $content .= Lang::pad($config['phone'], ' ', 2) . "\n"; + $content .= Lang::pad("", '=') . "\n"; + $content .= Lang::pads('ID', $voucher['id'], ' ') . "\n"; + $content .= Lang::pads(Lang::T('Code'), $voucher['code'], ' ') . "\n"; + $content .= Lang::pads(Lang::T('Plan Name'), $plan['name_plan'], ' ') . "\n"; + $content .= Lang::pads(Lang::T('Type'), $voucher['type'], ' ') . "\n"; + $content .= Lang::pads(Lang::T('Plan Price'), Lang::moneyFormat($plan['price']), ' ') . "\n"; + $content .= Lang::pads(Lang::T('Sales'), $admin['fullname'] . ' #' . $admin['id'], ' ') . "\n"; + $content .= Lang::pad("", '=') . "\n"; + $content .= Lang::pad($config['note'], ' ', 2) . "\n"; + $ui->assign('_title', Lang::T('View')); + $ui->assign('whatsapp', urlencode("```$content```")); + $ui->display('voucher-view.tpl'); + } else { + r2(U . 'plan/voucher/', 'e', Lang::T('Voucher Not Found')); + } + break; + case 'voucher-delete': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $id = $routes['2']; + run_hook('delete_voucher'); #HOOK + $d = ORM::for_table('tbl_voucher')->find_one($id); + if ($d) { + $d->delete(); + r2(U . 'plan/voucher', 's', Lang::T('Data Deleted Successfully')); + } + break; + + case 'refill': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $ui->assign('xfooter', $select2_customer); + $ui->assign('_title', Lang::T('Refill Account')); + run_hook('view_refill'); #HOOK + $ui->display('refill.tpl'); + + break; + + case 'refill-post': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $code = _post('code'); + $user = ORM::for_table('tbl_customers')->where('id', _post('id_customer'))->find_one(); + $v1 = ORM::for_table('tbl_voucher')->where('code', $code)->where('status', 0)->find_one(); + + run_hook('refill_customer'); #HOOK + if ($v1) { + if (Package::rechargeUser($user['id'], $v1['routers'], $v1['id_plan'], "Voucher", $code)) { + $v1->status = "1"; + $v1->user = $user['username']; + $v1->save(); + $in = ORM::for_table('tbl_transactions')->where('username', $user['username'])->order_by_desc('id')->find_one(); + Package::createInvoice($in); + $ui->display('invoice.tpl'); + } else { + r2(U . 'plan/refill', 'e', "Failed to refill account"); + } + } else { + r2(U . 'plan/refill', 'e', Lang::T('Voucher Not Valid')); + } + break; + case 'deposit': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $ui->assign('_title', Lang::T('Refill Balance')); + $ui->assign('xfooter', $select2_customer); + if (in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + $ui->assign('p', ORM::for_table('tbl_plans')->where('type', 'Balance')->find_many()); + } else { + $ui->assign('p', ORM::for_table('tbl_plans')->where('enabled', '1')->where('type', 'Balance')->find_many()); + } + run_hook('view_deposit'); #HOOK + $ui->display('deposit.tpl'); + break; + case 'deposit-post': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent', 'Sales'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $user = _post('id_customer'); + $plan = _post('id_plan'); + + run_hook('deposit_customer'); #HOOK + if (!empty($user) && !empty($plan)) { + if (Package::rechargeUser($user, 'balance', $plan, "Deposit", $admin['fullname'])) { + $c = ORM::for_table('tbl_customers')->where('id', $user)->find_one(); + $in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one(); + Package::createInvoice($in); + $ui->display('invoice.tpl'); + } else { + r2(U . 'plan/refill', 'e', "Failed to refill account"); + } + } else { + r2(U . 'plan/refill', 'e', "All field is required"); + } + break; + default: + $ui->display('a404.tpl'); +} diff --git a/system/controllers/pluginmanager.php b/system/controllers/pluginmanager.php index 8b68a6bf..a289e0bf 100644 --- a/system/controllers/pluginmanager.php +++ b/system/controllers/pluginmanager.php @@ -1,29 +1,29 @@ assign('_title', $_L['Plugin Manager']); +$ui->assign('_title', 'Plugin Manager'); $ui->assign('_system_menu', 'settings'); $plugin_repository = 'https://hotspotbilling.github.io/Plugin-Repository/repository.json'; $action = $routes['1']; -$admin = Admin::_info(); $ui->assign('_admin', $admin); -if ($admin['user_type'] != 'Admin') { - r2(U . "dashboard", 'e', $_L['Do_Not_Access']); +if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); } -$cache = File::pathFixer('system/cache/plugin_repository.json'); +$cache = $CACHE_PATH . File::pathFixer('/plugin_repository.json'); if (file_exists($cache) && time() - filemtime($cache) < (24 * 60 * 60)) { $txt = file_get_contents($cache); $json = json_decode($txt, true); - if(empty($json['plugins']) && empty($json['payment_gateway'])){ + if (empty($json['plugins']) && empty($json['payment_gateway'])) { unlink($cache); r2(U . 'dashboard', 'd', $txt); } @@ -32,26 +32,24 @@ if (file_exists($cache) && time() - filemtime($cache) < (24 * 60 * 60)) { file_put_contents($cache, $data); $json = json_decode($data, true); } - switch ($action) { - - case 'install': - if(!is_writeable(File::pathFixer('system/cache/'))){ - r2(U . "pluginmanager", 'e', 'Folder system/cache/ is not writable'); + case 'delete': + if (!is_writeable($CACHE_PATH)) { + r2(U . "pluginmanager", 'e', 'Folder cache/ is not writable'); } - if(!is_writeable(File::pathFixer('system/plugin/'))){ - r2(U . "pluginmanager", 'e', 'Folder system/plugin/ is not writable'); + if (!is_writeable($PLUGIN_PATH)) { + r2(U . "pluginmanager", 'e', 'Folder plugin/ is not writable'); } set_time_limit(-1); $tipe = $routes['2']; $plugin = $routes['3']; - $file = File::pathFixer('system/cache/') . $plugin . '.zip'; + $file = $CACHE_PATH . DIRECTORY_SEPARATOR . $plugin . '.zip'; if (file_exists($file)) unlink($file); if ($tipe == 'plugin') { foreach ($json['plugins'] as $plg) { if ($plg['id'] == $plugin) { $fp = fopen($file, 'w+'); - $ch = curl_init($plg['github'].'/archive/refs/heads/master.zip'); + $ch = curl_init($plg['github'] . '/archive/refs/heads/master.zip'); curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15); curl_setopt($ch, CURLOPT_TIMEOUT, 15); @@ -64,19 +62,67 @@ switch ($action) { $zip = new ZipArchive(); $zip->open($file); - $zip->extractTo(File::pathFixer('system/cache/')); + $zip->extractTo($CACHE_PATH); $zip->close(); - $folder = File::pathFixer('system/cache/' . $plugin.'-main/'); - if(!file_exists($folder)){ - $folder = File::pathFixer('system/cache/' . $plugin.'-master/'); + $folder = $CACHE_PATH . File::pathFixer('/' . $plugin . '-main/'); + if (!file_exists($folder)) { + $folder = $CACHE_PATH . File::pathFixer('/' . $plugin . '-master/'); } - if(!file_exists($folder)){ + if (!file_exists($folder)) { r2(U . "pluginmanager", 'e', 'Extracted Folder is unknown'); } - File::copyFolder($folder, File::pathFixer('system/plugin/'), ['README.md','LICENSE']); + scanAndRemovePath($folder, $PLUGIN_PATH . DIRECTORY_SEPARATOR); File::deleteFolder($folder); unlink($file); - r2(U . "pluginmanager", 's', 'Plugin '.$plugin.' has been installed'); + r2(U . "pluginmanager", 's', 'Plugin ' . $plugin . ' has been deleted'); + break; + } + } + break; + } + break; + case 'install': + if (!is_writeable($CACHE_PATH)) { + r2(U . "pluginmanager", 'e', 'Folder cache/ is not writable'); + } + if (!is_writeable($PLUGIN_PATH)) { + r2(U . "pluginmanager", 'e', 'Folder plugin/ is not writable'); + } + set_time_limit(-1); + $tipe = $routes['2']; + $plugin = $routes['3']; + $file = $CACHE_PATH . DIRECTORY_SEPARATOR . $plugin . '.zip'; + if (file_exists($file)) unlink($file); + if ($tipe == 'plugin') { + foreach ($json['plugins'] as $plg) { + if ($plg['id'] == $plugin) { + $fp = fopen($file, 'w+'); + $ch = curl_init($plg['github'] . '/archive/refs/heads/master.zip'); + curl_setopt($ch, CURLOPT_POST, 0); + curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15); + curl_setopt($ch, CURLOPT_TIMEOUT, 15); + curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); + curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); + curl_setopt($ch, CURLOPT_FILE, $fp); + curl_exec($ch); + curl_close($ch); + fclose($fp); + + $zip = new ZipArchive(); + $zip->open($file); + $zip->extractTo($CACHE_PATH); + $zip->close(); + $folder = $CACHE_PATH . File::pathFixer('/' . $plugin . '-main/'); + if (!file_exists($folder)) { + $folder = $CACHE_PATH . File::pathFixer('/' . $plugin . '-master/'); + } + if (!file_exists($folder)) { + r2(U . "pluginmanager", 'e', 'Extracted Folder is unknown'); + } + File::copyFolder($folder, $PLUGIN_PATH . DIRECTORY_SEPARATOR, ['README.md', 'LICENSE']); + File::deleteFolder($folder); + unlink($file); + r2(U . "pluginmanager", 's', 'Plugin ' . $plugin . ' has been installed'); break; } } @@ -85,7 +131,7 @@ switch ($action) { foreach ($json['payment_gateway'] as $plg) { if ($plg['id'] == $plugin) { $fp = fopen($file, 'w+'); - $ch = curl_init($plg['github'].'/archive/refs/heads/master.zip'); + $ch = curl_init($plg['github'] . '/archive/refs/heads/master.zip'); curl_setopt($ch, CURLOPT_POST, 0); curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 15); curl_setopt($ch, CURLOPT_TIMEOUT, 15); @@ -98,19 +144,19 @@ switch ($action) { $zip = new ZipArchive(); $zip->open($file); - $zip->extractTo(File::pathFixer('system/cache/')); + $zip->extractTo($CACHE_PATH); $zip->close(); - $folder = File::pathFixer('system/cache/' . $plugin.'-main/'); - if(!file_exists($folder)){ - $folder = File::pathFixer('system/cache/' . $plugin.'-master/'); + $folder = $CACHE_PATH . File::pathFixer('/' . $plugin . '-main/'); + if (!file_exists($folder)) { + $folder = $CACHE_PATH . File::pathFixer('/' . $plugin . '-master/'); } - if(!file_exists($folder)){ + if (!file_exists($folder)) { r2(U . "pluginmanager", 'e', 'Extracted Folder is unknown'); } - File::copyFolder($folder, File::pathFixer('system/paymentgateway/'), ['README.md','LICENSE']); + File::copyFolder($folder, $PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR, ['README.md', 'LICENSE']); File::deleteFolder($folder); unlink($file); - r2(U . "paymentgateway", 's', 'Payment Gateway '.$plugin.' has been installed'); + r2(U . "paymentgateway", 's', 'Payment Gateway ' . $plugin . ' has been installed'); break; } } @@ -127,3 +173,24 @@ switch ($action) { $ui->assign('pgs', $json['payment_gateway']); $ui->display('plugin-manager.tpl'); } + + +function scanAndRemovePath($source, $target) +{ + $files = scandir($source); + foreach ($files as $file) { + if (is_file($source . $file)) { + if(file_exists($target.$file)){ + unlink($target . $file); + } + } else if (is_dir($source . $file) && !in_array($file, ['.', '..'])) { + scanAndRemovePath($source. $file. DIRECTORY_SEPARATOR, $target. $file. DIRECTORY_SEPARATOR); + if(file_exists($target.$file)){ + rmdir($target . $file); + } + } + } + if(file_exists($target)){ + rmdir($target); + } +} \ No newline at end of file diff --git a/system/controllers/pool.php b/system/controllers/pool.php index de7b2932..311188c8 100644 --- a/system/controllers/pool.php +++ b/system/controllers/pool.php @@ -6,15 +6,14 @@ **/ _admin(); -$ui->assign('_title', $_L['Network']); +$ui->assign('_title', Lang::T('Network')); $ui->assign('_system_menu', 'network'); $action = $routes['1']; -$admin = Admin::_info(); $ui->assign('_admin', $admin); -if ($admin['user_type'] != 'Admin') { - r2(U . "dashboard", 'e', $_L['Do_Not_Access']); +if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'),'danger', "dashboard"); } @@ -24,15 +23,14 @@ switch ($action) { $name = _post('name'); if ($name != '') { - $paginator = Paginator::build(ORM::for_table('tbl_pool'), ['pool_name' => '%' . $name . '%'], $name); - $d = ORM::for_table('tbl_pool')->where_like('pool_name', '%' . $name . '%')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many(); + $query = ORM::for_table('tbl_pool')->where_like('pool_name', '%' . $name . '%')->order_by_desc('id'); + $d = Paginator::findMany($query, ['name' => $name]); } else { - $paginator = Paginator::build(ORM::for_table('tbl_pool')); - $d = ORM::for_table('tbl_pool')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many(); + $query = ORM::for_table('tbl_pool')->order_by_desc('id'); + $d = Paginator::findMany($query); } $ui->assign('d', $d); - $ui->assign('paginator', $paginator); run_hook('view_pool'); #HOOK $ui->display('pool.tpl'); break; @@ -68,11 +66,13 @@ switch ($action) { Mikrotik::removePool($client, $d['pool_name']); } catch (Exception $e) { //ignore exception, it means router has already deleted + } catch(Throwable $e){ + //ignore exception, it means router has already deleted } } $d->delete(); - r2(U . 'pool/list', 's', $_L['Delete_Successfully']); + r2(U . 'pool/list', 's', Lang::T('Data Deleted Successfully')); } break; @@ -99,12 +99,12 @@ switch ($action) { $msg .= 'Name should be between 3 to 30 characters' . '
'; } if ($ip_address == '' or $routers == '') { - $msg .= $_L['All_field_is_required'] . '
'; + $msg .= Lang::T('All field is required') . '
'; } $d = ORM::for_table('tbl_pool')->where('pool_name', $name)->find_one(); if ($d) { - $msg .= $_L['Pool_already_exist'] . '
'; + $msg .= Lang::T('Pool Name Already Exist') . '
'; } if ($msg == '') { if ($routers != 'radius') { @@ -119,7 +119,7 @@ switch ($action) { $b->routers = $routers; $b->save(); - r2(U . 'pool/list', 's', $_L['Created_Successfully']); + r2(U . 'pool/list', 's', Lang::T('Data Created Successfully')); } else { r2(U . 'pool/add', 'e', $msg); } @@ -133,14 +133,14 @@ switch ($action) { $msg = ''; if ($ip_address == '' or $routers == '') { - $msg .= $_L['All_field_is_required'] . '
'; + $msg .= Lang::T('All field is required') . '
'; } $id = _post('id'); $d = ORM::for_table('tbl_pool')->find_one($id); if ($d) { } else { - $msg .= $_L['Data_Not_Found'] . '
'; + $msg .= Lang::T('Data Not Found') . '
'; } if ($msg == '') { @@ -154,7 +154,7 @@ switch ($action) { $d->routers = $routers; $d->save(); - r2(U . 'pool/list', 's', $_L['Updated_Successfully']); + r2(U . 'pool/list', 's', Lang::T('Data Updated Successfully')); } else { r2(U . 'pool/edit/' . $id, 'e', $msg); } diff --git a/system/controllers/prepaid.php b/system/controllers/prepaid.php deleted file mode 100644 index 7509c0d8..00000000 --- a/system/controllers/prepaid.php +++ /dev/null @@ -1,488 +0,0 @@ -assign('_title', $_L['Recharge_Account']); -$ui->assign('_system_menu', 'prepaid'); - -$action = $routes['1']; -$admin = Admin::_info(); -$ui->assign('_admin', $admin); - -if ($admin['user_type'] != 'Admin' and $admin['user_type'] != 'Sales') { - r2(U . "dashboard", 'e', $_L['Do_Not_Access']); -} - -$select2_customer = << -document.addEventListener("DOMContentLoaded", function(event) { - $('#personSelect').select2({ - theme: "bootstrap", - ajax: { - url: function(params) { - if(params.term != undefined){ - return './index.php?_route=autoload/customer_select2&s='+params.term; - }else{ - return './index.php?_route=autoload/customer_select2'; - } - } - } - }); -}); - -EOT; - -switch ($action) { - case 'sync': - set_time_limit(-1); - $plans = ORM::for_table('tbl_user_recharges')->where('status', 'on')->find_many(); - $log = ''; - $router = ''; - foreach ($plans as $plan) { - if ($router != $plan['routers'] && $plan['routers'] != 'radius') { - $mikrotik = Mikrotik::info($plan['routers']); - $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); - $router = $plan['routers']; - } - $p = ORM::for_table('tbl_plans')->findOne($plan['plan_id']); - $c = ORM::for_table('tbl_customers')->findOne($plan['customer_id']); - if ($plan['routers'] == 'radius') { - Radius::customerAddPlan($c, $p, $plan['expiration'] . ' ' . $plan['time']); - } else { - if ($plan['type'] == 'Hotspot') { - Mikrotik::addHotspotUser($client, $p, $c); - } else if ($plan['type'] == 'PPPOE') { - Mikrotik::addPpoeUser($client, $p, $c); - } - } - $log .= "DONE : $plan[username], $plan[namebp], $plan[type], $plan[routers]
"; - } - r2(U . 'prepaid/list', 's', $log); - case 'list': - $ui->assign('xfooter', ''); - $ui->assign('_title', $_L['Customers']); - $username = _post('username'); - if ($username != '') { - $paginator = Paginator::build(ORM::for_table('tbl_user_recharges'), ['username' => '%' . $username . '%'], $username); - $d = ORM::for_table('tbl_user_recharges')->where_like('username', '%' . $username . '%')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many(); - } else { - $paginator = Paginator::build(ORM::for_table('tbl_user_recharges')); - $d = ORM::for_table('tbl_user_recharges')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many(); - } - - $ui->assign('d', $d); - $ui->assign('cari', $username); - $ui->assign('paginator', $paginator); - run_hook('view_list_billing'); #HOOK - $ui->display('prepaid.tpl'); - break; - - case 'recharge': - $ui->assign('xfooter', $select2_customer); - $p = ORM::for_table('tbl_plans')->where('enabled', '1')->find_many(); - $ui->assign('p', $p); - $r = ORM::for_table('tbl_routers')->where('enabled', '1')->find_many(); - $ui->assign('r', $r); - if (isset($routes['2']) && !empty($routes['2'])) { - $ui->assign('cust', ORM::for_table('tbl_customers')->find_one($routes['2'])); - } - run_hook('view_recharge'); #HOOK - $ui->display('recharge.tpl'); - break; - - case 'recharge-user': - $id = $routes['2']; - $ui->assign('id', $id); - - $c = ORM::for_table('tbl_customers')->find_many(); - $ui->assign('c', $c); - $p = ORM::for_table('tbl_plans')->where('enabled', '1')->find_many(); - $ui->assign('p', $p); - $r = ORM::for_table('tbl_routers')->where('enabled', '1')->find_many(); - $ui->assign('r', $r); - run_hook('view_recharge_customer'); #HOOK - $ui->display('recharge-user.tpl'); - break; - - case 'recharge-post': - $id_customer = _post('id_customer'); - $type = _post('type'); - $server = _post('server'); - $plan = _post('plan'); - $date_only = date("Y-m-d"); - $time = date("H:i:s"); - - $msg = ''; - if ($id_customer == '' or $type == '' or $server == '' or $plan == '') { - $msg .= 'All field is required' . '
'; - } - - if ($msg == '') { - if (Package::rechargeUser($id_customer, $server, $plan, "Recharge", $admin['fullname'])) { - $c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one(); - $in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one(); - $ui->assign('in', $in); - $ui->assign('date', date("Y-m-d H:i:s")); - $ui->display('invoice.tpl'); - _log('[' . $admin['username'] . ']: ' . 'Recharge ' . $c['username'] . ' [' . $in['plan_name'] . '][' . Lang::moneyFormat($in['price']) . ']', 'Admin', $admin['id']); - } else { - r2(U . 'prepaid/recharge', 'e', "Failed to recharge account"); - } - } else { - r2(U . 'prepaid/recharge', 'e', $msg); - } - break; - - case 'view': - $id = $routes['2']; - $d = ORM::for_table('tbl_transactions')->where('id', $id)->find_one(); - $ui->assign('in', $d); - - if (!empty($routes['3']) && $routes['3'] == 'send') { - $c = ORM::for_table('tbl_customers')->where('username', $d['username'])->find_one(); - if ($c) { - Message::sendInvoice($c, $d); - r2(U . 'prepaid/view/' . $id, 's', "Success send to customer"); - } - r2(U . 'prepaid/view/' . $id, 'd', "Customer not found"); - } - $ui->assign('_title', 'View Invoice'); - $ui->assign('date', Lang::dateAndTimeFormat($d['recharged_on'], $d['recharged_time'])); - $ui->display('invoice.tpl'); - break; - - - case 'print': - $id = _post('id'); - $d = ORM::for_table('tbl_transactions')->where('id', $id)->find_one(); - $ui->assign('d', $d); - - $ui->assign('date', Lang::dateAndTimeFormat($d['recharged_on'], $d['recharged_time'])); - run_hook('print_invoice'); #HOOK - $ui->display('invoice-print.tpl'); - break; - - case 'edit': - $id = $routes['2']; - $d = ORM::for_table('tbl_user_recharges')->find_one($id); - if ($d) { - $ui->assign('d', $d); - $p = ORM::for_table('tbl_plans')->where('enabled', '1')->find_many(); - $ui->assign('p', $p); - run_hook('view_edit_customer_plan'); #HOOK - $ui->display('prepaid-edit.tpl'); - } else { - r2(U . 'services/list', 'e', $_L['Account_Not_Found']); - } - break; - - case 'delete': - $id = $routes['2']; - $d = ORM::for_table('tbl_user_recharges')->find_one($id); - if ($d) { - run_hook('delete_customer_active_plan'); #HOOK - $p = ORM::for_table('tbl_plans')->find_one($d['plan_id']); - if ($p['is_radius']) { - Radius::customerDeactivate($d['username']); - } else { - $mikrotik = Mikrotik::info($d['routers']); - if ($d['type'] == 'Hotspot') { - $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); - Mikrotik::removeHotspotUser($client, $d['username']); - Mikrotik::removeHotspotActiveUser($client, $d['username']); - } else { - $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); - Mikrotik::removePpoeUser($client, $d['username']); - Mikrotik::removePpoeActive($client, $d['username']); - } - } - $d->delete(); - _log('[' . $admin['username'] . ']: ' . 'Delete Plan for Customer ' . $c['username'] . ' [' . $in['plan_name'] . '][' . Lang::moneyFormat($in['price']) . ']', 'Admin', $admin['id']); - r2(U . 'prepaid/list', 's', $_L['Delete_Successfully']); - } - break; - - case 'edit-post': - $username = _post('username'); - $id_plan = _post('id_plan'); - $recharged_on = _post('recharged_on'); - $expiration = _post('expiration'); - $time = _post('time'); - - $id = _post('id'); - $d = ORM::for_table('tbl_user_recharges')->find_one($id); - if ($d) { - } else { - $msg .= $_L['Data_Not_Found'] . '
'; - } - - if ($msg == '') { - run_hook('edit_customer_plan'); #HOOK - $d->username = $username; - $d->plan_id = $id_plan; - //$d->recharged_on = $recharged_on; - $d->expiration = $expiration; - $d->time = $time; - $d->save(); - Package::changeTo($username, $id_plan); - _log('[' . $admin['username'] . ']: ' . 'Edit Plan for Customer ' . $d['username'] . ' to [' . $d['plan_name'] . '][' . Lang::moneyFormat($d['price']) . ']', 'Admin', $admin['id']); - r2(U . 'prepaid/list', 's', $_L['Updated_Successfully']); - } else { - r2(U . 'prepaid/edit/' . $id, 'e', $msg); - } - break; - - case 'voucher': - $ui->assign('xfooter', ''); - - $code = _post('code'); - if ($code != '') { - $ui->assign('code', $code); - $paginator = Paginator::build(ORM::for_table('tbl_voucher'), ['code' => '%' . $code . '%'], $code); - $d = ORM::for_table('tbl_plans')->where('enabled', '1') - ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) - ->where_like('tbl_voucher.code', '%' . $code . '%') - ->offset($paginator['startpoint']) - ->limit($paginator['limit']) - ->find_many(); - } else { - $paginator = Paginator::build(ORM::for_table('tbl_voucher')); - $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(); - } - - $ui->assign('d', $d); - $ui->assign('_code', $code); - $ui->assign('paginator', $paginator); - run_hook('view_list_voucher'); #HOOK - $ui->display('voucher.tpl'); - break; - - case 'add-voucher': - - $c = ORM::for_table('tbl_customers')->find_many(); - $ui->assign('c', $c); - $p = ORM::for_table('tbl_plans')->where('enabled', '1')->find_many(); - $ui->assign('p', $p); - $r = ORM::for_table('tbl_routers')->where('enabled', '1')->find_many(); - $ui->assign('r', $r); - run_hook('view_add_voucher'); #HOOK - $ui->display('voucher-add.tpl'); - break; - - case 'print-voucher': - $from_id = _post('from_id'); - $planid = _post('planid'); - $pagebreak = _post('pagebreak'); - $limit = _post('limit'); - $vpl = _post('vpl'); - if (empty($vpl)) { - $vpl = 3; - } - if ($pagebreak < 1) $pagebreak = 12; - - if ($limit < 1) $limit = $pagebreak * 2; - if (empty($from_id)) { - $from_id = 0; - } - - if ($from_id > 0 && $planid > 0) { - $v = ORM::for_table('tbl_plans') - ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) - ->where('tbl_voucher.status', '0') - ->where('tbl_plans.id', $planid) - ->where_gt('tbl_voucher.id', $from_id) - ->limit($limit) - ->find_many(); - $vc = ORM::for_table('tbl_plans') - ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) - ->where('tbl_voucher.status', '0') - ->where('tbl_plans.id', $planid) - ->where_gt('tbl_voucher.id', $from_id) - ->count(); - } else if ($from_id == 0 && $planid > 0) { - $v = ORM::for_table('tbl_plans') - ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) - ->where('tbl_voucher.status', '0') - ->where('tbl_plans.id', $planid) - ->limit($limit) - ->find_many(); - $vc = ORM::for_table('tbl_plans') - ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) - ->where('tbl_voucher.status', '0') - ->where('tbl_plans.id', $planid) - ->count(); - } else if ($from_id > 0 && $planid == 0) { - $v = ORM::for_table('tbl_plans') - ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) - ->where('tbl_voucher.status', '0') - ->where_gt('tbl_voucher.id', $from_id) - ->limit($limit) - ->find_many(); - $vc = ORM::for_table('tbl_plans') - ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) - ->where('tbl_voucher.status', '0') - ->where_gt('tbl_voucher.id', $from_id) - ->count(); - } else { - $v = ORM::for_table('tbl_plans') - ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) - ->where('tbl_voucher.status', '0') - ->limit($limit) - ->find_many(); - $vc = ORM::for_table('tbl_plans') - ->join('tbl_voucher', array('tbl_plans.id', '=', 'tbl_voucher.id_plan')) - ->where('tbl_voucher.status', '0') - ->count(); - } - $template = file_get_contents("pages/Voucher.html"); - $template = str_replace('[[company_name]]', $config['CompanyName'], $template); - - $ui->assign('_title', $_L['Voucher_Hotspot']); - $ui->assign('from_id', $from_id); - $ui->assign('vpl', $vpl); - $ui->assign('pagebreak', $pagebreak); - - $plans = ORM::for_table('tbl_plans')->find_many(); - $ui->assign('plans', $plans); - $ui->assign('limit', $limit); - $ui->assign('planid', $planid); - - $voucher = []; - $n = 1; - foreach ($v as $vs) { - $temp = $template; - $temp = str_replace('[[qrcode]]', '', $temp); - $temp = str_replace('[[price]]', Lang::moneyFormat($vs['price']), $temp); - $temp = str_replace('[[voucher_code]]', $vs['code'], $temp); - $temp = str_replace('[[plan]]', $vs['name_plan'], $temp); - $temp = str_replace('[[counter]]', $n, $temp); - $voucher[] = $temp; - $n++; - } - - $ui->assign('voucher', $voucher); - $ui->assign('vc', $vc); - - //for counting pagebreak - $ui->assign('jml', 0); - run_hook('view_print_voucher'); #HOOK - $ui->display('print-voucher.tpl'); - break; - case 'voucher-post': - $type = _post('type'); - $plan = _post('plan'); - $server = _post('server'); - $numbervoucher = _post('numbervoucher'); - $lengthcode = _post('lengthcode'); - - $msg = ''; - if ($type == '' or $plan == '' or $server == '' or $numbervoucher == '' or $lengthcode == '') { - $msg .= $_L['All_field_is_required'] . '
'; - } - if (Validator::UnsignedNumber($numbervoucher) == false) { - $msg .= 'The Number of Vouchers must be a number' . '
'; - } - if (Validator::UnsignedNumber($lengthcode) == false) { - $msg .= 'The Length Code must be a number' . '
'; - } - if ($msg == '') { - run_hook('create_voucher'); #HOOK - for ($i = 0; $i < $numbervoucher; $i++) { - $code = strtoupper(substr(md5(time() . rand(10000, 99999)), 0, $lengthcode)); - if ($config['voucher_format'] == 'low') { - $code = strtolower($code); - } else if ($config['voucher_format'] == 'rand') { - $code = Lang::randomUpLowCase($code); - } - $d = ORM::for_table('tbl_voucher')->create(); - $d->type = $type; - $d->routers = $server; - $d->id_plan = $plan; - $d->code = $code; - $d->user = '0'; - $d->status = '0'; - $d->save(); - } - - r2(U . 'prepaid/voucher', 's', $_L['Voucher_Successfully']); - } else { - r2(U . 'prepaid/add-voucher/' . $id, 'e', $msg); - } - break; - - case 'voucher-delete': - $id = $routes['2']; - run_hook('delete_voucher'); #HOOK - $d = ORM::for_table('tbl_voucher')->find_one($id); - if ($d) { - $d->delete(); - r2(U . 'prepaid/voucher', 's', $_L['Delete_Successfully']); - } - break; - - case 'refill': - $ui->assign('xfooter', $select2_customer); - $ui->assign('_title', $_L['Refill_Account']); - run_hook('view_refill'); #HOOK - $ui->display('refill.tpl'); - - break; - - case 'refill-post': - $code = _post('code'); - $user = ORM::for_table('tbl_customers')->where('id', _post('id_customer'))->find_one(); - $v1 = ORM::for_table('tbl_voucher')->where('code', $code)->where('status', 0)->find_one(); - - run_hook('refill_customer'); #HOOK - if ($v1) { - if (Package::rechargeUser($user['id'], $v1['routers'], $v1['id_plan'], "Refill", "Voucher")) { - $v1->status = "1"; - $v1->user = $user['username']; - $v1->save(); - $in = ORM::for_table('tbl_transactions')->where('username', $user['username'])->order_by_desc('id')->find_one(); - $ui->assign('in', $in); - $ui->assign('date', date("Y-m-d H:i:s")); - $ui->display('invoice.tpl'); - } else { - r2(U . 'prepaid/refill', 'e', "Failed to refill account"); - } - } else { - r2(U . 'prepaid/refill', 'e', $_L['Voucher_Not_Valid']); - } - break; - case 'deposit': - $ui->assign('_title', Lang::T('Refill Balance')); - $ui->assign('xfooter', $select2_customer); - $ui->assign('p', ORM::for_table('tbl_plans')->where('enabled', '1')->where('type', 'Balance')->find_many()); - run_hook('view_deposit'); #HOOK - $ui->display('deposit.tpl'); - break; - case 'deposit-post': - $user = _post('id_customer'); - $plan = _post('id_plan'); - - run_hook('deposit_customer'); #HOOK - if (!empty($user) && !empty($plan)) { - if (Package::rechargeUser($user, 'balance', $plan, "Deposit", $admin['fullname'])) { - $c = ORM::for_table('tbl_customers')->where('id', $user)->find_one(); - $in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one(); - $ui->assign('in', $in); - $ui->assign('date', date("Y-m-d H:i:s")); - $ui->display('invoice.tpl'); - } else { - r2(U . 'prepaid/refill', 'e', "Failed to refill account"); - } - } else { - r2(U . 'prepaid/refill', 'e', "All field is required"); - } - break; - default: - $ui->display('a404.tpl'); -} diff --git a/system/controllers/radius.php b/system/controllers/radius.php index 2cf1cf36..a831aa13 100644 --- a/system/controllers/radius.php +++ b/system/controllers/radius.php @@ -1,4 +1,5 @@ assign('_title', $_L['Plugin Manager']); $ui->assign('_system_menu', 'settings'); $action = $routes['1']; -$admin = Admin::_info(); $ui->assign('_admin', $admin); -if ($admin['user_type'] != 'Admin') { - r2(U . "dashboard", 'e', $_L['Do_Not_Access']); +if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); } switch ($action) { case 'nas-add': - $ui->assign('_system_menu', 'network'); + $ui->assign('_system_menu', 'radius'); $ui->assign('_title', "Network Access Server"); $ui->assign('routers', ORM::for_table('tbl_routers')->find_many()); $ui->display('radius-nas-add.tpl'); @@ -67,7 +67,7 @@ switch ($action) { } break; case 'nas-edit': - $ui->assign('_system_menu', 'network'); + $ui->assign('_system_menu', 'radius'); $ui->assign('_title', "Network Access Server"); $id = $routes['2']; @@ -131,26 +131,19 @@ switch ($action) { r2(U . 'radius/nas-list', 'e', 'NAS Not found'); } default: - $ui->assign('_system_menu', 'network'); + $ui->assign('_system_menu', 'radius'); $ui->assign('_title', "Network Access Server"); $name = _post('name'); if (empty($name)) { - $paginator = Paginator::build(ORM::for_table('nas', 'radius')); - $nas = ORM::for_table('nas', 'radius')->offset($paginator['startpoint'])->limit($paginator['limit'])->find_many(); + $query = ORM::for_table('nas', 'radius'); + $nas = Paginator::findMany($query); } else { - $paginator = Paginator::build(ORM::for_table('nas', 'radius'), [ - 'nasname' => '%'.$search.'%', - 'shortname' => '%'.$search.'%', - 'description' => '%'.$search.'%' - ]); - $nas = ORM::for_table('nas', 'radius') - ->where_like('nasname', $search) - ->where_like('shortname', $search) - ->where_like('description', $search) - ->offset($paginator['startpoint'])->limit($paginator['limit']) - ->find_many(); + $query = ORM::for_table('nas', 'radius') + ->where_like('nasname', $search) + ->where_like('shortname', $search) + ->where_like('description', $search); + $nas = Paginator::findMany($query, ['name' => $name]); } - $ui->assign('paginator', $paginator); $ui->assign('name', $name); $ui->assign('nas', $nas); $ui->display('radius-nas.tpl'); diff --git a/system/controllers/register.php b/system/controllers/register.php index c1b3651e..9ab440a0 100644 --- a/system/controllers/register.php +++ b/system/controllers/register.php @@ -1,4 +1,5 @@ '; } if ($password != $cpassword) { - $msg .= $_L['PasswordsNotMatch'] . '
'; + $msg .= Lang::T('Passwords does not match') . '
'; } - if(!empty($config['sms_url'])){ - $otpPath .= sha1($username.$db_password).".txt"; + if (!empty($config['sms_url'])) { + $otpPath .= sha1($username . $db_password) . ".txt"; run_hook('validate_otp'); #HOOK //expired 10 minutes - if(file_exists($otpPath) && time()-filemtime($otpPath)>1200){ + if (file_exists($otpPath) && time() - filemtime($otpPath) > 1200) { unlink($otpPath); r2(U . 'register', 's', 'Verification code expired'); - }else if(file_exists($otpPath)){ + } else if (file_exists($otpPath)) { $code = file_get_contents($otpPath); - if($code!=$otp_code){ + if ($code != $otp_code) { $ui->assign('username', $username); $ui->assign('fullname', $fullname); $ui->assign('address', $address); @@ -63,21 +64,21 @@ switch ($do) { $ui->assign('notify_t', 'd'); $ui->display('register-otp.tpl'); exit(); - }else{ + } else { unlink($otpPath); } - }else{ + } 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'] . '
'; + $msg .= Lang::T('Account already axist') . '
'; } if ($msg == '') { run_hook('register_user'); #HOOK $d = ORM::for_table('tbl_customers')->create(); - $d->username = alphanumeric($username,"+_."); + $d->username = alphanumeric($username, "+_."); $d->password = $password; $d->fullname = $fullname; $d->address = $address; @@ -85,7 +86,7 @@ switch ($do) { $d->phonenumber = $phonenumber; if ($d->save()) { $user = $d->id(); - r2(U . 'login', 's', $_L['Register_Success']); + r2(U . 'login', 's', Lang::T('Register Success! You can login now')); } else { $ui->assign('username', $username); $ui->assign('fullname', $fullname); @@ -110,38 +111,38 @@ switch ($do) { break; default: - if(!empty($config['sms_url'])){ + if (!empty($config['sms_url'])) { $username = _post('username'); - if(!empty($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']); + r2(U . 'register', 's', Lang::T('Account already axist')); } - if(!file_exists($otpPath)){ + if (!file_exists($otpPath)) { mkdir($otpPath); - touch($otpPath.'index.html'); + touch($otpPath . 'index.html'); } - $otpPath .= sha1($username.$db_password).".txt"; + $otpPath .= sha1($username . $db_password) . ".txt"; //expired 10 minutes - if(file_exists($otpPath) && time()-filemtime($otpPath)<1200){ + if (file_exists($otpPath) && time() - filemtime($otpPath) < 1200) { $ui->assign('username', $username); - $ui->assign('notify', 'Please wait '.(1200-(time()-filemtime($otpPath))).' seconds before sending another SMS'); + $ui->assign('notify', 'Please wait ' . (1200 - (time() - filemtime($otpPath))) . ' seconds before sending another SMS'); $ui->assign('notify_t', 'd'); $ui->display('register-otp.tpl'); - }else{ - $otp = rand(100000,999999); + } else { + $otp = rand(100000, 999999); file_put_contents($otpPath, $otp); - Message::sendSMS($username,$config['CompanyName']."\nYour Verification code are: $otp"); + Message::sendSMS($username, $config['CompanyName'] . "\nYour Verification code are: $otp"); $ui->assign('username', $username); $ui->assign('notify', 'Verification code has been sent to your phone'); $ui->assign('notify_t', 's'); $ui->display('register-otp.tpl'); } - }else{ + } else { run_hook('view_otp_register'); #HOOK $ui->display('register-rotp.tpl'); } - }else{ + } else { $ui->assign('username', ""); $ui->assign('fullname', ""); $ui->assign('address', ""); diff --git a/system/controllers/reports.php b/system/controllers/reports.php index 84b58792..2983fc1f 100644 --- a/system/controllers/reports.php +++ b/system/controllers/reports.php @@ -6,17 +6,12 @@ **/ _admin(); -$ui->assign('_title', $_L['Reports']); +$ui->assign('_title', Lang::T('Reports')); $ui->assign('_system_menu', 'reports'); $action = $routes['1']; -$admin = Admin::_info(); $ui->assign('_admin', $admin); -if ($admin['user_type'] != 'Admin' and $admin['user_type'] != 'Sales') { - r2(U . "dashboard", 'e', $_L['Do_Not_Access']); -} - $mdate = date('Y-m-d'); $mtime = date('H:i:s'); $tdate = date('Y-m-d', strtotime('today - 30 days')); @@ -35,28 +30,26 @@ switch ($action) { r2(U . "logs/list/", 's', "Delete logs older than $keep days"); } if ($q != '') { - $paginator = Paginator::build(ORM::for_table('tbl_transactions'), ['invoice' => '%' . $q . '%'], $q); - $d = ORM::for_table('tbl_transactions')->where_like('invoice', '%' . $q . '%')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many(); + $query = ORM::for_table('tbl_transactions')->where_like('invoice', '%' . $q . '%')->order_by_desc('id'); + $d = Paginator::findMany($query, ['q' => $q]); } else { - $paginator = Paginator::build(ORM::for_table('tbl_transactions')); - $d = ORM::for_table('tbl_transactions')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many(); + $query = ORM::for_table('tbl_transactions')->order_by_desc('id'); + $d = Paginator::findMany($query); } $ui->assign('activation', $d); $ui->assign('q', $q); - $ui->assign('paginator', $paginator); $ui->display('reports-activation.tpl'); break; case 'daily-report': - $paginator = Paginator::build(ORM::for_table('tbl_transactions'), ['recharged_on' => $mdate]); - $d = ORM::for_table('tbl_transactions')->where('recharged_on', $mdate)->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many(); - $dr = ORM::for_table('tbl_transactions')->where('recharged_on', $mdate)->sum('price'); + $query = ORM::for_table('tbl_transactions')->where('recharged_on', $mdate)->order_by_desc('id'); + $d = Paginator::findMany($query); + $dr = $query->sum('price'); $ui->assign('d', $d); $ui->assign('dr', $dr); $ui->assign('mdate', $mdate); $ui->assign('mtime', $mtime); - $ui->assign('paginator', $paginator); run_hook('view_daily_reports'); #HOOK $ui->display('reports-daily.tpl'); break; diff --git a/system/controllers/routers.php b/system/controllers/routers.php index 31cc4cce..9c73351f 100644 --- a/system/controllers/routers.php +++ b/system/controllers/routers.php @@ -6,19 +6,18 @@ **/ _admin(); -$ui->assign('_title', $_L['Network']); +$ui->assign('_title', Lang::T('Network')); $ui->assign('_system_menu', 'network'); $action = $routes['1']; -$admin = Admin::_info(); $ui->assign('_admin', $admin); use PEAR2\Net\RouterOS; require_once 'system/autoload/PEAR2/Autoload.php'; -if ($admin['user_type'] != 'Admin') { - r2(U . "dashboard", 'e', $_L['Do_Not_Access']); +if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); } switch ($action) { @@ -27,15 +26,14 @@ switch ($action) { $name = _post('name'); if ($name != '') { - $paginator = Paginator::build(ORM::for_table('tbl_routers'), ['name' => '%' . $name . '%'], $name); - $d = ORM::for_table('tbl_routers')->where_like('name', '%' . $name . '%')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many(); + $query = ORM::for_table('tbl_routers')->where_like('name', '%' . $name . '%')->order_by_desc('id'); + $d = Paginator::findMany($query, ['name' => $name]); } else { - $paginator = Paginator::build(ORM::for_table('tbl_routers')); - $d = ORM::for_table('tbl_routers')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many(); + $query = ORM::for_table('tbl_routers')->order_by_desc('id'); + $d = Paginator::findMany($query); } $ui->assign('d', $d); - $ui->assign('paginator', $paginator); run_hook('view_list_routers'); #HOOK $ui->display('routers.tpl'); break; @@ -66,7 +64,7 @@ switch ($action) { $d = ORM::for_table('tbl_routers')->find_one($id); if ($d) { $d->delete(); - r2(U . 'routers/list', 's', $_L['Delete_Successfully']); + r2(U . 'routers/list', 's', Lang::T('Data Deleted Successfully')); } break; @@ -83,12 +81,12 @@ switch ($action) { $msg .= 'Name should be between 5 to 30 characters' . '
'; } if ($ip_address == '' or $username == '') { - $msg .= $_L['All_field_is_required'] . '
'; + $msg .= Lang::T('All field is required') . '
'; } $d = ORM::for_table('tbl_routers')->where('ip_address', $ip_address)->find_one(); if ($d) { - $msg .= $_L['Router_already_exist'] . '
'; + $msg .= Lang::T('IP Router Already Exist') . '
'; } if (strtolower($name) == 'radius') { $msg .= 'Radius name is reserved
'; @@ -106,7 +104,7 @@ switch ($action) { $d->enabled = $enabled; $d->save(); - r2(U . 'routers/list', 's', $_L['Created_Successfully']); + r2(U . 'routers/list', 's', Lang::T('Data Created Successfully')); } else { r2(U . 'routers/add', 'e', $msg); } @@ -125,14 +123,14 @@ switch ($action) { $msg .= 'Name should be between 5 to 30 characters' . '
'; } if ($ip_address == '' or $username == '') { - $msg .= $_L['All_field_is_required'] . '
'; + $msg .= Lang::T('All field is required') . '
'; } $id = _post('id'); $d = ORM::for_table('tbl_routers')->find_one($id); if ($d) { } else { - $msg .= $_L['Data_Not_Found'] . '
'; + $msg .= Lang::T('Data Not Found') . '
'; } if ($d['name'] != $name) { @@ -185,7 +183,7 @@ switch ($action) { $p->set('routers', $name); $p->save(); } - r2(U . 'routers/list', 's', $_L['Updated_Successfully']); + r2(U . 'routers/list', 's', Lang::T('Data Updated Successfully')); } else { r2(U . 'routers/edit/' . $id, 'e', $msg); } diff --git a/system/controllers/services.php b/system/controllers/services.php index 3cc81302..5a07f116 100644 --- a/system/controllers/services.php +++ b/system/controllers/services.php @@ -5,15 +5,14 @@ * by https://t.me/ibnux **/ _admin(); -$ui->assign('_title', $_L['Hotspot_Plans']); +$ui->assign('_title', Lang::T('Hotspot Plans')); $ui->assign('_system_menu', 'services'); $action = $routes['1']; -$admin = Admin::_info(); $ui->assign('_admin', $admin); -if ($admin['user_type'] != 'Admin' and $admin['user_type'] != 'Sales') { - r2(U . "dashboard", 'e', $_L['Do_Not_Access']); +if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); } use PEAR2\Net\RouterOS; @@ -61,7 +60,7 @@ switch ($action) { $rate = $plan['rate_up'] . $unitup . "/" . $plan['rate_down'] . $unitdown; Mikrotik::addHotspotPlan($client, $plan['name_plan'], $plan['shared_users'], $rate); $log .= "DONE : $plan[name_plan], $plan[shared_users], $rate
"; - if (!empty($plan['pool_expired'])) { + if (!empty ($plan['pool_expired'])) { Mikrotik::setHotspotExpiredPlan($client, 'EXPIRED NUXBILL ' . $plan['pool_expired'], $plan['pool_expired']); $log .= "DONE Expired : EXPIRED NUXBILL $plan[pool_expired]
"; } @@ -106,7 +105,7 @@ switch ($action) { $rate = $plan['rate_up'] . $unitup . "/" . $plan['rate_down'] . $unitdown; Mikrotik::addPpoePlan($client, $plan['name_plan'], $plan['pool'], $rate); $log .= "DONE : $plan[name_plan], $plan[pool], $rate
"; - if (!empty($plan['pool_expired'])) { + if (!empty ($plan['pool_expired'])) { Mikrotik::setPpoePlan($client, 'EXPIRED NUXBILL ' . $plan['pool_expired'], $plan['pool_expired'], '512K/512K'); $log .= "DONE Expired : EXPIRED NUXBILL $plan[pool_expired]
"; } @@ -120,15 +119,14 @@ switch ($action) { $name = _post('name'); if ($name != '') { - $paginator = Paginator::build(ORM::for_table('tbl_plans'), ['name_plan' => '%' . $name . '%', 'type' => 'Hotspot'], $name); - $d = ORM::for_table('tbl_bandwidth')->join('tbl_plans', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))->where('tbl_plans.type', 'Hotspot')->where_like('tbl_plans.name_plan', '%' . $name . '%')->offset($paginator['startpoint'])->limit($paginator['limit'])->find_many(); + $query = ORM::for_table('tbl_bandwidth')->join('tbl_plans', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))->where('tbl_plans.type', 'Hotspot')->where_like('tbl_plans.name_plan', '%' . $name . '%'); + $d = Paginator::findMany($query, ['name'=> $name]); } else { - $paginator = Paginator::build(ORM::for_table('tbl_plans'), ['type' => 'Hotspot']); - $d = ORM::for_table('tbl_bandwidth')->join('tbl_plans', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))->where('tbl_plans.type', 'Hotspot')->offset($paginator['startpoint'])->limit($paginator['limit'])->find_many(); + $query = ORM::for_table('tbl_bandwidth')->join('tbl_plans', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))->where('tbl_plans.type', 'Hotspot'); + $d = Paginator::findMany($query); } $ui->assign('d', $d); - $ui->assign('paginator', $paginator); run_hook('view_list_plans'); #HOOK $ui->display('hotspot.tpl'); break; @@ -143,7 +141,7 @@ switch ($action) { break; case 'edit': - $id = $routes['2']; + $id = $routes['2']; $d = ORM::for_table('tbl_plans')->find_one($id); if ($d) { $ui->assign('d', $d); @@ -159,7 +157,7 @@ switch ($action) { break; case 'delete': - $id = $routes['2']; + $id = $routes['2']; $d = ORM::for_table('tbl_plans')->find_one($id); if ($d) { @@ -173,17 +171,20 @@ switch ($action) { Mikrotik::removeHotspotPlan($client, $d['name_plan']); } catch (Exception $e) { //ignore exception, it means router has already deleted + } catch (Throwable $e) { + //ignore exception, it means router has already deleted } } $d->delete(); - r2(U . 'services/hotspot', 's', $_L['Delete_Successfully']); + r2(U . 'services/hotspot', 's', Lang::T('Data Deleted Successfully')); } break; case 'add-post': $name = _post('name'); + $plan_type = _post('plan_type'); //Personal / Business $radius = _post('radius'); $typebp = _post('typebp'); $limit_type = _post('limit_type'); @@ -198,7 +199,9 @@ switch ($action) { $validity_unit = _post('validity_unit'); $routers = _post('routers'); $pool_expired = _post('pool_expired'); + $list_expired = _post('list_expired'); $enabled = _post('enabled'); + $prepaid = _post('prepaid'); $msg = ''; if (Validator::UnsignedNumber($validity) == false) { @@ -208,16 +211,16 @@ switch ($action) { $msg .= 'The price must be a number' . '
'; } if ($name == '' or $id_bw == '' or $price == '' or $validity == '') { - $msg .= $_L['All_field_is_required'] . '
'; + $msg .= Lang::T('All field is required') . '
'; } - if (empty($radius)) { + if (empty ($radius)) { if ($routers == '') { - $msg .= $_L['All_field_is_required'] . '
'; + $msg .= Lang::T('All field is required') . '
'; } } $d = ORM::for_table('tbl_plans')->where('name_plan', $name)->where('type', 'Hotspot')->find_one(); if ($d) { - $msg .= $_L['Plan_already_exist'] . '
'; + $msg .= Lang::T('Name Plan Already Exist') . '
'; } run_hook('add_plan'); #HOOK @@ -240,6 +243,7 @@ switch ($action) { } $rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown; $radiusRate = $b['rate_up'] . $radup . '/' . $b['rate_down'] . $raddown; + $rate = trim($rate . " " . $b['burst']); $d = ORM::for_table('tbl_plans')->create(); $d->name_plan = $name; @@ -247,6 +251,7 @@ switch ($action) { $d->price = $price; $d->type = 'Hotspot'; $d->typebp = $typebp; + $d->plan_type = $plan_type; $d->limit_type = $limit_type; $d->time_limit = $time_limit; $d->time_unit = $time_unit; @@ -255,15 +260,17 @@ switch ($action) { $d->validity = $validity; $d->validity_unit = $validity_unit; $d->shared_users = $sharedusers; - if (!empty($radius)) { + if (!empty ($radius)) { $d->is_radius = 1; $d->routers = ''; } else { $d->is_radius = 0; $d->routers = $routers; - $d->pool_expired = $pool_expired; } + $d->pool_expired = $pool_expired; + $d->list_expired = $list_expired; $d->enabled = $enabled; + $d->prepaid = $prepaid; $d->save(); $plan_id = $d->id(); @@ -273,13 +280,13 @@ switch ($action) { $mikrotik = Mikrotik::info($routers); $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); Mikrotik::addHotspotPlan($client, $name, $sharedusers, $rate); - if (!empty($pool_expired)) { + if (!empty ($pool_expired)) { Mikrotik::setHotspotExpiredPlan($client, 'EXPIRED NUXBILL ' . $pool_expired, $pool_expired); } } - r2(U . 'services/hotspot', 's', $_L['Created_Successfully']); + r2(U . 'services/hotspot', 's', Lang::T('Data Created Successfully')); } else { r2(U . 'services/add', 'e', $msg); } @@ -289,6 +296,7 @@ switch ($action) { case 'edit-post': $id = _post('id'); $name = _post('name'); + $plan_type = _post('plan_type'); $id_bw = _post('id_bw'); $typebp = _post('typebp'); $price = _post('price'); @@ -301,8 +309,10 @@ switch ($action) { $validity = _post('validity'); $validity_unit = _post('validity_unit'); $pool_expired = _post('pool_expired'); + $list_expired = _post('list_expired'); $enabled = _post('enabled'); - + $prepaid = _post('prepaid'); + $routers = _post('routers'); $msg = ''; if (Validator::UnsignedNumber($validity) == false) { $msg .= 'The validity must be a number' . '
'; @@ -311,12 +321,12 @@ switch ($action) { $msg .= 'The price must be a number' . '
'; } if ($name == '' or $id_bw == '' or $price == '' or $validity == '') { - $msg .= $_L['All_field_is_required'] . '
'; + $msg .= Lang::T('All field is required') . '
'; } $d = ORM::for_table('tbl_plans')->where('id', $id)->find_one(); if ($d) { } else { - $msg .= $_L['Data_Not_Found'] . '
'; + $msg .= Lang::T('Data Not Found') . '
'; } run_hook('edit_plan'); #HOOK if ($msg == '') { @@ -338,13 +348,15 @@ switch ($action) { $rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown; $radiusRate = $b['rate_up'] . $radup . '/' . $b['rate_down'] . $raddown; + $rate = trim($rate . " " . $b['burst']); + if ($d['is_radius']) { Radius::planUpSert($id, $radiusRate); } else { $mikrotik = Mikrotik::info($routers); $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); Mikrotik::setHotspotPlan($client, $name, $sharedusers, $rate); - if (!empty($pool_expired)) { + if (!empty ($pool_expired)) { Mikrotik::setHotspotExpiredPlan($client, 'EXPIRED NUXBILL ' . $pool_expired, $pool_expired); } } @@ -357,41 +369,43 @@ switch ($action) { $d->time_limit = $time_limit; $d->time_unit = $time_unit; $d->data_limit = $data_limit; + $d->plan_type = $plan_type; $d->data_unit = $data_unit; $d->validity = $validity; $d->validity_unit = $validity_unit; $d->shared_users = $sharedusers; $d->pool_expired = $pool_expired; + $d->list_expired = $list_expired; $d->enabled = $enabled; + $d->prepaid = $prepaid; $d->save(); - r2(U . 'services/hotspot', 's', $_L['Updated_Successfully']); + r2(U . 'services/hotspot', 's', Lang::T('Data Updated Successfully')); } else { r2(U . 'services/edit/' . $id, 'e', $msg); } break; case 'pppoe': - $ui->assign('_title', $_L['PPPOE_Plans']); + $ui->assign('_title', Lang::T('PPPOE Plans')); $ui->assign('xfooter', ''); $name = _post('name'); if ($name != '') { - $paginator = Paginator::build(ORM::for_table('tbl_plans'), ['name_plan' => '%' . $name . '%', 'type' => 'PPPOE'], $name); - $d = ORM::for_table('tbl_bandwidth')->join('tbl_plans', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))->where('tbl_plans.type', 'PPPOE')->where_like('tbl_plans.name_plan', '%' . $name . '%')->offset($paginator['startpoint'])->limit($paginator['limit'])->find_many(); + $query = ORM::for_table('tbl_bandwidth')->join('tbl_plans', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))->where('tbl_plans.type', 'PPPOE')->where_like('tbl_plans.name_plan', '%' . $name . '%'); + $d = Paginator::findMany($query, ['name' => $name]); } else { - $paginator = Paginator::build(ORM::for_table('tbl_plans'), ['type' => 'PPPOE'], $name); - $d = ORM::for_table('tbl_bandwidth')->join('tbl_plans', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))->where('tbl_plans.type', 'PPPOE')->offset($paginator['startpoint'])->limit($paginator['limit'])->find_many(); + $query = ORM::for_table('tbl_bandwidth')->join('tbl_plans', array('tbl_bandwidth.id', '=', 'tbl_plans.id_bw'))->where('tbl_plans.type', 'PPPOE'); + $d = Paginator::findMany($query); } $ui->assign('d', $d); - $ui->assign('paginator', $paginator); run_hook('view_list_ppoe'); #HOOK $ui->display('pppoe.tpl'); break; case 'pppoe-add': - $ui->assign('_title', $_L['PPPOE_Plans']); + $ui->assign('_title', Lang::T('PPPOE Plans')); $d = ORM::for_table('tbl_bandwidth')->find_many(); $ui->assign('d', $d); $r = ORM::for_table('tbl_routers')->find_many(); @@ -401,8 +415,8 @@ switch ($action) { break; case 'pppoe-edit': - $ui->assign('_title', $_L['PPPOE_Plans']); - $id = $routes['2']; + $ui->assign('_title', Lang::T('PPPOE Plans')); + $id = $routes['2']; $d = ORM::for_table('tbl_plans')->find_one($id); if ($d) { $ui->assign('d', $d); @@ -423,7 +437,7 @@ switch ($action) { break; case 'pppoe-delete': - $id = $routes['2']; + $id = $routes['2']; $d = ORM::for_table('tbl_plans')->find_one($id); if ($d) { @@ -437,16 +451,19 @@ switch ($action) { Mikrotik::removePpoePlan($client, $d['name_plan']); } catch (Exception $e) { //ignore exception, it means router has already deleted + } catch (Throwable $e) { + //ignore exception, it means router has already deleted } } $d->delete(); - r2(U . 'services/pppoe', 's', $_L['Delete_Successfully']); + r2(U . 'services/pppoe', 's', Lang::T('Data Deleted Successfully')); } break; case 'pppoe-add-post': $name = _post('name_plan'); + $plan_type = _post('plan_type'); $radius = _post('radius'); $id_bw = _post('id_bw'); $price = _post('price'); @@ -455,7 +472,10 @@ switch ($action) { $routers = _post('routers'); $pool = _post('pool_name'); $pool_expired = _post('pool_expired'); + $list_expired = _post('list_expired'); $enabled = _post('enabled'); + $prepaid = _post('prepaid'); + $msg = ''; if (Validator::UnsignedNumber($validity) == false) { @@ -465,17 +485,17 @@ switch ($action) { $msg .= 'The price must be a number' . '
'; } if ($name == '' or $id_bw == '' or $price == '' or $validity == '' or $pool == '') { - $msg .= $_L['All_field_is_required'] . '
'; + $msg .= Lang::T('All field is required') . '
'; } - if (empty($radius)) { + if (empty ($radius)) { if ($routers == '') { - $msg .= $_L['All_field_is_required'] . '
'; + $msg .= Lang::T('All field is required') . '
'; } } $d = ORM::for_table('tbl_plans')->where('name_plan', $name)->find_one(); if ($d) { - $msg .= $_L['Plan_already_exist'] . '
'; + $msg .= Lang::T('Name Plan Already Exist') . '
'; } run_hook('add_ppoe'); #HOOK if ($msg == '') { @@ -496,24 +516,28 @@ switch ($action) { } $rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown; $radiusRate = $b['rate_up'] . $radup . '/' . $b['rate_down'] . $raddown; + $rate = trim($rate . " " . $b['burst']); $d = ORM::for_table('tbl_plans')->create(); $d->type = 'PPPOE'; $d->name_plan = $name; $d->id_bw = $id_bw; $d->price = $price; + $d->plan_type = $plan_type; $d->validity = $validity; $d->validity_unit = $validity_unit; $d->pool = $pool; - if (!empty($radius)) { + if (!empty ($radius)) { $d->is_radius = 1; $d->routers = ''; } else { $d->is_radius = 0; $d->routers = $routers; - $d->pool_expired = $pool_expired; } + $d->pool_expired = $pool_expired; + $d->list_expired = $list_expired; $d->enabled = $enabled; + $d->prepaid = $prepaid; $d->save(); $plan_id = $d->id(); @@ -523,12 +547,12 @@ switch ($action) { $mikrotik = Mikrotik::info($routers); $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); Mikrotik::addPpoePlan($client, $name, $pool, $rate); - if (!empty($pool_expired)) { + if (!empty ($pool_expired)) { Mikrotik::setPpoePlan($client, 'EXPIRED NUXBILL ' . $pool_expired, $pool_expired, '512K/512K'); } } - r2(U . 'services/pppoe', 's', $_L['Created_Successfully']); + r2(U . 'services/pppoe', 's', Lang::T('Data Created Successfully')); } else { r2(U . 'services/pppoe-add', 'e', $msg); } @@ -536,6 +560,7 @@ switch ($action) { case 'edit-pppoe-post': $id = _post('id'); + $plan_type = _post('plan_type'); $name = _post('name_plan'); $id_bw = _post('id_bw'); $price = _post('price'); @@ -544,7 +569,9 @@ switch ($action) { $routers = _post('routers'); $pool = _post('pool_name'); $pool_expired = _post('pool_expired'); + $list_expired = _post('list_expired'); $enabled = _post('enabled'); + $prepaid = _post('prepaid'); $msg = ''; if (Validator::UnsignedNumber($validity) == false) { @@ -554,13 +581,13 @@ switch ($action) { $msg .= 'The price must be a number' . '
'; } if ($name == '' or $id_bw == '' or $price == '' or $validity == '' or $pool == '') { - $msg .= $_L['All_field_is_required'] . '
'; + $msg .= Lang::T('All field is required') . '
'; } $d = ORM::for_table('tbl_plans')->where('id', $id)->find_one(); if ($d) { } else { - $msg .= $_L['Data_Not_Found'] . '
'; + $msg .= Lang::T('Data Not Found') . '
'; } run_hook('edit_ppoe'); #HOOK if ($msg == '') { @@ -581,6 +608,7 @@ switch ($action) { } $rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown; $radiusRate = $b['rate_up'] . $radup . '/' . $b['rate_down'] . $raddown; + $rate = trim($rate . " " . $b['burst']); if ($d['is_radius']) { Radius::planUpSert($id, $radiusRate, $pool); @@ -588,7 +616,7 @@ switch ($action) { $mikrotik = Mikrotik::info($routers); $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); Mikrotik::setPpoePlan($client, $name, $pool, $rate); - if (!empty($pool_expired)) { + if (!empty ($pool_expired)) { Mikrotik::setPpoePlan($client, 'EXPIRED NUXBILL ' . $pool_expired, $pool_expired, '512K/512K'); } } @@ -596,15 +624,18 @@ switch ($action) { $d->name_plan = $name; $d->id_bw = $id_bw; $d->price = $price; + $d->plan_type = $plan_type; $d->validity = $validity; $d->validity_unit = $validity_unit; $d->routers = $routers; $d->pool = $pool; $d->pool_expired = $pool_expired; + $d->list_expired = $list_expired; $d->enabled = $enabled; + $d->prepaid = $prepaid; $d->save(); - r2(U . 'services/pppoe', 's', $_L['Updated_Successfully']); + r2(U . 'services/pppoe', 's', Lang::T('Data Updated Successfully')); } else { r2(U . 'services/pppoe-edit/' . $id, 'e', $msg); } @@ -613,15 +644,14 @@ switch ($action) { $ui->assign('_title', Lang::T('Balance Plans')); $name = _post('name'); if ($name != '') { - $paginator = Paginator::build(ORM::for_table('tbl_plans'), ['name_plan' => '%' . $name . '%', 'type' => 'Balance'], $name); - $d = ORM::for_table('tbl_plans')->where('tbl_plans.type', 'Balance')->where_like('tbl_plans.name_plan', '%' . $name . '%')->offset($paginator['startpoint'])->limit($paginator['limit'])->find_many(); + $query = ORM::for_table('tbl_plans')->where('tbl_plans.type', 'Balance')->where_like('tbl_plans.name_plan', '%' . $name . '%'); + $d = Paginator::findMany($query, ['name' => $name]); } else { - $paginator = Paginator::build(ORM::for_table('tbl_plans'), ['type' => 'Balance'], $name); - $d = ORM::for_table('tbl_plans')->where('tbl_plans.type', 'Balance')->offset($paginator['startpoint'])->limit($paginator['limit'])->find_many(); + $query = ORM::for_table('tbl_plans')->where('tbl_plans.type', 'Balance'); + $d = Paginator::findMany($query); } $ui->assign('d', $d); - $ui->assign('paginator', $paginator); run_hook('view_list_balance'); #HOOK $ui->display('balance.tpl'); break; @@ -632,20 +662,20 @@ switch ($action) { break; case 'balance-edit': $ui->assign('_title', Lang::T('Balance Plans')); - $id = $routes['2']; + $id = $routes['2']; $d = ORM::for_table('tbl_plans')->find_one($id); $ui->assign('d', $d); run_hook('view_edit_balance'); #HOOK $ui->display('balance-edit.tpl'); break; case 'balance-delete': - $id = $routes['2']; + $id = $routes['2']; $d = ORM::for_table('tbl_plans')->find_one($id); if ($d) { run_hook('delete_balance'); #HOOK $d->delete(); - r2(U . 'services/balance', 's', $_L['Delete_Successfully']); + r2(U . 'services/balance', 's', Lang::T('Data Deleted Successfully')); } break; case 'balance-edit-post': @@ -653,28 +683,30 @@ switch ($action) { $name = _post('name'); $price = _post('price'); $enabled = _post('enabled'); + $prepaid = _post('prepaid'); $msg = ''; if (Validator::UnsignedNumber($price) == false) { $msg .= 'The price must be a number' . '
'; } if ($name == '') { - $msg .= $_L['All_field_is_required'] . '
'; + $msg .= Lang::T('All field is required') . '
'; } $d = ORM::for_table('tbl_plans')->where('id', $id)->find_one(); if ($d) { } else { - $msg .= $_L['Data_Not_Found'] . '
'; + $msg .= Lang::T('Data Not Found') . '
'; } run_hook('edit_ppoe'); #HOOK if ($msg == '') { $d->name_plan = $name; $d->price = $price; $d->enabled = $enabled; + $d->prepaid = 'yes'; $d->save(); - r2(U . 'services/balance', 's', $_L['Updated_Successfully']); + r2(U . 'services/balance', 's', Lang::T('Data Updated Successfully')); } else { r2(U . 'services/balance-edit/' . $id, 'e', $msg); } @@ -689,12 +721,12 @@ switch ($action) { $msg .= 'The price must be a number' . '
'; } if ($name == '') { - $msg .= $_L['All_field_is_required'] . '
'; + $msg .= Lang::T('All field is required') . '
'; } $d = ORM::for_table('tbl_plans')->where('name_plan', $name)->find_one(); if ($d) { - $msg .= $_L['Plan_already_exist'] . '
'; + $msg .= Lang::T('Name Plan Already Exist') . '
'; } run_hook('add_ppoe'); #HOOK if ($msg == '') { @@ -708,9 +740,10 @@ switch ($action) { $d->routers = ''; $d->pool = ''; $d->enabled = $enabled; + $d->prepaid = 'yes'; $d->save(); - r2(U . 'services/balance', 's', $_L['Created_Successfully']); + r2(U . 'services/balance', 's', Lang::T('Data Created Successfully')); } else { r2(U . 'services/balance-add', 'e', $msg); } diff --git a/system/controllers/settings.php b/system/controllers/settings.php index 5b13dbee..e6282722 100644 --- a/system/controllers/settings.php +++ b/system/controllers/settings.php @@ -5,27 +5,45 @@ * by https://t.me/ibnux **/ _admin(); -$ui->assign('_title', $_L['Settings']); +$ui->assign('_title', Lang::T('Settings')); $ui->assign('_system_menu', 'settings'); $action = $routes['1']; -$admin = Admin::_info(); $ui->assign('_admin', $admin); switch ($action) { case 'app': - if ($admin['user_type'] != 'Admin') { - r2(U . "dashboard", 'e', $_L['Do_Not_Access']); + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); } - if (file_exists('system/uploads/logo.png')) { - $logo = 'system/uploads/logo.png?' . time(); + + if (!empty(_get('testWa'))) { + $result = Message::sendWhatsapp(_get('testWa'), 'PHPNuxBill Test Whatsapp'); + r2(U . "settings/app", 's', 'Test Whatsapp has been send
Result: ' . $result); + } + if (!empty(_get('testSms'))) { + $result = Message::sendSMS(_get('testSms'), 'PHPNuxBill Test SMS'); + r2(U . "settings/app", 's', 'Test SMS has been send
Result: ' . $result); + } + if (!empty(_get('testEmail'))) { + Message::sendEmail(_get('testEmail'), 'PHPNuxBill Test Email', 'PHPNuxBill Test Email Body'); + r2(U . "settings/app", 's', 'Test Email has been send'); + } + if (!empty(_get('testTg'))) { + $result = Message::sendTelegram('PHPNuxBill Test Telegram'); + r2(U . "settings/app", 's', 'Test Telegram has been send
Result: ' . $result); + } + + $UPLOAD_URL_PATH = str_replace($root_path, '', $UPLOAD_PATH); + if (file_exists($UPLOAD_PATH . DIRECTORY_SEPARATOR . 'logo.png')) { + $logo = $UPLOAD_URL_PATH . DIRECTORY_SEPARATOR . 'logo.png?' . time(); } else { - $logo = 'system/uploads/logo.default.png'; + $logo = $UPLOAD_URL_PATH . DIRECTORY_SEPARATOR . 'logo.default.png'; } $ui->assign('logo', $logo); - if (empty($_c['radius_client'])) { + if ($config['radius_enable'] && empty($config['radius_client'])) { try { - $_c['radius_client'] = Radius::getClient(); + $config['radius_client'] = Radius::getClient(); $ui->assign('_c', $_c); } catch (Exception $e) { //ignore @@ -38,10 +56,30 @@ switch ($action) { $themes[] = $file; } } - $php = trim(shell_exec('which php')); - if (empty($php)) { + $r = ORM::for_table('tbl_routers')->find_many(); + $ui->assign('r', $r); + if (function_exists("shell_exec")) { + $php = trim(shell_exec('which php')); + if (empty($php)) { + $php = 'php'; + } + } else { $php = 'php'; } + if (empty($config['api_key'])) { + $config['api_key'] = sha1(uniqid(rand(), true)); + $d = ORM::for_table('tbl_appconfig')->where('setting', 'api_key')->find_one(); + if ($d) { + $d->value = $config['api_key']; + $d->save(); + } else { + $d = ORM::for_table('tbl_appconfig')->create(); + $d->setting = 'api_key'; + $d->value = $config['api_key']; + $d->save(); + } + } + $ui->assign('_c', $config); $ui->assign('php', $php); $ui->assign('dir', str_replace('controllers', '', __DIR__)); $ui->assign('themes', $themes); @@ -49,434 +87,29 @@ switch ($action) { $ui->display('app-settings.tpl'); break; - case 'localisation': - if ($admin['user_type'] != 'Admin') { - r2(U . "dashboard", 'e', $_L['Do_Not_Access']); - } - $folders = []; - $files = scandir('system/lan/'); - foreach ($files as $file) { - if (is_dir('system/lan/' . $file) && !in_array($file, ['.', '..'])) { - $folders[] = $file; - } - } - $ui->assign('lan', $folders); - $timezonelist = Timezone::timezoneList(); - $ui->assign('tlist', $timezonelist); - $ui->assign('xjq', ' $("#tzone").select2(); '); - run_hook('view_localisation'); #HOOK - $ui->display('app-localisation.tpl'); - break; - - case 'users': - if ($admin['user_type'] != 'Admin') { - r2(U . "dashboard", 'e', $_L['Do_Not_Access']); - } - - $ui->assign('xfooter', ''); - - $username = _post('username'); - if ($username != '') { - $paginator = Paginator::build(ORM::for_table('tbl_users'), ['username' => '%' . $username . '%'], $username); - $d = ORM::for_table('tbl_users')->where_like('username', '%' . $username . '%')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_asc('id')->find_many(); - } else { - $paginator = Paginator::build(ORM::for_table('tbl_users')); - $d = ORM::for_table('tbl_users')->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_asc('id')->find_many(); - } - - $ui->assign('d', $d); - $ui->assign('paginator', $paginator); - run_hook('view_list_admin'); #HOOK - $ui->display('users.tpl'); - break; - - case 'users-add': - if ($admin['user_type'] != 'Admin') { - r2(U . "dashboard", 'e', $_L['Do_Not_Access']); - } - run_hook('view_add_admin'); #HOOK - $ui->display('users-add.tpl'); - break; - - case 'users-edit': - if ($admin['user_type'] != 'Admin') { - r2(U . "dashboard", 'e', $_L['Do_Not_Access']); - } - - $id = $routes['2']; - $d = ORM::for_table('tbl_users')->find_one($id); - if ($d) { - $ui->assign('d', $d); - run_hook('view_edit_admin'); #HOOK - $ui->display('users-edit.tpl'); - } else { - r2(U . 'settings/users', 'e', $_L['Account_Not_Found']); - } - break; - - case 'users-delete': - if ($admin['user_type'] != 'Admin') { - r2(U . "dashboard", 'e', $_L['Do_Not_Access']); - } - - $id = $routes['2']; - if (($admin['id']) == $id) { - r2(U . 'settings/users', 'e', 'Sorry You can\'t delete yourself'); - } - $d = ORM::for_table('tbl_users')->find_one($id); - if ($d) { - run_hook('delete_admin'); #HOOK - $d->delete(); - r2(U . 'settings/users', 's', $_L['User_Delete_Ok']); - } else { - r2(U . 'settings/users', 'e', $_L['Account_Not_Found']); - } - break; - - case 'users-post': - $username = _post('username'); - $fullname = _post('fullname'); - $password = _post('password'); - $cpassword = _post('cpassword'); - $user_type = _post('user_type'); - $msg = ''; - if (Validator::Length($username, 16, 2) == false) { - $msg .= 'Username should be between 3 to 15 characters' . '
'; - } - if (Validator::Length($fullname, 26, 2) == false) { - $msg .= 'Full Name should be between 3 to 25 characters' . '
'; - } - if (!Validator::Length($password, 15, 5)) { - $msg .= 'Password should be between 6 to 15 characters' . '
'; - } - if ($password != $cpassword) { - $msg .= 'Passwords does not match' . '
'; - } - - $d = ORM::for_table('tbl_users')->where('username', $username)->find_one(); - if ($d) { - $msg .= $_L['account_already_exist'] . '
'; - } - $date_now = date("Y-m-d H:i:s"); - run_hook('add_admin'); #HOOK - if ($msg == '') { - $password = Password::_crypt($password); - $d = ORM::for_table('tbl_users')->create(); - $d->username = $username; - $d->fullname = $fullname; - $d->password = $password; - $d->user_type = $user_type; - $d->status = 'Active'; - $d->creationdate = $date_now; - - $d->save(); - - _log('[' . $admin['username'] . ']: ' . $_L['account_created_successfully'], 'Admin', $admin['id']); - r2(U . 'settings/users', 's', $_L['account_created_successfully']); - } else { - r2(U . 'settings/users-add', 'e', $msg); - } - break; - - case 'users-edit-post': - $username = _post('username'); - $fullname = _post('fullname'); - $password = _post('password'); - $cpassword = _post('cpassword'); - - $msg = ''; - if (Validator::Length($username, 16, 2) == false) { - $msg .= 'Username should be between 3 to 15 characters' . '
'; - } - if (Validator::Length($fullname, 26, 2) == false) { - $msg .= 'Full Name should be between 3 to 25 characters' . '
'; - } - if ($password != '') { - if (!Validator::Length($password, 15, 5)) { - $msg .= 'Password should be between 6 to 15 characters' . '
'; - } - if ($password != $cpassword) { - $msg .= 'Passwords does not match' . '
'; - } - } - - $id = _post('id'); - $d = ORM::for_table('tbl_users')->find_one($id); - if ($d) { - } else { - $msg .= $_L['Data_Not_Found'] . '
'; - } - - if ($d['username'] != $username) { - $c = ORM::for_table('tbl_users')->where('username', $username)->find_one(); - if ($c) { - $msg .= $_L['account_already_exist'] . '
'; - } - } - run_hook('edit_admin'); #HOOK - if ($msg == '') { - $d->username = $username; - if ($password != '') { - $password = Password::_crypt($password); - $d->password = $password; - } - - $d->fullname = $fullname; - if (($admin['id']) != $id) { - $user_type = _post('user_type'); - $d->user_type = $user_type; - } - - $d->save(); - - _log('[' . $admin['username'] . ']: ' . $_L['User_Updated_Successfully'], 'Admin', $admin['id']); - r2(U . 'settings/users', 's', 'User Updated Successfully'); - } else { - r2(U . 'settings/users-edit/' . $id, 'e', $msg); - } - break; - case 'app-post': - $company = _post('company'); - $footer = _post('footer'); - $enable_balance = _post('enable_balance'); - $allow_balance_transfer = _post('allow_balance_transfer'); - $disable_voucher = _post('disable_voucher'); - $telegram_bot = _post('telegram_bot'); - $telegram_target_id = _post('telegram_target_id'); - $sms_url = _post('sms_url'); - $wa_url = _post('wa_url'); - $minimum_transfer = _post('minimum_transfer'); - $user_notification_expired = _post('user_notification_expired'); - $user_notification_reminder = _post('user_notification_reminder'); - $user_notification_payment = _post('user_notification_payment'); - $address = _post('address'); - $tawkto = _post('tawkto'); - $http_proxy = _post('http_proxy'); - $http_proxyauth = _post('http_proxyauth'); - $radius_enable = _post('radius_enable'); - $radius_client = _post('radius_client'); - $theme = _post('theme'); - $voucher_format = _post('voucher_format'); + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $company = _post('CompanyName'); run_hook('save_settings'); #HOOK if (!empty($_FILES['logo']['name'])) { if (function_exists('imagecreatetruecolor')) { - if (file_exists('system/uploads/logo.png')) unlink('system/uploads/logo.png'); - File::resizeCropImage($_FILES['logo']['tmp_name'], 'system/uploads/logo.png', 1078, 200, 100); + if (file_exists($UPLOAD_PATH . DIRECTORY_SEPARATOR . 'logo.png')) unlink($UPLOAD_PATH . DIRECTORY_SEPARATOR . 'logo.png'); + File::resizeCropImage($_FILES['logo']['tmp_name'], $UPLOAD_PATH . DIRECTORY_SEPARATOR . 'logo.png', 1078, 200, 100); if (file_exists($_FILES['logo']['tmp_name'])) unlink($_FILES['logo']['tmp_name']); } else { r2(U . 'settings/app', 'e', 'PHP GD is not installed'); } } if ($company == '') { - r2(U . 'settings/app', 'e', $_L['All_field_is_required']); + r2(U . 'settings/app', 'e', Lang::T('All field is required')); } else { - $d = ORM::for_table('tbl_appconfig')->where('setting', 'CompanyName')->find_one(); - $d->value = $company; - $d->save(); - - $d = ORM::for_table('tbl_appconfig')->where('setting', 'address')->find_one(); - $d->value = $address; - $d->save(); - - $phone = _post('phone'); - $d = ORM::for_table('tbl_appconfig')->where('setting', 'phone')->find_one(); - $d->value = $phone; - $d->save(); - - - $d = ORM::for_table('tbl_appconfig')->where('setting', 'http_proxy')->find_one(); - if ($d) { - $d->value = $http_proxy; - $d->save(); - } else { - $d = ORM::for_table('tbl_appconfig')->create(); - $d->setting = 'http_proxy'; - $d->value = $http_proxy; - $d->save(); - } - - $d = ORM::for_table('tbl_appconfig')->where('setting', 'http_proxyauth')->find_one(); - if ($d) { - $d->value = $http_proxyauth; - $d->save(); - } else { - $d = ORM::for_table('tbl_appconfig')->create(); - $d->setting = 'http_proxyauth'; - $d->value = $http_proxyauth; - $d->save(); - } - - - $d = ORM::for_table('tbl_appconfig')->where('setting', 'theme')->find_one(); - if ($d) { - $d->value = $theme; - $d->save(); - } else { - $d = ORM::for_table('tbl_appconfig')->create(); - $d->setting = 'theme'; - $d->value = $theme; - $d->save(); - } - - $d = ORM::for_table('tbl_appconfig')->where('setting', 'CompanyFooter')->find_one(); - if ($d) { - $d->value = $footer; - $d->save(); - } else { - $d = ORM::for_table('tbl_appconfig')->create(); - $d->setting = 'CompanyFooter'; - $d->value = $footer; - $d->save(); - } - - $d = ORM::for_table('tbl_appconfig')->where('setting', 'voucher_format')->find_one(); - if ($d) { - $d->value = $voucher_format; - $d->save(); - } else { - $d = ORM::for_table('tbl_appconfig')->create(); - $d->setting = 'voucher_format'; - $d->value = $voucher_format; - $d->save(); - } - $d = ORM::for_table('tbl_appconfig')->where('setting', 'disable_voucher')->find_one(); - if ($d) { - $d->value = $disable_voucher; - $d->save(); - } else { - $d = ORM::for_table('tbl_appconfig')->create(); - $d->setting = 'disable_voucher'; - $d->value = $disable_voucher; - $d->save(); - } - - $d = ORM::for_table('tbl_appconfig')->where('setting', 'enable_balance')->find_one(); - if ($d) { - $d->value = $enable_balance; - $d->save(); - } else { - $d = ORM::for_table('tbl_appconfig')->create(); - $d->setting = 'enable_balance'; - $d->value = $enable_balance; - $d->save(); - } - - $d = ORM::for_table('tbl_appconfig')->where('setting', 'allow_balance_transfer')->find_one(); - if ($d) { - $d->value = $allow_balance_transfer; - $d->save(); - } else { - $d = ORM::for_table('tbl_appconfig')->create(); - $d->setting = 'allow_balance_transfer'; - $d->value = $allow_balance_transfer; - $d->save(); - } - - $d = ORM::for_table('tbl_appconfig')->where('setting', 'minimum_transfer')->find_one(); - if ($d) { - $d->value = $minimum_transfer; - $d->save(); - } else { - $d = ORM::for_table('tbl_appconfig')->create(); - $d->setting = 'minimum_transfer'; - $d->value = $minimum_transfer; - $d->save(); - } - - $d = ORM::for_table('tbl_appconfig')->where('setting', 'telegram_bot')->find_one(); - if ($d) { - $d->value = $telegram_bot; - $d->save(); - } else { - $d = ORM::for_table('tbl_appconfig')->create(); - $d->setting = 'telegram_bot'; - $d->value = $telegram_bot; - $d->save(); - } - - $d = ORM::for_table('tbl_appconfig')->where('setting', 'telegram_target_id')->find_one(); - if ($d) { - $d->value = $telegram_target_id; - $d->save(); - } else { - $d = ORM::for_table('tbl_appconfig')->create(); - $d->setting = 'telegram_target_id'; - $d->value = $telegram_target_id; - $d->save(); - } - - $d = ORM::for_table('tbl_appconfig')->where('setting', 'sms_url')->find_one(); - if ($d) { - $d->value = $sms_url; - $d->save(); - } else { - $d = ORM::for_table('tbl_appconfig')->create(); - $d->setting = 'sms_url'; - $d->value = $sms_url; - $d->save(); - } - - $d = ORM::for_table('tbl_appconfig')->where('setting', 'wa_url')->find_one(); - if ($d) { - $d->value = $wa_url; - $d->save(); - } else { - $d = ORM::for_table('tbl_appconfig')->create(); - $d->setting = 'wa_url'; - $d->value = $wa_url; - $d->save(); - } - - $d = ORM::for_table('tbl_appconfig')->where('setting', 'user_notification_expired')->find_one(); - if ($d) { - $d->value = $user_notification_expired; - $d->save(); - } else { - $d = ORM::for_table('tbl_appconfig')->create(); - $d->setting = 'user_notification_expired'; - $d->value = $user_notification_expired; - $d->save(); - } - - $d = ORM::for_table('tbl_appconfig')->where('setting', 'user_notification_reminder')->find_one(); - if ($d) { - $d->value = $user_notification_reminder; - $d->save(); - } else { - $d = ORM::for_table('tbl_appconfig')->create(); - $d->setting = 'user_notification_reminder'; - $d->value = $user_notification_reminder; - $d->save(); - } - - $d = ORM::for_table('tbl_appconfig')->where('setting', 'user_notification_payment')->find_one(); - if ($d) { - $d->value = $user_notification_payment; - $d->save(); - } else { - $d = ORM::for_table('tbl_appconfig')->create(); - $d->setting = 'user_notification_payment'; - $d->value = $user_notification_payment; - $d->save(); - } - - $d = ORM::for_table('tbl_appconfig')->where('setting', 'tawkto')->find_one(); - if ($d) { - $d->value = $tawkto; - $d->save(); - } else { - $d = ORM::for_table('tbl_appconfig')->create(); - $d->setting = 'tawkto'; - $d->value = $tawkto; - $d->save(); - } - if ($radius_enable) { try { - Radius::getTableNas()->find_one(1); + Radius::getTableNas()->find_many(); } catch (Exception $e) { $ui->assign("error_title", "RADIUS Error"); $ui->assign("error_message", "Radius table not found.

" . @@ -486,48 +119,81 @@ switch ($action) { die(); } } - - $d = ORM::for_table('tbl_appconfig')->where('setting', 'radius_enable')->find_one(); - if ($d) { - $d->value = $radius_enable; - $d->save(); - } else { - $d = ORM::for_table('tbl_appconfig')->create(); - $d->setting = 'radius_enable'; - $d->value = $radius_enable; - $d->save(); + // save all settings + foreach ($_POST as $key => $value) { + $d = ORM::for_table('tbl_appconfig')->where('setting', $key)->find_one(); + if ($d) { + $d->value = $value; + $d->save(); + } else { + $d = ORM::for_table('tbl_appconfig')->create(); + $d->setting = $key; + $d->value = $value; + $d->save(); + } } - $d = ORM::for_table('tbl_appconfig')->where('setting', 'radius_client')->find_one(); - if ($d) { - $d->value = $radius_client; - $d->save(); - } else { - $d = ORM::for_table('tbl_appconfig')->create(); - $d->setting = 'radius_client'; - $d->value = $radius_client; - $d->save(); + //checkbox + $checks = ['hide_mrc', 'hide_tms', 'hide_aui', 'hide_al', 'hide_uet', 'hide_vs', 'hide_pg']; + foreach ($checks as $check) { + if (!isset($_POST[$check])) { + $d = ORM::for_table('tbl_appconfig')->where('setting', $check)->find_one(); + if ($d) { + $d->value = 'no'; + $d->save(); + } else { + $d = ORM::for_table('tbl_appconfig')->create(); + $d->setting = $check; + $d->value = 'no'; + $d->save(); + } + } } - $note = _post('note'); - $d = ORM::for_table('tbl_appconfig')->where('setting', 'note')->find_one(); - $d->value = $note; - $d->save(); + _log('[' . $admin['username'] . ']: ' . Lang::T('Settings Saved Successfully'), $admin['user_type'], $admin['id']); - _log('[' . $admin['username'] . ']: ' . $_L['Settings_Saved_Successfully'], 'Admin', $admin['id']); - - r2(U . 'settings/app', 's', $_L['Settings_Saved_Successfully']); + r2(U . 'settings/app', 's', Lang::T('Settings Saved Successfully')); } break; + case 'localisation': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $folders = []; + $files = scandir('system/lan/'); + foreach ($files as $file) { + if (is_file('system/lan/' . $file) && !in_array($file, ['index.html', 'country.json', '.DS_Store'])) { + $file = str_replace(".json", "", $file); + $folders[$file] = ''; + } + } + $ui->assign('lani', $folders); + $lans = Lang::getIsoLang(); + foreach ($lans as $lan => $val) { + if (isset($folders[$lan])) { + unset($lans[$lan]); + } + } + $ui->assign('lan', $lans); + $timezonelist = Timezone::timezoneList(); + $ui->assign('tlist', $timezonelist); + $ui->assign('xjq', ' $("#tzone").select2(); '); + run_hook('view_localisation'); #HOOK + $ui->display('app-localisation.tpl'); + break; + case 'localisation-post': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } $tzone = _post('tzone'); $date_format = _post('date_format'); $country_code_phone = _post('country_code_phone'); $lan = _post('lan'); run_hook('save_localisation'); #HOOK if ($tzone == '' or $date_format == '' or $lan == '') { - r2(U . 'settings/app', 'e', $_L['All_field_is_required']); + r2(U . 'settings/app', 'e', Lang::T('All field is required')); } else { $d = ORM::for_table('tbl_appconfig')->where('setting', 'timezone')->find_one(); $d->value = $tzone; @@ -601,16 +267,353 @@ switch ($action) { $d = ORM::for_table('tbl_appconfig')->where('setting', 'language')->find_one(); $d->value = $lan; $d->save(); + unset($_SESSION['Lang']); + _log('[' . $admin['username'] . ']: ' . Lang::T('Settings Saved Successfully'), $admin['user_type'], $admin['id']); + r2(U . 'settings/localisation', 's', Lang::T('Settings Saved Successfully')); + } + break; - _log('[' . $admin['username'] . ']: ' . $_L['Settings_Saved_Successfully'], 'Admin', $admin['id']); - r2(U . 'settings/localisation', 's', $_L['Settings_Saved_Successfully']); + case 'users': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $search = _req('search'); + if ($search != '') { + if ($admin['user_type'] == 'SuperAdmin') { + $query = ORM::for_table('tbl_users') + ->where_like('username', '%' . $search . '%') + ->order_by_asc('id'); + $d = Paginator::findMany($query, ['search' => $search]); + } else if ($admin['user_type'] == 'Admin') { + $query = ORM::for_table('tbl_users') + ->where_like('username', '%' . $search . '%')->where_any_is([ + ['user_type' => 'Report'], + ['user_type' => 'Agent'], + ['user_type' => 'Sales'], + ['id' => $admin['id']] + ])->order_by_asc('id'); + $d = Paginator::findMany($query, ['search' => $search]); + } else { + $query = ORM::for_table('tbl_users') + ->where_like('username', '%' . $search . '%') + ->where_any_is([ + ['id' => $admin['id']], + ['root' => $admin['id']] + ])->order_by_asc('id'); + $d = Paginator::findMany($query, ['search' => $search]); + } + } else { + if ($admin['user_type'] == 'SuperAdmin') { + $query = ORM::for_table('tbl_users')->order_by_asc('id'); + $d = Paginator::findMany($query); + } else if ($admin['user_type'] == 'Admin') { + $query = ORM::for_table('tbl_users')->where_any_is([ + ['user_type' => 'Report'], + ['user_type' => 'Agent'], + ['user_type' => 'Sales'], + ['id' => $admin['id']] + ])->order_by_asc('id'); + $d = Paginator::findMany($query); + } else { + $query = ORM::for_table('tbl_users') + ->where_any_is([ + ['id' => $admin['id']], + ['root' => $admin['id']] + ])->order_by_asc('id'); + $d = Paginator::findMany($query); + } + } + $admins = []; + foreach ($d as $k) { + if (!empty($k['root'])) { + $admins[] = $k['root']; + } + } + if (count($admins) > 0) { + $adms = ORM::for_table('tbl_users')->where_in('id', $admins)->findArray(); + unset($admins); + foreach ($adms as $adm) { + $admins[$adm['id']] = $adm['fullname']; + } + } + if ($isApi) { + showResult(true, $action, [ + 'admins' => $d, + 'roots' => $admins + ], ['search' => $search]); + } + $ui->assign('admins', $admins); + $ui->assign('d', $d); + $ui->assign('search', $search); + run_hook('view_list_admin'); #HOOK + $ui->display('users.tpl'); + break; + + case 'users-add': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $ui->assign('_title', Lang::T('Add User')); + $ui->assign('agents', ORM::for_table('tbl_users')->where('user_type', 'Agent')->find_many()); + $ui->display('users-add.tpl'); + break; + case 'users-view': + $ui->assign('_title', Lang::T('Edit User')); + $id = $routes['2']; + if (empty($id)) { + $id = $admin['id']; + } + //allow see himself + if ($admin['id'] == $id) { + $d = ORM::for_table('tbl_users')->where('id', $id)->find_array($id)[0]; + } else { + if (in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + // Super Admin can see anyone + $d = ORM::for_table('tbl_users')->where('id', $id)->find_array()[0]; + } else if ($admin['user_type'] == 'Agent') { + // Agent can see Sales + $d = ORM::for_table('tbl_users')->where_any_is([['root' => $admin['id']], ['id' => $id]])->find_array()[0]; + } + } + if ($d) { + run_hook('view_edit_admin'); #HOOK + if ($d['user_type'] == 'Sales') { + $ui->assign('agent', ORM::for_table('tbl_users')->where('id', $d['root'])->find_array()[0]); + } + if ($isApi) { + unset($d['password']); + $agent = $ui->get('agent'); + if ($agent) unset($agent['password']); + showResult(true, $action, [ + 'admin' => $d, + 'agent' => $agent + ], ['search' => $search]); + } + $ui->assign('d', $d); + $ui->assign('_title', $d['username']); + $ui->display('users-view.tpl'); + } else { + r2(U . 'settings/users', 'e', $_L['Account_Not_Found']); + } + break; + case 'users-edit': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $ui->assign('_title', Lang::T('Edit User')); + $id = $routes['2']; + if (empty($id)) { + $id = $admin['id']; + } + if ($admin['id'] == $id) { + $d = ORM::for_table('tbl_users')->find_one($id); + } else { + if ($admin['user_type'] == 'SuperAdmin') { + $d = ORM::for_table('tbl_users')->find_one($id); + $ui->assign('agents', ORM::for_table('tbl_users')->where('user_type', 'Agent')->find_many()); + } else if ($admin['user_type'] == 'Admin') { + $d = ORM::for_table('tbl_users')->where_any_is([ + ['user_type' => 'Report'], + ['user_type' => 'Agent'], + ['user_type' => 'Sales'] + ])->find_one($id); + $ui->assign('agents', ORM::for_table('tbl_users')->where('user_type', 'Agent')->find_many()); + } else { + // Agent cannot move Sales to other Agent + $ui->assign('agents', ORM::for_table('tbl_users')->where('id', $admin['id'])->find_many()); + $d = ORM::for_table('tbl_users')->where('root', $admin['id'])->find_one($id); + } + } + if ($d) { + $ui->assign('id', $id); + $ui->assign('d', $d); + run_hook('view_edit_admin'); #HOOK + $ui->display('users-edit.tpl'); + } else { + r2(U . 'settings/users', 'e', $_L['Account_Not_Found']); + } + break; + + case 'users-delete': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + + $id = $routes['2']; + if (($admin['id']) == $id) { + r2(U . 'settings/users', 'e', 'Sorry You can\'t delete yourself'); + } + $d = ORM::for_table('tbl_users')->find_one($id); + if ($d) { + run_hook('delete_admin'); #HOOK + $d->delete(); + r2(U . 'settings/users', 's', Lang::T('User deleted Successfully')); + } else { + r2(U . 'settings/users', 'e', $_L['Account_Not_Found']); + } + break; + + case 'users-post': + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin', 'Agent'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + $username = _post('username'); + $fullname = _post('fullname'); + $password = _post('password'); + $user_type = _post('user_type'); + $phone = _post('phone'); + $email = _post('email'); + $city = _post('city'); + $subdistrict = _post('subdistrict'); + $ward = _post('ward'); + $send_notif = _post('send_notif'); + $root = _post('root'); + $msg = ''; + if (Validator::Length($username, 45, 2) == false) { + $msg .= Lang::T('Username should be between 3 to 45 characters') . '
'; + } + if (Validator::Length($fullname, 45, 2) == false) { + $msg .= Lang::T('Full Name should be between 3 to 45 characters') . '
'; + } + if (!Validator::Length($password, 1000, 5)) { + $msg .= Lang::T('Password should be minimum 6 characters') . '
'; + } + + $d = ORM::for_table('tbl_users')->where('username', $username)->find_one(); + if ($d) { + $msg .= Lang::T('Account already axist') . '
'; + } + $date_now = date("Y-m-d H:i:s"); + run_hook('add_admin'); #HOOK + if ($msg == '') { + $passwordC = Password::_crypt($password); + $d = ORM::for_table('tbl_users')->create(); + $d->username = $username; + $d->fullname = $fullname; + $d->password = $passwordC; + $d->user_type = $user_type; + $d->phone = $phone; + $d->email = $email; + $d->city = $city; + $d->subdistrict = $subdistrict; + $d->ward = $ward; + $d->status = 'Active'; + $d->creationdate = $date_now; + if ($admin['user_type'] == 'Agent') { + // Prevent hacking from form + $d->root = $admin['id']; + } else if ($user_type == 'Sales') { + $d->root = $root; + } + $d->save(); + + if ($send_notif == 'wa') { + Message::sendWhatsapp(Lang::phoneFormat($phone), Lang::T('Hello, Your account has been created successfully.') . "\nUsername: $username\nPassword: $password\n\n" . $config['CompanyName']); + } else if ($send_notif == 'sms') { + Message::sendSMS($phone, Lang::T('Hello, Your account has been created successfully.') . "\nUsername: $username\nPassword: $password\n\n" . $config['CompanyName']); + } + + _log('[' . $admin['username'] . ']: ' . "Created $user_type $username", $admin['user_type'], $admin['id']); + r2(U . 'settings/users', 's', Lang::T('Account Created Successfully')); + } else { + r2(U . 'settings/users-add', 'e', $msg); + } + break; + + case 'users-edit-post': + $username = _post('username'); + $fullname = _post('fullname'); + $password = _post('password'); + $cpassword = _post('cpassword'); + $user_type = _post('user_type'); + $phone = _post('phone'); + $email = _post('email'); + $city = _post('city'); + $subdistrict = _post('subdistrict'); + $ward = _post('ward'); + $status = _post('status'); + $root = _post('root'); + $msg = ''; + if (Validator::Length($username, 45, 2) == false) { + $msg .= Lang::T('Username should be between 3 to 45 characters') . '
'; + } + if (Validator::Length($fullname, 45, 2) == false) { + $msg .= Lang::T('Full Name should be between 3 to 45 characters') . '
'; + } + if ($password != '') { + if (!Validator::Length($password, 1000, 5)) { + $msg .= Lang::T('Password should be minimum 6 characters') . '
'; + } + if ($password != $cpassword) { + $msg .= Lang::T('Passwords does not match') . '
'; + } + } + + $id = _post('id'); + if ($admin['id'] == $id) { + $d = ORM::for_table('tbl_users')->find_one($id); + } else { + if ($admin['user_type'] == 'SuperAdmin') { + $d = ORM::for_table('tbl_users')->find_one($id); + } else if ($admin['user_type'] == 'Admin') { + $d = ORM::for_table('tbl_users')->where_any_is([ + ['user_type' => 'Report'], + ['user_type' => 'Agent'], + ['user_type' => 'Sales'] + ])->find_one($id); + } else { + $d = ORM::for_table('tbl_users')->where('root', $admin['id'])->find_one($id); + } + } + if (!$d) { + $msg .= Lang::T('Data Not Found') . '
'; + } + + if ($d['username'] != $username) { + $c = ORM::for_table('tbl_users')->where('username', $username)->find_one(); + if ($c) { + $msg .= "$username " . Lang::T('Account already axist') . '
'; + } + } + run_hook('edit_admin'); #HOOK + if ($msg == '') { + $d->username = $username; + if ($password != '') { + $password = Password::_crypt($password); + $d->password = $password; + } + + $d->fullname = $fullname; + if (($admin['id']) != $id) { + $user_type = _post('user_type'); + $d->user_type = $user_type; + } + $d->phone = $phone; + $d->email = $email; + $d->city = $city; + $d->subdistrict = $subdistrict; + $d->ward = $ward; + if (isset($_POST['status'])) { + $d->status = $status; + } + + if ($admin['user_type'] == 'Agent') { + // Prevent hacking from form + $d->root = $admin['id']; + } else if ($user_type == 'Sales') { + $d->root = $root; + } + + $d->save(); + + _log('[' . $admin['username'] . ']: $username ' . Lang::T('User Updated Successfully'), $admin['user_type'], $admin['id']); + r2(U . 'settings/users', 's', 'User Updated Successfully'); + } else { + r2(U . 'settings/users-edit/' . $id, 'e', $msg); } break; case 'change-password': - if ($admin['user_type'] != 'Admin' and $admin['user_type'] != 'Sales') { - r2(U . "dashboard", 'e', $_L['Do_Not_Access']); - } run_hook('view_change_password'); #HOOK $ui->display('change-password.tpl'); break; @@ -636,187 +639,125 @@ switch ($action) { $d->password = $npass; $d->save(); - _msglog('s', $_L['Password_Changed_Successfully']); - _log('[' . $admin['username'] . ']: Password changed successfully', 'Admin', $admin['id']); + _msglog('s', Lang::T('Password changed successfully, Please login again')); + _log('[' . $admin['username'] . ']: Password changed successfully', $admin['user_type'], $admin['id']); r2(U . 'admin'); } else { - r2(U . 'settings/change-password', 'e', $_L['Incorrect_Current_Password']); + r2(U . 'settings/change-password', 'e', Lang::T('Incorrect Current Password')); } } else { - r2(U . 'settings/change-password', 'e', $_L['Incorrect_Current_Password']); + r2(U . 'settings/change-password', 'e', Lang::T('Incorrect Current Password')); } } else { - r2(U . 'settings/change-password', 'e', $_L['Incorrect_Current_Password']); + r2(U . 'settings/change-password', 'e', Lang::T('Incorrect Current Password')); } break; case 'notifications': - if ($admin['user_type'] != 'Admin' and $admin['user_type'] != 'Sales') { - r2(U . "dashboard", 'e', $_L['Do_Not_Access']); + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); } run_hook('view_notifications'); #HOOK - if (file_exists("system/uploads/notifications.json")) { - $ui->assign('_json', json_decode(file_get_contents('system/uploads/notifications.json'), true)); + if (file_exists($UPLOAD_PATH . DIRECTORY_SEPARATOR . "notifications.json")) { + $ui->assign('_json', json_decode(file_get_contents($UPLOAD_PATH . DIRECTORY_SEPARATOR . 'notifications.json'), true)); } else { - $ui->assign('_json', json_decode(file_get_contents('system/uploads/notifications.default.json'), true)); + $ui->assign('_json', json_decode(file_get_contents($UPLOAD_PATH . DIRECTORY_SEPARATOR . 'notifications.default.json'), true)); } - $ui->assign('_default', json_decode(file_get_contents('system/uploads/notifications.default.json'), true)); + $ui->assign('_default', json_decode(file_get_contents($UPLOAD_PATH . DIRECTORY_SEPARATOR . 'notifications.default.json'), true)); $ui->display('app-notifications.tpl'); break; case 'notifications-post': - file_put_contents("system/uploads/notifications.json", json_encode($_POST)); - r2(U . 'settings/notifications', 's', $_L['Settings_Saved_Successfully']); + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + file_put_contents($UPLOAD_PATH . "/notifications.json", json_encode($_POST)); + r2(U . 'settings/notifications', 's', Lang::T('Settings Saved Successfully')); break; case 'dbstatus': - if ($admin['user_type'] != 'Admin') { - r2(U . "dashboard", 'e', $_L['Do_Not_Access']); + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); } $dbc = new mysqli($db_host, $db_user, $db_password, $db_name); if ($result = $dbc->query('SHOW TABLE STATUS')) { - $size = 0; - $decimals = 2; $tables = array(); while ($row = $result->fetch_array()) { - $size += $row["Data_length"] + $row["Index_length"]; - $total_size = ($row["Data_length"] + $row["Index_length"]) / 1024; - $tables[$row['Name']]['size'] = number_format($total_size, '0'); - $tables[$row['Name']]['rows'] = $row["Rows"]; + $tables[$row['Name']]['rows'] = ORM::for_table($row["Name"])->count(); $tables[$row['Name']]['name'] = $row["Name"]; } - $mbytes = number_format($size / (1024 * 1024), $decimals, $config['dec_point'], $config['thousands_sep']); - $ui->assign('tables', $tables); - $ui->assign('dbsize', $mbytes); run_hook('view_database'); #HOOK $ui->display('dbstatus.tpl'); } break; case 'dbbackup': - if ($admin['user_type'] != 'Admin') { - r2(U . "dashboard", 'e', $_L['Do_Not_Access']); + if (!in_array($admin['user_type'], ['SuperAdmin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); } - - try { - run_hook('backup_database'); #HOOK - $mysqli = new mysqli($db_host, $db_user, $db_password, $db_name); - if ($mysqli->connect_errno) { - throw new Exception("Failed to connect to MySQL: " . $mysqli->connect_error); - } - - header('Pragma: public'); - header('Expires: 0'); - header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); - header('Content-Type: application/force-download'); - header('Content-Type: application/octet-stream'); - header('Content-Type: application/download'); - header('Content-Disposition: attachment;filename="backup_' . date('Y-m-d_h_i_s') . '.sql"'); - header('Content-Transfer-Encoding: binary'); - - ob_start(); - $f_output = fopen("php://output", 'w'); - - print("-- pjl SQL Dump\n"); - print("-- Server version:" . $mysqli->server_info . "\n"); - print("-- Generated: " . date('Y-m-d h:i:s') . "\n"); - print('-- Current PHP version: ' . phpversion() . "\n"); - print('-- Host: ' . $db_host . "\n"); - print('-- Database:' . $db_name . "\n"); - - $aTables = array(); - $strSQL = 'SHOW TABLES'; - if (!$res_tables = $mysqli->query($strSQL)) - throw new Exception("MySQL Error: " . $mysqli->error . 'SQL: ' . $strSQL); - - while ($row = $res_tables->fetch_array()) { - $aTables[] = $row[0]; - } - - $res_tables->free(); - - foreach ($aTables as $table) { - print("-- --------------------------------------------------------\n"); - print("-- Structure for '" . $table . "'\n"); - print("--\n\n"); - - $strSQL = 'SHOW CREATE TABLE ' . $table; - if (!$res_create = $mysqli->query($strSQL)) - throw new Exception("MySQL Error: " . $mysqli->error . 'SQL: ' . $strSQL); - $row_create = $res_create->fetch_assoc(); - - print("\n" . $row_create['Create Table'] . ";\n"); - print("-- --------------------------------------------------------\n"); - print('-- Dump Data for `' . $table . "`\n"); - print("--\n\n"); - $res_create->free(); - - $strSQL = 'SELECT * FROM ' . $table; - if (!$res_select = $mysqli->query($strSQL)) - throw new Exception("MySQL Error: " . $mysqli->error . 'SQL: ' . $strSQL); - - $fields_info = $res_select->fetch_fields(); - - while ($values = $res_select->fetch_assoc()) { - $strFields = ''; - $strValues = ''; - foreach ($fields_info as $field) { - if ($strFields != '') $strFields .= ','; - $strFields .= "`" . $field->name . "`"; - - if ($strValues != '') $strValues .= ','; - $strValues .= '"' . preg_replace('/[^(\x20-\x7F)\x0A]*/', '', $values[$field->name] . '"'); - } - print("INSERT INTO " . $table . " (" . $strFields . ") VALUES (" . $strValues . ");\n"); - } - print("\n\n\n"); - $res_select->free(); - } - _log('[' . $admin['username'] . ']: ' . $_L['Download_Database_Backup'], 'Admin', $admin['id']); - } catch (Exception $e) { - print($e->getMessage()); + $tables = $_POST['tables']; + set_time_limit(-1); + header('Pragma: public'); + header('Expires: 0'); + header('Cache-Control: must-revalidate, post-check=0, pre-check=0'); + header('Content-Type: application/force-download'); + header('Content-Type: application/octet-stream'); + header('Content-Type: application/download'); + header('Content-Disposition: attachment;filename="phpnuxbill_' . count($tables) . '_tables_' . date('Y-m-d_H_i') . '.json"'); + header('Content-Transfer-Encoding: binary'); + $array = []; + foreach ($tables as $table) { + $array[$table] = ORM::for_table($table)->find_array(); + } + echo json_encode($array); + break; + case 'dbrestore': + if (!in_array($admin['user_type'], ['SuperAdmin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); + } + if (file_exists($_FILES['json']['tmp_name'])) { + $suc = 0; + $fal = 0; + $json = json_decode(file_get_contents($_FILES['json']['tmp_name']), true); + foreach ($json as $table => $records) { + ORM::raw_execute("TRUNCATE $table;"); + foreach ($records as $rec) { + $t = ORM::for_table($table)->create(); + foreach ($rec as $k => $v) { + if ($k != 'id') { + $t->set($k, $v); + } + } + if ($t->save()) { + $suc++; + } else { + $fal++; + } + } + } + if (file_exists($_FILES['json']['tmp_name'])) unlink($_FILES['json']['tmp_name']); + r2(U . "settings/dbstatus", 's', "Restored $suc success $fal failed"); + } else { + r2(U . "settings/dbstatus", 'e', 'Upload failed'); } - - fclose($f_output); - print(ob_get_clean()); - $mysqli->close(); - break; - case 'language': - if ($admin['user_type'] != 'Admin') { - r2(U . "dashboard", 'e', $_L['Do_Not_Access']); + if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) { + _alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard"); } run_hook('view_add_language'); #HOOK + if (file_exists($lan_file)) { + $ui->assign('langs', json_decode(file_get_contents($lan_file), true)); + } else { + $ui->assign('langs', []); + } $ui->display('language-add.tpl'); break; case 'lang-post': - $name = _post('name'); - $folder = _post('folder'); - $translator = _post('translator'); - - if ($name == '' or $folder == '') { - $msg .= $_L['All_field_is_required'] . '
'; - } - - $d = ORM::for_table('tbl_language')->where('name', $name)->find_one(); - if ($d) { - $msg .= $_L['Lang_already_exist'] . '
'; - } - run_hook('save_language'); #HOOK - if ($msg == '') { - $b = ORM::for_table('tbl_language')->create(); - $b->name = $name; - $b->folder = $folder; - $b->author = $translator; - $b->save(); - - r2(U . 'settings/localisation', 's', $_L['Created_Successfully']); - } else { - r2(U . 'settings/language', 'e', $msg); - } + file_put_contents($lan_file, json_encode($_POST, JSON_PRETTY_PRINT)); + r2(U . 'settings/language', 's', Lang::T('Translation saved Successfully')); break; default: diff --git a/system/controllers/voucher.php b/system/controllers/voucher.php index c491430e..96972f71 100644 --- a/system/controllers/voucher.php +++ b/system/controllers/voucher.php @@ -4,15 +4,13 @@ * by https://t.me/ibnux **/ _auth(); -$ui->assign('_title', $_L['Voucher']); +$ui->assign('_title', Lang::T('Voucher')); $ui->assign('_system_menu', 'voucher'); $action = $routes['1']; $user = User::_info(); $ui->assign('_user', $user); -use PEAR2\Net\RouterOS; - require_once 'system/autoload/PEAR2/Autoload.php'; switch ($action) { @@ -27,31 +25,43 @@ switch ($action) { $v1 = ORM::for_table('tbl_voucher')->where('code', $code)->where('status', 0)->find_one(); run_hook('customer_activate_voucher'); #HOOK if ($v1) { - if (Package::rechargeUser($user['id'], $v1['routers'], $v1['id_plan'], "Activation", "Voucher")) { + if (Package::rechargeUser($user['id'], $v1['routers'], $v1['id_plan'], "Voucher", $code)) { $v1->status = "1"; $v1->user = $user['username']; $v1->save(); - r2(U . "voucher/list-activated", 's', $_L['Activation_Vouchers_Successfully']); + r2(U . "voucher/list-activated", 's', Lang::T('Activation Vouchers Successfully')); } else { r2(U . 'voucher/activation', 'e', "Failed to refill account"); } } else { - r2(U . 'voucher/activation', 'e', $_L['Voucher_Not_Valid']); + r2(U . 'voucher/activation', 'e', Lang::T('Voucher Not Valid')); } break; case 'list-activated': $ui->assign('_system_menu', 'list-activated'); - $paginator = Paginator::build(ORM::for_table('tbl_transactions'), ['username' => $user['username']]); - $d = ORM::for_table('tbl_transactions')->where('username', $user['username'])->offset($paginator['startpoint'])->limit($paginator['limit'])->order_by_desc('id')->find_many(); + $query = ORM::for_table('tbl_transactions')->where('username', $user['username'])->order_by_asc('id'); + $d = Paginator::findMany($query); $ui->assign('d', $d); - $ui->assign('paginator', $paginator); run_hook('customer_view_activation_list'); #HOOK $ui->display('user-activation-list.tpl'); break; - + case 'invoice': + $id = $routes[2]; + if(empty($id)){ + $in = ORM::for_table('tbl_transactions')->where('username', $user['username'])->order_by_desc('id')->find_one(); + }else{ + $in = ORM::for_table('tbl_transactions')->where('username', $user['username'])->where('id', $id)->find_one(); + } + if($in){ + Package::createInvoice($in); + $ui->display('invoice-customer.tpl'); + }else{ + r2(U . 'voucher/list-activated', 'e', Lang::T('Not Found')); + } + break; default: $ui->display('a404.tpl'); } diff --git a/system/cron.php b/system/cron.php index 869b06e6..398c3146 100644 --- a/system/cron.php +++ b/system/cron.php @@ -1,89 +1,11 @@ "; } - -if(!file_exists('../config.php')){ - die("config.php file not found"); -} - - -if(!file_exists('orm.php')){ - die("orm.php file not found"); -} - -if(!file_exists('uploads/notifications.default.json')){ - die("uploads/notifications.default.json file not found"); -} - -require_once '../config.php'; -require_once 'orm.php'; -require_once 'autoload/PEAR2/Autoload.php'; -include "autoload/Hookers.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); - - -// notification message -if (file_exists("uploads/notifications.json")) { - $_notifmsg = json_decode(file_get_contents('uploads/notifications.json'), true); -} -$_notifmsg_default = json_decode(file_get_contents('uploads/notifications.default.json'), true); - -//register all plugin -foreach (glob(File::pathFixer("plugin/*.php")) as $filename) { - include $filename; -} - -$result = ORM::for_table('tbl_appconfig')->find_many(); -foreach ($result as $value) { - $config[$value['setting']] = $value['value']; -} - -if (!empty($radius_user) && $config['radius_enable']) { - ORM::configure("mysql:host=$radius_host;dbname=$radius_name", null, 'radius'); - ORM::configure('username', $radius_user, 'radius'); - ORM::configure('password', $radius_pass, 'radius'); - ORM::configure('driver_options', array(PDO::MYSQL_ATTR_INIT_COMMAND => 'SET NAMES utf8'), 'radius'); - ORM::configure('return_result_sets', true, 'radius'); -} - echo "PHP Time\t" . date('Y-m-d H:i:s') . "\n"; $res = ORM::raw_execute('SELECT NOW() AS WAKTU;'); $statement = ORM::get_last_statement(); @@ -94,7 +16,6 @@ while ($row = $statement->fetch(PDO::FETCH_ASSOC)) { $_c = $config; -date_default_timezone_set($config['timezone']); $textExpired = Lang::getNotifText('expired'); @@ -103,40 +24,49 @@ echo "Found " . count($d) . " user(s)\n"; run_hook('cronjob'); #HOOK foreach ($d as $ds) { - if ($ds['type'] == 'Hotspot') { + if ($ds['type'] == 'Hotspot') { # HOTSPOT $date_now = strtotime(date("Y-m-d H:i:s")); $expiration = strtotime($ds['expiration'] . ' ' . $ds['time']); - echo $ds['expiration'] . " : " . $ds['username']; + echo $ds['expiration'] . " : " . (($isCli) ? $ds['username'] : Lang::maskText($ds['username'])); if ($date_now >= $expiration) { echo " : EXPIRED \r\n"; $u = ORM::for_table('tbl_user_recharges')->where('id', $ds['id'])->find_one(); $c = ORM::for_table('tbl_customers')->where('id', $ds['customer_id'])->find_one(); - $m = ORM::for_table('tbl_routers')->where('name', $ds['routers'])->find_one(); + $m = Mikrotik::info($ds['routers']); $p = ORM::for_table('tbl_plans')->where('id', $u['plan_id'])->find_one(); - + $price = Lang::moneyFormat($p['price']); if ($p['is_radius']) { if (empty($p['pool_expired'])) { print_r(Radius::customerDeactivate($c['username'])); } else { - Radius::upsertCustomerAttr($c['username'], 'Framed-Pool', $plan['pool_expired'], ':='); + Radius::upsertCustomerAttr($c['username'], 'Framed-Pool', $p['pool_expired'], ':='); print_r(Radius::disconnectCustomer($c['username'])); } } else { $client = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']); if (!empty($p['pool_expired'])) { Mikrotik::setHotspotUserPackage($client, $c['username'], 'EXPIRED NUXBILL ' . $p['pool_expired']); + // }if (!empty($p['list_expired'])) { + // $ip = Mikrotik::getIpHotspotUser($client, $ds['username']); + // Mikrotik::addIpToAddressList($client, $ip, $p['list_expired'], $c['username']); } else { Mikrotik::removeHotspotUser($client, $c['username']); } Mikrotik::removeHotspotActiveUser($client, $c['username']); } - Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $u['namebp'], $textExpired, $config['user_notification_expired']); + echo Message::sendPackageNotification($c, $u['namebp'], $price, $textExpired, $config['user_notification_expired']) . "\n"; //update database user dengan status off $u->status = 'off'; $u->save(); // autorenewal from deposit if ($config['enable_balance'] == 'yes' && $c['auto_renewal']) { + list($bills, $add_cost) = User::getBills($ds['customer_id']); + if ($add_cost > 0) { + if (!empty($add_cost)) { + $p['price'] += $add_cost; + } + } if ($p && $p['enabled'] && $c['balance'] >= $p['price']) { if (Package::rechargeUser($ds['customer_id'], $p['routers'], $p['id'], 'Customer', 'Balance')) { // if success, then get the balance @@ -147,7 +77,7 @@ foreach ($d as $ds) { echo "plan enabled: $p[enabled] | User balance: $c[balance] | price $p[price]\n"; echo "auto renewall Failed\n"; Message::sendTelegram("FAILED RENEWAL #cron\n\n#u$c[username] #buy #Hotspot \n" . $p['name_plan'] . - "\nRouter: " . $router_name . + "\nRouter: " . $p['routers'] . "\nPrice: " . $p['price']); } } else { @@ -156,23 +86,24 @@ foreach ($d as $ds) { } else { echo "no renewall | balance $config[enable_balance] auto_renewal $c[auto_renewal]\n"; } - } else echo " : ACTIVE \r\n"; - } else { + } else + echo " : ACTIVE \r\n"; + } else { # PPPOE $date_now = strtotime(date("Y-m-d H:i:s")); $expiration = strtotime($ds['expiration'] . ' ' . $ds['time']); - echo $ds['expiration'] . " : " . $ds['username']; + echo $ds['expiration'] . " : " . (($isCli) ? $ds['username'] : Lang::maskText($ds['username'])); if ($date_now >= $expiration) { echo " : EXPIRED \r\n"; $u = ORM::for_table('tbl_user_recharges')->where('id', $ds['id'])->find_one(); $c = ORM::for_table('tbl_customers')->where('id', $ds['customer_id'])->find_one(); $m = ORM::for_table('tbl_routers')->where('name', $ds['routers'])->find_one(); $p = ORM::for_table('tbl_plans')->where('id', $u['plan_id'])->find_one(); - + $price = Lang::moneyFormat($p['price']); if ($p['is_radius']) { if (empty($p['pool_expired'])) { print_r(Radius::customerDeactivate($c['username'])); } else { - Radius::upsertCustomerAttr($c['username'], 'Framed-Pool', $plan['pool_expired'], ':='); + Radius::upsertCustomerAttr($c['username'], 'Framed-Pool', $p['pool_expired'], ':='); print_r(Radius::disconnectCustomer($c['username'])); } } else { @@ -184,13 +115,19 @@ foreach ($d as $ds) { } Mikrotik::removePpoeActive($client, $c['username']); } - Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $u['namebp'], $textExpired, $config['user_notification_expired']); + echo Message::sendPackageNotification($c, $u['namebp'], $price, $textExpired, $config['user_notification_expired']) . "\n"; $u->status = 'off'; $u->save(); // autorenewal from deposit if ($config['enable_balance'] == 'yes' && $c['auto_renewal']) { + list($bills, $add_cost) = User::getBills($ds['customer_id']); + if ($add_cost > 0) { + if (!empty($add_cost)) { + $p['price'] += $add_cost; + } + } if ($p && $p['enabled'] && $c['balance'] >= $p['price']) { if (Package::rechargeUser($ds['customer_id'], $p['routers'], $p['id'], 'Customer', 'Balance')) { // if success, then get the balance @@ -201,11 +138,12 @@ foreach ($d as $ds) { echo "plan enabled: $p[enabled] | User balance: $c[balance] | price $p[price]\n"; echo "auto renewall Failed\n"; Message::sendTelegram("FAILED RENEWAL #cron\n\n#u$c[username] #buy #PPPOE \n" . $p['name_plan'] . - "\nRouter: " . $router_name . + "\nRouter: " . $p['routers'] . "\nPrice: " . $p['price']); } } } - } else echo " : ACTIVE \r\n"; + } else + echo " : ACTIVE \r\n"; } } diff --git a/system/cron_reminder.php b/system/cron_reminder.php index 1b77aac8..44d101ef 100644 --- a/system/cron_reminder.php +++ b/system/cron_reminder.php @@ -7,76 +7,14 @@ * 0 7 * * * /usr/bin/php /var/www/system/cron_reminder.php **/ -// on some server, it getting error because of slash is backwards -function _autoloader($class) -{ - if (strpos($class, '_') !== false) { - $class = str_replace('_', DIRECTORY_SEPARATOR, $class); - if (file_exists(__DIR__ . DIRECTORY_SEPARATOR . 'autoload' . DIRECTORY_SEPARATOR . $class . '.php')) { - include __DIR__ . DIRECTORY_SEPARATOR . 'autoload' . DIRECTORY_SEPARATOR . $class . '.php'; - } else { - $class = str_replace("\\", DIRECTORY_SEPARATOR, $class); - if (file_exists(__DIR__ . DIRECTORY_SEPARATOR . 'autoload' . DIRECTORY_SEPARATOR . $class . '.php')) - include __DIR__ . DIRECTORY_SEPARATOR . 'autoload' . DIRECTORY_SEPARATOR . $class . '.php'; - } - } else { - if (file_exists(__DIR__ . DIRECTORY_SEPARATOR . 'autoload' . DIRECTORY_SEPARATOR . $class . '.php')) { - include __DIR__ . DIRECTORY_SEPARATOR . 'autoload' . DIRECTORY_SEPARATOR . $class . '.php'; - } else { - $class = str_replace("\\", DIRECTORY_SEPARATOR, $class); - if (file_exists(__DIR__ . DIRECTORY_SEPARATOR . 'autoload' . DIRECTORY_SEPARATOR . $class . '.php')) - include __DIR__ . DIRECTORY_SEPARATOR . 'autoload' . DIRECTORY_SEPARATOR . $class . '.php'; - } - } -} -spl_autoload_register('_autoloader'); +include "../init.php"; -if(php_sapi_name() !== 'cli'){ +$isCli = true; +if (php_sapi_name() !== 'cli') { + $isCli = false; echo "
";
 }
 
-if(!file_exists('../config.php')){
-    die("config.php file not found");
-}
-
-
-if(!file_exists('orm.php')){
-    die("orm.php file not found");
-}
-
-if(!file_exists('uploads/notifications.default.json')){
-    die("uploads/notifications.default.json file not found");
-}
-
-require_once '../config.php';
-require_once 'orm.php';
-require_once 'autoload/PEAR2/Autoload.php';
-include "autoload/Hookers.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);
-
-// notification message
-if (file_exists("uploads/notifications.json")) {
-    $_notifmsg = json_decode(file_get_contents('uploads/notifications.json'), true);
-}
-$_notifmsg_default = json_decode(file_get_contents('uploads/notifications.default.json'), true);
-
-//register all plugin
-foreach (glob(File::pathFixer("plugin/*.php")) as $filename) {
-    include $filename;
-}
-
-$result = ORM::for_table('tbl_appconfig')->find_many();
-foreach ($result as $value) {
-    $config[$value['setting']] = $value['value'];
-}
-date_default_timezone_set($config['timezone']);
-
-
 $d = ORM::for_table('tbl_user_recharges')->where('status', 'on')->find_many();
 
 run_hook('cronjob_reminder'); #HOOK
@@ -98,13 +36,31 @@ print_r([$day1, $day3, $day7]);
 foreach ($d as $ds) {
     if (in_array($ds['expiration'], [$day1, $day3, $day7])) {
         $u = ORM::for_table('tbl_user_recharges')->where('id', $ds['id'])->find_one();
+        $p = ORM::for_table('tbl_plans')->where('id', $u['plan_id'])->find_one();
         $c = ORM::for_table('tbl_customers')->where('id', $ds['customer_id'])->find_one();
+        list($bills, $add_cost) = User::getBills($ds['customer_id']);
+        if ($add_cost > 0) {
+            if (!empty($add_cost)) {
+                $p['price'] += $add_cost;
+            }
+        }
+		if ($p['validity_unit'] == 'Period') {
+			// Postpaid price from field
+			$add_inv = User::getAttribute("Invoice", $ds['customer_id']);
+			if (empty ($add_inv) or $add_inv == 0) {
+				$price = Lang::moneyFormat($p['price']);
+			} else {
+				$price = Lang::moneyFormat($add_inv);
+			}
+        } else {
+                $price = Lang::moneyFormat($p['price']);
+        }
         if ($ds['expiration'] == $day7) {
-            echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $u['namebp'], Lang::getNotifText('reminder_7_day'), $config['user_notification_reminder']) . "\n";
+            echo Message::sendPackageNotification($c, $p['name_plan'], $price, Lang::getNotifText('reminder_7_day'), $config['user_notification_reminder']) . "\n";
         } else if ($ds['expiration'] == $day3) {
-            echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $u['namebp'], Lang::getNotifText('reminder_3_day'), $config['user_notification_reminder']) . "\n";
+            echo Message::sendPackageNotification($c, $p['name_plan'], $price, Lang::getNotifText('reminder_3_day'), $config['user_notification_reminder']) . "\n";
         } else if ($ds['expiration'] == $day1) {
-            echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $u['namebp'], Lang::getNotifText('reminder_1_day'), $config['user_notification_reminder']) . "\n";
+            echo Message::sendPackageNotification($c, $p['name_plan'], $price, Lang::getNotifText('reminder_1_day'), $config['user_notification_reminder']) . "\n";
         }
     }
 }
diff --git a/system/lan/country.json b/system/lan/country.json
new file mode 100644
index 00000000..f9f798bd
--- /dev/null
+++ b/system/lan/country.json
@@ -0,0 +1,59 @@
+{
+    "english": "en",
+    "indonesia": "id",
+    "spanish": "es",
+    "turkish": "tr",
+    "amharic": "am",
+    "arabic": "ar",
+    "basque": "eu",
+    "bengali": "bn",
+    "english-uk": "en-gb",
+    "portuguese-brazil": "pt-br",
+    "bulgarian": "bg",
+    "catalan": "ca",
+    "cherokee": "chr",
+    "croatian": "hr",
+    "czech": "cs",
+    "danish": "da",
+    "dutch": "nl",
+    "estonian": "et",
+    "filipino": "fil",
+    "finnish": "fi",
+    "french": "fr",
+    "german": "de",
+    "greek": "el",
+    "gujarati": "gu",
+    "hebrew": "iw",
+    "hindi": "hi",
+    "hungarian": "hu",
+    "iran": "ir",
+    "icelandic": "is",
+    "italian": "it",
+    "japanese": "ja",
+    "kannada": "kn",
+    "korean": "ko",
+    "latvian": "lv",
+    "lithuanian": "lt",
+    "malay": "ms",
+    "malayalam": "ml",
+    "marathi": "mr",
+    "norwegian": "no",
+    "polish": "pl",
+    "portuguese (portugal)": "pt-pt",
+    "romanian": "ro",
+    "russian": "ru",
+    "serbian": "sr",
+    "chinese (prc)": "zh-cn",
+    "slovak": "sk",
+    "slovenian": "sl",
+    "swahili": "sw",
+    "swedish": "sv",
+    "tamil": "ta",
+    "telugu": "te",
+    "thai": "th",
+    "chinese-taiwan": "zh-tw",
+    "urdu": "ur",
+    "ukrainian": "uk",
+    "vietnamese": "vi",
+    "welsh": "cy"
+}
diff --git a/system/lan/english.json b/system/lan/english.json
new file mode 100644
index 00000000..d099d8cb
--- /dev/null
+++ b/system/lan/english.json
@@ -0,0 +1,540 @@
+{
+    "Log_in": "Log-in",
+    "Register": "Register",
+    "Announcement": "Announcement",
+    "Registration_Info": "Registration Info",
+    "Voucher_not_found__please_buy_voucher_befor_register": "Voucher not found, please buy voucher befor register",
+    "Register_Success__You_can_login_now": "Register Success! You can login now",
+    "Log_in_to_Member_Panel": "Log in to Member Panel",
+    "Register_as_Member": "Register as Member",
+    "Enter_Admin_Area": "Enter Admin Area",
+    "PHPNuxBill": "PHPNuxBill",
+    "Username": "Username",
+    "Password": "Password",
+    "Passwords_does_not_match": "Passwords does not match",
+    "Account_already_axist": "Account already axist",
+    "Manage": "Manage",
+    "Submit": "Submit",
+    "Save_Changes": "Save Changes",
+    "Cancel": "Cancel",
+    "Edit": "Edit",
+    "Delete": "Delete",
+    "Welcome": "Welcome",
+    "Data_Created_Successfully": "Data Created Successfully",
+    "Data_Updated_Successfully": "Data Updated Successfully",
+    "Data_Deleted_Successfully": "Data Deleted Successfully",
+    "Static_Pages": "Static Pages",
+    "Failed_to_save_page__make_sure_i_can_write_to_folder_pages___i_chmod_664_pages___html_i_": "Failed to save page, make sure i can write to folder pages, chmod 664 pages\/*.html",
+    "Saving_page_success": "Saving page success",
+    "Sometimes_you_need_to_refresh_3_times_until_content_change": "Sometimes you need to refresh 3 times until content change",
+    "Dashboard": "Dashboard",
+    "Search_Customers___": "Search Customers...",
+    "My_Account": "My Account",
+    "My_Profile": "My Profile",
+    "Settings": "Settings",
+    "Edit_Profile": "Edit Profile",
+    "Change_Password": "Change Password",
+    "Logout": "Logout",
+    "Services": "Services",
+    "Bandwidth_Plans": "Bandwidth Plans",
+    "Bandwidth_Name": "Bandwidth Name",
+    "New_Bandwidth": "New Bandwidth",
+    "Edit_Bandwidth": "Edit Bandwidth",
+    "Add_New_Bandwidth": "Add New Bandwidth",
+    "Rate_Download": "Rate Download",
+    "Rate_Upload": "Rate Upload",
+    "Name_Bandwidth_Already_Exist": "Name Bandwidth Already Exist",
+    "Hotspot_Plans": "Hotspot Plans",
+    "PPPOE_Plans": "PPPOE Plans",
+    "Plan_Name": "Plan Name",
+    "New_Service_Plan": "New Service Plan",
+    "Add_Service_Plan": "Add Service Plan",
+    "Edit_Service_Plan": "Edit Service Plan",
+    "Name_Plan_Already_Exist": "Name Plan Already Exist",
+    "Plan_Type": "Plan Type",
+    "Plan_Price": "Plan Price",
+    "Limit_Type": "Limit Type",
+    "Unlimited": "Unlimited",
+    "Limited": "Limited",
+    "Time_Limit": "Time Limit",
+    "Data_Limit": "Data Limit",
+    "Both_Limit": "Both Limit",
+    "Plan_Validity": "Plan Validity",
+    "Select_Bandwidth": "Select Bandwidth",
+    "Shared_Users": "Shared Users",
+    "Choose_User_Type_Sales_to_disable_access_to_Settings": "Choose User Type Sales to disable access to Settings",
+    "Current_Password": "Current Password",
+    "New_Password": "New Password",
+    "Administrator": "Administrator",
+    "Sales": "Sales",
+    "Member": "Member",
+    "Confirm_New_Password": "Confirm New Password",
+    "Confirm_Password": "Confirm Password",
+    "Full_Name": "Full Name",
+    "User_Type": "User Type",
+    "Address": "Address",
+    "Created_On": "Created On",
+    "Expires_On": "Expires On",
+    "Phone_Number": "Phone Number",
+    "User_deleted_Successfully": "User deleted Successfully",
+    "Full_Administrator": "Full Administrator",
+    "Keep_Blank_to_do_not_change_Password": "Keep Blank to do not change Password",
+    "Keep_it_blank_if_you_do_not_want_to_show_currency_code": "Keep it blank if you do not want to show currency code",
+    "Theme_Style": "Theme Style",
+    "Theme_Color": "Theme Color",
+    "Default_Language": "Default Language",
+    "Network": "Network",
+    "Routers": "Routers",
+    "IP_Pool": "IP Pool",
+    "New_Router": "New Router",
+    "Add_Router": "Add Router",
+    "Edit_Router": "Edit Router",
+    "Router_Name": "Router Name",
+    "IP_Address": "IP Address",
+    "Router_Secret": "Router Secret",
+    "Description": "Description",
+    "IP_Router_Already_Exist": "IP Router Already Exist",
+    "Name_Pool": "Name Pool",
+    "Range_IP": "Range IP",
+    "New_Pool": "New Pool",
+    "Add_Pool": "Add Pool",
+    "Edit_Pool": "Edit Pool",
+    "Pool_Name_Already_Exist": "Pool Name Already Exist",
+    "Refill_Account": "Refill Account",
+    "Recharge_Account": "Recharge Account",
+    "Select_Account": "Select Account",
+    "Service_Plan": "Service Plan",
+    "Recharge": "Recharge",
+    "Method": "Method",
+    "Account_Created_Successfully": "Account Created Successfully",
+    "Database_Status": "Database Status",
+    "Total_Database_Size": "Total Database Size",
+    "Download_Database_Backup": "Download Database Backup",
+    "Table_Name": "Table Name",
+    "Rows": "Rows",
+    "Size": "Size",
+    "Customer": "Customer",
+    "Add_New_Contact": "Add New Contact",
+    "Edit_Contact": "Edit Contact",
+    "List_Contact": "List Contact",
+    "Manage_Contact": "Manage Contact",
+    "Reports": "Reports",
+    "Daily_Reports": "Daily Reports",
+    "Period_Reports": "Period Reports",
+    "All_Transactions": "All Transactions",
+    "Total_Income": "Total Income",
+    "All_Transactions_at_Date": "All Transactions at Date",
+    "Export_for_Print": "Export for Print",
+    "Print": "Print",
+    "Export_to_PDF": "Export to PDF",
+    "Click_Here_to_Print": "Click Here to Print",
+    "You_can_use_html_tag": "You can use html tag",
+    "Date_Format": "Date Format",
+    "Income_Today": "Income Today",
+    "Income_This_Month": "Income This Month",
+    "Users_Active": "Users Active",
+    "Total_Users": "Total Users",
+    "Users": "Users",
+    "Edit_User": "Edit User",
+    "Last_Login": "Last Login",
+    "Administrator_Users": "Administrator Users",
+    "Manage_Administrator": "Manage Administrator",
+    "Add_New_Administrator": "Add New Administrator",
+    "Localisation": "Localisation",
+    "Backup_Restore": "Backup\/Restore",
+    "General_Settings": "General Settings",
+    "Date": "Date",
+    "Login_Successful": "Login Successful",
+    "Failed_Login": "Failed Login",
+    "Settings_Saved_Successfully": "Settings Saved Successfully",
+    "User_Updated_Successfully": "User Updated Successfully",
+    "User_Expired__Today": "User Expired, Today",
+    "Activity_Log": "Activity Log",
+    "View_Reports": "View Reports",
+    "View_All": "View All",
+    "Number_of_Vouchers": "Number of Vouchers",
+    "Length_Code": "Length Code",
+    "Code_Voucher": "Code Voucher",
+    "Voucher": "Voucher",
+    "Hotspot_Voucher": "Hotspot Voucher",
+    "Status_Voucher": "Status Voucher",
+    "Add_Vouchers": "Add Vouchers",
+    "Create_Vouchers_Successfully": "Create Vouchers Successfully",
+    "Generate": "Generate",
+    "Print_side_by_side__it_will_easy_to_cut": "Print side by side, it will easy to cut",
+    "From_Date": "From Date",
+    "To_Date": "To Date",
+    "New_Service": "New Service",
+    "Type": "Type",
+    "Finish": "Finish",
+    "Application_Name__Company_Name": "Application Name\/ Company Name",
+    "This_Name_will_be_shown_on_the_Title": "This Name will be shown on the Title",
+    "Next": "Next",
+    "Last": "Last",
+    "Timezone": "Timezone",
+    "Decimal_Point": "Decimal Point",
+    "Thousands_Separator": "Thousands Separator",
+    "Currency_Code": "Currency Code",
+    "Order_Voucher": "Order Voucher",
+    "Voucher_Activation": "Voucher Activation",
+    "List_Activated_Voucher": "List Activated Voucher",
+    "Enter_voucher_code_here": "Enter voucher code here",
+    "Private_Message": "Private Message",
+    "Inbox": "Inbox",
+    "Outbox": "Outbox",
+    "Compose": "Compose",
+    "Send_to": "Send to",
+    "Title": "Title",
+    "Message": "Message",
+    "Your_Account_Information": "Your Account Information",
+    "Welcome_to_the_Panel_Members_page__on_this_page_you_can_": "Welcome to the Panel Members page, on this page you can:",
+    "Invalid_Username_or_Password": "Invalid Username or Password",
+    "You_do_not_have_permission_to_access_this_page": "You do not have permission to access this page",
+    "Incorrect_Current_Password": "Incorrect Current Password",
+    "Password_changed_successfully__Please_login_again": "Password changed successfully, Please login again",
+    "All_field_is_required": "All field is required",
+    "Voucher_Not_Valid": "Voucher Not Valid",
+    "Activation_Vouchers_Successfully": "Activation Vouchers Successfully",
+    "Data_Not_Found": "Data Not Found",
+    "Search_by_Username": "Search by Username",
+    "Search_by_Name": "Search by Name",
+    "Search_by_Code_Voucher": "Search by Code Voucher",
+    "Search": "Search",
+    "Select_a_customer": "Select a customer",
+    "Select_Routers": "Select Routers",
+    "Select_Plans": "Select Plans",
+    "Select_Pool": "Select Pool",
+    "Hrs": "Hrs",
+    "Mins": "Mins",
+    "Days": "Days",
+    "Months": "Months",
+    "Add_Language": "Add Language",
+    "Language_Name": "Language Name",
+    "Folder_Name": "Folder Name",
+    "Translator": "Translator",
+    "Language_Name_Already_Exist": "Language Name Already Exist",
+    "Payment_Gateway": "Payment Gateway",
+    "Community": "Community",
+    "1_user_can_be_used_for_many_devices_": "1 user can be used for many devices?",
+    "Cannot_be_change_after_saved": "Cannot be change after saved",
+    "Explain_Coverage_of_router": "Explain Coverage of router",
+    "Name_of_Area_that_router_operated": "Name of Area that router operated",
+    "Payment_Notification_URL__Recurring_Notification_URL__Pay_Account_Notification_URL": "Payment Notification URL, Recurring Notification URL, Pay Account Notification URL",
+    "Finish_Redirect_URL__Unfinish_Redirect_URL__Error_Redirect_URL": "Finish Redirect URL, Unfinish Redirect URL, Error Redirect URL",
+    "Status": "Status",
+    "Plan_Not_found": "Plan Not found",
+    "Failed_to_create_transaction_": "Failed to create transaction.",
+    "Seller_has_not_yet_setup_Xendit_payment_gateway": "Seller has not yet setup Xendit payment gateway",
+    "Admin_has_not_yet_setup_Xendit_payment_gateway__please_tell_admin": "Admin has not yet setup Xendit payment gateway, please tell admin",
+    "You_already_have_unpaid_transaction__cancel_it_or_pay_it_": "You already have unpaid transaction, cancel it or pay it.",
+    "Transaction_Not_found": "Transaction Not found",
+    "Cancel_it_": "Cancel it?",
+    "expired": "expired",
+    "Check_for_Payment": "Check for Payment",
+    "Transaction_still_unpaid_": "Transaction still unpaid.",
+    "Paid_Date": "Paid Date",
+    "Transaction_has_been_paid_": "Transaction has been paid.",
+    "PAID": "PAID",
+    "CANCELED": "CANCELED",
+    "UNPAID": "UNPAID",
+    "PAY_NOW": "PAY NOW",
+    "Buy_Hotspot_Plan": "Buy Hotspot Plan",
+    "Buy_PPOE_Plan": "Buy PPOE Plan",
+    "Package": "Package",
+    "Order_Internet_Package": "Order Internet Package",
+    "Unknown_Command_": "Unknown Command.",
+    "Checking_payment": "Checking payment",
+    "Create_Transaction_Success": "Create Transaction Success",
+    "You_have_unpaid_transaction": "You have unpaid transaction",
+    "TripayPayment_Channel": "TripayPayment Channel",
+    "Payment_Channel": "Payment Channel",
+    "Payment_check_failed_": "Payment check failed.",
+    "Order_Package": "Order Package",
+    "Transactions": "Transactions",
+    "Payments": "Payments",
+    "History": "History",
+    "Order_History": "Order History",
+    "Gateway": "Gateway",
+    "Date_Done": "Date Done",
+    "Unpaid_Order": "Unpaid Order",
+    "Payment_Gateway_Not_Found": "Payment Gateway Not Found",
+    "Payment_Gateway_saved_successfully": "Payment Gateway saved successfully",
+    "ORDER": "ORDER",
+    "Package_History": "Package History",
+    "Buy_History": "Buy History",
+    "Activation_History": "Activation History",
+    "Buy_Package": "Buy Package",
+    "Email": "Email",
+    "Company_Footer": "Company Footer",
+    "Will_show_below_user_pages": "Will show below user pages",
+    "Request_OTP": "Request OTP",
+    "Verification_Code": "Verification Code",
+    "SMS_Verification_Code": "SMS Verification Code",
+    "Please_enter_your_email_address": "Please enter your email address",
+    "Failed_to_create_Paypal_transaction_": "Failed to create Paypal transaction.",
+    "Plugin": "Plugin",
+    "Plugin_Manager": "Plugin Manager",
+    "User_Notification": "User Notification",
+    "Expired_Notification": "Expired Notification",
+    "User_will_get_notification_when_package_expired": "User will get notification when package expired",
+    "Expired_Notification_Message": "Expired Notification Message",
+    "Payment_Notification": "Payment Notification",
+    "User_will_get_invoice_notification_when_buy_package_or_package_refilled": "User will get invoice notification when buy package or package refilled",
+    "Current_IP": "Current IP",
+    "Current_MAC": "Current MAC",
+    "Login_Status": "Login Status",
+    "Login_Request_successfully": "Login Request successfully",
+    "Logout_Request_successfully": "Logout Request successfully",
+    "Disconnect_Internet_": "Disconnect Internet?",
+    "Not_Online__Login_now_": "Not Online, Login now?",
+    "You_are_Online__Logout_": "You are Online, Logout?",
+    "Connect_to_Internet_": "Connect to Internet?",
+    "Your_account_not_connected_to_internet": "Your account not connected to internet",
+    "Failed_to_create_transaction__": "Failed to create transaction. ",
+    "Failed_to_check_status_transaction__": "Failed to check status transaction. ",
+    "Disable_Voucher": "Disable Voucher",
+    "Balance": "Balance",
+    "Balance_System": "Balance System",
+    "Enable_System": "Enable System",
+    "Allow_Transfer": "Allow Transfer",
+    "Telegram_Notification": "Telegram Notification",
+    "SMS_OTP_Registration": "SMS OTP Registration",
+    "Whatsapp_Notification": "Whatsapp Notification",
+    "Tawk_to_Chat_Widget": "Tawk.to Chat Widget",
+    "Invoice": "Invoice",
+    "Country_Code_Phone": "Country Code Phone",
+    "Voucher_activation_menu_will_be_hidden": "Voucher activation menu will be hidden",
+    "Customer_can_deposit_money_to_buy_voucher": "Customer can deposit money to buy voucher",
+    "Allow_balance_transfer_between_customers": "Allow balance transfer between customers",
+    "Reminder_Notification": "Reminder Notification",
+    "Reminder_Notification_Message": "Reminder Notification Message",
+    "Reminder_7_days": "Reminder 7 days",
+    "Reminder_3_days": "Reminder 3 days",
+    "Reminder_1_day": "Reminder 1 day",
+    "PPPOE_Password": "PPPOE Password",
+    "User_Cannot_change_this__only_admin__if_it_Empty_it_will_use_user_password": "User Cannot change this, only admin. if it Empty it will use user password",
+    "Invoice_Balance_Message": "Invoice Balance Message",
+    "Invoice_Notification_Payment": "Invoice Notification Payment",
+    "Balance_Notification_Payment": "Balance Notification Payment",
+    "Balance_Plans": "Balance Plans",
+    "Buy_Balance": "Buy Balance",
+    "Price": "Price",
+    "Validity": "Validity",
+    "Disable_auto_renewal_": "Disable auto renewal?",
+    "Auto_Renewal_On": "Auto Renewal On",
+    "Enable_auto_renewal_": "Enable auto renewal?",
+    "Auto_Renewal_Off": "Auto Renewal Off",
+    "Refill_Balance": "Refill Balance",
+    "Invoice_Footer": "Invoice Footer",
+    "Pay_With_Balance": "Pay With Balance",
+    "Pay_this_with_Balance__your_active_package_will_be_overwrite": "Pay this with Balance? your active package will be overwrite",
+    "Success_to_buy_package": "Success to buy package",
+    "Auto_Renewal": "Auto Renewal",
+    "View": "View",
+    "Back": "Back",
+    "Active": "Active",
+    "Transfer_Balance": "Transfer Balance",
+    "Send_your_balance_": "Send your balance?",
+    "Send": "Send",
+    "Cannot_send_to_yourself": "Cannot send to yourself",
+    "Sending_balance_success": "Sending balance success",
+    "From": "From",
+    "To": "To",
+    "insufficient_balance": "insufficient balance",
+    "Send_Balance": "Send Balance",
+    "Received_Balance": "Received Balance",
+    "Minimum_Balance_Transfer": "Minimum Balance Transfer",
+    "Minimum_Transfer": "Minimum Transfer",
+    "Company_Logo": "Company Logo",
+    "Expired_IP_Pool": "Expired IP Pool",
+    "Proxy": "Proxy",
+    "Proxy_Server": "Proxy Server",
+    "Proxy_Server_Login": "Proxy Server Login",
+    "Hotspot_Plan": "Hotspot Plan",
+    "PPPOE_Plan": "PPPOE Plan",
+    "UNKNOWN": "UNKNOWN",
+    "Are_You_Sure_": "Are You Sure?",
+    "Success_to_send_package": "Success to send package",
+    "Target_has_active_plan__different_with_current_plant_": "Target has active plan, different with current plant.",
+    "Recharge_a_friend": "Recharge a friend",
+    "Buy_for_friend": "Buy for friend",
+    "Buy_this_for_friend_account_": "Buy this for friend account?",
+    "Review_package_before_recharge": "Review package before recharge",
+    "Activate": "Activate",
+    "Deactivate": "Deactivate",
+    "Sync": "Sync",
+    "Failed_to_create_PaymeTrust_transaction_": "Failed to create PaymeTrust transaction.",
+    "Location": "Location",
+    "Radius_Plans": "Radius Plans",
+    "Change_title_in_user_Plan_order": "Change title in user Plan order",
+    "Logs": "Logs",
+    "Voucher_Format": "Voucher Format",
+    "Resend_To_Customer": "Resend To Customer",
+    "Your_friend_do_not_have_active_package": "Your friend do not have active package",
+    "Service_Type": "Service Type",
+    "Others": "Others",
+    "PPPoE": "PPPoE",
+    "Hotspot": "Hotspot",
+    "Disable_Registration": "Disable Registration",
+    "Customer_just_Login_with_Phone_number_and_Voucher_Code__Voucher_will_be_password": "Customer just Login with Phone number and Voucher Code, Voucher will be password",
+    "Login___Activate_Voucher": "Login \/ Activate Voucher",
+    "After_Customer_activate_voucher_or_login__customer_will_be_redirected_to_this_url": "After Customer activate voucher or login, customer will be redirected to this url",
+    "Voucher_Prefix": "Voucher Prefix",
+    "Voucher_activation_success__now_you_can_login": "Voucher activation success, now you can login",
+    "Buy_this__your_active_package_will_be_overwritten": "Buy this? your active package will be overwritten",
+    "Pay_this_with_Balance__your_active_package_will_be_overwritten": "Pay this with Balance? your active package will be overwritten",
+    "Buy_this__your_active_package_will_be_overwrite": "Buy this? your active package will be overwrite",
+    "Monthly_Registered_Customers": "Monthly Registered Customers",
+    "Total_Monthly_Sales": "Total Monthly Sales",
+    "Active_Users": "Active Users",
+    "All_Users_Insights": "All Users Insights",
+    "SuperAdmin": "Super Admin",
+    "Radius": "Radius",
+    "Radius_NAS": "Radius NAS",
+    "Translation": "Translation",
+    "Translation_saved_Successfully": "Translation saved Successfully",
+    "Language_Editor": "Language Editor",
+    "year": "year",
+    "month": "month",
+    "week": "week",
+    "day": "day",
+    "hour": "hour",
+    "minute": "minute",
+    "second": "second",
+    "Attributes": "Attributes",
+    "Profile": "Profile",
+    "Phone": "Phone",
+    "City": "City",
+    "Sub_District": "Sub District",
+    "Ward": "Ward",
+    "Credentials": "Credentials",
+    "Agent": "Agent",
+    "This_Token_will_act_as_SuperAdmin_Admin": "This Token will act as SuperAdmin\/Admin",
+    "Login": "Login",
+    "Expired_Action": "Expired Action",
+    "Expired_Address_List_Name": "Expired Address List Name",
+    "Address_List": "Address List",
+    "Optional": "Optional",
+    "Generated_By": "Generated By",
+    "Admin": "Admin",
+    "Password_should_be_minimum_6_characters": "Password should be minimum 6 characters",
+    "Add_User": "Add User",
+    "Send_Notification": "Send Notification",
+    "Code": "Code",
+    "Send_To_Customer": "Send To Customer",
+    "Prev": "Prev",
+    "Voucher_Not_Found": "Voucher Not Found",
+    "Miscellaneous": "Miscellaneous",
+    "OTP_Required": "OTP Required",
+    "Change": "Change",
+    "Change_Phone_Number": "Change Phone Number",
+    "Current_Number": "Current Number",
+    "New_Number": "New Number",
+    "Input_your_phone_number": "Input your phone number",
+    "OTP": "OTP",
+    "Enter_OTP_that_was_sent_to_your_phone": "Enter OTP that was sent to your phone",
+    "Update": "Update",
+    "OTP_is_required_when_user_want_to_change_phone_number": "OTP is required when user want to change phone number",
+    "Rate": "Rate",
+    "Burst": "Burst",
+    "Editing_Bandwidth_will_not_automatically_update_the_plan__you_need_to_edit_the_plan_then_save_again": "Editing Bandwidth will not automatically update the plan, you need to edit the plan then save again",
+    "OTP_Method": "OTP Method",
+    "SMS": "SMS",
+    "WhatsApp": "WhatsApp",
+    "SMS_and_WhatsApp": "SMS and WhatsApp",
+    "The_method_which_OTP_will_be_sent_to_user": "The method which OTP will be sent to user",
+    "Report_Viewer": "Report Viewer",
+    "Super_Administrator": "Super Administrator",
+    "Send_To": "Send To",
+    "Resend": "Resend",
+    "Alert": "Alert",
+    "success": "success",
+    "Click_Here": "Click Here",
+    "danger": "danger",
+    "Logout_Successful": "Logout Successful",
+    "warning": "warning",
+    "Users_Announcement": "Users Announcement",
+    "Customer_Announcement": "Customer Announcement",
+    "1_Period___1_Month__Expires_the_20th_of_each_month": "1 Period = 1 Month, Expires the 20th of each month",
+    "Period": "Period",
+    "Add": "Add",
+    "Select_Payment_Gateway": "Select Payment Gateway",
+    "Available_Payment_Gateway": "Available Payment Gateway",
+    "Pay_Now": "Pay Now",
+    "Please_select_Payment_Gateway": "Please select Payment Gateway",
+    "Payment_Gateway_Deleted": "Payment Gateway Deleted",
+    "Payment_Gateway_not_set__please_set_it_in_Settings": "Payment Gateway not set, please set it in Settings",
+    "Failed_to_create_Transaction__": "Failed to create Transaction..",
+    "Show_To_Customer": "Type",
+    "Using": "Using",
+    "Default": "Default",
+    "Customer_Balance": "Customer Balance",
+    "Vouchers": "Vouchers",
+    "Refill_Customer": "Refill Customer",
+    "Recharge_Customer": "Recharge Customer",
+    "Plans": "Plans",
+    "PPPOE": "PPPOE",
+    "Bandwidth": "Bandwidth",
+    "Customers": "Customers",
+    "Actives": "Actives",
+    "Name": "Name",
+    "Confirm": "Confirm",
+    "Plan": "Plan",
+    "Total": "Total",
+    "Current_Cycle": "Current Cycle",
+    "Additional_Cost": "Additional Cost",
+    "Remaining": "Remaining",
+    "Not_Found": "Not Found",
+    "Cash": "Cash",
+    "Payment_not_found": "Payment not found",
+    "If_your_friend_have_Additional_Cost__you_will_pay_for_that_too": "If your friend have Additional Cost, you will pay for that too",
+    "Cache_cleared_successfully_": "Cache cleared successfully!",
+    "Paid": "Paid",
+    "Send_Message": "Send Message",
+    "Send_Personal_Message": "Send Personal Message",
+    "Send_Via": "Send Via",
+    "Compose_your_message___": "Compose your message...",
+    "Use_placeholders_": "Use placeholders:",
+    "Customer_Name": "Customer Name",
+    "Customer_Username": "Customer Username",
+    "Customer_Phone": "Customer Phone",
+    "Your_Company_Name": "Your Company Name",
+    "Message_Sent_Successfully": "Message Sent Successfully",
+    "Send_Bulk_Message": "Send Bulk Message",
+    "Group": "Group",
+    "All_Customers": "All Customers",
+    "New_Customers": "New Customers",
+    "Expired_Customers": "Expired Customers",
+    "Active_Customers": "Active Customers",
+    "Map": "Map",
+    "Customer_Location": "Customer Location",
+    "Account_Type": "Account Type",
+    "Coordinates": "Coordinates",
+    "Latitude_and_Longitude_coordinates_for_map_must_be_separate_with_comma____": "Latitude and Longitude coordinates for map must be separate with comma ","",
+    "Customer_Geo_Location_Information": "Customer Geo Location Information",
+    "List": "List",
+    "Lists": "Lists",
+    "Single_Customer": "Single Customer",
+    "Bulk_Customers": "Bulk Customers",
+    "Message_per_time": "Message per time",
+    "5_Messages": "5 Messages",
+    "10_Messages": "10 Messages",
+    "15_Messages": "15 Messages",
+    "20_Messages": "20 Messages",
+    "30_Messages": "30 Messages",
+    "40_Messages": "40 Messages",
+    "50_Messages": "50 Messages",
+    "60_Messages": "60 Messages",
+    "Use_20_and_above_if_you_are_sending_to_all_customers_to_avoid_server_time_out": "Use 20 and above if you are sending to all customers to avoid server time out",
+    "Delay": "Delay",
+    "No_Delay": "No Delay",
+    "5_Seconds": "5 Seconds",
+    "10_Seconds": "10 Seconds",
+    "15_Seconds": "15 Seconds",
+    "20_Seconds": "20 Seconds",
+    "Use_at_least_5_secs_if_you_are_sending_to_all_customers_to_avoid_being_banned_by_your_message_provider": "Use at least 5 secs if you are sending to all customers to avoid being banned by your message provider",
+    "Testing__if_checked_no_real_message_is_sent_": "Testing [if checked no real message is sent]",
+    "All_fields_are_required": "All fields are required",
+    "Personal": "Personal",
+    "Email_Notification": "Email Notification"
+}
\ No newline at end of file
diff --git a/system/lan/english/common.lan.php b/system/lan/english/common.lan.php
deleted file mode 100644
index 8a4fae6f..00000000
--- a/system/lan/english/common.lan.php
+++ /dev/null
@@ -1,410 +0,0 @@
-chmod 664 pages/*.html";
-$_L['Success_Save_Page'] = "Saving page success";
-$_L['Info_Page'] = "Sometimes you need to refresh 3 times until content change";
-
-$_L['Dashboard'] = 'Dashboard';
-$_L['Search_Contact'] = 'Search Customers...';
-$_L['My_Account'] = 'My Account';
-$_L['My_Profile'] = 'My Profile';
-$_L['Settings'] = 'Settings';
-$_L['Edit_Profile'] = 'Edit Profile';
-$_L['Change_Password'] = 'Change Password';
-$_L['Logout'] = 'Logout';
-
-$_L['Services'] = 'Services';
-$_L['Bandwidth_Plans'] = 'Bandwidth Plans';
-$_L['BW_Name'] = 'Bandwidth Name';
-$_L['New_Bandwidth'] = 'New Bandwidth';
-$_L['Edit_Bandwidth'] = 'Edit Bandwidth';
-$_L['Add_Bandwidth'] = 'Add New Bandwidth';
-$_L['Rate_Download'] = 'Rate Download';
-$_L['Rate_Upload'] = 'Rate Upload';
-$_L['BW_already_exist'] = 'Name Bandwidth Already Exist';
-$_L['Hotspot_Plans'] = 'Hotspot Plans';
-$_L['PPPOE_Plans'] = 'PPPOE Plans';
-$_L['Plan_Name'] = 'Plan Name';
-$_L['New_Plan'] = 'New Service Plan';
-$_L['Add_Plan'] = 'Add Service Plan';
-$_L['Edit_Plan'] = 'Edit Service Plan';
-$_L['Plan_already_exist'] = 'Name Plan Already Exist';
-$_L['Plan_Type'] = 'Plan Type';
-$_L['Plan_Price'] = 'Plan Price';
-$_L['Limit_Type'] = 'Limit Type';
-$_L['Unlimited'] = 'Unlimited';
-$_L['Limited'] = 'Limited';
-$_L['Time_Limit'] = 'Time Limit';
-$_L['Data_Limit'] = 'Data Limit';
-$_L['Both_Limit'] = 'Both Limit';
-$_L['Plan_Validity'] = 'Plan Validity';
-$_L['Select_BW'] = 'Select Bandwidth';
-$_L['Shared_Users'] = 'Shared Users';
-
-$_L['user_type_help'] = 'Choose User Type Sales to disable access to Settings';
-$_L['Current_Password'] = 'Current Password';
-$_L['New_Password'] = 'New Password';
-$_L['Administrator'] = 'Administrator';
-$_L['Sales'] = 'Sales';
-$_L['Member'] = 'Member';
-$_L['Confirm_New_Password'] = 'Confirm New Password';
-$_L['Confirm_Password'] = 'Confirm Password';
-$_L['Full_Name'] = 'Full Name';
-$_L['User_Type'] = 'User Type';
-$_L['Address'] = 'Address';
-$_L['Created_On'] = 'Created On';
-$_L['Expires_On'] = 'Expires On';
-$_L['Phone_Number'] = 'Phone Number';
-$_L['User_Delete_Ok'] = 'User deleted Successfully';
-$_L['Full_Administrator'] = 'Full Administrator';
-$_L['password_change_help'] = 'Keep Blank to do not change Password';
-$_L['currency_help'] = 'Keep it blank if you do not want to show currency code';
-$_L['Theme_Style'] = 'Theme Style';
-$_L['Theme_Color'] = 'Theme Color';
-$_L['Default_Language'] = 'Default Language';
-
-$_L['Network'] = 'Network';
-$_L['Routers'] = 'Routers';
-$_L['Pool'] = 'IP Pool';
-$_L['New_Router'] = 'New Router';
-$_L['Add_Router'] = 'Add Router';
-$_L['Edit_Router'] = 'Edit Router';
-$_L['Router_Name'] = 'Router Name';
-$_L['IP_Address'] = 'IP Address';
-$_L['Router_Secret'] = 'Router Secret';
-$_L['Description'] = 'Description';
-$_L['Router_already_exist'] = 'IP Router Already Exist';
-$_L['Pool_Name'] = 'Name Pool';
-$_L['Range_IP'] = 'Range IP';
-$_L['New_Pool'] = 'New Pool';
-$_L['Add_Pool'] = 'Add Pool';
-$_L['Edit_Pool'] = 'Edit Pool';
-$_L['Pool_already_exist'] = 'Pool Name Already Exist';
-
-$_L['Prepaid'] = 'Prepaid';
-$_L['Prepaid_User'] = 'Prepaid Users';
-$_L['Prepaid_Vouchers'] = 'Prepaid Vouchers';
-$_L['Refill_Account'] = 'Refill Account';
-$_L['Recharge_Account'] = 'Recharge Account';
-$_L['Select_Account'] = 'Select Account';
-$_L['Service_Plan'] = 'Service Plan';
-$_L['Recharge'] = 'Recharge';
-$_L['Method'] = 'Method';
-$_L['account_created_successfully'] = 'Account Created Successfully';
-
-$_L['Database_Status'] = 'Database Status';
-$_L['Total_Database_Size'] = 'Total Database Size';
-$_L['Download_Database_Backup'] = 'Download Database Backup';
-$_L['Table_Name'] = 'Table Name';
-$_L['Rows'] = 'Rows';
-$_L['Size'] = 'Size';
-
-$_L['Customers'] = 'Customer';
-$_L['Add_Contact'] = 'Add New Contact';
-$_L['Edit_Contact'] = 'Edit Contact';
-$_L['List_Contact'] = 'List Contact';
-$_L['Manage_Accounts'] = 'Manage Contact';
-
-$_L['Reports'] = 'Reports';
-$_L['Daily_Report'] = 'Daily Reports';
-$_L['Period_Reports'] = 'Period Reports';
-$_L['All_Transactions'] = 'All Transactions';
-$_L['Total_Income'] = 'Total Income';
-$_L['All_Transactions_at_Date'] = 'All Transactions at Date';
-$_L['Total_Income'] = 'Total Income';
-$_L['Export_for_Print'] = 'Export for Print';
-$_L['Print'] = 'Print';
-$_L['Export_to_PDF'] = 'Export to PDF';
-$_L['Click_Here_to_Print'] = 'Click Here to Print';
-$_L['You_can_use_html_tag'] = 'You can use html tag';
-$_L['Date_Format'] = 'Date Format';
-$_L['Income_Today'] = 'Income Today';
-$_L['Income_This_Month'] = 'Income This Month';
-$_L['Users_Active'] = 'Users Active';
-$_L['Total_Users'] = 'Total Users';
-$_L['Users'] = 'Users';
-$_L['Edit_User'] = 'Edit User';
-$_L['Last_Login'] = 'Last Login';
-$_L['Administrator_Users'] = 'Administrator Users';
-$_L['Manage_Administrator'] = 'Manage Administrator';
-$_L['Add_New_Administrator'] = 'Add New Administrator';
-$_L['Localisation'] = 'Localisation';
-$_L['Backup_Restore'] = 'Backup/Restore';
-
-$_L['General_Settings'] = 'General Settings';
-$_L['Date'] = 'Date';
-$_L['Login_Successful'] = 'Login Successful';
-$_L['Failed_Login'] = 'Failed Login';
-$_L['Settings_Saved_Successfully'] = 'Settings Saved Successfully';
-$_L['User_Updated_Successfully'] = 'User Updated Successfully';
-$_L['User_Expired_Today'] = 'User Expired, Today';
-$_L['Activity_Log'] = 'Activity Log';
-$_L['View_Reports'] = 'View Reports';
-$_L['View_All'] = 'View All';
-$_L['Number_of_Vouchers'] = 'Number of Vouchers';
-$_L['Length_Code'] = 'Length Code';
-$_L['Code_Voucher'] = 'Code Voucher';
-$_L['Voucher'] = 'Voucher';
-$_L['Voucher_Hotspot'] = 'Hotspot Voucher';
-$_L['Status_Voucher'] = 'Status Voucher';
-$_L['Add_Voucher'] = 'Add Vouchers';
-$_L['Voucher_Successfully'] = 'Create Vouchers Successfully';
-$_L['Generate'] = 'Generate';
-$_L['Print_Info'] = 'Print side by side, it will easy to cut';
-
-$_L['From_Date'] = 'From Date';
-$_L['To_Date'] = 'To Date';
-$_L['New_Service'] = 'New Service';
-$_L['Type'] = 'Type';
-$_L['Finish'] = 'Finish';
-$_L['App_Name'] = 'Application Name/ Company Name';
-$_L['App_Name_Help_Text'] = 'This Name will be shown on the Title';
-$_L['Next'] = 'Next';
-$_L['Last'] = 'Last';
-$_L['Timezone'] = 'Timezone';
-$_L['Decimal_Point'] = 'Decimal Point';
-$_L['Thousands_Separator'] = 'Thousands Separator';
-$_L['Currency_Code'] = 'Currency Code';
-
-$_L['Order_Voucher'] = 'Order Voucher';
-$_L['Voucher_Activation'] = 'Voucher Activation';
-$_L['List_Activated_Voucher'] = 'List Activated Voucher';
-$_L['Enter_Voucher_Code'] = 'Enter voucher code here';
-$_L['Private_Message'] = 'Private Message';
-$_L['Inbox'] = 'Inbox';
-$_L['Outbox'] = 'Outbox';
-$_L['Compose'] = 'Compose';
-$_L['Send_to'] = 'Send to';
-$_L['Title'] = 'Title';
-$_L['Message'] = 'Message';
-$_L['Account_Information'] = 'Your Account Information';
-$_L['Welcome_Text_User'] = 'Welcome to the Panel Members page, on this page you can:';
-$_L['Welcome_Text_Admin'] = 'PHPNuxBill is a billing Hotspot and PPPOE for Mikrotik using PHP and Mikrotik API to comunicate with router. If you get more profit with this application, please donate us.
Watch project in here'; - -//update -$_L['Invalid_Username_or_Password'] = 'Invalid Username or Password'; -$_L['Do_Not_Access'] = 'You do not have permission to access this page'; -$_L['Incorrect_Current_Password'] = 'Incorrect Current Password'; -$_L['Password_Changed_Successfully'] = 'Password changed successfully, Please login again'; -$_L['All_field_is_required'] = 'All field is required'; -$_L['Voucher_Not_Valid'] = 'Voucher Not Valid'; -$_L['Activation_Vouchers_Successfully'] = 'Activation Vouchers Successfully'; -$_L['Data_Not_Found'] = 'Data Not Found'; -$_L['Search_by_Username'] = 'Search by Username'; -$_L['Search_by_Name'] = 'Search by Name'; -$_L['Search_by_Code'] = 'Search by Code Voucher'; -$_L['Search'] = 'Search'; -$_L['Select_Customer'] = 'Select a customer'; -$_L['Select_Routers'] = 'Select Routers'; -$_L['Select_Plans'] = 'Select Plans'; -$_L['Select_Pool'] = 'Select Pool'; -$_L['Hrs'] = 'Hrs'; -$_L['Mins'] = 'Mins'; -$_L['Days'] = 'Days'; -$_L['Months'] = 'Months'; - -$_L['Add_Language'] = 'Add Language'; -$_L['Name_Lang'] = 'Language Name'; -$_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'] = 'Explain Coverage of router'; -$_L['Name_of_Area_that_router_operated'] = 'Name of Area that router operated'; -$_L['Payment_Notification_URL_Recurring_Notification_URL_Pay_Account_Notification_URL'] = 'Payment Notification URL, Recurring Notification URL, Pay Account Notification URL'; -$_L['Finish_Redirect_URL_Unfinish_Redirect_URL_Error_Redirect_URL'] = 'Finish Redirect URL, Unfinish Redirect URL, Error Redirect URL'; -$_L['Status'] = 'Status'; -$_L['Plan_Not_found'] = 'Plan Not found'; -$_L['Failed_to_create_transaction'] = 'Failed to create transaction.'; -$_L['Seller_has_not_yet_setup_Xendit_payment_gateway'] = 'Seller has not yet setup Xendit payment gateway'; -$_L['Admin_has_not_yet_setup_Xendit_payment_gateway_please_tell_admin'] = 'Admin has not yet setup Xendit payment gateway, please tell admin'; -$_L['Buy_this_your_active_package_will_be_overwrite'] = 'Buy this? your active package will be overwrite'; -$_L['You_already_have_unpaid_transaction_cancel_it_or_pay_it'] = 'You already have unpaid transaction, cancel it or pay it.'; -$_L['Transaction_Not_found'] = 'Transaction Not found'; -$_L['Cancel_it'] = 'Cancel it?'; -$_L['expired'] = 'expired'; -$_L['Check_for_Payment'] = 'Check for Payment'; -$_L['Transaction_still_unpaid'] = 'Transaction still unpaid.'; -$_L['Paid_Date'] = 'Paid Date'; -$_L['Transaction_has_been_paid'] = 'Transaction has been paid.'; -$_L['PAID'] = 'PAID'; -$_L['CANCELED'] = 'CANCELED'; -$_L['UNPAID'] = 'UNPAID'; -$_L['PAY_NOW'] = 'PAY NOW'; -$_L['Buy_Hotspot_Plan'] = 'Buy Hotspot Plan'; -$_L['Buy_PPOE_Plan'] = 'Buy PPOE Plan'; -$_L['Package'] = 'Package'; -$_L['Order_Internet_Package'] = 'Order Internet Package'; -$_L['Unknown_Command'] = 'Unknown Command.'; -$_L['Checking_payment'] = 'Checking payment'; -$_L['Create_Transaction_Success'] = 'Create Transaction Success'; -$_L['You_have_unpaid_transaction'] = 'You have unpaid transaction'; -$_L['TripayPayment_Channel'] = 'TripayPayment Channel'; -$_L['Payment_Channel'] = 'Payment Channel'; -$_L['Payment_check_failed'] = 'Payment check failed.'; -$_L['Order_Package'] = 'Order Package'; -$_L['Transactions'] = 'Transactions'; -$_L['Payments'] = 'Payments'; -$_L['History'] = 'History'; -$_L['Order_History'] = 'Order History'; -$_L['Gateway'] = 'Gateway'; -$_L['Date_Done'] = 'Date Done'; -$_L['Unpaid_Order'] = 'Unpaid Order'; -$_L['Payment_Gateway_Not_Found'] = 'Payment Gateway Not Found'; -$_L['Payment_Gateway_saved_successfully'] = 'Payment Gateway saved successfully'; -$_L['ORDER'] = 'ORDER'; -$_L['Package_History'] = 'Package History'; -$_L['Buy_History'] = 'Buy History'; -$_L['Activation_History'] = 'Activation History'; -$_L['Buy_Package'] = 'Buy Package'; -$_L['Email'] = 'Email'; -$_L['Company_Footer'] = 'Company Footer'; -$_L['Will_show_below_user_pages'] = 'Will show below user pages'; -$_L['Request_OTP'] = 'Request OTP'; -$_L['Verification_Code'] = 'Verification Code'; -$_L['SMS_Verification_Code'] = 'SMS Verification Code'; -$_L['Please_enter_your_email_address'] = 'Please enter your email address'; -$_L['Failed_to_create_Paypal_transaction'] = 'Failed to create Paypal transaction.'; -$_L['Plugin'] = 'Plugin'; -$_L['Plugin_Manager'] = 'Plugin Manager'; -$_L['User_Notification'] = 'User Notification'; -$_L['Expired_Notification'] = 'Expired Notification'; -$_L['User_will_get_notification_when_package_expired'] = 'User will get notification when package expired'; -$_L['Expired_Notification_Message'] = 'Expired Notification Message'; -$_L['bnameb_will_be_replaced_with_Customer_Name_bpackageb_will_be_replaced_with_Package_name'] = '[[name]] will be replaced with Customer Name. [[package]] will be replaced with Package name.'; -$_L['Payment_Notification'] = 'Payment Notification'; -$_L['User_will_get_invoice_notification_when_buy_package_or_package_refilled'] = 'User will get invoice notification when buy package or package refilled'; -$_L['Current_IP'] = 'Current IP'; -$_L['Current_MAC'] = 'Current MAC'; -$_L['Login_Status'] = 'Login Status'; -$_L['Login_Request_successfully'] = 'Login Request successfully'; -$_L['Logout_Request_successfully'] = 'Logout Request successfully'; -$_L['Disconnect_Internet'] = 'Disconnect Internet?'; -$_L['Not_Online_Login_now'] = 'Not Online, Login now?'; -$_L['You_are_Online_Logout'] = 'You are Online, Logout?'; -$_L['Connect_to_Internet'] = 'Connect to Internet?'; -$_L['Your_account_not_connected_to_internet'] = 'Your account not connected to internet'; - -$_L['Failed_to_create_transaction_'] = 'Failed to create transaction. '; -$_L['Failed_to_check_status_transaction_'] = 'Failed to check status transaction. '; -$_L['Disable_Voucher'] = 'Disable Voucher'; -$_L['Balance'] = 'Balance'; -$_L['Balance_System'] = 'Balance System'; -$_L['Enable_System'] = 'Enable System'; -$_L['Allow_Transfer'] = 'Allow Transfer'; -$_L['Telegram_Notification'] = 'Telegram Notification'; -$_L['SMS_OTP_Registration'] = 'SMS OTP Registration'; -$_L['Whatsapp_Notification'] = 'Whatsapp Notification'; -$_L['Tawkto_Chat_Widget'] = 'Tawk.to Chat Widget'; -$_L['Invoice'] = 'Invoice'; -$_L['Country_Code_Phone'] = 'Country Code Phone'; -$_L['Voucher_activation_menu_will_be_hidden'] = 'Voucher activation menu will be hidden'; -$_L['Customer_can_deposit_money_to_buy_voucher'] = 'Customer can deposit money to buy voucher'; -$_L['Allow_balance_transfer_between_customers'] = 'Allow balance transfer between customers'; -$_L['Reminder_Notification'] = 'Reminder Notification'; -$_L['Reminder_Notification_Message'] = 'Reminder Notification Message'; -$_L['Reminder_7_days'] = 'Reminder 7 days'; -$_L['Reminder_3_days'] = 'Reminder 3 days'; -$_L['Reminder_1_day'] = 'Reminder 1 day'; -$_L['PPPOE_Password'] = 'PPPOE Password'; -$_L['User_Cannot_change_this_only_admin_if_it_Empty_it_will_use_user_password'] = 'User Cannot change this, only admin. if it Empty it will use user password'; -$_L['Invoice_Balance_Message'] = 'Invoice Balance Message'; -$_L['Invoice_Notification_Payment'] = 'Invoice Notification Payment'; -$_L['Balance_Notification_Payment'] = 'Balance Notification Payment'; -$_L['Balance_Plans'] = 'Balance Plans'; -$_L['Buy_Balance'] = 'Buy Balance'; -$_L['Price'] = 'Price'; -$_L['Validity'] = 'Validity'; -$_L['Disable_auto_renewal'] = 'Disable auto renewal?'; -$_L['Auto_Renewal_On'] = 'Auto Renewal On'; -$_L['Enable_auto_renewal'] = 'Enable auto renewal?'; -$_L['Auto_Renewal_Off'] = 'Auto Renewal Off'; -$_L['Refill_Balance'] = 'Refill Balance'; -$_L['Invoice_Footer'] = 'Invoice Footer'; -$_L['Pay_With_Balance'] = 'Pay With Balance'; -$_L['Pay_this_with_Balance_your_active_package_will_be_overwrite'] = 'Pay this with Balance? your active package will be overwrite'; -$_L['Success_to_buy_package'] = 'Success to buy package'; -$_L['Auto_Renewal'] = 'Auto Renewal'; -$_L['View'] = 'View'; -$_L['Back'] = 'Back'; -$_L['Active'] = 'Active'; -$_L['Transfer_Balance'] = 'Transfer Balance'; -$_L['Send_your_balance'] = 'Send your balance?'; -$_L['Send'] = 'Send'; -$_L['Cannot_send_to_yourself'] = 'Cannot send to yourself'; -$_L['Sending_balance_success'] = 'Sending balance success'; -$_L['From'] = 'From'; -$_L['To'] = 'To'; -$_L['insufficient_balance'] = 'insufficient balance'; -$_L['Send_Balance'] = 'Send Balance'; -$_L['Received_Balance'] = 'Received Balance'; -$_L['Minimum_Balance_Transfer'] = 'Minimum Balance Transfer'; -$_L['Minimum_Transfer'] = 'Minimum Transfer'; -$_L['Company_Logo'] = 'Company Logo'; -$_L['Expired_IP_Pool'] = 'Expired IP Pool'; -$_L['Proxy'] = 'Proxy'; -$_L['Proxy_Server'] = 'Proxy Server'; -$_L['Proxy_Server_Login'] = 'Proxy Server Login'; -$_L['Hotspot_Plan'] = 'Hotspot Plan'; -$_L['PPPOE_Plan'] = 'PPPOE Plan'; -$_L['UNKNOWN'] = 'UNKNOWN'; -$_L['Are_You_Sure'] = 'Are You Sure?'; -$_L['Success_to_send_package'] = 'Success to send package'; -$_L['Target_has_active_plan_different_with_current_plant'] = 'Target has active plan, different with current plant.'; -$_L['Recharge_a_friend'] = 'Recharge a friend'; -$_L['Buy_for_friend'] = 'Buy for friend'; -$_L['Buy_this_for_friend_account'] = 'Buy this for friend account?'; -$_L['Review_package_before_recharge'] = 'Review package before recharge'; -$_L['Activate'] = 'Activate'; -$_L['Deactivate'] = 'Deactivate'; -$_L['Sync'] = 'Sync'; -$_L['Failed_to_create_PaymeTrust_transaction'] = 'Failed to create PaymeTrust transaction.'; -$_L['Location'] = 'Location'; -$_L['Radius_Plans'] = 'Radius Plans'; -$_L['Change_title_in_user_Plan_order'] = 'Change title in user Plan order'; -$_L['Logs'] = 'Logs'; -$_L['Voucher_Format'] = 'Voucher Format'; -$_L['Resend_To_Customer'] = 'Resend To Customer'; diff --git a/system/lan/english/index.html b/system/lan/english/index.html deleted file mode 100644 index 97579708..00000000 --- a/system/lan/english/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - 403 Forbidden - - -

Directory access is forbidden.

- - \ No newline at end of file diff --git a/system/lan/indonesia.json b/system/lan/indonesia.json index 0e62b63c..a90093b7 100644 --- a/system/lan/indonesia.json +++ b/system/lan/indonesia.json @@ -54,7 +54,7 @@ "Plan_Type": "Jenis Paket", "Plan_Price": "Harga Paket", "Limit_Type": "Tipe Batas", - "Unlimited": "Tak Terbatas", + "Unlimited": "Tak terbatas", "Limited": "Terbatas", "Time_Limit": "Batas waktu", "Data_Limit": "Batas Data", @@ -69,7 +69,7 @@ "Sales": "Sales", "Member": "Anggota", "Confirm_New_Password": "Konfirmasi sandi baru", - "Confirm_Password": "Konfirmasi sandi", + "Confirm_Password": "konfirmasi sandi", "Full_Name": "Nama Lengkap", "User_Type": "Tipe Pelanggan", "Address": "Alamat", diff --git a/system/lan/indonesia/common.lan.php b/system/lan/indonesia/common.lan.php deleted file mode 100644 index 2f70f35f..00000000 --- a/system/lan/indonesia/common.lan.php +++ /dev/null @@ -1,401 +0,0 @@ -silahkan masuk'; -$_L['Sign_In_Member'] = 'Masuk ke Member Panel'; -$_L['Register_Member'] = 'Mendaftar sebagai pelanggan
pastikan anda sudah membeli voucher'; -$_L['Sign_In_Admin'] = 'Masuk ke Admin Panel'; -$_L['Logo'] = 'PHPNuxBill'; -$_L['Username'] = 'Username'; -$_L['Password'] = 'Password'; -$_L['PasswordsNotMatch'] = 'Sandi tidak sama'; -$_L['account_already_exist'] = 'Username sudah ada yang menggunakan'; -$_L['Manage'] = 'Proses'; -$_L['Submit'] = 'Kirim'; -$_L['Save'] = 'Simpan Perubahan'; -$_L['Cancel'] = 'Batal'; -$_L['Edit'] = 'Edit'; -$_L['Delete'] = 'Hapus'; -$_L['Welcome'] = 'Selamat Datang'; -$_L['Created_Successfully'] = 'Data berhasil di buat'; -$_L['Updated_Successfully'] = 'Data berhasil di ubah'; -$_L['Delete_Successfully'] = 'Berhasil menghapus data'; - -$_L['Static_Pages'] = "Halaman statis"; -$_L['Failed_Save_Page'] = "Gagal menyimpan halaman, pastikan diperbolehkan menulis file di folder pages, chmod 664 pages/*.html"; -$_L['Success_Save_Page'] = "Sukses menyimpan halaman"; -$_L['Info_Page'] = "Kadang harus di-refresh 3 kali baru konten berubah"; - -$_L['Dashboard'] = 'Beranda'; -$_L['Search_Contact'] = 'Cari username member...'; -$_L['My_Account'] = 'Akun Saya'; -$_L['My_Profile'] = 'Profil Saya'; -$_L['Settings'] = 'Pengaturan'; -$_L['Edit_Profile'] = 'Ubah Profil'; -$_L['Change_Password'] = 'Ganti Password'; -$_L['Logout'] = 'Keluar'; - -$_L['Services'] = 'Layanan'; -$_L['Bandwidth_Plans'] = 'Daftar Bandwidth'; -$_L['BW_Name'] = 'Nama Bandwidth'; -$_L['New_Bandwidth'] = 'Tambah Data Bandwidth'; -$_L['Edit_Bandwidth'] = 'Ubah Data Bandwidth'; -$_L['Add_Bandwidth'] = 'Tambah Bandwidth Baru'; -$_L['Rate_Download'] = 'Rate Download'; -$_L['Rate_Upload'] = 'Rate Upload'; -$_L['BW_already_exist'] = 'Nama Bandwidth Sudah Ada'; -$_L['Hotspot_Plans'] = 'Paket Hotspot'; -$_L['PPPOE_Plans'] = 'Paket PPPOE'; -$_L['Plan_Name'] = 'Nama Paket'; -$_L['New_Plan'] = 'Tambah Paket Baru'; -$_L['Add_Plan'] = 'Tambah Paket Baru'; -$_L['Edit_Plan'] = 'Ubah Paket'; -$_L['Plan_already_exist'] = 'Nama Paket Sudah Ada'; -$_L['Plan_Type'] = 'Jenis Paket'; -$_L['Plan_Price'] = 'Harga'; -$_L['Limit_Type'] = 'Jenis Limit'; -$_L['Unlimited'] = 'Unlimited'; -$_L['Limited'] = 'Limited'; -$_L['Time_Limit'] = 'TimeBase'; -$_L['Data_Limit'] = 'QuotaBase'; -$_L['Both_Limit'] = 'Keduanya'; -$_L['Plan_Validity'] = 'Masa Aktif'; -$_L['Select_BW'] = 'Pilih Nama Bandwidth'; -$_L['Shared_Users'] = 'Shared Users'; - -$_L['user_type_help'] = 'Pilih Sales jika ingin fasilitas Pengaturan dinonaktifkan'; -$_L['Current_Password'] = 'Password Sekarang'; -$_L['New_Password'] = 'Password Baru'; -$_L['Administrator'] = 'Administrator'; -$_L['Sales'] = 'Sales'; -$_L['Member'] = 'Member'; -$_L['Confirm_New_Password'] = 'Konfirmasi Password'; -$_L['Confirm_Password'] = 'Konfirmasi Password'; -$_L['Full_Name'] = 'Nama Lengkap'; -$_L['User_Type'] = 'Posisi User'; -$_L['Address'] = 'Alamat Lengkap'; -$_L['Created_On'] = 'Tanggal Aktif'; -$_L['Expires_On'] = 'Tanggal Expire'; -$_L['Phone_Number'] = 'Nomor HP'; -$_L['User_Delete_Ok'] = 'User berhasil di hapus'; -$_L['Full_Administrator'] = 'Full Administrator'; -$_L['password_change_help'] = 'Kosongkan jika tidak ingin mengganti password'; -$_L['currency_help'] = 'Kosongkan jika tidak ingin mengatur kode Mata Uang'; -$_L['Theme_Style'] = 'Theme Style'; -$_L['Theme_Color'] = 'Theme Color'; -$_L['Default_Language'] = 'Bahasa'; - -$_L['Network'] = 'Network'; -$_L['Routers'] = 'Routers'; -$_L['Pool'] = 'IP Pool'; -$_L['New_Router'] = 'Router Baru'; -$_L['Add_Router'] = 'Tambah Router'; -$_L['Edit_Router'] = 'Ubah Router'; -$_L['Router_Name'] = 'Nama Router'; -$_L['IP_Address'] = 'IP Address'; -$_L['Router_Secret'] = 'Password Router'; -$_L['Description'] = 'Deskripsi'; -$_L['Router_already_exist'] = 'IP Router sudah digunakan'; -$_L['Pool_Name'] = 'Nama Pool'; -$_L['Range_IP'] = 'Rentang IP'; -$_L['New_Pool'] = 'Pool Baru'; -$_L['Add_Pool'] = 'Tambah Pool'; -$_L['Edit_Pool'] = 'Ubah Pool'; -$_L['Pool_already_exist'] = 'Nama Pool Sudah Ada'; - -$_L['Prepaid'] = 'Billing'; -$_L['Prepaid_User'] = 'Billing'; -$_L['Prepaid_Vouchers'] = 'Kelola Voucher'; -$_L['Refill_Account'] = 'Refill Akun'; -$_L['Recharge_Account'] = 'Perpanjang Akun'; -$_L['Select_Account'] = 'Pilih Akun'; -$_L['Service_Plan'] = 'Paket'; -$_L['Recharge'] = 'Isi Ulang Akun'; -$_L['Method'] = 'Metode'; -$_L['account_created_successfully'] = 'Account Created Successfully'; - -$_L['Database_Status'] = 'Status Database'; -$_L['Total_Database_Size'] = 'Ukuran Database'; -$_L['Download_Database_Backup'] = 'Download Database Backup'; -$_L['Table_Name'] = 'Nama Tabel'; -$_L['Rows'] = 'Rows'; -$_L['Size'] = 'Size'; - -$_L['Customers'] = 'Kontak Member'; -$_L['Add_Contact'] = 'Tambah Kontak Baru'; -$_L['Edit_Contact'] = 'Edit Kontak'; -$_L['List_Contact'] = 'List Kontak'; -$_L['Manage_Accounts'] = 'Kelola Kontak'; - -$_L['Reports'] = 'Laporan'; -$_L['Daily_Report'] = 'Laporan Harian'; -$_L['Period_Reports'] = 'Laporan Periode'; -$_L['All_Transactions'] = 'Semua Transaksi'; -$_L['Total_Income'] = 'Total Pendapatan'; -$_L['All_Transactions_at_Date'] = 'Semua Transaksi pada Tanggal'; -$_L['Export_for_Print'] = 'Cetak Laporan'; -$_L['Print'] = 'Print'; -$_L['Export_to_PDF'] = 'Export ke PDF'; -$_L['Click_Here_to_Print'] = 'Klik Disini untuk Cetak Laporan'; -$_L['You_can_use_html_tag'] = 'Boleh menggunakan tag html'; -$_L['Date_Format'] = 'Format Tanggal'; -$_L['Income_Today'] = 'Pendapatan Hari Ini'; -$_L['Income_This_Month'] = 'Pendapatan Bulan Ini'; -$_L['Users_Active'] = 'Member Aktif'; -$_L['Total_Users'] = 'Total Member'; -$_L['Users'] = 'User'; -$_L['Edit_User'] = 'Ubah Pengguna'; -$_L['Last_Login'] = 'Terakhir Login'; -$_L['Administrator_Users'] = 'Pengguna Admin'; -$_L['Manage_Administrator'] = 'Kelola Administrator'; -$_L['Add_New_Administrator'] = 'Tambah Administrator'; -$_L['Localisation'] = 'Lokalisasi'; -$_L['Backup_Restore'] = 'Backup/Restore'; - -$_L['General_Settings'] = 'Pengaturan Umum'; -$_L['Date'] = 'Tanggal'; -$_L['Login_Successful'] = 'Login Berhasil'; -$_L['Failed_Login'] = 'Gagal Login'; -$_L['Settings_Saved_Successfully'] = 'Pengaturan Berhasil Disimpan'; -$_L['User_Updated_Successfully'] = 'Berhasil mengubah pengguna'; -$_L['User_Expired_Today'] = 'Member Expire Hari Ini'; -$_L['Activity_Log'] = 'Aktifitas Log'; -$_L['View_Reports'] = 'Lihat Laporan'; -$_L['View_All'] = 'Lihat Semua'; -$_L['Number_of_Vouchers'] = 'Jumlah Voucher'; -$_L['Length_Code'] = 'Panjang Kode'; -$_L['Code_Voucher'] = 'Kode Voucher'; -$_L['Voucher'] = 'Voucher'; -$_L['Voucher_Hotspot'] = 'Voucher Hotspot'; -$_L['Status_Voucher'] = 'Status Voucher'; -$_L['Add_Voucher'] = 'Tambah'; -$_L['Voucher_Successfully'] = 'Berhasil membuat Voucher baru'; -$_L['Generate'] = 'Generate'; -$_L['Print_Info'] = 'Print bolak balik, biar mudah dipotong dan hemat kertas'; - -$_L['From_Date'] = 'Dari Tanggal'; -$_L['To_Date'] = 'Hingga Tanggal'; -$_L['New_Service'] = 'Layanan Baru'; -$_L['Type'] = 'Jenis'; -$_L['Finish'] = 'Selesai'; -$_L['App_Name'] = 'Nama Perusahaan'; -$_L['App_Name_Help_Text'] = 'Nama ini akan tampil pada judul'; -$_L['Next'] = 'Next'; -$_L['Last'] = 'Last'; -$_L['Timezone'] = 'Timezone'; -$_L['Decimal_Point'] = 'Pemisah Desimal'; -$_L['Thousands_Separator'] = 'Pemisah Ribuan'; -$_L['Currency_Code'] = 'Mata Uang'; - -$_L['Order_Voucher'] = 'Beli Voucher'; -$_L['Voucher_Activation'] = 'Aktifasi Voucher'; -$_L['List_Activated_Voucher'] = 'List Aktifasi Voucher'; -$_L['Enter_Voucher_Code'] = 'Masukkan kode voucher disini'; -$_L['Private_Message'] = 'Pesan Singkat'; -$_L['Inbox'] = 'Inbox'; -$_L['Outbox'] = 'Outbox'; -$_L['Compose'] = 'Compose'; -$_L['Send_to'] = 'Send to'; -$_L['Title'] = 'Title'; -$_L['Message'] = 'Message'; -$_L['Account_Information'] = 'Informasi Akun Anda'; -$_L['Welcome_Text_User'] = 'Selamat datang di Member Panel, disini Anda dapat mengetahui:'; -$_L['Welcome_Text_Admin'] = 'PHPNuxBill adalah sebuah aplikasi billing Hotspot dan PPPOE untuk Mikrotik dengan menggunakan bahasa pemograman PHP dan menggunakan API Mikrotik sebagai komunikasi dengan router. Jika aplikasi ini sangat berguna bagi bisnis Anda silahkan Anda donasi berapapun.
Pantau proyek disini'; - -//update -$_L['Invalid_Username_or_Password'] = 'Username atau Password Salah'; -$_L['Do_Not_Access'] = 'Anda tidak diijinkan untuk mengakses halaman ini'; -$_L['Incorrect_Current_Password'] = 'Password Saat ini Salah'; -$_L['Password_Changed_Successfully'] = 'Berhasil mengganti password, Silahkan login kembali'; -$_L['All_field_is_required'] = 'Semua bidang wajib di isi'; -$_L['Voucher_Not_Valid'] = 'Voucher Tidak Benar'; -$_L['Activation_Vouchers_Successfully'] = 'Berhasil melakukan aktivasi Voucher.'; -$_L['Data_Not_Found'] = 'Data tidak ditemukan'; -$_L['Search_by_Username'] = 'Cari berdasarkan Username'; -$_L['Search_by_Name'] = 'Cari berdasarkan Nama'; -$_L['Search_by_Code'] = 'Cari Kode Voucher'; -$_L['Search'] = 'Pencarian'; -$_L['Select_Customer'] = 'Pilih Member'; -$_L['Select_Routers'] = 'Pilih Routers'; -$_L['Select_Plans'] = 'Pilih Paket'; -$_L['Select_Pool'] = 'Pilih Pool'; -$_L['Hrs'] = 'Jam'; -$_L['Mins'] = 'Menit'; -$_L['Days'] = 'Hari'; -$_L['Months'] = 'Bulan'; -$_L['Add_Language'] = 'Tambah Bahasa'; -$_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'] = 'Paket tidak ditemukan'; -$_L['Failed_to_create_transaction'] = 'Gagal Membuat Transaksi.'; -$_L['Seller_has_not_yet_setup_Xendit_payment_gateway'] = 'Admin belum mengaktifkan pembayarana melalui Xendit'; -$_L['Admin_has_not_yet_setup_Xendit_payment_gateway_please_tell_admin'] = 'Admin belum mengaktifkan pembayaran Xendit, Mohon beritahu dmin'; -$_L['Buy_this_your_active_package_will_be_overwrite'] = 'Beli? Paket yang aktif akan dinonaktifkan'; -$_L['You_already_have_unpaid_transaction_cancel_it_or_pay_it'] = 'Anda masih memiliki transaksi yang belum dibayar, Bayar atau Batalkan.'; -$_L['Transaction_Not_found'] = 'Transaksi tidak ditemukan'; -$_L['Cancel_it'] = 'Batalkan?'; -$_L['expired'] = 'Kadaluarsa'; -$_L['Check_for_Payment'] = 'Cek Pembayaran'; -$_L['Transaction_still_unpaid'] = 'Transaksi Belum dibayar.'; -$_L['Paid_Date'] = 'Tanggal Bayar'; -$_L['Transaction_has_been_paid'] = 'Transaksi telah dibayar.'; -$_L['PAID'] = 'LUNAS'; -$_L['CANCELED'] = 'BATAL'; -$_L['UNPAID'] = 'BELUM DIBAYAR'; -$_L['PAY_NOW'] = 'BAYAR SEKARANG'; -$_L['Buy_Hotspot_Plan'] = 'Beli Paket Hotspot'; -$_L['Buy_PPOE_Plan'] = 'Beli Paket PPOE'; -$_L['Package'] = 'Paket'; -$_L['Order_Internet_Package'] = 'Beli Paket Internet'; -$_L['Unknown_Command'] = 'Perintah tidak dikenal.'; -$_L['Checking_payment'] = 'Cek pembayaran'; -$_L['Create_Transaction_Success'] = 'Transaksi sukses dibuat'; -$_L['You_have_unpaid_transaction'] = 'Anda memiliki transaksi yang belum dibayar'; -$_L['TripayPayment_Channel'] = 'TripayPayment Channel'; -$_L['Payment_Channel'] = 'Payment Channel'; -$_L['Payment_check_failed'] = 'Gagal cek pembayaran.'; -$_L['Order_Package'] = 'Beli Paket'; -$_L['Transactions'] = 'Daftar Transaksi'; -$_L['Payments'] = 'Pembayaran'; -$_L['History'] = 'Riwayat'; -$_L['Order_History'] = 'Riwayat Pembelian'; -$_L['Gateway'] = 'Gateway'; -$_L['Date_Done'] = 'Tanggal Selesai'; -$_L['Unpaid_Order'] = 'Pembelian belum dibayar'; -$_L['Payment_Gateway_Not_Found'] = 'Payment Gateway Tidak ditemukan'; -$_L['Payment_Gateway_saved_successfully'] = 'Payment Gateway telah disimpan'; -$_L['ORDER'] = 'BELI'; -$_L['Package_History'] = 'Riwayat Paket'; -$_L['Buy_History'] = 'Riwayat Pembelian'; -$_L['Activation_History'] = 'Riwayat Aktivasi'; -$_L['Buy_Package'] = 'Beli Paket'; -$_L['Email'] = 'Email'; -$_L['Company_Footer'] = 'Company Footer'; -$_L['Will_show_below_user_pages'] = 'Akan muncul di bawah halaman pelanggan'; -$_L['Request_OTP'] = 'Meminta kode OTP'; -$_L['Verification_Code'] = 'Kode Verifikasi'; -$_L['SMS_Verification_Code'] = 'Kode Verifikasi SMS'; -$_L['Please_enter_your_email_address'] = 'Masukkan alamat email'; -$_L['Failed_to_create_Paypal_transaction'] = 'gagal membuat transaksi Paypal'; -$_L['Plugin'] = 'Plugin'; -$_L['Plugin_Manager'] = 'Plugin Manager'; -$_L['User_Notification'] = 'Notifikasi Pelanggan'; -$_L['Expired_Notification'] = 'Notifikasi Kadaluarsa'; -$_L['User_will_get_notification_when_package_expired'] = 'Pelanggan akan mendapatkan Notifikasi jika paket kadaluarsa'; -$_L['Expired_Notification_Message'] = 'Pesan jika paket kadaluarsa'; -$_L['bnameb_will_be_replaced_with_Customer_Name_bpackageb_will_be_replaced_with_Package_name'] = '[[name]] akan diganti dengan nama konsumen. [[package]] akan diganti dengan nama paket internet.'; -$_L['Payment_Notification'] = 'Notifikasi Pembayaran'; -$_L['User_will_get_invoice_notification_when_buy_package_or_package_refilled'] = 'Pelanggan akan mendapatkan Notifikasi pembayaran setelah melakukan pembelian paket'; -$_L['Current_IP'] = 'IP anda'; -$_L['Current_MAC'] = 'MAC anda'; -$_L['Login_Status'] = 'Status Internet'; -$_L['Login_Request_successfully'] = 'Sukses melakukan menyalakan koneksi internet'; -$_L['Logout_Request_successfully'] = 'Sukses melakukan pemutusan koneksi internet'; -$_L['Disconnect_Internet'] = 'Putuskan Internet?'; -$_L['Not_Online_Login_now'] = 'Internet mati, Nyalakan?'; -$_L['You_are_Online_Logout'] = 'Internet hidup, Putuskan?'; -$_L['Connect_to_Internet'] = 'Koneksikan internet?'; -$_L['Your_account_not_connected_to_internet'] = 'Akun tidak terkoneksi dengan internet'; -$_L['Balance'] = 'Saldo'; -$_L['Balance_System'] = 'Sistem Saldo'; -$_L['Enable_System'] = 'Aktifkan Saldo'; -$_L['Allow_Transfer'] = 'Bolehkan Transfer'; -$_L['Telegram_Notification'] = 'Telegram Notification'; -$_L['SMS_OTP_Registration'] = 'SMS OTP Registration'; -$_L['Whatsapp_Notification'] = 'Whatsapp Notification'; -$_L['Tawkto_Chat_Widget'] = 'Tawk.to Chat Widget'; -$_L['Invoice'] = 'Invoice'; -$_L['Country_Code_Phone'] = 'Kode Negara Telepon'; -$_L['Voucher_activation_menu_will_be_hidden'] = 'Info Pembelian Voucher dan Redeem akan disembunyikan'; -$_L['Customer_can_deposit_money_to_buy_voucher'] = 'Pelanggan dapat topup saldo untuk langganan Internet'; -$_L['Allow_balance_transfer_between_customers'] = 'Bolehkan transfer saldo antar pelanggan'; -$_L['Refill_Balance'] = 'Refill Balance'; -$_L['Balance_Plans'] = 'Balance Plans'; -$_L['Expired_IP_Pool'] = 'Expired IP Pool'; -$_L['Company_Logo'] = 'Company Logo'; -$_L['Disable_Voucher'] = 'Disable Voucher'; -$_L['Minimum_Balance_Transfer'] = 'Minimum Balance Transfer'; -$_L['Reminder_Notification'] = 'Reminder Notification'; -$_L['Invoice_Footer'] = 'Invoice Footer'; - -$_L['Reminder_7_days'] = 'Reminder 7 days'; -$_L['Reminder_3_days'] = 'Reminder 3 days'; -$_L['Reminder_1_day'] = 'Reminder 1 day'; -$_L['PPPOE_Password'] = 'PPPOE Password'; -$_L['User_Cannot_change_this_only_admin_if_it_Empty_it_will_use_user_password'] = 'User Cannot change this, only admin. if it Empty it will use user password'; -$_L['Invoice_Balance_Message'] = 'Invoice Balance Message'; -$_L['Invoice_Notification_Payment'] = 'Invoice Notification Payment'; -$_L['Balance_Notification_Payment'] = 'Balance Notification Payment'; -$_L['Buy_Balance'] = 'Buy Balance'; -$_L['Price'] = 'Price'; -$_L['Validity'] = 'Validity'; -$_L['Disable_auto_renewal'] = 'Disable auto renewal?'; -$_L['Auto_Renewal_On'] = 'Auto Renewal On'; -$_L['Enable_auto_renewal'] = 'Enable auto renewal?'; -$_L['Auto_Renewal_Off'] = 'Auto Renewal Off'; -$_L['Pay_With_Balance'] = 'Pay With Balance'; -$_L['Pay_this_with_Balance_your_active_package_will_be_overwrite'] = 'Pay this with Balance? your active package will be overwrite'; -$_L['Success_to_buy_package'] = 'Success to buy package'; -$_L['Auto_Renewal'] = 'Auto Renewal'; -$_L['View'] = 'View'; -$_L['Back'] = 'Back'; -$_L['Active'] = 'Active'; -$_L['Transfer_Balance'] = 'Transfer Balance'; -$_L['Send_your_balance'] = 'Send your balance?'; -$_L['Send'] = 'Send'; -$_L['Cannot_send_to_yourself'] = 'Cannot send to yourself'; -$_L['Sending_balance_success'] = 'Sending balance success'; -$_L['From'] = 'From'; -$_L['To'] = 'To'; -$_L['insufficient_balance'] = 'insufficient balance'; -$_L['Send_Balance'] = 'Send Balance'; -$_L['Received_Balance'] = 'Received Balance'; -$_L['Minimum_Transfer'] = 'Minimum Transfer'; -$_L['Proxy'] = 'Proxy'; -$_L['Proxy_Server'] = 'Proxy Server'; -$_L['Proxy_Server_Login'] = 'Proxy Server Login'; -$_L['Hotspot_Plan'] = 'Hotspot Plan'; -$_L['PPPOE_Plan'] = 'PPPOE Plan'; -$_L['UNKNOWN'] = 'UNKNOWN'; -$_L['Are_You_Sure'] = 'Are You Sure?'; -$_L['Success_to_send_package'] = 'Success to send package'; -$_L['Target_has_active_plan_different_with_current_plant'] = 'Target has active plan, different with current plant.'; -$_L['Recharge_a_friend'] = 'Recharge a friend'; -$_L['Buy_for_friend'] = 'Buy for friend'; -$_L['Buy_this_for_friend_account'] = 'Buy this for friend account?'; -$_L['Review_package_before_recharge'] = 'Review package before recharge'; -$_L['Activate'] = 'Activate'; -$_L['Deactivate'] = 'Deactivate'; -$_L['Sync'] = 'Sync'; -$_L['Failed_to_create_PaymeTrust_transaction'] = 'Failed to create PaymeTrust transaction.'; -$_L['Location'] = 'Location'; -$_L['Voucher_Format'] = 'Voucher Format'; \ No newline at end of file diff --git a/system/lan/indonesia/index.html b/system/lan/indonesia/index.html deleted file mode 100644 index 97579708..00000000 --- a/system/lan/indonesia/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - 403 Forbidden - - -

Directory access is forbidden.

- - \ No newline at end of file diff --git a/system/lan/spanish.json b/system/lan/spanish.json new file mode 100644 index 00000000..de937f54 --- /dev/null +++ b/system/lan/spanish.json @@ -0,0 +1,377 @@ +{ + "Log_in": "Entrar", + "Register": "Registro", + "Announcement": "Anuncio", + "Registration_Info": "Informaci\u00f3n de registro", + "Voucher_not_found__please_buy_voucher_befor_register": "Cup\u00f3n no encontrado, compre el cup\u00f3n antes de registrarse", + "Register_Success__You_can_login_now": "\u00a1Registro exitoso! Puedes iniciar sesi\u00f3n ahora", + "Log_in_to_Member_Panel": "Log in to Member Panel", + "Register_as_Member": "Reg\u00edstrese como miembro", + "Enter_Admin_Area": "Panel de administraci\u00f3n", + "PHPNuxBill": "DIGITAL-RED", + "Username": "Usuario", + "Password": "Contrase\u00f1a", + "Passwords_does_not_match": "Las contrase\u00f1as no coinciden", + "Account_already_axist": "La cuenta ya existe", + "Manage": "Administrar", + "Submit": "Enviar", + "Save_Changes": "Guardar cambios", + "Cancel": "Cancelar", + "Edit": "Editar", + "Delete": "Eliminar", + "Welcome": "Bienvenido", + "Data_Created_Successfully": "Datos creados con \u00e9xito", + "Data_Updated_Successfully": "Datos actualizados con \u00e9xito", + "Data_Deleted_Successfully": "Datos eliminados con \u00e9xito", + "Static_Pages": "P\u00e1ginas est\u00e1ticas", + "Failed_to_save_page__make_sure_i_can_write_to_folder_pages___i_chmod_664_pages___html_i_": "No se pudo guardar la p\u00e1gina, aseg\u00farese de que pueda escribir en las p\u00e1ginas de la carpeta, chmod 664 pages\/*.html", + "Saving_page_success": "Guardando el \u00e9xito de la p\u00e1gina", + "Sometimes_you_need_to_refresh_3_times_until_content_change": "A veces es necesario actualizar 3 veces hasta que cambie el contenido", + "Dashboard": "Dashboard", + "Search_Customers___": "Buscar clientes...", + "My_Account": "Mi cuenta", + "My_Profile": "Mi perfil", + "Settings": "Ajustes", + "Edit_Profile": "Editar perfil", + "Change_Password": "Cambia la contrase\u00f1a", + "Logout": "Cerrar sesi\u00f3n", + "Services": "Servicios", + "Bandwidth_Plans": "Planes de velocidad", + "Bandwidth_Name": "Nombre de ancho de banda", + "New_Bandwidth": "Nuevo ancho de banda", + "Edit_Bandwidth": "Editar ancho de banda", + "Add_New_Bandwidth": "Agregar nuevo ancho de banda", + "Rate_Download": "Tarifa Descarga", + "Rate_Upload": "Tasa de subida", + "Name_Bandwidth_Already_Exist": "El ancho de banda del nombre ya existe", + "Hotspot_Plans": "Planes de Hotspot", + "PPPOE_Plans": "Planes PPPOE", + "Plan_Name": "Nombre", + "New_Service_Plan": "Nuevo plan de servicio", + "Add_Service_Plan": "Agregar plan de servicio", + "Edit_Service_Plan": "Editar plan de servicio", + "Name_Plan_Already_Exist": "Nombre El plan ya existe", + "Plan_Type": "Tipo de plan", + "Plan_Price": "Precio del plan", + "Limit_Type": "Tipo de l\u00edmite", + "Unlimited": "Ilimitado", + "Limited": "Limitado", + "Time_Limit": "L\u00edmite de tiempo", + "Data_Limit": "L\u00edmite de datos", + "Both_Limit": "Ambos L\u00edmite", + "Plan_Validity": "Validez del Plan", + "Select_Bandwidth": "Seleccionar ancho de banda", + "Shared_Users": "Usuarios compartidos", + "Choose_User_Type_Sales_to_disable_access_to_Settings": "Elija Ventas de tipo de usuario para deshabilitar el acceso a la Configuraci\u00f3n", + "Current_Password": "Contrase\u00f1a actual", + "New_Password": "Nueva contrase\u00f1a", + "Administrator": "Administrador", + "Sales": "Ventas", + "Member": "Usuario", + "Confirm_New_Password": "Confirmar nueva contrase\u00f1a", + "Confirm_Password": "Confirmar contrase\u00f1a", + "Full_Name": "Nombre completo", + "User_Type": "Tipo de usuario", + "Address": "Direcci\u00f3n", + "Created_On": "Creado en", + "Expires_On": "Expira el", + "Phone_Number": "N\u00famero de tel\u00e9fono", + "User_deleted_Successfully": "Usuario eliminado con \u00e9xito", + "Full_Administrator": "Administrador completo", + "Keep_Blank_to_do_not_change_Password": "Mantener en blanco para no cambiar la contrase\u00f1a", + "Keep_it_blank_if_you_do_not_want_to_show_currency_code": "Mant\u00e9ngalo en blanco si no desea mostrar el c\u00f3digo de moneda", + "Theme_Style": "Estilo de tema", + "Theme_Color": "Color del tema", + "Default_Language": "Idioma predeterminado", + "Network": "Red", + "Routers": "Routers", + "IP_Pool": "IP Pool", + "New_Router": "Nuevo Router", + "Add_Router": "Agregar Router", + "Edit_Router": "Editar Router", + "Router_Name": "Nombre del Router", + "IP_Address": "Direccion IP", + "Router_Secret": "Contrase\u00f1a Router", + "Description": "Descripcion", + "IP_Router_Already_Exist": "El enrutador IP ya existe", + "Name_Pool": "Nombre del Pool", + "Range_IP": "Rango de IP", + "New_Pool": "Nuevo Pool", + "Add_Pool": "Agregar Pool", + "Edit_Pool": "Editar Pool", + "Pool_Name_Already_Exist": "Nombre del Pool ya existe", + "Refill_Account": "Recargar Ficha", + "Recharge_Account": "Recargar Cuenta", + "Select_Account": "Seleccionar cuenta", + "Service_Plan": "Plan de servicio", + "Recharge": "Recargar", + "Method": "M\u00e9todo", + "Account_Created_Successfully": "Cuenta creada con \u00e9xito", + "Database_Status": "Estado de la base de datos", + "Total_Database_Size": "Tama\u00f1o total de la base de datos", + "Download_Database_Backup": "Descargar copia de seguridad de la base de datos", + "Table_Name": "Nombre de la tabla", + "Rows": "Filas", + "Size": "Tama\u00f1o", + "Customer": "Clientes", + "Add_New_Contact": "A\u00f1adir nuevo contacto", + "Edit_Contact": "Editar contacto", + "List_Contact": "Lista de contactos", + "Manage_Contact": "Administrar contacto", + "Reports": "Reportes", + "Daily_Reports": "Reportes diarios", + "Period_Reports": "Informes del per\u00edodo", + "All_Transactions": "Todas las transacciones", + "Total_Income": "Ingresos totales", + "All_Transactions_at_Date": "Todas las transacciones en la fecha", + "Export_for_Print": "Exportar para imprimir", + "Print": "Impresi\u00f3n", + "Export_to_PDF": "Exportar a PDF", + "Click_Here_to_Print": "Haga clic aqu\u00ed para imprimir", + "You_can_use_html_tag": "Puedes usar la etiqueta html", + "Date_Format": "Formato de fecha", + "Income_Today": "Ingresos hoy", + "Income_This_Month": "Ingresos este mes", + "Users_Active": "Usuarios activos", + "Total_Users": "Total de usuarios", + "Users": "Usuarios", + "Edit_User": "Editar usuario", + "Last_Login": "\u00daltimo acceso", + "Administrator_Users": "Usuarios administradores", + "Manage_Administrator": "Administrar administrador", + "Add_New_Administrator": "Agregar nuevo administrador", + "Localisation": "Localizaci\u00f3n", + "Backup_Restore": "Copia de seguridad\/restauracion", + "General_Settings": "Configuraci\u00f3n general", + "Date": "Fecha", + "Login_Successful": "Inicio de sesi\u00f3n exitoso", + "Failed_Login": "Inicio de sesi\u00f3n fallido", + "Settings_Saved_Successfully": "Configuraci\u00f3n guardada con \u00e9xito", + "User_Updated_Successfully": "Usuario actualizado con \u00e9xito", + "User_Expired__Today": "Usuario vencido, hoy", + "Activity_Log": "Registro de actividades", + "View_Reports": "Ver los informes", + "View_All": "Ver todo", + "Number_of_Vouchers": "N\u00famero de Fichas", + "Length_Code": "Longitud de codigo", + "Code_Voucher": "Cup\u00f3n de Ficha", + "Voucher": "Ficha", + "Hotspot_Voucher": "Ficha Hotspot", + "Status_Voucher": "Estatado de Ficha", + "Add_Vouchers": "Agregar Ficha", + "Create_Vouchers_Successfully": "Crear Ficha con \u00e9xito", + "Generate": "Generar", + "Print_side_by_side__it_will_easy_to_cut": "Imprimir uno al lado del otro, ser\u00e1 f\u00e1cil de cortar", + "From_Date": "Partir de la fecha", + "To_Date": "Hasta la fecha", + "New_Service": "Nuevo servicio", + "Type": "Tipo", + "Finish": "Finalizar", + "Application_Name__Company_Name": "Nombre de la aplicaci\u00f3n\/ Nombre de la empresa", + "This_Name_will_be_shown_on_the_Title": "Este nombre se mostrar\u00e1 en el t\u00edtulo", + "Next": "Siguiente", + "Last": "Atras", + "Timezone": "Zona horaria", + "Decimal_Point": "Punto decimal", + "Thousands_Separator": "Separador de miles", + "Currency_Code": "C\u00f3digo de moneda", + "Order_Voucher": "Comprobante de pedido", + "Voucher_Activation": "Activaci\u00f3n de Fichas", + "List_Activated_Voucher": "Lista de Fichas activados", + "Enter_voucher_code_here": "Ingrese el c\u00f3digo de la Ficha aqu\u00ed", + "Private_Message": "Mensaje privado", + "Inbox": "Bandeja de entrada", + "Outbox": "Bandeja de salida", + "Compose": "Componer", + "Send_to": "Enviar a", + "Title": "T\u00edtulo", + "Message": "Mensaje", + "Your_Account_Information": "Informaci\u00f3n de su cuenta", + "Welcome_to_the_Panel_Members_page__on_this_page_you_can_": "Bienvenido a la p\u00e1gina de Miembros del Panel, en esta p\u00e1gina puede:", + "Invalid_Username_or_Password": "Usuario o contrase\u00f1a invalido", + "You_do_not_have_permission_to_access_this_page": "Usted no tiene permiso para acceder a esta p\u00e1gina", + "Incorrect_Current_Password": "IContrase\u00f1a actual incorrecta", + "Password_changed_successfully__Please_login_again": "Contrase\u00f1a cambiada con \u00e9xito, por favor inicie sesi\u00f3n de nuevo", + "All_field_is_required": "Todo el campo es requerido", + "Voucher_Not_Valid": "Ficha no v\u00e1lida", + "Activation_Vouchers_Successfully": "Fichas de activaci\u00f3n con \u00e9xito", + "Data_Not_Found": "Datos no encontrados", + "Search_by_Username": "Buscar por nombre de usuario", + "Search_by_Name": "Buscar por nombre", + "Search_by_Code_Voucher": "B\u00fasqueda por c\u00f3digo de Ficha", + "Search": "B\u00fasqueda", + "Select_a_customer": "Seleccione un cliente", + "Select_Routers": "Seleccionar enrutadores", + "Select_Plans": "Seleccionar planes", + "Select_Pool": "Seleccionar Pool", + "Hrs": "Hrs", + "Mins": "Mins", + "Days": "Dias", + "Months": "Meses", + "Add_Language": "Agregar idioma", + "Language_Name": "Nombre del lenguaje", + "Folder_Name": "Nombre de la carpeta", + "Translator": "Traducir", + "Language_Name_Already_Exist": "El nombre del idioma ya existe", + "Payment_Gateway": "Payment Gateway", + "Community": "Community", + "1_user_can_be_used_for_many_devices_": "1 user can be used for many devices?", + "Cannot_be_change_after_saved": "Cannot be change after saved", + "Explain_Coverage_of_router": "Jelaskan Cakupan wilayah hotspot", + "Name_of_Area_that_router_operated": "Nama Lokasi\/Wilayah Router beroperasi", + "Payment_Notification_URL__Recurring_Notification_URL__Pay_Account_Notification_URL": "Payment Notification URL, Recurring Notification URL, Pay Account Notification URL", + "Finish_Redirect_URL__Unfinish_Redirect_URL__Error_Redirect_URL": "Finish Redirect URL, Unfinish Redirect URL, Error Redirect URL", + "Status": "Status", + "Plan_Not_found": "Plan Not found", + "Failed_to_create_transaction_": "Failed to create transaction.", + "Seller_has_not_yet_setup_Xendit_payment_gateway": "Seller has not yet setup Xendit payment gateway", + "Admin_has_not_yet_setup_Xendit_payment_gateway__please_tell_admin": "Admin has not yet setup Xendit payment gateway, please tell admin", + "Buy_this__your_active_package_will_be_overwrite": "Buy this? your active package will be overwrite", + "You_already_have_unpaid_transaction__cancel_it_or_pay_it_": "You already have unpaid transaction, cancel it or pay it.", + "Transaction_Not_found": "Transaction Not found", + "Cancel_it_": "Cancel it?", + "expired": "expired", + "Check_for_Payment": "Check for Payment", + "Transaction_still_unpaid_": "Transaction still unpaid.", + "Paid_Date": "Paid Date", + "Transaction_has_been_paid_": "Transaction has been paid.", + "PAID": "PAID", + "CANCELED": "CANCELED", + "UNPAID": "UNPAID", + "PAY_NOW": "PAY NOW", + "Buy_Hotspot_Plan": "Buy Hotspot Plan", + "Buy_PPOE_Plan": "Buy PPOE Plan", + "Package": "Package", + "Order_Internet_Package": "Order Internet Package", + "Unknown_Command_": "Unknown Command.", + "Checking_payment": "Checking payment", + "Create_Transaction_Success": "Create Transaction Success", + "You_have_unpaid_transaction": "You have unpaid transaction", + "TripayPayment_Channel": "TripayPayment Channel", + "Payment_Channel": "Payment Channel", + "Payment_check_failed_": "Payment check failed.", + "Order_Package": "Order Package", + "Transactions": "Transactions", + "Payments": "Payments", + "History": "History", + "Order_History": "Order History", + "Gateway": "Gateway", + "Date_Done": "Date Done", + "Unpaid_Order": "Unpaid Order", + "Payment_Gateway_Not_Found": "Payment Gateway Not Found", + "Payment_Gateway_saved_successfully": "Payment Gateway saved successfully", + "ORDER": "ORDER", + "Package_History": "Package History", + "Buy_History": "Buy History", + "Activation_History": "Activation History", + "Buy_Package": "Buy Package", + "Email": "Email", + "Company_Footer": "Company Footer", + "Will_show_below_user_pages": "Will show below user pages", + "Request_OTP": "Request OTP", + "Verification_Code": "Verification Code", + "SMS_Verification_Code": "SMS Verification Code", + "Please_enter_your_email_address": "Please enter your email address", + "Failed_to_create_Paypal_transaction_": "Failed to create Paypal transaction.", + "Plugin": "Plugin", + "Plugin_Manager": "Plugin Manager", + "User_Notification": "User Notification", + "Expired_Notification": "Expired Notification", + "User_will_get_notification_when_package_expired": "User will get notification when package expired", + "Expired_Notification_Message": "Expired Notification Message", + "Payment_Notification": "Payment Notification", + "User_will_get_invoice_notification_when_buy_package_or_package_refilled": "User will get invoice notification when buy package or package refilled", + "Current_IP": "Current IP", + "Current_MAC": "Current MAC", + "Login_Status": "Login Status", + "Login_Request_successfully": "Login Request successfully", + "Logout_Request_successfully": "Logout Request successfully", + "Disconnect_Internet_": "Disconnect Internet?", + "Not_Online__Login_now_": "Not Online, Login now?", + "You_are_Online__Logout_": "You are Online, Logout?", + "Connect_to_Internet_": "Connect to Internet?", + "Your_account_not_connected_to_internet": "Your account not connected to internet", + "Balance": "Balance", + "Balance_System": "Balance System", + "Enable_System": "Enable System", + "Allow_Transfer": "Allow Transfer", + "Telegram_Notification": "Telegram Notification", + "SMS_OTP_Registration": "SMS OTP Registration", + "Whatsapp_Notification": "Whatsapp Notification", + "Tawk_to_Chat_Widget": "Tawk.to Chat Widget", + "Invoice": "Invoice", + "Country_Code_Phone": "Country Code Phone", + "Voucher_activation_menu_will_be_hidden": "Voucher activation menu will be hidden", + "Customer_can_deposit_money_to_buy_voucher": "Customer can deposit money to buy voucher", + "Allow_balance_transfer_between_customers": "Allow balance transfer between customers", + "Refill_Balance": "Refill Balance", + "Balance_Plans": "Balance Plans", + "Failed_to_create_transaction__": "Failed to create transaction. ", + "Failed_to_check_status_transaction__": "Failed to check status transaction. ", + "Disable_Voucher": "Disable Voucher", + "Reminder_Notification": "Reminder Notification", + "Reminder_Notification_Message": "Reminder Notification Message", + "Reminder_7_days": "Reminder 7 days", + "Reminder_3_days": "Reminder 3 days", + "Reminder_1_day": "Reminder 1 day", + "PPPOE_Password": "PPPOE Password", + "User_Cannot_change_this__only_admin__if_it_Empty_it_will_use_user_password": "User Cannot change this, only admin. if it Empty it will use user password", + "Invoice_Balance_Message": "Invoice Balance Message", + "Invoice_Notification_Payment": "Invoice Notification Payment", + "Balance_Notification_Payment": "Balance Notification Payment", + "Buy_Balance": "Buy Balance", + "Price": "Price", + "Validity": "Validity", + "Disable_auto_renewal_": "Disable auto renewal?", + "Auto_Renewal_On": "Auto Renewal On", + "Enable_auto_renewal_": "Enable auto renewal?", + "Auto_Renewal_Off": "Auto Renewal Off", + "Invoice_Footer": "Invoice Footer", + "Pay_With_Balance": "Pay With Balance", + "Pay_this_with_Balance__your_active_package_will_be_overwrite": "Pay this with Balance? your active package will be overwrite", + "Success_to_buy_package": "Success to buy package", + "Auto_Renewal": "Auto Renewal", + "View": "View", + "Back": "Back", + "Active": "Active", + "Transfer_Balance": "Transfer Balance", + "Send_your_balance_": "Send your balance?", + "Send": "Send", + "Cannot_send_to_yourself": "Cannot send to yourself", + "Sending_balance_success": "Sending balance success", + "From": "From", + "To": "To", + "insufficient_balance": "insufficient balance", + "Send_Balance": "Send Balance", + "Received_Balance": "Received Balance", + "Minimum_Balance_Transfer": "Minimum Balance Transfer", + "Minimum_Transfer": "Minimum Transfer", + "Company_Logo": "Company Logo", + "Expired_IP_Pool": "Expired IP Pool", + "Proxy": "Proxy", + "Proxy_Server": "Proxy Server", + "Proxy_Server_Login": "Proxy Server Login", + "Hotspot_Plan": "Hotspot Plan", + "PPPOE_Plan": "PPPOE Plan", + "UNKNOWN": "UNKNOWN", + "Are_You_Sure_": "Are You Sure?", + "Success_to_send_package": "Success to send package", + "Target_has_active_plan__different_with_current_plant_": "Target has active plan, different with current plant.", + "Recharge_a_friend": "Recharge a friend", + "Buy_for_friend": "Buy for friend", + "Buy_this_for_friend_account_": "Buy this for friend account?", + "Review_package_before_recharge": "Review package before recharge", + "Activate": "Activate", + "Deactivate": "Deactivate", + "Sync": "Sync", + "Failed_to_create_PaymeTrust_transaction_": "Failed to create PaymeTrust transaction.", + "Location": "Location", + "Voucher_Format": "Voucher Format", + "Service_Type": "Service Type", + "Others": "Others", + "PPPoE": "PPPoE", + "Hotspot": "Hotspot", + "Monthly_Registered_Customers": "Monthly Registered Customers", + "Total_Monthly_Sales": "Total Monthly Sales", + "Active_Users": "Active Users" +} \ No newline at end of file diff --git a/system/lan/spanish/common.lan.php b/system/lan/spanish/common.lan.php deleted file mode 100644 index 2c13913a..00000000 --- a/system/lan/spanish/common.lan.php +++ /dev/null @@ -1,404 +0,0 @@ -chmod 664 pages/*.html"; -$_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['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'] = 'MIKRO-RED 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.
Ver proyecto aqui'; - -//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'; -$_L['Payment_Gateway_Not_Found'] = 'Payment Gateway Not Found'; -$_L['Payment_Gateway_saved_successfully'] = 'Payment Gateway saved successfully'; -$_L['ORDER'] = 'ORDER'; -$_L['Package_History'] = 'Package History'; -$_L['Buy_History'] = 'Buy History'; -$_L['Activation_History'] = 'Activation History'; -$_L['Buy_Package'] = 'Buy Package'; -$_L['Email'] = 'Email'; -$_L['Company_Footer'] = 'Company Footer'; -$_L['Will_show_below_user_pages'] = 'Will show below user pages'; -$_L['Request_OTP'] = 'Request OTP'; -$_L['Verification_Code'] = 'Verification Code'; -$_L['SMS_Verification_Code'] = 'SMS Verification Code'; -$_L['Please_enter_your_email_address'] = 'Please enter your email address'; -$_L['Failed_to_create_Paypal_transaction'] = 'Failed to create Paypal transaction.'; -$_L['Plugin'] = 'Plugin'; -$_L['Plugin_Manager'] = 'Plugin Manager'; -$_L['User_Notification'] = 'User Notification'; -$_L['Expired_Notification'] = 'Expired Notification'; -$_L['User_will_get_notification_when_package_expired'] = 'User will get notification when package expired'; -$_L['Expired_Notification_Message'] = 'Expired Notification Message'; -$_L['bnameb_will_be_replaced_with_Customer_Name_bpackageb_will_be_replaced_with_Package_name'] = '[[name]] will be replaced with Customer Name. [[package]] will be replaced with Package name.'; -$_L['Payment_Notification'] = 'Payment Notification'; -$_L['User_will_get_invoice_notification_when_buy_package_or_package_refilled'] = 'User will get invoice notification when buy package or package refilled'; -$_L['Current_IP'] = 'Current IP'; -$_L['Current_MAC'] = 'Current MAC'; -$_L['Login_Status'] = 'Login Status'; -$_L['Login_Request_successfully'] = 'Login Request successfully'; -$_L['Logout_Request_successfully'] = 'Logout Request successfully'; -$_L['Disconnect_Internet'] = 'Disconnect Internet?'; -$_L['Not_Online_Login_now'] = 'Not Online, Login now?'; -$_L['You_are_Online_Logout'] = 'You are Online, Logout?'; -$_L['Connect_to_Internet'] = 'Connect to Internet?'; -$_L['Your_account_not_connected_to_internet'] = 'Your account not connected to internet'; -$_L['Balance'] = 'Balance'; -$_L['Balance_System'] = 'Balance System'; -$_L['Enable_System'] = 'Enable System'; -$_L['Allow_Transfer'] = 'Allow Transfer'; -$_L['Telegram_Notification'] = 'Telegram Notification'; -$_L['SMS_OTP_Registration'] = 'SMS OTP Registration'; -$_L['Whatsapp_Notification'] = 'Whatsapp Notification'; -$_L['Tawkto_Chat_Widget'] = 'Tawk.to Chat Widget'; -$_L['Invoice'] = 'Invoice'; -$_L['Country_Code_Phone'] = 'Country Code Phone'; -$_L['Voucher_activation_menu_will_be_hidden'] = 'Voucher activation menu will be hidden'; -$_L['Customer_can_deposit_money_to_buy_voucher'] = 'Customer can deposit money to buy voucher'; -$_L['Allow_balance_transfer_between_customers'] = 'Allow balance transfer between customers';$_L['Refill_Balance'] = 'Refill Balance'; -$_L['Balance_Plans'] = 'Balance Plans'; - -$_L['Failed_to_create_transaction_'] = 'Failed to create transaction. '; -$_L['Failed_to_check_status_transaction_'] = 'Failed to check status transaction. '; -$_L['Disable_Voucher'] = 'Disable Voucher'; -$_L['Reminder_Notification'] = 'Reminder Notification'; -$_L['Reminder_Notification_Message'] = 'Reminder Notification Message'; -$_L['Reminder_7_days'] = 'Reminder 7 days'; -$_L['Reminder_3_days'] = 'Reminder 3 days'; -$_L['Reminder_1_day'] = 'Reminder 1 day'; -$_L['PPPOE_Password'] = 'PPPOE Password'; -$_L['User_Cannot_change_this_only_admin_if_it_Empty_it_will_use_user_password'] = 'User Cannot change this, only admin. if it Empty it will use user password'; -$_L['Invoice_Balance_Message'] = 'Invoice Balance Message'; -$_L['Invoice_Notification_Payment'] = 'Invoice Notification Payment'; -$_L['Balance_Notification_Payment'] = 'Balance Notification Payment'; -$_L['Buy_Balance'] = 'Buy Balance'; -$_L['Price'] = 'Price'; -$_L['Validity'] = 'Validity'; -$_L['Disable_auto_renewal'] = 'Disable auto renewal?'; -$_L['Auto_Renewal_On'] = 'Auto Renewal On'; -$_L['Enable_auto_renewal'] = 'Enable auto renewal?'; -$_L['Auto_Renewal_Off'] = 'Auto Renewal Off'; -$_L['Invoice_Footer'] = 'Invoice Footer'; -$_L['Pay_With_Balance'] = 'Pay With Balance'; -$_L['Pay_this_with_Balance_your_active_package_will_be_overwrite'] = 'Pay this with Balance? your active package will be overwrite'; -$_L['Success_to_buy_package'] = 'Success to buy package'; -$_L['Auto_Renewal'] = 'Auto Renewal'; -$_L['View'] = 'View'; -$_L['Back'] = 'Back'; -$_L['Active'] = 'Active'; -$_L['Transfer_Balance'] = 'Transfer Balance'; -$_L['Send_your_balance'] = 'Send your balance?'; -$_L['Send'] = 'Send'; -$_L['Cannot_send_to_yourself'] = 'Cannot send to yourself'; -$_L['Sending_balance_success'] = 'Sending balance success'; -$_L['From'] = 'From'; -$_L['To'] = 'To'; -$_L['insufficient_balance'] = 'insufficient balance'; -$_L['Send_Balance'] = 'Send Balance'; -$_L['Received_Balance'] = 'Received Balance'; -$_L['Minimum_Balance_Transfer'] = 'Minimum Balance Transfer'; -$_L['Minimum_Transfer'] = 'Minimum Transfer'; -$_L['Company_Logo'] = 'Company Logo'; -$_L['Expired_IP_Pool'] = 'Expired IP Pool'; -$_L['Proxy'] = 'Proxy'; -$_L['Proxy_Server'] = 'Proxy Server'; -$_L['Proxy_Server_Login'] = 'Proxy Server Login'; -$_L['Hotspot_Plan'] = 'Hotspot Plan'; -$_L['PPPOE_Plan'] = 'PPPOE Plan'; -$_L['UNKNOWN'] = 'UNKNOWN'; -$_L['Are_You_Sure'] = 'Are You Sure?'; -$_L['Success_to_send_package'] = 'Success to send package'; -$_L['Target_has_active_plan_different_with_current_plant'] = 'Target has active plan, different with current plant.'; -$_L['Recharge_a_friend'] = 'Recharge a friend'; -$_L['Buy_for_friend'] = 'Buy for friend'; -$_L['Buy_this_for_friend_account'] = 'Buy this for friend account?'; -$_L['Review_package_before_recharge'] = 'Review package before recharge'; -$_L['Activate'] = 'Activate'; -$_L['Deactivate'] = 'Deactivate'; -$_L['Sync'] = 'Sync'; -$_L['Failed_to_create_PaymeTrust_transaction'] = 'Failed to create PaymeTrust transaction.'; -$_L['Location'] = 'Location'; -$_L['Voucher_Format'] = 'Voucher Format'; \ No newline at end of file diff --git a/system/lan/turkish.json b/system/lan/turkish.json new file mode 100644 index 00000000..7f9357db --- /dev/null +++ b/system/lan/turkish.json @@ -0,0 +1,372 @@ +{ + "Log_in": "Oturum a\u00e7", + "Register": "Kay\u0131t olmak", + "Announcement": "Duyuru", + "Registration_Info": "Kay\u0131t Bilgisi", + "Voucher_not_found__please_buy_voucher_befor_register": "Kupon bulunamad\u0131, l\u00fctfen kay\u0131t olun ve kay\u0131t olun", + "Register_Success__You_can_login_now": "Kay\u0131t Ba\u015far\u0131l\u0131! \u015eimdi giri\u015f yapabilirsiniz ", + "Log_in_to_Member_Panel": "\u00dcye Paneli'ne giri\u015f yap\u0131n", + "Register_as_Member": "\u00dcye olarak kay\u0131t ol", + "Enter_Admin_Area": "Y\u00f6netici Paneli Giri\u015fi", + "PHPNuxBill": "PHPNuxBill", + "Username": "Kullan\u0131c\u0131 ad\u0131", + "Password": "Parola", + "Passwords_does_not_match": "Parolalar e\u015fle\u015fmiyor", + "Account_already_axist": "Hesap zaten aksanl\u0131", + "Manage": "Y\u00f6net", + "Submit": "G\u00f6nder", + "Save_Changes": "De\u011fi\u015fiklikleri Kaydet", + "Cancel": "\u0130ptal etmek", + "Edit": "D\u00fczenle", + "Delete": "Sil", + "Welcome": "Ho\u015fgeldiniz", + "Data_Created_Successfully": "Veriler Ba\u015far\u0131yla Olu\u015fturuldu ", + "Data_Updated_Successfully": "Veriler Ba\u015far\u0131yla G\u00fcncellendi", + "Data_Deleted_Successfully": "Veri Ba\u015far\u0131yla Silindi", + "Dashboard": "Dashboard", + "Search_Customers___": "M\u00fc\u015fteri Ara ...", + "My_Account": "Hesab\u0131m", + "My_Profile": "Benim profilim", + "Settings": "Ayarlar", + "Edit_Profile": "Profili D\u00fczenle", + "Change_Password": "\u015eifre de\u011fi\u015ftir", + "Logout": "\u00c7\u0131k\u0131\u015f Yap", + "Services": "Hizmetler", + "Bandwidth_Plans": "Bant Geni\u015fli\u011fi Planlar\u0131", + "Bandwidth_Name": "Bant Geni\u015fli\u011fi Ad\u0131", + "New_Bandwidth": "Yeni Bant Geni\u015fli\u011fi", + "Edit_Bandwidth": "Bant Geni\u015fli\u011fini D\u00fczenle", + "Add_New_Bandwidth": "Yeni Bant Geni\u015fli\u011fi Ekle", + "Rate_Download": "\u0130ndirme Oran\u0131", + "Rate_Upload": "\u00dccret Y\u00fckleme", + "Name_Bandwidth_Already_Exist": "Bandwidth Ad\u0131 Zaten Var", + "Hotspot_Plans": "Hotspot Planlar\u0131", + "PPPOE_Plans": "PPPOE Planlar\u0131", + "Plan_Name": "Plan Ad\u0131", + "New_Service_Plan": "Yeni Hizmet Plan\u0131", + "Add_Service_Plan": "Hizmet Plan\u0131 Ekle", + "Edit_Service_Plan": "Hizmet Plan\u0131n\u0131 D\u00fczenle", + "Name_Plan_Already_Exist": "Plan\u0131 \u0130smi Zaten Var", + "Plan_Type": "Plan T\u00fcr\u00fc", + "Plan_Price": "Plan Fiyat\u0131", + "Limit_Type": "S\u0131n\u0131r Tipi", + "Unlimited": "S\u0131n\u0131rs\u0131z", + "Limited": "S\u0131n\u0131rl\u0131", + "Time_Limit": "Zaman s\u0131n\u0131r\u0131", + "Data_Limit": "Veri S\u0131n\u0131r\u0131", + "Both_Limit": "Her \u0130ki S\u0131n\u0131r", + "Plan_Validity": "Plan Ge\u00e7erlili\u011fi", + "Select_Bandwidth": "Bant Geni\u015fli\u011fini Se\u00e7", + "Shared_Users": "Payla\u015f\u0131lan Kullan\u0131c\u0131lar", + "Choose_User_Type_Sales_to_disable_access_to_Settings": "Ayarlar'a eri\u015fimi devre d\u0131\u015f\u0131 b\u0131rakmak i\u00e7in Kullan\u0131c\u0131 T\u00fcr\u00fc Sat\u0131\u015flar\u0131n\u0131 Se\u00e7", + "Current_Password": "\u015eimdiki \u015eifre", + "New_Password": "Yeni \u015eifre", + "Administrator": "Y\u00f6netici", + "Sales": "Sat\u0131\u015f", + "Member": "\u00dcye", + "Confirm_New_Password": "Yeni \u015fifreyi onayla", + "Confirm_Password": "\u015eifreyi Onayla", + "Full_Name": "Ad Soyad", + "User_Type": "Kullan\u0131c\u0131 tipi", + "Address": "Adres", + "Created_On": "Olu\u015fturuldu", + "Expires_On": "Tarihinde sona eriyor", + "Phone_Number": "Telefon numaras\u0131", + "User_deleted_Successfully": "Kullan\u0131c\u0131 Ba\u015far\u0131yla Silindi", + "Full_Administrator": "Tam Y\u00f6netici", + "Keep_Blank_to_do_not_change_Password": "\u015eifreyi de\u011fi\u015ftirmemek i\u00e7in bo\u015f tutun", + "Keep_it_blank_if_you_do_not_want_to_show_currency_code": "Para birimi kodunu g\u00f6stermek istemiyorsan\u0131z bo\u015f b\u0131rak\u0131n", + "Theme_Style": "Tema Stili", + "Theme_Color": "Tema Rengi", + "Default_Language": "Varsay\u0131lan dil", + "Network": "A\u011f", + "Routers": "Y\u00f6nlendiriciler", + "IP_Pool": "IP Havuzu", + "New_Router": "Yeni Y\u00f6nlendirici", + "Add_Router": "Router ekle", + "Edit_Router": "Y\u00f6nlendiriciyi D\u00fczenle", + "Router_Name": "Y\u00f6nlendirici Ad\u0131", + "IP_Address": "IP adresi", + "Router_Secret": "Y\u00f6nlendirici S\u0131rr\u0131", + "Description": "A\u00e7\u0131klama", + "IP_Router_Already_Exist": "IP Router Zaten Var", + "Name_Pool": "\u0130sim Havuzu", + "Range_IP": "Aral\u0131k \u0130P", + "New_Pool": "Yeni Havuz", + "Add_Pool": "Havuz ekle", + "Edit_Pool": "Havuzu D\u00fczenle", + "Pool_Name_Already_Exist": "Havuz Ad\u0131 \u200b\u200bZaten Var", + "Refill_Account": "Hesab\u0131 Yenile", + "Recharge_Account": "Hesab\u0131 Yeniden \u015earj Et", + "Select_Account": "Hesap Se\u00e7", + "Service_Plan": "Servis plan\u0131", + "Recharge": "\u015earj", + "Method": "Y\u00f6ntem", + "Account_Created_Successfully": "Hesap ba\u015far\u0131yla olu\u015fturuldu", + "Database_Status": "Veritaban\u0131 Durumu", + "Total_Database_Size": "Toplam Veritaban\u0131 Boyutu", + "Download_Database_Backup": "Veritaban\u0131 Yedekleme \u0130ndir", + "Table_Name": "Tablo ismi", + "Rows": "Sat\u0131r", + "Size": "Boyut", + "Customer": "M\u00fc\u015fteri", + "Add_New_Contact": "Yeni \u0130leti\u015fim Ekle", + "Edit_Contact": "\u0130leti\u015fim D\u00fczenle", + "List_Contact": "Liste \u0130rtibat", + "Manage_Contact": "Ki\u015fiyi Y\u00f6netin", + "Reports": "Raporlar", + "Daily_Reports": "G\u00fcnl\u00fck raporlar", + "Period_Reports": "D\u00f6nem Raporlar\u0131", + "All_Transactions": "T\u00fcm \u0130\u015flemler", + "Total_Income": "Toplam gelir", + "All_Transactions_at_Date": "Tarihte T\u00fcm \u0130\u015flemler", + "Export_for_Print": "Bask\u0131 i\u00e7in \u0130hracat", + "Print": "Bask\u0131", + "Export_to_PDF": "PDF'ye Aktar", + "Click_Here_to_Print": "Yazd\u0131rmak i\u00e7in Buraya T\u0131klay\u0131n", + "You_can_use_html_tag": "Html etiketini kullanabilirsiniz", + "Date_Format": "Tarih format\u0131", + "Income_Today": "Gelir Bug\u00fcn", + "Income_This_Month": "Bu Ay Gelir", + "Users_Active": "Kullan\u0131c\u0131lar Aktif", + "Total_Users": "Toplam Kullan\u0131c\u0131", + "Users": "Kullan\u0131c\u0131lar", + "Edit_User": "Kullan\u0131c\u0131y\u0131 d\u00fczenle", + "Last_Login": "Son giri\u015f", + "Administrator_Users": "Y\u00f6netici Kullan\u0131c\u0131lar\u0131", + "Manage_Administrator": "Y\u00f6netici Y\u00f6net", + "Add_New_Administrator": "Yeni Y\u00f6netici Ekleyin", + "Localisation": "Lokalizasyon", + "Backup_Restore": "Yedekleme \/ Geri", + "General_Settings": "Genel Ayarlar", + "Date": "Tarih", + "Login_Successful": "Giri\u015f ba\u015far\u0131l\u0131", + "Failed_Login": "Ba\u015far\u0131s\u0131z oturum a\u00e7ma", + "Settings_Saved_Successfully": "Ayarlar ba\u015far\u0131yla kaydedildi", + "User_Updated_Successfully": "Kullan\u0131c\u0131 Ba\u015far\u0131yla G\u00fcncellendi", + "User_Expired__Today": "Kullan\u0131c\u0131 S\u00fcresi Doldu, Bug\u00fcn", + "Activity_Log": "Etkinlik G\u00fcnl\u00fc\u011f\u00fc", + "View_Reports": "Raporlar\u0131 G\u00f6r\u00fcnt\u00fcle", + "View_All": "Hepsini g\u00f6r", + "Number_of_Vouchers": "Kuponlar\u0131n Say\u0131s\u0131", + "Length_Code": "Uzunluk Kodu", + "Code_Voucher": "Kod Makbuzu", + "Voucher": "Fi\u015f", + "Hotspot_Voucher": "Hotspot Kuponu", + "Status_Voucher": "Durum Makbuzu", + "Add_Vouchers": "Kupon Ekle", + "Create_Vouchers_Successfully": "Kuponlar\u0131 ba\u015far\u0131yla olu\u015ftur", + "Generate": "Genel", + "Print_side_by_side__it_will_easy_to_cut": "Yanyana yazd\u0131r\u0131rsan\u0131z, kesmesi daha kolay olacakt\u0131r.", + "From_Date": "\u0130tibaren", + "To_Date": "Bug\u00fcne kadar", + "New_Service": "Yeni Servis", + "Type": "T\u00fcr", + "Finish": "Biti\u015f", + "Application_Name__Company_Name": "Uygulama Ad\u0131 \/ \u015eirket Ad\u0131", + "This_Name_will_be_shown_on_the_Title": "Bu \u0130sim Ba\u015fl\u0131kta g\u00f6sterilecek", + "Next": "Sonraki", + "Last": "Son", + "Timezone": "Saat dilimi", + "Decimal_Point": "Ondal\u0131k nokta", + "Thousands_Separator": "Bin Ay\u0131r\u0131c\u0131", + "Currency_Code": "Para Birimi Kodu", + "Order_Voucher": "Sipari\u015f Makbuzu", + "Voucher_Activation": "Kupon Aktivasyonu", + "List_Activated_Voucher": "Aktif Fi\u015f Listesi", + "Enter_voucher_code_here": "Kupon kodunu buraya girin", + "Private_Message": "\u00d6zel mesaj", + "Inbox": "Gelen kutusu", + "Outbox": "Giden", + "Compose": "Olu\u015fturma", + "Send_to": "G\u00f6nderildi", + "Title": "Ba\u015fl\u0131k", + "Message": "Mesaj", + "Your_Account_Information": "Hesap Bilgileriniz", + "Invalid_Username_or_Password": "Ge\u00e7ersiz kullan\u0131c\u0131 ad\u0131 veya \u015fifre", + "You_do_not_have_permission_to_access_this_page": "Bu sayfaya eri\u015fim izniniz yok", + "Incorrect_Current_Password": "Yanl\u0131\u015f Ge\u00e7erli \u015eifre", + "Password_changed_successfully__Please_login_again": "\u015eifre ba\u015far\u0131yla de\u011fi\u015ftirildi, L\u00fctfen tekrar giri\u015f yap\u0131n", + "All_field_is_required": "T\u00fcm alan gerekli", + "Voucher_Not_Valid": "Kupon Ge\u00e7erli De\u011fil", + "Activation_Vouchers_Successfully": "Aktivasyon Kuponlar\u0131 Ba\u015far\u0131yla", + "Data_Not_Found": "Veri bulunamad\u0131", + "Search_by_Username": "Kullan\u0131c\u0131 Ad\u0131na G\u00f6re Ara", + "Search_by_Name": "\u0130sme G\u00f6re Ara", + "Search_by_Code_Voucher": "Kod Makbuzuna G\u00f6re Ara", + "Search": "Arama", + "Select_a_customer": "Bir m\u00fc\u015fteri se\u00e7in", + "Select_Routers": "Router'lar\u0131 Se\u00e7", + "Select_Plans": "Planlar\u0131 Se\u00e7", + "Select_Pool": "Havuz Se\u00e7", + "Hrs": "Saat", + "Mins": "Dk", + "Days": "G\u00fcn", + "Months": "Ay", + "Add_Language": "Dil Ekle", + "Language_Name": "Dil ad\u0131", + "Folder_Name": "Klas\u00f6r ad\u0131", + "Translator": "\u00c7evirmen", + "Language_Name_Already_Exist": "Dil Ad\u0131 Zaten Var", + "Payment_Gateway": "Payment Gateway", + "Community": "Community", + "1_user_can_be_used_for_many_devices_": "1 user can be used for many devices?", + "Cannot_be_change_after_saved": "Cannot be change after saved", + "Explain_Coverage_of_router": "Jelaskan Cakupan wilayah hotspot", + "Name_of_Area_that_router_operated": "Nama Lokasi\/Wilayah Router beroperasi", + "Payment_Notification_URL__Recurring_Notification_URL__Pay_Account_Notification_URL": "Payment Notification URL, Recurring Notification URL, Pay Account Notification URL", + "Finish_Redirect_URL__Unfinish_Redirect_URL__Error_Redirect_URL": "Finish Redirect URL, Unfinish Redirect URL, Error Redirect URL", + "Status": "Status", + "Plan_Not_found": "Plan Not found", + "Failed_to_create_transaction_": "Failed to create transaction.", + "Seller_has_not_yet_setup_Xendit_payment_gateway": "Seller has not yet setup Xendit payment gateway", + "Admin_has_not_yet_setup_Xendit_payment_gateway__please_tell_admin": "Admin has not yet setup Xendit payment gateway, please tell admin", + "Buy_this__your_active_package_will_be_overwrite": "Buy this? your active package will be overwrite", + "You_already_have_unpaid_transaction__cancel_it_or_pay_it_": "You already have unpaid transaction, cancel it or pay it.", + "Transaction_Not_found": "Transaction Not found", + "Cancel_it_": "Cancel it?", + "expired": "expired", + "Check_for_Payment": "Check for Payment", + "Transaction_still_unpaid_": "Transaction still unpaid.", + "Paid_Date": "Paid Date", + "Transaction_has_been_paid_": "Transaction has been paid.", + "PAID": "PAID", + "CANCELED": "CANCELED", + "UNPAID": "UNPAID", + "PAY_NOW": "PAY NOW", + "Buy_Hotspot_Plan": "Buy Hotspot Plan", + "Buy_PPOE_Plan": "Buy PPOE Plan", + "Package": "Package", + "Order_Internet_Package": "Order Internet Package", + "Unknown_Command_": "Unknown Command.", + "Checking_payment": "Checking payment", + "Create_Transaction_Success": "Create Transaction Success", + "You_have_unpaid_transaction": "You have unpaid transaction", + "TripayPayment_Channel": "TripayPayment Channel", + "Payment_Channel": "Payment Channel", + "Payment_check_failed_": "Payment check failed.", + "Order_Package": "Order Package", + "Transactions": "Transactions", + "Payments": "Payments", + "History": "History", + "Order_History": "Order History", + "Gateway": "Gateway", + "Date_Done": "Date Done", + "Unpaid_Order": "Unpaid Order", + "Payment_Gateway_Not_Found": "Payment Gateway Not Found", + "Payment_Gateway_saved_successfully": "Payment Gateway saved successfully", + "ORDER": "ORDER", + "Package_History": "Package History", + "Buy_History": "Buy History", + "Activation_History": "Activation History", + "Buy_Package": "Buy Package", + "Email": "Email", + "Company_Footer": "Company Footer", + "Will_show_below_user_pages": "Will show below user pages", + "Request_OTP": "Request OTP", + "Verification_Code": "Verification Code", + "SMS_Verification_Code": "SMS Verification Code", + "Please_enter_your_email_address": "Please enter your email address", + "Failed_to_create_Paypal_transaction_": "Failed to create Paypal transaction.", + "Plugin": "Plugin", + "Plugin_Manager": "Plugin Manager", + "User_Notification": "User Notification", + "Expired_Notification": "Expired Notification", + "User_will_get_notification_when_package_expired": "User will get notification when package expired", + "Expired_Notification_Message": "Expired Notification Message", + "Payment_Notification": "Payment Notification", + "User_will_get_invoice_notification_when_buy_package_or_package_refilled": "User will get invoice notification when buy package or package refilled", + "Current_IP": "Current IP", + "Current_MAC": "Current MAC", + "Login_Status": "Login Status", + "Login_Request_successfully": "Login Request successfully", + "Logout_Request_successfully": "Logout Request successfully", + "Disconnect_Internet_": "Disconnect Internet?", + "Not_Online__Login_now_": "Not Online, Login now?", + "You_are_Online__Logout_": "You are Online, Logout?", + "Connect_to_Internet_": "Connect to Internet?", + "Your_account_not_connected_to_internet": "Your account not connected to internet", + "Balance": "Balance", + "Balance_System": "Balance System", + "Enable_System": "Enable System", + "Allow_Transfer": "Allow Transfer", + "Telegram_Notification": "Telegram Notification", + "SMS_OTP_Registration": "SMS OTP Registration", + "Whatsapp_Notification": "Whatsapp Notification", + "Tawk_to_Chat_Widget": "Tawk.to Chat Widget", + "Invoice": "Invoice", + "Country_Code_Phone": "Country Code Phone", + "Voucher_activation_menu_will_be_hidden": "Voucher activation menu will be hidden", + "Customer_can_deposit_money_to_buy_voucher": "Customer can deposit money to buy voucher", + "Allow_balance_transfer_between_customers": "Allow balance transfer between customers", + "Failed_to_create_transaction__": "Failed to create transaction. ", + "Failed_to_check_status_transaction__": "Failed to check status transaction. ", + "Disable_Voucher": "Disable Voucher", + "Reminder_Notification": "Reminder Notification", + "Reminder_Notification_Message": "Reminder Notification Message", + "Reminder_7_days": "Reminder 7 days", + "Reminder_3_days": "Reminder 3 days", + "Reminder_1_day": "Reminder 1 day", + "PPPOE_Password": "PPPOE Password", + "User_Cannot_change_this__only_admin__if_it_Empty_it_will_use_user_password": "User Cannot change this, only admin. if it Empty it will use user password", + "Invoice_Balance_Message": "Invoice Balance Message", + "Invoice_Notification_Payment": "Invoice Notification Payment", + "Balance_Notification_Payment": "Balance Notification Payment", + "Balance_Plans": "Balance Plans", + "Buy_Balance": "Buy Balance", + "Price": "Price", + "Validity": "Validity", + "Disable_auto_renewal_": "Disable auto renewal?", + "Auto_Renewal_On": "Auto Renewal On", + "Enable_auto_renewal_": "Enable auto renewal?", + "Auto_Renewal_Off": "Auto Renewal Off", + "Refill_Balance": "Refill Balance", + "Invoice_Footer": "Invoice Footer", + "Pay_With_Balance": "Pay With Balance", + "Pay_this_with_Balance__your_active_package_will_be_overwrite": "Pay this with Balance? your active package will be overwrite", + "Success_to_buy_package": "Success to buy package", + "Auto_Renewal": "Auto Renewal", + "View": "View", + "Back": "Back", + "Active": "Active", + "Transfer_Balance": "Transfer Balance", + "Send_your_balance_": "Send your balance?", + "Send": "Send", + "Cannot_send_to_yourself": "Cannot send to yourself", + "Sending_balance_success": "Sending balance success", + "From": "From", + "To": "To", + "insufficient_balance": "insufficient balance", + "Send_Balance": "Send Balance", + "Received_Balance": "Received Balance", + "Minimum_Balance_Transfer": "Minimum Balance Transfer", + "Minimum_Transfer": "Minimum Transfer", + "Company_Logo": "Company Logo", + "Expired_IP_Pool": "Expired IP Pool", + "Proxy": "Proxy", + "Proxy_Server": "Proxy Server", + "Proxy_Server_Login": "Proxy Server Login", + "Hotspot_Plan": "Hotspot Plan", + "PPPOE_Plan": "PPPOE Plan", + "UNKNOWN": "UNKNOWN", + "Are_You_Sure_": "Are You Sure?", + "Success_to_send_package": "Success to send package", + "Target_has_active_plan__different_with_current_plant_": "Target has active plan, different with current plant.", + "Recharge_a_friend": "Recharge a friend", + "Buy_for_friend": "Buy for friend", + "Buy_this_for_friend_account_": "Buy this for friend account?", + "Review_package_before_recharge": "Review package before recharge", + "Activate": "Activate", + "Deactivate": "Deactivate", + "Sync": "Sync", + "Failed_to_create_PaymeTrust_transaction_": "Failed to create PaymeTrust transaction.", + "Location": "Location", + "Voucher_Format": "Voucher Format", + "Service_Type": "Service Type", + "Others": "Others", + "PPPoE": "PPPoE", + "Hotspot": "Hotspot", + "Monthly_Registered_Customers": "Monthly Registered Customers", + "Total_Monthly_Sales": "Total Monthly Sales", + "Active_Users": "Active Users" +} \ No newline at end of file diff --git a/system/lan/turkish/common.lan.php b/system/lan/turkish/common.lan.php deleted file mode 100755 index d7d5dd59..00000000 --- a/system/lan/turkish/common.lan.php +++ /dev/null @@ -1,381 +0,0 @@ - PHPNuxBill , PHP ve Mikrotik API kullanılarak Mikrotik için bir faturalandırma Hotspot ve PPPOE olup, yönlendiriciyle iletişim kurar. Bu uygulamayla daha fazla kazanç elde ederseniz, lütfen bize bağış yapın.
Projeyi buradan izleyin '; -$_L['Invalid_Username_or_Password'] = 'Geçersiz kullanıcı adı veya şifre'; -$_L['Do_Not_Access'] = 'Bu sayfaya erişim izniniz yok'; -$_L['Incorrect_Current_Password'] = 'Yanlış Geçerli Şifre'; -$_L['Password_Changed_Successfully'] = 'Şifre başarıyla değiştirildi, Lütfen tekrar giriş yapın'; -$_L['All_field_is_required'] = 'Tüm alan gerekli'; -$_L['Voucher_Not_Valid'] = 'Kupon Geçerli Değil'; -$_L['Activation_Vouchers_Successfully'] = 'Aktivasyon Kuponları Başarıyla'; -$_L['Data_Not_Found'] = 'Veri bulunamadı'; -$_L['Search_by_Username'] = 'Kullanıcı Adına Göre Ara'; -$_L['Search_by_Name'] = 'İsme Göre Ara'; -$_L['Search_by_Code'] = 'Kod Makbuzuna Göre Ara'; -$_L['Search'] = 'Arama'; -$_L['Select_Customer'] = 'Bir müşteri seçin'; -$_L['Select_Routers'] = 'Router\'ları Seç'; -$_L['Select_Plans'] = 'Planları Seç'; -$_L['Select_Pool'] = 'Havuz Seç'; -$_L['Hrs'] = 'Saat'; -$_L['Mins'] = 'Dk'; -$_L['Days'] = 'Gün'; -$_L['Months'] = 'Ay'; -$_L['Add_Language'] = 'Dil Ekle'; -$_L['Name_Lang'] = 'Dil adı'; -$_L['Folder_Lang'] = 'Klasör adı'; -$_L['Translator'] = 'Çevirmen'; -$_L['Lang_already_exist'] = 'Dil Adı Zaten Var'; - -$_L['Payment_Gateway'] = 'Payment Gateway'; -$_L['Community'] = 'Community'; -$_L['1_user_can_be_used_for_many_devices'] = '1 user can be used for many devices?'; -$_L['Cannot_be_change_after_saved'] = 'Cannot be change after saved'; - -$_L['Explain_Coverage_of_router'] = 'Jelaskan Cakupan wilayah hotspot'; -$_L['Name_of_Area_that_router_operated'] = 'Nama Lokasi/Wilayah Router beroperasi'; -$_L['Payment_Notification_URL_Recurring_Notification_URL_Pay_Account_Notification_URL'] = 'Payment Notification URL, Recurring Notification URL, Pay Account Notification URL'; -$_L['Finish_Redirect_URL_Unfinish_Redirect_URL_Error_Redirect_URL'] = 'Finish Redirect URL, Unfinish Redirect URL, Error Redirect URL'; -$_L['Status'] = 'Status'; -$_L['Plan_Not_found'] = 'Plan Not found'; -$_L['Failed_to_create_transaction'] = 'Failed to create transaction.'; -$_L['Seller_has_not_yet_setup_Xendit_payment_gateway'] = 'Seller has not yet setup Xendit payment gateway'; -$_L['Admin_has_not_yet_setup_Xendit_payment_gateway_please_tell_admin'] = 'Admin has not yet setup Xendit payment gateway, please tell admin'; -$_L['Buy_this_your_active_package_will_be_overwrite'] = 'Buy this? your active package will be overwrite'; -$_L['You_already_have_unpaid_transaction_cancel_it_or_pay_it'] = 'You already have unpaid transaction, cancel it or pay it.'; -$_L['Transaction_Not_found'] = 'Transaction Not found'; -$_L['Cancel_it'] = 'Cancel it?'; -$_L['expired'] = 'expired'; -$_L['Check_for_Payment'] = 'Check for Payment'; -$_L['Transaction_still_unpaid'] = 'Transaction still unpaid.'; -$_L['Paid_Date'] = 'Paid Date'; -$_L['Transaction_has_been_paid'] = 'Transaction has been paid.'; -$_L['PAID'] = 'PAID'; -$_L['CANCELED'] = 'CANCELED'; -$_L['UNPAID'] = 'UNPAID'; -$_L['PAY_NOW'] = 'PAY NOW'; -$_L['Buy_Hotspot_Plan'] = 'Buy Hotspot Plan'; -$_L['Buy_PPOE_Plan'] = 'Buy PPOE Plan'; -$_L['Package'] = 'Package'; -$_L['Order_Internet_Package'] = 'Order Internet Package'; -$_L['Unknown_Command'] = 'Unknown Command.'; -$_L['Checking_payment'] = 'Checking payment'; -$_L['Create_Transaction_Success'] = 'Create Transaction Success'; -$_L['You_have_unpaid_transaction'] = 'You have unpaid transaction'; -$_L['TripayPayment_Channel'] = 'TripayPayment Channel'; -$_L['Payment_Channel'] = 'Payment Channel'; -$_L['Payment_check_failed'] = 'Payment check failed.'; -$_L['Order_Package'] = 'Order Package'; -$_L['Transactions'] = 'Transactions'; -$_L['Payments'] = 'Payments'; -$_L['History'] = 'History'; -$_L['Order_History'] = 'Order History'; -$_L['Gateway'] = 'Gateway'; -$_L['Date_Done'] = 'Date Done'; -$_L['Unpaid_Order'] = 'Unpaid Order'; -$_L['Payment_Gateway_Not_Found'] = 'Payment Gateway Not Found'; -$_L['Payment_Gateway_saved_successfully'] = 'Payment Gateway saved successfully'; -$_L['ORDER'] = 'ORDER'; -$_L['Package_History'] = 'Package History'; -$_L['Buy_History'] = 'Buy History'; -$_L['Activation_History'] = 'Activation History'; -$_L['Buy_Package'] = 'Buy Package'; -$_L['Email'] = 'Email'; -$_L['Company_Footer'] = 'Company Footer'; -$_L['Will_show_below_user_pages'] = 'Will show below user pages'; -$_L['Request_OTP'] = 'Request OTP'; -$_L['Verification_Code'] = 'Verification Code'; -$_L['SMS_Verification_Code'] = 'SMS Verification Code'; -$_L['Please_enter_your_email_address'] = 'Please enter your email address'; -$_L['Failed_to_create_Paypal_transaction'] = 'Failed to create Paypal transaction.'; -$_L['Plugin'] = 'Plugin'; -$_L['Plugin_Manager'] = 'Plugin Manager'; -$_L['User_Notification'] = 'User Notification'; -$_L['Expired_Notification'] = 'Expired Notification'; -$_L['User_will_get_notification_when_package_expired'] = 'User will get notification when package expired'; -$_L['Expired_Notification_Message'] = 'Expired Notification Message'; -$_L['bnameb_will_be_replaced_with_Customer_Name_bpackageb_will_be_replaced_with_Package_name'] = '[[name]] will be replaced with Customer Name. [[package]] will be replaced with Package name.'; -$_L['Payment_Notification'] = 'Payment Notification'; -$_L['User_will_get_invoice_notification_when_buy_package_or_package_refilled'] = 'User will get invoice notification when buy package or package refilled'; -$_L['Current_IP'] = 'Current IP'; -$_L['Current_MAC'] = 'Current MAC'; -$_L['Login_Status'] = 'Login Status'; -$_L['Login_Request_successfully'] = 'Login Request successfully'; -$_L['Logout_Request_successfully'] = 'Logout Request successfully'; -$_L['Disconnect_Internet'] = 'Disconnect Internet?'; -$_L['Not_Online_Login_now'] = 'Not Online, Login now?'; -$_L['You_are_Online_Logout'] = 'You are Online, Logout?'; -$_L['Connect_to_Internet'] = 'Connect to Internet?'; -$_L['Your_account_not_connected_to_internet'] = 'Your account not connected to internet'; -$_L['Balance'] = 'Balance'; -$_L['Balance_System'] = 'Balance System'; -$_L['Enable_System'] = 'Enable System'; -$_L['Allow_Transfer'] = 'Allow Transfer'; -$_L['Telegram_Notification'] = 'Telegram Notification'; -$_L['SMS_OTP_Registration'] = 'SMS OTP Registration'; -$_L['Whatsapp_Notification'] = 'Whatsapp Notification'; -$_L['Tawkto_Chat_Widget'] = 'Tawk.to Chat Widget'; -$_L['Invoice'] = 'Invoice'; -$_L['Country_Code_Phone'] = 'Country Code Phone'; -$_L['Voucher_activation_menu_will_be_hidden'] = 'Voucher activation menu will be hidden'; -$_L['Customer_can_deposit_money_to_buy_voucher'] = 'Customer can deposit money to buy voucher'; -$_L['Allow_balance_transfer_between_customers'] = 'Allow balance transfer between customers'; - -$_L['Failed_to_create_transaction_'] = 'Failed to create transaction. '; -$_L['Failed_to_check_status_transaction_'] = 'Failed to check status transaction. '; -$_L['Disable_Voucher'] = 'Disable Voucher'; -$_L['Reminder_Notification'] = 'Reminder Notification'; -$_L['Reminder_Notification_Message'] = 'Reminder Notification Message'; -$_L['Reminder_7_days'] = 'Reminder 7 days'; -$_L['Reminder_3_days'] = 'Reminder 3 days'; -$_L['Reminder_1_day'] = 'Reminder 1 day'; -$_L['PPPOE_Password'] = 'PPPOE Password'; -$_L['User_Cannot_change_this_only_admin_if_it_Empty_it_will_use_user_password'] = 'User Cannot change this, only admin. if it Empty it will use user password'; -$_L['Invoice_Balance_Message'] = 'Invoice Balance Message'; -$_L['Invoice_Notification_Payment'] = 'Invoice Notification Payment'; -$_L['Balance_Notification_Payment'] = 'Balance Notification Payment'; -$_L['Balance_Plans'] = 'Balance Plans'; -$_L['Buy_Balance'] = 'Buy Balance'; -$_L['Price'] = 'Price'; -$_L['Validity'] = 'Validity'; -$_L['Disable_auto_renewal'] = 'Disable auto renewal?'; -$_L['Auto_Renewal_On'] = 'Auto Renewal On'; -$_L['Enable_auto_renewal'] = 'Enable auto renewal?'; -$_L['Auto_Renewal_Off'] = 'Auto Renewal Off'; -$_L['Refill_Balance'] = 'Refill Balance'; -$_L['Invoice_Footer'] = 'Invoice Footer'; -$_L['Pay_With_Balance'] = 'Pay With Balance'; -$_L['Pay_this_with_Balance_your_active_package_will_be_overwrite'] = 'Pay this with Balance? your active package will be overwrite'; -$_L['Success_to_buy_package'] = 'Success to buy package'; -$_L['Auto_Renewal'] = 'Auto Renewal'; -$_L['View'] = 'View'; -$_L['Back'] = 'Back'; -$_L['Active'] = 'Active'; -$_L['Transfer_Balance'] = 'Transfer Balance'; -$_L['Send_your_balance'] = 'Send your balance?'; -$_L['Send'] = 'Send'; -$_L['Cannot_send_to_yourself'] = 'Cannot send to yourself'; -$_L['Sending_balance_success'] = 'Sending balance success'; -$_L['From'] = 'From'; -$_L['To'] = 'To'; -$_L['insufficient_balance'] = 'insufficient balance'; -$_L['Send_Balance'] = 'Send Balance'; -$_L['Received_Balance'] = 'Received Balance'; -$_L['Minimum_Balance_Transfer'] = 'Minimum Balance Transfer'; -$_L['Minimum_Transfer'] = 'Minimum Transfer'; -$_L['Company_Logo'] = 'Company Logo'; -$_L['Expired_IP_Pool'] = 'Expired IP Pool'; -$_L['Proxy'] = 'Proxy'; -$_L['Proxy_Server'] = 'Proxy Server'; -$_L['Proxy_Server_Login'] = 'Proxy Server Login'; -$_L['Hotspot_Plan'] = 'Hotspot Plan'; -$_L['PPPOE_Plan'] = 'PPPOE Plan'; -$_L['UNKNOWN'] = 'UNKNOWN'; -$_L['Are_You_Sure'] = 'Are You Sure?'; -$_L['Success_to_send_package'] = 'Success to send package'; -$_L['Target_has_active_plan_different_with_current_plant'] = 'Target has active plan, different with current plant.'; -$_L['Recharge_a_friend'] = 'Recharge a friend'; -$_L['Buy_for_friend'] = 'Buy for friend'; -$_L['Buy_this_for_friend_account'] = 'Buy this for friend account?'; -$_L['Review_package_before_recharge'] = 'Review package before recharge'; -$_L['Activate'] = 'Activate'; -$_L['Deactivate'] = 'Deactivate'; -$_L['Sync'] = 'Sync'; -$_L['Failed_to_create_PaymeTrust_transaction'] = 'Failed to create PaymeTrust transaction.'; -$_L['Location'] = 'Location'; -$_L['Voucher_Format'] = 'Voucher Format'; \ No newline at end of file diff --git a/system/lan/turkish/index.html b/system/lan/turkish/index.html deleted file mode 100755 index 97579708..00000000 --- a/system/lan/turkish/index.html +++ /dev/null @@ -1,8 +0,0 @@ - - - 403 Forbidden - - -

Directory access is forbidden.

- - \ No newline at end of file diff --git a/system/updates.json b/system/updates.json index 86796d35..cb0de143 100644 --- a/system/updates.json +++ b/system/updates.json @@ -6,34 +6,89 @@ "ALTER TABLE `tbl_customers_meta` MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;" ], "2023.8.14": [ - "ALTER TABLE `tbl_customers` ADD `pppoe_password` varchar(45) NOT NULL DEFAULT '1' COMMENT 'For PPPOE Login' AFTER `password`;", + "ALTER TABLE `tbl_customers` ADD `pppoe_password` varchar(45) NOT NULL DEFAULT '' COMMENT 'For PPPOE Login' AFTER `password`;", "ALTER TABLE `tbl_plans` CHANGE `type` `type` ENUM('Hotspot','PPPOE','Balance') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;", "ALTER TABLE `tbl_transactions` CHANGE `type` `type` ENUM('Hotspot','PPPOE','Balance') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;", "ALTER TABLE `tbl_customers` ADD `auto_renewal` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Auto renewall using balance' AFTER `balance`;" ], - "2023.8.23" : [ - "ALTER TABLE `tbl_customers` CHANGE `pppoe_password` `pppoe_password` VARCHAR(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '0' COMMENT 'For PPPOE Login';" + "2023.8.23": [ + "ALTER TABLE `tbl_customers` CHANGE `pppoe_password` `pppoe_password` VARCHAR(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'For PPPOE Login';" ], - "2023.8.28" : [ + "2023.8.28": [ "ALTER TABLE `tbl_user_recharges` ADD `recharged_time` time NOT NULL DEFAULT '00:00:00' AFTER `recharged_on`;", "ALTER TABLE `tbl_transactions` ADD `recharged_time` time NOT NULL DEFAULT '00:00:00' AFTER `recharged_on`;" ], - "2023.9.5" : [ + "2023.9.5": [ "DROP TABLE `tbl_language`;", "ALTER TABLE `tbl_plans` ADD `pool_expired` varchar(40) NOT NULL DEFAULT '' AFTER `pool`;" ], - "2023.9.27" : [ + "2023.9.27": [ "ALTER TABLE `tbl_plans` CHANGE `type` `type` ENUM('Hotspot','PPPOE','Balance','Radius') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;", "ALTER TABLE `tbl_transactions` CHANGE `type` `type` ENUM('Hotspot','PPPOE','Balance','Radius') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;" ], - "2023.9.28" : [ + "2023.9.28": [ "ALTER TABLE `tbl_plans` CHANGE `type` `type` ENUM('Hotspot','PPPOE','Balance') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;", "ALTER TABLE `tbl_transactions` CHANGE `type` `type` ENUM('Hotspot','PPPOE','Balance') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;" ], - "2023.10.1" : [ + "2023.10.1": [ "ALTER TABLE `tbl_plans` ADD `is_radius` TINYINT(1) NOT NULL DEFAULT '0' COMMENT '1 is radius' AFTER `routers`; " ], - "2023.10.24" : [ + "2023.10.24": [ "ALTER TABLE `nas` ADD `routers` VARCHAR(32) NOT NULL DEFAULT '' AFTER `description`;" + ], + "2023.12.15": [ + "ALTER TABLE `tbl_customers` ADD `service_type` ENUM('Hotspot','PPPoE','Others') DEFAULT 'Others' COMMENT 'For selecting user type' AFTER `balance`;" + ], + "2024.1.11": [ + "ALTER TABLE `tbl_plans` ADD `allow_purchase` ENUM('yes','no') DEFAULT 'yes' COMMENT 'allow to show package in buy package page' AFTER `enabled`;" + ], + "2024.2.7": [ + "ALTER TABLE `tbl_voucher` ADD `generated_by` INT NOT NULL DEFAULT '0' COMMENT 'id admin' AFTER `status`;", + "ALTER TABLE `tbl_users` ADD `root` INT NOT NULL DEFAULT '0' COMMENT 'for sub account' AFTER `id`;" + ], + "2024.2.12": [ + "ALTER TABLE `tbl_users` CHANGE `user_type` `user_type` ENUM('SuperAdmin','Admin','Report','Agent','Sales') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;" + ], + "2024.2.15": [ + "ALTER TABLE `tbl_users` CHANGE `password` `password` VARCHAR(64) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;", + "ALTER TABLE `tbl_users` ADD `phone` VARCHAR(32) NOT NULL DEFAULT '' AFTER `password`, ADD `email` VARCHAR(128) NOT NULL DEFAULT '' AFTER `phone`, ADD `city` VARCHAR(64) NOT NULL DEFAULT '' COMMENT 'kota' AFTER `email`, ADD `subdistrict` VARCHAR(64) NOT NULL DEFAULT '' COMMENT 'kecamatan' AFTER `city`, ADD `ward` VARCHAR(64) NOT NULL DEFAULT '' COMMENT 'kelurahan' AFTER `subdistrict`;" + ], + "2024.2.16": [ + "ALTER TABLE `tbl_customers` ADD `created_by` INT NOT NULL DEFAULT '0' AFTER `auto_renewal`;" + ], + "2024.2.19": [ + "CREATE TABLE `tbl_customers_fields` (`id` INT PRIMARY KEY AUTO_INCREMENT, `customer_id` INT NOT NULL, `field_name` VARCHAR(255) NOT NULL, `field_value` VARCHAR(255) NOT NULL, FOREIGN KEY (customer_id) REFERENCES tbl_customers(id));" + ], + "2024.2.20" : [ + "ALTER TABLE `tbl_plans` ADD `list_expired` VARCHAR(32) NOT NULL DEFAULT '' COMMENT 'address list' AFTER `pool_expired`;", + "ALTER TABLE `tbl_bandwidth` ADD `burst` VARCHAR(128) NOT NULL DEFAULT '' AFTER `rate_up_unit`;" + ], + "2024.2.20.1" : [ + "DROP TABLE IF EXISTS `tbl_customers_meta`;" + ], + "2024.2.23" : [ + "ALTER TABLE `tbl_transactions` ADD `admin_id` INT NOT NULL DEFAULT '1' AFTER `type`;", + "ALTER TABLE `tbl_user_recharges` ADD `admin_id` INT NOT NULL DEFAULT '1' AFTER `type`;" + ], + "2024.3.3" : [ + "ALTER TABLE `tbl_plans` CHANGE `validity_unit` `validity_unit` ENUM('Mins','Hrs','Days','Months','Period') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL;" + ], + "2024.3.12" : [ + "ALTER TABLE `tbl_plans` CHANGE `allow_purchase` `prepaid` ENUM('yes','no') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NULL DEFAULT 'yes' COMMENT 'is prepaid';" + ], + "2024.3.14" : [ + "ALTER TABLE `tbl_transactions` ADD `note` VARCHAR(256) NOT NULL DEFAULT '' COMMENT 'for note' AFTER `type`;" + ], + "2024.3.19" : [ + "ALTER TABLE `tbl_customers` ADD `coordinates` VARCHAR(50) NOT NULL DEFAULT '' COMMENT 'Latitude and Longitude coordinates' AFTER `email`;" + ], + "2024.3.19.1" : [ + "ALTER TABLE `tbl_customers` ADD `account_type` ENUM('Business', 'Personal') DEFAULT 'Personal' COMMENT 'For selecting account type' AFTER `coordinates`;" + ], + "2024.3.19.2" : [ + "ALTER TABLE `tbl_plans` ADD `plan_type` ENUM('Business', 'Personal') DEFAULT 'Personal' COMMENT 'For selecting account type' ;" + ], + "2023.3.20": [ + "ALTER TABLE `tbl_customers` CHANGE `pppoe_password` `pppoe_password` VARCHAR(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '' COMMENT 'For PPPOE Login';" ] } \ No newline at end of file diff --git a/system/vendor/mpdf/mpdf/.github/CONTRIBUTING.md b/system/vendor/mpdf/mpdf/.github/CONTRIBUTING.md deleted file mode 100644 index eef6959a..00000000 --- a/system/vendor/mpdf/mpdf/.github/CONTRIBUTING.md +++ /dev/null @@ -1,53 +0,0 @@ -Contributing -============ - -Issue tracker -------------- - -The Issue tracker serves mainly as a place to report bugs and request new features. -Please do not abuse it as a general questions or troubleshooting location. - -General troubleshooting -------------- - -For these questions please use [Discussions](https://github.com/mpdf/mpdf/discussions). Add your enquiry -to appropriate category and as always, include a reproducible code example when applicable (see code example guidelines below). - -You can also use the [mpdf tag](https://stackoverflow.com/questions/tagged/mpdf) -at [Stack Overflow](https://stackoverflow.com/) -as the StackOverflow user base is more likely to answer you in a timely manner. -When doing so, make sure you comply to StackOverflow question guidelines. - -Bug reports -------------- - -* Bug reports **MUST** contain a small example in php/html that reproduces the bug. -* The code example **MUST** be reproducible by copy&paste assuming composer dependencies are installed. That means: - * No calling unrelated funcions, - * an actual final HTML code has to be present, pasting a template file is not enough, - * if the bug considers import or fonts, example source PDF/TTF/etc files have to be included. -* Failing to provide necessary information or not using the issue template will cause the issue to be closed until required information is provided. -* Please report one feature or one bug per issue. - -Feature requests -------------- - -Feature requests have to be labeled as such and have to include reasoning for the change in question. - - -Pull requests -------------- - -Pull requests should be always based on the default [development](https://github.com/mpdf/mpdf/tree/development) -branch except for backports to older versions. - -Guidelines: - -* Use an aptly named feature branch for the Pull request. -* Only files and lines affecting the scope of the Pull request must be affected. -* Make small, *atomic* commits that keep the smallest possible related code changes together. -* Code must be accompanied by a unit test testing expected behaviour whenever possible. -* To be incorporated, the PR should contain a change in the CHANGELOG.md file describing itself - -When updating a PR, do not create a new one, just `git push --force` to your former feature branch, the PR will -update itself. diff --git a/system/vendor/mpdf/mpdf/.github/FUNDING.yml b/system/vendor/mpdf/mpdf/.github/FUNDING.yml deleted file mode 100644 index 47601376..00000000 --- a/system/vendor/mpdf/mpdf/.github/FUNDING.yml +++ /dev/null @@ -1 +0,0 @@ -custom: https://www.paypal.me/mpdf diff --git a/system/vendor/mpdf/mpdf/.github/ISSUE_TEMPLATE/01_bug_report.yml b/system/vendor/mpdf/mpdf/.github/ISSUE_TEMPLATE/01_bug_report.yml deleted file mode 100644 index 0ce324aa..00000000 --- a/system/vendor/mpdf/mpdf/.github/ISSUE_TEMPLATE/01_bug_report.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Bug report 🐛 -description: The library does not work as expected -body: - - - type: checkboxes - attributes: - label: Guidelines - description: Please confirm this is a bug report and not general troubleshooting. - options: - - label: I understand that [if I fail to provide all required details, this issue may be closed without review](https://github.com/mpdf/mpdf/blob/development/.github/CONTRIBUTING.md). - required: true - - - type: textarea - attributes: - label: Description of the bug - validations: - required: true - - - type: input - attributes: - label: mPDF version - validations: - required: true - - - type: input - attributes: - label: PHP Version and environment (server type, cli provider etc., enclosing libraries and their respective versions) - validations: - required: true - - - type: textarea - attributes: - label: Reproducible PHP+CSS+HTML snippet suffering by the error - validations: - required: true diff --git a/system/vendor/mpdf/mpdf/.github/ISSUE_TEMPLATE/02_feature_request.yml b/system/vendor/mpdf/mpdf/.github/ISSUE_TEMPLATE/02_feature_request.yml deleted file mode 100644 index 88d9bdca..00000000 --- a/system/vendor/mpdf/mpdf/.github/ISSUE_TEMPLATE/02_feature_request.yml +++ /dev/null @@ -1,8 +0,0 @@ -name: Feature request 🚀 -description: I would like to have a new functionality added -body: - - type: textarea - attributes: - label: Please describe the new functionality as best as you can. - validations: - required: true \ No newline at end of file diff --git a/system/vendor/mpdf/mpdf/.github/ISSUE_TEMPLATE/config.yml b/system/vendor/mpdf/mpdf/.github/ISSUE_TEMPLATE/config.yml deleted file mode 100644 index 3c03ea0d..00000000 --- a/system/vendor/mpdf/mpdf/.github/ISSUE_TEMPLATE/config.yml +++ /dev/null @@ -1,8 +0,0 @@ -blank_issues_enabled: false -contact_links: - - name: General questions and troubleshooting ❓ - url: https://github.com/mpdf/mpdf/discussions - about: You can use Github Discussions for general questions and troubleshooting. Please note that asking at Stack Overflow will probably be more successful. - - name: QA at Stack Overflow ❓ - url: https://stackoverflow.com/questions/tagged/mpdf - about: Ask at Stack Overflow for a greater chance of a quick and correct answer to your questions. Make sure to comply to SO rules, terms and conditions. diff --git a/system/vendor/mpdf/mpdf/.github/SECURITY.md b/system/vendor/mpdf/mpdf/.github/SECURITY.md deleted file mode 100644 index c4f92d31..00000000 --- a/system/vendor/mpdf/mpdf/.github/SECURITY.md +++ /dev/null @@ -1,6 +0,0 @@ -How to disclose potential security issues -============ - -As mPDF does not have a domain or a dedicated contact apart from its Github repository, to prevent -disclosing maintainers' contacts publicly, please create an Issue about the security issue with means to contact you. -We will reach out to you as soon as possible. diff --git a/system/vendor/mpdf/mpdf/.github/workflows/coverage.yml b/system/vendor/mpdf/mpdf/.github/workflows/coverage.yml deleted file mode 100644 index 45980f9d..00000000 --- a/system/vendor/mpdf/mpdf/.github/workflows/coverage.yml +++ /dev/null @@ -1,42 +0,0 @@ -# https://help.github.com/en/categories/automating-your-workflow-with-github-actions - -name: "Code coverage" - -on: - push: - branches: - - "development" - - "coverage" - -jobs: - - coverage: - - name: "Code coverage" - - runs-on: ${{ matrix.operating-system }} - - strategy: - matrix: - php-version: - - "7.4" - - operating-system: [ubuntu-latest] - - steps: - - name: "Checkout" - uses: "actions/checkout@v3" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "xdebug" - php-version: "${{ matrix.php-version }}" - extensions: "mbstring, gd, bcmath, bz2" - tools: composer:v2 - - - name: "Install dependencies" - run: "composer install --no-interaction --no-progress" - - - name: "Code coverage" - run: composer coverage diff --git a/system/vendor/mpdf/mpdf/.github/workflows/cs.yml b/system/vendor/mpdf/mpdf/.github/workflows/cs.yml deleted file mode 100644 index 1fdf0aa0..00000000 --- a/system/vendor/mpdf/mpdf/.github/workflows/cs.yml +++ /dev/null @@ -1,43 +0,0 @@ -# https://help.github.com/en/categories/automating-your-workflow-with-github-actions - -name: "Coding standard check" - -on: - pull_request: - push: - branches: - - "development" - - "test" - -jobs: - - cs: - - name: "Coding standard" - - runs-on: ${{ matrix.operating-system }} - - strategy: - matrix: - php-version: - - "7.4" - - operating-system: [ubuntu-latest] - - steps: - - name: "Checkout" - uses: "actions/checkout@v3" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "none" - php-version: "${{ matrix.php-version }}" - extensions: "mbstring" - tools: composer:v2 - - - name: "Install dependencies" - run: "composer install --no-interaction --no-progress" - - - name: "CS" - run: composer cs diff --git a/system/vendor/mpdf/mpdf/.github/workflows/tests.yml b/system/vendor/mpdf/mpdf/.github/workflows/tests.yml deleted file mode 100644 index 71d26dc1..00000000 --- a/system/vendor/mpdf/mpdf/.github/workflows/tests.yml +++ /dev/null @@ -1,53 +0,0 @@ -# https://help.github.com/en/categories/automating-your-workflow-with-github-actions - -name: "CI" - -on: - pull_request: - push: - branches: - - "master" - - "development" - - "test" - -jobs: - - tests: - - name: "Tests" - - runs-on: ${{ matrix.operating-system }} - - strategy: - fail-fast: false - matrix: - php-version: - - "5.6" - - "7.0" - - "7.1" - - "7.2" - - "7.3" - - "7.4" - - "8.0" - - "8.1" - - "8.2" - operating-system: [ubuntu-latest, windows-latest] - - steps: - - name: "Checkout" - uses: "actions/checkout@v3" - - - name: "Install PHP" - uses: "shivammathur/setup-php@v2" - with: - coverage: "none" - php-version: "${{ matrix.php-version }}" - extensions: "mbstring, gd, bcmath, bz2" - tools: composer:v2 - ini-values: error_reporting=-1 - - - name: "Install dependencies" - run: "composer install --no-interaction --no-progress" - - - name: "Tests" - run: composer test \ No newline at end of file diff --git a/system/vendor/mpdf/mpdf/.gitignore b/system/vendor/mpdf/mpdf/.gitignore deleted file mode 100644 index 0bfe817f..00000000 --- a/system/vendor/mpdf/mpdf/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -vendor/* -composer.lock diff --git a/system/vendor/mpdf/mpdf/CHANGELOG.md b/system/vendor/mpdf/mpdf/CHANGELOG.md deleted file mode 100644 index 97ae7c20..00000000 --- a/system/vendor/mpdf/mpdf/CHANGELOG.md +++ /dev/null @@ -1,786 +0,0 @@ -mPDF 8.1.x -=========================== - -New features ------------- - -* Service container for internal services -* Set /Lang entry for better accessibility when document language is available (@cuongmits, #1418) -* More verbose helper methods for `Output`: `OutputBinaryData`, `OutputHttpInline`, `OutputHttpDownload`, `OutputFile` (since v8.1.2) -* Set font-size to `auto` in textarea and input in active forms to resize the font-size (@ChrisB9, #1721) -* PHP 8.2 support in mPDF 8.1.3 -* Added support for `psr/log` v3 without dropping v2. (@markdorison, @apotek, @greg-1-anderson, #1857) - -Bugfixes --------- - -* Better exception message about fonts with MarkGlyphSets (Fix for #1408) -* Updated Garuda font with fixed "k" character (Fix for #1440) -* Testing and suppressing PNG file conversion errors -* Prevent hyphenation of urls starting with https and e-mail addresses (@HKandulla, #1634) -* Colorspace restrictor reads mode from Mpdf and works again (Fix for #1094) -* Prevent exception when multiple columns wrap to next page -* Update default `curlUserAgent` configuration variable from Firefox 13 to 108 - -mPDF 8.0.x -=========================== - -* Ability to customize User-Agent header in the HTTP requests sent by cURL (@samuelecat, #1229) -* Add Page Number Myanmar Language Support (@MinKyawNyunt, #1201) -* new `Mpdf\Exception\FontException` extending base `MpdfException` was introduced and is thrown on Font manipulation -* A bit cleaner exception messages for font-related errors -* Use atomic cache writing. (@PATROMO, #1186) -* Fix: "Undefined index: group" when calling MultiCell when using font without OTL data (@Kekos, #1213, #941) -* Add C128RAW barcode type to create any barcode (ex: subtype change in middle of barcode) (#1124) -* Add proxy support to curl -* Fixed date and time format in the informations dictionary (#1083, @peterdevpl) -* Checking allowed stream wrappers in CssManager -* PHP 7.4 support (until final 7.4 release with composer --ignore-platform-reqs) -* Improve debugging of remote content issues (@ribeirobreno) -* Added `exposeVersion` configuration variable allowing to hide mPDF version from Producer tag and HTTP headers -* Added the check for JPEG SOF header 0xFF 0xC1 (extended) (@jamiejones85) -* Allows setting `none` as zoom mode in `SetDisplayMode` method, so that OpenAction is not written (#602) -* Allowed image stream whitelist to be customised (#1005, thanks @jakejackson) -* Fixed parsing of top-left-bottom-right CSS rules with !important (#1009) -* Fixed skipping ordered list numbering with page-break-inside: avoid (#339) -* Compound classes selector support, like `.one.two` or `div.message.special` (#538, @peterdevpl) -* Fixed CMYK colors in text-shadow (#1115, @lexilya) -* Skip non supported wrappers when resolving paths (#1204, @MarkVaughn) -* Fixed SVGs using a style tag, has styles ignored ( Requires ext-dom ) (#450, @antman3351) -* Allows `{nb}`, `{nbpg}`, `{PAGENO}` and `{DATE ...}` substitution in body (#172 and #267, @Dasc3er) -* Cache now creates a dedicated subdirectory `/mpdf`. -* It is possible to disable automatic cache cleanup with `cacheCleanupInterval` config variable -* PHP 8.0 is supported since 8.0.10 (#1263) -* Fix: First header of named page is added twice (@antman3351, #1320) -* Added `curlExecutionTimeout` configuration variable allowing to `CURLOPT_TIMEOUT` when fetching remote content -* Fix: Not all combinations were generated for more than three compound classes (@JeppeKnockaert) -* Added `quiet_zone_left` and `quiet_zone_right` to barcodes which support quiet zones in order to customize its width -* Updated `CssManager` to use the `RemoteContentFetcher` class instead of `curl` natively (@greew) -* Added optional `continue2pages` parameter to `SetDocTemplate` method, allowing a template to continue the last 2 pages alternately (@bmg-ruudv) -* Ensure that all digits of a string are hexadecimal before decoding in ColorConverter (@derklaro) -* Fix: Using mpdf in phar package leads to weird errors (#1504, @sandreas) -* WEBP images support (#1525) - - -mPDF 8.0.0 -=========================== - -### 15/03/2019 - -* Updated FPDI dependency to version 2 (thanks a lot, @JanSlabon) - - removed `SetImportUse` method - - case of `ImportPage` method changed to `importPage` - - similarly, case of `setSourceFile` and `useTemplate` was changed to a lowercase first letter. - - signature of `importPage` changed - - returned value of `useTemplate` changed -* Moved QRCode generating code portions to external package _mpdf/qrcode_ - - This reduced package size considerably (ca 6MB) -* Fraction sizes without leading zeros allowed for font sizes (#973, thanks @peterdevpl) -* WriteHTML is now strict about used `$mode` parameter (#915, thanks, @tomtomau) -* Fixed regression in nested tables (#860, thanks, @machour) -* Scientific notation handling in CSS font sizes (#753, thanks, @peterdevpl) - - -mPDF 7.1.x -=========================== - -* PHAR security issue fixed (thanks, @jakejackson) -* Font temporary data saved as JSON instead of generating PHP files (thanks, @jakejackson) -* cURL handling enhancements (thanks, @jakejackson) -* SVG parsing fixes (thanks, @achretien) -* Write PDF content with *Writer service classes -* PHP 7.3 is supported -* Added myclabs/deepcopy dependency, fixed TOC page numbering (thanks, @jakejackson) -* Custom color for QR codes -* Added support for orientation config key -* Code and tests cleanups and enhancements - - PHPUnit dedicated assertions (thanks, @carusogabriel) - - WriteHTML part constants (thanks, @tomtomau) - - Various notice fixes (kudos to all respective authors) - -mPDF 7.0.x -=========================== - -* Allow passing file content or file path to `SetAssociatedFiles` (#558) -* Allowed ^1.4 and ^2.0 of paragon/random_compat to allow wider usage -* Fix of undefined _getImage function (#539) -* Code cleanup -* Better writable rights for temp dir validation (#534) -* Fix displaying dollar character in footer with core fonts (#520) -* Fixed missed code2utf call (#531) -* Refactored and cleaned-up classes and subnamespaces - - -mPDF 7.0.0 -=========================== - -### 19/10/2017 - -Backward incompatible changes ------------------------------ - -- PHP `^5.6 || ~7.0.0 || ~7.1.0 || ~7.2.0` is required. -- Entire project moved under `Mpdf` namespace - - Practically all classes renamed to use `PascalCase` and named to be more verbose - - Changed directory structure to comply to `PSR-4` -- Removed explicit require calls, replaced with Composer autoloading -- Removed configuration files - - All configuration now done via `__construct` parameter (see below) -- Changed `\Mpdf\Mpdf` constructor signature - - Class now accepts only single array `$config` parameter - - Array keys are former `config.php` and `config_fonts.php` properties - - Additionally, former constructor parameters can be used as keys -- `tempDir` directory now must be writable, otherwise an exception is thrown -- ICC profile is loaded as entire path to file (to prevent a need to write inside vendor directory) -- Moved examples to separate repository -- Moved `TextVars` constants to separate class -- Moved border constants to separate class -- `scriptToLang` and `langToFont` in separate interfaced class methods -- Will now throw an exception when `mbstring.func_overload` is set -- Moved Glyph operator `GF_` constants in separate `\Mpdf\Fonts\GlyphOperator` class -- All methods in Barcode class renamed to camelCase including public `dec_to_hex` and `hex_to_dec` -- Decimal conversion methods (to roman, cjk, etc.) were moved to classes in `\Mpdf\Conversion` namespace -- Images in PHP variables (``) were moved from direct Mpdf properties to `Mpdf::$imageVars` public property array -- Removed global `_SVG_AUTOFONT` and `_SVG_CLASSES` constants in favor of `svgAutoFont` and `svgClasses` configuration keys -- Moved global `_testIntersect`, `_testIntersectCircle` and `calc_bezier_bbox` fucntions inside `Svg` class as private methods. - - Changed names to camelCase without underscores and to `computeBezierBoundingBox` -- Security: Embedded files via `` custom tag must be explicitly allowed via `allowAnnotationFiles` configuration key -- `fontDir` property of Mpdf class is private and must be accessed via configuration variable with array of paths or `AddFontDirectory` method -- QR code `` element now treats `\r\n` and `\n` as actual line breaks -- cURL is prefered over socket when downloading images. -- Removed globally defined functions from `functions.php` in favor of `\Mpdf\Utils` classes `PdfDate` and `UtfString`. - - Unused global functions were removed entirely. - - -Removed features ----------------- - -- Progressbar support -- JpGraph support -- `error_reporting` changes -- Timezone changes -- `compress.php` utility -- `_MPDF_PATH` and `_MPDF_URI` constants -- `_MPDF_TEMP_PATH` constant in favor of `tempDir` configuration variable -- `_MPDF_TTFONTDATAPATH` in favor of `tempDir` configuration variable -- `_MPDFK` constant in favor of `\Mpdf\Mpdf::SCALE` class constant -- `FONT_DESCRIPTOR` constant in favor of `fontDescriptor` configuration variable -- `_MPDF_SYSTEM_TTFONTS` constant in favor of `fontDir` configuration variable with array of paths or `AddFontDirectory` method -- HTML output of error messages and debugs -- Formerly deprecated methods - - -Fixes and code enhancements ----------------------------- - -- Fixed joining arab letters -- Fixed redeclared `unicode_hex` function -- Converted arrays to short syntax -- Refactored and tested color handling with potential conversion fixes in `hsl*()` color definitions -- Refactored `Barcode` class with separate class in `Mpdf\Barcode` namespace for each barcode type -- Fixed colsum calculation for different locales (by @flow-control in #491) -- Image type guessing from content separated to its own class - - -New features ------------- - -- Refactored caching (custom `Cache` and `FontCache` classes) -- Implemented `Psr\Log\LoggerAware` interface - - All debug and additional messages are now sent to the logger - - Messages can be filtered based on `\Mpdf\Log\Context` class constants -- `FontFileFinder` class allowing to specify multiple paths to search for fonts -- `MpdfException` now extends `ErrorException` to allow specifying place in code where error occured -- Generating font metrics moved to separate class -- Added `\Mpdf\Output\Destination` class with verbose output destination constants -- Availability to set custom default CSS file -- Availability to set custom hyphenation dictionary file -- Refactored code portions to new "separate" classes: - - `Mpdf\Color\*` classes - - `ColorConvertor` - - `ColorModeConvertor` - - `ColorSpaceRestrictor` - - `Mpdf\SizeConvertor` - - `Mpdf\Hyphenator` - - `Mpdf\Image\ImageProcessor` - - `Mpdf\Image\ImageTypeGuesser` - - `Mpdf\Conversion\*` classes -- Custom watermark angle with `watermarkAngle` configuration variable -- Custom document properties (idea by @zarubik in #142) -- PDF/A-3 associated files + additional xmp rdf (by @chab in #130) -- Additional font directories can be added via `addFontDir` method -- Introduced `cleanup` method which restores original `mb_` encoding settings (see #421) -- QR code `` element now treats `\r\n` and `\n` as actual line breaks -- Customizable following of 3xx HTTP redirects, validation of SSL certificates, cURL timeout. - - `curlFollowLocation` - - `curlAllowUnsafeSslRequests` - - `curlTimeout` -- QR codes can be generated without a border using `disableborder="1"` HTML attribute in `` tag - - -Git repository enhancements ---------------------------- - -- Added contributing guidelines -- Added Issue template - - -mPDF 6.1.0 -=========================== - -### 26/04/2016 - -- Composer updates - - First release officially supporting Composer - - Updated license in composer.json - - Chmod 777 on dirs `ttfontdata`, `tmp`, `graph_cache` after composer install -- Requiring PHP 5.4.0+ with Composer -- Code style - - Reformated (almost) all PHP files to keep basic code style - - Removed trailing whitespaces - - Converted all txt, php, css, and htm files to utf8 - - Removed closing PHP tags - - Change all else if calls to elseif -- Added base PHPUnit tests -- Added Travis CI integration with unit tests -- Changed all `mPDF::Error` and `die()` calls to throwing `MpdfException` -- PDF Import changes - - FPDI updated to 1.6.0 to fix incompatible licenses - - FPDI loaded from Composer or manually only -- Removed iccprofiles/CMYK directory -- Renamed example files: change spaces to underscores to make scripting easier -- Fixed `LEDGER` and `TABLOID` paper sizes -- Implemented static cache for mpdf function `ConvertColor`. -- Removed PHP4 style constructors -- Work with HTML tags separated to `Tag` class -- Fixed most Strict standards PHP errors -- Add config constant so we can define custom font data -- HTML - - fax & tel support in href attribute - - Check $html in `$mpdf->WriteHTML()` to see if it is an integer, float, string, boolean or - a class with `__toString()` and cast to a string, otherwise throw exception. -- PHP 7 - - Fix getting image from internal variable in PHP7 (4dcc2b4) - - Fix PHP7 Fatal error: `'break' not in the 'loop' or 'switch' context` (002bb8a) -- Fixed output file name for `D` and `I` output modes (issue #105, f297546) - -mPDF 6.0 -=========================== - -### 20/12/2014 - -New features / Improvements ---------------------------- -- Support for OpenTypeLayout tables / features for complex scripts and Advances Typography. -- Improved bidirectional text handling. -- Improved line-breaking, including for complex scripts e.g. Lao, Thai and Khmer. -- Updated page-breaking options. -- Automatic language mark-up and font selection using autoScriptToLang and autoLangToFont. -- Kashida for text-justification in arabic scripts. -- Index collation for non-ASCII characters. -- Index mark-up allowing control over layout using CSS. -- `{PAGENO}` and `{nbpg}` can use any of the number types as in list-style e.g. set in `` using pagenumstyle. -- CSS support for lists. -- Default stylesheet - `mpdf.css` - updated. - -Added CSS support ------------------ -- lang attribute selector e.g. :lang(fr), [lang="fr"] -- font-variant-position -- font-variant-caps -- font-variant-ligatures -- font-variant-numeric -- font-variant-alternates - Only [normal | historical-forms] supported (i.e. most are NOT supported) -- font-variant - as above, and except for: east-asian-variant-values, east-asian-width-values, ruby -- font-language-override -- font-feature-settings -- text-outline is now supported on TD/TH tags -- hebrew, khmer, cambodian, lao, and cjk-decimal recognised as values for "list-style-type" in numbered lists and page numbering. -- list-style-image and list-style-position -- transform (on `` only) -- text-decoration:overline -- image-rendering -- unicode-bidi (also `` tag) -- vertical-align can use lengths e.g. 0.5em -- line-stacking-strategy -- line-stacking-shift - -mPDF 5.7.4 -================ - -### 15/12/2014 - -Bug Fixes & Minor Additions ---------------------------- -- SVG images now support embedded images e.g. `` -- SVG images now supports `` element e.g. ``, and also `` -- SVG images now can use Autofont (see top of `classes/svg.php` file) -- SVG images now has limited support for CSS classes (see top of `classes/svg.php` file) -- SVG images - style inheritance improved -- SVG images - improved handling of comments and other extraneous code -- SVG images - fix to ensure opacity is reset before another element -- SVG images - font-size not resetting after a `` element -- SVG radial gradients bug (if the focus [fx,fy] lies outside circle defined by [cx,cy] and r) cf. pservers-grad-15-b.svg -- SVG allows spaces in attribute definitions in `` or `` e.g. `` -- SVG text which contains a `<` sign, it will break the text - now processed as `<` (despite the fact that this does not conform to XML spec) -- SVG images - support automatic font selection and (minimal) use of CSS classes - cf. the defined constants at top of svg.php file -- SVG images - text-anchor now supported as a CSS style, as well as an HTML attribute -- CSS support for :nth-child() selector improved to fully support the draft CSS3 spec - http://www.w3.org/TR/selectors/#nth-child-pseudo - [NB only works on table columns or rows] -- text-indent when set as "em" - incorrectly calculated if last text in line in different font size than for block -- CSS not applying cascaded styles on `` elements - [changed MergeCSS() type to INLINE for 'A', LEGEND, METER and PROGRESS] -- fix for underline/strikethrough/overline so that line position(s) are based correctly on font-size/font in nested situations -- Error: Strict warning: Only variables should be passed by reference - in PHP5.5.9 -- bug accessing images from some servers (HTTP 403 Forbidden whn accessed using fopen etc.) -- Setting page format incorrectly set default twice and missed some options -- bug fixed in Overwrite() when specifying replacement as a string -- barcode C93 - updated C93 code from TCPDF because of bug - incorrect checksum character for "153-2-4" -- Tables - bug when using colspan across columns which may have a cell width specified - cf. http://www.mpdf1.com/forum/discussion/2221/colspan-bug -- Tables - cell height (when specified) is not resized when table is shrunk -- Tables - if table width specified, but narrower than minimum cell wdith, and less than page width - table will expand to - minimum cell width(s) as long as $keep_table_proportions = true -- Tables - if using packTableData, and borders-collapse, wider border is overwriting content of adjacent cell - Test case: - ``` - - - -
Hallo world
Hallo world
- ``` -- Images - image height is reset proportional to original if width is set to maximum e.g. `` -- URL handling changed to work with special characters in path fragments; affects `
` links, `` images and - CSS url() e.g background-image - - also to ignore `../` included as a query value -- Barcodes with bottom numerals e.g. EAN-13 - incorrect numeral size when using core fonts - --------------------------------- - -NB Spec. for embedded SVG images: -as per http://www.w3.org/TR/2003/REC-SVG11-20030114/struct.html#ImageElement -Attributes supported: -- x -- y -- xlink:href (required) - can be jpeg, png or gif image - not vector (SVG or WMF) image -- width (required) -- height (required) -- preserveAspectRatio - -Note: all attribute names and values are case-sensitive -width and height cannot be assigned by CSS - must be attributes - -mPDF 5.7.3 -================ - -### 24/8/2014 - -Bug Fixes & Minor Additions ---------------------------- - -- Tables - cellSpacing and cellPadding taking preference over CSS stylesheet -- Tables - background images in table inside HTML Footer incorrectly positioned -- Tables - cell in a nested table with a specified width, should determine width of parent table cell - (cf. http://www.mpdf1.com/forum/discussion/1648/nested-table-bug-) -- Tables - colspan (on a row after first row) exceeds number of columns in table -- Gradients in Imported documents (mPDFI) causing error in some browsers -- Fatal error after page-break-after:always on root level block element -- Support for 'https/SSL' if file_get_contents_by_socket required (e.g. getting images with allow_url_fopen turned off) -- Improved support for specified ports when getting external CSS stylesheets e.g. www.domain.com:80 -- error accessing local .css files with dummy queries (cache-busting) e.g. mpdfstyleA4.css?v=2.0.18.9 -- start of end tag in PRE incorrectly changed to < -- error thrown when open.basedir restriction in effect (deleting temporary files) -- image which forces pagebreak incorrectly positioned at top of page -- [changes to avoid warning notices by checking if (isset(x)) before referencing it] -- text with letter-spacing set inside table which needs to be resixed (shrunk) - letter-spacing was not adjusted -- nested table incorrectly calculating width and unnecessarily wrapping text -- vertical-align:super|sub can be nested using `` elements -- inline elements can be nested e.g. text `text13text` text -- CSS vertical-align:0.5em (or %) now supported -- underline and strikethrough now use the parent inline block baseline/fontsize/color for child inline elements *** change in behaviour - (Adjusts line height to take account of superscript and subscript except in tables) -- nested table incorrectly calculating width and unnecessarily wrapping text -- tables - font size carrying over from one nested table to the next nested table -- tables - border set as attribute on `` overrides border set as CSS on `` not printing at all (since v5.7) -- list-style incorrectly overriding list-style-type in cascading CSS -- page-break-after:avoid not taking into account bottom padding and margin when estimating if next line can fit on page -- images not displayed when using "https://" if images are referenced by src="//domain.com/image" -- +aCJK incorrectly parsed when instantiating class e.g. new mpDF('ja+aCJK') -- line-breaking - zero-width object at end of line (e.g. index entry) causing a space left untrimmed at end of line -- ToC since v5.7 incorrectly handling non-ascii characters, entities or tags -- cell height miscalculated when using hard-hyphenate -- border colors set with transparency not working -- transparency settings for stroke and fill interfering with one another -- 'float' inside a HTML header/footer - not clearing the float before first line of text -- error if script run across date change at midnight -- temporary file name collisions (e.g. when processing images) if numerous users -- `` position attribute not working -- `<` (less-than sign) inside a PRE element, and NOT start of a valid tag, was incorrectly removed -- file attachments not opening in Reader XI -- JPG images not recognised if not containing JFIF or Exif markers -- instance of preg_replace with /e modifier causing error in PHP 5.5 -- correctly handle CSS URLs with no scheme -- Index entries causing errors when repeat entries are used within page-break-inside:avoid, rotated tables etc. -- table with fixed width column and long word in cell set to colspan across this column (adding spare width to all columns) -- incorrect hyphenation if multiple soft-hyphens on line before break -- SVG images - objects contained in `` being displayed -- SVG images - multiple, or quoted fonts e.g. style="font-family:'lucida grande', verdana" not recognised -- SVG images - line with opacity=0 still visible (only in some PDF viewers/browsers) -- text in an SVG image displaying with incorrect font in some PDF viewers/browsers -- SVG images - fill:RGB(0,0,0) not recognised when uppercase -- background images using data:image\/(jpeg|gif|png);base64 format - error when reading in stylesheet - -New CSS support ---------------- - -- added support for style="opacity:0.6;" in SVG images - previously only supported style="fill-opacity:0.6; stroke-opacity: 0.6;" -- improved PNG image handling for some cases of alpha channel transparency -- khmer, cambodian and lao recognised as list-style-type for numbered lists - -SVG Images ----------- - -- Limited support for `` and `` - -mPDF 5.7.1 -================ -## 01/09/2013 - -1) FILES: mpdf.php - -Bug fix; Dollar sign enclosed by `
` tag causing error.
-Test e.g.: `
Test $1.00 Test
Test $2.00 Test
Test $3.00 Test
Test $4.00 Test
` - ------------------------------ - -2) FILES: includes/functions.php AND mpdf.php - -Changes to `preg_replace` with `/e` modifier to use `preg_replace_callback` -(/e depracated from PHP 5.5) - ------------------------------ - -3) FILES: classes/barcode.php - -Small change to function `barcode_c128()` which allows ASCII 0 - 31 to be used in C128A e.g. chr(13) in: -`` - ------------------------------ - -4) FILES: mpdf.php - -Using $use_kwt ("keep-[heading]-with-table") if `

` before table is on 2 lines and pagebreak occurs after first line -the first line is displayed at the bottom of the 2nd page. -Edited so that $use_kwt only works if the HEADING is only one line. Else ignores (but prints correctly) - ------------------------------ - -5) FILES: mpdf.php - -Clearing old temporary files from `_MPDF_TEMP_PATH` will now ignore "hidden" files e.g. starting with a "`.`" `.htaccess`, `.gitignore` etc. -and also leave `dummy.txt` alone - - -mPDF 5.7 -=========================== - -### 14/07/2013 - -Files changed -------------- -- config.php -- mpdf.php -- classes/tocontents.php -- classes/cssmgr.php -- classes/svg.php -- includes/functions.php -- includes/out.php -- examples/formsubmit.php [Important - Security update] - -Updated Example Files in /examples/ ------------------------------------ - -- All example files -- mpdfstyleA4.css - -config.php ----------- - -Removed: -- $this->hyphenateTables -- $this->hyphenate -- $this->orphansAllowed -Edited: -- "hyphens: manual" - Added to $this->defaultCSS -- $this->allowedCSStags now includes '|TEXTCIRCLE|DOTTAB' -New: -- $this->decimal_align = array('DP'=>'.', 'DC'=>',', 'DM'=>"\xc2\xb7", 'DA'=>"\xd9\xab", 'DD'=>'-'); -- $this->h2toc = array('H1'=>0, 'H2'=>1, 'H3'=>2); -- $this->h2bookmarks = array('H1'=>0, 'H2'=>1, 'H3'=>2); -- $this->CJKforceend = false; // Forces overflowng punctuation to hang outside right margin (used with CJK script) - - -Backwards compatability ------------------------ - -Changes in mPDF 5.7 may cause some changes to the way your documents appear. There are two main differences: -1) Hyphenation. To retain appearance compatible with earlier versions, set the CSS property "hyphens: auto" whenever - you previously used $mpdf->hyphenate=true; -2) Table of Contents - appearance can now be controlled with CSS styles. By default, in mPDF 5.7, no styling is applied so you will get: - - No indent (previous default of 5mm) - ($tocindent is ignored) - - Any font, font-size set ($tocfont or $tocfontsize) will not work - - HyperLinks will appear with your default appearance - usually blue and underlined - - line spacing will be narrower (can use line-height or margin-top in CSS) - -New features / Improvements ---------------------------- -- Layout of Table of Content ToC now controlled using CSS styles -- Text alignment on decimal mark inside tables -- Automatically generated bookmarks and/or ToC entries from H1 - H6 tags -- Support for unit of "rem" as size e.g. font-size: 1rem; -- Origin and clipping for background images and gradients controlled by CSS i.e. background-origin, background-size, background-clip -- Text-outline controlled by CSS (compatible with CSS3 spec.) -- Use of `` enhanced by custom CSS "outdent" property -- Image HTML attributes `` added: max-height, max-width, min-height and min-width -- Spotcolor can now be defined as it is used e.g. color: spot(PANTONE 534 EC, 100%, 85, 65, 47, 9); -- Lists - added support for "start" attribute in `
    ` e.g. `
      ` -- Hyphenation controlled using CSS, consistent with CSS3 spec. -- Line breaking improved to avoid breaks within words where HTML tags are used e.g. H20 -- Line breaking in CJK scripts improved (and ability to force hanging punctuation) -- Numerals in a CJK script are kept together -- RTL improved support for phrases containing numerals and \ and / -- Bidi override codes supported - Right-to-Left Embedding [RLE] U+202B, Left-to-Right Embedding [LRE] U+202A, - U+202C POP DIRECTIONAL FORMATTING (PDF) -- Support for `` in HTML - uses it to SetBasePath for relative URLs. -- HTML tag - added support for `` or `` - converted to a soft-hyphen -- CSS now takes precedence over HTML attribute e.g. `
` -- tables - if table width set to 100% and one cell/column is empty with no padding/border, sizing incorrectly - (http://www.mpdf1.com/forum/discussion/1886/td-fontsize-in-nested-table-bug-#Item_5) -- `
` added as recognised tag -- CSS style transform supported on `` element (only) - All transform functions are supported except matrix() i.e. translate(), translateX(), translateY(), skew(), skewX(), skewY(), - scale(), scaleX(), scaleY(), rotate() - NB When using Columns or Keep-with-table (use_kwt), cannot use transform -- CSS background-color now supported on `` element -- @page :first not recognised unless @page {} has styles set -- left/right margins not allowed on @page :first - -mPDF 5.7.2 -================ - -### 28/12/2013 - -Bug Fixes ---------- - -- `
` - -Added CSS support ------------------ -- max-height, max-width, min-height and min-width for images `` -- "hyphens: none|manual|auto" as per CSS3 spec. -- Decimal mark alignment e.g. text-align: "." center; -- "rem" accepted as a valid (font)size in CSS e.g. font-size: 1.5rem -- text-outline, text-outline-width and text-outline-color supported everywhere except in tables (blur not supported) -- background-origin, background-size, background-clip are now supported everywhere except in tables -- "visibility: hidden|visible|printonly|screenonly" for inline elements e.g. `` -- Colors: device-cmyk(c,m,y,k) as per CSS3 spec. For consistency, device-cmyka also supported (not CSS3 spec) -- "z-index" can be used to utilise layers in the PDF document -- Custom CSS property added: "outdent" - opposite of indent - -The HTML elements `` and `` can now have CSS properties applied to them. - -Bug fixes ---------- -- SVG images - path including e.g. 1.234E-15 incorrectly parsed (not recognising capital E) -- Tables - if a table starts when the Y position on page is below bottom margin caused endless loop -- Float-ing DIVs - starting a float at bottom of page and it causes page break before anything output, second new page is forced -- Tables - Warning notice now given in Table footer or header if `` placed after `` and table spans page -- Columns - block with border-width wider than the length of the border line, line overflows -- Columns - block with no padding containing a block with borders but no backgound colour, borders not printed -- Table in Columns - when background color set by surrounding block element - colour missing for height of half bottom border. -- TOCpagebreakByArray() when called by function was not adding the pagebreak -- Border around block element - dashed not showing correctly (not resetting linewidth between different edges) -- Double border in table - when background colour set in surrounding block element - shows as black line between the 2 bits of double -- Borders around DIVs - "double" border problem if not all 4 sides equally - fixed -- Borders around DIVs - solid (and double) borders overlap as in tables - now fixed so mitred joins as in browser - [Inadvertently improves borders in Columns because of change in LineCap] -- Page numbering - $mpdf->pagenumSuffix etc not suppressed in HTML headers/footers if number suppressed -- Page numbering - Page number total {nbpg} incorrect - e.g. showing decreasing numbers through document, when ToC present -- RTL numerals - incorrectly reversing a number followed by a comma -- Transform to uppercase/lowercase not working for chars > ASCII 128 when using core fonts -- TOCpagebreak - Not setting TOC-FOOTER -- TOCpagebreak - toc-even-header-name etc. not working -- Parsing some relative URLs incorrectly -- Textcircle - when moved to next page by "page-break-inside: avoid" -- Bookmarks will now work if jump more than one level e.g. 0,2,1 Inserts a new blank entry at level 1 -- Paths to img or stylesheets - incorrectly reading "//www.domain.com" i.e. when starting with two / -- data:image as background url() - incorrectly adjusting path on server if MPDF_PATH not specified (included in release mPDF 5.6.1) -- Image problem if spaces or commas in path using http:// URL (included in release mPDF 5.6.1) -- Image URL parsing rewritten to handle both urlencoded URLs and not urlencoded (included in release mPDF 5.6.1) -- `` fixed to allow color, font-size and font-family to be correctly used, avoid dots being moved to new page, and to work in RTL -- Table {colsum} summed figures in table header -- list-style-type (custom) colour not working -- `` toc-preHTML and toc-postHTML can now contain quotes - -mPDF 5.6 -=========================== - -### 20/01/2013 - -Files changed -------------- -- mpdf.php -- config.php -- includes/functions.php -- classes/meter.php -- classes/directw.php - - -config.php changes ------------------- - -- $this->allowedCSStags - added HTML5 tags + textcircle AND -- $this->outerblocktags - added HTML5 tags -- $this->defaultCSS - added default CSS properties - -New features / Improvements ---------------------------- -CSS support added for for min-height, min-width, max-height and max-width in `` - -Images embedded in CSS -- `` improved to make it more robust, and background: `url(data:image...` now added to work - -HTML5 tags supported -- as generic block elements: `
- - - +
+

{$_bill['routers']}

+
+ {if $_bill['type'] == 'Hotspot'} + {if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if} + {else} + {if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if} + {/if} +
+
+ {else} +
+

{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}

+
{/if} - - - - - - - - - - - - - {if $nux_ip} +
s are globally styled */ - border-color: #eeeeee; - /* don't put a border between events and/or the day number */ - border-bottom: 0; -} -.fc-row .fc-content-skeleton tbody td, -.fc-row .fc-helper-skeleton tbody td { - /* don't put a border between event cells */ - border-top: 0; -} -.fc-row .fc-content-skeleton tr td { - padding-right: 3px; - padding-top: 3px; -} -/* Scrolling Container ---------------------------------------------------------------------------------------------------*/ -.fc-scroller { - /* this class goes on elements for guaranteed vertical scrollbars */ - overflow-y: scroll; - overflow-x: hidden; -} -.fc-scroller > * { - /* we expect an immediate inner element */ - position: relative; - /* re-scope all positions */ - width: 100%; - /* hack to force re-sizing this inner element when scrollbars appear/disappear */ - overflow: hidden; - /* don't let negative margins or absolute positioning create further scroll */ -} -/* Global Event Styles ---------------------------------------------------------------------------------------------------*/ -.fc-event { - position: relative; - /* for resize handle and other inner positioning */ - display: block; - /* make the tag block */ - font-size: 10px; - line-height: 1.4; - border-radius: 1px; - border: 1px solid transparent; - /* default BORDER color */ - background-color: #e91e63; - /* default BACKGROUND color */ - font-weight: normal; - /* undo jqui's ui-widget-header bold */ - padding: 4px; -} -/* overpower some of bootstrap's and jqui's styles on tags */ -.fc-event, -.fc-event:hover, -.ui-widget .fc-event { - color: #fff; - /* default TEXT color */ - text-decoration: none; - /* if has an href */ -} -.fc-event[href], -.fc-event.fc-draggable { - cursor: pointer; - /* give events with links and draggable events a hand mouse pointer */ -} -.fc-not-allowed, -.fc-not-allowed .fc-event { - /* to override an event's custom cursor */ - cursor: not-allowed; -} -/* DayGrid events ----------------------------------------------------------------------------------------------------- -We use the full "fc-day-grid-event" class instead of using descendants because the event won't -be a descendant of the grid when it is being dragged. -*/ -.fc-day-grid-event { - margin: 1px 2px 0; - /* spacing between events and edges */ - padding: 2px 5px; -} -/* events that are continuing to/from another week. kill rounded corners and butt up against edge */ -.fc-ltr .fc-day-grid-event.fc-not-start, -.fc-rtl .fc-day-grid-event.fc-not-end { - margin-left: 0; - border-left-width: 0; - padding-left: 1px; - /* replace the border with padding */ - border-top-left-radius: 0; - border-bottom-left-radius: 0; -} -.fc-ltr .fc-day-grid-event.fc-not-end, -.fc-rtl .fc-day-grid-event.fc-not-start { - margin-right: 0; - border-right-width: 0; - padding-right: 1px; - /* replace the border with padding */ - border-top-right-radius: 0; - border-bottom-right-radius: 0; -} -.fc-day-grid-event > .fc-content { - /* force events to be one-line tall */ - white-space: nowrap; - overflow: hidden; -} -.fc-day-grid-event .fc-time { - font-weight: bold; -} -/* resize handle (outside of fc-content, so can go outside of bounds) */ -.fc-day-grid-event .fc-resizer { - position: absolute; - top: 0; - bottom: 0; - width: 7px; -} -.fc-ltr .fc-day-grid-event .fc-resizer { - right: -3px; - cursor: e-resize; -} -.fc-rtl .fc-day-grid-event .fc-resizer { - left: -3px; - cursor: w-resize; -} -/* Event Limiting ---------------------------------------------------------------------------------------------------*/ -/* "more" link that represents hidden events */ -a.fc-more { - margin: 1px 3px; - font-size: 10px; - cursor: pointer; - text-decoration: none; -} -a.fc-more:hover { - text-decoration: underline; -} -.fc-limited { - /* rows and cells that are hidden because of a "more" link */ - display: none; -} -/* popover that appears when "more" link is clicked */ -.fc-day-grid .fc-row { - z-index: 1; - /* make the "more" popover one higher than this */ -} -.fc-more-popover { - z-index: 2; - width: 220px; -} -.fc-more-popover .fc-event-container { - padding: 15px; -} -/* Toolbar ---------------------------------------------------------------------------------------------------*/ -.fc-toolbar { - text-align: center; - margin-bottom: 1em; -} -.fc-toolbar .fc-left { - float: left; -} -.fc-toolbar .fc-right { - float: right; -} -.fc-toolbar .fc-center { - display: inline-block; -} -/* the things within each left/right/center section */ -.fc .fc-toolbar > * > * { - /* extra precedence to override button border margins */ - float: left; - margin-left: .75em; -} -/* the first thing within each left/center/right section */ -.fc .fc-toolbar > * > :first-child { - /* extra precedence to override button border margins */ - margin-left: 0; -} -/* title text */ -.fc-toolbar h2 { - margin: 0; -} -/* button layering (for border precedence) */ -.fc-toolbar button { - position: relative; -} -.fc-toolbar .fc-state-hover, -.fc-toolbar .ui-state-hover { - z-index: 2; -} -.fc-toolbar .fc-state-down { - z-index: 3; -} -.fc-toolbar .fc-state-active, -.fc-toolbar .ui-state-active { - z-index: 4; -} -.fc-toolbar button:focus { - z-index: 5; -} -/* View Structure ---------------------------------------------------------------------------------------------------*/ -.fc-view-container { - box-shadow: 0 1px 2px rgba(0, 0, 0, 0.07); -} -/* undo twitter bootstrap's box-sizing rules. normalizes positioning techniques */ -/* don't do this for the toolbar because we'll want bootstrap to style those buttons as some pt */ -.fc-view-container *, -.fc-view-container *:before, -.fc-view-container *:after { - -webkit-box-sizing: content-box; - -moz-box-sizing: content-box; - box-sizing: content-box; -} -.fc-view, -.fc-view > table { - /* so dragged elements can be above the view's main element */ - position: relative; - z-index: 1; -} -/* BasicView ---------------------------------------------------------------------------------------------------*/ -/* day row structure */ -.fc-basicWeek-view .fc-content-skeleton, -.fc-basicDay-view .fc-content-skeleton { - /* we are sure there are no day numbers in these views, so... */ - padding-top: 1px; - /* add a pixel to make sure there are 2px padding above events */ - padding-bottom: 1em; - /* ensure a space at bottom of cell for user selecting/clicking */ -} -.fc-basic-view tbody .fc-row { - min-height: 4em; - /* ensure that all rows are at least this tall */ -} -/* a "rigid" row will take up a constant amount of height because content-skeleton is absolute */ -.fc-row.fc-rigid { - overflow: hidden; -} -.fc-row.fc-rigid .fc-content-skeleton { - position: absolute; - top: 0; - left: 0; - right: 0; -} -/* week and day number styling */ -.fc-basic-view .fc-week-number, -.fc-basic-view .fc-day-number { - padding: 0 2px; -} -.fc-basic-view td.fc-week-number span, -.fc-basic-view td.fc-day-number { - padding-top: 2px; - padding-bottom: 2px; -} -.fc-basic-view .fc-week-number { - text-align: center; -} -.fc-basic-view .fc-week-number span { - /* work around the way we do column resizing and ensure a minimum width */ - display: inline-block; - min-width: 1.25em; -} -.fc-ltr .fc-basic-view .fc-day-number { - text-align: right; -} -.fc-rtl .fc-basic-view .fc-day-number { - text-align: left; -} -.fc-day-number.fc-other-month { - opacity: 0.3; -} -/* AgendaView all-day area ---------------------------------------------------------------------------------------------------*/ -.fc-agenda-view .fc-day-grid { - position: relative; - z-index: 2; - /* so the "more.." popover will be over the time grid */ -} -.fc-agenda-view .fc-day-grid .fc-row { - min-height: 3em; - /* all-day section will never get shorter than this */ -} -.fc-agenda-view .fc-day-grid .fc-row .fc-content-skeleton { - padding-top: 1px; - /* add a pixel to make sure there are 2px padding above events */ - padding-bottom: 1em; - /* give space underneath events for clicking/selecting days */ -} -/* TimeGrid axis running down the side (for both the all-day area and the slot area) ---------------------------------------------------------------------------------------------------*/ -.fc .fc-axis { - /* .fc to overcome default cell styles */ - vertical-align: middle; - padding: 0 4px; - white-space: nowrap; -} -.fc-ltr .fc-axis { - text-align: right; -} -.fc-rtl .fc-axis { - text-align: left; -} -.ui-widget td.fc-axis { - font-weight: normal; - /* overcome jqui theme making it bold */ -} -/* TimeGrid Structure ---------------------------------------------------------------------------------------------------*/ -.fc-time-grid-container, -.fc-time-grid { - /* so slats/bg/content/etc positions get scoped within here */ - position: relative; - z-index: 1; -} -.fc-time-grid { - min-height: 100%; - /* so if height setting is 'auto', .fc-bg stretches to fill height */ -} -.fc-time-grid table { - /* don't put outer borders on slats/bg/content/etc */ - border: 0 hidden transparent; -} -.fc-time-grid > .fc-bg { - z-index: 1; -} -.fc-time-grid .fc-slats, -.fc-time-grid > hr { - /* the
AgendaView injects when grid is shorter than scroller */ - position: relative; - z-index: 2; -} -.fc-time-grid .fc-bgevent-skeleton, -.fc-time-grid .fc-content-skeleton { - position: absolute; - top: 0; - left: 0; - right: 0; -} -.fc-time-grid .fc-bgevent-skeleton { - z-index: 3; -} -.fc-time-grid .fc-highlight-skeleton { - z-index: 4; -} -.fc-time-grid .fc-content-skeleton { - z-index: 5; -} -.fc-time-grid .fc-helper-skeleton { - z-index: 6; -} -/* TimeGrid Slats (lines that run horizontally) ---------------------------------------------------------------------------------------------------*/ -.fc-slats td { - height: 1.5em; - border-bottom: 0; - /* each cell is responsible for its top border */ -} -.fc-slats .fc-minor td { - border-top-style: dotted; -} -.fc-slats .ui-widget-content { - /* for jqui theme */ - background: none; - /* see through to fc-bg */ -} -/* TimeGrid Highlighting Slots ---------------------------------------------------------------------------------------------------*/ -.fc-time-grid .fc-highlight-container { - /* a div within a cell within the fc-highlight-skeleton */ - position: relative; - /* scopes the left/right of the fc-highlight to be in the column */ -} -.fc-time-grid .fc-highlight { - position: absolute; - left: 0; - right: 0; - /* top and bottom will be in by JS */ -} -/* TimeGrid Event Containment ---------------------------------------------------------------------------------------------------*/ -.fc-time-grid .fc-event-container, -.fc-time-grid .fc-bgevent-container { - /* a div within a cell within the fc-bgevent-skeleton */ - position: relative; -} -.fc-ltr .fc-time-grid .fc-event-container { - /* space on the sides of events for LTR (default) */ - margin: 0 2.5% 0 2px; -} -.fc-rtl .fc-time-grid .fc-event-container { - /* space on the sides of events for RTL */ - margin: 0 2px 0 2.5%; -} -.fc-time-grid .fc-event, -.fc-time-grid .fc-bgevent { - position: absolute; - z-index: 1; - /* scope inner z-index's */ -} -.fc-time-grid .fc-bgevent { - /* background events always span full width */ - left: 0; - right: 0; -} -/* TimeGrid Event Styling ----------------------------------------------------------------------------------------------------- -We use the full "fc-time-grid-event" class instead of using descendants because the event won't -be a descendant of the grid when it is being dragged. -*/ -.fc-time-grid-event.fc-not-start { - /* events that are continuing from another day */ - /* replace space made by the top border with padding */ - border-top-width: 0; - padding-top: 1px; - /* remove top rounded corners */ - border-top-left-radius: 0; - border-top-right-radius: 0; -} -.fc-time-grid-event.fc-not-end { - /* replace space made by the top border with padding */ - border-bottom-width: 0; - padding-bottom: 1px; - /* remove bottom rounded corners */ - border-bottom-left-radius: 0; - border-bottom-right-radius: 0; -} -.fc-time-grid-event { - overflow: hidden; - /* don't let the bg flow over rounded corners */ -} -.fc-time-grid-event > .fc-content { - /* contains the time and title, but no bg and resizer */ - position: relative; - z-index: 2; - /* above the bg */ -} -.fc-time-grid-event .fc-time, -.fc-time-grid-event .fc-title { - padding: 0 1px; -} -.fc-time-grid-event .fc-time { - font-size: 10px; - white-space: nowrap; -} -.fc-time-grid-event .fc-bg { - z-index: 1; - background: #fff; - opacity: .25; -} -/* short mode, where time and title are on the same line */ -.fc-time-grid-event.fc-short .fc-content { - /* don't wrap to second line (now that contents will be inline) */ - white-space: nowrap; -} -.fc-time-grid-event.fc-short .fc-time, -.fc-time-grid-event.fc-short .fc-title { - /* put the time and title on the same line */ - display: inline-block; - vertical-align: top; -} -.fc-time-grid-event.fc-short .fc-time span { - display: none; - /* don't display the full time text... */ -} -.fc-time-grid-event.fc-short .fc-time:before { - content: attr(data-start); - /* ...instead, display only the start time */ -} -.fc-time-grid-event.fc-short .fc-time:after { - content: "\000A0-\000A0"; - /* seperate with a dash, wrapped in nbsp's */ -} -.fc-time-grid-event.fc-short .fc-title { - font-size: .85em; - /* make the title text the same size as the time */ - padding: 0; - /* undo padding from above */ -} -/* resizer */ -.fc-time-grid-event .fc-resizer { - position: absolute; - z-index: 3; - /* above content */ - left: 0; - right: 0; - bottom: 0; - height: 8px; - overflow: hidden; - line-height: 8px; - font-size: 10px; - font-family: monospace; - text-align: center; - cursor: s-resize; -} -.fc-time-grid-event .fc-resizer:after { - content: "="; -} diff --git a/ui/ui/styles/plugins/pace.css b/ui/ui/styles/plugins/pace.css new file mode 100755 index 00000000..2f196bb6 --- /dev/null +++ b/ui/ui/styles/plugins/pace.css @@ -0,0 +1,85 @@ +.pace { + -webkit-pointer-events: none; + pointer-events: none; + -webkit-user-select: none; + -moz-user-select: none; + user-select: none; +} + +.pace-inactive { + display: none; +} + +.pace .pace-progress { + background: #fff; + position: fixed; + z-index: 2000; + top: 0; + right: 100%; + width: 100%; + height: 2px; +} + +.pace .pace-progress-inner { + display: block; + position: absolute; + right: 0px; + width: 100px; + height: 100%; + box-shadow: 0 0 10px #fff, 0 0 5px #fff; + opacity: 1.0; + -webkit-transform: rotate(3deg) translate(0px, -4px); + -moz-transform: rotate(3deg) translate(0px, -4px); + -ms-transform: rotate(3deg) translate(0px, -4px); + -o-transform: rotate(3deg) translate(0px, -4px); + transform: rotate(3deg) translate(0px, -4px); +} + +.pace .pace-activity { + display: block; + position: fixed; + z-index: 2000; + top: 15px; + right: 50%; + width: 14px; + height: 14px; + border: solid 2px transparent; + border-top-color: #fff; + border-left-color: #fff; + border-radius: 10px; + -webkit-animation: pace-spinner 400ms linear infinite; + -moz-animation: pace-spinner 400ms linear infinite; + -ms-animation: pace-spinner 400ms linear infinite; + -o-animation: pace-spinner 400ms linear infinite; + animation: pace-spinner 400ms linear infinite; +} + +@media (max-width: 767px) { + .pace .pace-activity { + top: 15px; + right: 15px; + width: 14px; + height: 14px; + } +} + +@-webkit-keyframes pace-spinner { + 0% { -webkit-transform: rotate(0deg); transform: rotate(0deg); } + 100% { -webkit-transform: rotate(360deg); transform: rotate(360deg); } +} +@-moz-keyframes pace-spinner { + 0% { -moz-transform: rotate(0deg); transform: rotate(0deg); } + 100% { -moz-transform: rotate(360deg); transform: rotate(360deg); } +} +@-o-keyframes pace-spinner { + 0% { -o-transform: rotate(0deg); transform: rotate(0deg); } + 100% { -o-transform: rotate(360deg); transform: rotate(360deg); } +} +@-ms-keyframes pace-spinner { + 0% { -ms-transform: rotate(0deg); transform: rotate(0deg); } + 100% { -ms-transform: rotate(360deg); transform: rotate(360deg); } +} +@keyframes pace-spinner { + 0% { transform: rotate(0deg); transform: rotate(0deg); } + 100% { transform: rotate(360deg); transform: rotate(360deg); } +} \ No newline at end of file diff --git a/ui/ui/styles/plugins/perfect-scrollbar.css b/ui/ui/styles/plugins/perfect-scrollbar.css deleted file mode 100644 index 7aee9589..00000000 --- a/ui/ui/styles/plugins/perfect-scrollbar.css +++ /dev/null @@ -1,70 +0,0 @@ -.ps-container.ps-active-x > .ps-scrollbar-x-rail, -.ps-container.ps-active-y > .ps-scrollbar-y-rail { - display: block; -} -.ps-container > .ps-scrollbar-x-rail, -.ps-container > .ps-scrollbar-y-rail { - display: none; - /* please don't change 'position' */ - position: absolute; - border-radius: 1px; - opacity: 0; - -webkit-transition: background-color 0.2s linear, opacity 0.2s linear; - transition: background-color 0.2s linear, opacity 0.2s linear; -} -.ps-container > .ps-scrollbar-x-rail.in-scrolling, -.ps-container > .ps-scrollbar-y-rail.in-scrolling { - background-color: transparent; - opacity: .9; - display: block; -} -.ps-container > .ps-scrollbar-x-rail > .ps-scrollbar-x, -.ps-container > .ps-scrollbar-y-rail > .ps-scrollbar-y { - position: absolute; - background-color: #aaa; - border-radius: 1px; - -webkit-transition: background-color 0.2s linear, width 0.2s linear; - transition: background-color 0.2s linear, width 0.2s linear; -} -.ps-container > .ps-scrollbar-x-rail { - /* there must be 'bottom' for ps-scrollbar-x-rail */ - bottom: 3px; - height: 8px; -} -.ps-container > .ps-scrollbar-x-rail.in-scrolling { - height: 4px; -} -.ps-container > .ps-scrollbar-x-rail:hover > .ps-scrollbar-y { - height: 4px; -} -.ps-container > .ps-scrollbar-x-rail > .ps-scrollbar-x { - bottom: 0; - height: 4px; -} -.ps-container > .ps-scrollbar-y-rail { - right: 0px; - width: 14px; -} -.ps-container > .ps-scrollbar-y-rail.in-scrolling { - width: 4px; -} -.ps-container > .ps-scrollbar-y-rail:hover > .ps-scrollbar-y { - width: 4px; -} -.ps-container > .ps-scrollbar-y-rail > .ps-scrollbar-y { - right: 0; - width: 4px; -} -.ps-container:hover > .ps-scrollbar-x-rail, -.ps-container:hover > .ps-scrollbar-y-rail { - opacity: .4; -} -.ps-container:hover > .ps-scrollbar-x-rail:hover, -.ps-container:hover > .ps-scrollbar-y-rail:hover { - opacity: .7; - display: block; -} -.ps-container:hover > .ps-scrollbar-x-rail > .ps-scrollbar-x, -.ps-container:hover > .ps-scrollbar-y-rail > .ps-scrollbar-y { - background-color: #888; -} diff --git a/ui/ui/styles/plugins/waves.css b/ui/ui/styles/plugins/waves.css deleted file mode 100644 index b5f2696f..00000000 --- a/ui/ui/styles/plugins/waves.css +++ /dev/null @@ -1,129 +0,0 @@ -/*! - * Waves v0.7.1 - * http://fian.my.id/Waves - * - * Copyright 2014 Alfiana E. Sibuea and other contributors - * Released under the MIT license - * https://github.com/fians/Waves/blob/master/LICENSE - */ -.waves-effect { - position: relative; - cursor: pointer; - /*display: inline-block;*/ - overflow: hidden; - -webkit-user-select: none; - -moz-user-select: none; - -ms-user-select: none; - user-select: none; - -webkit-tap-highlight-color: transparent; - -} -.waves-effect .waves-ripple { - position: absolute; - border-radius: 50%; - width: 100px; - height: 100px; - margin-top: -50px; - margin-left: -50px; - opacity: 0; - background: rgba(0, 0, 0, 0.2); - background: -webkit-radial-gradient(rgba(0, 0, 0, 0.1) 0, rgba(0, 0, 0, 0.2) 40%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.4) 60%, rgba(255, 255, 255, 0) 70%); - background: -o-radial-gradient(rgba(0, 0, 0, 0.1) 0, rgba(0, 0, 0, 0.2) 40%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.4) 60%, rgba(255, 255, 255, 0) 70%); - background: -moz-radial-gradient(rgba(0, 0, 0, 0.1) 0, rgba(0, 0, 0, 0.2) 40%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.4) 60%, rgba(255, 255, 255, 0) 70%); - background: radial-gradient(rgba(0, 0, 0, 0.1) 0, rgba(0, 0, 0, 0.2) 40%, rgba(0, 0, 0, 0.3) 50%, rgba(0, 0, 0, 0.4) 60%, rgba(255, 255, 255, 0) 70%); - -webkit-transition: all 0.7s ease-out; - -moz-transition: all 0.7s ease-out; - -o-transition: all 0.7s ease-out; - transition: all 0.7s ease-out; - -webkit-transition-property: -webkit-transform, opacity; - -moz-transition-property: -moz-transform, opacity; - -o-transition-property: -o-transform, opacity; - transition-property: transform, opacity; - -webkit-transform: scale(0) translate(0, 0); - -moz-transform: scale(0) translate(0, 0); - -ms-transform: scale(0) translate(0, 0); - -o-transform: scale(0) translate(0, 0); - transform: scale(0) translate(0, 0); - pointer-events: none; -} -.waves-effect.waves-light .waves-ripple { - background: rgba(255, 255, 255, 0.4); - background: -webkit-radial-gradient(rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0) 70%); - background: -o-radial-gradient(rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0) 70%); - background: -moz-radial-gradient(rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0) 70%); - background: radial-gradient(rgba(255, 255, 255, 0.2) 0, rgba(255, 255, 255, 0.3) 40%, rgba(255, 255, 255, 0.4) 50%, rgba(255, 255, 255, 0.5) 60%, rgba(255, 255, 255, 0) 70%); -} -.waves-effect.waves-classic .waves-ripple { - background: rgba(0, 0, 0, 0.2); -} -.waves-effect.waves-classic.waves-light .waves-ripple { - background: rgba(255, 255, 255, 0.4); -} -.waves-notransition { - -webkit-transition: none !important; - -moz-transition: none !important; - -o-transition: none !important; - transition: none !important; -} -.waves-button, -.waves-circle { - -webkit-transform: translateZ(0); - -moz-transform: translateZ(0); - -ms-transform: translateZ(0); - -o-transform: translateZ(0); - transform: translateZ(0); - /*-webkit-mask-image: -webkit-radial-gradient(circle, #ffffff 100%, #000000 100%);*/ -} -.waves-button, -.waves-button:hover, -.waves-button:visited, -.waves-button-input { -/* white-space: nowrap; - vertical-align: middle; - cursor: pointer; - border: none; - outline: none; - color: inherit; - background-color: rgba(0, 0, 0, 0); - font-size: 1em; - line-height: 1em; - text-align: center; - text-decoration: none; - z-index: 1;*/ -} -.waves-button { - /*padding: 0.85em 1.1em; - border-radius: 0.2em;*/ -} -.waves-button-input { - margin: 0; - padding: 0.85em 1.1em; -} - -.waves-circle { - text-align: center; - width: 2.5em; - height: 2.5em; - line-height: 2.5em; - border-radius: 50%; -} -.waves-float { - -webkit-mask-image: none; - -webkit-box-shadow: 0px 1px 1.5px 1px rgba(0, 0, 0, 0.12); - box-shadow: 0px 1px 1.5px 1px rgba(0, 0, 0, 0.12); - -webkit-transition: all 300ms; - -moz-transition: all 300ms; - -o-transition: all 300ms; - transition: all 300ms; -} -.waves-float:active { - -webkit-box-shadow: 0px 8px 20px 1px rgba(0, 0, 0, 0.3); - box-shadow: 0px 8px 20px 1px rgba(0, 0, 0, 0.3); -} -.waves-block { - display: block; -} -/* Firefox Bug: link not triggered */ -a.waves-effect .waves-ripple { - z-index: -1; -} diff --git a/ui/ui/styles/skin-blue.min.css b/ui/ui/styles/skin-blue.min.css deleted file mode 100644 index c2219cd9..00000000 --- a/ui/ui/styles/skin-blue.min.css +++ /dev/null @@ -1 +0,0 @@ -.skin-blue .main-header .navbar{background-color:#3c8dbc}.skin-blue .main-header .navbar .nav>li>a{color:#fff}.skin-blue .main-header .navbar .nav>li>a:hover,.skin-blue .main-header .navbar .nav>li>a:active,.skin-blue .main-header .navbar .nav>li>a:focus,.skin-blue .main-header .navbar .nav .open>a,.skin-blue .main-header .navbar .nav .open>a:hover,.skin-blue .main-header .navbar .nav .open>a:focus,.skin-blue .main-header .navbar .nav>.active>a{background:rgba(0,0,0,0.1);color:#f6f6f6}.skin-blue .main-header .navbar .sidebar-toggle{color:#fff}.skin-blue .main-header .navbar .sidebar-toggle:hover{color:#f6f6f6;background:rgba(0,0,0,0.1)}.skin-blue .main-header .navbar .sidebar-toggle{color:#fff}.skin-blue .main-header .navbar .sidebar-toggle:hover{background-color:#367fa9}@media (max-width:767px){.skin-blue .main-header .navbar .dropdown-menu li.divider{background-color:rgba(255,255,255,0.1)}.skin-blue .main-header .navbar .dropdown-menu li a{color:#fff}.skin-blue .main-header .navbar .dropdown-menu li a:hover{background:#367fa9}}.skin-blue .main-header .logo{background-color:#367fa9;color:#fff;border-bottom:0 solid transparent}.skin-blue .main-header .logo:hover{background-color:#357ca5}.skin-blue .main-header li.user-header{background-color:#3c8dbc}.skin-blue .content-header{background:transparent}.skin-blue .wrapper,.skin-blue .main-sidebar,.skin-blue .left-side{background-color:#222d32}.skin-blue .user-panel>.info,.skin-blue .user-panel>.info>a{color:#fff}.skin-blue .sidebar-menu>li.header{color:#4b646f;background:#1a2226}.skin-blue .sidebar-menu>li>a{border-left:3px solid transparent}.skin-blue .sidebar-menu>li:hover>a,.skin-blue .sidebar-menu>li.active>a,.skin-blue .sidebar-menu>li.menu-open>a{color:#fff;background:#1e282c}.skin-blue .sidebar-menu>li.active>a{border-left-color:#3c8dbc}.skin-blue .sidebar-menu>li>.treeview-menu{margin:0 1px;background:#2c3b41}.skin-blue .sidebar a{color:#b8c7ce}.skin-blue .sidebar a:hover{text-decoration:none}.skin-blue .sidebar-menu .treeview-menu>li>a{color:#8aa4af}.skin-blue .sidebar-menu .treeview-menu>li.active>a,.skin-blue .sidebar-menu .treeview-menu>li>a:hover{color:#fff}.skin-blue .sidebar-form{border-radius:3px;border:1px solid #374850;margin:10px 10px}.skin-blue .sidebar-form input[type="text"],.skin-blue .sidebar-form .btn{box-shadow:none;background-color:#374850;border:1px solid transparent;height:35px}.skin-blue .sidebar-form input[type="text"]{color:#666;border-top-left-radius:2px;border-top-right-radius:0;border-bottom-right-radius:0;border-bottom-left-radius:2px}.skin-blue .sidebar-form input[type="text"]:focus,.skin-blue .sidebar-form input[type="text"]:focus+.input-group-btn .btn{background-color:#fff;color:#666}.skin-blue .sidebar-form input[type="text"]:focus+.input-group-btn .btn{border-left-color:#fff}.skin-blue .sidebar-form .btn{color:#999;border-top-left-radius:0;border-top-right-radius:2px;border-bottom-right-radius:2px;border-bottom-left-radius:0}.skin-blue.layout-top-nav .main-header>.logo{background-color:#3c8dbc;color:#fff;border-bottom:0 solid transparent}.skin-blue.layout-top-nav .main-header>.logo:hover{background-color:#3b8ab8} \ No newline at end of file diff --git a/ui/ui/styles/sweetalert2.min.css b/ui/ui/styles/sweetalert2.min.css new file mode 100644 index 00000000..7d533ed3 --- /dev/null +++ b/ui/ui/styles/sweetalert2.min.css @@ -0,0 +1 @@ +.swal2-popup.swal2-toast{box-sizing:border-box;grid-column:1/4 !important;grid-row:1/4 !important;grid-template-columns:min-content auto min-content;padding:1em;overflow-y:hidden;background:#fff;box-shadow:0 0 1px rgba(0,0,0,.075),0 1px 2px rgba(0,0,0,.075),1px 2px 4px rgba(0,0,0,.075),1px 3px 8px rgba(0,0,0,.075),2px 4px 16px rgba(0,0,0,.075);pointer-events:all}.swal2-popup.swal2-toast>*{grid-column:2}.swal2-popup.swal2-toast .swal2-title{margin:.5em 1em;padding:0;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-loading{justify-content:center}.swal2-popup.swal2-toast .swal2-input{height:2em;margin:.5em;font-size:1em}.swal2-popup.swal2-toast .swal2-validation-message{font-size:1em}.swal2-popup.swal2-toast .swal2-footer{margin:.5em 0 0;padding:.5em 0 0;font-size:.8em}.swal2-popup.swal2-toast .swal2-close{grid-column:3/3;grid-row:1/99;align-self:center;width:.8em;height:.8em;margin:0;font-size:2em}.swal2-popup.swal2-toast .swal2-html-container{margin:.5em 1em;padding:0;overflow:initial;font-size:1em;text-align:initial}.swal2-popup.swal2-toast .swal2-html-container:empty{padding:0}.swal2-popup.swal2-toast .swal2-loader{grid-column:1;grid-row:1/99;align-self:center;width:2em;height:2em;margin:.25em}.swal2-popup.swal2-toast .swal2-icon{grid-column:1;grid-row:1/99;align-self:center;width:2em;min-width:2em;height:2em;margin:0 .5em 0 0}.swal2-popup.swal2-toast .swal2-icon .swal2-icon-content{display:flex;align-items:center;font-size:1.8em;font-weight:bold}.swal2-popup.swal2-toast .swal2-icon.swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line]{top:.875em;width:1.375em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=left]{left:.3125em}.swal2-popup.swal2-toast .swal2-icon.swal2-error [class^=swal2-x-mark-line][class$=right]{right:.3125em}.swal2-popup.swal2-toast .swal2-actions{justify-content:flex-start;height:auto;margin:0;margin-top:.5em;padding:0 .5em}.swal2-popup.swal2-toast .swal2-styled{margin:.25em .5em;padding:.4em .6em;font-size:1em}.swal2-popup.swal2-toast .swal2-success{border-color:#a5dc86}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line]{position:absolute;width:1.6em;height:3em;border-radius:50%}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.8em;left:-0.5em;transform:rotate(-45deg);transform-origin:2em 2em;border-radius:4em 0 0 4em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.25em;left:.9375em;transform-origin:0 1.5em;border-radius:0 4em 4em 0}.swal2-popup.swal2-toast .swal2-success .swal2-success-ring{width:2em;height:2em}.swal2-popup.swal2-toast .swal2-success .swal2-success-fix{top:0;left:.4375em;width:.4375em;height:2.6875em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line]{height:.3125em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=tip]{top:1.125em;left:.1875em;width:.75em}.swal2-popup.swal2-toast .swal2-success [class^=swal2-success-line][class$=long]{top:.9375em;right:.1875em;width:1.375em}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-toast-animate-success-line-tip .75s}.swal2-popup.swal2-toast .swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-toast-animate-success-line-long .75s}.swal2-popup.swal2-toast.swal2-show{animation:swal2-toast-show .5s}.swal2-popup.swal2-toast.swal2-hide{animation:swal2-toast-hide .1s forwards}div:where(.swal2-container){display:grid;position:fixed;z-index:1060;inset:0;box-sizing:border-box;grid-template-areas:"top-start top top-end" "center-start center center-end" "bottom-start bottom-center bottom-end";grid-template-rows:minmax(min-content, auto) minmax(min-content, auto) minmax(min-content, auto);height:100%;padding:.625em;overflow-x:hidden;transition:background-color .1s;-webkit-overflow-scrolling:touch}div:where(.swal2-container).swal2-backdrop-show,div:where(.swal2-container).swal2-noanimation{background:rgba(0,0,0,.4)}div:where(.swal2-container).swal2-backdrop-hide{background:rgba(0,0,0,0) !important}div:where(.swal2-container).swal2-top-start,div:where(.swal2-container).swal2-center-start,div:where(.swal2-container).swal2-bottom-start{grid-template-columns:minmax(0, 1fr) auto auto}div:where(.swal2-container).swal2-top,div:where(.swal2-container).swal2-center,div:where(.swal2-container).swal2-bottom{grid-template-columns:auto minmax(0, 1fr) auto}div:where(.swal2-container).swal2-top-end,div:where(.swal2-container).swal2-center-end,div:where(.swal2-container).swal2-bottom-end{grid-template-columns:auto auto minmax(0, 1fr)}div:where(.swal2-container).swal2-top-start>.swal2-popup{align-self:start}div:where(.swal2-container).swal2-top>.swal2-popup{grid-column:2;place-self:start center}div:where(.swal2-container).swal2-top-end>.swal2-popup,div:where(.swal2-container).swal2-top-right>.swal2-popup{grid-column:3;place-self:start end}div:where(.swal2-container).swal2-center-start>.swal2-popup,div:where(.swal2-container).swal2-center-left>.swal2-popup{grid-row:2;align-self:center}div:where(.swal2-container).swal2-center>.swal2-popup{grid-column:2;grid-row:2;place-self:center center}div:where(.swal2-container).swal2-center-end>.swal2-popup,div:where(.swal2-container).swal2-center-right>.swal2-popup{grid-column:3;grid-row:2;place-self:center end}div:where(.swal2-container).swal2-bottom-start>.swal2-popup,div:where(.swal2-container).swal2-bottom-left>.swal2-popup{grid-column:1;grid-row:3;align-self:end}div:where(.swal2-container).swal2-bottom>.swal2-popup{grid-column:2;grid-row:3;place-self:end center}div:where(.swal2-container).swal2-bottom-end>.swal2-popup,div:where(.swal2-container).swal2-bottom-right>.swal2-popup{grid-column:3;grid-row:3;place-self:end end}div:where(.swal2-container).swal2-grow-row>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-column:1/4;width:100%}div:where(.swal2-container).swal2-grow-column>.swal2-popup,div:where(.swal2-container).swal2-grow-fullscreen>.swal2-popup{grid-row:1/4;align-self:stretch}div:where(.swal2-container).swal2-no-transition{transition:none !important}div:where(.swal2-container) div:where(.swal2-popup){display:none;position:relative;box-sizing:border-box;grid-template-columns:minmax(0, 100%);width:32em;max-width:100%;padding:0 0 1.25em;border:none;border-radius:5px;background:#fff;color:#545454;font-family:inherit;font-size:1rem}div:where(.swal2-container) div:where(.swal2-popup):focus{outline:none}div:where(.swal2-container) div:where(.swal2-popup).swal2-loading{overflow-y:hidden}div:where(.swal2-container) h2:where(.swal2-title){position:relative;max-width:100%;margin:0;padding:.8em 1em 0;color:inherit;font-size:1.875em;font-weight:600;text-align:center;text-transform:none;word-wrap:break-word}div:where(.swal2-container) div:where(.swal2-actions){display:flex;z-index:1;box-sizing:border-box;flex-wrap:wrap;align-items:center;justify-content:center;width:auto;margin:1.25em auto 0;padding:0}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled[disabled]{opacity:.4}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:hover{background-image:linear-gradient(rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.1))}div:where(.swal2-container) div:where(.swal2-actions):not(.swal2-loading) .swal2-styled:active{background-image:linear-gradient(rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.2))}div:where(.swal2-container) div:where(.swal2-loader){display:none;align-items:center;justify-content:center;width:2.2em;height:2.2em;margin:0 1.875em;animation:swal2-rotate-loading 1.5s linear 0s infinite normal;border-width:.25em;border-style:solid;border-radius:100%;border-color:#2778c4 rgba(0,0,0,0) #2778c4 rgba(0,0,0,0)}div:where(.swal2-container) button:where(.swal2-styled){margin:.3125em;padding:.625em 1.1em;transition:box-shadow .1s;box-shadow:0 0 0 3px rgba(0,0,0,0);font-weight:500}div:where(.swal2-container) button:where(.swal2-styled):not([disabled]){cursor:pointer}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm{border:0;border-radius:.25em;background:initial;background-color:#7066e0;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-confirm:focus{box-shadow:0 0 0 3px rgba(112,102,224,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny{border:0;border-radius:.25em;background:initial;background-color:#dc3741;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-deny:focus{box-shadow:0 0 0 3px rgba(220,55,65,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel{border:0;border-radius:.25em;background:initial;background-color:#6e7881;color:#fff;font-size:1em}div:where(.swal2-container) button:where(.swal2-styled).swal2-cancel:focus{box-shadow:0 0 0 3px rgba(110,120,129,.5)}div:where(.swal2-container) button:where(.swal2-styled).swal2-default-outline:focus{box-shadow:0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-styled):focus{outline:none}div:where(.swal2-container) button:where(.swal2-styled)::-moz-focus-inner{border:0}div:where(.swal2-container) div:where(.swal2-footer){margin:1em 0 0;padding:1em 1em 0;border-top:1px solid #eee;color:inherit;font-size:1em;text-align:center}div:where(.swal2-container) .swal2-timer-progress-bar-container{position:absolute;right:0;bottom:0;left:0;grid-column:auto !important;overflow:hidden;border-bottom-right-radius:5px;border-bottom-left-radius:5px}div:where(.swal2-container) div:where(.swal2-timer-progress-bar){width:100%;height:.25em;background:rgba(0,0,0,.2)}div:where(.swal2-container) img:where(.swal2-image){max-width:100%;margin:2em auto 1em}div:where(.swal2-container) button:where(.swal2-close){z-index:2;align-items:center;justify-content:center;width:1.2em;height:1.2em;margin-top:0;margin-right:0;margin-bottom:-1.2em;padding:0;overflow:hidden;transition:color .1s,box-shadow .1s;border:none;border-radius:5px;background:rgba(0,0,0,0);color:#ccc;font-family:monospace;font-size:2.5em;cursor:pointer;justify-self:end}div:where(.swal2-container) button:where(.swal2-close):hover{transform:none;background:rgba(0,0,0,0);color:#f27474}div:where(.swal2-container) button:where(.swal2-close):focus{outline:none;box-shadow:inset 0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) button:where(.swal2-close)::-moz-focus-inner{border:0}div:where(.swal2-container) .swal2-html-container{z-index:1;justify-content:center;margin:1em 1.6em .3em;padding:0;overflow:auto;color:inherit;font-size:1.125em;font-weight:normal;line-height:normal;text-align:center;word-wrap:break-word;word-break:break-word}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea),div:where(.swal2-container) select:where(.swal2-select),div:where(.swal2-container) div:where(.swal2-radio),div:where(.swal2-container) label:where(.swal2-checkbox){margin:1em 2em 3px}div:where(.swal2-container) input:where(.swal2-input),div:where(.swal2-container) input:where(.swal2-file),div:where(.swal2-container) textarea:where(.swal2-textarea){box-sizing:border-box;width:auto;transition:border-color .1s,box-shadow .1s;border:1px solid #d9d9d9;border-radius:.1875em;background:rgba(0,0,0,0);box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) input:where(.swal2-input).swal2-inputerror,div:where(.swal2-container) input:where(.swal2-file).swal2-inputerror,div:where(.swal2-container) textarea:where(.swal2-textarea).swal2-inputerror{border-color:#f27474 !important;box-shadow:0 0 2px #f27474 !important}div:where(.swal2-container) input:where(.swal2-input):focus,div:where(.swal2-container) input:where(.swal2-file):focus,div:where(.swal2-container) textarea:where(.swal2-textarea):focus{border:1px solid #b4dbed;outline:none;box-shadow:inset 0 1px 1px rgba(0,0,0,.06),0 0 0 3px rgba(100,150,200,.5)}div:where(.swal2-container) input:where(.swal2-input)::placeholder,div:where(.swal2-container) input:where(.swal2-file)::placeholder,div:where(.swal2-container) textarea:where(.swal2-textarea)::placeholder{color:#ccc}div:where(.swal2-container) .swal2-range{margin:1em 2em 3px;background:#fff}div:where(.swal2-container) .swal2-range input{width:80%}div:where(.swal2-container) .swal2-range output{width:20%;color:inherit;font-weight:600;text-align:center}div:where(.swal2-container) .swal2-range input,div:where(.swal2-container) .swal2-range output{height:2.625em;padding:0;font-size:1.125em;line-height:2.625em}div:where(.swal2-container) .swal2-input{height:2.625em;padding:0 .75em}div:where(.swal2-container) .swal2-file{width:75%;margin-right:auto;margin-left:auto;background:rgba(0,0,0,0);font-size:1.125em}div:where(.swal2-container) .swal2-textarea{height:6.75em;padding:.75em}div:where(.swal2-container) .swal2-select{min-width:50%;max-width:100%;padding:.375em .625em;background:rgba(0,0,0,0);color:inherit;font-size:1.125em}div:where(.swal2-container) .swal2-radio,div:where(.swal2-container) .swal2-checkbox{align-items:center;justify-content:center;background:#fff;color:inherit}div:where(.swal2-container) .swal2-radio label,div:where(.swal2-container) .swal2-checkbox label{margin:0 .6em;font-size:1.125em}div:where(.swal2-container) .swal2-radio input,div:where(.swal2-container) .swal2-checkbox input{flex-shrink:0;margin:0 .4em}div:where(.swal2-container) label:where(.swal2-input-label){display:flex;justify-content:center;margin:1em auto 0}div:where(.swal2-container) div:where(.swal2-validation-message){align-items:center;justify-content:center;margin:1em 0 0;padding:.625em;overflow:hidden;background:#f0f0f0;color:#666;font-size:1em;font-weight:300}div:where(.swal2-container) div:where(.swal2-validation-message)::before{content:"!";display:inline-block;width:1.5em;min-width:1.5em;height:1.5em;margin:0 .625em;border-radius:50%;background-color:#f27474;color:#fff;font-weight:600;line-height:1.5em;text-align:center}div:where(.swal2-container) .swal2-progress-steps{flex-wrap:wrap;align-items:center;max-width:100%;margin:1.25em auto;padding:0;background:rgba(0,0,0,0);font-weight:600}div:where(.swal2-container) .swal2-progress-steps li{display:inline-block;position:relative}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step{z-index:20;flex-shrink:0;width:2em;height:2em;border-radius:2em;background:#2778c4;color:#fff;line-height:2em;text-align:center}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step{background:#2778c4}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step{background:#add8e6;color:#fff}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step.swal2-active-progress-step~.swal2-progress-step-line{background:#add8e6}div:where(.swal2-container) .swal2-progress-steps .swal2-progress-step-line{z-index:10;flex-shrink:0;width:2.5em;height:.4em;margin:0 -1px;background:#2778c4}div:where(.swal2-icon){position:relative;box-sizing:content-box;justify-content:center;width:5em;height:5em;margin:2.5em auto .6em;border:0.25em solid rgba(0,0,0,0);border-radius:50%;border-color:#000;font-family:inherit;line-height:5em;cursor:default;user-select:none}div:where(.swal2-icon) .swal2-icon-content{display:flex;align-items:center;font-size:3.75em}div:where(.swal2-icon).swal2-error{border-color:#f27474;color:#f27474}div:where(.swal2-icon).swal2-error .swal2-x-mark{position:relative;flex-grow:1}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line]{display:block;position:absolute;top:2.3125em;width:2.9375em;height:.3125em;border-radius:.125em;background-color:#f27474}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=left]{left:1.0625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-error [class^=swal2-x-mark-line][class$=right]{right:1em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-error.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-error.swal2-icon-show .swal2-x-mark{animation:swal2-animate-error-x-mark .5s}div:where(.swal2-icon).swal2-warning{border-color:#facea8;color:#f8bb86}div:where(.swal2-icon).swal2-warning.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-warning.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .5s}div:where(.swal2-icon).swal2-info{border-color:#9de0f6;color:#3fc3ee}div:where(.swal2-icon).swal2-info.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-info.swal2-icon-show .swal2-icon-content{animation:swal2-animate-i-mark .8s}div:where(.swal2-icon).swal2-question{border-color:#c9dae1;color:#87adbd}div:where(.swal2-icon).swal2-question.swal2-icon-show{animation:swal2-animate-error-icon .5s}div:where(.swal2-icon).swal2-question.swal2-icon-show .swal2-icon-content{animation:swal2-animate-question-mark .8s}div:where(.swal2-icon).swal2-success{border-color:#a5dc86;color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line]{position:absolute;width:3.75em;height:7.5em;border-radius:50%}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=left]{top:-0.4375em;left:-2.0635em;transform:rotate(-45deg);transform-origin:3.75em 3.75em;border-radius:7.5em 0 0 7.5em}div:where(.swal2-icon).swal2-success [class^=swal2-success-circular-line][class$=right]{top:-0.6875em;left:1.875em;transform:rotate(-45deg);transform-origin:0 3.75em;border-radius:0 7.5em 7.5em 0}div:where(.swal2-icon).swal2-success .swal2-success-ring{position:absolute;z-index:2;top:-0.25em;left:-0.25em;box-sizing:content-box;width:100%;height:100%;border:.25em solid rgba(165,220,134,.3);border-radius:50%}div:where(.swal2-icon).swal2-success .swal2-success-fix{position:absolute;z-index:1;top:.5em;left:1.625em;width:.4375em;height:5.625em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line]{display:block;position:absolute;z-index:2;height:.3125em;border-radius:.125em;background-color:#a5dc86}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=tip]{top:2.875em;left:.8125em;width:1.5625em;transform:rotate(45deg)}div:where(.swal2-icon).swal2-success [class^=swal2-success-line][class$=long]{top:2.375em;right:.5em;width:2.9375em;transform:rotate(-45deg)}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-tip{animation:swal2-animate-success-line-tip .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-line-long{animation:swal2-animate-success-line-long .75s}div:where(.swal2-icon).swal2-success.swal2-icon-show .swal2-success-circular-line-right{animation:swal2-rotate-success-circular-line 4.25s ease-in}[class^=swal2]{-webkit-tap-highlight-color:rgba(0,0,0,0)}.swal2-show{animation:swal2-show .3s}.swal2-hide{animation:swal2-hide .15s forwards}.swal2-noanimation{transition:none}.swal2-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll}.swal2-rtl .swal2-close{margin-right:initial;margin-left:0}.swal2-rtl .swal2-timer-progress-bar{right:0;left:auto}@keyframes swal2-toast-show{0%{transform:translateY(-0.625em) rotateZ(2deg)}33%{transform:translateY(0) rotateZ(-2deg)}66%{transform:translateY(0.3125em) rotateZ(2deg)}100%{transform:translateY(0) rotateZ(0deg)}}@keyframes swal2-toast-hide{100%{transform:rotateZ(1deg);opacity:0}}@keyframes swal2-toast-animate-success-line-tip{0%{top:.5625em;left:.0625em;width:0}54%{top:.125em;left:.125em;width:0}70%{top:.625em;left:-0.25em;width:1.625em}84%{top:1.0625em;left:.75em;width:.5em}100%{top:1.125em;left:.1875em;width:.75em}}@keyframes swal2-toast-animate-success-line-long{0%{top:1.625em;right:1.375em;width:0}65%{top:1.25em;right:.9375em;width:0}84%{top:.9375em;right:0;width:1.125em}100%{top:.9375em;right:.1875em;width:1.375em}}@keyframes swal2-show{0%{transform:scale(0.7)}45%{transform:scale(1.05)}80%{transform:scale(0.95)}100%{transform:scale(1)}}@keyframes swal2-hide{0%{transform:scale(1);opacity:1}100%{transform:scale(0.5);opacity:0}}@keyframes swal2-animate-success-line-tip{0%{top:1.1875em;left:.0625em;width:0}54%{top:1.0625em;left:.125em;width:0}70%{top:2.1875em;left:-0.375em;width:3.125em}84%{top:3em;left:1.3125em;width:1.0625em}100%{top:2.8125em;left:.8125em;width:1.5625em}}@keyframes swal2-animate-success-line-long{0%{top:3.375em;right:2.875em;width:0}65%{top:3.375em;right:2.875em;width:0}84%{top:2.1875em;right:0;width:3.4375em}100%{top:2.375em;right:.5em;width:2.9375em}}@keyframes swal2-rotate-success-circular-line{0%{transform:rotate(-45deg)}5%{transform:rotate(-45deg)}12%{transform:rotate(-405deg)}100%{transform:rotate(-405deg)}}@keyframes swal2-animate-error-x-mark{0%{margin-top:1.625em;transform:scale(0.4);opacity:0}50%{margin-top:1.625em;transform:scale(0.4);opacity:0}80%{margin-top:-0.375em;transform:scale(1.15)}100%{margin-top:0;transform:scale(1);opacity:1}}@keyframes swal2-animate-error-icon{0%{transform:rotateX(100deg);opacity:0}100%{transform:rotateX(0deg);opacity:1}}@keyframes swal2-rotate-loading{0%{transform:rotate(0deg)}100%{transform:rotate(360deg)}}@keyframes swal2-animate-question-mark{0%{transform:rotateY(-360deg)}100%{transform:rotateY(0)}}@keyframes swal2-animate-i-mark{0%{transform:rotateZ(45deg);opacity:0}25%{transform:rotateZ(-25deg);opacity:.4}50%{transform:rotateZ(15deg);opacity:.8}75%{transform:rotateZ(-5deg);opacity:1}100%{transform:rotateX(0);opacity:1}}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow:hidden}body.swal2-height-auto{height:auto !important}body.swal2-no-backdrop .swal2-container{background-color:rgba(0,0,0,0) !important;pointer-events:none}body.swal2-no-backdrop .swal2-container .swal2-popup{pointer-events:all}body.swal2-no-backdrop .swal2-container .swal2-modal{box-shadow:0 0 10px rgba(0,0,0,.4)}@media print{body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown){overflow-y:scroll !important}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown)>[aria-hidden=true]{display:none}body.swal2-shown:not(.swal2-no-backdrop):not(.swal2-toast-shown) .swal2-container{position:static !important}}body.swal2-toast-shown .swal2-container{box-sizing:border-box;width:360px;max-width:100%;background-color:rgba(0,0,0,0);pointer-events:none}body.swal2-toast-shown .swal2-container.swal2-top{inset:0 auto auto 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-top-end,body.swal2-toast-shown .swal2-container.swal2-top-right{inset:0 0 auto auto}body.swal2-toast-shown .swal2-container.swal2-top-start,body.swal2-toast-shown .swal2-container.swal2-top-left{inset:0 auto auto 0}body.swal2-toast-shown .swal2-container.swal2-center-start,body.swal2-toast-shown .swal2-container.swal2-center-left{inset:50% auto auto 0;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-center{inset:50% auto auto 50%;transform:translate(-50%, -50%)}body.swal2-toast-shown .swal2-container.swal2-center-end,body.swal2-toast-shown .swal2-container.swal2-center-right{inset:50% 0 auto auto;transform:translateY(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-start,body.swal2-toast-shown .swal2-container.swal2-bottom-left{inset:auto auto 0 0}body.swal2-toast-shown .swal2-container.swal2-bottom{inset:auto auto 0 50%;transform:translateX(-50%)}body.swal2-toast-shown .swal2-container.swal2-bottom-end,body.swal2-toast-shown .swal2-container.swal2-bottom-right{inset:auto 0 0 auto} diff --git a/ui/ui/user-activation-list.tpl b/ui/ui/user-activation-list.tpl index 8d6c8841..11513f14 100644 --- a/ui/ui/user-activation-list.tpl +++ b/ui/ui/user-activation-list.tpl @@ -4,25 +4,25 @@
-
{$_L['List_Activated_Voucher']}
+
{Lang::T('List Activated Voucher')}
- +
- - - - - - - + + + + + + + {foreach $d as $ds} - - + + @@ -34,7 +34,7 @@
{$_L['Username']}{$_L['Plan_Name']}{$_L['Plan_Price']}{$_L['Type']}{$_L['Created_On']}{$_L['Expires_On']}{$_L['Method']}{Lang::T('Invoice')}{Lang::T('Plan Name')}{Lang::T('Plan Price')}{Lang::T('Type')}{Lang::T('Created On')}{Lang::T('Expires On')}{Lang::T('Method')}
{$ds['username']}
{$ds['invoice']} {$ds['plan_name']} {Lang::moneyFormat($ds['price'])} {$ds['type']}
- {$paginator['contents']} + {include file="pagination.tpl"}
diff --git a/ui/ui/user-activation.tpl b/ui/ui/user-activation.tpl index 459274a4..69ecb87d 100644 --- a/ui/ui/user-activation.tpl +++ b/ui/ui/user-activation.tpl @@ -4,7 +4,7 @@
-

{$_L['Order_Voucher']}

+

{Lang::T('Order Voucher')}

{include file="$_path/../pages/Order_Voucher.html"}
@@ -15,22 +15,22 @@
-
{$_L['Voucher_Activation']}
+
{Lang::T('Voucher Activation')}
- +
+ placeholder="{Lang::T('Enter voucher code here')}">
diff --git a/ui/ui/user-change-password.tpl b/ui/ui/user-change-password.tpl index 880fb24a..6094354e 100644 --- a/ui/ui/user-change-password.tpl +++ b/ui/ui/user-change-password.tpl @@ -4,23 +4,23 @@
-
{$_L['Change_Password']}
+
{Lang::T('Change Password')}
- +
- +
- +
@@ -28,9 +28,9 @@
- - Or {$_L['Cancel']} + + Or {Lang::T('Cancel')}
diff --git a/ui/ui/user-dashboard.tpl b/ui/ui/user-dashboard.tpl index dc8b6fe1..a2f19db9 100644 --- a/ui/ui/user-dashboard.tpl +++ b/ui/ui/user-dashboard.tpl @@ -8,18 +8,18 @@

{Lang::T('Unpaid Order')}

- +
- + - + @@ -50,29 +50,46 @@ {/if}
-

{$_L['Announcement']}

+

{Lang::T('Announcement')}

- {include file="$_path/../pages/Announcement.html"} + {$Announcement_Customer = "{$PAGES_PATH}/Announcement_Customer.html"} + {if file_exists($Announcement_Customer)} + {include file=$Announcement_Customer} + {/if}
-

{$_L['Account_Information']}

+

{Lang::T('Your Account Information')}

-
{Lang::T('expired')} {Lang::dateTimeFormat($unpaid['expired_date'])}
{$_L['Plan_Name']}{Lang::T('Plan Name')} {$unpaid['plan_name']}
{$_L['Plan_Price']}{Lang::T('Plan Price')} {$unpaid['price']}
+
- + - + + + + + + {if $_c['enable_balance'] == 'yes'} @@ -88,84 +105,117 @@ {/if} - {if $_bill} +
{$_L['Username']}{Lang::T('Username')} {$_user['username']}
{$_L['Password']}{Lang::T('Password')}
{Lang::T('Service Type')} + {if $_user.service_type == 'Hotspot'} + Hotspot + {elseif $_user.service_type == 'PPPoE'} + PPPoE + {elseif $_user.service_type == 'Others' || $_user.service_type == null} + Others + {/if} +
{Lang::T('Balance')}
+
+ {if $_bills} +
+ {foreach $_bills as $_bill} {if $_bill['routers'] != 'radius'} -
{strtoupper(Lang::T('Location'))}{$_bill['routers']}
{$_L['Plan_Name']} - {$_bill['namebp']} - {if $_bill['status'] == 'on'} - {Lang::T('Deactivate')} - {else} - {Lang::T('expired')} - {/if} -
{$_L['Created_On']} - {if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['recharged_on'],$_bill['recharged_time'])} - {/if} 
{$_L['Expires_On']} - {if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['expiration'],$_bill['time'])}{/if}  - {Lang::T('Recharge')} -
- - - - {/if} - {if $nux_mac} - - - - - {/if} - {if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on' && $_bill['routers'] != 'radius'} - - - + - {/if} + + + + + + + + + + + + + {if $nux_ip neq ''} + + + + + {/if} + {if $nux_mac neq ''} + + + + + {/if} + {if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on' && $_bill['routers'] != 'radius'} + + + + + {/if} + + + + +
{Lang::T('Current IP')}{$nux_ip}
{Lang::T('Current MAC')}{$nux_mac}
{Lang::T('Login Status')} - + {Lang::T('Plan Name')} + {$_bill['namebp']} + {if $_bill['status'] != 'on'} + {Lang::T('expired')} + {/if}
{Lang::T('Created On')} + {if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['recharged_on'],$_bill['recharged_time'])} + {/if} 
{Lang::T('Expires On')} + {if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['expiration'],$_bill['time'])}{/if}  +
{Lang::T('Type')} + {if $_bill['prepaid'] eq yes}Prepaid{else}Postpaid{/if} +
{Lang::T('Current IP')}{$nux_ip}
{Lang::T('Current MAC')}{$nux_mac}
{Lang::T('Login Status')} + +
+ {if $_bill['status'] == 'on'} + + {/if} + + {Lang::T('Recharge')} +
+ {/foreach} + + {/if} + {if $_c['disable_voucher'] == 'yes'} + - {if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on'} - + + {/if} + {if $_bills} + {foreach $_bills as $_bill} + {if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on'} + + {/if} + {/foreach} {/if} {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes'}
@@ -177,11 +227,11 @@
+ placeholder="{Lang::T('Username')}">
+ required placeholder="{Lang::T('Balance')}">
+
@@ -246,7 +296,7 @@
- {$_L['Order_Voucher']} + {Lang::T('Order Voucher')} {if $_c['payment_gateway'] != 'none' or $_c['payment_gateway'] == '' } diff --git a/ui/ui/user-login-noreg.tpl b/ui/ui/user-login-noreg.tpl new file mode 100644 index 00000000..0a3c7bdd --- /dev/null +++ b/ui/ui/user-login-noreg.tpl @@ -0,0 +1,85 @@ + + + + + + + {Lang::T('Login')} - {$_c['CompanyName']} + + + + + + + + + + + + + + \ No newline at end of file diff --git a/ui/ui/user-login.tpl b/ui/ui/user-login.tpl index dbbaa827..69e7a1f0 100644 --- a/ui/ui/user-login.tpl +++ b/ui/ui/user-login.tpl @@ -4,12 +4,11 @@ - {$_title} - {$_L['Login']} + {Lang::T('Login')} - {$_c['CompanyName']} - - + @@ -31,19 +30,22 @@
-
{$_L['Announcement']}
+
{Lang::T('Announcement')}
- {include file="$_path/../pages/Announcement.html"} + {$Announcement = "{$PAGES_PATH}/Announcement.html"} + {if file_exists($Announcement)} + {include file=$Announcement} + {/if}
-
{$_L['Sign_In_Member']}
+
{Lang::T('Log in to Member Panel')}
- +
{if $_c['country_code_phone']!= ''} + @@ -52,14 +54,14 @@ class="glyphicon glyphicon-phone-alt"> {/if} + placeholder="{if $_c['country_code_phone']!= ''}{$_c['country_code_phone']}{/if} {Lang::T('Phone Number')}">
- + + placeholder="{Lang::T('Password')}">
- +

diff --git a/ui/ui/user-orderBalance.tpl b/ui/ui/user-orderBalance.tpl index a7aa4aa8..91b97aa7 100644 --- a/ui/ui/user-orderBalance.tpl +++ b/ui/ui/user-orderBalance.tpl @@ -21,7 +21,7 @@
- Buy
diff --git a/ui/ui/user-orderHistory.tpl b/ui/ui/user-orderHistory.tpl index c4f717f1..03aa2379 100644 --- a/ui/ui/user-orderHistory.tpl +++ b/ui/ui/user-orderHistory.tpl @@ -4,21 +4,21 @@
-
{$_L['Order_History']}
+
{Lang::T('Order History')}
- +
- + - - - - + + + + - + @@ -35,18 +35,18 @@ strtotime($ds['expired_date']))} - {/foreach}
{$_L['Plan_Name']}{Lang::T('Plan Name')} {Lang::T('Gateway')} {Lang::T('Routers')}{$_L['Type']}{$_L['Plan_Price']}{$_L['Created_On']}{$_L['Expires_On']}{Lang::T('Type')}{Lang::T('Plan Price')}{Lang::T('Created On')}{Lang::T('Expires On')} {Lang::T('Date Done')}{$_L['Method']}{Lang::T('Method')}
{if $ds['status']!=1}{date("{$_c['date_format']} H:i", strtotime($ds['paid_date']))}{/if}{if $ds['status']==1}{$_L['UNPAID']} - {elseif $ds['status']==2}{$_L['PAID']} + {if $ds['status']==1}{Lang::T('UNPAID')} + {elseif $ds['status']==2}{Lang::T('PAID')} {elseif $ds['status']==3}{$_L['FAILED']} - {elseif $ds['status']==4}{$_L['CANCELED']} - {elseif $ds['status']==5}{$_L['UNKNOWN']} + {elseif $ds['status']==4}{Lang::T('CANCELED')} + {elseif $ds['status']==5}{Lang::T('UNKNOWN')} {/if}
- {$paginator['contents']} + {include file="pagination.tpl"}
diff --git a/ui/ui/user-orderPlan.tpl b/ui/ui/user-orderPlan.tpl index 56893749..79852912 100644 --- a/ui/ui/user-orderPlan.tpl +++ b/ui/ui/user-orderPlan.tpl @@ -6,105 +6,209 @@
{Lang::T('Order Internet Package')}
{if $_c['radius_enable']} - {if Lang::arrayCount($radius_hotspot)>0} - -
- {foreach $radius_hotspot as $plan} -
-
-
{$plan['name_plan']}
-
- - - - - - - - - - - - - - - -
{Lang::T('Type')}{$plan['type']}
{Lang::T('Price')}{Lang::moneyFormat($plan['price'])}
{Lang::T('Validity')}{$plan['validity']} {$plan['validity_unit']}
-
-
-
- Buy - {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']} - {Lang::T('Pay With Balance')} - {/if} + {if $_user['service_type'] == 'PPPoE'} + {if Lang::arrayCount($radius_pppoe)>0} + +
+ {foreach $radius_pppoe as $plan} +
+
+
{$plan['name_plan']}
+
+ + + + + + + + + + + + + + + +
{Lang::T('Type')}{$plan['type']}
{Lang::T('Price')}{Lang::moneyFormat($plan['price'])}
{Lang::T('Validity')}{$plan['validity']} {$plan['validity_unit']}
+
+
+
+ Buy + {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']} + {Lang::T('Pay With Balance')} + {/if} +
+ {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']} + {Lang::T('Buy for friend')} + {/if} +
- {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']} - {Lang::T('Buy for friend')} - {/if}
-
+ {/foreach}
- {/foreach} -
- {/if} - {if Lang::arrayCount($radius_pppoe)>0} + {/if} + {elseif $_user['service_type'] == 'Hotspot'} + {if Lang::arrayCount($radius_hotspot)>0} + +
+ {foreach $radius_hotspot as $plan} +
+
+
{$plan['name_plan']}
+
+ + + + + + + + + + + + + + + +
{Lang::T('Type')}{$plan['type']}
{Lang::T('Price')}{Lang::moneyFormat($plan['price'])}
{Lang::T('Validity')}{$plan['validity']} {$plan['validity_unit']}
+
+
+
+ Buy + {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']} + {Lang::T('Pay With Balance')} + {/if} +
+ {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']} + {Lang::T('Buy for friend')} + {/if} +
+
+
+ {/foreach} +
+ {/if} + {elseif $_user['service_type'] == 'Others' || $_user['service_type'] == '' && (Lang::arrayCount($radius_pppoe)>0 || Lang::arrayCount($radius_hotspot)>0)} -
- {foreach $radius_pppoe as $plan} -
-
-
{$plan['name_plan']}
-
- - - - - - - - - - - - - - - -
{Lang::T('Type')}{$plan['type']}
{Lang::T('Price')}{Lang::moneyFormat($plan['price'])}
{Lang::T('Validity')}{$plan['validity']} {$plan['validity_unit']}
-
-
-
- Buy - {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']} - {Lang::T('Pay With Balance')} + {if Lang::arrayCount($radius_pppoe)>0} +
+ {foreach $radius_pppoe as $plan} +
+
+
{$plan['name_plan']}
+
+ + + + + + + + + + + + + + + +
{Lang::T('Type')}{$plan['type']}
{Lang::T('Price')}{Lang::moneyFormat($plan['price'])}
{Lang::T('Validity')}{$plan['validity']} {$plan['validity_unit']}
+
+
+
+ Buy + {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']} + {Lang::T('Pay With Balance')} + {/if} +
+ {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']} + {Lang::T('Buy for friend')} {/if}
- {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']} - {Lang::T('Buy for friend')} - {/if}
-
- {/foreach} -
+ {/foreach} +
+ {/if} + {if Lang::arrayCount($radius_hotspot)>0} + +
+ {foreach $radius_hotspot as $plan} +
+
+
{$plan['name_plan']}
+
+ + + + + + + + + + + + + + + +
{Lang::T('Type')}{$plan['type']}
{Lang::T('Price')}{Lang::moneyFormat($plan['price'])}
{Lang::T('Validity')}{$plan['validity']} {$plan['validity_unit']}
+
+
+
+ Buy + {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']} + {Lang::T('Pay With Balance')} + {/if} +
+ {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']} + {Lang::T('Buy for friend')} + {/if} +
+
+
+ {/foreach} +
+ {/if} {/if} {/if} {foreach $routers as $router} @@ -116,8 +220,9 @@ {$router['description']}
{/if} - {if Validator::countRouterPlan($plans_hotspot, $router['name'])>0} -
{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}
+ {if $_user['service_type'] == 'Hotspot' && Validator::countRouterPlan($plans_hotspot, $router['name'])>0} +
{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if} +
{foreach $plans_hotspot as $plan} {if $router['name'] eq $plan['routers']} @@ -144,7 +249,7 @@
- Buy {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']} @@ -165,7 +270,7 @@ {/foreach}
{/if} - {if Validator::countRouterPlan($plans_pppoe,$router['name'])>0} + {if $_user['service_type'] == 'PPPoE' && Validator::countRouterPlan($plans_pppoe,$router['name'])>0}
{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}
{foreach $plans_pppoe as $plan} @@ -193,7 +298,104 @@
- Buy + {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']} + {Lang::T('Pay With Balance')} + {/if} +
+ {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']} + {Lang::T('Buy for friend')} + {/if} +
+
+
+ {/if} + {/foreach} +
+ {/if} + {if $_user['service_type'] == 'Others' || $_user['service_type'] == '' && (Validator::countRouterPlan($plans_hotspot, $router['name'])>0 || Validator::countRouterPlan($plans_pppoe, $router['name'])>0)} +
{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if} +
+
+ {foreach $plans_hotspot as $plan} + {if $router['name'] eq $plan['routers']} +
+
+
{$plan['name_plan']}
+
+ + + + + + + + + + + + + + + +
{Lang::T('Type')}{$plan['type']}
{Lang::T('Price')}{Lang::moneyFormat($plan['price'])}
{Lang::T('Validity')}{$plan['validity']} {$plan['validity_unit']}
+
+
+
+ Buy + {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']} + {Lang::T('Pay With Balance')} + {/if} +
+ {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes' && $_user['balance']>=$plan['price']} + {Lang::T('Buy for friend')} + {/if} +
+
+
+ {/if} + {/foreach} +
+
{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}
+
+ {foreach $plans_pppoe as $plan} + {if $router['name'] eq $plan['routers']} +
+
+
{$plan['name_plan']}
+
+ + + + + + + + + + + + + + + +
{Lang::T('Type')}{$plan['type']}
{Lang::T('Price')}{Lang::moneyFormat($plan['price'])}
{Lang::T('Validity')}{$plan['validity']} {$plan['validity_unit']}
+
+
+
+ Buy {if $_c['enable_balance'] == 'yes' && $_user['balance']>=$plan['price']} @@ -219,5 +421,4 @@ {/foreach}
-
{include file="sections/user-footer.tpl"} \ No newline at end of file diff --git a/ui/ui/user-orderView.tpl b/ui/ui/user-orderView.tpl index 6a090412..41954048 100644 --- a/ui/ui/user-orderView.tpl +++ b/ui/ui/user-orderView.tpl @@ -6,7 +6,7 @@
- {if $trx['routers']!='balance'} + {if !in_array($trx['routers'],['balance','radius'])}
{$router['name']}
@@ -30,15 +30,15 @@ {date('H:i', strtotime($trx['paid_date']))} - {if $trx['plan_name'] == 'Receive Balance'} - {Lang::T('From')} + {if $trx['plan_name'] == 'Receive Balance'} + {Lang::T('From')} {else} {Lang::T('To')} {/if} {$trx['gateway']} - {$_L['Balance']} + {Lang::T('Balance')} {Lang::moneyFormat($trx['price'])} @@ -64,12 +64,24 @@ {/if} - {$_L['Plan_Name']} + {Lang::T('Plan Name')} {$plan['name_plan']} + {if $add_cost>0} + {foreach $bills as $k => $v} + + {$k} + {Lang::moneyFormat($v)} + + {/foreach} + + {Lang::T('Additional Cost')} + {Lang::moneyFormat($add_cost)} + + {/if} - {$_L['Plan_Price']} - {Lang::moneyFormat($plan['price'])} + {Lang::T('Plan Price')}{if $add_cost>0} + {Lang::T('Additional Cost')}{/if} + {Lang::moneyFormat($trx['price'])} {Lang::T('Type')} @@ -97,11 +109,11 @@ {/if} {/if} - {$_L['Plan_Validity']} + {Lang::T('Plan Validity')} {$plan['validity']} {$plan['validity_unit']} - {$_L['Bandwidth_Plans']} + {Lang::T('Bandwidth Plans')} {$bandw['name_bw']}
{$bandw['rate_down']}{$bandw['rate_down_unit']}/{$bandw['rate_up']}{$bandw['rate_up_unit']} diff --git a/ui/ui/user-phone-update.tpl b/ui/ui/user-phone-update.tpl new file mode 100644 index 00000000..65f528ca --- /dev/null +++ b/ui/ui/user-phone-update.tpl @@ -0,0 +1,80 @@ +{include file="sections/user-header.tpl"} + + + +
+
+

{Lang::T('Change Phone Number')}

+
+
+
+
+ +
+
+ + + +
+
+
+ +
+ +
+
+ + + + + + +
+
+
+ +
+ +
+ +
+ +
+
+ + + + +
+
+ + Or {Lang::T('Cancel')} +
+
+
+ + +
+
+
+{include file="sections/user-footer.tpl"} \ No newline at end of file diff --git a/ui/ui/user-profile.tpl b/ui/ui/user-profile.tpl index 2343a746..78c1477d 100644 --- a/ui/ui/user-profile.tpl +++ b/ui/ui/user-profile.tpl @@ -4,24 +4,24 @@
-
{$_L['Edit_User']}
+
{Lang::T('Edit User')}
- +
+ + placeholder="{if $_c['country_code_phone']!= ''}{$_c['country_code_phone']}{/if} {Lang::T('Phone Number')}">
- +
@@ -29,22 +29,40 @@
- +
-
- -
-
- + - + {if $_c['allow_phone_otp'] != 'yes'} +
+ +
+
+ + + +
-
+ {else} +
+ +
+
+ + + + + {Lang::T('Change')} + +
+
+
+ {/if}
@@ -54,9 +72,9 @@
- - Or {$_L['Cancel']} + + Or {Lang::T('Cancel')}
diff --git a/ui/ui/user-selectGateway.tpl b/ui/ui/user-selectGateway.tpl new file mode 100644 index 00000000..4a86462f --- /dev/null +++ b/ui/ui/user-selectGateway.tpl @@ -0,0 +1,29 @@ +{include file="sections/user-header.tpl"} + +
+
+
+
{Lang::T('Available Payment Gateway')}
+ +
+
+
+ +{include file="sections/user-footer.tpl"} \ No newline at end of file diff --git a/ui/ui/user-sendPlan.tpl b/ui/ui/user-sendPlan.tpl index 1e959da2..c2ab0e4b 100644 --- a/ui/ui/user-sendPlan.tpl +++ b/ui/ui/user-sendPlan.tpl @@ -12,9 +12,21 @@ {Lang::T('Type')} {$plan['type']} + {if $add_cost>0} + {foreach $bills as $k => $v} + + {$k} + {Lang::moneyFormat($v)} + + {/foreach} + + {Lang::T('Additional Cost')} + {Lang::moneyFormat($add_cost)} + + {/if} - {Lang::T('Price')} - {Lang::moneyFormat($plan['price'])} + {Lang::T('Price')}{if $add_cost>0} + {Lang::T('Additional Cost')}{/if} + {Lang::moneyFormat($plan['price'])} {Lang::T('Validity')} @@ -28,13 +40,14 @@
+ placeholder="{Lang::T('Username')}">
+

{Lang::T('If your friend have Additional Cost, you will pay for that too')}

diff --git a/ui/ui/users-add.tpl b/ui/ui/users-add.tpl index 7259ddf8..b68ed50a 100644 --- a/ui/ui/users-add.tpl +++ b/ui/ui/users-add.tpl @@ -1,60 +1,119 @@ {include file="sections/header.tpl"} -
-
-
-
{$_L['Add_New_Administrator']}
-
- -
+ +
+
+
+
{Lang::T('Profile')}
+
- -
- -
-
-
- -
+ +
- -
- +
+
+
+ +
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+
{Lang::T('Credentials')}
+
+
+ +
+ +
+
+
- -
- + +
+
- -
- + +
+
-
-
- - Or {$_L['Cancel']} + +
+
- - +
-
+
+ + Or {Lang::T('Cancel')} +
+ +{literal} + +{/literal} {include file="sections/footer.tpl"} \ No newline at end of file diff --git a/ui/ui/users-edit.tpl b/ui/ui/users-edit.tpl index d1e26e23..9f98de58 100644 --- a/ui/ui/users-edit.tpl +++ b/ui/ui/users-edit.tpl @@ -1,68 +1,144 @@ {include file="sections/header.tpl"} -
-
-
-
{$_L['Edit_User']}
-
- -
+ +
+
+
+
{Lang::T('Profile')}
+
- -
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+
+
+ +
+
+ +
+
+ +
+
+
+
+
+
+
+
{Lang::T('Credentials')}
+
+ {if ($_admin['id']) neq ($d['id'])} +
+ +
+ +
+
+
+ +
+ +
+
+
+ +
+ +
+
+ {/if} +
+ +
- -
- -
-
- {if ($_admin['id']) neq ($d['id'])} -
- -
- - {$_L['user_type_help']} -
-
- {/if} -
- -
+ +
- {$_L['password_change_help']} + {Lang::T('Keep Blank to do not change Password')}
- -
- + +
+ + {Lang::T('Keep Blank to do not change Password')}
- -
-
- - Or {$_L['Cancel']} -
-
- - +
-
+
+ + Or {Lang::T('Cancel')} +
+ +{literal} + +{/literal} {include file="sections/footer.tpl"} \ No newline at end of file diff --git a/ui/ui/users-view.tpl b/ui/ui/users-view.tpl new file mode 100644 index 00000000..461e0a0f --- /dev/null +++ b/ui/ui/users-view.tpl @@ -0,0 +1,71 @@ +{include file="sections/header.tpl"} + + +
+
+ {if $d['user_type'] == "Sales"}
{else}
{/if} +
+
{$d['fullname']}
+
+
    +
  • + {Lang::T('Username')} {$d['username']} +
  • +
  • + {Lang::T('Phone Number')} {$d['phone']} +
  • +
  • + {Lang::T('Email')} {$d['email']} +
  • +
  • + {Lang::T('City')} {$d['city']} +
  • +
  • + {Lang::T('Sub District')} {$d['subdistrict']} +
  • +
  • + {Lang::T('Ward')} {$d['ward']} +
  • +
  • + {Lang::T('User Type')} {$d['user_type']} +
  • +
+
+ +
+
+ {if $d['user_type'] == "Sales" && $d['root'] neq ''} +
+
+
Agent - {$agent['fullname']}
+
+
    +
  • + {Lang::T('Phone Number')} {$agent['phone']} +
  • +
  • + {Lang::T('Email')} {$agent['email']} +
  • +
  • + {Lang::T('City')} {$agent['city']} +
  • +
  • + {Lang::T('Sub District')} {$agent['subdistrict']} +
  • +
  • + {Lang::T('Ward')} {$agent['ward']} +
  • +
+
+
+
+ {/if} +
+ +{include file="sections/footer.tpl"} \ No newline at end of file diff --git a/ui/ui/users.tpl b/ui/ui/users.tpl index a3757715..1ce6ca9a 100644 --- a/ui/ui/users.tpl +++ b/ui/ui/users.tpl @@ -4,7 +4,7 @@
-
{$_L['Manage_Administrator']}
+
{Lang::T('Manage Administrator')}
@@ -13,51 +13,65 @@
-
- +
 
- +
- - - - - + + + + + + + + + + {foreach $d as $ds} - + + + - + + + + {/foreach}
{$_L['Username']}{$_L['Full_Name']}{$_L['Type']}{$_L['Last_Login']}{$_L['Manage']}{Lang::T('Username')}{Lang::T('Full Name')}{Lang::T('Phone')}{Lang::T('Email')}{Lang::T('Type')}{Lang::T('Location')}{Lang::T('Agent')}{Lang::T('Last Login')}{Lang::T('Manage')}ID
{$ds['username']} {$ds['fullname']}{$ds['phone']}{$ds['email']} {$ds['user_type']}{$ds['last_login']}{$ds['city']}, {$ds['subdistrict']}, {$ds['ward']}{if $ds['root']} + + {$admins[$ds['root']]}{/if}{if $ds['last_login']}{Lang::timeElapsed($ds['last_login'])}{/if} + {Lang::T('View')} {$_L['Edit']} - {if ($_admin['username']) neq ($ds['username'])} + class="btn btn-info btn-xs">{Lang::T('Edit')} + {if ($_admin['id']) neq ($ds['id'])} {$_L['Delete']} + class="btn btn-danger btn-xs" onclick="return confirm('{Lang::T('Delete')}?')"> {/if} {$ds['id']}
- {$paginator['contents']} + {include file="pagination.tpl"}
diff --git a/ui/ui/voucher-add.tpl b/ui/ui/voucher-add.tpl index 44798171..544c65a7 100644 --- a/ui/ui/voucher-add.tpl +++ b/ui/ui/voucher-add.tpl @@ -4,52 +4,72 @@
-
{$_L['Add_Voucher']}
+
{Lang::T('Add Vouchers')}
-
+
- +
- {$_L['Hotspot_Plans']} - {$_L['PPPOE_Plans']} + {Lang::T('Hotspot Plans')} + {Lang::T('PPPOE Plans')}
- +
- +
-
- +
-
- + +
+ +
+

UPPERCASE lowercase RaNdoM

+
+
+ +
+ +
+

NUX-VoUCHeRCOdE

+
+
+
-
- +
diff --git a/ui/ui/voucher-view.tpl b/ui/ui/voucher-view.tpl new file mode 100644 index 00000000..62f5042d --- /dev/null +++ b/ui/ui/voucher-view.tpl @@ -0,0 +1,38 @@ +{include file="sections/header.tpl"} + +
+
+
+
+
+

+                    
+                    
+                    {Lang::T('Finish')}
+                    
+                         WhatsApp
+                    
+                        
+                        
+                
+ + +
+
+
+
+ +{include file="sections/footer.tpl"} \ No newline at end of file diff --git a/ui/ui/voucher.tpl b/ui/ui/voucher.tpl index e72a3bab..5e3c7d35 100644 --- a/ui/ui/voucher.tpl +++ b/ui/ui/voucher.tpl @@ -3,19 +3,28 @@
-
{$_L['Prepaid_Vouchers']}
+
+ {if in_array($_admin['user_type'],['SuperAdmin','Admin'])} + + {/if} +   +
- @@ -23,56 +32,81 @@  
- +
- - - - - - - + + + + + + + + {foreach $d as $ds} - + - - + - + + {/foreach}
ID{$_L['Type']}{$_L['Routers']}{$_L['Plan_Name']}{$_L['Code_Voucher']}{$_L['Status_Voucher']}{$_L['Customers']}{$_L['Manage']}{Lang::T('Type')}{Lang::T('Routers')}{Lang::T('Plan Name')}{Lang::T('Code Voucher')}{Lang::T('Status Voucher')}{Lang::T('Customer')}{Lang::T('Generated By')}{Lang::T('Manage')}
{$ds['id']} {$ds['type']} {$ds['routers']} {$ds['name_plan']}{if $ds['status'] eq '0'} + {$ds['code']}{if $ds['status'] eq '0'} {else} {/if}{if $ds['user'] eq '0'} - {else}{$ds['user']}{/if}{if $ds['user'] eq '0'} - + {else}{$ds['user']} + {/if}{if $ds['generated_by']} + {$admins[$ds['generated_by']]} + {else} - + {/if} + - {$_L['Delete']} + {if $ds['status'] neq '1'} +   {Lang::T('View')}   + {/if} + {if in_array($_admin['user_type'],['SuperAdmin','Admin'])} + + {/if}
- {$paginator['contents']} + +
diff --git a/update.php b/update.php index c11fe563..b5eb0e06 100644 --- a/update.php +++ b/update.php @@ -8,7 +8,7 @@ session_start(); include "config.php"; -if(empty($update_url)){ +if (empty($update_url)) { $update_url = 'https://github.com/hotspotbilling/phpnuxbill/archive/refs/heads/master.zip'; } @@ -36,7 +36,7 @@ if (!extension_loaded('zip')) { $file = pathFixer('system/cache/phpnuxbill.zip'); -$folder = pathFixer('system/cache/phpnuxbill-'.basename($update_url, ".zip").'/'); +$folder = pathFixer('system/cache/phpnuxbill-' . basename($update_url, ".zip") . '/'); if (empty($step)) { $step++; @@ -77,6 +77,9 @@ if (empty($step)) { // remove downloaded zip if (file_exists($file)) unlink($file); } else if ($step == 3) { + deleteFolder('system/autoload/'); + deleteFolder('system/vendor/'); + deleteFolder('ui/ui/'); copyFolder($folder, pathFixer('./')); deleteFolder('install/'); deleteFolder($folder); @@ -105,9 +108,9 @@ if (empty($step)) { foreach ($updates as $version => $queries) { if (!in_array($version, $dones)) { foreach ($queries as $q) { - try{ - $db->exec($q); - }catch(PDOException $e){ + try { + $db->exec($q); + } catch (PDOException $e) { //ignore, it exists already } } @@ -118,6 +121,13 @@ if (empty($step)) { } $step++; } else { + $path = 'ui/compiled/'; + $files = scandir($path); + foreach ($files as $file) { + if (is_file($path . $file)) { + unlink($path . $file); + } + } $version = json_decode(file_get_contents('version.json'), true)['version']; $continue = false; } @@ -182,10 +192,9 @@ function deleteFolder($path) - - - + + diff --git a/version.json b/version.json index b562731b..ad181ed8 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "2023.10.25" + "version": "2024.3.26" } \ No newline at end of file