@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>
    <div class="layui-input-block">
      <input type="text" name="game_name" required  lay-verify="required" placeholder="请输入玩法名称" autocomplete="off" value="{{ isset($data['game_name'])?$data['game_name']:'' }}" class="layui-input">
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">比赛状态:</label>
        <div class="layui-input-block">
            <input type="radio" name="status" value="1" title="启用" @if($data['status']==1) checked @endif >
            <input type="radio" name="status" value="0" title="禁用" @if($data['status']==0) checked @endif>
        </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">所属联赛:</label>
        <div class="layui-input-block">
            <select name="lg_id"  id="lg_id" lay-filter = 'sect'  lay-verify="required" autocomplete="off" class="layui-input"  eventType=event-query>
              <option value="@if($only['lg_id']) {{$only['lg_id']}} @endif">@if($only['name_chinese']) {{$only['name_chinese']}} @else {{ trans('gjmatch.lg_select') }} @endif</option>
              @foreach($ldata as $k=>$v)
                <option value="{{$v['lg_id']}}">{{$v['name_chinese']}}</option>
              @endforeach
            </select>
        </div>
  </div>

@if(S('ACTION')!='view')
  <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-primary">重置</button>
    </div>
  </div>
@endif
</form>

<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);
	setTimeout(function(){
		parent.window.location.reload();
	},2500);
}
</script>
@endsection
