add notification settings

This commit is contained in:
Ibnu Maksum 2023-03-06 14:49:26 +07:00
parent 6042538d8e
commit 3130310d9c
No known key found for this signature in database
GPG Key ID: 7FC82848810579E5
3 changed files with 80 additions and 14 deletions

View File

@ -210,6 +210,9 @@ switch ($action) {
$telegram_target_id = _post('telegram_target_id');
$sms_url = _post('sms_url');
$wa_url = _post('wa_url');
$user_notification_expired = _post('user_notification_expired');
$user_notification_expired_text = _post('user_notification_expired_text');
$user_notification_payment = _post('user_notification_payment');
$address = _post('address');
$tawkto = _post('tawkto');
$radius_mode = _post('radius_mode')*1;
@ -286,6 +289,38 @@ switch ($action) {
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'user_notification_expired')->find_one();
if($d){
$d->value = $user_notification_expired;
$d->save();
}else{
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'user_notification_expired';
$d->value = $user_notification_expired;
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'user_notification_expired_text')->find_one();
if($d){
$d->value = $user_notification_expired_text;
$d->save();
}else{
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'user_notification_expired_text';
$d->value = $user_notification_expired_text;
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'user_notification_payment')->find_one();
if($d){
$d->value = $user_notification_payment;
$d->save();
}else{
$d = ORM::for_table('tbl_appconfig')->create();
$d->setting = 'user_notification_payment';
$d->value = $user_notification_payment;
$d->save();
}
$d = ORM::for_table('tbl_appconfig')->where('setting', 'tawkto')->find_one();
if($d){

View File

@ -26,7 +26,7 @@
<label class="col-md-2 control-label">{$_L['Address']}</label>
<div class="col-md-6">
<textarea class="form-control" id="address" name="address"
rows="3">{$_c['address']}</textarea>
rows="3">{Lang::htmlspecialchars($_c['address'])}</textarea>
<span class="help-block">{$_L['You_can_use_html_tag']}</span>
</div>
</div>
@ -100,6 +100,38 @@
</div>
</div>
</div>
<div class="panel-heading">{Lang::T('User Notification')}</div>
<div class="panel-body">
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Expired Notification')}</label>
<div class="col-md-6">
<select name="user_notification_expired" id="user_notification_expired" class="form-control">
<option value="none">None</option>
<option value="wa" {if $_c['user_notification_expired'] == 'wa'}selected="selected" {/if}>Whatsapp</option>
<option value="sms" {if $_c['user_notification_expired'] == 'sms'}selected="selected" {/if}>SMS</option>
</select>
<p class="help-block">{Lang::T('User will get notification when package expired')}</p>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Expired Notification Message')}</label>
<div class="col-md-6">
<textarea class="form-control" id="user_notification_expired_text" name="user_notification_expired_text" placeholder="Hello [[name]], your internet package [[package]] has been expired" rows="3">{if $_c['user_notification_expired_text']!=''}{Lang::htmlspecialchars($_c['user_notification_expired_text'])}{else}Hello [[name]], your internet package [[package]] has been expired.{/if}</textarea>
<p class="help-block">{Lang::T('<b>[[name]]</b> will be replaced with Customer Name. <b>[[package]]</b> will be replaced with Package name.')}</p>
</div>
</div>
<div class="form-group">
<label class="col-md-2 control-label">{Lang::T('Payment Notification')}</label>
<div class="col-md-6">
<select name="user_notification_payment" id="user_notification_payment" class="form-control">
<option value="none">None</option>
<option value="wa" {if $_c['user_notification_payment'] == 'wa'}selected="selected" {/if}>Whatsapp</option>
<option value="sms" {if $_c['user_notification_payment'] == 'sms'}selected="selected" {/if}>SMS</option>
</select>
<p class="help-block">{Lang::T('User will get notification when buy package or package refilled')}</p>
</div>
</div>
</div>
<div class="panel-heading">Tawk.to Chat Widget</div>
<div class="panel-body">
<div class="form-group">
@ -119,7 +151,7 @@ add dst-host=*.tawk.to</pre>
<div class="form-group">
<label class="col-md-2 control-label">Note Invoice</label>
<div class="col-md-6">
<textarea class="form-control" id="note" name="note" rows="3">{$_c['note']}</textarea>
<textarea class="form-control" id="note" name="note" rows="3">{Lang::htmlspecialchars($_c['note'])}</textarea>
<span class="help-block">{$_L['You_can_use_html_tag']}</span>
</div>
</div>

View File

@ -1,5 +1,4 @@
</section>
</div>
{if isset($_c['CompanyFooter'])}
<footer class="main-footer">