#@layer()

#define script()
<script>
    function closeLayer() {
        parent.layer.closeAll();
    }
</script>
#end

#define content()

<section class="content">

    <div class="row">
        <div class="col-xs-12">
            <form class="form-horizontal form-setting autoAjaxSubmit" autocomplete="off"
                  action="#(CPATH)/admin/user/doMemberSave"
                  method="POST"
                  data-ok-function="closeLayer"
            >
                <input type="hidden" name="member.id" value="#(member.id ??)">
                <input type="hidden" name="member.user_id" value="#para('userId')">
                <div class="box-body ">


                    <div class="form-group">
                        <label class="col-sm-2 control-label">会员</label>
                        <div class="col-sm-8">
                            <select class="form-control" name="member.group_id">
                                #for(group : groups)
                                <option value="#(group.id ??)">
                                    #(group.name ??)
                                </option>
                                #end
                            </select>
                        </div>
                    </div>


                    <div class="form-group">
                        <label class="col-sm-2 control-label">到期时间</label>
                        <div class="col-sm-8">
                            <input type="input" name="member.duetime" class="form-control datetimepicker"
                                   value="#(member.duetime ??)"
                                   placeholder="该会员的到期时间">
                        </div>
                    </div>


                    <div class="form-group">
                        <label class="col-sm-2 control-label">来源</label>
                        <div class="col-sm-8">
                            <select class="form-control" name="member.source">
                                <option value="buy"> 用户购买</option>
                                <option value="free"> 免费赠送</option>
                                <option value="other"> 其他</option>
                            </select>
                        </div>
                    </div>

                    <div class="form-group">
                        <label class="col-sm-2 control-label">状态</label>
                        <div class="col-sm-8">
                            <select class="form-control" name="member.status">
                                <option value="9"> 正常 </option>
                                <option value="1"> 禁用 </option>
                            </select>
                        </div>
                    </div>


                    <div class="form-group">
                        <label class="col-sm-2 control-label">备注</label>
                        <div class="col-sm-8">
                                    <textarea rows="5" name="member.remark" class="form-control"
                                              placeholder="该会员的备注信息...">#(member.remark ??)</textarea>
                        </div>
                    </div>
                </div>
                <!-- /.box-body -->
                <div class="box-footer">
                    <div class="col-sm-offset-9 col-sm-2 submit-block">
                        <div class="box-submit">
                            <button type="submit" class="btn btn-primary">提交</button>
                        </div>
                    </div>
                </div>
                <!-- /.box-footer -->
            </form>
        </div>
    </div>

</section>

#end
