From 20c4be9121864427136745a2b8d0269af7a9fb6f Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Sun, 21 Apr 2024 10:52:18 +0700 Subject: [PATCH] As exp dev says, if it works, dont touch it --- system/cron.php | 8 +++----- system/cron_reminder.php | 16 +++++----------- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/system/cron.php b/system/cron.php index 398c3146..4d03201b 100644 --- a/system/cron.php +++ b/system/cron.php @@ -34,7 +34,6 @@ foreach ($d as $ds) { $c = ORM::for_table('tbl_customers')->where('id', $ds['customer_id'])->find_one(); $m = Mikrotik::info($ds['routers']); $p = ORM::for_table('tbl_plans')->where('id', $u['plan_id'])->find_one(); - $price = Lang::moneyFormat($p['price']); if ($p['is_radius']) { if (empty($p['pool_expired'])) { print_r(Radius::customerDeactivate($c['username'])); @@ -54,7 +53,7 @@ foreach ($d as $ds) { } Mikrotik::removeHotspotActiveUser($client, $c['username']); } - echo Message::sendPackageNotification($c, $u['namebp'], $price, $textExpired, $config['user_notification_expired']) . "\n"; + echo Message::sendPackageNotification($c, $u['namebp'], $p['price'], $textExpired, $config['user_notification_expired']) . "\n"; //update database user dengan status off $u->status = 'off'; $u->save(); @@ -98,7 +97,6 @@ foreach ($d as $ds) { $c = ORM::for_table('tbl_customers')->where('id', $ds['customer_id'])->find_one(); $m = ORM::for_table('tbl_routers')->where('name', $ds['routers'])->find_one(); $p = ORM::for_table('tbl_plans')->where('id', $u['plan_id'])->find_one(); - $price = Lang::moneyFormat($p['price']); if ($p['is_radius']) { if (empty($p['pool_expired'])) { print_r(Radius::customerDeactivate($c['username'])); @@ -115,7 +113,7 @@ foreach ($d as $ds) { } Mikrotik::removePpoeActive($client, $c['username']); } - echo Message::sendPackageNotification($c, $u['namebp'], $price, $textExpired, $config['user_notification_expired']) . "\n"; + echo Message::sendPackageNotification($c, $u['namebp'], $p['price'], $textExpired, $config['user_notification_expired']) . "\n"; $u->status = 'off'; $u->save(); @@ -146,4 +144,4 @@ foreach ($d as $ds) { } else echo " : ACTIVE \r\n"; } -} +} \ No newline at end of file diff --git a/system/cron_reminder.php b/system/cron_reminder.php index 44d101ef..85b1a076 100644 --- a/system/cron_reminder.php +++ b/system/cron_reminder.php @@ -38,22 +38,16 @@ foreach ($d as $ds) { $u = ORM::for_table('tbl_user_recharges')->where('id', $ds['id'])->find_one(); $p = ORM::for_table('tbl_plans')->where('id', $u['plan_id'])->find_one(); $c = ORM::for_table('tbl_customers')->where('id', $ds['customer_id'])->find_one(); - list($bills, $add_cost) = User::getBills($ds['customer_id']); - if ($add_cost > 0) { - if (!empty($add_cost)) { - $p['price'] += $add_cost; - } - } - if ($p['validity_unit'] == 'Period') { + if ($p['validity_unit'] == 'Period') { // Postpaid price from field $add_inv = User::getAttribute("Invoice", $ds['customer_id']); if (empty ($add_inv) or $add_inv == 0) { - $price = Lang::moneyFormat($p['price']); + $price = $p['price']; } else { - $price = Lang::moneyFormat($add_inv); + $price = $add_inv; } } else { - $price = Lang::moneyFormat($p['price']); + $price = $p['price']; } if ($ds['expiration'] == $day7) { echo Message::sendPackageNotification($c, $p['name_plan'], $price, Lang::getNotifText('reminder_7_day'), $config['user_notification_reminder']) . "\n"; @@ -63,4 +57,4 @@ foreach ($d as $ds) { echo Message::sendPackageNotification($c, $p['name_plan'], $price, Lang::getNotifText('reminder_1_day'), $config['user_notification_reminder']) . "\n"; } } -} +} \ No newline at end of file