From 64f52d6c1c4521a61c9ce188c334b6cce39936dc Mon Sep 17 00:00:00 2001 From: Ibnu Maksum Date: Tue, 16 Jan 2024 09:52:12 +0700 Subject: [PATCH] add [[price]] to reminder notification --- CHANGELOG.md | 2 ++ system/autoload/Message.php | 11 ++++++----- system/cron_reminder.php | 8 +++++--- system/lan/english/common.lan.php | 30 +++++++++++------------------ system/lan/indonesia/common.lan.php | 3 --- ui/ui/app-notifications.tpl | 8 ++++---- version.json | 2 +- 7 files changed, 29 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb80646b..262ab4f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,8 @@ ## 2024.1.16 - Add yellow color to table for plan not allowed to purchase +- Fix Radius pool select +- add price to reminder notification ## 2024.1.15 diff --git a/system/autoload/Message.php b/system/autoload/Message.php index 3ee749d8..83940860 100644 --- a/system/autoload/Message.php +++ b/system/autoload/Message.php @@ -66,10 +66,11 @@ class Message } } - public static function sendPackageNotification($phone, $name, $package, $message, $via) + public static function sendPackageNotification($phone, $name, $package, $price, $message, $via) { - $msg = str_replace('[[name]]', "*$name*", $message); - $msg = str_replace('[[package]]', "*$package*", $msg); + $msg = str_replace('[[name]]', "$name", $message); + $msg = str_replace('[[package]]', "$package", $msg); + $msg = str_replace('[[price]]', "$price", $msg); if ( !empty($phone) && strlen($phone) > 5 && !empty($message) && in_array($via, ['sms', 'wa']) @@ -85,9 +86,9 @@ class Message public static function sendBalanceNotification($phone, $name, $balance, $balance_now, $message, $via) { - $msg = str_replace('[[name]]', "*$name*", $message); + $msg = str_replace('[[name]]', "$name", $message); $msg = str_replace('[[current_balance]]', Lang::moneyFormat($balance_now), $msg); - $msg = str_replace('[[balance]]', "*" . Lang::moneyFormat($balance) . "*", $msg); + $msg = str_replace('[[balance]]', Lang::moneyFormat($balance), $msg); if ( !empty($phone) && strlen($phone) > 5 && !empty($message) && in_array($via, ['sms', 'wa']) diff --git a/system/cron_reminder.php b/system/cron_reminder.php index d15fa953..b09b7dec 100644 --- a/system/cron_reminder.php +++ b/system/cron_reminder.php @@ -104,13 +104,15 @@ print_r([$day1, $day3, $day7]); foreach ($d as $ds) { if (in_array($ds['expiration'], [$day1, $day3, $day7])) { $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(); + $price = Lang::moneyFormat($p['price']); if ($ds['expiration'] == $day7) { - echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $u['namebp'], Lang::getNotifText('reminder_7_day'), $config['user_notification_reminder']) . "\n"; + echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $p['name_plan'], $price, Lang::getNotifText('reminder_7_day'), $config['user_notification_reminder']) . "\n"; } else if ($ds['expiration'] == $day3) { - echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $u['namebp'], Lang::getNotifText('reminder_3_day'), $config['user_notification_reminder']) . "\n"; + echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $p['name_plan'], $price, Lang::getNotifText('reminder_3_day'), $config['user_notification_reminder']) . "\n"; } else if ($ds['expiration'] == $day1) { - echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $u['namebp'], Lang::getNotifText('reminder_1_day'), $config['user_notification_reminder']) . "\n"; + echo Message::sendPackageNotification($c['phonenumber'], $c['fullname'], $p['name_plan'], $price, Lang::getNotifText('reminder_1_day'), $config['user_notification_reminder']) . "\n"; } } } diff --git a/system/lan/english/common.lan.php b/system/lan/english/common.lan.php index d0d1e4ac..5345f97f 100644 --- a/system/lan/english/common.lan.php +++ b/system/lan/english/common.lan.php @@ -3,8 +3,6 @@ ----------------------------------- Language Name: English Contributor: Ismail Marzuqi -Web: www.phpnuxbill.com -Email: iesien22@yahoo.com 2017 Contributor: Ibnu Maksum (@ibnux) @@ -261,7 +259,6 @@ $_L['Plan_Not_found'] = 'Plan Not found'; $_L['Failed_to_create_transaction'] = 'Failed to create transaction.'; $_L['Seller_has_not_yet_setup_Xendit_payment_gateway'] = 'Seller has not yet setup Xendit payment gateway'; $_L['Admin_has_not_yet_setup_Xendit_payment_gateway_please_tell_admin'] = 'Admin has not yet setup Xendit payment gateway, please tell admin'; -$_L['Buy_this_your_active_package_will_be_overwrite'] = 'Buy this? your active package will be overwrite'; $_L['You_already_have_unpaid_transaction_cancel_it_or_pay_it'] = 'You already have unpaid transaction, cancel it or pay it.'; $_L['Transaction_Not_found'] = 'Transaction Not found'; $_L['Cancel_it'] = 'Cancel it?'; @@ -314,7 +311,6 @@ $_L['User_Notification'] = 'User Notification'; $_L['Expired_Notification'] = 'Expired Notification'; $_L['User_will_get_notification_when_package_expired'] = 'User will get notification when package expired'; $_L['Expired_Notification_Message'] = 'Expired Notification Message'; -$_L['bnameb_will_be_replaced_with_Customer_Name_bpackageb_will_be_replaced_with_Package_name'] = '[[name]] will be replaced with Customer Name. [[package]] will be replaced with Package name.'; $_L['Payment_Notification'] = 'Payment Notification'; $_L['User_will_get_invoice_notification_when_buy_package_or_package_refilled'] = 'User will get invoice notification when buy package or package refilled'; $_L['Current_IP'] = 'Current IP'; @@ -411,18 +407,14 @@ $_L['Resend_To_Customer'] = 'Resend To Customer'; $_L['Your_friend_do_not_have_active_package'] = 'Your friend do not have active package'; $_L['Service_Type'] = 'Service Type'; $_L['Others'] = 'Others'; -$_L['PPPoE'] = 'PPPoE'; -$_L['Hotspot'] = 'Hotspot'; -$_L['Disable_Registration'] = 'Disable Registration'; -$_L['Customer_just_Login_with_Phone_number_and_Voucher_Code_Voucher_will_be_password'] = 'Customer just Login with Phone number and Voucher Code, Voucher will be password'; -$_L['Login__Activate_Voucher'] = 'Login / Activate Voucher'; -$_L['After_Customer_activate_voucher_or_login_customer_will_be_redirected_to_this_url'] = 'After Customer activate voucher or login, customer will be redirected to this url'; -$_L['Voucher_Prefix'] = 'Voucher Prefix'; -$_L['Voucher_activation_success_now_you_can_login'] = 'Voucher activation success, now you can login'; -$_L['Client_Can_Purchase'] = 'Client Can Purchase'; -$_L['Buy_this_your_active_package_will_be_overwritten'] = 'Buy this? your active package will be overwritten'; -$_L['Pay_this_with_Balance_your_active_package_will_be_overwritten'] = 'Pay this with Balance? your active package will be overwritten'; -$_L['Buy_this_your_active_package_will_be_overwritten'] = 'Buy this? your active package will be overwritten'; -$_L['Pay_this_with_Balance_your_active_package_will_be_overwritten'] = 'Pay this with Balance? your active package will be overwritten'; -$_L['Buy_this_your_active_package_will_be_overwritten'] = 'Buy this? your active package will be overwritten'; -$_L['Pay_this_with_Balance_your_active_package_will_be_overwritten'] = 'Pay this with Balance? your active package will be overwritten'; +$_L['PPPoE'] = 'PPPoE'; +$_L['Hotspot'] = 'Hotspot'; +$_L['Disable_Registration'] = 'Disable Registration'; +$_L['Customer_just_Login_with_Phone_number_and_Voucher_Code_Voucher_will_be_password'] = 'Customer just Login with Phone number and Voucher Code, Voucher will be password'; +$_L['Login__Activate_Voucher'] = 'Login / Activate Voucher'; +$_L['After_Customer_activate_voucher_or_login_customer_will_be_redirected_to_this_url'] = 'After Customer activate voucher or login, customer will be redirected to this url'; +$_L['Voucher_Prefix'] = 'Voucher Prefix'; +$_L['Voucher_activation_success_now_you_can_login'] = 'Voucher activation success, now you can login'; +$_L['Client_Can_Purchase'] = 'Client Can Purchase'; +$_L['Buy_this_your_active_package_will_be_overwritten'] = 'Buy this? your active package will be overwritten'; +$_L['Pay_this_with_Balance_your_active_package_will_be_overwritten'] = 'Pay this with Balance? your active package will be overwritten'; diff --git a/system/lan/indonesia/common.lan.php b/system/lan/indonesia/common.lan.php index f6a88e37..22c42831 100644 --- a/system/lan/indonesia/common.lan.php +++ b/system/lan/indonesia/common.lan.php @@ -3,9 +3,6 @@ ----------------------------------- Language Name: Indonesia Contributor: Ismail Marzuqi -Web: www.phpnuxbill.com -Email: iesien22@yahoo.com - 2017 Contributor: Ibnu Maksum (@ibnux) diff --git a/ui/ui/app-notifications.tpl b/ui/ui/app-notifications.tpl index b3d14000..2471c979 100644 --- a/ui/ui/app-notifications.tpl +++ b/ui/ui/app-notifications.tpl @@ -21,7 +21,7 @@ rows="3">{if $_json['expired']!=''}{Lang::htmlspecialchars($_json['expired'])}{else}Hello [[name]], your internet package [[package]] has been expired.{/if}

- {Lang::T('[[name]] will be replaced with Customer Name. [[package]] will be replaced with Package name.')} + [[name]] will be replaced with Customer Name. [[package]] will be replaced with Package name. [[price]] will be replaced with Package price.

@@ -33,7 +33,7 @@ rows="3">{Lang::htmlspecialchars($_json['reminder_7_day'])}

- {Lang::T('[[name]] will be replaced with Customer Name. [[package]] will be replaced with Package name.')} + [[name]] will be replaced with Customer Name. [[package]] will be replaced with Package name. [[price]] will be replaced with Package price.

@@ -45,7 +45,7 @@ rows="3">{Lang::htmlspecialchars($_json['reminder_3_day'])}

- {Lang::T('[[name]] will be replaced with Customer Name. [[package]] will be replaced with Package name.')} + [[name]] will be replaced with Customer Name. [[package]] will be replaced with Package name. [[price]] will be replaced with Package price.

@@ -57,7 +57,7 @@ rows="3">{Lang::htmlspecialchars($_json['reminder_1_day'])}

- {Lang::T('[[name]] will be replaced with Customer Name. [[package]] will be replaced with Package name.')} + [[name]] will be replaced with Customer Name. [[package]] will be replaced with Package name. [[price]] will be replaced with Package price.

diff --git a/version.json b/version.json index 8cd16b4f..88c0648d 100644 --- a/version.json +++ b/version.json @@ -1,3 +1,3 @@ { - "version": "2024.1.15" + "version": "2024.1.16" } \ No newline at end of file