Different Reminder for PPPOE and Hotspot using <divider>

This commit is contained in:
iBNu Maksum 2025-03-11 11:55:48 +07:00
parent 827bb8706d
commit 3c7e6c7a64
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
4 changed files with 109 additions and 24 deletions

View File

@ -393,6 +393,18 @@ class Message
}
}
public static function getMessageType($type, $message){
if(strpos($message, "<divider>") === false){
return $message;
}
$msgs = explode("<divider>", $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();

View File

@ -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());
}
}
}
}
}

View File

@ -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"
}

View File

@ -35,18 +35,6 @@
</div>
</div>
</div>
<div class="box box-hovered mb20 box-primary">
<div class="box-header">
<h3 class="box-title">{Lang::T('')}Feedback</h3>
</div>
<div class="box-body">
{Lang::T('Feedback and Bug Report')}
</div>
<div class="box-footer">
<a href="https://github.com/hotspotbilling/phpnuxbill/issues" target="_blank"
class="btn btn-primary btn-sm btn-block"><i class="ion ion-chatboxes"></i> {Lang::T('Give Feedback')}</a>
</div>
</div>
</div>
</div>
@ -131,7 +119,9 @@
<div class="box-header">
<h3 class="box-title">{Lang::T('Chat with me')}</h3>
</div>
<div class="box-body">{Lang::T('$50 Paid Support')}<br>{Lang::T('donation confirmation?')}<br>{Lang::T('Or ask any Donation Alternative')}</div>
<div class="box-body">
{Lang::T('$50 Paid Support')}<br>{Lang::T('donation confirmation?')}<br>{Lang::T('Or ask any Donation Alternative')}
</div>
<div class="box-footer">
<a href="https://t.me/ibnux" target="_blank" class="btn btn-primary btn-sm btn-block">Telegram</a>
</div>
@ -155,7 +145,8 @@
<h3 class="box-title">PHPNUXBILL</h3>
</div>
<div class="box-body">
<b>PHPNuxBill</b> {Lang::T('is a billing Hotspot and PPPOE for Mikrotik using PHP and Mikrotik API to comunicate
<b>PHPNuxBill</b>
{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.')}<br>{Lang::T('Watch project')} <a
href="https://github.com/hotspotbilling/phpnuxbill" target="_blank">{Lang::T('in here')}</a>
</div>
@ -163,16 +154,19 @@
<div class="box-footer" id="latestVersion">ver</div>
<div class="box-footer">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="./update.php" class="btn btn-success btn-sm btn-block">{Lang::T('Install Latest Version')}</a>
<a href="./update.php"
class="btn btn-success btn-sm btn-block">{Lang::T('Install Latest Version')}</a>
<a href="https://github.com/hotspotbilling/phpnuxbill/archive/refs/heads/master.zip" target="_blank"
class="btn btn-warning btn-sm btn-block text-black">{Lang::T('Download Latest Version')}</a>
</div>
<center><a href="{Text::url('community/rollback')}" class="btn btn-link btn-sm btn-block">{Lang::T('Select Old Version')}</a>
<center><a href="{Text::url('community/rollback')}"
class="btn btn-link btn-sm btn-block">{Lang::T('Select Old Version')}</a>
</center>
</div>
<div class="box-footer">
<div class="btn-group btn-group-justified" role="group" aria-label="...">
<a href="./CHANGELOG.md" target="_blank" class="btn btn-default btn-sm btn-block">{Lang::T('Current Changelog')}</a>
<a href="./CHANGELOG.md" target="_blank"
class="btn btn-default btn-sm btn-block">{Lang::T('Current Changelog')}</a>
<a href="https://github.com/hotspotbilling/phpnuxbill/blob/master/CHANGELOG.md" target="_blank"
class="btn btn-default btn-sm btn-block">{Lang::T('Repo Changelog')}</a>
</div>
@ -183,6 +177,44 @@
<a href="./update.php?step=4" class="btn btn-default btn-sm btn-block">{Lang::T('Update Database')}</a>
</div>
</div>
<div class="box box-hovered mb20 box-primary">
<div class="box-header">
<h3 class="box-title">{Lang::T('Credits')}</h3>
</div>
<table class="table table-sm">
<tr>
<td>
<ul>
<li>Bootstrap V3 <a href="https://getbootstrap.com/docs/3.4/" target="_blank"><i
class="glyphicon glyphicon-globe"></i></a></li>
<li>Admin LTE V3 <a href="https://adminlte.io/themes/v3/" target="_blank"><i
class="glyphicon glyphicon-globe"></i></a></li>
<li>Smarty Template V4 <a href="https://www.smarty.net/" target="_blank"><i
class="glyphicon glyphicon-globe"></i></a></li>
<li>PHP IdiORM <a href="https://idiorm.readthedocs.io/" target="_blank"><i
class="glyphicon glyphicon-globe"></i></a></li>
<li>PHP mPDF <a href="https://mpdf.github.io/" target="_blank"><i
class="glyphicon glyphicon-globe"></i></a></li>
</ul>
</td>
<td>
<ul>
<li>PHP QRCode <a href="http://phpqrcode.sourceforge.net/" target="_blank"><i
class="glyphicon glyphicon-globe"></i></a></li>
<li>PHP Net_RouterOS<a href="https://github.com/pear2/Net_RouterOS" target="_blank"><i
class="glyphicon glyphicon-globe"></i></a></li>
<li>Summernote <a href="https://summernote.org/" target="_blank"><i
class="glyphicon glyphicon-globe"></i></a></li>
<li>PHP Mailer <a href="https://github.com/PHPMailer/PHPMailer/" target="_blank"><i
class="glyphicon glyphicon-globe"></i></a></li>
</ul>
</td>
</tr>
</table>
<div class="box-body">
</div>
</div>
</div>
</div>
<script>
@ -197,4 +229,4 @@
});
});
</script>
{include file="sections/footer.tpl"}
{include file="sections/footer.tpl"}