<?php include ADMIN_COMMON_PATH.'/header.html';?>
<div class="layui-container fly-marginTop fly-user-main">
    <?php include ADMIN_COMMON_PATH.'/setting-nav.html';?>
    <div class="fly-panel fly-panel-user" pad20>
        <div class="layui-tab layui-tab-brief" lay-filter="email">
            <ul class="layui-tab-title" id="LAY_mine">
                <li class="layui-this" lay-id="info">邮箱设置</li>
            </ul>
            <div class="layui-tab-content" style="padding: 20px 0;">
                <div class="layui-form-pane layui-tab-item layui-show">
                    <form class="layui-form layui-show" method="post">
						<?php if(is_array($email) AND !empty($email)):?>
                        <div class="layui-form-item">
                            <label for="mailaddress" class="layui-form-label">邮箱地址</label>
                            <div class="layui-input-inline">
                                <input type="text" id="mailaddress" name="mailaddress" lay-verify="required|email" autocomplete="off" value="<?php echo $email['mailaddress'];?>" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="mailpassword" class="layui-form-label">邮箱密码</label>
                            <div class="layui-input-inline">
                                <input type="text" id="mailpassword" name="mailpassword" required lay-verify="required" autocomplete="off" value="<?php echo $email['mailpassword'];?>" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="sendmail" class="layui-form-label">发件人邮箱</label>
                            <div class="layui-input-inline">
                                <input type="text" id="sendmail" name="sendmail" autocomplete="off" lay-verify="required|email" value="<?php echo $email['sendmail'];?>" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="sendname" class="layui-form-label">发件人昵称</label>
                            <div class="layui-input-inline">
                                <input type="text" id="sendname" name="sendname" autocomplete="off" lay-verify="required" value="<?php echo $email['sendname'];?>" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="host" class="layui-form-label">发送服务器</label>
                            <div class="layui-input-inline">
                                <input type="text" id="host" name="host" autocomplete="off" lay-verify="required" value="<?php echo $email['host'];?>" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="port" class="layui-form-label">端口号</label>
                            <div class="layui-input-inline">
                                <input type="number" id="port" name="port" autocomplete="off" lay-verify="required" value="<?php echo $email['port'];?>" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
							<input type="hidden" name="id" value="<?php echo $email['id'];?>">
							<input type="hidden" name="method" value="edit">
                            <button class="layui-btn" key="set-mine" lay-filter="email" lay-submit>确认修改</button>
                        </div>
						<?php else:?>
                        <div class="layui-form-item">
                            <label for="mailaddress" class="layui-form-label">邮箱地址</label>
                            <div class="layui-input-inline">
                                <input type="text" id="mailaddress" name="mailaddress" lay-verify="required|email" autocomplete="off" value="" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="mailpassword" class="layui-form-label">邮箱密码</label>
                            <div class="layui-input-inline">
                                <input type="text" id="mailpassword" name="mailpassword" required lay-verify="required" autocomplete="off" value="" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="sendmail" class="layui-form-label">发件人邮箱</label>
                            <div class="layui-input-inline">
                                <input type="text" id="sendmail" name="sendmail" autocomplete="off" lay-verify="required|email" value="" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="sendname" class="layui-form-label">发件人昵称</label>
                            <div class="layui-input-inline">
                                <input type="text" id="sendname" name="sendname" autocomplete="off" lay-verify="required" value="" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="host" class="layui-form-label">发送服务器</label>
                            <div class="layui-input-inline">
                                <input type="text" id="host" name="host" autocomplete="off" lay-verify="required" value="smtp.exmail.qq.com" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
                            <label for="port" class="layui-form-label">端口号</label>
                            <div class="layui-input-inline">
                                <input type="text" id="port" name="port" autocomplete="off" lay-verify="required" value="465" class="layui-input">
                            </div>
                        </div>
                        <div class="layui-form-item">
							<input type="hidden" name="id" value="0">
							<input type="hidden" name="method" value="add">
                            <button class="layui-btn" key="set-mine" lay-filter="email" lay-submit>确认新增</button>
                        </div>
						<?php endif;?>
                    </form>
                </div>
            </div>
        </div>
    </div>
</div>
<!--引入公共底文件-->
<?php include ADMIN_COMMON_PATH.'/footer.html';?>
<script>
    layui.use('adminemail');
</script>