add expired notification

This commit is contained in:
Ibnu Maksum 2023-03-06 14:49:44 +07:00
parent 3130310d9c
commit b10cfa2a8e
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5

View File

@ -1,4 +1,5 @@
<?php
/**
* PHP Mikrotik Billing (https://github.com/hotspotbilling/phpnuxbill/)
**/
@ -19,8 +20,7 @@ include "autoload/Hookers.php";
//register all plugin
foreach (glob("system/plugin/*.php") as $filename)
{
foreach (glob("system/plugin/*.php") as $filename) {
include $filename;
}
@ -55,6 +55,8 @@ foreach($result as $value){
}
date_default_timezone_set($config['timezone']);
$textExpired = $config['user_notification_expired_text'];
$d = ORM::for_table('tbl_user_recharges')->where('status', 'on')->find_many();
run_hook('cronjob'); #HOOK
@ -74,8 +76,8 @@ foreach ($d as $ds){
$client = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']);
Mikrotik::setHotspotLimitUptime($client, $c['username']);
Mikrotik::removeHotspotActiveUser($client, $c['username']);
Message::sendExpiredNotification($c['phonenumber'], $c['fullname'], $u['namebp'], $textExpired, $config['user_notification_expired']);
}
//update database user dengan status off
$u->status = 'off';
$u->save();
@ -94,6 +96,7 @@ foreach ($d as $ds){
$client = Mikrotik::getClient($m['ip_address'], $m['username'], $m['password']);
Mikrotik::disablePpoeUser($client, $c['username']);
Mikrotik::removePpoeActive($client, $c['username']);
Message::sendExpiredNotification($c['phonenumber'], $c['fullname'], $u['namebp'], $textExpired, $config['user_notification_expired']);
}
$u->status = 'off';