{{include_file name='home/public/header' title='邮箱设置'}}

</head>

<body>

<div id="wrapper">

    <!-- Navigation -->
    {{include_file name='home/public/nav' sidebar='admin/public/sidebar' active='config'}}
    <div id="page-wrapper">
        <div class="row">
            <div class="col-lg-12">
                <div class="page-header">
                    <h1>邮箱设置 </h1>
                </div>
            </div>
            <!-- /.col-lg-12 -->
        </div>
        <!-- /.row -->
        <div class="row">

            <div class="col-lg-12">

                <div class="panel panel-default">

                    {{include_file name='admin/setting/tab' tab = 'email'}}

                    <div class="panel-body">
                        <form role="form" id="js_settingForm" action="{{url('')}}" method="post">
                            <input type="hidden" name="csrf-phprap" value="{{csrf_token()}}" />

                            <div class="form-group">
                                <label>邮件显示名</label>
                                <input class="form-control" name="Config[email_title]" value="{{$config->getField('email_title')}}" placeholder="必填，至少2位" datatype="*2-250" nullmsg="请输入网站名称！">
                            </div>

                            <div class="form-group">
                                <label>邮箱服务器地址</label>
                                <input class="form-control" name="Config[email_host]" value="{{$config->getField('email_host')}}" placeholder="" ignore="ignore" datatype="*">
                            </div>

                            <div class="form-group">
                                <label>邮箱账号</label>
                                <input class="form-control" name="Config[email_address]" value="{{$config->getField('email_address')}}" placeholder="必填" datatype="e" nullmsg="请输入系统邮箱！" errormsg="请输入合法邮箱">
                            </div>

                            <div class="form-group">
                                <label>邮箱密码</label>
                                <input class="form-control" name="Config[email_password]" value="{{$config->getField('email_password')}}" placeholder="必填，6-20个英文字母、数字或下划线组成的字符" datatype="*6-20" nullmsg="请输入重置默认密码！" errormsg="至少6位">
                            </div>

                            <div class="form-group js_pushTime">
                                <label>测试内容</label>
                                <input class="form-control" value="这是测试邮件发送内容,请勿回复" placeholder="" datatype="*">
                            </div>

                            <button type="reset" class="btn btn-default">重置</button>
                            <button type="button" class="btn btn-primary js_submit">保存</button>

                        </form>

                    </div>
                    <!-- /.panel-body -->
                </div>
                <!-- /.panel -->
            </div>
            <!-- /.col-lg-12 -->
        </div>

    </div>
    <!-- /#page-wrapper -->

</div>
<!-- /#wrapper -->

<script>

    $(function () {
        $("#js_settingForm").Validform({

            tiptype:function(msg,o){

                if(!o.obj.is("form")){

                    if(3 == o.type){
                        alert(msg, 'error');
                    }

                }

            },

            label:"label",

            btnSubmit: '.js_submit',

            tipSweep:true,

            ajaxPost:true,

            callback:function(json){

                if(200 == json.code){
                    alert(json.msg, 'success', function () {
                        window.location.reload();
                    });
                }else{
                    alert(json.msg, 'error');
                }


            }
        });
    });


</script>

{{include_file name='admin/public/footer'}}