<link rel="stylesheet" type="text/css" href="{$config.site_root}/modules/mail/css/style.css?{$revision}">
<div style="font-size:16px;margin:0 auto 10px" align="center">
    <b>{$lang['modules']['mail']['setting_top']} </b><span class="help_bt"
                                                    h_id="setting_top_mail"></span>
</div>
<script>
    $(function () {
        $('.datepicker').datepicker({
            showOn: "button",
            dateFormat: lang.date_js_format,
            showAlways: true,
            buttonImage: "images/calbtn.png",
            buttonImageOnly: true,
            buttonText: "Calendar",
            showAnim: (('\v' == 'v') ? "" : "show"),  // в ie не включаем анимацию, тормозит
        }).attr('placeholder', lang.date_placeholder);
    });
</script>
<div align="center" class="f13">
    <a href="?module=mail">{$lang['modules']['mail']['inset1']}</a> /
    <a href="?module=mail&path=table">{$lang['modules']['mail']['inset2']}</a> /
    <a href="?module=mail&path=mail">{$lang['modules']['mail']['inset3']}</a> /
    <a href="?module=mail&path=server">{$lang['modules']['mail']['inset4']}</a> /
    <a href="?module=mail&path=black">{$lang['modules']['mail']['inset5']}</a> /
    {$lang['modules']['mail']['inset6']}
</div>
<br/>
{if $trial}
    <div class="c_r" align="center">{$lang['modules']['mail']['activate']}</div>
{else}
    <div align="center">
        {$lang['modules']['mail']['inset6top']}
        <br/>
        <form method="post" action="">
            <table cellpadding="2" class="for_table">
                <tr>
                    <td align="right">{$lang['modules']['mail']['inset6mail']}<span class="help_bt"
                                                                                    h_id="Plus_mail"></span>:
                    </td>
                    <td>
                        <select class="form-control form-control-160" name="mail" title="">
                            <option></option>
                            {foreach from = $accaunt item = subtable  name=row}
                                <option value='{$subtable.id}'>{$subtable.email}</option>
                            {/foreach}
                        </select>
                    </td>
                </tr>
                <tr>
                    <td align="right">{$lang['modules']['mail']['inset6date1']}<span class="help_bt"
                                                                                     h_id="Plus_date1"></span>:
                    </td>
                    <td>
                        <input type="text" id="datepicker1" class="datepicker form-control form-control-160"
                               name="date1" required title="">
                    </td>
                </tr>
                <tr>
                    <td align="right">{$lang['modules']['mail']['inset6date2']} <span class="help_bt"
                                                                                      h_id="Plus_date2"></span>:
                    </td>
                    <td>
                        <input type="text" id="datepicker2" class="datepicker form-control form-control-160"
                               name="date2" required title="">
                    </td>
                </tr>
            </table>
            <div class="clear"></div>
            <br/>
            <input type=hidden name="csrf" value="{$csrf}">
            <input type="hidden" name="action" value="load">
            <input class="btn btn-default btn-sm" type=submit value="{$lang['modules']['mail']['insetload']}">
            <button class="btn btn-default btn-sm" type="button"
                    onclick="window.location='{$config.site_url}/edit_modules.php?module=mail&path=sets';">{$lang['modules']['mail']['insetcancel']}</button>
        </form>
        <div style="margin:30px auto 10px">{$lang.modules.mail.settings}</div>
        <form method="post" action="">
            <table class="for_table">
                <tbody>
                <tr>
                    <td align="right" style="width:50%"><input type="checkbox" id="tip" name="tips"
                                                               {if $checked}value=""{/if} {$checked}
                                                               onclick="tips_check()" title=""></td>
                    <td>{$lang.modules.mail.tips}</td>
                </tr>
                <tr>
                    <td align="right" style="width:50%">
                        <input type="checkbox" name="autodelete_mailboxes" {if $config.autodelete_mailboxes}checked{/if} value=1>
                    </td>
                    <td>{$lang.modules.mail.autodelete_mailboxes_lost_users}</td>
                </tr>
                </tbody>
            </table>
            <div class="clear"></div>
            <br/>
            <input type=hidden name="csrf" value="{$csrf}">
            <input type="hidden" name="check" id="tip_check" value="{$checked}">
            <input type="hidden" name="action" value="save">
            <input class="btn btn-default btn-sm" type=submit value="{$lang['modules']['mail']['insetsave']}">
            <button class="btn btn-default btn-sm" type="button"
                    onclick="window.location='{$config.site_url}/edit_modules.php?module=mail&path=sets';">{$lang['modules']['mail']['insetcancel']}</button>
        </form>
        <br/>
        {$status3}
    </div>
{/if}
<script type="text/javascript" src="{$config.site_root}/modules/mail/js/script.js?{$revision}"></script>
<script>
    $(document).ready(() => {
        init_chosen();
    });
</script>