add anti double submit when refill balance
This commit is contained in:
parent
61bd042b15
commit
be43a5b385
@ -714,6 +714,14 @@ switch ($action) {
|
|||||||
}
|
}
|
||||||
$user = _post('id_customer');
|
$user = _post('id_customer');
|
||||||
$plan = _post('id_plan');
|
$plan = _post('id_plan');
|
||||||
|
$stoken = _req('stoken');
|
||||||
|
if (App::getTokenValue($stoken)) {
|
||||||
|
$c = ORM::for_table('tbl_customers')->where('id', $user)->find_one();
|
||||||
|
$in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one();
|
||||||
|
Package::createInvoice($in);
|
||||||
|
$ui->display('invoice.tpl');
|
||||||
|
die();
|
||||||
|
}
|
||||||
|
|
||||||
run_hook('deposit_customer'); #HOOK
|
run_hook('deposit_customer'); #HOOK
|
||||||
if (!empty($user) && !empty($plan)) {
|
if (!empty($user) && !empty($plan)) {
|
||||||
@ -721,6 +729,9 @@ switch ($action) {
|
|||||||
$c = ORM::for_table('tbl_customers')->where('id', $user)->find_one();
|
$c = ORM::for_table('tbl_customers')->where('id', $user)->find_one();
|
||||||
$in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one();
|
$in = ORM::for_table('tbl_transactions')->where('username', $c['username'])->order_by_desc('id')->find_one();
|
||||||
Package::createInvoice($in);
|
Package::createInvoice($in);
|
||||||
|
if(!empty($stoken)){
|
||||||
|
App::setToken($stoken, $in['id']);
|
||||||
|
}
|
||||||
$ui->display('invoice.tpl');
|
$ui->display('invoice.tpl');
|
||||||
} else {
|
} else {
|
||||||
r2(U . 'plan/refill', 'e', "Failed to refill account");
|
r2(U . 'plan/refill', 'e', "Failed to refill account");
|
||||||
|
@ -6,6 +6,7 @@
|
|||||||
<div class="panel-heading">{Lang::T('Refill Balance')}</div>
|
<div class="panel-heading">{Lang::T('Refill Balance')}</div>
|
||||||
<div class="panel-body">
|
<div class="panel-body">
|
||||||
<form class="form-horizontal" method="post" role="form" action="{$_url}plan/deposit-post">
|
<form class="form-horizontal" method="post" role="form" action="{$_url}plan/deposit-post">
|
||||||
|
<input type="hidden" name="stoken" value="{App::getToken()}">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label class="col-md-2 control-label">{Lang::T('Select Account')}</label>
|
<label class="col-md-2 control-label">{Lang::T('Select Account')}</label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
|
Loading…
x
Reference in New Issue
Block a user