commit
5af514244c
@ -34,8 +34,8 @@ 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();
|
||||||
|
|
||||||
if($c['status'] != 'Active'){
|
if ($c['status'] != 'Active') {
|
||||||
_alert(Lang::T('This account status').' : '.Lang::T($c['status']),'danger', "");
|
_alert(Lang::T('This account status') . ' : ' . Lang::T($c['status']), 'danger', "");
|
||||||
}
|
}
|
||||||
|
|
||||||
$add_cost = 0;
|
$add_cost = 0;
|
||||||
@ -197,28 +197,29 @@ class Package
|
|||||||
if ($plan_id != $b['plan_id']) {
|
if ($plan_id != $b['plan_id']) {
|
||||||
$isChangePlan = true;
|
$isChangePlan = true;
|
||||||
}
|
}
|
||||||
if ($b['namebp'] == $p['name_plan'] && $b['status'] == 'on') {
|
if ($config['extend_expiry'] === 'yes') {
|
||||||
// if it same internet plan, expired will extend
|
if ($b['namebp'] == $p['name_plan'] && $b['status'] == 'on') {
|
||||||
if ($p['validity_unit'] == 'Months') {
|
// if it same internet plan, expired will extend
|
||||||
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
|
if ($p['validity_unit'] == 'Months') {
|
||||||
$time = $b['time'];
|
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
|
||||||
} else if ($p['validity_unit'] == 'Period') {
|
$time = $b['time'];
|
||||||
$date_exp = date("Y-m-$day_exp", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
|
} else if ($p['validity_unit'] == 'Period') {
|
||||||
$time = date("23:59:00");
|
$date_exp = date("Y-m-$day_exp", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
|
||||||
} else if ($p['validity_unit'] == 'Days') {
|
$time = date("23:59:00");
|
||||||
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days'));
|
} else if ($p['validity_unit'] == 'Days') {
|
||||||
$time = $b['time'];
|
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days'));
|
||||||
} else if ($p['validity_unit'] == 'Hrs') {
|
$time = $b['time'];
|
||||||
$datetime = explode(' ', date("Y-m-d H:i:s", strtotime($b['expiration'] . ' ' . $b['time'] . ' +' . $p['validity'] . ' hours')));
|
} else if ($p['validity_unit'] == 'Hrs') {
|
||||||
$date_exp = $datetime[0];
|
$datetime = explode(' ', date("Y-m-d H:i:s", strtotime($b['expiration'] . ' ' . $b['time'] . ' +' . $p['validity'] . ' hours')));
|
||||||
$time = $datetime[1];
|
$date_exp = $datetime[0];
|
||||||
} else if ($p['validity_unit'] == 'Mins') {
|
$time = $datetime[1];
|
||||||
$datetime = explode(' ', date("Y-m-d H:i:s", strtotime($b['expiration'] . ' ' . $b['time'] . ' +' . $p['validity'] . ' minutes')));
|
} else if ($p['validity_unit'] == 'Mins') {
|
||||||
$date_exp = $datetime[0];
|
$datetime = explode(' ', date("Y-m-d H:i:s", strtotime($b['expiration'] . ' ' . $b['time'] . ' +' . $p['validity'] . ' minutes')));
|
||||||
$time = $datetime[1];
|
$date_exp = $datetime[0];
|
||||||
|
$time = $datetime[1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($isChangePlan || $b['status'] == 'off') {
|
if ($isChangePlan || $b['status'] == 'off') {
|
||||||
if ($p['is_radius']) {
|
if ($p['is_radius']) {
|
||||||
Radius::customerAddPlan($c, $p, "$date_exp $time");
|
Radius::customerAddPlan($c, $p, "$date_exp $time");
|
||||||
@ -398,25 +399,27 @@ class Package
|
|||||||
if ($plan_id != $b['plan_id']) {
|
if ($plan_id != $b['plan_id']) {
|
||||||
$isChangePlan = true;
|
$isChangePlan = true;
|
||||||
}
|
}
|
||||||
if ($b['namebp'] == $p['name_plan'] && $b['status'] == 'on') {
|
if ($config['extend_expiry'] === 'yes') {
|
||||||
// if it same internet plan, expired will extend
|
if ($b['namebp'] == $p['name_plan'] && $b['status'] == 'on') {
|
||||||
if ($p['validity_unit'] == 'Months') {
|
// if it same internet plan, expired will extend
|
||||||
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
|
if ($p['validity_unit'] == 'Months') {
|
||||||
$time = $b['time'];
|
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
|
||||||
} else if ($p['validity_unit'] == 'Period') {
|
$time = $b['time'];
|
||||||
$date_exp = date("Y-m-$day_exp", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
|
} else if ($p['validity_unit'] == 'Period') {
|
||||||
$time = date("23:59:00");
|
$date_exp = date("Y-m-$day_exp", strtotime($b['expiration'] . ' +' . $p['validity'] . ' months'));
|
||||||
} else if ($p['validity_unit'] == 'Days') {
|
$time = date("23:59:00");
|
||||||
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days'));
|
} else if ($p['validity_unit'] == 'Days') {
|
||||||
$time = $b['time'];
|
$date_exp = date("Y-m-d", strtotime($b['expiration'] . ' +' . $p['validity'] . ' days'));
|
||||||
} else if ($p['validity_unit'] == 'Hrs') {
|
$time = $b['time'];
|
||||||
$datetime = explode(' ', date("Y-m-d H:i:s", strtotime($b['expiration'] . ' ' . $b['time'] . ' +' . $p['validity'] . ' hours')));
|
} else if ($p['validity_unit'] == 'Hrs') {
|
||||||
$date_exp = $datetime[0];
|
$datetime = explode(' ', date("Y-m-d H:i:s", strtotime($b['expiration'] . ' ' . $b['time'] . ' +' . $p['validity'] . ' hours')));
|
||||||
$time = $datetime[1];
|
$date_exp = $datetime[0];
|
||||||
} else if ($p['validity_unit'] == 'Mins') {
|
$time = $datetime[1];
|
||||||
$datetime = explode(' ', date("Y-m-d H:i:s", strtotime($b['expiration'] . ' ' . $b['time'] . ' +' . $p['validity'] . ' minutes')));
|
} else if ($p['validity_unit'] == 'Mins') {
|
||||||
$date_exp = $datetime[0];
|
$datetime = explode(' ', date("Y-m-d H:i:s", strtotime($b['expiration'] . ' ' . $b['time'] . ' +' . $p['validity'] . ' minutes')));
|
||||||
$time = $datetime[1];
|
$date_exp = $datetime[0];
|
||||||
|
$time = $datetime[1];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -804,4 +807,11 @@ class Package
|
|||||||
$ui->assign('whatsapp', urlencode("```$invoice```"));
|
$ui->assign('whatsapp', urlencode("```$invoice```"));
|
||||||
$ui->assign('in', $in);
|
$ui->assign('in', $in);
|
||||||
}
|
}
|
||||||
|
public static function tax($price, $tax_rate = 1)
|
||||||
|
{
|
||||||
|
// Convert tax rate to decimal
|
||||||
|
$tax_rate_decimal = $tax_rate / 100;
|
||||||
|
$tax = $price * $tax_rate_decimal;
|
||||||
|
return $tax;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
@ -131,7 +131,7 @@ switch ($action) {
|
|||||||
$router = Mikrotik::info($trx['routers']);
|
$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']);
|
||||||
$invoice = ORM::for_table('tbl_transactions')->where("invoice",$trx['trx_invoice'])->find_one();
|
$invoice = ORM::for_table('tbl_transactions')->where("invoice", $trx['trx_invoice'])->find_one();
|
||||||
$ui->assign('invoice', $invoice);
|
$ui->assign('invoice', $invoice);
|
||||||
$ui->assign('trx', $trx);
|
$ui->assign('trx', $trx);
|
||||||
$ui->assign('router', $router);
|
$ui->assign('router', $router);
|
||||||
@ -148,9 +148,6 @@ switch ($action) {
|
|||||||
r2(U . "voucher/invoice/");
|
r2(U . "voucher/invoice/");
|
||||||
die();
|
die();
|
||||||
}
|
}
|
||||||
if($user['status'] != 'Active'){
|
|
||||||
_alert(Lang::T('This account status').' : '.Lang::T($user['status']),'danger', "");
|
|
||||||
}
|
|
||||||
$plan = ORM::for_table('tbl_plans')->where('enabled', '1')->find_one($routes['3']);
|
$plan = ORM::for_table('tbl_plans')->where('enabled', '1')->find_one($routes['3']);
|
||||||
if (empty($plan)) {
|
if (empty($plan)) {
|
||||||
r2(U . "order/package", 'e', Lang::T("Plan Not found"));
|
r2(U . "order/package", 'e', Lang::T("Plan Not found"));
|
||||||
@ -163,30 +160,48 @@ switch ($action) {
|
|||||||
} else {
|
} else {
|
||||||
$router_name = $plan['routers'];
|
$router_name = $plan['routers'];
|
||||||
}
|
}
|
||||||
|
|
||||||
list($bills, $add_cost) = User::getBills($id_customer);
|
list($bills, $add_cost) = User::getBills($id_customer);
|
||||||
if ($plan && $plan['enabled'] && $user['balance'] >= $plan['price']) {
|
|
||||||
|
// Tax calculation start
|
||||||
|
$tax_enable = isset($config['enable_tax']) ? $config['enable_tax'] : 'no';
|
||||||
|
$tax_rate_setting = isset($config['tax_rate']) ? $config['tax_rate'] : null;
|
||||||
|
$custom_tax_rate = isset($config['custom_tax_rate']) ? (float)$config['custom_tax_rate'] : null;
|
||||||
|
|
||||||
|
if ($tax_rate_setting === 'custom') {
|
||||||
|
$tax_rate = $custom_tax_rate;
|
||||||
|
} else {
|
||||||
|
$tax_rate = $tax_rate_setting;
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($tax_enable === 'yes') {
|
||||||
|
$tax = Package::tax($plan['price'], $tax_rate);
|
||||||
|
} else {
|
||||||
|
$tax = 0;
|
||||||
|
}
|
||||||
|
// Tax calculation stop
|
||||||
|
|
||||||
|
if ($plan && $plan['enabled'] && $user['balance'] >= $plan['price'] + $tax) {
|
||||||
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'] + $add_cost);
|
Balance::min($user['id'], $plan['price'] + $add_cost + $tax);
|
||||||
App::setToken($_GET['stoken'], "success");
|
App::setToken($_GET['stoken'], "success");
|
||||||
r2(U . "voucher/invoice/", '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'] .
|
||||||
"\nRouter: " . $router_name .
|
"\nRouter: " . $router_name .
|
||||||
"\nPrice: " . $p['price']);
|
"\nPrice: " . $plan['price'] + $tax);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
r2(U . "home", 'e', 'Plan is not exists');
|
r2(U . "home", 'e', 'Plan is not exists');
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'send':
|
case 'send':
|
||||||
if ($config['enable_balance'] != 'yes') {
|
if ($config['enable_balance'] != 'yes') {
|
||||||
r2(U . "order/package", 'e', Lang::T("Balance not enabled"));
|
r2(U . "order/package", 'e', Lang::T("Balance not enabled"));
|
||||||
}
|
}
|
||||||
if($user['status'] != 'Active'){
|
|
||||||
_alert(Lang::T('This account status').' : '.Lang::T($user['status']),'danger', "");
|
|
||||||
}
|
|
||||||
$ui->assign('_title', Lang::T('Buy for friend'));
|
$ui->assign('_title', Lang::T('Buy for friend'));
|
||||||
$ui->assign('_system_menu', 'package');
|
$ui->assign('_system_menu', 'package');
|
||||||
$plan = ORM::for_table('tbl_plans')->find_one($routes['3']);
|
$plan = ORM::for_table('tbl_plans')->find_one($routes['3']);
|
||||||
@ -201,6 +216,27 @@ switch ($action) {
|
|||||||
} else {
|
} else {
|
||||||
$router_name = $plan['routers'];
|
$router_name = $plan['routers'];
|
||||||
}
|
}
|
||||||
|
$tax_rate_setting = isset($config['tax_rate']) ? $config['tax_rate'] : null;
|
||||||
|
$custom_tax_rate = isset($config['custom_tax_rate']) ? (float)$config['custom_tax_rate'] : null;
|
||||||
|
|
||||||
|
if ($tax_rate_setting === 'custom') {
|
||||||
|
$tax_rate = $custom_tax_rate;
|
||||||
|
} else {
|
||||||
|
$tax_rate = $tax_rate_setting;
|
||||||
|
}
|
||||||
|
|
||||||
|
$tax_enable = isset($config['enable_tax']) ? $config['enable_tax'] : 'no';
|
||||||
|
|
||||||
|
if ($tax_enable === 'yes') {
|
||||||
|
$tax = Package::tax($plan['price'], $tax_rate);
|
||||||
|
$ui->assign('tax', $tax);
|
||||||
|
} else {
|
||||||
|
$tax = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Add tax to plan price
|
||||||
|
$plan['price'] += $tax;
|
||||||
|
|
||||||
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']);
|
list($bills, $add_cost) = User::getBills($target['id']);
|
||||||
@ -209,6 +245,7 @@ switch ($action) {
|
|||||||
$ui->assign('add_cost', $add_cost);
|
$ui->assign('add_cost', $add_cost);
|
||||||
$plan['price'] += $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'));
|
||||||
}
|
}
|
||||||
@ -269,15 +306,22 @@ switch ($action) {
|
|||||||
$d->save();
|
$d->save();
|
||||||
r2(U . "order/view/$trx_id", 's', Lang::T("Success to send package"));
|
r2(U . "order/view/$trx_id", 's', Lang::T("Success to send package"));
|
||||||
} else {
|
} else {
|
||||||
r2(U . "order/package", 'e', Lang::T("Failed to Send package"));
|
$errorMessage = "Send Package with Balance Failed\n\n#u$user[username] #send \n" . $plan['name_plan'] .
|
||||||
Message::sendTelegram("Send Package with Balance Failed\n\n#u$user[username] #send \n" . $plan['name_plan'] .
|
|
||||||
"\nRouter: " . $router_name .
|
"\nRouter: " . $router_name .
|
||||||
"\nPrice: " . $plan['price']);
|
"\nPrice: " . $plan['price'];
|
||||||
|
|
||||||
|
if ($tax_enable === 'yes') {
|
||||||
|
$errorMessage .= "\nTax: " . $tax;
|
||||||
|
}
|
||||||
|
|
||||||
|
r2(U . "order/package", 'e', Lang::T("Failed to Send package"));
|
||||||
|
Message::sendTelegram($errorMessage);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
$ui->assign('username', $_GET['u']);
|
$ui->assign('username', $_GET['u']);
|
||||||
$ui->assign('router', $router_name);
|
$ui->assign('router', $router_name);
|
||||||
$ui->assign('plan', $plan);
|
$ui->assign('plan', $plan);
|
||||||
|
$ui->assign('tax', $tax);
|
||||||
$ui->display('user-sendPlan.tpl');
|
$ui->display('user-sendPlan.tpl');
|
||||||
break;
|
break;
|
||||||
case 'gateway':
|
case 'gateway':
|
||||||
@ -286,6 +330,16 @@ switch ($action) {
|
|||||||
if (strpos($user['email'], '@') === false) {
|
if (strpos($user['email'], '@') === false) {
|
||||||
r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address"));
|
r2(U . 'accounts/profile', 'e', Lang::T("Please enter your email address"));
|
||||||
}
|
}
|
||||||
|
$tax_enable = isset($config['enable_tax']) ? $config['enable_tax'] : 'no';
|
||||||
|
$tax_rate_setting = isset($config['tax_rate']) ? $config['tax_rate'] : null;
|
||||||
|
$custom_tax_rate = isset($config['custom_tax_rate']) ? (float)$config['custom_tax_rate'] : null;
|
||||||
|
if ($tax_rate_setting === 'custom') {
|
||||||
|
$tax_rate = $custom_tax_rate;
|
||||||
|
} else {
|
||||||
|
$tax_rate = $tax_rate_setting;
|
||||||
|
}
|
||||||
|
$plan = ORM::for_table('tbl_plans')->find_one($routes['3']);
|
||||||
|
$tax = Package::tax($plan['price'], $tax_rate);
|
||||||
$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");
|
||||||
@ -294,11 +348,12 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
if (count($pgs) > 1) {
|
if (count($pgs) > 1) {
|
||||||
$ui->assign('pgs', $pgs);
|
$ui->assign('pgs', $pgs);
|
||||||
//$ui->assign('pgs', $pgs);
|
if ($tax_enable === 'yes') {
|
||||||
|
$ui->assign('tax', $tax);
|
||||||
|
}
|
||||||
$ui->assign('route2', $routes[2]);
|
$ui->assign('route2', $routes[2]);
|
||||||
$ui->assign('route3', $routes[3]);
|
$ui->assign('route3', $routes[3]);
|
||||||
|
$ui->assign('plan', $plan);
|
||||||
//$ui->assign('plan', $plan);
|
|
||||||
$ui->display('user-selectGateway.tpl');
|
$ui->display('user-selectGateway.tpl');
|
||||||
break;
|
break;
|
||||||
} else {
|
} else {
|
||||||
@ -317,9 +372,6 @@ switch ($action) {
|
|||||||
} else if (!empty($gateway)) {
|
} else if (!empty($gateway)) {
|
||||||
$_SESSION['gateway'] = $gateway;
|
$_SESSION['gateway'] = $gateway;
|
||||||
}
|
}
|
||||||
if($user['status'] != 'Active'){
|
|
||||||
_alert(Lang::T('This account status').' : '.Lang::T($user['status']),'danger', "");
|
|
||||||
}
|
|
||||||
if (empty($gateway)) {
|
if (empty($gateway)) {
|
||||||
r2(U . 'order/gateway/' . $routes[2] . '/' . $routes[3], 'w', Lang::T("Please select Payment Gateway"));
|
r2(U . 'order/gateway/' . $routes[2] . '/' . $routes[3], 'w', Lang::T("Please select Payment Gateway"));
|
||||||
}
|
}
|
||||||
@ -357,9 +409,23 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
$add_cost = 0;
|
$add_cost = 0;
|
||||||
|
$tax = 0;
|
||||||
if ($router['name'] != 'balance') {
|
if ($router['name'] != 'balance') {
|
||||||
list($bills, $add_cost) = User::getBills($id_customer);
|
list($bills, $add_cost) = User::getBills($id_customer);
|
||||||
}
|
}
|
||||||
|
// Tax calculation start
|
||||||
|
$tax_enable = isset($config['enable_tax']) ? $config['enable_tax'] : 'no';
|
||||||
|
$tax_rate_setting = isset($config['tax_rate']) ? $config['tax_rate'] : null;
|
||||||
|
$custom_tax_rate = isset($config['custom_tax_rate']) ? (float)$config['custom_tax_rate'] : null;
|
||||||
|
if ($tax_rate_setting === 'custom') {
|
||||||
|
$tax_rate = $custom_tax_rate;
|
||||||
|
} else {
|
||||||
|
$tax_rate = $tax_rate_setting;
|
||||||
|
}
|
||||||
|
if ($tax_enable === 'yes') {
|
||||||
|
$tax = Package::tax($plan['price'], $tax_rate);
|
||||||
|
}
|
||||||
|
// Tax calculation stop
|
||||||
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'];
|
||||||
@ -372,12 +438,12 @@ switch ($action) {
|
|||||||
// Postpaid price from field
|
// Postpaid price from field
|
||||||
$add_inv = User::getAttribute("Invoice", $id_customer);
|
$add_inv = User::getAttribute("Invoice", $id_customer);
|
||||||
if (empty($add_inv) or $add_inv == 0) {
|
if (empty($add_inv) or $add_inv == 0) {
|
||||||
$d->price = ($plan['price'] + $add_cost);
|
$d->price = ($plan['price'] + $add_cost + $tax);
|
||||||
} else {
|
} else {
|
||||||
$d->price = ($add_inv + $add_cost);
|
$d->price = ($add_inv + $add_cost + $tax);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$d->price = ($plan['price'] + $add_cost);
|
$d->price = ($plan['price'] + $add_cost + $tax);
|
||||||
}
|
}
|
||||||
//$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');
|
||||||
@ -395,12 +461,12 @@ switch ($action) {
|
|||||||
// Postpaid price from field
|
// Postpaid price from field
|
||||||
$add_inv = User::getAttribute("Invoice", $id_customer);
|
$add_inv = User::getAttribute("Invoice", $id_customer);
|
||||||
if (empty($add_inv) or $add_inv == 0) {
|
if (empty($add_inv) or $add_inv == 0) {
|
||||||
$d->price = ($plan['price'] + $add_cost);
|
$d->price = ($plan['price'] + $add_cost + $tax);
|
||||||
} else {
|
} else {
|
||||||
$d->price = ($add_inv + $add_cost);
|
$d->price = ($add_inv + $add_cost + $tax);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$d->price = ($plan['price'] + $add_cost);
|
$d->price = ($plan['price'] + $add_cost + $tax);
|
||||||
}
|
}
|
||||||
//$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');
|
||||||
|
@ -244,37 +244,6 @@ switch ($action) {
|
|||||||
$rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown;
|
$rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown;
|
||||||
$radiusRate = $b['rate_up'] . $radup . '/' . $b['rate_down'] . $raddown . '/' . $b['burst'];
|
$radiusRate = $b['rate_up'] . $radup . '/' . $b['rate_down'] . $raddown . '/' . $b['burst'];
|
||||||
$rate = trim($rate . " " . $b['burst']);
|
$rate = trim($rate . " " . $b['burst']);
|
||||||
|
|
||||||
// Check if tax is enabled in config
|
|
||||||
$tax_enable = isset($config['enable_tax']) ? $config['enable_tax'] : 'no';
|
|
||||||
|
|
||||||
// Default tax rate
|
|
||||||
$default_tax_rate = 0.01; // Default tax rate 1%
|
|
||||||
|
|
||||||
// Check if tax rate is set to custom in config
|
|
||||||
$tax_rate_setting = isset($config['tax_rate']) ? $config['tax_rate'] : $default_tax_rate;
|
|
||||||
|
|
||||||
// Check if tax rate is custom
|
|
||||||
if ($tax_rate_setting === 'custom') {
|
|
||||||
// Check if custom tax rate is set in config
|
|
||||||
$custom_tax_rate = isset($config['custom_tax_rate']) ? (float)$config['custom_tax_rate'] : $default_tax_rate;
|
|
||||||
// Convert custom tax rate to decimal
|
|
||||||
$custom_tax_rate_decimal = $custom_tax_rate / 100;
|
|
||||||
$tax_rate = $custom_tax_rate_decimal;
|
|
||||||
} else {
|
|
||||||
// Use tax rate
|
|
||||||
$tax_rate = $tax_rate_setting;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Calculate the new price with tax if tax is enabled
|
|
||||||
if ($tax_enable === 'yes') {
|
|
||||||
$price_with_tax = $price + ($price * $tax_rate);
|
|
||||||
} else {
|
|
||||||
// If tax is not enabled, use the original price
|
|
||||||
$price_with_tax = $price;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Create new plan
|
// Create new plan
|
||||||
$d = ORM::for_table('tbl_plans')->create();
|
$d = ORM::for_table('tbl_plans')->create();
|
||||||
$d->name_plan = $name;
|
$d->name_plan = $name;
|
||||||
@ -391,37 +360,6 @@ switch ($action) {
|
|||||||
Mikrotik::setHotspotExpiredPlan($client, 'EXPIRED NUXBILL ' . $pool_expired, $pool_expired);
|
Mikrotik::setHotspotExpiredPlan($client, 'EXPIRED NUXBILL ' . $pool_expired, $pool_expired);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if tax is enabled in config
|
|
||||||
$tax_enable = isset($config['enable_tax']) ? $config['enable_tax'] : 'no';
|
|
||||||
|
|
||||||
// Default tax rate
|
|
||||||
$default_tax_rate = 0.01; // Default tax rate 1%
|
|
||||||
|
|
||||||
// Check if tax rate is set to custom in config
|
|
||||||
$tax_rate_setting = isset($config['tax_rate']) ? $config['tax_rate'] : $default_tax_rate;
|
|
||||||
|
|
||||||
// Check if tax rate is custom
|
|
||||||
if ($tax_rate_setting === 'custom') {
|
|
||||||
// Check if custom tax rate is set in config
|
|
||||||
$custom_tax_rate = isset($config['custom_tax_rate']) ? (float)$config['custom_tax_rate'] : $default_tax_rate;
|
|
||||||
// Convert custom tax rate to decimal
|
|
||||||
$custom_tax_rate_decimal = $custom_tax_rate / 100;
|
|
||||||
$tax_rate = $custom_tax_rate_decimal;
|
|
||||||
} else {
|
|
||||||
// Use tax rate
|
|
||||||
$tax_rate = $tax_rate_setting;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Calculate the new price with tax if tax is enabled
|
|
||||||
if ($tax_enable === 'yes') {
|
|
||||||
$price_with_tax = $price + ($price * $tax_rate);
|
|
||||||
} else {
|
|
||||||
// If tax is not enabled, use the original price
|
|
||||||
$price_with_tax = $price;
|
|
||||||
}
|
|
||||||
|
|
||||||
$d->name_plan = $name;
|
$d->name_plan = $name;
|
||||||
$d->id_bw = $id_bw;
|
$d->id_bw = $id_bw;
|
||||||
$d->price = $price_with_tax; // Set price with or without tax based on configuration
|
$d->price = $price_with_tax; // Set price with or without tax based on configuration
|
||||||
@ -578,38 +516,6 @@ switch ($action) {
|
|||||||
$rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown;
|
$rate = $b['rate_up'] . $unitup . "/" . $b['rate_down'] . $unitdown;
|
||||||
$radiusRate = $b['rate_up'] . $radup . '/' . $b['rate_down'] . $raddown . '/' . $b['burst'];
|
$radiusRate = $b['rate_up'] . $radup . '/' . $b['rate_down'] . $raddown . '/' . $b['burst'];
|
||||||
$rate = trim($rate . " " . $b['burst']);
|
$rate = trim($rate . " " . $b['burst']);
|
||||||
|
|
||||||
// Check if tax is enabled in config
|
|
||||||
$tax_enable = isset($config['enable_tax']) ? $config['enable_tax'] : 'no';
|
|
||||||
|
|
||||||
// Default tax rate
|
|
||||||
$default_tax_rate = 0.01; // Default tax rate 1%
|
|
||||||
|
|
||||||
// Check if tax rate is set to custom in config
|
|
||||||
$tax_rate_setting = isset($config['tax_rate']) ? $config['tax_rate'] : $default_tax_rate;
|
|
||||||
|
|
||||||
// Check if tax rate is custom
|
|
||||||
if ($tax_rate_setting === 'custom') {
|
|
||||||
// Check if custom tax rate is set in config
|
|
||||||
$custom_tax_rate = isset($config['custom_tax_rate']) ? (float)$config['custom_tax_rate'] : $default_tax_rate;
|
|
||||||
// Convert custom tax rate to decimal
|
|
||||||
$custom_tax_rate_decimal = $custom_tax_rate / 100;
|
|
||||||
$tax_rate = $custom_tax_rate_decimal;
|
|
||||||
} else {
|
|
||||||
// Use tax rate
|
|
||||||
$tax_rate = $tax_rate_setting;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Calculate the new price with tax if tax is enabled
|
|
||||||
if ($tax_enable === 'yes') {
|
|
||||||
$price_with_tax = $price + ($price * $tax_rate);
|
|
||||||
} else {
|
|
||||||
// If tax is not enabled, use the original price
|
|
||||||
$price_with_tax = $price;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$d = ORM::for_table('tbl_plans')->create();
|
$d = ORM::for_table('tbl_plans')->create();
|
||||||
$d->type = 'PPPOE';
|
$d->type = 'PPPOE';
|
||||||
$d->name_plan = $name;
|
$d->name_plan = $name;
|
||||||
@ -712,37 +618,6 @@ switch ($action) {
|
|||||||
Mikrotik::setPpoePlan($client, 'EXPIRED NUXBILL ' . $pool_expired, $pool_expired, '512K/512K');
|
Mikrotik::setPpoePlan($client, 'EXPIRED NUXBILL ' . $pool_expired, $pool_expired, '512K/512K');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check if tax is enabled in config
|
|
||||||
$tax_enable = isset($config['enable_tax']) ? $config['enable_tax'] : 'no';
|
|
||||||
|
|
||||||
// Default tax rate
|
|
||||||
$default_tax_rate = 0.01; // Default tax rate 1%
|
|
||||||
|
|
||||||
// Check if tax rate is set to custom in config
|
|
||||||
$tax_rate_setting = isset($config['tax_rate']) ? $config['tax_rate'] : $default_tax_rate;
|
|
||||||
|
|
||||||
// Check if tax rate is custom
|
|
||||||
if ($tax_rate_setting === 'custom') {
|
|
||||||
// Check if custom tax rate is set in config
|
|
||||||
$custom_tax_rate = isset($config['custom_tax_rate']) ? (float)$config['custom_tax_rate'] : $default_tax_rate;
|
|
||||||
// Convert custom tax rate to decimal
|
|
||||||
$custom_tax_rate_decimal = $custom_tax_rate / 100;
|
|
||||||
$tax_rate = $custom_tax_rate_decimal;
|
|
||||||
} else {
|
|
||||||
// Use tax rate
|
|
||||||
$tax_rate = $tax_rate_setting;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Calculate the new price with tax if tax is enabled
|
|
||||||
if ($tax_enable === 'yes') {
|
|
||||||
$price_with_tax = $price + ($price * $tax_rate);
|
|
||||||
} else {
|
|
||||||
// If tax is not enabled, use the original price
|
|
||||||
$price_with_tax = $price;
|
|
||||||
}
|
|
||||||
|
|
||||||
$d->name_plan = $name;
|
$d->name_plan = $name;
|
||||||
$d->id_bw = $id_bw;
|
$d->id_bw = $id_bw;
|
||||||
$d->price = $price_with_tax;
|
$d->price = $price_with_tax;
|
||||||
@ -822,35 +697,6 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
run_hook('edit_ppoe'); #HOOK
|
run_hook('edit_ppoe'); #HOOK
|
||||||
if ($msg == '') {
|
if ($msg == '') {
|
||||||
// Check if tax is enabled in config
|
|
||||||
$tax_enable = isset($config['enable_tax']) ? $config['enable_tax'] : 'no';
|
|
||||||
|
|
||||||
// Default tax rate
|
|
||||||
$default_tax_rate = 0.01; // Default tax rate 1%
|
|
||||||
|
|
||||||
// Check if tax rate is set to custom in config
|
|
||||||
$tax_rate_setting = isset($config['tax_rate']) ? $config['tax_rate'] : $default_tax_rate;
|
|
||||||
|
|
||||||
// Check if tax rate is custom
|
|
||||||
if ($tax_rate_setting === 'custom') {
|
|
||||||
// Check if custom tax rate is set in config
|
|
||||||
$custom_tax_rate = isset($config['custom_tax_rate']) ? (float)$config['custom_tax_rate'] : $default_tax_rate;
|
|
||||||
// Convert custom tax rate to decimal
|
|
||||||
$custom_tax_rate_decimal = $custom_tax_rate / 100;
|
|
||||||
$tax_rate = $custom_tax_rate_decimal;
|
|
||||||
} else {
|
|
||||||
// Use tax rate
|
|
||||||
$tax_rate = $tax_rate_setting;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Calculate the new price with tax if tax is enabled
|
|
||||||
if ($tax_enable === 'yes') {
|
|
||||||
$price_with_tax = $price + ($price * $tax_rate);
|
|
||||||
} else {
|
|
||||||
// If tax is not enabled, use the original price
|
|
||||||
$price_with_tax = $price;
|
|
||||||
}
|
|
||||||
$d->name_plan = $name;
|
$d->name_plan = $name;
|
||||||
$d->price = $price_with_tax;
|
$d->price = $price_with_tax;
|
||||||
$d->enabled = $enabled;
|
$d->enabled = $enabled;
|
||||||
@ -881,38 +727,6 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
run_hook('add_ppoe'); #HOOK
|
run_hook('add_ppoe'); #HOOK
|
||||||
if ($msg == '') {
|
if ($msg == '') {
|
||||||
|
|
||||||
// Check if tax is enabled in config
|
|
||||||
$tax_enable = isset($config['enable_tax']) ? $config['enable_tax'] : 'no';
|
|
||||||
|
|
||||||
// Default tax rate
|
|
||||||
$default_tax_rate = 0.01; // Default tax rate 1%
|
|
||||||
|
|
||||||
// Check if tax rate is set to custom in config
|
|
||||||
$tax_rate_setting = isset($config['tax_rate']) ? $config['tax_rate'] : $default_tax_rate;
|
|
||||||
|
|
||||||
// Check if tax rate is custom
|
|
||||||
if ($tax_rate_setting === 'custom') {
|
|
||||||
// Check if custom tax rate is set in config
|
|
||||||
$custom_tax_rate = isset($config['custom_tax_rate']) ? (float)$config['custom_tax_rate'] : $default_tax_rate;
|
|
||||||
// Convert custom tax rate to decimal
|
|
||||||
$custom_tax_rate_decimal = $custom_tax_rate / 100;
|
|
||||||
$tax_rate = $custom_tax_rate_decimal;
|
|
||||||
} else {
|
|
||||||
// Use tax rate
|
|
||||||
$tax_rate = $tax_rate_setting;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Calculate the new price with tax if tax is enabled
|
|
||||||
if ($tax_enable === 'yes') {
|
|
||||||
$price_with_tax = $price + ($price * $tax_rate);
|
|
||||||
} else {
|
|
||||||
// If tax is not enabled, use the original price
|
|
||||||
$price_with_tax = $price;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
$d = ORM::for_table('tbl_plans')->create();
|
$d = ORM::for_table('tbl_plans')->create();
|
||||||
$d->type = 'Balance';
|
$d->type = 'Balance';
|
||||||
$d->name_plan = $name;
|
$d->name_plan = $name;
|
||||||
|
@ -132,34 +132,6 @@ switch ($action) {
|
|||||||
$d->save();
|
$d->save();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Handle tax system separately
|
|
||||||
$enable_tax = isset($_POST['enable_tax']) ? $_POST['enable_tax'] : 'no';
|
|
||||||
$tax_rate = isset($_POST['tax_rate']) ? $_POST['tax_rate'] : '0.01'; // Default tax rate 1%
|
|
||||||
|
|
||||||
// Save or update tax system settings
|
|
||||||
$d_tax_enable = ORM::for_table('tbl_appconfig')->where('setting', 'enable_tax')->find_one();
|
|
||||||
if ($d_tax_enable) {
|
|
||||||
$d_tax_enable->value = $enable_tax;
|
|
||||||
$d_tax_enable->save();
|
|
||||||
} else {
|
|
||||||
$d_tax_enable = ORM::for_table('tbl_appconfig')->create();
|
|
||||||
$d_tax_enable->setting = 'enable_tax';
|
|
||||||
$d_tax_enable->value = $enable_tax;
|
|
||||||
$d_tax_enable->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
$d_tax_rate = ORM::for_table('tbl_appconfig')->where('setting', 'tax_rate')->find_one();
|
|
||||||
if ($d_tax_rate) {
|
|
||||||
$d_tax_rate->value = $tax_rate;
|
|
||||||
$d_tax_rate->save();
|
|
||||||
} else {
|
|
||||||
$d_tax_rate = ORM::for_table('tbl_appconfig')->create();
|
|
||||||
$d_tax_rate->setting = 'tax_rate';
|
|
||||||
$d_tax_rate->value = $tax_rate;
|
|
||||||
$d_tax_rate->save();
|
|
||||||
}
|
|
||||||
|
|
||||||
//checkbox
|
//checkbox
|
||||||
$checks = ['hide_mrc', 'hide_tms', 'hide_aui', 'hide_al', 'hide_uet', 'hide_vs', 'hide_pg'];
|
$checks = ['hide_mrc', 'hide_tms', 'hide_aui', 'hide_al', 'hide_uet', 'hide_vs', 'hide_pg'];
|
||||||
foreach ($checks as $check) {
|
foreach ($checks as $check) {
|
||||||
|
@ -602,9 +602,21 @@
|
|||||||
</div>
|
</div>
|
||||||
<p class="help-block col-md-4">{Lang::T('The method which OTP will be sent to user')}</p>
|
<p class="help-block col-md-4">{Lang::T('The method which OTP will be sent to user')}</p>
|
||||||
</div>
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label class="col-md-2 control-label">{Lang::T('Extend Package Expiry')}</label>
|
||||||
|
<div class="col-md-6">
|
||||||
|
<select name="extend_expiry" id="extend_expiry" class="form-control">
|
||||||
|
<option value="no" {if $_c['extend_expiry']=='no' }selected="selected" {/if}>
|
||||||
|
{Lang::T('No')}
|
||||||
|
<option value="yes" {if $_c['extend_expiry']=='yes' }selected="selected"
|
||||||
|
{/if}> {Lang::T('Yes')}
|
||||||
|
</select>
|
||||||
|
</div>
|
||||||
|
<p class="help-block col-md-4">{Lang::T('If user buy same internet plan, expiry date will extend')}</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{* <div class="panel-heading">
|
<div class="panel-heading">
|
||||||
<div class="btn-group pull-right">
|
<div class="btn-group pull-right">
|
||||||
<button class="btn btn-primary btn-xs" title="save" type="submit">
|
<button class="btn btn-primary btn-xs" title="save" type="submit">
|
||||||
<span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>
|
<span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span>
|
||||||
@ -631,22 +643,22 @@
|
|||||||
<label class="col-md-2 control-label">{Lang::T('Tax Rate')}</label>
|
<label class="col-md-2 control-label">{Lang::T('Tax Rate')}</label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<select name="tax_rate" id="tax_rate" class="form-control">
|
<select name="tax_rate" id="tax_rate" class="form-control">
|
||||||
<option value="0.005" {if $_c['tax_rate']=='0.005' }selected="selected" {/if}>
|
<option value="0.5" {if $_c['tax_rate']=='0.5' }selected="selected" {/if}>
|
||||||
{Lang::T('0.5%')}
|
{Lang::T('0.5%')}
|
||||||
</option>
|
</option>
|
||||||
<option value="0.01" {if $_c['tax_rate']=='0.01' }selected="selected" {/if}>
|
<option value="1" {if $_c['tax_rate']=='1' }selected="selected" {/if}>
|
||||||
{Lang::T('1%')}
|
{Lang::T('1%')}
|
||||||
</option>
|
</option>
|
||||||
<option value="0.015" {if $_c['tax_rate']=='0.015' }selected="selected" {/if}>
|
<option value="1.5" {if $_c['tax_rate']=='1.5' }selected="selected" {/if}>
|
||||||
{Lang::T('1.5%')}
|
{Lang::T('1.5%')}
|
||||||
</option>
|
</option>
|
||||||
<option value="0.02" {if $_c['tax_rate']=='0.02' }selected="selected" {/if}>
|
<option value="2" {if $_c['tax_rate']=='2' }selected="selected" {/if}>
|
||||||
{Lang::T('2%')}
|
{Lang::T('2%')}
|
||||||
</option>
|
</option>
|
||||||
<option value="0.05" {if $_c['tax_rate']=='0.05' }selected="selected" {/if}>
|
<option value="5" {if $_c['tax_rate']=='5' }selected="selected" {/if}>
|
||||||
{Lang::T('5%')}
|
{Lang::T('5%')}
|
||||||
</option>
|
</option>
|
||||||
<option value="0.1" {if $_c['tax_rate']=='0.1' }selected="selected" {/if}>
|
<option value="10" {if $_c['tax_rate']=='10' }selected="selected" {/if}>
|
||||||
{Lang::T('10%')}
|
{Lang::T('10%')}
|
||||||
</option>
|
</option>
|
||||||
<!-- Custom tax rate option -->
|
<!-- Custom tax rate option -->
|
||||||
@ -666,7 +678,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<p class="help-block col-md-4">{Lang::T('Enter the custom tax rate (e.g., 3.75 for 3.75%)')}</p>
|
<p class="help-block col-md-4">{Lang::T('Enter the custom tax rate (e.g., 3.75 for 3.75%)')}</p>
|
||||||
</div>
|
</div>
|
||||||
</div> *}
|
</div>
|
||||||
|
|
||||||
{* <div class="panel-heading" id="envato">
|
{* <div class="panel-heading" id="envato">
|
||||||
<div class="btn-group pull-right">
|
<div class="btn-group pull-right">
|
||||||
|
@ -11,15 +11,64 @@
|
|||||||
<div class="col-md-8">
|
<div class="col-md-8">
|
||||||
<select name="gateway" id="gateway" class="form-control">
|
<select name="gateway" id="gateway" class="form-control">
|
||||||
{foreach $pgs as $pg}
|
{foreach $pgs as $pg}
|
||||||
<option value="{$pg}">
|
<option value="{$pg}">
|
||||||
{ucwords($pg)}</option>
|
{ucwords($pg)}</option>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-2">
|
|
||||||
<button type="submit" class="btn btn-block btn-primary">{Lang::T('Pay Now')}</button>
|
|
||||||
</div>
|
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="panel-body">
|
||||||
|
<center><b>{Lang::T('Package Details')}</b></center>
|
||||||
|
<ul class="list-group list-group-unbordered">
|
||||||
|
<li class="list-group-item">
|
||||||
|
<b>{Lang::T('Plan Name')}</b> <span class="pull-right">{$plan['name_plan']}</span>
|
||||||
|
</li>
|
||||||
|
{if $plan['is_radius'] or $plan['routers']}
|
||||||
|
<li class="list-group-item">
|
||||||
|
<b>{Lang::T('Location')}</b> <span class="pull-right">{if
|
||||||
|
$plan['is_radius']}Radius{else}{$plan['routers']}{/if}</span>
|
||||||
|
</li>
|
||||||
|
{/if}
|
||||||
|
<li class="list-group-item">
|
||||||
|
<b>{Lang::T('Type')}</b> <span class="pull-right">{if $plan['prepaid'] eq
|
||||||
|
'yes'}Prepaid{else}Postpaid{/if}
|
||||||
|
{$plan['type']}</span>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<b>{Lang::T('Plan Price')}</b> <span class="pull-right">{if $using eq
|
||||||
|
'zero'}{Lang::moneyFormat(0)}{else}{Lang::moneyFormat($plan['price'])}{/if}</span>
|
||||||
|
</li>
|
||||||
|
{if $plan['validity']}
|
||||||
|
<li class="list-group-item">
|
||||||
|
<b>{Lang::T('Plan Validity')}</b> <span class="pull-right">{$plan['validity']}
|
||||||
|
{$plan['validity_unit']}</span>
|
||||||
|
</li>
|
||||||
|
{/if}
|
||||||
|
</ul>
|
||||||
|
<center><b>{Lang::T('Summary')}</b></center>
|
||||||
|
<ul class="list-group list-group-unbordered">
|
||||||
|
{if $tax}
|
||||||
|
<li class="list-group-item">
|
||||||
|
<b>{Lang::T('Tax')}</b> <span
|
||||||
|
class="pull-right">{Lang::moneyFormat($tax)}</span>
|
||||||
|
</li>
|
||||||
|
<li class="list-group-item">
|
||||||
|
<b>{Lang::T('Total')}</b> <small>({Lang::T('Plan Price')} + {Lang::T('Tax')})</small><span class="pull-right"
|
||||||
|
style="font-size: large; font-weight:bolder; font-family: 'Courier New', Courier, monospace; ">{Lang::moneyFormat($plan['price']+$tax)}</span>
|
||||||
|
</li>
|
||||||
|
{else}
|
||||||
|
<li class="list-group-item">
|
||||||
|
<b>{Lang::T('Total')}</b> <span class="pull-right"
|
||||||
|
style="font-size: large; font-weight:bolder; font-family: 'Courier New', Courier, monospace; ">
|
||||||
|
{Lang::moneyFormat($plan['price'])}</span>
|
||||||
|
</li>
|
||||||
|
{/if}
|
||||||
|
</ul>
|
||||||
|
<center>
|
||||||
|
<button type="submit" class="btn btn-primary">{Lang::T('Pay Now')}</button><br>
|
||||||
|
<a class="btn btn-link" href="{$_url}home">{Lang::T('Cancel')}</a>
|
||||||
|
</center>
|
||||||
</form>
|
</form>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -13,20 +13,29 @@
|
|||||||
<td>{$plan['type']}</td>
|
<td>{$plan['type']}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{if $add_cost>0}
|
{if $add_cost>0}
|
||||||
{foreach $bills as $k => $v}
|
{foreach $bills as $k => $v}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{$k}</td>
|
<td>{$k}</td>
|
||||||
<td>{Lang::moneyFormat($v)}</td>
|
<td>{Lang::moneyFormat($v)}</td>
|
||||||
</tr>
|
</tr>
|
||||||
{/foreach}
|
{/foreach}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{Lang::T('Additional Cost')}</td>
|
<td>{Lang::T('Additional Cost')}</td>
|
||||||
<td>{Lang::moneyFormat($add_cost)}</td>
|
<td>{Lang::moneyFormat($add_cost)}</td>
|
||||||
</tr>
|
</tr>
|
||||||
|
{/if}
|
||||||
|
{if $tax > 0}
|
||||||
|
<tr>
|
||||||
|
<td>{Lang::T('Tax')}</td>
|
||||||
|
<td>{Lang::moneyFormat($tax)}</td>
|
||||||
|
</tr>
|
||||||
{/if}
|
{/if}
|
||||||
<tr>
|
<tr>
|
||||||
<td>{Lang::T('Price')}{if $add_cost>0}<small> + {Lang::T('Additional Cost')}{/if}</td>
|
<td>{Lang::T('Price')}{if $add_cost>0}<small> + {Lang::T('Additional Cost')}{/if}{if
|
||||||
<td style="font-size: large; font-weight:bolder; font-family: 'Courier New', Courier, monospace; ">{Lang::moneyFormat($plan['price'])}</td>
|
$tax>0}<small> + {Lang::T('Tax')}{/if}</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>
|
||||||
@ -39,15 +48,17 @@
|
|||||||
<form method="post" onsubmit="return askConfirm()" role="form">
|
<form method="post" onsubmit="return askConfirm()" role="form">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
<input type="text" id="username" name="username" class="form-control" required value="{$username}"
|
<input type="text" id="username" name="username" class="form-control" required
|
||||||
placeholder="{Lang::T('Username')}">
|
value="{$username}" placeholder="{Lang::T('Username')}">
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-sm-3" align="center">
|
<div class="form-group col-sm-3" align="center">
|
||||||
<button class="btn btn-success btn-block" id="sendBtn" type="submit" name="send" onclick="return confirm('{Lang::T("Are You Sure?")}')"
|
<button class="btn btn-success btn-block" id="sendBtn" type="submit" name="send"
|
||||||
value="plan"><i class="glyphicon glyphicon-send"></i></button>
|
onclick="return confirm('{Lang::T(" Are You Sure?")}')" 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>
|
<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>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user