@extends('vip.layouts')
@section('content')

    <form class="layui-form" action="{{ url()->full() }}" id="submitForm" name="submitForm" method="post"
          eventType="eventAjaxForm" lay-filter="submitForm">
        {!! csrf_field() !!}

        <div class="layui-form-item">
            <label class="layui-form-label">代理名&nbsp;</label>
            <div class="layui-input-inline">
                <input type="text" name="account_name" required lay-verify="required" placeholder="" autocomplete="off"
                       class="layui-input" value="{{isset(
      $data['agent_user'])?$data['agent_user']:''}}" disabled="disabled">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">结算金额&nbsp;</label>
            <div class="layui-input-inline">
                <a href="/admin/agent/settle?id={{Request::get('id')}}">
                    <input style="border: 0;color: #1E9FFF;line-height:38px;cursor: pointer " type="text" value="结算金额" readonly="readonly">
                </a>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">手机&nbsp;</label>
            <div class="layui-input-inline">
                <input type="text" name="phone" required lay-verify="required" placeholder="" autocomplete="off"
                       class="layui-input" value="{{isset($data['phone'])?$data['phone']:''}}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">email&nbsp;</label>
            <div class="layui-input-inline">
                <input type="text" name="email" required lay-verify="required" placeholder="" autocomplete="off"
                       class="layui-input" value="{{isset($data['email'])?$data['email']:''}}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">银行卡号&nbsp;</label>
            <div class="layui-input-inline">
                <input type="text" name="bank_number" required lay-verify="required" placeholder="" autocomplete="off"
                       class="layui-input" value="{{isset($data['bank_number'])?$data['bank_number']:''}}">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">分成方式&nbsp;</label>
            <div class="layui-input-inline">
                <select name="type">
                    <option value="1" @if($data['type']==1) selected @endif>盈利分成</option>
                    <option value="2" @if($data['type']==2) selected @endif>流水分成</option>
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">所属组&nbsp;&nbsp;</label>
            <div class="layui-input-inline">
                <select name="grade">
                    @foreach($gradeArray as $v)
                        <option value="{{$v['grade_code']}}" @if($data['grade']==$v['grade_code']) selected @endif>{{$v['grade_name']}}</option>
                    @endforeach
                </select>
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">注册时间&nbsp;</label>
            <div class="layui-input-inline">
                <input type="text" name="account_name" required lay-verify="required" placeholder="" autocomplete="off"
                       class="layui-input" value="{{isset($data['start_time'])?$data['start_time']:''}}" disabled="disabled">
            </div>
        </div>

        <div class="layui-form-item">
            <div class="layui-input-block">
                <button class="layui-btn sub" lay-submit lay-filter="submitForm">确认</button>
            </div>
        </div>
    </form>
    <div>
    </div>
    <script>
        //Demo
        layui.use(['form'], function () {
            var form = layui.form;

        //监听提交
        form.on('submit(submitForm)', function (data) {
            return true;
        });


//        function cbFormSuccess(data) {
//            layer.msg(data.msg);
////            var table = window.parent.tab;
////            //执行重载
////            table.reload({
////                page: {
////                    curr: 1 //重新从第 1 页开始
////                }
////                , where: {
////                    account: $("#account_name", parent.document).val(),
////                    sureblur: $('.layui-form-switch', parent.document).text(),
////                }
////            });
////            var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
////            parent.layer.close(index); //再执行关闭
////            console.log( parent.getFrameIndex(window.name));
////            $('#content').html('');
////            layer.alert(data.msg, {}, function () {
////                var table = window.parent.tab;
////                //执行重载
////                table.reload({
////                    page: {
////                        curr: 1 //重新从第 1 页开始
////                    }
////                    , where: {
////                        account: $("#account_name", parent.document).val(),
////                        sureblur: $('.layui-form-switch', parent.document).text(),
////                    }
////                });
////                var index = parent.layer.getFrameIndex(window.name); //先得到当前iframe层的索引
////                parent.layer.close(index); //再执行关闭
//
////            });
//            }
        });


    </script>
@endsection
