Feature: Custom Balance

Add custom balance in customer dashboard

Note: i only test it with Paystack and Razorpay payment gateway and it works as expected

test it very well and report any error or bug
This commit is contained in:
Focuslinkstech 2024-10-29 08:46:03 +01:00
parent df7293e3d0
commit 70d8cd8e01
4 changed files with 366 additions and 183 deletions

View File

@ -102,6 +102,10 @@ class Package
return self::rechargeBalance($c, $p, $gateway, $channel);
}
if ($router_name == 'Custom Balance') {
return self::rechargeCustomBalance($c, $p, $gateway, $channel);
}
/**
* 1 Customer only can have 1 PPPOE and 1 Hotspot Plan, 1 prepaid and 1 postpaid
*/
@ -499,6 +503,71 @@ class Package
return $t->id();
}
public static function rechargeCustomBalance($customer, $plan, $gateway, $channel, $note = '')
{
global $admin, $config;
$plan = ORM::for_table('tbl_payment_gateway')
->where('username', $customer['username'])
->where('routers', 'Custom Balance')
->where('status', '1')
->find_one();
if (!$plan) {
return false;
}
// insert table transactions
$t = ORM::for_table('tbl_transactions')->create();
$t->invoice = $inv = "INV-" . Package::_raid();
$t->username = $customer['username'];
$t->plan_name = 'Custom Balance';
$t->price = $plan['price'];
$t->recharged_on = date("Y-m-d");
$t->recharged_time = date("H:i:s");
$t->expiration = date("Y-m-d");
$t->time = date("H:i:s");
$t->method = "$gateway - $channel";
$t->routers = 'balance';
$t->type = "Balance";
$t->note = $note;
if ($admin) {
$t->admin_id = ($admin['id']) ? $admin['id'] : '0';
} else {
$t->admin_id = '0';
}
$t->save();
$balance_before = $customer['balance'];
Balance::plus($customer['id'], $plan['price']);
$balance = $customer['balance'] + $plan['price'];
$textInvoice = Lang::getNotifText('invoice_balance');
$textInvoice = str_replace('[[company_name]]', $config['CompanyName'], $textInvoice);
$textInvoice = str_replace('[[address]]', $config['address'], $textInvoice);
$textInvoice = str_replace('[[phone]]', $config['phone'], $textInvoice);
$textInvoice = str_replace('[[invoice]]', $inv, $textInvoice);
$textInvoice = str_replace('[[date]]', Lang::dateTimeFormat(date("Y-m-d H:i:s")), $textInvoice);
$textInvoice = str_replace('[[trx_date]]', Lang::dateTimeFormat(date("Y-m-d H:i:s")), $textInvoice);
$textInvoice = str_replace('[[payment_gateway]]', $gateway, $textInvoice);
$textInvoice = str_replace('[[payment_channel]]', $channel, $textInvoice);
$textInvoice = str_replace('[[type]]', 'Balance', $textInvoice);
$textInvoice = str_replace('[[plan_name]]', $plan['name_plan'], $textInvoice);
$textInvoice = str_replace('[[plan_price]]', Lang::moneyFormat($plan['price']), $textInvoice);
$textInvoice = str_replace('[[name]]', $customer['fullname'], $textInvoice);
$textInvoice = str_replace('[[user_name]]', $customer['username'], $textInvoice);
$textInvoice = str_replace('[[user_password]]', $customer['password'], $textInvoice);
$textInvoice = str_replace('[[footer]]', $config['note'], $textInvoice);
$textInvoice = str_replace('[[balance_before]]', Lang::moneyFormat($balance_before), $textInvoice);
$textInvoice = str_replace('[[balance]]', Lang::moneyFormat($balance), $textInvoice);
if ($config['user_notification_payment'] == 'sms') {
Message::sendSMS($customer['phonenumber'], $textInvoice);
} else if ($config['user_notification_payment'] == 'wa') {
Message::sendWhatsapp($customer['phonenumber'], $textInvoice);
} else if ($config['user_notification_payment'] == 'email') {
Message::sendEmail($customer['email'], '[' . $config['CompanyName'] . '] ' . Lang::T("Invoice") . ' ' . $inv, $textInvoice);
}
return $t->id();
}
public static function _raid()
{
return ORM::for_table('tbl_transactions')->max('id') + 1;

View File

@ -416,6 +416,16 @@ switch ($action) {
if ($tax_enable === 'yes') {
$ui->assign('tax', $tax);
}
if (_post('custom') == '1') {
if (_post('amount') > 0) {
$ui->assign('custom', '1');
$ui->assign('amount', _post('amount'));
} else {
r2(U . "order/balance", 'e', Lang::T("Please enter amount"));
}
}
$ui->assign('route2', $routes[2]);
$ui->assign('route3', $routes[3]);
$ui->assign('add_cost', $add_cost);
@ -445,98 +455,140 @@ switch ($action) {
include $PAYMENTGATEWAY_PATH . DIRECTORY_SEPARATOR . $gateway . '.php';
call_user_func($gateway . '_validate_config');
$plan = ORM::for_table('tbl_plans')->where('enabled', '1')->find_one($routes['3']);
if ($plan['is_radius'] == '1') {
$router['id'] = 0;
$router['name'] = 'radius';
} else if ($routes['2'] > 0) {
$router = ORM::for_table('tbl_routers')->where('enabled', '1')->find_one($routes['2']);
} else {
$router['id'] = 0;
$router['name'] = 'balance';
}
if (empty($router) || empty($plan)) {
r2(U . "order/package", 'e', Lang::T("Plan Not found"));
}
$d = ORM::for_table('tbl_payment_gateway')
->where('username', $user['username'])
->where('status', 1)
->find_one();
if ($d) {
if ($d['pg_url_payment']) {
r2(U . "order/view/" . $d['id'], 'w', Lang::T("You already have unpaid transaction, cancel it or pay it."));
} else {
if ($gateway == $d['gateway']) {
$id = $d['id'];
switch (_post('custom')) {
case '1':
$amount = _post('amount');
$amount = (float) $amount;
if ($amount <= 0) {
r2(U . "order/gateway/" . $routes[2] . '/' . $routes[3], 'w', Lang::T("Please enter amount"));
}
$d = ORM::for_table('tbl_payment_gateway')
->where('username', $user['username'])
->where('status', 1)
->find_one();
if ($d) {
if ($d['pg_url_payment']) {
r2(U . "order/view/" . $d['id'], 'w', Lang::T("You already have unpaid transaction, cancel it or pay it."));
} else {
if ($gateway == $d['gateway']) {
$id = $d['id'];
} else {
$d->status = 4;
$d->save();
}
}
}
$d = ORM::for_table('tbl_payment_gateway')->create();
$d->username = $user['username'];
$d->gateway = $gateway;
$d->plan_id = 0;
$d->plan_name = 'Custom';
$d->routers_id = '0';
$d->routers = 'Custom Balance';
$d->price = $amount;
$d->created_date = date('Y-m-d H:i:s');
$d->status = 1;
$d->save();
$id = $d->id;
break;
default:
$plan = ORM::for_table('tbl_plans')->where('enabled', '1')->find_one($routes['3']);
if ($plan['is_radius'] == '1') {
$router['id'] = 0;
$router['name'] = 'radius';
} else if ($routes['2'] > 0) {
$router = ORM::for_table('tbl_routers')->where('enabled', '1')->find_one($routes['2']);
} else {
$d->status = 4;
$router['id'] = 0;
$router['name'] = 'balance';
}
if (empty($router) || empty($plan)) {
r2(U . "order/package", 'e', Lang::T("Plan Not found"));
}
$d = ORM::for_table('tbl_payment_gateway')
->where('username', $user['username'])
->where('status', 1)
->find_one();
if ($d) {
if ($d['pg_url_payment']) {
r2(U . "order/view/" . $d['id'], 'w', Lang::T("You already have unpaid transaction, cancel it or pay it."));
} else {
if ($gateway == $d['gateway']) {
$id = $d['id'];
} else {
$d->status = 4;
$d->save();
}
}
}
$add_cost = 0;
$tax = 0;
if ($router['name'] != 'balance') {
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)) {
$d = ORM::for_table('tbl_payment_gateway')->create();
$d->username = $user['username'];
$d->gateway = $gateway;
$d->plan_id = $plan['id'];
$d->plan_name = $plan['name_plan'];
$d->routers_id = $router['id'];
$d->routers = $router['name'];
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 + $tax);
} else {
$d->price = ($add_inv + $add_cost + $tax);
}
} else {
$d->price = ($plan['price'] + $add_cost + $tax);
}
$d->created_date = date('Y-m-d H:i:s');
$d->status = 1;
$d->save();
$id = $d->id();
} else {
$d->username = $user['username'];
$d->gateway = $gateway;
$d->plan_id = $plan['id'];
$d->plan_name = $plan['name_plan'];
$d->routers_id = $router['id'];
$d->routers = $router['name'];
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 + $tax);
} else {
$d->price = ($add_inv + $add_cost + $tax);
}
} else {
$d->price = ($plan['price'] + $add_cost + $tax);
}
//$d->price = ($plan['price'] + $add_cost);
$d->created_date = date('Y-m-d H:i:s');
$d->status = 1;
$d->save();
}
}
}
$add_cost = 0;
$tax = 0;
if ($router['name'] != 'balance') {
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)) {
$d = ORM::for_table('tbl_payment_gateway')->create();
$d->username = $user['username'];
$d->gateway = $gateway;
$d->plan_id = $plan['id'];
$d->plan_name = $plan['name_plan'];
$d->routers_id = $router['id'];
$d->routers = $router['name'];
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 + $tax);
} else {
$d->price = ($add_inv + $add_cost + $tax);
}
} else {
$d->price = ($plan['price'] + $add_cost + $tax);
}
$d->created_date = date('Y-m-d H:i:s');
$d->status = 1;
$d->save();
$id = $d->id();
} else {
$d->username = $user['username'];
$d->gateway = $gateway;
$d->plan_id = $plan['id'];
$d->plan_name = $plan['name_plan'];
$d->routers_id = $router['id'];
$d->routers = $router['name'];
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 + $tax);
} else {
$d->price = ($add_inv + $add_cost + $tax);
}
} else {
$d->price = ($plan['price'] + $add_cost + $tax);
}
//$d->price = ($plan['price'] + $add_cost);
$d->created_date = date('Y-m-d H:i:s');
$d->status = 1;
$d->save();
break;
}
if (!$id) {
r2(U . "order/package/" . $d['id'], 'e', Lang::T("Failed to create Transaction.."));

View File

@ -3,39 +3,64 @@
<div class="row">
<div class="col-sm-12">
{if $_c['enable_balance'] == 'yes'}
<div class="box box-solid box-success bg-gray-light">
<div class="box-header">{Lang::T('Buy Balance Plans')}</div>
<div class="box-body row">
{foreach $plans_balance as $plan}
<div class="col col-md-4">
<div class="box box-solid box-default">
<div class="box-header text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}
{if !empty($plan['price_old'])}
<sup style="text-decoration: line-through; color: red">{Lang::moneyFormat($plan['price_old'])}</sup>
{/if}
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="box-body">
<a href="{$_url}order/gateway/0/{$plan['id']}"
onclick="return confirm('{Lang::T('Buy Balance')}?')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy')}</a>
</div>
<div class="box box-solid box-success bg-gray-light">
<div class="box-header">{Lang::T('Buy Balance Plans')}</div>
<div class="box-body row">
{foreach $plans_balance as $plan}
<div class="col col-md-4">
<div class="box box-solid box-default">
<div class="box-header text-bold">{$plan['name_plan']}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<td>{Lang::T('Price')}</td>
<td>{Lang::moneyFormat($plan['price'])}
{if !empty($plan['price_old'])}
<sup
style="text-decoration: line-through; color: red">{Lang::moneyFormat($plan['price_old'])}</sup>
{/if}
</td>
</tr>
</tbody>
</table>
</div>
</div>
{/foreach}
<div class="box-body">
<a href="{$_url}order/gateway/0/{$plan['id']}"
onclick="return confirm('{Lang::T('Buy Balance')}?')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy')}</a>
</div>
</div>
</div>
{/foreach}
<div class="col col-md-4">
<form action="{$_url}order/gateway/0/0" method="post">
<input type="hidden" name="custom" value="1">
<div class="box box-solid box-default">
<div class="box-header text-bold">{Lang::T('Custom Balance')}</div>
<div class="table-responsive">
<div style="margin-left: 5px; margin-right: 5px;">
<table class="table table-bordered table-striped">
<tbody>
<tr>
<input type="number" name="amount" id="amount" class="form-control"
placeholder="{Lang::T('Input Desired Amount')}">
</tr>
</tbody>
</table>
</div>
</div>
<div class="box-body">
<button onclick="return confirm('{Lang::T('Buy Balance')}?')"
class="btn btn-sm btn-block btn-primary">{Lang::T('Buy')}</button>
</div>
</div>
</form>
</div>
</div>
</div>
{/if}
</div>
</div>

View File

@ -2,25 +2,26 @@
<div class="row">
{if file_exists("$PAGES_PATH/Payment_Info.html")}
<div class="col-md-6">
<div class="panel panel-warning panel-hovered">
<div class="panel-heading">{Lang::T('Payment Info')}</div>
<div class="panel-body">{include file="$PAGES_PATH/Payment_Info.html"}</div>
</div>
<div class="col-md-6">
<div class="panel panel-warning panel-hovered">
<div class="panel-heading">{Lang::T('Payment Info')}</div>
<div class="panel-body">{include file="$PAGES_PATH/Payment_Info.html"}</div>
</div>
</div>
{/if}
<div class="{if file_exists("$PAGES_PATH/Payment_Info.html")}col-md-6{else}col-md-6 col-md-offset-3{/if}">
<div class="{if file_exists(" $PAGES_PATH/Payment_Info.html")}col-md-6{else}col-md-6 col-md-offset-3{/if}">
<div class="panel panel-success panel-hovered">
<div class="panel-heading">{Lang::T('Available Payment Gateway')}</div>
<div class="panel-footer">
{if !$custom}
<form method="post" action="{$_url}order/buy/{$route2}/{$route3}">
<div class="form-group row">
<label class="col-md-4">{Lang::T('Payment Gateway')}</label>
<div class="col-md-8">
<select name="gateway" id="gateway" class="form-control">
{foreach $pgs as $pg}
<option value="{$pg}">
{ucwords($pg)}</option>
<option value="{$pg}">
{ucwords($pg)}</option>
{/foreach}
</select>
</div>
@ -28,14 +29,15 @@
</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']}
<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}
@ -47,69 +49,70 @@
</li>
<li class="list-group-item">
<b>{Lang::T('Plan Price')}</b> <span class="pull-right">
{if !empty($plan['price_old'])}
<sup style="text-decoration: line-through; color: red">{Lang::moneyFormat($plan['price_old'])}</sup>
{/if}
{Lang::moneyFormat($plan['price'])}
{if !empty($plan['price_old'])}
<sup
style="text-decoration: line-through; color: red">{Lang::moneyFormat($plan['price_old'])}</sup>
{/if}
{Lang::moneyFormat($plan['price'])}
</span>
</li>
{if $plan['validity']}
<li class="list-group-item">
<b>{Lang::T('Validity Periode')}</b> <span class="pull-right">{$plan['validity']}
{$plan['validity_unit']}</span>
</li>
<li class="list-group-item">
<b>{Lang::T('Validity Periode')}</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>
{if $add_cost!=0}
{foreach $bills as $k => $v}
<li class="list-group-item">
<b>{$k}</b> <span class="pull-right">{Lang::moneyFormat($v)}</span>
</li>
{/foreach}
<li class="list-group-item">
<b>{Lang::T('Additional Cost')}</b> <span
class="pull-right">{Lang::moneyFormat($add_cost)}</span>
</li>
<li class="list-group-item">
<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+$tax)}</span>
</li>
{else}
<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>
{/if}
<li class="list-group-item">
<b>{Lang::T('Tax')}</b> <span class="pull-right">{Lang::moneyFormat($tax)}</span>
</li>
{if $add_cost!=0}
{foreach $bills as $k => $v}
<li class="list-group-item">
<b>{$k}</b> <span class="pull-right">{Lang::moneyFormat($v)}</span>
</li>
{/foreach}
<li class="list-group-item">
<b>{Lang::T('Additional Cost')}</b> <span
class="pull-right">{Lang::moneyFormat($add_cost)}</span>
</li>
<li class="list-group-item">
<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+$tax)}</span>
</li>
{else}
{if $add_cost!=0}
{foreach $bills as $k => $v}
<li class="list-group-item">
<b>{$k}</b> <span class="pull-right">{Lang::moneyFormat($v)}</span>
</li>
{/foreach}
<li class="list-group-item">
<b>{Lang::T('Additional Cost')}</b> <span
class="pull-right">{Lang::moneyFormat($add_cost)}</span>
</li>
<li class="list-group-item">
<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>
</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}
<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>
{/if}
{else}
{if $add_cost!=0}
{foreach $bills as $k => $v}
<li class="list-group-item">
<b>{$k}</b> <span class="pull-right">{Lang::moneyFormat($v)}</span>
</li>
{/foreach}
<li class="list-group-item">
<b>{Lang::T('Additional Cost')}</b> <span
class="pull-right">{Lang::moneyFormat($add_cost)}</span>
</li>
<li class="list-group-item">
<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>
</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}
{/if}
</ul>
<center>
@ -117,6 +120,40 @@
<a class="btn btn-link" href="{$_url}home">{Lang::T('Cancel')}</a>
</center>
</form>
{else}
<br>
<form method="post" action="{$_url}order/buy/{$route2}/{$route3}">
<div class="form-group row">
<label class="col-md-4">{Lang::T('Payment Gateway')}</label>
<div class="col-md-8">
<select name="gateway" id="gateway" class="form-control">
{foreach $pgs as $pg}
<option value="{$pg}">
{ucwords($pg)}</option>
{/foreach}
</select>
</div>
</div>
<ul class="list-group list-group-unbordered">
<input type="hidden" name="custom" value="1">
<input type="hidden" name="amount" value="{$amount}">
<li class="list-group-item">
<b>{Lang::T('Custom Balance')}</b> <span
class="pull-right">{Lang::moneyFormat($amount)}</span>
</li>
<br> <br> <br>
<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($amount)}</span>
</li>
</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>
{/if}
<br>
</div>
</div>
</div>