diff --git a/install/phpnuxbill.sql b/install/phpnuxbill.sql
index 28903fe6..c2c2127b 100644
--- a/install/phpnuxbill.sql
+++ b/install/phpnuxbill.sql
@@ -228,6 +228,7 @@ CREATE TABLE
`plan_name` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`price` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`recharged_on` date NOT NULL,
+ `recharged_time` time NOT NULL DEFAULT '00:00:00',
`expiration` date NOT NULL,
`time` time NOT NULL,
`method` varchar(128) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
@@ -271,6 +272,7 @@ CREATE TABLE
`plan_id` int(10) NOT NULL,
`namebp` varchar(40) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`recharged_on` date NOT NULL,
+ `recharged_time` time NOT NULL DEFAULT '00:00:00',
`expiration` date NOT NULL,
`time` time NOT NULL,
`status` varchar(20) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
diff --git a/system/autoload/Mikrotik.php b/system/autoload/Mikrotik.php
index 7b7f82ca..ae9809ec 100644
--- a/system/autoload/Mikrotik.php
+++ b/system/autoload/Mikrotik.php
@@ -12,11 +12,14 @@ class Mikrotik
public static function getClient($ip, $user, $pass)
{
+ global $ui;
try {
$iport = explode(":", $ip);
return new RouterOS\Client($iport[0], $user, $pass, ($iport[1]) ? $iport[1] : null);
} catch (Exception $e) {
- die("Unable to connect to the router. " . $e->getMessage());
+ $ui->assign("error_meesage","Unable to connect to the router. " . $e->getMessage());
+ $ui->display('router-error.tpl');
+ die();
}
}
diff --git a/system/autoload/Package.php b/system/autoload/Package.php
index 97fbda01..1cb6473a 100644
--- a/system/autoload/Package.php
+++ b/system/autoload/Package.php
@@ -22,6 +22,7 @@ class Package
global $_c, $_L, $_notifmsg;
$date_now = date("Y-m-d H:i:s");
$date_only = date("Y-m-d");
+ $time_only = date("H:i:s");
$time = date("H:i:s");
if ($id_customer == '' or $router_name == '' or $plan_id == '') {
@@ -40,6 +41,7 @@ class Package
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
+ $t->recharged_time = date("H:i:s");
$t->expiration = $date_only;
$t->time = $time;
$t->method = "$gateway - $channel";
@@ -100,11 +102,29 @@ class Package
Mikrotik::addHotspotUser($client, $p, $c);
}
+ if ($b['namebp'] == $p['name_plan']) {
+ // 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'));
+ } else if ($p['validity_unit'] == 'Days') {
+ $date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days'));
+ } else if ($p['validity_unit'] == 'Hrs') {
+ $datetime = explode(' ', date("Y-m-d H:i:s", strtotime($b['expiration'] . ' ' . $b['time'] . ' +' . $p['validity'] . ' hours')));
+ $date_exp = $datetime[0];
+ $time = $datetime[1];
+ } else if ($p['validity_unit'] == 'Mins') {
+ $datetime = explode(' ', date("Y-m-d H:i:s", strtotime($b['expiration'] . ' ' . $b['time'] . ' +' . $p['validity'] . ' minutes')));
+ $date_exp = $datetime[0];
+ $time = $datetime[1];
+ }
+ }
+
$b->customer_id = $id_customer;
$b->username = $c['username'];
$b->plan_id = $plan_id;
$b->namebp = $p['name_plan'];
$b->recharged_on = $date_only;
+ $b->recharged_time = $time_only;
$b->expiration = $date_exp;
$b->time = $time;
$b->status = "on";
@@ -120,6 +140,7 @@ class Package
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
+ $t->recharged_time = $time_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "$gateway - $channel";
@@ -139,6 +160,7 @@ class Package
$d->plan_id = $plan_id;
$d->namebp = $p['name_plan'];
$d->recharged_on = $date_only;
+ $d->recharged_time = $time_only;
$d->expiration = $date_exp;
$d->time = $time;
$d->status = "on";
@@ -154,6 +176,7 @@ class Package
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
+ $t->recharged_time = $time_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "$gateway - $channel";
@@ -176,11 +199,30 @@ class Package
Mikrotik::addPpoeUser($client, $p, $c);
}
+
+ if ($b['namebp'] == $p['name_plan']) {
+ // 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'));
+ } else if ($p['validity_unit'] == 'Days') {
+ $date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days'));
+ } else if ($p['validity_unit'] == 'Hrs') {
+ $datetime = explode(' ', date("Y-m-d H:i:s", strtotime($b['expiration'] . ' ' . $b['time'] . ' +' . $p['validity'] . ' hours')));
+ $date_exp = $datetime[0];
+ $time = $datetime[1];
+ } else if ($p['validity_unit'] == 'Mins') {
+ $datetime = explode(' ', date("Y-m-d H:i:s", strtotime($b['expiration'] . ' ' . $b['time'] . ' +' . $p['validity'] . ' minutes')));
+ $date_exp = $datetime[0];
+ $time = $datetime[1];
+ }
+ }
+
$b->customer_id = $id_customer;
$b->username = $c['username'];
$b->plan_id = $plan_id;
$b->namebp = $p['name_plan'];
$b->recharged_on = $date_only;
+ $b->recharged_time = $time_only;
$b->expiration = $date_exp;
$b->time = $time;
$b->status = "on";
@@ -196,6 +238,7 @@ class Package
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
+ $t->recharged_time = $time_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "$gateway - $channel";
@@ -215,6 +258,7 @@ class Package
$d->plan_id = $plan_id;
$d->namebp = $p['name_plan'];
$d->recharged_on = $date_only;
+ $d->recharged_time = $time_only;
$d->expiration = $date_exp;
$d->time = $time;
$d->status = "on";
@@ -230,6 +274,7 @@ class Package
$t->plan_name = $p['name_plan'];
$t->price = $p['price'];
$t->recharged_on = $date_only;
+ $t->recharged_time = $time_only;
$t->expiration = $date_exp;
$t->time = $time;
$t->method = "$gateway - $channel";
diff --git a/system/controllers/home.php b/system/controllers/home.php
index 821261be..851a7a16 100644
--- a/system/controllers/home.php
+++ b/system/controllers/home.php
@@ -15,7 +15,7 @@ if (isset($_GET['renewal'])) {
}
if (_post('send') == 'balance') {
- if ($config['allow_balance_transfer'] == 'yes') {
+ if ($config['enable_balance'] == 'yes' && $config['allow_balance_transfer'] == 'yes') {
$target = ORM::for_table('tbl_customers')->where('username', _post('username'))->find_one();
if (!$target) {
r2(U . 'home', 'd', Lang::T('Username not found'));
diff --git a/system/controllers/prepaid.php b/system/controllers/prepaid.php
index 8a9cb2d2..28c85ccd 100644
--- a/system/controllers/prepaid.php
+++ b/system/controllers/prepaid.php
@@ -168,6 +168,7 @@ switch ($action) {
$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);
@@ -180,8 +181,9 @@ switch ($action) {
run_hook('edit_customer_plan'); #HOOK
$d->username = $username;
$d->plan_id = $id_plan;
- $d->recharged_on = $recharged_on;
+ //$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']);
diff --git a/system/controllers/voucher.php b/system/controllers/voucher.php
index eb322db4..3f2c8993 100644
--- a/system/controllers/voucher.php
+++ b/system/controllers/voucher.php
@@ -26,187 +26,16 @@ switch ($action) {
case 'activation-post':
$code = _post('code');
$v1 = ORM::for_table('tbl_voucher')->where('code', $code)->where('status', 0)->find_one();
-
- $c = ORM::for_table('tbl_customers')->find_one($user['id']);
- $p = ORM::for_table('tbl_plans')->find_one($v1['id_plan']);
- $b = ORM::for_table('tbl_user_recharges')->where('customer_id', $user['id'])->find_one();
-
- $date_now = date("Y-m-d H:i:s");
- $date_only = date("Y-m-d");
- $time = date("H:i:s");
-
- $mikrotik = Mikrotik::info($v1['routers']);
- if ($p['validity_unit'] == 'Months') {
- $date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' month'));
- } else if ($p['validity_unit'] == 'Days') {
- $date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' day'));
- } else if ($p['validity_unit'] == 'Hrs') {
- $datetime = explode(' ', date("Y-m-d H:i:s", strtotime('+' . $p['validity'] . ' hour')));
- $date_exp = $datetime[0];
- $time = $datetime[1];
- } else if ($p['validity_unit'] == 'Mins') {
- $datetime = explode(' ', date("Y-m-d H:i:s", strtotime('+' . $p['validity'] . ' minute')));
- $date_exp = $datetime[0];
- $time = $datetime[1];
- }
run_hook('customer_activate_voucher'); #HOOK
if ($v1) {
- if ($v1['type'] == 'Hotspot') {
- if ($b) {
- if (!$config['radius_mode']) {
- $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
- Mikrotik::removeHotspotUser($client, $c['username']);
- Mikrotik::addHotspotUser($client, $p, $c);
- }
- $b->customer_id = $user['id'];
- $b->username = $c['username'];
- $b->plan_id = $v1['id_plan'];
- $b->namebp = $p['name_plan'];
- $b->recharged_on = $date_only;
- $b->expiration = $date_exp;
- $b->time = $time;
- $b->status = "on";
- $b->method = "voucher";
- $b->routers = $v1['routers'];
- $b->type = "Hotspot";
- $b->save();
-
- // insert table transactions
- $t = ORM::for_table('tbl_transactions')->create();
- $t->invoice = "INV-" . Package::_raid(5);
- $t->username = $c['username'];
- $t->plan_name = $p['name_plan'];
- $t->price = $p['price'];
- $t->recharged_on = $date_only;
- $t->expiration = $date_exp;
- $t->time = $time;
- $t->method = "voucher";
- $t->routers = $v1['routers'];
- $t->type = "Hotspot";
- $t->save();
- } else {
- if (!$config['radius_mode']) {
- $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
- Mikrotik::addHotspotUser($client, $p, $c);
- }
-
- $d = ORM::for_table('tbl_user_recharges')->create();
- $d->customer_id = $user['id'];
- $d->username = $c['username'];
- $d->plan_id = $v1['id_plan'];
- $d->namebp = $p['name_plan'];
- $d->recharged_on = $date_only;
- $d->expiration = $date_exp;
- $d->time = $time;
- $d->status = "on";
- $d->method = "voucher";
- $d->routers = $v1['routers'];
- $d->type = "Hotspot";
- $d->save();
-
- // insert table transactions
- $t = ORM::for_table('tbl_transactions')->create();
- $t->invoice = "INV-" . Package::_raid(5);
- $t->username = $c['username'];
- $t->plan_name = $p['name_plan'];
- $t->price = $p['price'];
- $t->recharged_on = $date_only;
- $t->expiration = $date_exp;
- $t->time = $time;
- $t->method = "voucher";
- $t->routers = $v1['routers'];
- $t->type = "Hotspot";
- $t->save();
- }
-
+ if (Package::rechargeUser($user['id'], $v1['routers'], $v1['id_plan'], "Activation", "Voucher")) {
$v1->status = "1";
- $v1->user = $c['username'];
+ $v1->user = $user['username'];
$v1->save();
- // Telegram to Admin
- Message::sendTelegram('#u' . $c['username'] . " Activate #Voucher #Hotspot\n" . $p['name_plan'] .
- "\nCode: " . $code .
- "\nRouter: " . $v1['routers'] .
- "\nPrice: " . $p['price']);
+ r2(U . "voucher/list-activated", 's', $_L['Activation_Vouchers_Successfully']);
} else {
- if ($b) {
- if (!$config['radius_mode']) {
- $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
- Mikrotik::removePpoeUser($client, $c['username']);
- Mikrotik::addPpoeUser($client, $p, $c);
- }
-
- $b->customer_id = $user['id'];
- $b->username = $c['username'];
- $b->plan_id = $v1['id_plan'];
- $b->namebp = $p['name_plan'];
- $b->recharged_on = $date_only;
- $b->expiration = $date_exp;
- $b->time = $time;
- $b->status = "on";
- $b->method = "voucher";
- $b->routers = $v1['routers'];
- $b->type = "PPPOE";
- $b->save();
-
- // insert table transactions
- $t = ORM::for_table('tbl_transactions')->create();
- $t->invoice = "INV-" . Package::_raid(5);
- $t->username = $c['username'];
- $t->plan_name = $p['name_plan'];
- $t->price = $p['price'];
- $t->recharged_on = $date_only;
- $t->expiration = $date_exp;
- $t->time = $time;
- $t->method = "voucher";
- $t->routers = $v1['routers'];
- $t->type = "PPPOE";
- $t->save();
- } else {
- if (!$config['radius_mode']) {
- $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
- Mikrotik::addPpoeUser($client, $p, $c);
- }
-
- $d = ORM::for_table('tbl_user_recharges')->create();
- $d->customer_id = $user['id'];
- $d->username = $c['username'];
- $d->plan_id = $v1['id_plan'];
- $d->namebp = $p['name_plan'];
- $d->recharged_on = $date_only;
- $d->expiration = $date_exp;
- $d->time = $time;
- $d->status = "on";
- $d->method = "voucher";
- $d->routers = $v1['routers'];
- $d->type = "PPPOE";
- $d->save();
-
- // insert table transactions
- $t = ORM::for_table('tbl_transactions')->create();
- $t->invoice = "INV-" . Package::_raid(5);
- $t->username = $c['username'];
- $t->plan_name = $p['name_plan'];
- $t->price = $p['price'];
- $t->recharged_on = $date_only;
- $t->expiration = $date_exp;
- $t->time = $time;
- $t->method = "voucher";
- $t->routers = $v1['routers'];
- $t->type = "PPPOE";
- $t->save();
- }
-
- $v1->status = "1";
- $v1->user = $c['username'];
- $v1->save();
- // Telegram to Admin
- Message::sendTelegram('#u' . $c['username'] . " Activate #Voucher #PPPOE\n" . $p['name_plan'] .
- "\nCode: " . $code .
- "\nRouter: " . $v1['routers'] .
- "\nPrice: " . $p['price']);
+ r2(U . 'voucher/activation', 'e', "Failed to refill account");
}
-
- r2(U . "voucher/list-activated", 's', $_L['Activation_Vouchers_Successfully']);
} else {
r2(U . 'voucher/activation', 'e', $_L['Voucher_Not_Valid']);
}
diff --git a/system/updates.json b/system/updates.json
index a0151c59..6269b896 100644
--- a/system/updates.json
+++ b/system/updates.json
@@ -13,5 +13,9 @@
],
"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.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`;"
]
}
\ No newline at end of file
diff --git a/ui/ui/customers-view.tpl b/ui/ui/customers-view.tpl
index c990fa1f..422aaadb 100644
--- a/ui/ui/customers-view.tpl
+++ b/ui/ui/customers-view.tpl
@@ -73,7 +73,8 @@
class="pull-right">{if $package['status']=='on'}yes{else}no{/if}
- {$_L['Created_On']} {Lang::dateFormat($package['recharged_on'])}
+ {$_L['Created_On']} {Lang::dateAndTimeFormat($package['recharged_on'],$package['recharged_time'])}
{$_L['Expires_On']} {$ds['plan_name']}
{Lang::moneyFormat($ds['price'])}
{$ds['type']}
- {date($_c['date_format'], strtotime($ds['recharged_on']))}
- {date($_c['date_format'], strtotime($ds['expiration']))}
- {$ds['time']}
+ {Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}
+
+ {Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}
{$ds['method']}
{/foreach}
@@ -146,12 +147,9 @@
{$ds['routers']}
{$ds['payment_channel']}
{Lang::moneyFormat($ds['price'])}
- {date("{$_c['date_format']} H:i",
- strtotime($ds['created_date']))}
- {date("{$_c['date_format']} H:i",
- strtotime($ds['expired_date']))}
- {if $ds['status']!=1}{date("{$_c['date_format']} H:i",
- strtotime($ds['paid_date']))}{/if}
+ {Lang::dateTimeFormat($ds['created_date'])}
+ {Lang::dateTimeFormat($ds['expired_date'])}
+ {if $ds['status']!=1}{Lang::dateTimeFormat($ds['paid_date'])}{/if}
{if $ds['status']==1}{$_L['UNPAID']}
{elseif $ds['status']==2}{$_L['PAID']}
{elseif $ds['status']==3}{$_L['FAILED']}
diff --git a/ui/ui/dashboard.tpl b/ui/ui/dashboard.tpl
index 6d8151fc..873d4ee0 100644
--- a/ui/ui/dashboard.tpl
+++ b/ui/ui/dashboard.tpl
@@ -108,9 +108,9 @@
{$no++}
{$expired['username']}
- {date($_c['date_format'], strtotime($expired['recharged_on']))}
+ {Lang::dateAndTimeFormat($expired['recharged_on'],$expired['recharged_time'])}
- {date($_c['date_format'], strtotime($expired['expiration']))} {$expired['time']}
+ {Lang::dateAndTimeFormat($expired['expiration'],$expired['time'])}
diff --git a/ui/ui/invoice-print.tpl b/ui/ui/invoice-print.tpl
index 8da794d5..942692ec 100644
--- a/ui/ui/invoice-print.tpl
+++ b/ui/ui/invoice-print.tpl
@@ -39,9 +39,8 @@
{$_L['Password']} : **********
{if $in['type'] != 'Balance'}
- {$_L['Created_On']} : {date($_c['date_format'], strtotime($d['recharged_on']))}
- {$_L['Expires_On']} : {date($_c['date_format'], strtotime($d['expiration']))}
- {$d['time']}
+ {$_L['Created_On']} : {Lang::dateAndTimeFormat($d['recharged_on'],$d['recharged_time'])}
+ {$_L['Expires_On']} : {Lang::dateAndTimeFormat($d['expiration'],$d['time'])}
{/if}
============================================
{$_c['note']}
diff --git a/ui/ui/invoice.tpl b/ui/ui/invoice.tpl
index 5f4a9d3f..fdb48984 100644
--- a/ui/ui/invoice.tpl
+++ b/ui/ui/invoice.tpl
@@ -24,9 +24,8 @@
{$_L['Password']} : **********
{if $in['type'] != 'Balance'}
- {$_L['Created_On']} : {date($_c['date_format'], strtotime($in['recharged_on']))}
- {$_L['Expires_On']} : {date($_c['date_format'], strtotime($in['expiration']))}
- {$in['time']}
+ {$_L['Created_On']} : {Lang::dateAndTimeFormat($in['recharged_on'],$in['recharged_time'])}
+ {$_L['Expires_On']} : {Lang::dateAndTimeFormat($in['expiration'],$in['time'])}
{/if}
=====================================================
{$_c['note']}
diff --git a/ui/ui/prepaid-edit.tpl b/ui/ui/prepaid-edit.tpl
index 03abd043..90a02adb 100644
--- a/ui/ui/prepaid-edit.tpl
+++ b/ui/ui/prepaid-edit.tpl
@@ -3,57 +3,62 @@
-
{$_L['Recharge_Account']}
+
+
{$_L['Recharge_Account']}
+
-{include file="sections/footer.tpl"}
+{include file="sections/footer.tpl"}
\ No newline at end of file
diff --git a/ui/ui/prepaid.tpl b/ui/ui/prepaid.tpl
index a80aabcb..3a8ad2be 100644
--- a/ui/ui/prepaid.tpl
+++ b/ui/ui/prepaid.tpl
@@ -1,66 +1,70 @@
{include file="sections/header.tpl"}
-
-
-
-
{$_L['Prepaid_User']}
-
-
-
-
-
-
- {$_L['Username']}
- {$_L['Plan_Name']}
- {$_L['Type']}
- {$_L['Created_On']}
- {$_L['Expires_On']}
- {$_L['Method']}
- {$_L['Routers']}
- {$_L['Manage']}
-
-
-
- {foreach $d as $ds}
-
- {$ds['username']}
- {$ds['namebp']}
- {$ds['type']}
- {$ds['recharged_on']}
- {$ds['expiration']} {$ds['time']}
- {$ds['method']}
- {$ds['routers']}
-
- {$_L['Edit']}
- {$_L['Delete']}
-
-
- {/foreach}
-
-
-
- {$paginator['contents']}
-
-
-
-
+
+
+
+
{$_L['Prepaid_User']}
+
+
+
+
+
+
+ {$_L['Username']}
+ {$_L['Plan_Name']}
+ {$_L['Type']}
+ {$_L['Created_On']}
+ {$_L['Expires_On']}
+ {$_L['Method']}
+ {$_L['Routers']}
+ {$_L['Manage']}
+
+
+
+ {foreach $d as $ds}
+
+ {$ds['username']}
+ {$ds['namebp']}
+ {$ds['type']}
+ {Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}
+ {Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}
+ {$ds['method']}
+ {$ds['routers']}
+
+ {$_L['Edit']}
+ {$_L['Delete']}
+
+
+ {/foreach}
+
+
+
+ {$paginator['contents']}
+
+
+
+
-{include file="sections/footer.tpl"}
+{include file="sections/footer.tpl"}
\ No newline at end of file
diff --git a/ui/ui/print-by-date.tpl b/ui/ui/print-by-date.tpl
index fd8f3d9a..ed7e96ee 100644
--- a/ui/ui/print-by-date.tpl
+++ b/ui/ui/print-by-date.tpl
@@ -39,8 +39,8 @@
{$ds['plan_name']}
{$ds['type']}
{Lang::moneyFormat($ds['price'])}
- {date($_c['date_format'], strtotime($ds['recharged_on']))}
- {date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}
+ {Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}
+ {Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}
{$ds['method']}
{$ds['routers']}
diff --git a/ui/ui/print-by-period.tpl b/ui/ui/print-by-period.tpl
index 95f47a51..ec8d0ab6 100644
--- a/ui/ui/print-by-period.tpl
+++ b/ui/ui/print-by-period.tpl
@@ -39,8 +39,8 @@
{$ds['plan_name']}
{$ds['type']}
{Lang::moneyFormat($ds['price'])}
- {date($_c['date_format'], strtotime($ds['recharged_on']))}
- {date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}
+ {Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}
+ {Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}
{$ds['method']}
{$ds['routers']}
diff --git a/ui/ui/reports-daily.tpl b/ui/ui/reports-daily.tpl
index 116a342c..53525a83 100644
--- a/ui/ui/reports-daily.tpl
+++ b/ui/ui/reports-daily.tpl
@@ -42,8 +42,8 @@
{$ds['type']}
{$ds['plan_name']}
{Lang::moneyFormat($ds['price'])}
- {date($_c['date_format'], strtotime($ds['recharged_on']))}
- {date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}
+ {Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}
+ {Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}
{$ds['method']}
{$ds['routers']}
diff --git a/ui/ui/reports-period-view.tpl b/ui/ui/reports-period-view.tpl
index 1082f1b5..69a5f43c 100644
--- a/ui/ui/reports-period-view.tpl
+++ b/ui/ui/reports-period-view.tpl
@@ -53,8 +53,8 @@
{$ds['type']}
{$ds['plan_name']}
{Lang::moneyFormat($ds['price'])}
- {date($_c['date_format'], strtotime($ds['recharged_on']))}
- {date($_c['date_format'], strtotime($ds['expiration']))} {$ds['time']}
+ {Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}
+ {Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}
{$ds['method']}
{$ds['routers']}
diff --git a/ui/ui/reports-period.tpl b/ui/ui/reports-period.tpl
index 67a378b6..557c2932 100644
--- a/ui/ui/reports-period.tpl
+++ b/ui/ui/reports-period.tpl
@@ -10,19 +10,13 @@
diff --git a/ui/ui/router-error.tpl b/ui/ui/router-error.tpl
new file mode 100644
index 00000000..fad1e26d
--- /dev/null
+++ b/ui/ui/router-error.tpl
@@ -0,0 +1,59 @@
+
+
+
+
+
+
+
Router Error - PHPNuxBill
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {$error_meesage}
+
+
back
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/ui/ui/user-activation-list.tpl b/ui/ui/user-activation-list.tpl
index e0a4542e..8d6c8841 100644
--- a/ui/ui/user-activation-list.tpl
+++ b/ui/ui/user-activation-list.tpl
@@ -26,9 +26,8 @@
{$ds['plan_name']}
{Lang::moneyFormat($ds['price'])}
{$ds['type']}
-
{date($_c['date_format'], strtotime($ds['recharged_on']))}
-
{date($_c['date_format'], strtotime($ds['expiration']))}
- {$ds['time']}
+
{Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}
+
{Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}
{$ds['method']}
{/foreach}
diff --git a/ui/ui/user-dashboard.tpl b/ui/ui/user-dashboard.tpl
index 39a63c31..4a7f413d 100644
--- a/ui/ui/user-dashboard.tpl
+++ b/ui/ui/user-dashboard.tpl
@@ -84,14 +84,14 @@
{$_L['Created_On']}
- {if $_bill['time'] ne ''}{date($_c['date_format'], strtotime($_bill['recharged_on']))}
+ {if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['recharged_on'],$_bill['recharged_time'])}
{/if}
{$_L['Expires_On']}
- {if $_bill['time'] ne ''}{date($_c['date_format'], strtotime($_bill['expiration']))}
- {$_bill['time']}{/if}
+ {if $_bill['time'] ne ''}{Lang::dateAndTimeFormat($_bill['expiration'],$_bill['time'])}{/if}
+
{if $_bill['type'] == 'Hotspot' && $_bill['status'] == 'on'}
{if $nux_ip}
@@ -138,7 +138,7 @@
}, 2000);
{/if}
- {if $_c['enable_balance'] == 'yes'}
+ {if $_c['enable_balance'] == 'yes' && $_c['allow_balance_transfer'] == 'yes'}