From 3c7e6c7a64c535eafdc46460c86f0cacb418f447 Mon Sep 17 00:00:00 2001 From: iBNu Maksum Date: Tue, 11 Mar 2025 11:55:48 +0700 Subject: [PATCH] Different Reminder for PPPOE and Hotspot using --- system/autoload/Message.php | 12 +++++++ system/cron_reminder.php | 27 ++++++++++++--- system/lan/english.json | 26 +++++++++++++- ui/ui/admin/community.tpl | 68 +++++++++++++++++++++++++++---------- 4 files changed, 109 insertions(+), 24 deletions(-) diff --git a/system/autoload/Message.php b/system/autoload/Message.php index 9dc6d520..db4624d4 100644 --- a/system/autoload/Message.php +++ b/system/autoload/Message.php @@ -393,6 +393,18 @@ class Message } } + public static function getMessageType($type, $message){ + if(strpos($message, "") === false){ + return $message; + } + $msgs = explode("", $message); + if($type == "PPPOE"){ + return $msgs[1]; + }else{ + return $msgs[0]; + } + } + public static function logMessage($messageType, $recipient, $messageContent, $status, $errorMessage = null) { $log = ORM::for_table('tbl_message_logs')->create(); diff --git a/system/cron_reminder.php b/system/cron_reminder.php index bb163ea3..ad4adbca 100644 --- a/system/cron_reminder.php +++ b/system/cron_reminder.php @@ -51,23 +51,40 @@ foreach ($d as $ds) { } if ($ds['expiration'] == $day7 && $config['notification_reminder_7day'] !== 'no') { try { - echo Message::sendPackageNotification($c, $p['name_plan'], $price, Lang::getNotifText('reminder_7_day'), $config['user_notification_reminder']) . "\n"; + echo Message::sendPackageNotification( + $c, + $p['name_plan'], + $price, + Message::getMessageType($p['type'], Lang::getNotifText('reminder_7_day')), + $config['user_notification_reminder'] + ) . "\n"; } catch (Exception $e) { sendTelegram("Cron Reminder failed to send 7-day reminder to " . $ds['username'] . " Error: " . $e->getMessage()); } } else if ($ds['expiration'] == $day3 && $config['notification_reminder_3day'] !== 'no') { try { - echo Message::sendPackageNotification($c, $p['name_plan'], $price, Lang::getNotifText('reminder_3_day'), $config['user_notification_reminder']) . "\n"; + echo Message::sendPackageNotification( + $c, + $p['name_plan'], + $price, + Message::getMessageType($p['type'], Lang::getNotifText('reminder_3_day')), + $config['user_notification_reminder'] + ) . "\n"; } catch (Exception $e) { sendTelegram("Cron Reminder failed to send 3-day reminder to " . $ds['username'] . " Error: " . $e->getMessage()); } } else if ($ds['expiration'] == $day1 && $config['notification_reminder_1day'] !== 'no') { try { - echo Message::sendPackageNotification($c, $p['name_plan'], $price, Lang::getNotifText('reminder_1_day'), $config['user_notification_reminder']) . "\n"; + echo Message::sendPackageNotification( + $c, + $p['name_plan'], + $price, + Message::getMessageType($p['type'], Lang::getNotifText('reminder_1_day')), + $config['user_notification_reminder'] + ) . "\n"; } catch (Exception $e) { sendTelegram("Cron Reminder failed to send 1-day reminder to " . $ds['username'] . " Error: " . $e->getMessage()); } } - } -} \ No newline at end of file +} diff --git a/system/lan/english.json b/system/lan/english.json index a6889087..8c42d1a0 100644 --- a/system/lan/english.json +++ b/system/lan/english.json @@ -1120,5 +1120,29 @@ "Delete_this_widget_": "Delete this widget?", "Remove_this_widget_": "Remove this widget?", "PPPoE_Remote_IP": "PPPoE Remote IP", - "Continue_the_Recharge_process": "Continue the Recharge process" + "Continue_the_Recharge_process": "Continue the Recharge process", + "Contributors": "Contributors", + "Discussions": "Discussions", + "Get_help_from_community": "Get help from community", + "Github_Discussions": "Github Discussions", + "Telegram_Group": "Telegram Group", + "Feedback_and_Bug_Report": "Feedback and Bug Report", + "Give_Feedback": "Give Feedback", + "Chat_with_me": "Chat with me", + "_50_Paid_Support": "$50 Paid Support", + "donation_confirmation_": "donation confirmation?", + "Or_ask_any_Donation_Alternative": "Or ask any Donation Alternative", + "Free_WhatsApp_Gateway_and_Telegram_Bot_creater": "Free WhatsApp Gateway and Telegram Bot creater", + "There_is_a_Telegram_bot_wizard_in_here": "There is a Telegram bot wizard in here", + "is_a_billing_Hotspot_and_PPPOE_for_Mikrotik_using_PHP_and_Mikrotik_API_to_comunicate_with_router__If_you_get_more_profit_with_this_application__please_donate_us_": "is a billing Hotspot and PPPOE for Mikrotik using PHP and Mikrotik API to comunicate with router. If you get more profit with this application, please donate us.", + "Watch_project": "Watch project", + "in_here": "in here", + "Install_Latest_Version": "Install Latest Version", + "Download_Latest_Version": "Download Latest Version", + "Select_Old_Version": "Select Old Version", + "Current_Changelog": "Current Changelog", + "Repo_Changelog": "Repo Changelog", + "If_you_Download_manual_the_update_file__sometime_update_change_database__after_uploading__click_this_button_to_update_database_structure_": "If you Download manual the update file, sometime update change database, after uploading, click this button to update database structure.", + "Update_Database": "Update Database", + "Credits": "Credits" } \ No newline at end of file diff --git a/ui/ui/admin/community.tpl b/ui/ui/admin/community.tpl index 34a4fc0d..df727ccd 100644 --- a/ui/ui/admin/community.tpl +++ b/ui/ui/admin/community.tpl @@ -35,18 +35,6 @@ -
-
-

{Lang::T('')}Feedback

-
-
- {Lang::T('Feedback and Bug Report')} -
- -
@@ -131,7 +119,9 @@

{Lang::T('Chat with me')}

-
{Lang::T('$50 Paid Support')}
{Lang::T('donation confirmation?')}
{Lang::T('Or ask any Donation Alternative')}
+
+ {Lang::T('$50 Paid Support')}
{Lang::T('donation confirmation?')}
{Lang::T('Or ask any Donation Alternative')} +
@@ -155,7 +145,8 @@

PHPNUXBILL

- PHPNuxBill {Lang::T('is a billing Hotspot and PPPOE for Mikrotik using PHP and Mikrotik API to comunicate + PHPNuxBill + {Lang::T('is a billing Hotspot and PPPOE for Mikrotik using PHP and Mikrotik API to comunicate with router. If you get more profit with this application, please donate us.')}
{Lang::T('Watch project')} {Lang::T('in here')}
@@ -163,16 +154,19 @@ + +
+
+

{Lang::T('Credits')}

+
+ + + + + +
+
    +
  • Bootstrap V3
  • +
  • Admin LTE V3
  • +
  • Smarty Template V4
  • +
  • PHP IdiORM
  • +
  • PHP mPDF
  • +
+
+
    +
  • PHP QRCode
  • +
  • PHP Net_RouterOS
  • +
  • Summernote
  • +
  • PHP Mailer
  • +
+
+
+
+
-{include file="sections/footer.tpl"} +{include file="sections/footer.tpl"} \ No newline at end of file