diff --git a/system/controllers/plan.php b/system/controllers/plan.php index d4d1c7a5..68adcffd 100644 --- a/system/controllers/plan.php +++ b/system/controllers/plan.php @@ -714,6 +714,14 @@ switch ($action) { } $user = _post('id_customer'); $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 if (!empty($user) && !empty($plan)) { @@ -721,6 +729,9 @@ switch ($action) { $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); + if(!empty($stoken)){ + App::setToken($stoken, $in['id']); + } $ui->display('invoice.tpl'); } else { r2(U . 'plan/refill', 'e', "Failed to refill account"); diff --git a/ui/ui/deposit.tpl b/ui/ui/deposit.tpl index a19da134..1b086fe7 100644 --- a/ui/ui/deposit.tpl +++ b/ui/ui/deposit.tpl @@ -6,6 +6,7 @@