Delete Used Voucher which not exists in tbl recharges

This commit is contained in:
Ibnu Maksum
2024-01-08 16:12:21 +07:00
parent b862a759d0
commit 055b855bc1
5 changed files with 62 additions and 41 deletions

View File

@ -11,8 +11,6 @@ $action = $routes['1'];
$user = User::_info();
$ui->assign('_user', $user);
use PEAR2\Net\RouterOS;
require_once 'system/autoload/PEAR2/Autoload.php';
switch ($action) {
@ -27,7 +25,7 @@ switch ($action) {
$v1 = ORM::for_table('tbl_voucher')->where('code', $code)->where('status', 0)->find_one();
run_hook('customer_activate_voucher'); #HOOK
if ($v1) {
if (Package::rechargeUser($user['id'], $v1['routers'], $v1['id_plan'], "Activation", "Voucher")) {
if (Package::rechargeUser($user['id'], $v1['routers'], $v1['id_plan'], "Voucher", $code)) {
$v1->status = "1";
$v1->user = $user['username'];
$v1->save();