This commit is contained in:
Ibnu Maksum 2024-06-12 15:27:33 +07:00
parent a662291036
commit 6e263ca4bd
No known key found for this signature in database
GPG key ID: 7FC82848810579E5
2 changed files with 11 additions and 11 deletions

View file

@ -108,10 +108,10 @@ switch ($action) {
}
$ui->assign('devices', $devices);
//select expired plan
if($d['is_radius']){
$exps = ORM::for_table('tbl_plans')->selects('id','name_plan')->where("is_radius", 1)->findArray();
}else{
$exps = ORM::for_table('tbl_plans')->selects('id','name_plan')->where("routers", $d['routers'])->findArray();
if ($d['is_radius']) {
$exps = ORM::for_table('tbl_plans')->selects('id', 'name_plan')->where('type', 'Hotspot')->where("is_radius", 1)->findArray();
} else {
$exps = ORM::for_table('tbl_plans')->selects('id', 'name_plan')->where('type', 'Hotspot')->where("routers", $d['routers'])->findArray();
}
$ui->assign('exps', $exps);
run_hook('view_edit_plan'); #HOOK
@ -219,7 +219,7 @@ switch ($action) {
new Exception(Lang::T("Devices Not Found"));
}
r2(U . 'services/hotspot', 's', Lang::T('Data Created Successfully'));
r2(U . 'services/edit/' . $d->id(), 's', Lang::T('Data Created Successfully'));
} else {
r2(U . 'services/add', 'e', $msg);
}
@ -387,10 +387,10 @@ switch ($action) {
}
$ui->assign('devices', $devices);
//select expired plan
if($d['is_radius']){
$exps = ORM::for_table('tbl_plans')->selects('id','name_plan')->where("is_radius", 1)->findArray();
}else{
$exps = ORM::for_table('tbl_plans')->selects('id','name_plan')->where("routers", $d['routers'])->findArray();
if ($d['is_radius']) {
$exps = ORM::for_table('tbl_plans')->selects('id', 'name_plan')->where('type', 'PPPOE')->where("is_radius", 1)->findArray();
} else {
$exps = ORM::for_table('tbl_plans')->selects('id', 'name_plan')->where('type', 'PPPOE')->where("routers", $d['routers'])->findArray();
}
$ui->assign('exps', $exps);
run_hook('view_edit_ppoe'); #HOOK

View file

@ -21,7 +21,7 @@ $textExpired = Lang::getNotifText('expired');
$d = ORM::for_table('tbl_user_recharges')->where('status', 'on')->where_lte('expiration', date("Y-m-d"))->find_many();
echo "Found " . count($d) . " user(s)\n";
run_hook('cronjob'); #HOOK
//run_hook('cronjob'); #HOOK
foreach ($d as $ds) {
$date_now = strtotime(date("Y-m-d H:i:s"));
@ -35,7 +35,7 @@ foreach ($d as $ds) {
$dvc = Package::getDevice($p);
if (file_exists($dvc)) {
require_once $dvc;
(new $p['device'])->remove_customer($ds['routers'], $c, $p);
(new $p['device'])->remove_customer($c, $p);
} else {
echo "Cron error Devices $p[device] not found, cannot disconnect $c[username]";
Message::sendTelegram("Cron error Devices $p[device] not found, cannot disconnect $c[username]");