Compare commits
10 Commits
Author | SHA1 | Date | |
---|---|---|---|
6f5d49cd2f | |||
850581d328 | |||
1d0d3f13ab | |||
c82b6b6acf | |||
532fbf7337 | |||
c4afd6da7f | |||
a812e3a3e0 | |||
a15510e62a | |||
78d1634470 | |||
cc8d810d45 |
@ -2,6 +2,11 @@
|
|||||||
|
|
||||||
# CHANGELOG
|
# CHANGELOG
|
||||||
|
|
||||||
|
## 2024.3.15
|
||||||
|
|
||||||
|
- Fix Customer View to list active Plan
|
||||||
|
- Additional Bill using Customer Attributes
|
||||||
|
|
||||||
## 2024.3.14
|
## 2024.3.14
|
||||||
|
|
||||||
- Add Note to Invoices
|
- Add Note to Invoices
|
||||||
|
1
init.php
1
init.php
@ -37,7 +37,6 @@ function _autoloader($class)
|
|||||||
}
|
}
|
||||||
spl_autoload_register('_autoloader');
|
spl_autoload_register('_autoloader');
|
||||||
|
|
||||||
|
|
||||||
if (!file_exists($root_path . 'config.php')) {
|
if (!file_exists($root_path . 'config.php')) {
|
||||||
$root_path .= '..' . DIRECTORY_SEPARATOR;
|
$root_path .= '..' . DIRECTORY_SEPARATOR;
|
||||||
if (!file_exists($root_path . 'config.php')) {
|
if (!file_exists($root_path . 'config.php')) {
|
||||||
|
@ -32,29 +32,21 @@ class Package
|
|||||||
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
|
$c = ORM::for_table('tbl_customers')->where('id', $id_customer)->find_one();
|
||||||
$p = ORM::for_table('tbl_plans')->where('id', $plan_id)->find_one();
|
$p = ORM::for_table('tbl_plans')->where('id', $plan_id)->find_one();
|
||||||
|
|
||||||
// Additional cost
|
|
||||||
$add_cost = 0;
|
$add_cost = 0;
|
||||||
$add_rem = User::getAttribute("Additional Remaining", $id_customer);
|
|
||||||
// if empty then it doesnt have cycle, if zero then it finish
|
|
||||||
if ($add_rem != 0) {
|
|
||||||
$add_cost = User::getAttribute("Additional Cost", $id_customer);
|
|
||||||
if (empty($add_cost)) {
|
|
||||||
$add_cost = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($add_cost > 0 && $router_name != 'balance') {
|
|
||||||
$bills = User::getAttributes("Bill", $id_customer);
|
|
||||||
foreach ($bills as $k => $v) {
|
|
||||||
$note .= $k . " : " . Lang::moneyFormat($v) . "\n";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Zero cost recharge
|
// Zero cost recharge
|
||||||
if (isset($zero) && $zero == 1) {
|
if (isset($zero) && $zero == 1) {
|
||||||
$p['price'] = 0;
|
$p['price'] = 0;
|
||||||
$add_cost = 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";
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (!$p['enabled']) {
|
if (!$p['enabled']) {
|
||||||
if (!isset($admin) || !isset($admin['id']) || empty($admin['id'])) {
|
if (!isset($admin) || !isset($admin['id']) || empty($admin['id'])) {
|
||||||
r2(U . 'home', 'e', Lang::T('Plan Not found'));
|
r2(U . 'home', 'e', Lang::T('Plan Not found'));
|
||||||
@ -246,7 +238,17 @@ class Package
|
|||||||
$t->invoice = "INV-" . Package::_raid();
|
$t->invoice = "INV-" . Package::_raid();
|
||||||
$t->username = $c['username'];
|
$t->username = $c['username'];
|
||||||
$t->plan_name = $p['name_plan'];
|
$t->plan_name = $p['name_plan'];
|
||||||
$t->price = $p['price'] + $add_cost;
|
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_on = $date_only;
|
||||||
$t->recharged_time = $time_only;
|
$t->recharged_time = $time_only;
|
||||||
$t->expiration = $date_exp;
|
$t->expiration = $date_exp;
|
||||||
@ -263,7 +265,7 @@ class Package
|
|||||||
$t->save();
|
$t->save();
|
||||||
|
|
||||||
if ($p['validity_unit'] == 'Period') {
|
if ($p['validity_unit'] == 'Period') {
|
||||||
// insert to fields
|
// 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();
|
$fl = ORM::for_table('tbl_customers_fields')->where('field_name', 'Invoice')->where('customer_id', $c['id'])->find_one();
|
||||||
if (!$fl) {
|
if (!$fl) {
|
||||||
$fl = ORM::for_table('tbl_customers_fields')->create();
|
$fl = ORM::for_table('tbl_customers_fields')->create();
|
||||||
@ -319,18 +321,9 @@ class Package
|
|||||||
$t->invoice = "INV-" . Package::_raid();
|
$t->invoice = "INV-" . Package::_raid();
|
||||||
$t->username = $c['username'];
|
$t->username = $c['username'];
|
||||||
$t->plan_name = $p['name_plan'];
|
$t->plan_name = $p['name_plan'];
|
||||||
if ($p['validity_unit'] == 'Period' && $p['price'] != 0) {
|
if ($p['validity_unit'] == 'Period') {
|
||||||
// Calculating Price
|
// Postpaid price always zero for first time
|
||||||
$sd = new DateTime("$date_only");
|
$t->price = 0 + $add_cost;
|
||||||
$ed = new DateTime("$date_exp");
|
|
||||||
$td = $ed->diff($sd);
|
|
||||||
$fd = $td->format("%a");
|
|
||||||
$gi = ($p['price'] / 30) * $fd;
|
|
||||||
if ($gi > $p['price']) {
|
|
||||||
$t->price = $p['price'] + $add_cost;
|
|
||||||
} else {
|
|
||||||
$t->price = $gi + $add_cost;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$t->price = $p['price'] + $add_cost;
|
$t->price = $p['price'] + $add_cost;
|
||||||
}
|
}
|
||||||
@ -350,12 +343,18 @@ class Package
|
|||||||
$t->save();
|
$t->save();
|
||||||
|
|
||||||
if ($p['validity_unit'] == 'Period' && $p['price'] != 0) {
|
if ($p['validity_unit'] == 'Period' && $p['price'] != 0) {
|
||||||
// insert to fields
|
// 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();
|
$fl = ORM::for_table('tbl_customers_fields')->where('field_name', 'Invoice')->where('customer_id', $c['id'])->find_one();
|
||||||
if (!$fl) {
|
if (!$fl) {
|
||||||
$fl = ORM::for_table('tbl_customers_fields')->create();
|
$fl = ORM::for_table('tbl_customers_fields')->create();
|
||||||
$fl->customer_id = $c['id'];
|
$fl->customer_id = $c['id'];
|
||||||
$fl->field_name = 'Invoice';
|
$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) * $fd;
|
||||||
if ($gi > $p['price']) {
|
if ($gi > $p['price']) {
|
||||||
$fl->field_value = $p['price'];
|
$fl->field_value = $p['price'];
|
||||||
} else {
|
} else {
|
||||||
@ -433,7 +432,17 @@ class Package
|
|||||||
$t->invoice = "INV-" . Package::_raid();
|
$t->invoice = "INV-" . Package::_raid();
|
||||||
$t->username = $c['username'];
|
$t->username = $c['username'];
|
||||||
$t->plan_name = $p['name_plan'];
|
$t->plan_name = $p['name_plan'];
|
||||||
$t->price = $p['price'] + $add_cost;
|
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_on = $date_only;
|
||||||
$t->recharged_time = $time_only;
|
$t->recharged_time = $time_only;
|
||||||
$t->expiration = $date_exp;
|
$t->expiration = $date_exp;
|
||||||
@ -450,7 +459,7 @@ class Package
|
|||||||
$t->save();
|
$t->save();
|
||||||
|
|
||||||
if ($p['validity_unit'] == 'Period' && $p['price'] != 0) {
|
if ($p['validity_unit'] == 'Period' && $p['price'] != 0) {
|
||||||
// insert to fields
|
// 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();
|
$fl = ORM::for_table('tbl_customers_fields')->where('field_name', 'Invoice')->where('customer_id', $c['id'])->find_one();
|
||||||
if (!$fl) {
|
if (!$fl) {
|
||||||
$fl = ORM::for_table('tbl_customers_fields')->create();
|
$fl = ORM::for_table('tbl_customers_fields')->create();
|
||||||
@ -505,18 +514,9 @@ class Package
|
|||||||
$t->invoice = "INV-" . Package::_raid();
|
$t->invoice = "INV-" . Package::_raid();
|
||||||
$t->username = $c['username'];
|
$t->username = $c['username'];
|
||||||
$t->plan_name = $p['name_plan'];
|
$t->plan_name = $p['name_plan'];
|
||||||
if ($p['validity_unit'] == 'Period' && $p['price'] != 0) {
|
if ($p['validity_unit'] == 'Period') {
|
||||||
// Calculating Price
|
// Postpaid price always zero for first time
|
||||||
$sd = new DateTime("$date_only");
|
$t->price = 0 + $add_cost;
|
||||||
$ed = new DateTime("$date_exp");
|
|
||||||
$td = $ed->diff($sd);
|
|
||||||
$fd = $td->format("%a");
|
|
||||||
$gi = ($p['price'] / 30) * $fd;
|
|
||||||
if ($gi > $p['price']) {
|
|
||||||
$t->price = $p['price'] + $add_cost;
|
|
||||||
} else {
|
|
||||||
$t->price = $gi + $add_cost;
|
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
$t->price = $p['price'] + $add_cost;
|
$t->price = $p['price'] + $add_cost;
|
||||||
}
|
}
|
||||||
@ -536,12 +536,18 @@ class Package
|
|||||||
$t->save();
|
$t->save();
|
||||||
|
|
||||||
if ($p['validity_unit'] == 'Period' && $p['price'] != 0) {
|
if ($p['validity_unit'] == 'Period' && $p['price'] != 0) {
|
||||||
// insert to fields
|
// 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();
|
$fl = ORM::for_table('tbl_customers_fields')->where('field_name', 'Invoice')->where('customer_id', $c['id'])->find_one();
|
||||||
if (!$fl) {
|
if (!$fl) {
|
||||||
$fl = ORM::for_table('tbl_customers_fields')->create();
|
$fl = ORM::for_table('tbl_customers_fields')->create();
|
||||||
$fl->customer_id = $c['id'];
|
$fl->customer_id = $c['id'];
|
||||||
$fl->field_name = 'Invoice';
|
$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) * $fd;
|
||||||
if ($gi > $p['price']) {
|
if ($gi > $p['price']) {
|
||||||
$fl->field_value = $p['price'];
|
$fl->field_value = $p['price'];
|
||||||
} else {
|
} else {
|
||||||
@ -562,8 +568,8 @@ class Package
|
|||||||
"\nPrice: " . Lang::moneyFormat($p['price']));
|
"\nPrice: " . Lang::moneyFormat($p['price']));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($add_rem > 0) {
|
if (count($bills) > 0) {
|
||||||
User::setAttribute('Additional Remaining', ($add_rem - 1), $id_customer);
|
User::billsPaid($bills, $id_customer);
|
||||||
}
|
}
|
||||||
run_hook("recharge_user_finish");
|
run_hook("recharge_user_finish");
|
||||||
Message::sendInvoice($c, $t);
|
Message::sendInvoice($c, $t);
|
||||||
@ -671,6 +677,8 @@ class Package
|
|||||||
$_admin = Admin::_info($in['admin_id']);
|
$_admin = Admin::_info($in['admin_id']);
|
||||||
// if admin not deleted
|
// if admin not deleted
|
||||||
if ($_admin) $admin = $_admin;
|
if ($_admin) $admin = $_admin;
|
||||||
|
}else{
|
||||||
|
$admin['fullname'] = 'Customer';
|
||||||
}
|
}
|
||||||
//print
|
//print
|
||||||
$invoice = Lang::pad($config['CompanyName'], ' ', 2) . "\n";
|
$invoice = Lang::pad($config['CompanyName'], ' ', 2) . "\n";
|
||||||
|
@ -26,6 +26,60 @@ class User
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static function getBills($id = 0)
|
||||||
|
{
|
||||||
|
if (!$id) {
|
||||||
|
$id = User::getID();
|
||||||
|
if (!$id) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$addcost = 0;
|
||||||
|
$bills = [];
|
||||||
|
$attrs = User::getAttributes('Bill', $id);
|
||||||
|
foreach ($attrs as $k => $v) {
|
||||||
|
// if has : then its an installment
|
||||||
|
if (strpos($v, ":") === false) {
|
||||||
|
// Not installment
|
||||||
|
$bills[$k] = $v;
|
||||||
|
$addcost += $v;
|
||||||
|
} else {
|
||||||
|
// installment
|
||||||
|
list($cost, $rem) = explode(":", $v);
|
||||||
|
// :0 installment is done
|
||||||
|
if (!empty($rem)) {
|
||||||
|
$bills[$k] = $cost;
|
||||||
|
$addcost += $cost;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return [$bills, $addcost];
|
||||||
|
}
|
||||||
|
|
||||||
|
public static function billsPaid($bills, $id = 0)
|
||||||
|
{
|
||||||
|
if (!$id) {
|
||||||
|
$id = User::getID();
|
||||||
|
if (!$id) {
|
||||||
|
return [];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
foreach ($bills as $k => $v) {
|
||||||
|
// if has : then its an installment
|
||||||
|
$v = User::getAttribute($k, $id);
|
||||||
|
if (strpos($v, ":") === false) {
|
||||||
|
// Not installment, no need decrement
|
||||||
|
} else {
|
||||||
|
// installment
|
||||||
|
list($cost, $rem) = explode(":", $v);
|
||||||
|
// :0 installment is done
|
||||||
|
if ($rem != 0) {
|
||||||
|
User::setAttribute($k, "$cost:".($rem - 1), $id);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static function setAttribute($name, $value, $id = 0)
|
public static function setAttribute($name, $value, $id = 0)
|
||||||
{
|
{
|
||||||
if (!$id) {
|
if (!$id) {
|
||||||
@ -35,7 +89,7 @@ class User
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$f = ORM::for_table('tbl_customers_fields')->where('field_name', $name)->where('customer_id', $id)->find_one();
|
$f = ORM::for_table('tbl_customers_fields')->where('field_name', $name)->where('customer_id', $id)->find_one();
|
||||||
if(!$f){
|
if (!$f) {
|
||||||
$f = ORM::for_table('tbl_customers_fields')->create();
|
$f = ORM::for_table('tbl_customers_fields')->create();
|
||||||
$f->customer_id = $id;
|
$f->customer_id = $id;
|
||||||
$f->field_name = $name;
|
$f->field_name = $name;
|
||||||
@ -45,7 +99,7 @@ class User
|
|||||||
if ($result) {
|
if ($result) {
|
||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
}else{
|
} else {
|
||||||
$f->field_value = $value;
|
$f->field_value = $value;
|
||||||
$f->save();
|
$f->save();
|
||||||
return $f['id'];
|
return $f['id'];
|
||||||
|
@ -97,20 +97,14 @@ switch ($action) {
|
|||||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||||
}
|
}
|
||||||
$id_customer = $routes['2'];
|
$id_customer = $routes['2'];
|
||||||
$b = ORM::for_table('tbl_user_recharges')->where('customer_id', $id_customer)->find_one();
|
$plan_id = $routes['3'];
|
||||||
|
$b = ORM::for_table('tbl_user_recharges')->where('customer_id', $id_customer)->where('plan_id', $plan_id)->find_one();
|
||||||
if ($b) {
|
if ($b) {
|
||||||
$gateway = 'Recharge';
|
$gateway = 'Recharge';
|
||||||
$channel = $admin['fullname'];
|
$channel = $admin['fullname'];
|
||||||
$cust = User::_info($id_customer);
|
$cust = User::_info($id_customer);
|
||||||
$plan = ORM::for_table('tbl_plans')->find_one($b['plan_id']);
|
$plan = ORM::for_table('tbl_plans')->find_one($b['plan_id']);
|
||||||
$add_cost = 0;
|
list($bills, $add_cost) = User::getBills($id_customer);
|
||||||
$add_rem = User::getAttribute("Additional Remaining", $id_customer);
|
|
||||||
if($add_rem != 0){
|
|
||||||
$add_cost = User::getAttribute("Additional Cost", $id_customer);
|
|
||||||
if (empty($add_cost)) {
|
|
||||||
$add_cost = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($using == 'balance' && $config['enable_balance'] == 'yes') {
|
if ($using == 'balance' && $config['enable_balance'] == 'yes') {
|
||||||
if (!$cust) {
|
if (!$cust) {
|
||||||
r2(U . 'prepaid/recharge', 'e', Lang::T('Customer not found'));
|
r2(U . 'prepaid/recharge', 'e', Lang::T('Customer not found'));
|
||||||
@ -127,10 +121,8 @@ switch ($action) {
|
|||||||
$zero = 1;
|
$zero = 1;
|
||||||
$gateway = 'Recharge Zero';
|
$gateway = 'Recharge Zero';
|
||||||
}
|
}
|
||||||
$bills = User::getAttributes("Bill", $id_customer);
|
|
||||||
$ui->assign('bills', $bills);
|
$ui->assign('bills', $bills);
|
||||||
$ui->assign('add_cost', $add_cost);
|
$ui->assign('add_cost', $add_cost);
|
||||||
$ui->assign('add_rem', $add_rem);
|
|
||||||
$ui->assign('cust', $cust);
|
$ui->assign('cust', $cust);
|
||||||
$ui->assign('gateway', $gateway);
|
$ui->assign('gateway', $gateway);
|
||||||
$ui->assign('channel', $channel);
|
$ui->assign('channel', $channel);
|
||||||
@ -138,16 +130,19 @@ switch ($action) {
|
|||||||
$ui->assign('using', 'cash');
|
$ui->assign('using', 'cash');
|
||||||
$ui->assign('plan', $plan);
|
$ui->assign('plan', $plan);
|
||||||
$ui->display('recharge-confirm.tpl');
|
$ui->display('recharge-confirm.tpl');
|
||||||
|
}else{
|
||||||
|
r2(U . 'customers/view/' . $id_customer, 'e', 'Cannot find active plan');
|
||||||
}
|
}
|
||||||
r2(U . 'customers/view/' . $id_customer, 'e', 'Cannot find active plan');
|
break;
|
||||||
case 'deactivate':
|
case 'deactivate':
|
||||||
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
|
if (!in_array($admin['user_type'], ['SuperAdmin', 'Admin'])) {
|
||||||
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
_alert(Lang::T('You do not have permission to access this page'), 'danger', "dashboard");
|
||||||
}
|
}
|
||||||
$id_customer = $routes['2'];
|
$id_customer = $routes['2'];
|
||||||
$b = ORM::for_table('tbl_user_recharges')->where('customer_id', $id_customer)->find_one();
|
$plan_id = $routes['3'];
|
||||||
|
$b = ORM::for_table('tbl_user_recharges')->where('customer_id', $id_customer)->where('plan_id', $plan_id)->find_one();
|
||||||
if ($b) {
|
if ($b) {
|
||||||
$p = ORM::for_table('tbl_plans')->where('id', $b['plan_id'])->where('enabled', '1')->find_one();
|
$p = ORM::for_table('tbl_plans')->where('id', $b['plan_id'])->find_one();
|
||||||
if ($p) {
|
if ($p) {
|
||||||
if ($p['is_radius']) {
|
if ($p['is_radius']) {
|
||||||
Radius::customerDeactivate($b['username']);
|
Radius::customerDeactivate($b['username']);
|
||||||
@ -175,27 +170,28 @@ switch ($action) {
|
|||||||
break;
|
break;
|
||||||
case 'sync':
|
case 'sync':
|
||||||
$id_customer = $routes['2'];
|
$id_customer = $routes['2'];
|
||||||
$b = ORM::for_table('tbl_user_recharges')->where('customer_id', $id_customer)->where('status', 'on')->find_one();
|
$bs = ORM::for_table('tbl_user_recharges')->where('customer_id', $id_customer)->where('status', 'on')->findMany();
|
||||||
if ($b) {
|
if ($bs) {
|
||||||
$c = ORM::for_table('tbl_customers')->find_one($id_customer);
|
$routers = [];
|
||||||
$p = ORM::for_table('tbl_plans')->where('id', $b['plan_id'])->where('enabled', '1')->find_one();
|
foreach ($bs as $b) {
|
||||||
if ($p) {
|
$c = ORM::for_table('tbl_customers')->find_one($id_customer);
|
||||||
if ($p['is_radius']) {
|
$p = ORM::for_table('tbl_plans')->where('id', $b['plan_id'])->where('enabled', '1')->find_one();
|
||||||
Radius::customerAddPlan($c, $p, $p['expiration'] . ' ' . $p['time']);
|
if ($p) {
|
||||||
r2(U . 'customers/view/' . $id_customer, 's', 'Success sync customer to Radius');
|
$routers[] = $b['routers'];
|
||||||
} else {
|
if ($p['is_radius']) {
|
||||||
$mikrotik = Mikrotik::info($b['routers']);
|
Radius::customerAddPlan($c, $p, $p['expiration'] . ' ' . $p['time']);
|
||||||
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
} else {
|
||||||
if ($b['type'] == 'Hotspot') {
|
$mikrotik = Mikrotik::info($b['routers']);
|
||||||
Mikrotik::addHotspotUser($client, $p, $c);
|
$client = Mikrotik::getClient($mikrotik['ip_address'], $mikrotik['username'], $mikrotik['password']);
|
||||||
} else if ($b['type'] == 'PPPOE') {
|
if ($b['type'] == 'Hotspot') {
|
||||||
Mikrotik::addPpoeUser($client, $p, $c);
|
Mikrotik::addHotspotUser($client, $p, $c);
|
||||||
|
} else if ($b['type'] == 'PPPOE') {
|
||||||
|
Mikrotik::addPpoeUser($client, $p, $c);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
r2(U . 'customers/view/' . $id_customer, 's', 'Success sync customer to Mikrotik');
|
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
r2(U . 'customers/view/' . $id_customer, 'e', 'Customer plan is inactive');
|
|
||||||
}
|
}
|
||||||
|
r2(U . 'customers/view/' . $id_customer, 's', 'Sync success to '.implode(", ",$routers));
|
||||||
}
|
}
|
||||||
r2(U . 'customers/view/' . $id_customer, 'e', 'Cannot find active plan');
|
r2(U . 'customers/view/' . $id_customer, 'e', 'Cannot find active plan');
|
||||||
break;
|
break;
|
||||||
@ -216,7 +212,10 @@ switch ($action) {
|
|||||||
->find_many();
|
->find_many();
|
||||||
|
|
||||||
$v = $routes['3'];
|
$v = $routes['3'];
|
||||||
if (empty($v) || $v == 'order') {
|
if(empty($v)){
|
||||||
|
$v = 'activation';
|
||||||
|
}
|
||||||
|
if ($v == 'order') {
|
||||||
$v = 'order';
|
$v = 'order';
|
||||||
$paginator = Paginator::build(ORM::for_table('tbl_payment_gateway'), ['username' => $customer['username']]);
|
$paginator = Paginator::build(ORM::for_table('tbl_payment_gateway'), ['username' => $customer['username']]);
|
||||||
$order = ORM::for_table('tbl_payment_gateway')
|
$order = ORM::for_table('tbl_payment_gateway')
|
||||||
@ -238,8 +237,7 @@ switch ($action) {
|
|||||||
$ui->assign('paginator', $paginator);
|
$ui->assign('paginator', $paginator);
|
||||||
$ui->assign('activation', $activation);
|
$ui->assign('activation', $activation);
|
||||||
}
|
}
|
||||||
$package = ORM::for_table('tbl_user_recharges')->where('username', $customer['username'])->find_one();
|
$ui->assign('packages', User::_billing($customer['id']));
|
||||||
$ui->assign('package', $package);
|
|
||||||
$ui->assign('v', $v);
|
$ui->assign('v', $v);
|
||||||
$ui->assign('d', $customer);
|
$ui->assign('d', $customer);
|
||||||
$ui->assign('customFields', $customFields);
|
$ui->assign('customFields', $customFields);
|
||||||
|
@ -124,16 +124,16 @@ switch ($action) {
|
|||||||
$trx = ORM::for_table('tbl_payment_gateway')
|
$trx = ORM::for_table('tbl_payment_gateway')
|
||||||
->where('username', $user['username'])
|
->where('username', $user['username'])
|
||||||
->find_one($trxid);
|
->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"));
|
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']);
|
$plan = ORM::for_table('tbl_plans')->find_one($trx['plan_id']);
|
||||||
$bandw = ORM::for_table('tbl_bandwidth')->find_one($plan['id_bw']);
|
$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('trx', $trx);
|
||||||
$ui->assign('router', $router);
|
$ui->assign('router', $router);
|
||||||
$ui->assign('plan', $plan);
|
$ui->assign('plan', $plan);
|
||||||
@ -157,11 +157,12 @@ switch ($action) {
|
|||||||
} else {
|
} else {
|
||||||
$router_name = $plan['routers'];
|
$router_name = $plan['routers'];
|
||||||
}
|
}
|
||||||
|
list($bills, $add_cost) = User::getBills($id_customer);
|
||||||
if ($plan && $plan['enabled'] && $user['balance'] >= $plan['price']) {
|
if ($plan && $plan['enabled'] && $user['balance'] >= $plan['price']) {
|
||||||
if (Package::rechargeUser($user['id'], $router_name, $plan['id'], 'Customer', 'Balance')) {
|
if (Package::rechargeUser($user['id'], $router_name, $plan['id'], 'Customer', 'Balance')) {
|
||||||
// if success, then get the balance
|
// if success, then get the balance
|
||||||
Balance::min($user['id'], $plan['price']);
|
Balance::min($user['id'], $plan['price'] + $add_cost);
|
||||||
r2(U . "home", 's', Lang::T("Success to buy package"));
|
r2(U . "voucher/invoice/", 's', Lang::T("Success to buy package"));
|
||||||
} else {
|
} else {
|
||||||
r2(U . "order/package", 'e', Lang::T("Failed to buy package"));
|
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'] .
|
Message::sendTelegram("Buy Package with Balance Failed\n\n#u$c[username] #buy \n" . $plan['name_plan'] .
|
||||||
@ -192,6 +193,12 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
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();
|
$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) {
|
if (!$target) {
|
||||||
r2(U . 'home', 'd', Lang::T('Username not found'));
|
r2(U . 'home', 'd', Lang::T('Username not found'));
|
||||||
}
|
}
|
||||||
@ -267,13 +274,13 @@ switch ($action) {
|
|||||||
r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address"));
|
r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address"));
|
||||||
}
|
}
|
||||||
$pgs = array_values(explode(',', $config['payment_gateway']));
|
$pgs = array_values(explode(',', $config['payment_gateway']));
|
||||||
if(count($pgs)==0){
|
if (count($pgs) == 0) {
|
||||||
sendTelegram("Payment Gateway not set, please set it in Settings");
|
sendTelegram("Payment Gateway not set, please set it in Settings");
|
||||||
_log(Lang::T("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.."));
|
r2(U . "home", 'e', Lang::T("Failed to create Transaction.."));
|
||||||
}
|
}
|
||||||
if(count($pgs)>1){
|
if (count($pgs) > 1) {
|
||||||
$ui->assign('pgs',$pgs );
|
$ui->assign('pgs', $pgs);
|
||||||
//$ui->assign('pgs', $pgs);
|
//$ui->assign('pgs', $pgs);
|
||||||
$ui->assign('route2', $routes[2]);
|
$ui->assign('route2', $routes[2]);
|
||||||
$ui->assign('route3', $routes[3]);
|
$ui->assign('route3', $routes[3]);
|
||||||
@ -281,12 +288,12 @@ switch ($action) {
|
|||||||
//$ui->assign('plan', $plan);
|
//$ui->assign('plan', $plan);
|
||||||
$ui->display('user-selectGateway.tpl');
|
$ui->display('user-selectGateway.tpl');
|
||||||
break;
|
break;
|
||||||
}else{
|
} else {
|
||||||
if(empty($pgs[0])){
|
if (empty($pgs[0])) {
|
||||||
sendTelegram("Payment Gateway not set, please set it in Settings");
|
sendTelegram("Payment Gateway not set, please set it in Settings");
|
||||||
_log(Lang::T("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.."));
|
r2(U . "home", 'e', Lang::T("Failed to create Transaction.."));
|
||||||
}else{
|
} else {
|
||||||
$_POST['gateway'] = $pgs[0];
|
$_POST['gateway'] = $pgs[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -333,6 +340,10 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
$add_cost = 0;
|
||||||
|
if ($router['name'] != 'balance') {
|
||||||
|
list($bills, $add_cost) = User::getBills($id_customer);
|
||||||
|
}
|
||||||
if (empty($id)) {
|
if (empty($id)) {
|
||||||
$d = ORM::for_table('tbl_payment_gateway')->create();
|
$d = ORM::for_table('tbl_payment_gateway')->create();
|
||||||
$d->username = $user['username'];
|
$d->username = $user['username'];
|
||||||
@ -341,7 +352,18 @@ switch ($action) {
|
|||||||
$d->plan_name = $plan['name_plan'];
|
$d->plan_name = $plan['name_plan'];
|
||||||
$d->routers_id = $router['id'];
|
$d->routers_id = $router['id'];
|
||||||
$d->routers = $router['name'];
|
$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->created_date = date('Y-m-d H:i:s');
|
||||||
$d->status = 1;
|
$d->status = 1;
|
||||||
$d->save();
|
$d->save();
|
||||||
@ -353,7 +375,18 @@ switch ($action) {
|
|||||||
$d->plan_name = $plan['name_plan'];
|
$d->plan_name = $plan['name_plan'];
|
||||||
$d->routers_id = $router['id'];
|
$d->routers_id = $router['id'];
|
||||||
$d->routers = $router['name'];
|
$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->created_date = date('Y-m-d H:i:s');
|
||||||
$d->status = 1;
|
$d->status = 1;
|
||||||
$d->save();
|
$d->save();
|
||||||
|
@ -115,14 +115,7 @@ switch ($action) {
|
|||||||
$channel = $admin['fullname'];
|
$channel = $admin['fullname'];
|
||||||
$cust = User::_info($id_customer);
|
$cust = User::_info($id_customer);
|
||||||
$plan = ORM::for_table('tbl_plans')->find_one($planId);
|
$plan = ORM::for_table('tbl_plans')->find_one($planId);
|
||||||
$add_cost = 0;
|
list($bills, $add_cost) = User::getBills($id_customer);
|
||||||
$add_rem = User::getAttribute("Additional Remaining", $id_customer);
|
|
||||||
if($add_rem != 0){
|
|
||||||
$add_cost = User::getAttribute("Additional Cost", $id_customer);
|
|
||||||
if (empty($add_cost)) {
|
|
||||||
$add_cost = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($using == 'balance' && $config['enable_balance'] == 'yes') {
|
if ($using == 'balance' && $config['enable_balance'] == 'yes') {
|
||||||
if (!$cust) {
|
if (!$cust) {
|
||||||
r2(U . 'prepaid/recharge', 'e', Lang::T('Customer not found'));
|
r2(U . 'prepaid/recharge', 'e', Lang::T('Customer not found'));
|
||||||
@ -139,10 +132,8 @@ switch ($action) {
|
|||||||
$zero = 1;
|
$zero = 1;
|
||||||
$gateway = 'Recharge Zero';
|
$gateway = 'Recharge Zero';
|
||||||
}
|
}
|
||||||
$bills = User::getAttributes("Bill", $id_customer);
|
|
||||||
$ui->assign('bills', $bills);
|
$ui->assign('bills', $bills);
|
||||||
$ui->assign('add_cost', $add_cost);
|
$ui->assign('add_cost', $add_cost);
|
||||||
$ui->assign('add_rem', $add_rem);
|
|
||||||
$ui->assign('cust', $cust);
|
$ui->assign('cust', $cust);
|
||||||
$ui->assign('gateway', $gateway);
|
$ui->assign('gateway', $gateway);
|
||||||
$ui->assign('channel', $channel);
|
$ui->assign('channel', $channel);
|
||||||
@ -173,14 +164,7 @@ switch ($action) {
|
|||||||
$gateway = 'Recharge';
|
$gateway = 'Recharge';
|
||||||
$channel = $admin['fullname'];
|
$channel = $admin['fullname'];
|
||||||
$cust = User::_info($id_customer);
|
$cust = User::_info($id_customer);
|
||||||
$add_cost = 0;
|
list($bills, $add_cost) = User::getBills($id_customer);
|
||||||
$add_rem = User::getAttribute("Additional Remaining", $id_customer);
|
|
||||||
if($add_rem != 0){
|
|
||||||
$add_cost = User::getAttribute("Additional Cost", $id_customer);
|
|
||||||
if (empty($add_cost)) {
|
|
||||||
$add_cost = 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ($using == 'balance' && $config['enable_balance'] == 'yes') {
|
if ($using == 'balance' && $config['enable_balance'] == 'yes') {
|
||||||
$plan = ORM::for_table('tbl_plans')->find_one($planId);
|
$plan = ORM::for_table('tbl_plans')->find_one($planId);
|
||||||
if (!$cust) {
|
if (!$cust) {
|
||||||
|
@ -51,9 +51,17 @@ switch ($action) {
|
|||||||
break;
|
break;
|
||||||
case 'invoice':
|
case 'invoice':
|
||||||
$id = $routes[2];
|
$id = $routes[2];
|
||||||
$in = ORM::for_table('tbl_transactions')->where('username', $user['username'])->where('id', $id)->find_one();
|
if(empty($id)){
|
||||||
Package::createInvoice($in);
|
$in = ORM::for_table('tbl_transactions')->where('username', $user['username'])->order_by_desc('id')->find_one();
|
||||||
$ui->display('invoice-customer.tpl');
|
}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'));
|
||||||
|
}
|
||||||
default:
|
default:
|
||||||
$ui->display('a404.tpl');
|
$ui->display('a404.tpl');
|
||||||
}
|
}
|
||||||
|
@ -46,21 +46,27 @@ foreach ($d as $ds) {
|
|||||||
$client = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']);
|
$client = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']);
|
||||||
if (!empty($p['pool_expired'])) {
|
if (!empty($p['pool_expired'])) {
|
||||||
Mikrotik::setHotspotUserPackage($client, $c['username'], 'EXPIRED NUXBILL ' . $p['pool_expired']);
|
Mikrotik::setHotspotUserPackage($client, $c['username'], 'EXPIRED NUXBILL ' . $p['pool_expired']);
|
||||||
// }if (!empty($p['list_expired'])) {
|
// }if (!empty($p['list_expired'])) {
|
||||||
// $ip = Mikrotik::getIpHotspotUser($client, $ds['username']);
|
// $ip = Mikrotik::getIpHotspotUser($client, $ds['username']);
|
||||||
// Mikrotik::addIpToAddressList($client, $ip, $p['list_expired'], $c['username']);
|
// Mikrotik::addIpToAddressList($client, $ip, $p['list_expired'], $c['username']);
|
||||||
} else {
|
} else {
|
||||||
Mikrotik::removeHotspotUser($client, $c['username']);
|
Mikrotik::removeHotspotUser($client, $c['username']);
|
||||||
}
|
}
|
||||||
Mikrotik::removeHotspotActiveUser($client, $c['username']);
|
Mikrotik::removeHotspotActiveUser($client, $c['username']);
|
||||||
}
|
}
|
||||||
echo Message::sendPackageNotification($c, $u['namebp'], $price, $textExpired, $config['user_notification_expired'])."\n";
|
echo Message::sendPackageNotification($c, $u['namebp'], $price, $textExpired, $config['user_notification_expired']) . "\n";
|
||||||
//update database user dengan status off
|
//update database user dengan status off
|
||||||
$u->status = 'off';
|
$u->status = 'off';
|
||||||
$u->save();
|
$u->save();
|
||||||
|
|
||||||
// autorenewal from deposit
|
// autorenewal from deposit
|
||||||
if ($config['enable_balance'] == 'yes' && $c['auto_renewal']) {
|
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 ($p && $p['enabled'] && $c['balance'] >= $p['price']) {
|
||||||
if (Package::rechargeUser($ds['customer_id'], $p['routers'], $p['id'], 'Customer', 'Balance')) {
|
if (Package::rechargeUser($ds['customer_id'], $p['routers'], $p['id'], 'Customer', 'Balance')) {
|
||||||
// if success, then get the balance
|
// if success, then get the balance
|
||||||
@ -109,13 +115,19 @@ foreach ($d as $ds) {
|
|||||||
}
|
}
|
||||||
Mikrotik::removePpoeActive($client, $c['username']);
|
Mikrotik::removePpoeActive($client, $c['username']);
|
||||||
}
|
}
|
||||||
echo Message::sendPackageNotification($c, $u['namebp'], $price, $textExpired, $config['user_notification_expired'])."\n";
|
echo Message::sendPackageNotification($c, $u['namebp'], $price, $textExpired, $config['user_notification_expired']) . "\n";
|
||||||
|
|
||||||
$u->status = 'off';
|
$u->status = 'off';
|
||||||
$u->save();
|
$u->save();
|
||||||
|
|
||||||
// autorenewal from deposit
|
// autorenewal from deposit
|
||||||
if ($config['enable_balance'] == 'yes' && $c['auto_renewal']) {
|
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 ($p && $p['enabled'] && $c['balance'] >= $p['price']) {
|
||||||
if (Package::rechargeUser($ds['customer_id'], $p['routers'], $p['id'], 'Customer', 'Balance')) {
|
if (Package::rechargeUser($ds['customer_id'], $p['routers'], $p['id'], 'Customer', 'Balance')) {
|
||||||
// if success, then get the balance
|
// if success, then get the balance
|
||||||
|
@ -38,7 +38,24 @@ foreach ($d as $ds) {
|
|||||||
$u = ORM::for_table('tbl_user_recharges')->where('id', $ds['id'])->find_one();
|
$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();
|
$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();
|
$c = ORM::for_table('tbl_customers')->where('id', $ds['customer_id'])->find_one();
|
||||||
$price = Lang::moneyFormat($p['price']);
|
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']);
|
||||||
|
}
|
||||||
|
//$price = Lang::moneyFormat($p['price']);
|
||||||
if ($ds['expiration'] == $day7) {
|
if ($ds['expiration'] == $day7) {
|
||||||
echo Message::sendPackageNotification($c, $p['name_plan'], $price, 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) {
|
} else if ($ds['expiration'] == $day3) {
|
||||||
|
@ -487,5 +487,11 @@
|
|||||||
"Current_Cycle": "Current Cycle",
|
"Current_Cycle": "Current Cycle",
|
||||||
"Additional_Cost": "Additional Cost",
|
"Additional_Cost": "Additional Cost",
|
||||||
"Remaining": "Remaining",
|
"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"
|
||||||
}
|
}
|
@ -1,8 +0,0 @@
|
|||||||
<html>
|
|
||||||
<head>
|
|
||||||
<title>403 Forbidden</title>
|
|
||||||
</head>
|
|
||||||
<body>
|
|
||||||
<p>Directory access is forbidden.</p>
|
|
||||||
</body>
|
|
||||||
</html>
|
|
@ -30,20 +30,26 @@
|
|||||||
onclick="this.select()">
|
onclick="this.select()">
|
||||||
</li>
|
</li>
|
||||||
{if $d['pppoe_password'] != ''}
|
{if $d['pppoe_password'] != ''}
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<b>PPPOE {Lang::T('Password')}</b> <input type="password" value="{$d['pppoe_password']}"
|
<b>PPPOE {Lang::T('Password')}</b> <input type="password" value="{$d['pppoe_password']}"
|
||||||
style=" border: 0px; text-align: right;" class="pull-right"
|
style=" border: 0px; text-align: right;" class="pull-right"
|
||||||
onmouseleave="this.type = 'password'" onmouseenter="this.type = 'text'"
|
onmouseleave="this.type = 'password'" onmouseenter="this.type = 'text'"
|
||||||
onclick="this.select()">
|
onclick="this.select()">
|
||||||
</li>
|
</li>
|
||||||
{/if}
|
{/if}
|
||||||
<!--Customers Attributes view start -->
|
<!--Customers Attributes view start -->
|
||||||
{if $customFields}
|
{if $customFields}
|
||||||
{foreach $customFields as $customField}
|
{foreach $customFields as $customField}
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<b>{$customField.field_name}</b> <span class="pull-right">{$customField.field_value}</span>
|
<b>{$customField.field_name}</b> <span class="pull-right">
|
||||||
</li>
|
{if strpos($customField.field_value, ':0') === false}
|
||||||
{/foreach}
|
{$customField.field_value}
|
||||||
|
{else}
|
||||||
|
<b>{Lang::T('Paid')}</b>
|
||||||
|
{/if}
|
||||||
|
</span>
|
||||||
|
</li>
|
||||||
|
{/foreach}
|
||||||
{/if}
|
{/if}
|
||||||
<!--Customers Attributes view end -->
|
<!--Customers Attributes view end -->
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
@ -54,7 +60,8 @@
|
|||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<b>{Lang::T('Auto Renewal')}</b> <span class="pull-right">{if
|
<b>{Lang::T('Auto Renewal')}</b> <span class="pull-right">{if
|
||||||
$d['auto_renewal']}yes{else}no{/if}</span>
|
$d['auto_renewal']}yes{else}no
|
||||||
|
{/if}</span>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<b>{Lang::T('Created On')}</b> <span
|
<b>{Lang::T('Created On')}</b> <span
|
||||||
@ -78,22 +85,26 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{if $package}
|
{foreach $packages as $package}
|
||||||
<div class="box box-{if $package['status']=='on'}success{else}danger{/if}">
|
<div class="box box-{if $package['status']=='on'}success{else}danger{/if}">
|
||||||
<div class="box-body box-profile">
|
<div class="box-body box-profile">
|
||||||
<h4 class="text-center">{$package['type']} - {$package['namebp']}</h4>
|
<h4 class="text-center">{$package['type']} - {$package['namebp']}</h4>
|
||||||
<ul class="list-group list-group-unbordered">
|
<ul class="list-group list-group-unbordered">
|
||||||
|
<li class="list-group-item">
|
||||||
|
{Lang::T('Active')} <span class="pull-right">{if
|
||||||
|
$package['status']=='on'}yes{else}no
|
||||||
|
{/if}</span>
|
||||||
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
{Lang::T('Active')} <span class="pull-right">{if
|
{Lang::T('Type')} <span class="pull-right">
|
||||||
$package['status']=='on'}yes{else}no{/if}</span>
|
{if $package['prepaid'] eq yes}Prepaid{else}<b>Postpaid</b>{/if}</span>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
{Lang::T('Created On')} <span
|
{Lang::T('Created On')} <span
|
||||||
class="pull-right">{Lang::dateAndTimeFormat($package['recharged_on'],$package['recharged_time'])}</span>
|
class="pull-right">{Lang::dateAndTimeFormat($package['recharged_on'],$package['recharged_time'])}</span>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
{Lang::T('Expires On')} <span
|
{Lang::T('Expires On')} <span class="pull-right">{Lang::dateAndTimeFormat($package['expiration'],
|
||||||
class="pull-right">{Lang::dateAndTimeFormat($package['expiration'],
|
|
||||||
$package['time'])}</span>
|
$package['time'])}</span>
|
||||||
</li>
|
</li>
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
@ -102,28 +113,28 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-4">
|
||||||
<a href="{$_url}customers/deactivate/{$d['id']}" id="{$d['id']}"
|
<a href="{$_url}customers/deactivate/{$d['id']}/{$package['plan_id']}" id="{$d['id']}"
|
||||||
class="btn btn-danger btn-block btn-sm"
|
class="btn btn-danger btn-block btn-sm"
|
||||||
onclick="return confirm('This will deactivate Customer Plan, and make it expired')">{Lang::T('Deactivate')}</a>
|
onclick="return confirm('This will deactivate Customer Plan, and make it expired')">{Lang::T('Deactivate')}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-4">
|
<div class="col-xs-8">
|
||||||
<a href="{$_url}customers/recharge/{$d['id']}"
|
<a href="{$_url}customers/recharge/{$d['id']}/{$package['plan_id']}"
|
||||||
onclick="return confirm('This will extend Customer plan, same as recharge')"
|
|
||||||
class="btn btn-success btn-sm btn-block">{Lang::T('Recharge')}</a>
|
class="btn btn-success btn-sm btn-block">{Lang::T('Recharge')}</a>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xs-4">
|
|
||||||
<a href="{$_url}customers/sync/{$d['id']}"
|
|
||||||
onclick="return confirm('This will sync Customer to Mikrotik?')"
|
|
||||||
class="btn btn-primary btn-sm btn-block">{Lang::T('Sync')}</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{else}
|
{/foreach}
|
||||||
<a href="{$_url}prepaid/recharge/{$d['id']}"
|
<div class="row">
|
||||||
class="btn btn-success btn-sm btn-block mt-1">{Lang::T('Recharge')}</a><br>
|
<div class="col-xs-4">
|
||||||
{/if}
|
<a href="{$_url}customers/list" class="btn btn-primary btn-sm btn-block">{Lang::T('Back')}</a>
|
||||||
<a href="{$_url}customers/list" class="btn btn-primary btn-sm btn-block mt-1">{Lang::T('Back')}</a><br>
|
</div>
|
||||||
|
<div class="col-xs-8">
|
||||||
|
<a href="{$_url}customers/sync/{$d['id']}"
|
||||||
|
onclick="return confirm('This will sync Customer to Mikrotik?')"
|
||||||
|
class="btn btn-info btn-sm btn-block">{Lang::T('Sync')}</a>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-sm-8 col-md-8">
|
<div class="col-sm-8 col-md-8">
|
||||||
<ul class="nav nav-tabs">
|
<ul class="nav nav-tabs">
|
||||||
@ -135,68 +146,68 @@
|
|||||||
<div class="table-responsive" style="background-color: white;">
|
<div class="table-responsive" style="background-color: white;">
|
||||||
<table id="datatable" class="table table-bordered table-striped">
|
<table id="datatable" class="table table-bordered table-striped">
|
||||||
{if Lang::arrayCount($activation)}
|
{if Lang::arrayCount($activation)}
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{Lang::T('Invoice')}</th>
|
<th>{Lang::T('Invoice')}</th>
|
||||||
<th>{Lang::T('Username')}</th>
|
<th>{Lang::T('Username')}</th>
|
||||||
<th>{Lang::T('Plan Name')}</th>
|
<th>{Lang::T('Plan Name')}</th>
|
||||||
<th>{Lang::T('Plan Price')}</th>
|
<th>{Lang::T('Plan Price')}</th>
|
||||||
<th>{Lang::T('Type')}</th>
|
<th>{Lang::T('Type')}</th>
|
||||||
<th>{Lang::T('Created On')}</th>
|
<th>{Lang::T('Created On')}</th>
|
||||||
<th>{Lang::T('Expires On')}</th>
|
<th>{Lang::T('Expires On')}</th>
|
||||||
<th>{Lang::T('Method')}</th>
|
<th>{Lang::T('Method')}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{foreach $activation as $ds}
|
{foreach $activation as $ds}
|
||||||
<tr onclick="window.location.href = '{$_url}prepaid/view/{$ds['id']}'" style="cursor:pointer;">
|
<tr onclick="window.location.href = '{$_url}prepaid/view/{$ds['id']}'" style="cursor:pointer;">
|
||||||
<td>{$ds['invoice']}</td>
|
<td>{$ds['invoice']}</td>
|
||||||
<td>{$ds['username']}</td>
|
<td>{$ds['username']}</td>
|
||||||
<td>{$ds['plan_name']}</td>
|
<td>{$ds['plan_name']}</td>
|
||||||
<td>{Lang::moneyFormat($ds['price'])}</td>
|
<td>{Lang::moneyFormat($ds['price'])}</td>
|
||||||
<td>{$ds['type']}</td>
|
<td>{$ds['type']}</td>
|
||||||
<td class="text-success">{Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}
|
<td class="text-success">{Lang::dateAndTimeFormat($ds['recharged_on'],$ds['recharged_time'])}
|
||||||
</td>
|
</td>
|
||||||
<td class="text-danger">{Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}</td>
|
<td class="text-danger">{Lang::dateAndTimeFormat($ds['expiration'],$ds['time'])}</td>
|
||||||
<td>{$ds['method']}</td>
|
<td>{$ds['method']}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</tbody>
|
</tbody>
|
||||||
{/if}
|
{/if}
|
||||||
{if Lang::arrayCount($order)}
|
{if Lang::arrayCount($order)}
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>{Lang::T('Plan Name')}</th>
|
<th>{Lang::T('Plan Name')}</th>
|
||||||
<th>{Lang::T('Gateway')}</th>
|
<th>{Lang::T('Gateway')}</th>
|
||||||
<th>{Lang::T('Routers')}</th>
|
<th>{Lang::T('Routers')}</th>
|
||||||
<th>{Lang::T('Type')}</th>
|
<th>{Lang::T('Type')}</th>
|
||||||
<th>{Lang::T('Plan Price')}</th>
|
<th>{Lang::T('Plan Price')}</th>
|
||||||
<th>{Lang::T('Created On')}</th>
|
<th>{Lang::T('Created On')}</th>
|
||||||
<th>{Lang::T('Expires On')}</th>
|
<th>{Lang::T('Expires On')}</th>
|
||||||
<th>{Lang::T('Date Done')}</th>
|
<th>{Lang::T('Date Done')}</th>
|
||||||
<th>{Lang::T('Method')}</th>
|
<th>{Lang::T('Method')}</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
{foreach $order as $ds}
|
{foreach $order as $ds}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{$ds['plan_name']}</td>
|
<td>{$ds['plan_name']}</td>
|
||||||
<td>{$ds['gateway']}</td>
|
<td>{$ds['gateway']}</td>
|
||||||
<td>{$ds['routers']}</td>
|
<td>{$ds['routers']}</td>
|
||||||
<td>{$ds['payment_channel']}</td>
|
<td>{$ds['payment_channel']}</td>
|
||||||
<td>{Lang::moneyFormat($ds['price'])}</td>
|
<td>{Lang::moneyFormat($ds['price'])}</td>
|
||||||
<td class="text-primary">{Lang::dateTimeFormat($ds['created_date'])}</td>
|
<td class="text-primary">{Lang::dateTimeFormat($ds['created_date'])}</td>
|
||||||
<td class="text-danger">{Lang::dateTimeFormat($ds['expired_date'])}</td>
|
<td class="text-danger">{Lang::dateTimeFormat($ds['expired_date'])}</td>
|
||||||
<td class="text-success">{if $ds['status']!=1}{Lang::dateTimeFormat($ds['paid_date'])}{/if}</td>
|
<td class="text-success">{if $ds['status']!=1}{Lang::dateTimeFormat($ds['paid_date'])}{/if}</td>
|
||||||
<td>{if $ds['status']==1}{Lang::T('UNPAID')}
|
<td>{if $ds['status']==1}{Lang::T('UNPAID')}
|
||||||
{elseif $ds['status']==2}{Lang::T('PAID')}
|
{elseif $ds['status']==2}{Lang::T('PAID')}
|
||||||
{elseif $ds['status']==3}{$_L['FAILED']}
|
{elseif $ds['status']==3}{$_L['FAILED']}
|
||||||
{elseif $ds['status']==4}{Lang::T('CANCELED')}
|
{elseif $ds['status']==4}{Lang::T('CANCELED')}
|
||||||
{elseif $ds['status']==5}{Lang::T('UNKNOWN')}
|
{elseif $ds['status']==5}{Lang::T('UNKNOWN')}
|
||||||
{/if}</td>
|
{/if}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</tbody>
|
</tbody>
|
||||||
{/if}
|
{/if}
|
||||||
</table>
|
</table>
|
||||||
</div>
|
</div>
|
||||||
|
@ -55,7 +55,7 @@
|
|||||||
</ul>
|
</ul>
|
||||||
<center><b>{Lang::T('Total')}</b></center>
|
<center><b>{Lang::T('Total')}</b></center>
|
||||||
<ul class="list-group list-group-unbordered">
|
<ul class="list-group list-group-unbordered">
|
||||||
{if $add_rem != 0 and $using neq 'zero' and $add_cost>0}
|
{if $using neq 'zero' and $add_cost>0}
|
||||||
{foreach $bills as $k => $v}
|
{foreach $bills as $k => $v}
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<b>{$k}</b> <span class="pull-right">{Lang::moneyFormat($v)}</span>
|
<b>{$k}</b> <span class="pull-right">{Lang::moneyFormat($v)}</span>
|
||||||
@ -65,11 +65,6 @@
|
|||||||
<b>{Lang::T('Additional Cost')}</b> <span
|
<b>{Lang::T('Additional Cost')}</b> <span
|
||||||
class="pull-right">{Lang::moneyFormat($add_cost)}</span>
|
class="pull-right">{Lang::moneyFormat($add_cost)}</span>
|
||||||
</li>
|
</li>
|
||||||
{if $add_rem != ''}
|
|
||||||
<li class="list-group-item">
|
|
||||||
<b>{Lang::T('Remaining')}</b> <span class="pull-right">{$add_rem}</span>
|
|
||||||
</li>
|
|
||||||
{/if}
|
|
||||||
<li class="list-group-item">
|
<li class="list-group-item">
|
||||||
<b>{Lang::T('Total')}</b> <small>({Lang::T('Plan Price')} +{Lang::T('Additional Cost')})</small><span class="pull-right"
|
<b>{Lang::T('Total')}</b> <small>({Lang::T('Plan Price')} +{Lang::T('Additional Cost')})</small><span class="pull-right"
|
||||||
style="font-size: large; font-weight:bolder; font-family: 'Courier New', Courier, monospace; ">{Lang::moneyFormat($plan['price']+$add_cost)}</span>
|
style="font-size: large; font-weight:bolder; font-family: 'Courier New', Courier, monospace; ">{Lang::moneyFormat($plan['price']+$add_cost)}</span>
|
||||||
|
@ -54,17 +54,18 @@
|
|||||||
<li>Make sure your hosting not blocking port to external</li>
|
<li>Make sure your hosting not blocking port to external</li>
|
||||||
<li>Make sure your Mikrotik accessible from PHPNuxBill</li>
|
<li>Make sure your Mikrotik accessible from PHPNuxBill</li>
|
||||||
</ul>
|
</ul>
|
||||||
|
If you just update PHPNuxBill from upload files, try click Update Database
|
||||||
</div>
|
</div>
|
||||||
<div class="box-footer">
|
<div class="box-footer">
|
||||||
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
||||||
<a href="./update.php?step=4" class="btn btn-info btn-sm btn-block">Update Database</a>
|
<a href="./update.php?step=4" style="color: black;" class="btn btn-info btn-sm btn-block">Update Database</a>
|
||||||
<a href="{$_url}community#update" class="btn btn-success btn-sm btn-block">Update
|
<a href="{$_url}community#update" style="color: black;" class="btn btn-success btn-sm btn-block">Update
|
||||||
PHPNuxBill</a>
|
PHPNuxBill</a>
|
||||||
</div>
|
</div>
|
||||||
<br>
|
<br>
|
||||||
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
<div class="btn-group btn-group-justified" role="group" aria-label="...">
|
||||||
<a href="https://github.com/hotspotbilling/phpnuxbill/discussions" target="_blank"
|
<a href="https://github.com/hotspotbilling/phpnuxbill/discussions" target="_blank"
|
||||||
class="btn btn-success btn-sm btn-block">Ask Github Community</a>
|
class="btn btn-success btn-sm btn-block" style="color: black;">Ask Github Community</a>
|
||||||
<a href="https://t.me/phpnuxbill" target="_blank"
|
<a href="https://t.me/phpnuxbill" target="_blank"
|
||||||
class="btn btn-primary btn-sm btn-block">Ask Telegram Community</a>
|
class="btn btn-primary btn-sm btn-block">Ask Telegram Community</a>
|
||||||
</div>
|
</div>
|
||||||
|
@ -113,8 +113,8 @@
|
|||||||
<li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li>
|
<li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li>
|
||||||
<li>{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}</li>
|
<li>{if $_c['pppoe_plan']==''}PPPOE Plan{else}{$_c['pppoe_plan']}{/if}</li>
|
||||||
</ol>
|
</ol>
|
||||||
<div class="row">
|
{if Lang::arrayCount($radius_pppoe)>0}
|
||||||
{if Lang::arrayCount($radius_pppoe)>0}
|
<div class="row">
|
||||||
{foreach $radius_pppoe as $plan}
|
{foreach $radius_pppoe as $plan}
|
||||||
<div class="col col-md-4">
|
<div class="col col-md-4">
|
||||||
<div class="box box-primary">
|
<div class="box box-primary">
|
||||||
@ -157,13 +157,14 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{/if}
|
</div>
|
||||||
|
{/if}
|
||||||
{if Lang::arrayCount($radius_hotspot)>0}
|
{if Lang::arrayCount($radius_hotspot)>0}
|
||||||
<ol class="breadcrumb">
|
<ol class="breadcrumb">
|
||||||
<li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li>
|
<li>{if $_c['radius_plan']==''}Radius Plan{else}{$_c['radius_plan']}{/if}</li>
|
||||||
<li>{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}</li>
|
<li>{if $_c['hotspot_plan']==''}Hotspot Plan{else}{$_c['hotspot_plan']}{/if}</li>
|
||||||
</ol>
|
</ol>
|
||||||
|
<div class="row">
|
||||||
{foreach $radius_hotspot as $plan}
|
{foreach $radius_hotspot as $plan}
|
||||||
<div class="col col-md-4">
|
<div class="col col-md-4">
|
||||||
<div class="box box-primary">
|
<div class="box box-primary">
|
||||||
@ -206,8 +207,8 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
{/if}
|
</div>
|
||||||
</div>
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
{/if}
|
{/if}
|
||||||
{foreach $routers as $router}
|
{foreach $routers as $router}
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
<div
|
<div
|
||||||
class="panel mb20 {if $trx['status']==1}panel-warning{elseif $trx['status']==2}panel-success{elseif $trx['status']==3}panel-danger{elseif $trx['status']==4}panel-danger{else}panel-primary{/if} panel-hovered">
|
class="panel mb20 {if $trx['status']==1}panel-warning{elseif $trx['status']==2}panel-success{elseif $trx['status']==3}panel-danger{elseif $trx['status']==4}panel-danger{else}panel-primary{/if} panel-hovered">
|
||||||
<div class="panel-footer">Transaction #{$trx['id']}</div>
|
<div class="panel-footer">Transaction #{$trx['id']}</div>
|
||||||
{if $trx['routers']!='balance'}
|
{if !in_array($trx['routers'],['balance','radius'])}
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<div class="panel panel-primary panel-hovered">
|
<div class="panel panel-primary panel-hovered">
|
||||||
<div class="panel-heading">{$router['name']}</div>
|
<div class="panel-heading">{$router['name']}</div>
|
||||||
@ -30,8 +30,8 @@
|
|||||||
{date('H:i', strtotime($trx['paid_date']))} </td>
|
{date('H:i', strtotime($trx['paid_date']))} </td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
{if $trx['plan_name'] == 'Receive Balance'}
|
{if $trx['plan_name'] == 'Receive Balance'}
|
||||||
<td>{Lang::T('From')}</td>
|
<td>{Lang::T('From')}</td>
|
||||||
{else}
|
{else}
|
||||||
<td>{Lang::T('To')}</td>
|
<td>{Lang::T('To')}</td>
|
||||||
{/if}
|
{/if}
|
||||||
@ -67,9 +67,21 @@
|
|||||||
<td>{Lang::T('Plan Name')}</td>
|
<td>{Lang::T('Plan Name')}</td>
|
||||||
<td>{$plan['name_plan']}</td>
|
<td>{$plan['name_plan']}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{if $add_cost>0}
|
||||||
|
{foreach $bills as $k => $v}
|
||||||
|
<tr>
|
||||||
|
<td>{$k}</td>
|
||||||
|
<td>{Lang::moneyFormat($v)}</td>
|
||||||
|
</tr>
|
||||||
|
{/foreach}
|
||||||
|
<tr>
|
||||||
|
<td>{Lang::T('Additional Cost')}</td>
|
||||||
|
<td>{Lang::moneyFormat($add_cost)}</td>
|
||||||
|
</tr>
|
||||||
|
{/if}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{Lang::T('Plan Price')}</td>
|
<td>{Lang::T('Plan Price')}{if $add_cost>0}<small> + {Lang::T('Additional Cost')}{/if}</small></td>
|
||||||
<td>{Lang::moneyFormat($plan['price'])}</td>
|
<td style="font-size: large; font-weight:bolder; font-family: 'Courier New', Courier, monospace; ">{Lang::moneyFormat($trx['price'])}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>{Lang::T('Type')}</td>
|
<td>{Lang::T('Type')}</td>
|
||||||
|
@ -12,9 +12,21 @@
|
|||||||
<td>{Lang::T('Type')}</td>
|
<td>{Lang::T('Type')}</td>
|
||||||
<td>{$plan['type']}</td>
|
<td>{$plan['type']}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{if $add_cost>0}
|
||||||
|
{foreach $bills as $k => $v}
|
||||||
|
<tr>
|
||||||
|
<td>{$k}</td>
|
||||||
|
<td>{Lang::moneyFormat($v)}</td>
|
||||||
|
</tr>
|
||||||
|
{/foreach}
|
||||||
|
<tr>
|
||||||
|
<td>{Lang::T('Additional Cost')}</td>
|
||||||
|
<td>{Lang::moneyFormat($add_cost)}</td>
|
||||||
|
</tr>
|
||||||
|
{/if}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{Lang::T('Price')}</td>
|
<td>{Lang::T('Price')}{if $add_cost>0}<small> + {Lang::T('Additional Cost')}{/if}</td>
|
||||||
<td>{Lang::moneyFormat($plan['price'])}</td>
|
<td style="font-size: large; font-weight:bolder; font-family: 'Courier New', Courier, monospace; ">{Lang::moneyFormat($plan['price'])}</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>{Lang::T('Validity')}</td>
|
<td>{Lang::T('Validity')}</td>
|
||||||
@ -35,6 +47,7 @@
|
|||||||
value="plan"><i class="glyphicon glyphicon-send"></i></button>
|
value="plan"><i class="glyphicon glyphicon-send"></i></button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<p class="help-block text-center">{Lang::T('If your friend have Additional Cost, you will pay for that too')}</p>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
{
|
{
|
||||||
"version": "2024.3.14"
|
"version": "2024.3.15"
|
||||||
}
|
}
|
Reference in New Issue
Block a user