<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <title>Moakt Email || 临时邮箱专业服务</title>
    <meta name="description" content="Moakt Mail 是一个专业的临时邮箱服务供应商."/>
    <meta name="keywords" content="可替代邮箱, 可替换邮箱, 临时邮箱, moakt, mohmal, 一次性邮箱"/>
    <meta name="viewport" content="width=device-width"/>
    <link href="/css/theme.min.css" rel="stylesheet" type="text/css"/>
    <link href="/css/style-ltr.min.css" rel="stylesheet" type="text/css"/>
    <link href="/css/material-icons.min.css" rel="stylesheet" type="text/css"/>
    <script src="/js/jquery.min.js" type="text/javascript"></script>
    <script src="/js/jquery-ui.min.js" type="text/javascript"></script>

</head>
<body>
<div id="page_2">
    <div class="bgr_2">
        <div id="top_" class="css_spirite">
            <div class="cntr">

                <span class="clr"></span>
            </div>
        </div>
        <div class="cntr padd22">

            <a href="/" class="hd2-logo-link"><span>Moakt Email || 临时邮箱专业服务</span></a>
            <span class="clr mrg-in"></span>
            <div class="page_in">
                <div class="mail-controller">
                    <div class="mailbox-details">
                        <label>您已创建临时邮箱</label>
                        <div id="email-address"><?php echo $this->_data['email'] . "@" . $this->_data['domain']; ?></div>
                        <label>5秒刷新一次</label>
                    </div>
                </div>
                <span class="clr"></span>
                <div id="maillist">
                    <span class="clr"></span>
                    <div id="email_message_list">
                        <div class="email-messages">
                            <table id="mail_box">
                                <tr>
                                    <td id="email-title">邮件主题</td>
                                    <td id="email-sender">发件人</td>
                                    <td id="email-control">操作</td>
                                </tr>
                            </table>
                        </div>
                    </div>
                    <span class="clr"></span>
                </div>
            </div>
        </div>


        <script type="text/javascript">

            $(document).ready(function () {
               fresh();
            });
            function html2Escape(sHtml) {
                return sHtml.replace(/[<>&"]/g,function(c){return {'<':'&lt;','>':'&gt;','&':'&amp;','"':'&quot;'}[c];});
            }
            function fresh() {
                $("#mail_box").html('<table id="mail_box">\n' +
                    '                                <tr>\n' +
                    '                                    <td id="email-title">邮件主题</td>\n' +
                    '                                    <td id="email-sender">发件人</td>\n' +
                    '                                    <td id="email-control">操作</td>\n' +
                    '                                </tr>\n' +
                    '                            </table>');
                $.get("/vestacp/domain", {"type":"get_mail"<?php if ($this->email){?>,"email":"<?php echo $this->email;?>"<?php }?> },
                    function(data){
                        let html = "";
                        $.each(data.data,function(i,val){  //遍历二维数组
                            html+='<tr><td>'+html2Escape(val.subject)+'</td><td>'+html2Escape(val.from)+'</td><td><a target="_blank" href="/vestacp/domain?type=get_detail&id='+val.uid+'">点击查看详情</a></td></tr>';
                        });
                        $("#mail_box").append(html);
                    }, "json");
                setTimeout("fresh()", 1000 * 5);
            }
        </script>
</body>
</html>