@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/nagent/settle?id={{Request::get('id')}}&grade={{$data['grade_name']}}">
                    <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"  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"  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;&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['register_time'])?$data['register_time']:''}}" disabled="disabled">
            </div>
        </div>

        <div class="layui-form-item">
            <label class="layui-form-label">代理邀请域名&nbsp;</label>
            <div class="layui-input-inline" style="width: 50%;">
                <input type="text" name="domain_name" placeholder="" autocomplete="off"
                       class="layui-input" value="{{isset($data['domain_name'])?$data['domain_name']:''}}">
                       <span><span style="color: red;">注意：</span>添加时请加上<span style="color: red;">http或https</span>,多个请用||隔开</span>
            </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>
        layui.use(['form'], function () {
            var form = layui.form;

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