add hook when recharge

This commit is contained in:
Ibnu Maksum 2024-03-01 09:57:59 +07:00
parent 699289662b
commit de3312055a
No known key found for this signature in database
GPG key ID: 7FC82848810579E5
3 changed files with 10 additions and 5 deletions

View file

@ -238,7 +238,7 @@ function r2($to, $ntype = 'e', $msg = '')
exit;
}
function _alert($text, $type = 'success', $url = "home")
function _alert($text, $type = 'success', $url = "home", $time = 3)
{
global $ui;
if (!isset($ui)) return;
@ -251,8 +251,10 @@ function _alert($text, $type = 'success', $url = "home")
}
$ui->assign('text', $text);
$ui->assign('type', $type);
$ui->assign('time', $time);
$ui->assign('url', $url);
$ui->display('alert.tpl');
die();
}

View file

@ -94,6 +94,9 @@ class Package
->where('Type', $p['type'])
->find_one();
run_hook("recharge_user");
$mikrotik = Mikrotik::info($router_name);
if ($p['validity_unit'] == 'Months') {
$date_exp = date("Y-m-d", strtotime('+' . $p['validity'] . ' month'));
@ -357,8 +360,8 @@ class Package
"\nChannel: " . $channel .
"\nPrice: " . Lang::moneyFormat($p['price']));
}
Message::sendInvoice($c, $t);
run_hook("recharge_user_finish");
return true;
}

View file

@ -9,7 +9,7 @@
<link rel="shortcut icon" href="ui/ui/images/logo.png" type="image/x-icon" />
<link rel="stylesheet" href="ui/ui/styles/bootstrap.min.css">
<link rel="stylesheet" href="ui/ui/styles/modern-AdminLTE.min.css">
<meta http-equiv="refresh" content="3; url={$url}">
<meta http-equiv="refresh" content="{$time}; url={$url}">
</head>
<body class="hold-transition lockscreen">
@ -20,7 +20,7 @@
{$text}
</div>
<div class="panel-footer">
<a href="{$url}" id="button" class="btn btn-{$type} btn-block btn-block">{Lang::T('Click Here')} (3)</a>
<a href="{$url}" id="button" class="btn btn-{$type} btn-block btn-block">{Lang::T('Click Here')} ({$time})</a>
</div>
</div>
<div class="lockscreen-footer text-center">
@ -29,7 +29,7 @@
</div>
<script>
var time = 3;
var time = {$time};
timer();
function timer() {