<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="edit_form" class="form-horizontal">
    <input type="hidden" name="MemberForm[id]" value="<?= $id ?>">
    <div class="modal-body">
        <div class="input-group">
            <span class="input-group-addon">新密码</span>
            <input id="title" name="MemberForm[password]" type="password" class="form-control" placeholder="新密码(留空表示不修改)" autocomplete="off">
        </div>
        <div class="hr-line-dashed"></div>
        <div class="input-group">
            <span class="input-group-addon">&nbsp;&nbsp;&nbsp;姓名</span>
            <input id="title" name="MemberForm[name]" type="text" class="form-control" placeholder="姓名" value="<?= $memberInfo['name'] ?>" autocomplete="off">
        </div>
        <div class="hr-line-dashed"></div>
        <div class="input-group">
            <span class="input-group-addon">&nbsp;&nbsp;&nbsp;手机</span>
            <input id="title" name="MemberForm[mobile]" type="number" class="form-control" placeholder="手机号码" value="<?= $memberInfo['mobile'] ?>" autocomplete="off">
        </div>
        <div class="hr-line-dashed"></div>
    </div>
    <div class="modal-footer">
        <button type="button" class="btn btn-white" data-dismiss="modal">取消</button>
        <button id="edit_submit" type="button" class="btn btn-primary">提交</button>
    </div>
</form>
<script type="text/javascript">
$("#edit_submit").on("click",function(){
    $.ajax({
        type: "POST",
        url: "/admin/admin/update",
        data: $('#edit_form').serialize(),
        dataType: "json",
        beforeSend: function() {},
        success: function(data) {
            if(data.code == 1){
                $("#modal").modal("hide");
                table.ajax.reload();
            }else{
                toastr.error(data.message, "提示");
            }
        },
        complete: function(XMLHttpRequest, textStatus) {},
        error: function() {}
    });
});

</script>
