forked from kevinowino869/mitrobill
Prevent double submit for recharge and renew
This commit is contained in:
@ -91,6 +91,10 @@ if (_post('send') == 'balance') {
|
||||
$ui->assign('_bills', User::_billing());
|
||||
|
||||
if (isset($_GET['recharge']) && !empty($_GET['recharge'])) {
|
||||
if(!empty(App::getTokenValue($_GET['stoken']))){
|
||||
r2(U . "voucher/invoice/");
|
||||
die();
|
||||
}
|
||||
$bill = ORM::for_table('tbl_user_recharges')->where('id', $_GET['recharge'])->where('username', $user['username'])->findOne();
|
||||
if ($bill) {
|
||||
$router = ORM::for_table('tbl_routers')->where('name', $bill['routers'])->find_one();
|
||||
@ -100,9 +104,9 @@ if (isset($_GET['recharge']) && !empty($_GET['recharge'])) {
|
||||
r2(U . "home", 'e', 'Plan is not exists');
|
||||
}
|
||||
if ($user['balance'] > $plan['price']) {
|
||||
r2(U . "order/pay/$router[id]/$bill[plan_id]", 'e', 'Order Plan');
|
||||
r2(U . "order/pay/$router[id]/$bill[plan_id]&stoken=".$_GET['stoken']);
|
||||
} else {
|
||||
r2(U . "order/buy/$router[id]/$bill[plan_id]", 'e', 'Order Plan');
|
||||
r2(U . "order/buy/$router[id]/$bill[plan_id]");
|
||||
}
|
||||
} else {
|
||||
r2(U . "order/buy/$router[id]/$bill[plan_id]", 'e', 'Order Plan');
|
||||
|
Reference in New Issue
Block a user