<?php
/* Smarty version 4.5.3, created on 2024-12-04 09:59:18
  from '/var/www/html/admin/ui/ui_custom/app-settings.tpl' */

/* @var Smarty_Internal_Template $_smarty_tpl */
if ($_smarty_tpl->_decodeProperties($_smarty_tpl, array (
  'version' => '4.5.3',
  'unifunc' => 'content_674ffdc62e3820_76703540',
  'has_nocache_code' => false,
  'file_dependency' => 
  array (
    'b08e5ffdaa0c9ec1447fa45dfff0fa8979ebda71' => 
    array (
      0 => '/var/www/html/admin/ui/ui_custom/app-settings.tpl',
      1 => 1732165181,
      2 => 'file',
    ),
  ),
  'includes' => 
  array (
    'file:sections/header.tpl' => 1,
    'file:sections/footer.tpl' => 1,
  ),
),false)) {
function content_674ffdc62e3820_76703540 (Smarty_Internal_Template $_smarty_tpl) {
$_smarty_tpl->_subTemplateRender("file:sections/header.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
echo '<script'; ?>
 src="https://code.jquery.com/jquery-3.6.0.min.js"><?php echo '</script'; ?>
>


    <form class="form-horizontal" method="post" role="form" action="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
settings/app-post" enctype="multipart/form-data">
        <input type="hidden" name="csrf_token" value="<?php echo $_smarty_tpl->tpl_vars['csrf_token']->value;?>
">
        <div class="container-fluid">
            <form class="form-horizontal" method="post" role="form" action="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
settings/app-post" enctype="multipart/form-data">
        <!-- General Settings -->
        <div class="row mb-3">
            <div class="col-sm-12">
                <div class="card card-primary card-hovered card-stacked">
                    <div class="card-title text-center">
                        <div class="btn-group pull-right">
                            <button class="btn btn-primary btn-xs" title="save" type="submit">
                                <span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span> Save
                            </button>
                        </div>
                        <?php echo Lang::T('General Settings');?>

                    </div>
                    <div class="card-body">
                        <div class="form-group row">
                            <label class="col-md-2 control-label"><?php echo Lang::T('Application Name / Company Name');?>
</label>
                            <div class="col-md-6">
                                <input type="text" required class="form-control" id="CompanyName" name="CompanyName"
                                       value="<?php echo $_smarty_tpl->tpl_vars['_c']->value['CompanyName'];?>
">
                            </div>
                            <span class="help-block col-md-4"><?php echo Lang::T('This Name will be shown on the Title');?>
</span>
                        </div>
                        <div class="form-group row">
                            <label class="col-md-2 control-label"><?php echo Lang::T('Company Logo');?>
</label>
                            <div class="col-md-6">
                                <input type="file" class="form-control" id="logo" name="logo" accept="image/*">
                                <span class="help-block"><?php echo Lang::T('For PDF Reports | Best size 1078 x 200 | uploaded image will be
                                    autosize');?>
</span>
                            </div>
                            <span class="help-block col-md-4">
                                <a href="./<?php echo $_smarty_tpl->tpl_vars['logo']->value;?>
" target="_blank"><img src="./<?php echo $_smarty_tpl->tpl_vars['logo']->value;?>
" height="48" alt="logo for PDF"></a>
                            </span>
                        </div>
                        
                        <div class="form-group row">
                            <label class="col-md-2 control-label"><?php echo Lang::T('Phone Number');?>
</label>
                            <div class="col-md-6">
                                <input type="text" class="form-control" id="phone" name="phone" value="<?php echo $_smarty_tpl->tpl_vars['_c']->value['phone'];?>
">
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-md-2 control-label"><?php echo Lang::T('Income reset date');?>
</label>
                            <div class="col-md-6">
                                <input type="number" required class="form-control" id="reset_day" placeholder="20" min="1"
                                    max="28" step="1" name="reset_day" value="<?php echo $_smarty_tpl->tpl_vars['_c']->value['reset_day'];?>
">
                            </div>
                            <span class="help-block col-md-4"><?php echo Lang::T('Income will reset every this
                                day');?>
</span>
                        </div>
                        <div class="form-group row">
                            <label class="col-md-2 control-label"><?php echo Lang::T('Company Footer');?>
</label>
                            <div class="col-md-6">
                                <input type="text" required class="form-control" id="CompanyFooter" name="CompanyFooter"
                                    value="<?php echo $_smarty_tpl->tpl_vars['_c']->value['CompanyFooter'];?>
">
                            </div>
                            <span class="help-block col-md-4"><?php echo Lang::T('Will show below user pages');?>
</span>
                        </div>
                        <div class="form-group row">
                            <label class="col-md-2 control-label"><?php echo Lang::T('Address');?>
</label>
                            <div class="col-md-6">
                                <textarea class="form-control" id="address" name="address"
                                    rows="3"><?php echo Lang::htmlspecialchars($_smarty_tpl->tpl_vars['_c']->value['address']);?>
</textarea>
                            </div>
                            <span class="help-block col-md-4"><?php echo Lang::T('You can use html tag');?>
</span>
                        </div>
                    </div>
                </div>
            </div>
        </div>

                <!-- Extend Postpaid Expiration -->
                <div class="row mb-3">
                    <div class="col-sm-12">
                        <div class="card card-primary card-hovered card-stacked">
                            <div class="card-title text-center">
                                <div class="btn-group pull-right">
                                    <button class="btn btn-primary btn-xs" title="save" type="submit">
                                        <span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span> Save
                                    </button>
                                </div>
                                <?php echo Lang::T('Extend Postpaid Expiration');?>

                            </div>
                            <div class="card-body">
                                <div class="form-group row">
                                    <label class="col-md-2 control-label"><?php echo Lang::T('Allow Extend');?>
</label>
                                    <div class="col-md-6">
                                        <select name="extend_expired" id="extend_expired" class="form-control text-muted">
                                            <option value="0"><?php echo Lang::T('No');?>
</option>
                                            <option value="1" <?php if ($_smarty_tpl->tpl_vars['_c']->value['extend_expired'] == 1) {?>selected="selected" <?php }?>>
                                                <?php echo Lang::T('Yes');?>

                                            </option>
                                        </select>
                                    </div>
                                    <p class="help-block col-md-4"><?php echo Lang::T('Customer can request to extend expirations');?>
</p>
                                </div>
                                <div class="form-group row">
                                    <label class="col-md-2 control-label"><?php echo Lang::T('Extend Days');?>
</label>
                                    <div class="col-md-6">
                                        <input type="text" class="form-control" name="extend_days" placeholder="3" value="<?php echo $_smarty_tpl->tpl_vars['_c']->value['extend_days'];?>
">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-md-2 control-label"><?php echo Lang::T('Confirmation Message');?>
</label>
                                    <div class="col-md-6">
                                        <textarea type="text" rows="4" class="form-control" name="extend_confirmation" placeholder="<?php echo Lang::T('i agree to extends and will paid full after this');?>
"><?php echo $_smarty_tpl->tpl_vars['_c']->value['extend_confirmation'];?>
</textarea>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
                <form class="form-horizontal" method="post" role="form" action="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
settings/login-page-post" enctype="multipart/form-data">
                    <input type="hidden" name="csrf_token" value="<?php echo $_smarty_tpl->tpl_vars['csrf_token']->value;?>
">
                    <div class="card">
                        <div class="card-header">
                            <h3 class="card-title">
                                <?php echo Lang::T('Customer Login Page Settings');?>

                            </h3>
                        </div>
                        <div class="card-body">
                            <div class="form-group">
                                <label class="col-md-2 control-label"><?php echo Lang::T('Choose Template');?>
</label>
                                <div class="col-md-6">
                                    <select name="login_page_type" id="login_page_type" class="form-control">
                                        <option value="default" <?php if ($_smarty_tpl->tpl_vars['_c']->value['login_page_type'] == 'default') {?>selected="selected" <?php }?>>
                                            <?php echo Lang::T('Default');?>

                                        </option>
                                        <option value="custom" <?php if ($_smarty_tpl->tpl_vars['_c']->value['login_page_type'] == 'custom') {?>selected="selected" <?php }?>>
                                            <?php echo Lang::T('Custom');?>

                                        </option>
                                    </select>
                                </div>
                                <span class="help-block col-md-4"><small><?php echo Lang::T('Select your login template type');?>
</small></span>
                            </div>
                            <div id="customFields" style="display: none;">
                                <div class="form-group">
                                    <label class="col-md-2 control-label"><?php echo Lang::T('Select Login Page');?>
</label>
                                    <div class="col-md-6">
                                        <select name="login_Page_template" id="login_Page_template" class="form-control">
                                            <?php
$_from = $_smarty_tpl->smarty->ext->_foreach->init($_smarty_tpl, $_smarty_tpl->tpl_vars['template_files']->value, 'template');
$_smarty_tpl->tpl_vars['template']->do_else = true;
if ($_from !== null) foreach ($_from as $_smarty_tpl->tpl_vars['template']->value) {
$_smarty_tpl->tpl_vars['template']->do_else = false;
?>
                                                <option value="<?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['template']->value['value'], ENT_QUOTES, 'UTF-8', true);?>
"
                                                    <?php if ($_smarty_tpl->tpl_vars['_c']->value['login_Page_template'] == $_smarty_tpl->tpl_vars['template']->value['value']) {?>selected="selected" <?php }?>>
                                                    <?php echo htmlspecialchars((string)$_smarty_tpl->tpl_vars['template']->value['name'], ENT_QUOTES, 'UTF-8', true);?>

                                                </option>
                                            <?php
}
$_smarty_tpl->smarty->ext->_foreach->restore($_smarty_tpl, 1);?>
                                        </select>
                                    </div>
                                    <span class="help-block col-md-4"><small><?php echo Lang::T('Select your preferred login template');?>
</small></span>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label"><?php echo Lang::T('Page Heading / Company Name');?>
</label>
                                    <div class="col-md-6">
                                        <input type="text" required class="form-control" id="login_page_head" name="login_page_head"
                                            value="<?php echo $_smarty_tpl->tpl_vars['_c']->value['login_page_head'];?>
">
                                    </div>
                                    <span class="help-block col-md-4"><small><?php echo Lang::T('This Name will be shown on the login wallpaper');?>
</small></span>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label"><?php echo Lang::T('Page Description');?>
</label>
                                    <div class="col-md-6">
                                        <textarea class="form-control" id="login_page_description" name="login_page_description" rows="3">
                                            <?php echo Lang::htmlspecialchars($_smarty_tpl->tpl_vars['_c']->value['login_page_description']);?>

                                        </textarea>
                                    </div>
                                    <span class="help-block col-md-4"><small><?php echo Lang::T('This will also display on wallpaper, You can use html tag');?>
</small></span>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label"><?php echo Lang::T('Favicon');?>
</label>
                                    <div class="col-md-6">
                                        <input type="file" class="form-control" id="login_page_favicon" name="login_page_favicon" accept="image/*">
                                        <span class="help-block"><small><?php echo Lang::T('Best size 30 x 30 | uploaded image will be autosize');?>
</small></span>
                                    </div>
                                    <span class="help-block col-md-4">
                                        <a href="./<?php echo $_smarty_tpl->tpl_vars['favicon']->value;?>
" target="_blank"><img src="./<?php echo $_smarty_tpl->tpl_vars['favicon']->value;?>
" height="48" alt="Favicon"></a>
                                    </span>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label"><?php echo Lang::T('Login Page Logo');?>
</label>
                                    <div class="col-md-6">
                                        <input type="file" class="form-control" id="login_page_logo" name="login_page_logo" accept="image/*">
                                        <span class="help-block"><small><?php echo Lang::T('Best size 300 x 60 | uploaded image will be autosize');?>
</small></span>
                                    </div>
                                    <span class="help-block col-md-4">
                                        <a href="./<?php echo $_smarty_tpl->tpl_vars['login_logo']->value;?>
" target="_blank"><img src="./<?php echo $_smarty_tpl->tpl_vars['login_logo']->value;?>
" height="48" alt="Logo"></a>
                                    </span>
                                </div>
                                <div class="form-group">
                                    <label class="col-md-2 control-label"><?php echo Lang::T('Login Page Wallpaper');?>
</label>
                                    <div class="col-md-6">
                                        <input type="file" class="form-control" id="login_page_wallpaper" name="login_page_wallpaper" accept="image/*">
                                        <span class="help-block"><small><?php echo Lang::T('Best size 1920 x 1080 | uploaded image will be autosize');?>
</small></span>
                                    </div>
                                    <span class="help-block col-md-4">
                                        <a href="./<?php echo $_smarty_tpl->tpl_vars['wallpaper']->value;?>
" target="_blank"><img src="./<?php echo $_smarty_tpl->tpl_vars['wallpaper']->value;?>
" height="48" alt="Wallpaper"></a>
                                    </span>
                                </div>
                            </div>
                
                            <button class="btn btn-success btn-block" name="general" type="submit">
                                <?php echo Lang::T('Save Changes');?>

                            </button>
                        </div>
                    </div>
                </form>
                
                <?php echo '<script'; ?>
 src="https://code.jquery.com/jquery-3.6.0.min.js"><?php echo '</script'; ?>
>
                <?php echo '<script'; ?>
>
                    $(document).ready(function() {
                        // Trigger the change event to show or hide the customFields section on page load based on the selected template type
                        if ($('#login_page_type').val() == 'custom') {
                            $('#customFields').show();
                        }
                
                        // Toggle visibility of customFields based on dropdown selection
                        $('#login_page_type').change(function() {
                            if ($(this).val() == 'custom') {
                                $('#customFields').show();
                            } else {
                                $('#customFields').hide();
                            }
                        });
                    });
                <?php echo '</script'; ?>
>
                
                
                <?php echo '<script'; ?>
>
                    $(document).ready(function() {
                        $('#login_page_type').change(function() {
                            if ($(this).val() == 'custom') {
                                $('#customFields').show();
                            } else {
                                $('#customFields').hide();
                            }
                        });
                    });
                <?php echo '</script'; ?>
>
                
                
                <form class="form-horizontal" method="post" role="form" action="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
settings/app-post" enctype="multipart/form-data">
                    <input type="hidden" name="csrf_token" value="<?php echo $_smarty_tpl->tpl_vars['csrf_token']->value;?>
">
                    <div class="card">
                        <div class="card-header">
                            <h4 class="card-title">
                                <?php echo Lang::T('Registration');?>

                            </h4>
                        </div>
                        <div class="card-body">
                            <div class="form-group row">
                                <label class="col-md-2 control-label"><?php echo Lang::T('Allow Registration');?>
</label>
                                <div class="col-md-6">
                                    <select name="disable_registration" id="disable_registration" class="form-control">
                                        <option value="no" <?php if ($_smarty_tpl->tpl_vars['_c']->value['disable_registration'] == 'no') {?>selected="selected" <?php }?>>
                                            <?php echo Lang::T('Yes');?>

                                        </option>
                                        <?php if ($_smarty_tpl->tpl_vars['_c']->value['disable_voucher'] != 'yes') {?>
                                            <option value="yes" <?php if ($_smarty_tpl->tpl_vars['_c']->value['disable_registration'] == 'yes') {?>selected="selected" <?php }?>>
                                                <?php echo Lang::T('Voucher Only');?>

                                            </option>
                                        <?php }?>
                                        <option value="noreg" <?php if ($_smarty_tpl->tpl_vars['_c']->value['disable_registration'] == 'noreg') {?>selected="selected" <?php }?>>
                                            <?php echo Lang::T('No Registration');?>

                                        </option>
                                    </select>
                                </div>
                                <p class="help-block col-md-4">
                                    <?php echo Lang::T('Customer just Login with Phone number and Voucher Code, Voucher will be password');?>

                                </p>
                            </div>
                            <div class="form-group row">
                                <label class="col-md-2 control-label"><?php echo Lang::T('Registration Username');?>
</label>
                                <div class="col-md-6">
                                    <select name="registration_username" id="voucher_format" class="form-control">
                                        <option value="username" <?php if ($_smarty_tpl->tpl_vars['_c']->value['registration_username'] == 'username') {?>selected="selected" <?php }?>>Username</option>
                                        <option value="email" <?php if ($_smarty_tpl->tpl_vars['_c']->value['registration_username'] == 'email') {?>selected="selected" <?php }?>>Email</option>
                                        <option value="phone" <?php if ($_smarty_tpl->tpl_vars['_c']->value['registration_username'] == 'phone') {?>selected="selected" <?php }?>>Phone Number</option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-md-2 control-label"><?php echo Lang::T('Photo Required');?>
</label>
                                <div class="col-md-6">
                                    <select name="photo_register" id="photo_register" class="form-control">
                                        <option value="no"><?php echo Lang::T('No');?>
</option>
                                        <option value="yes" <?php if ($_smarty_tpl->tpl_vars['_c']->value['photo_register'] == 'yes') {?>selected="selected" <?php }?>><?php echo Lang::T('Yes');?>
</option>
                                    </select>
                                </div>
                                <p class="help-block col-md-4">
                                    <?php echo Lang::T('Customer Registration need to upload their photo');?>

                                </p>
                            </div>
                            <div class="form-group row">
                                <label class="col-md-2 control-label"><?php echo Lang::T('SMS OTP Registration');?>
</label>
                                <div class="col-md-6">
                                    <select name="sms_otp_registration" id="sms_otp_registration" class="form-control">
                                        <option value="no"><?php echo Lang::T('No');?>
</option>
                                        <option value="yes" <?php if ($_smarty_tpl->tpl_vars['_c']->value['sms_otp_registration'] == 'yes') {?>selected="selected" <?php }?>>
                                            <?php echo Lang::T('Yes');?>

                                        </option>
                                    </select>
                                </div>
                            </div>
                            <div class="form-group row">
                                <label class="col-md-2 control-label"><?php echo Lang::T('Enable Captcha Registration');?>
</label>
                                <div class="col-md-6">
                                    <select name="captcha_register" id="captcha_register" class="form-control">
                                        <option value="no" <?php if ($_smarty_tpl->tpl_vars['_c']->value['captcha_register'] == 'no') {?>selected="selected" <?php }?>><?php echo Lang::T('No');?>
</option>
                                        <option value="yes" <?php if ($_smarty_tpl->tpl_vars['_c']->value['captcha_register'] == 'yes') {?>selected="selected" <?php }?>><?php echo Lang::T('Yes');?>
</option>
                                    </select>
                                </div>
                            </div>
                
                            <button class="btn btn-success btn-block" name="general" type="submit">
                                <?php echo Lang::T('Save Changes');?>

                            </button>
                        </div>
                    </div>
                </form>
                

                <!-- Customer Balance System -->
                <div class="row mb-3">
                    <div class="col-sm-12">
                        <div class="card card-primary card-hovered card-stacked">
                            <div class="card-title text-center">
                                <div class="btn-group pull-right">
                                    <button class="btn btn-primary btn-xs" title="save" type="submit">
                                        <span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span> Save
                                    </button>
                                </div>
                                <?php echo Lang::T('Customer Balance System');?>

                            </div>
                            <div class="card-body">
                                <div class="form-group row">
                                    <label class="col-md-2 control-label"><?php echo Lang::T('Enable System');?>
</label>
                                    <div class="col-md-6">
                                        <select name="enable_balance" id="enable_balance" class="form-control">
                                            <option value="no" <?php if ($_smarty_tpl->tpl_vars['_c']->value['enable_balance'] == 'no') {?>selected="selected"<?php }?>>
                                                <?php echo Lang::T('No');?>

                                            </option>
                                            <option value="yes" <?php if ($_smarty_tpl->tpl_vars['_c']->value['enable_balance'] == 'yes') {?>selected="selected"<?php }?>>
                                                <?php echo Lang::T('Yes');?>

                                            </option>
                                        </select>
                                    </div>
                                    <p class="help-block col-md-4"><?php echo Lang::T('Customer can deposit money to buy voucher');?>
</p>
                                </div>
                                <div class="form-group row">
                                    <label class="col-md-2 control-label"><?php echo Lang::T('Allow Transfer');?>
</label>
                                    <div class="col-md-6">
                                        <select name="allow_balance_transfer" id="allow_balance_transfer" class="form-control">
                                            <option value="no" <?php if ($_smarty_tpl->tpl_vars['_c']->value['allow_balance_transfer'] == 'no') {?>selected="selected"<?php }?>>
                                                <?php echo Lang::T('No');?>

                                            </option>
                                            <option value="yes" <?php if ($_smarty_tpl->tpl_vars['_c']->value['allow_balance_transfer'] == 'yes') {?>selected="selected"<?php }?>>
                                                <?php echo Lang::T('Yes');?>

                                            </option>
                                        </select>
                                    </div>
                                    <p class="help-block col-md-4"><?php echo Lang::T('Allow balance transfer between customers');?>
</p>
                                </div>
                                <div class="form-group row">
                                    <label class="col-md-2 control-label"><?php echo Lang::T('Minimum Balance Transfer');?>
</label>
                                    <div class="col-md-6">
                                        <input type="number" class="form-control" id="minimum_transfer" name="minimum_transfer" value="<?php echo $_smarty_tpl->tpl_vars['_c']->value['minimum_transfer'];?>
">
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
        
                <!-- Telegram Notification -->
                <div class="row mb-3">
                    <div class="col-sm-12">
                        <div class="card card-primary card-hovered card-stacked">
                            <div class="card-title text-center">
                                <div class="btn-group pull-right">
                                    <a class="btn btn-success btn-xs" style="color: black;" href="javascript:testTg()">Test TG</a>
                                    <button class="btn btn-primary btn-xs" title="save" type="submit">
                                        <span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span> Save
                                    </button>
                                </div>
                                <?php echo Lang::T('Telegram Notification');?>

                            </div>
                            <div class="card-body">
                                <div class="form-group row">
                                    <label class="col-md-2 control-label"><?php echo Lang::T('Telegram Bot Token');?>
</label>
                                    <div class="col-md-6">
                                        <input type="password" class="form-control" id="telegram_bot" name="telegram_bot"
                                               onmouseleave="this.type = 'password'" onmouseenter="this.type = 'text'"
                                               value="<?php echo $_smarty_tpl->tpl_vars['_c']->value['telegram_bot'];?>
" placeholder="123456:asdasgdkuasghddlashdashldhalskdklasd">
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-md-2 control-label"><?php echo Lang::T('Telegram User/Channel/Group ID');?>
</label>
                                    <div class="col-md-6">
                                        <input type="text" class="form-control" id="telegram_target_id" name="telegram_target_id"
                                               value="<?php echo $_smarty_tpl->tpl_vars['_c']->value['telegram_target_id'];?>
" placeholder="12345678">
                                    </div>
                                </div>
                                <small id="emailHelp" class="form-text text-muted">
                                    <?php echo Lang::T('You will get Payment and Error notification');?>

                                </small>
                            </div>
                        </div>
                    </div>
                </div>     
                <!-- SMS OTP Registration -->
                <div class="row mb-3">
                    <div class="col-sm-12">
                        <div class="card card-primary card-hovered card-stacked">
                            <div class="card-title text-center">
                                <div class="btn-group pull-right">
                                    <a class="btn btn-success btn-xs" style="color: black;" href="javascript:testSms()"><?php echo Lang::T('Test SMS');?>
</a>
                                    <button class="btn btn-primary btn-xs" title="save" type="submit">
                                        <span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span> Save
                                    </button>
                                </div>
                                <?php echo Lang::T('SMS OTP Registration');?>

                            </div>
                            <div class="card-body">
                                <div class="form-group row">
                                    <label class="col-md-2 control-label"><?php echo Lang::T('SMS Server URL');?>
</label>
                                    <div class="col-md-6">
                                        <input type="text" class="form-control" id="sms_url" name="sms_url" value="<?php echo $_smarty_tpl->tpl_vars['_c']->value['sms_url'];?>
"
                                               placeholder="https://domain/?param_number=[number]&param_text=[text]&secret=">
                                    </div>
                                    <p class="help-block col-md-4"><?php echo Lang::T('Must include');?>
 <b>[text]</b> &amp; <b>[number]</b>,
                                        <?php echo Lang::T('it will be replaced.');?>

                                    </p>
                                </div>
                        </div>
                    </div>
                </div>
        
            </form>
        </div>
        <!-- WhatsApp Notification -->
        <div class="row mb-3">
            <div class="col-sm-12">
                <div class="card card-primary card-hovered card-stacked">
                    <div class="card-title text-center">
                        <div class="btn-group pull-right">
                            <a class="btn btn-success btn-xs" style="color: black;" href="javascript:testWa()">Test WA</a>
                            <button class="btn btn-primary btn-xs" title="save" type="submit">
                                <span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span> Save
                            </button>
                        </div>
                        <?php echo Lang::T('WhatsApp Notification');?>

                    </div>
                    <div class="card-body">
                        <div class="form-group row">
                            <label class="col-md-2 control-label"><?php echo Lang::T('WhatsApp Server URL');?>
</label>
                            <div class="col-md-6">
                                <input type="text" class="form-control" id="wa_url" name="wa_url" value="<?php echo $_smarty_tpl->tpl_vars['_c']->value['wa_url'];?>
" placeholder="https://domain/?param_number=[number]&param_text=[text]&secret=">
                            </div>
                            <p class="help-block col-md-4"><?php echo Lang::T('Must include');?>
 <b>[text]</b> &amp; <b>[number]</b>, <?php echo Lang::T('it will be replaced.');?>
</p>
                        </div>
                    </div>
                </div>
            </div>
        </div>             
               
               <!-- User Notification -->
                <div class="row mb-3">
                    <div class="col-sm-12">
                        <div class="card card-primary card-hovered card-stacked">
                            <div class="card-title text-center">
                                <div class="btn-group pull-right">
                                    <button class="btn btn-primary btn-xs" title="save" type="submit">
                                        <span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span> Save
                                    </button>
                                </div>
                                <?php echo Lang::T('User Notification');?>

                            </div>
                            <div class="card-body">
                                <div class="form-group row">
                                    <label class="col-md-2 control-label"><?php echo 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"><?php echo Lang::T('None');?>
</option>
                                            <option value="wa" <?php if ($_smarty_tpl->tpl_vars['_c']->value['user_notification_expired'] == 'wa') {?>selected="selected" <?php }?>><?php echo Lang::T('By WhatsApp');?>
</option>
                                            <option value="sms" <?php if ($_smarty_tpl->tpl_vars['_c']->value['user_notification_expired'] == 'sms') {?>selected="selected" <?php }?>><?php echo Lang::T('By SMS');?>
</option>
                                            <option value="email" <?php if ($_smarty_tpl->tpl_vars['_c']->value['user_notification_expired'] == 'email') {?>selected="selected" <?php }?>><?php echo Lang::T('By Email');?>
</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-md-2 control-label"><?php echo 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"><?php echo Lang::T('None');?>
</option>
                                            <option value="wa" <?php if ($_smarty_tpl->tpl_vars['_c']->value['user_notification_payment'] == 'wa') {?>selected="selected" <?php }?>><?php echo Lang::T('By WhatsApp');?>
</option>
                                            <option value="sms" <?php if ($_smarty_tpl->tpl_vars['_c']->value['user_notification_payment'] == 'sms') {?>selected="selected" <?php }?>><?php echo Lang::T('By SMS');?>
</option>
                                            <option value="email" <?php if ($_smarty_tpl->tpl_vars['_c']->value['user_notification_payment'] == 'email') {?>selected="selected" <?php }?>><?php echo Lang::T('By Email');?>
</option>
                                        </select>
                                    </div>
                                </div>
                                <div class="form-group row">
                                    <label class="col-md-2 control-label"><?php echo Lang::T('Reminder Notification');?>
</label>
                                    <div class="col-md-6">
                                        <select name="user_notification_reminder" id="user_notification_reminder" class="form-control">
                                            <option value="none"><?php echo Lang::T('None');?>
</option>
                                            <option value="wa" <?php if ($_smarty_tpl->tpl_vars['_c']->value['user_notification_reminder'] == 'wa') {?>selected="selected" <?php }?>><?php echo Lang::T('By WhatsApp');?>
</option>
                                            <option value="sms" <?php if ($_smarty_tpl->tpl_vars['_c']->value['user_notification_reminder'] == 'sms') {?>selected="selected" <?php }?>><?php echo Lang::T('By SMS');?>
</option>
                                            <option value="email" <?php if ($_smarty_tpl->tpl_vars['_c']->value['user_notification_reminder'] == 'email') {?>selected="selected" <?php }?>><?php echo Lang::T('By Email');?>
</option>
                                        </select>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
               <!-- Miscellaneous -->
                <div class="row mb-3" id="miscellaneous">
                    <div class="col-sm-12">
                        <div class="card card-primary card-hovered card-stacked">
                            <div class="card-title text-center">
                                <div class="btn-group pull-right">
                                    <button class="btn btn-primary btn-xs" title="save" type="submit">
                                        <span class="glyphicon glyphicon-floppy-disk" aria-hidden="true"></span> Save
                                    </button>
                                </div>
                                <?php echo Lang::T('Miscellaneous');?>

                            </div>
                            <div class="card-body">
                                <div class="form-group row">
                                    <label class="col-md-2 control-label"><?php echo Lang::T('Enable Session Timeout');?>
</label>
                                    <div class="col-md-6">
                                        <label class="switch">
                                            <input type="checkbox" id="enable_session_timeout" value="1" name="enable_session_timeout" <?php if ($_smarty_tpl->tpl_vars['_c']->value['enable_session_timeout'] == 1) {?>checked<?php }?>>
                                            <span class="slider"></span>
                                        </label>
                                    </div>
                                    <p class="help-block col-md-4"><?php echo Lang::T('Logout Admin if not Available/Online a period of time');?>
</p>
                                </div>
                                <div class="form-group row" id="timeout_duration_input" style="display: none;">
                                    <label class="col-md-2 control-label"><?php echo Lang::T('Timeout Duration');?>
</label>
                                    <div class="col-md-6">
                                        <input type="number" value="<?php echo $_smarty_tpl->tpl_vars['_c']->value['session_timeout_duration'];?>
" class="form-control" name="session_timeout_duration" id="session_timeout_duration" placeholder="<?php echo Lang::T('Enter the session timeout duration (minutes)');?>
" min="1">
                                    </div>
                                    <p class="help-block col-md-4"><?php echo Lang::T('Idle Timeout, Logout Admin if Idle for xx minutes');?>
</p>
                                </div>
                            
                                <div class="form-group row">
                                    <label class="col-md-2 control-label"><?php echo Lang::T('Router Check');?>
</label>
                                    <div class="col-md-6">
                                        <select name="router_check" id="router_check" class="form-control">
                                            <option value="0" <?php if ($_smarty_tpl->tpl_vars['_c']->value['router_check'] == '0') {?>selected="selected" <?php }?>><?php echo Lang::T('Disabled');?>
</option>
                                            <option value="1" <?php if ($_smarty_tpl->tpl_vars['_c']->value['router_check'] == '1') {?>selected="selected" <?php }?>><?php echo Lang::T('Enabled');?>
</option>
                                        </select>
                                    </div>
                                    <p class="help-block col-md-4"><?php echo Lang::T('If enabled, the system will notify Admin when router goes Offline');?>
</p>
                                </div>         
                        <div class="form-group row">
                            <label class="col-md-2 control-label"><?php echo Lang::T('Extend Package Expiry');?>
</label>
                            <div class="col-md-6">
                                <select name="extend_expiry" id="extend_expiry" class="form-control">
                                    <option value="yes" <?php if ($_smarty_tpl->tpl_vars['_c']->value['extend_expiry'] != 'no') {?>selected="selected" <?php }?>>
                                        <?php echo Lang::T('Yes');?>
</option>
                                    <option value="no" <?php if ($_smarty_tpl->tpl_vars['_c']->value['extend_expiry'] == 'no') {?>selected="selected" <?php }?>>
                                        <?php echo Lang::T('No');?>
</option>
                                </select>
                            </div>
                            <p class="help-block col-md-4">
                                <?php echo Lang::T('If user buy same internet plan, expiry date will extend');?>
</p>
                        </div>
                        <div class="form-group row">
                            <label class="col-md-2 control-label"><?php echo Lang::T('Show Bandwidth Plan');?>
</label>
                            <div class="col-md-6">
                                <select name="show_bandwidth_plan" id="show_bandwidth_plan" class="form-control">
                                    <option value="no" <?php if ($_smarty_tpl->tpl_vars['_c']->value['show_bandwidth_plan'] == 'no') {?>selected="selected" <?php }?>>
                                        <?php echo Lang::T('No');?>
</option>
                                    <option value="yes" <?php if ($_smarty_tpl->tpl_vars['_c']->value['show_bandwidth_plan'] == 'yes') {?>selected="selected" <?php }?>>
                                        <?php echo Lang::T('Yes');?>
</option>
                                </select>
                            </div>
                            <p class="help-block col-md-4">
                                <?php echo Lang::T(' for Customer');?>
</p>
                        </div>
                    </div>
                </div>
            </form>
        </div>      
        <div class="container-fluid">
            <form class="form-horizontal" method="post" role="form" action="<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
settings/app-post" enctype="multipart/form-data">    
        <!-- Save Changes Button -->
        <div class="panel-body">
            <div class="form-group row">
                <button class="btn btn-success btn-block" type="submit"><?php echo Lang::T('Save Changes');?>
</button>
            </div>
        </div>
        <pre>/ip hotspot walled-garden
            add dst-host=<?php echo $_smarty_tpl->tpl_vars['_domain']->value;?>

            add dst-host=*.<?php echo $_smarty_tpl->tpl_vars['_domain']->value;?>
</pre>
            
                        <pre>
            # <?php echo Lang::T('Expired Cronjob Every 5 Minutes');?>

            */5 * * * * cd <?php echo $_smarty_tpl->tpl_vars['dir']->value;?>
 && <?php echo $_smarty_tpl->tpl_vars['php']->value;?>
 cron.php
            
            # <?php echo Lang::T('Expired Cronjob Every 1 Hour');?>

            0 * * * * cd <?php echo $_smarty_tpl->tpl_vars['dir']->value;?>
 && <?php echo $_smarty_tpl->tpl_vars['php']->value;?>
 cron.php
            </pre>
                        <pre>
            # <?php echo Lang::T('Reminder Cronjob Every 7 AM');?>

            0 7 * * * cd <?php echo $_smarty_tpl->tpl_vars['dir']->value;?>
 && <?php echo $_smarty_tpl->tpl_vars['php']->value;?>
 cron_reminder.php
            </pre>
                    </div>
                </div>
            </form>


    
    
    <?php echo '<script'; ?>
>
        document.addEventListener('DOMContentLoaded', function() {
            var sectionTimeoutCheckbox = document.getElementById('enable_session_timeout');
            var timeoutDurationInput = document.getElementById('timeout_duration_input');
            var timeoutDurationField = document.getElementById('session_timeout_duration');
    
            if (sectionTimeoutCheckbox.checked) {
                timeoutDurationInput.style.display = 'block';
                timeoutDurationField.required = true;
            }
    
            sectionTimeoutCheckbox.addEventListener('change', function() {
                if (this.checked) {
                    timeoutDurationInput.style.display = 'block';
                    timeoutDurationField.required = true;
                } else {
                    timeoutDurationInput.style.display = 'none';
                    timeoutDurationField.required = false;
                }
            });
    
            document.querySelector('form').addEventListener('submit', function(event) {
                if (sectionTimeoutCheckbox.checked && (!timeoutDurationField.value || isNaN(
                        timeoutDurationField.value))) {
                    event.preventDefault();
                    alert('Please enter a valid session timeout duration.');
                    timeoutDurationField.focus();
                }
            });
        });
    <?php echo '</script'; ?>
>
    <?php echo '<script'; ?>
>
        function testWa() {
            var target = prompt("Phone number\nSave First before Test", "");
            if (target != null) {
                window.location.href = '<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
settings/app&testWa=' + target;
            }
        }
    
        function testSms() {
            var target = prompt("Phone number\nSave First before Test", "");
            if (target != null) {
                window.location.href = '<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
settings/app&testSms=' + target;
            }
        }
    
    
        function testEmail() {
            var target = prompt("Email\nSave First before Test", "");
            if (target != null) {
                window.location.href = '<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
settings/app&testEmail=' + target;
            }
        }
    
        function testTg() {
            window.location.href = '<?php echo $_smarty_tpl->tpl_vars['_url']->value;?>
settings/app&testTg=test';
        }
    <?php echo '</script'; ?>
>
    
    <?php echo '<script'; ?>
>
        document.addEventListener("DOMContentLoaded", function() {
            // Function to toggle visibility of custom tax rate input field
            function toggleCustomTaxRate() {
                var taxRateSelect = document.getElementById("tax_rate");
                var customTaxRateInput = document.getElementById("customTaxRate");
    
                if (taxRateSelect.value === "custom") {
                    customTaxRateInput.style.display = "block";
                } else {
                    customTaxRateInput.style.display = "none";
                }
            }
    
            // Call the function when the page loads
            toggleCustomTaxRate();
    
            // Call the function whenever the tax rate dropdown value changes
            document.getElementById("tax_rate").addEventListener("change", toggleCustomTaxRate);
        });
    <?php echo '</script'; ?>
>
    
    
    
    <?php $_smarty_tpl->_subTemplateRender("file:sections/footer.tpl", $_smarty_tpl->cache_id, $_smarty_tpl->compile_id, 0, $_smarty_tpl->cache_lifetime, array(), 0, false);
}
}
