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

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

  <div class="layui-form-item">
    <label class="layui-form-label">游戏名</label>
    @if(empty($game))
    <div class="layui-input-block">
      <input type="text" name="name" required autocomplete="off" class="layui-input" value="{{isset(
      $data['name'])?$data['name']:''}}" disabled="disabled">
    </div>
      @else
      <div class="layui-input-block">
        <select name="game_type">
          @foreach($game as $v)
            <option value="{{$v['game']}}">{{$v['name']}}</option>
          @endforeach
        </select>
      </div>
    @endif
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">会员等级</label>
    <div class="layui-input-block"> 
        <select name="grade" id="grade" lay-verify="" autocomplete="off" class="layui-input" eventType=event-query>
          @foreach($grade as $k=>$v):
            @if($k==0)
              <option value="10">{{$v}}</option>
            @else
              <option value="{{$k}}">{{$v}}</option>
            @endif
          @endforeach
        </select>
    </div>
  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">最大投注金额</label>
    <div class="layui-input-block">
    <input type="text" name="big_money"   lay-verify="" placeholder="请输入最大投注金额" autocomplete="off" class="layui-input" value="{{isset($data['big_money'])?$data['big_money']:''}}">
    </div>    
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">最小投注金额</label>
    <div class="layui-input-block">
      <input type="text" name="small_money"   lay-verify="" placeholder="请输入最小投注金额" autocomplete="off" class="layui-input" value="{{isset($data['small_money'])?$data['small_money']:''}}">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">最小反水金额</label>
    <div class="layui-input-block">
      <input type="text" name="commission_money"   lay-verify="" placeholder="请输入最小反水金额" autocomplete="off" class="layui-input" value="{{isset($data['commission_money'])?$data['commission_money']:''}}">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">最小反水比例</label>
    <div class="layui-input-block">
      <input type="text" name="commission_rate"   lay-verify="" placeholder="请输入最小反水比例" autocomplete="off" class="layui-input" value="{{isset($data['commission_rate'])?$data['commission_rate']:''}}">
    </div>
  </div>

  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit lay-filter="submitForm">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-normal">重置</button>
    </div>
  </div>
</form>
 
<script>
//Demo
layui.use(['form'], function(){
  var form = layui.form;
  
  //监听提交
  form.on('submit(submitForm)', function(data){
    return true;
  });
});

</script>
@endsection
