diff --git a/CHANGELOG.md b/CHANGELOG.md index 273041d8..a1d09b0f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,18 @@ # CHANGELOG +## 2023.8.24 + +- Balance transfer between Customer +- Optimize Cronjob +- View Customer Info +- Ajax for select customer + +## 2023.8.18 + +- Fix Auto Renewall Cronjob +- Add comment to Mikrotik User + ## 2023.8.16 - Admin Can Add Balance to Customer diff --git a/install/phpnuxbill.sql b/install/phpnuxbill.sql index 602f8364..28903fe6 100644 --- a/install/phpnuxbill.sql +++ b/install/phpnuxbill.sql @@ -50,12 +50,12 @@ CREATE TABLE `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', + `pppoe_password` varchar(45) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL DEFAULT '', `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', - `balance` decimal(15,2) NOT NULL COMMENT 'For Money Deposit', + `balance` decimal(15,2) NOT NULL DEFAULT 0.00 COMMENT 'For Money Deposit', `auto_renewal` tinyint(1) NOT NULL DEFAULT 1 COMMENT 'Auto renewal from balance', `created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP, `last_login` datetime DEFAULT NULL diff --git a/system/autoload/Balance.php b/system/autoload/Balance.php index 2b3713d2..f6557a3f 100644 --- a/system/autoload/Balance.php +++ b/system/autoload/Balance.php @@ -18,18 +18,14 @@ class Balance public static function transfer($id_customer, $phoneTarget, $amount) { global $config; - if ($config['allow_balance_transfer'] == 'yes') { - if(Balance::min($id_customer, $amount)){ - if(Balance::plusByPhone($phoneTarget, $amount)){ - return true; - }else{ - Balance::plus($id_customer, $amount); - return false; - } - }else{ + if (Balance::min($id_customer, $amount)) { + if (Balance::plusByPhone($phoneTarget, $amount)) { + return true; + } else { + Balance::plus($id_customer, $amount); return false; } - }else{ + } else { return false; } } @@ -38,7 +34,7 @@ class Balance { $c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one(); if ($c && $c['balance'] >= $amount) { - $c->balance = $amount - $c['balance']; + $c->balance = $c['balance'] - $amount; $c->save(); return true; } else { @@ -49,7 +45,7 @@ class Balance public static function plusByPhone($phone_customer, $amount) { $c = ORM::for_table('tbl_customers')->where('username', $phone_customer)->find_one(); - if($c){ + if ($c) { $c->balance = $amount + $c['balance']; $c->save(); return true; @@ -61,7 +57,7 @@ class Balance { $c = ORM::for_table('tbl_customers')->where('username', $phone_customer)->find_one(); if ($c && $c['balance'] >= $amount) { - $c->balance = $amount - $c['balance']; + $c->balance = $c['balance'] - $amount; $c->save(); return true; } else { diff --git a/system/autoload/Lang.php b/system/autoload/Lang.php index 6c790bd4..52abdd0f 100644 --- a/system/autoload/Lang.php +++ b/system/autoload/Lang.php @@ -31,4 +31,31 @@ class Lang return $phone; } } + + public static function dateFormat($date){ + global $config; + return date($config['date_format'], strtotime($date)); + } + + public static function dateTimeFormat($date){ + global $config; + return date($config['date_format']. ' H:i', strtotime($date)); + } + + public static function nl2br($text){ + return nl2br($text); + } + + public static function arrayCount($arr){ + return count($arr); + } + + public static function getNotifText($key){ + global $_notifmsg, $_notifmsg_default; + if(isset($_notifmsg[$key])){ + return $_notifmsg[$key]; + }else{ + return $_notifmsg_default[$key]; + } + } } diff --git a/system/autoload/Message.php b/system/autoload/Message.php index 0373d682..15981d06 100644 --- a/system/autoload/Message.php +++ b/system/autoload/Message.php @@ -56,4 +56,20 @@ class Message return "$via: $msg"; } + public static function sendBalanceNotification($phone, $name, $balance, $message, $via) + { + $msg = str_replace('[[name]]', "*$name*", $message); + $msg = str_replace('[[balance]]', "*" . Lang::moneyFormat($balance) . "*", $msg); + if ( + !empty($phone) && strlen($phone) > 5 + && !empty($message) && in_array($via, ['sms', 'wa']) + ) { + if ($via == 'sms') { + Message::sendSMS($phone, $msg); + } else if ($via == 'wa') { + Message::sendWhatsapp($phone, $msg); + } + } + return "$via: $msg"; + } } diff --git a/system/autoload/Mikrotik.php b/system/autoload/Mikrotik.php index 17b344e0..7b7f82ca 100644 --- a/system/autoload/Mikrotik.php +++ b/system/autoload/Mikrotik.php @@ -4,8 +4,9 @@ use PEAR2\Net\RouterOS; class Mikrotik { - public static function info($name){ - $d = ORM::for_table('tbl_routers')->where('name',$name)->find_one(); + public static function info($name) + { + $d = ORM::for_table('tbl_routers')->where('name', $name)->find_one(); return $d; } @@ -19,7 +20,8 @@ class Mikrotik } } - public static function isUserLogin($client, $username){ + public static function isUserLogin($client, $username) + { $printRequest = new RouterOS\Request( '/ip hotspot active print', RouterOS\Query::where('user', $username) @@ -27,7 +29,8 @@ class Mikrotik return $client->sendSync($printRequest)->getProperty('.id'); } - public static function logMeIn($client, $user, $pass, $ip, $mac){ + public static function logMeIn($client, $user, $pass, $ip, $mac) + { $addRequest = new RouterOS\Request('/ip/hotspot/active/login'); $client->sendSync( $addRequest @@ -38,7 +41,8 @@ class Mikrotik ); } - public static function logMeOut($client, $user){ + public static function logMeOut($client, $user) + { $printRequest = new RouterOS\Request( '/ip hotspot active print', RouterOS\Query::where('user', $user) @@ -51,7 +55,8 @@ class Mikrotik ); } - public static function addHotspotPlan($client, $name, $sharedusers, $rate){ + public static function addHotspotPlan($client, $name, $sharedusers, $rate) + { $addRequest = new RouterOS\Request('/ip/hotspot/user/profile/add'); $client->sendSync( $addRequest @@ -61,7 +66,8 @@ class Mikrotik ); } - public static function setHotspotPlan($client, $name, $sharedusers, $rate){ + public static function setHotspotPlan($client, $name, $sharedusers, $rate) + { $printRequest = new RouterOS\Request( '/ip hotspot user profile print .proplist=name', RouterOS\Query::where('name', $name) @@ -77,7 +83,8 @@ class Mikrotik ); } - public static function removeHotspotPlan($client, $name){ + public static function removeHotspotPlan($client, $name) + { $printRequest = new RouterOS\Request( '/ip hotspot user profile print .proplist=name', RouterOS\Query::where('name', $name) @@ -119,6 +126,8 @@ class Mikrotik ->setArgument('name', $customer['username']) ->setArgument('profile', $plan['name_plan']) ->setArgument('password', $customer['password']) + ->setArgument('comment', $customer['fullname']) + ->setArgument('email', $customer['email']) ->setArgument('limit-uptime', $timelimit) ); } else if ($plan['limit_type'] == "Data_Limit") { @@ -131,6 +140,8 @@ class Mikrotik ->setArgument('name', $customer['username']) ->setArgument('profile', $plan['name_plan']) ->setArgument('password', $customer['password']) + ->setArgument('comment', $customer['fullname']) + ->setArgument('email', $customer['email']) ->setArgument('limit-bytes-total', $datalimit) ); } else if ($plan['limit_type'] == "Both_Limit") { @@ -147,6 +158,8 @@ class Mikrotik ->setArgument('name', $customer['username']) ->setArgument('profile', $plan['name_plan']) ->setArgument('password', $customer['password']) + ->setArgument('comment', $customer['fullname']) + ->setArgument('email', $customer['email']) ->setArgument('limit-uptime', $timelimit) ->setArgument('limit-bytes-total', $datalimit) ); @@ -156,12 +169,15 @@ class Mikrotik $addRequest ->setArgument('name', $customer['username']) ->setArgument('profile', $plan['name_plan']) + ->setArgument('comment', $customer['fullname']) + ->setArgument('email', $customer['email']) ->setArgument('password', $customer['password']) ); } } - public static function setHotspotUser($client, $user, $pass, $nuser= null){ + public static function setHotspotUser($client, $user, $pass, $nuser = null) + { $printRequest = new RouterOS\Request('/ip/hotspot/user/print'); $printRequest->setArgument('.proplist', '.id'); $printRequest->setQuery(RouterOS\Query::where('name', $user)); @@ -216,9 +232,9 @@ class Mikrotik public static function addPpoeUser($client, $plan, $customer) { $addRequest = new RouterOS\Request('/ppp/secret/add'); - if(!empty($customer['pppoe_password'])){ + if (!empty($customer['pppoe_password'])) { $pass = $customer['pppoe_password']; - }else{ + } else { $pass = $customer['password']; } $client->sendSync( @@ -226,11 +242,13 @@ class Mikrotik ->setArgument('name', $customer['username']) ->setArgument('service', 'pppoe') ->setArgument('profile', $plan['name_plan']) + ->setArgument('comment', $customer['fullname'] . ' | ' . $customer['email']) ->setArgument('password', $pass) ); } - public static function setPpoeUser($client, $user, $pass, $nuser= null){ + public static function setPpoeUser($client, $user, $pass, $nuser = null) + { $printRequest = new RouterOS\Request('/ppp/secret/print'); $printRequest->setArgument('.proplist', '.id'); $printRequest->setQuery(RouterOS\Query::where('name', $user)); @@ -266,7 +284,8 @@ class Mikrotik $client->sendSync($removeRequest); } - public static function removePool($client, $name){ + public static function removePool($client, $name) + { $printRequest = new RouterOS\Request( '/ip pool print .proplist=name', RouterOS\Query::where('name', $name) @@ -274,29 +293,33 @@ class Mikrotik $poolName = $client->sendSync($printRequest)->getProperty('name'); $removeRequest = new RouterOS\Request('/ip/pool/remove'); - $client($removeRequest - ->setArgument('numbers', $poolName) + $client( + $removeRequest + ->setArgument('numbers', $poolName) ); } - public static function addPool($client, $name, $ip_address){ + public static function addPool($client, $name, $ip_address) + { $addRequest = new RouterOS\Request('/ip/pool/add'); - $client->sendSync($addRequest - ->setArgument('name', $name) - ->setArgument('ranges', $ip_address) + $client->sendSync( + $addRequest + ->setArgument('name', $name) + ->setArgument('ranges', $ip_address) ); } - public static function setPool($client, $name, $ip_address){ + public static function setPool($client, $name, $ip_address) + { $printRequest = new RouterOS\Request( '/ip pool print .proplist=name', RouterOS\Query::where('name', $name) ); $poolName = $client->sendSync($printRequest)->getProperty('name'); - if(empty($poolName)){ + if (empty($poolName)) { self::addPool($client, $name, $ip_address); - }else{ + } else { $setRequest = new RouterOS\Request('/ip/pool/set'); $client( $setRequest @@ -307,7 +330,8 @@ class Mikrotik } - public static function addPpoePlan($client, $name, $pool, $rate){ + public static function addPpoePlan($client, $name, $pool, $rate) + { $addRequest = new RouterOS\Request('/ppp/profile/add'); $client->sendSync( $addRequest @@ -318,15 +342,16 @@ class Mikrotik ); } - public static function setPpoePlan($client, $name, $pool, $rate){ + public static function setPpoePlan($client, $name, $pool, $rate) + { $printRequest = new RouterOS\Request( '/ppp profile print .proplist=name', RouterOS\Query::where('name', $name) ); $profileName = $client->sendSync($printRequest)->getProperty('name'); - if(empty($profileName)){ + if (empty($profileName)) { self::addPpoePlan($client, $name, $pool, $rate); - }else{ + } else { $setRequest = new RouterOS\Request('/ppp/profile/set'); $client( $setRequest @@ -338,7 +363,8 @@ class Mikrotik } } - public static function removePpoePlan($client, $name){ + public static function removePpoePlan($client, $name) + { $printRequest = new RouterOS\Request( '/ppp profile print .proplist=name', RouterOS\Query::where('name', $name) diff --git a/system/autoload/Package.php b/system/autoload/Package.php index 0a803dfc..97fbda01 100644 --- a/system/autoload/Package.php +++ b/system/autoload/Package.php @@ -33,7 +33,7 @@ class Package if ($router_name == 'balance') { // insert table transactions - $inv = "INV-" . _raid(5); + $inv = "INV-" . Package::_raid(5); $t = ORM::for_table('tbl_transactions')->create(); $t->invoice = $inv; $t->username = $c['username']; @@ -49,7 +49,7 @@ class Package Balance::plus($id_customer, $p['price']); - $textInvoice = $_notifmsg['invoice_balance']; + $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); @@ -96,6 +96,7 @@ class Package if (!$_c['radius_mode']) { $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); Mikrotik::removeHotspotUser($client, $c['username']); + Mikrotik::removePpoeUser($client, $c['username']); Mikrotik::addHotspotUser($client, $p, $c); } @@ -114,7 +115,7 @@ class Package // insert table transactions $t = ORM::for_table('tbl_transactions')->create(); - $t->invoice = "INV-" . _raid(5); + $t->invoice = "INV-" . Package::_raid(5); $t->username = $c['username']; $t->plan_name = $p['name_plan']; $t->price = $p['price']; @@ -128,6 +129,7 @@ class Package } else { if (!$_c['radius_mode']) { $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); + Mikrotik::removePpoeUser($client, $c['username']); Mikrotik::addHotspotUser($client, $p, $c); } @@ -147,7 +149,7 @@ class Package // insert table transactions $t = ORM::for_table('tbl_transactions')->create(); - $t->invoice = "INV-" . _raid(5); + $t->invoice = "INV-" . Package::_raid(5); $t->username = $c['username']; $t->plan_name = $p['name_plan']; $t->price = $p['price']; @@ -163,12 +165,13 @@ class Package "\nRouter: " . $router_name . "\nGateway: " . $gateway . "\nChannel: " . $channel . - "\nPrice: " . $p['price']); + "\nPrice: " . Lang::moneyFormat($p['price'])); } else { if ($b) { if (!$_c['radius_mode']) { $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); + Mikrotik::removeHotspotUser($client, $c['username']); Mikrotik::removePpoeUser($client, $c['username']); Mikrotik::addPpoeUser($client, $p, $c); } @@ -188,7 +191,7 @@ class Package // insert table transactions $t = ORM::for_table('tbl_transactions')->create(); - $t->invoice = "INV-" . _raid(5); + $t->invoice = "INV-" . Package::_raid(5); $t->username = $c['username']; $t->plan_name = $p['name_plan']; $t->price = $p['price']; @@ -202,6 +205,7 @@ class Package } else { if (!$_c['radius_mode']) { $client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']); + Mikrotik::removeHotspotUser($client, $c['username']); Mikrotik::addPpoeUser($client, $p, $c); } @@ -221,7 +225,7 @@ class Package // insert table transactions $t = ORM::for_table('tbl_transactions')->create(); - $t->invoice = "INV-" . _raid(5); + $t->invoice = "INV-" . Package::_raid(5); $t->username = $c['username']; $t->plan_name = $p['name_plan']; $t->price = $p['price']; @@ -237,12 +241,12 @@ class Package "\nRouter: " . $router_name . "\nGateway: " . $gateway . "\nChannel: " . $channel . - "\nPrice: " . $p['price']); + "\nPrice: " . Lang::moneyFormat($p['price'])); } $in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one(); - $textInvoice = $_notifmsg['invoice_paid']; + $textInvoice = Lang::getNotifText('invoice_paid'); $textInvoice = str_replace('[[company_name]]', $_c['CompanyName'], $textInvoice); $textInvoice = str_replace('[[address]]', $_c['address'], $textInvoice); $textInvoice = str_replace('[[phone]]', $_c['phone'], $textInvoice); @@ -301,4 +305,10 @@ class Package } } } + + + public static function _raid($l) + { + return substr(str_shuffle(str_repeat('0123456789', $l)), 0, $l); + } } diff --git a/system/autoload/Paginator.php b/system/autoload/Paginator.php index 97553cd8..cb6e4b92 100644 --- a/system/autoload/Paginator.php +++ b/system/autoload/Paginator.php @@ -1,28 +1,29 @@ where($w1,$c1)->count(); - }elseif($w2 != ''){ - $totalReq = ORM::for_table($table)->where($w1,$c1)->where($w2,$c2)->count(); - }elseif($w3 != ''){ - $totalReq = ORM::for_table($table)->where($w1,$c1)->where($w2,$c2)->where($w3,$c3)->count(); - }elseif($w4 != ''){ - $totalReq = ORM::for_table($table)->where($w1,$c1)->where($w2,$c2)->where($w3,$c3)->where($w4,$c4)->count(); - }else{ + if ($w1 != '') { + $totalReq = ORM::for_table($table)->where($w1, $c1)->count(); + } elseif ($w2 != '') { + $totalReq = ORM::for_table($table)->where($w1, $c1)->where($w2, $c2)->count(); + } elseif ($w3 != '') { + $totalReq = ORM::for_table($table)->where($w1, $c1)->where($w2, $c2)->where($w3, $c3)->count(); + } elseif ($w4 != '') { + $totalReq = ORM::for_table($table)->where($w1, $c1)->where($w2, $c2)->where($w3, $c3)->where($w4, $c4)->count(); + } else { $totalReq = ORM::for_table($table)->count(); } @@ -85,16 +86,103 @@ Class Paginator } if ($page < $counter - 1) { - $pagination .= "
+ [[name]] Receiver name.
+ [[balance]] how much balance have been send.
+
+ [[name]] Sender name.
+ [[balance]] how much balance have been received.
+
{Lang::T('Allow balance transfer between customers')}
+{Lang::nl2br($d['address'])}
+{$_L['Username']} | +{$_L['Plan_Name']} | +{$_L['Plan_Price']} | +{$_L['Type']} | +{$_L['Created_On']} | +{$_L['Expires_On']} | +{$_L['Method']} | +||
---|---|---|---|---|---|---|---|---|
{$ds['username']} | +{$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']} | +{$ds['method']} | +||
{$_L['Plan_Name']} | +{Lang::T('Gateway')} | +{Lang::T('Routers')} | +{$_L['Type']} | +{$_L['Plan_Price']} | +{$_L['Created_On']} | +{$_L['Expires_On']} | +{Lang::T('Date Done')} | +{$_L['Method']} | +
{$ds['plan_name']} | +{$ds['gateway']} | +{$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} | +{if $ds['status']==1}{$_L['UNPAID']} + {elseif $ds['status']==2}{$_L['PAID']} + {elseif $ds['status']==3}{$_L['FAILED']} + {elseif $ds['status']==4}{$_L['CANCELED']} + {elseif $ds['status']==5}{$_L['UNKNOWN']} + {/if} | +
{$_L['Manage']} | {$_L['Username']} | {$_L['Full_Name']} | {Lang::T('Balance')} | @@ -41,27 +35,23 @@{$_L['Email']} | {$_L['Created_On']} | {$_L['Recharge']} | -{$_L['Manage']} | ||
---|---|---|---|---|---|---|---|---|---|
+ {Lang::T('View')} + | {$ds['username']} | {$ds['fullname']} | {Lang::moneyFormat($ds['balance'])} | {$ds['phonenumber']} | {$ds['email']} | -{$ds['created_at']} | +{Lang::dateTimeFormat($ds['created_at'])} | {$_L['Recharge']} | -- {$_L['Edit']} - {$_L['Delete']} - |
{$no++} | -{$expired['username']} | +{$expired['username']} | {date($_c['date_format'], strtotime($expired['recharged_on']))} | {date($_c['date_format'], strtotime($expired['expiration']))} {$expired['time']}
diff --git a/ui/ui/deposit.tpl b/ui/ui/deposit.tpl
index 02e5810e..a76311fa 100644
--- a/ui/ui/deposit.tpl
+++ b/ui/ui/deposit.tpl
@@ -11,10 +11,6 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
+
{include file="sections/footer.tpl"}
\ No newline at end of file
diff --git a/ui/ui/reports-period.tpl b/ui/ui/reports-period.tpl
index a1926078..67a378b6 100644
--- a/ui/ui/reports-period.tpl
+++ b/ui/ui/reports-period.tpl
@@ -32,6 +32,7 @@
+
diff --git a/ui/ui/routers-edit.tpl b/ui/ui/routers-edit.tpl
index e33d0327..b6afb78d 100644
--- a/ui/ui/routers-edit.tpl
+++ b/ui/ui/routers-edit.tpl
@@ -41,7 +41,8 @@
-
-
+
diff --git a/ui/ui/scripts/select2.min.js b/ui/ui/scripts/select2.min.js
deleted file mode 100644
index 49a988c7..00000000
--- a/ui/ui/scripts/select2.min.js
+++ /dev/null
@@ -1,2 +0,0 @@
-/*! Select2 4.0.0 | https://github.com/select2/select2/blob/master/LICENSE.md */!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a("object"==typeof exports?require("jquery"):jQuery)}(function(a){var b=function(){if(a&&a.fn&&a.fn.select2&&a.fn.select2.amd)var b=a.fn.select2.amd;var b;return function(){if(!b||!b.requirejs){b?c=b:b={};var a,c,d;!function(b){function e(a,b){return u.call(a,b)}function f(a,b){var c,d,e,f,g,h,i,j,k,l,m,n=b&&b.split("/"),o=s.map,p=o&&o["*"]||{};if(a&&"."===a.charAt(0))if(b){for(n=n.slice(0,n.length-1),a=a.split("/"),g=a.length-1,s.nodeIdCompat&&w.test(a[g])&&(a[g]=a[g].replace(w,"")),a=n.concat(a),k=0;k
+
+ {$_L['Announcement']}
+
@@ -138,6 +138,39 @@
}, 2000);
{/if}
+ {if $_c['enable_balance'] == 'yes'}
+
{include file="$_path/../pages/Announcement.html"}
+
+ {/if}
+
+ {Lang::T("Transfer Balance")}+
+
+
+
+
+
+
+
+
+
+
+
+
+ {if $_c['disable_voucher'] != 'yes'}
diff --git a/ui/ui/user-orderPlan.tpl b/ui/ui/user-orderPlan.tpl
index 6315baad..d8a2c91b 100644
--- a/ui/ui/user-orderPlan.tpl
+++ b/ui/ui/user-orderPlan.tpl
@@ -33,6 +33,10 @@
{/foreach}
+
{/if}
{foreach $routers as $router}
{Lang::T('Balance')} {Lang::moneyFormat($_user['balance'])}
+
@@ -69,9 +73,16 @@
|
{Lang::T('Status')} | -{if $trx['status']==1}{Lang::T('UNPAID')}{elseif $trx['status']==2}{Lang::T('PAID')}{elseif $trx['status']==3}{Lang::T('FAILED')}{elseif $trx['status']==4}{Lang::T('CANCELED')}{else}{Lang::T('UNKNOWN')}{/if} - | -|||
{Lang::T('expired')} | -{date($_c['date_format'], strtotime($trx['expired_date']))} - {date('H:i', strtotime($trx['expired_date']))} | -
{Lang::T('Type')} | +{$trx['plan_name']} | +|||
{Lang::T('Paid Date')} | {date($_c['date_format'], strtotime($trx['paid_date']))} {date('H:i', strtotime($trx['paid_date']))} | |||
{$_L['Plan_Name']} | -{$plan['name_plan']} | -|||
{$_L['Plan_Price']} | -{Lang::moneyFormat($plan['price'])} | -|||
{Lang::T('Type')} | -{$plan['type']} | -|||
{Lang::T('Plan_Type')} | -{Lang::T($plan['typebp'])} | -|||
{Lang::T('Time_Limit')} | -{$ds['time_limit']} {$ds['time_unit']} | -|||
{Lang::T('Data_Limit')} | -{$ds['data_limit']} {$ds['data_unit']} | -|||
{$_L['Plan_Validity']} | -{$plan['validity']} {$plan['validity_unit']} | + {if $trx['plan_name'] == 'Receive Balance'} +{Lang::T('From')} | + {else} +{Lang::T('To')} | + {/if} +{$trx['gateway']} |
{$_L['Bandwidth_Plans']} | -{$bandw['name_bw']} {$bandw['rate_down']}{$bandw['rate_down_unit']}/{$bandw['rate_up']}{$bandw['rate_up_unit']} + | {$_L['Balance']} | +{Lang::moneyFormat($trx['price'])} | +
{Lang::T('Status')} | +{if $trx['status']==1}{Lang::T('UNPAID')}{elseif $trx['status']==2}{Lang::T('PAID')}{elseif $trx['status']==3}{Lang::T('FAILED')}{elseif $trx['status']==4}{Lang::T('CANCELED')}{else}{Lang::T('UNKNOWN')}{/if} |