<div class="modal-header">
    <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">&times;</span><span class="sr-only">Close</span></button>
    <h4 class="modal-title">添加用户</h4>
</div>
<form id="form" class="form-horizontal">
    <div class="modal-body">
        <div class="input-group">
            <span class="input-group-addon">&nbsp;&nbsp;&nbsp;用户名 *</span>
            <input name="MemberForm[name]" type="text" class="form-control" placeholder="用户名">
        </div>
        <div class="hr-line-dashed"></div>
        <div class="input-group">
            <span class="input-group-addon">MT4账户*</span>
            <input name="MemberForm[logins]" type="number" class="form-control" placeholder="MT4账户">
        </div>
        <div class="hr-line-dashed"></div>
        <div class="input-group">
            <span class="input-group-addon">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;邮箱*</span>
            <input name="MemberForm[username]" type="text" class="form-control" placeholder="电子邮箱">
        </div>
        <div class="hr-line-dashed"></div>
        <div class="input-group">
            <span class="input-group-addon">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;密码*</span>
            <input name="MemberForm[password]" type="text" class="form-control" placeholder="密码">
        </div>
        <div class="hr-line-dashed"></div>
        <div class="input-group">
            <span class="input-group-addon">&nbsp;&nbsp;证件号码</span>
            <input name="MemberForm[id_no]" type="text" class="form-control" placeholder="身份证号码">
        </div>
        <div class="hr-line-dashed"></div>
        <div class="input-group">
            <span class="input-group-addon">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;地址</span>
            <input name="MemberForm[address]" type="text" class="form-control" placeholder="地址">
        </div>

    </div>
    <div class="modal-footer">
        <div class="pull-left" style="padding-left:20px;">
            <!--<input name="isSendMail" type="checkbox" class="i-checks" checked> 发送邮件-->
        </div>
        <button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
        <button id="submit" type="button" class="btn btn-primary">提交</button>
    </div>
</form>


<script type="text/javascript">
$('.i-checks').iCheck({
    checkboxClass: 'icheckbox_square-green',
    radioClass: 'iradio_square-green',
});
$("#submit").on("click",function(){
    $.ajax({
        type: "POST",
        url: "/admin/member/save",
        data: $('#form').serialize(),
        dataType: "json",
        success: function(response) {
            if(response.code == 1){
                $("#modal").modal("hide");
                table.ajax.reload();
            }else{
                toastr.error(response.message, "提示");
            }
        }
    });
});

</script>					