@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" style="width: 125px">
      <input type="text" name="name" required  lay-verify="required" autocomplete="off" class="layui-input" value="{{isset(
      $game)?trans('common.'.$game):''}}" disabled="disabled">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">期号</label>
    <div class="layui-input-block">
      <input type="hidden" name="game" required  lay-verify="required" autocomplete="off" class="layui-input" value="{{$game}}">
      <input type="text" name="no"   lay-verify="" autocomplete="off" class="layui-input" value="{{isset($no)?$no:''}}" readonly="true">
    </div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">开奖号码</label>
    @for($i=0;$i<$code;$i++)
    <div class="layui-input-inline" style="width: 60px;margin-bottom: 10px">
      <input type="text" name="codes[{{$i}}]"  min="0" lay-verify="" autocomplete="off" class="layui-input" value="">
    </div>
    @endfor
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">开奖时间</label>
    <div class="layui-input-inline">
      <input type="text" name="open_time" class="layui-input" id="form_open_time" placeholder="-" value="{{isset($open_time)?$open_time:''}}">
    </div>
    <div class="layui-form-mid layui-word-aux"><font color="red">注意：时间格式务必填写正确，如2014-10-10 10:10:10</font></div>
  </div>

  <div class="layui-form-item">
    <label class="layui-form-label">二级密码</label>
    <div class="layui-input-block">
    <input type="password" name="password"   lay-verify="" placeholder="请输入密码" autocomplete="off" class="layui-input" value="{{isset($data['closeinfo'])?$data['closeinfo']:''}}">
    </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;
    });
    
    layui.use('laydate', function(){
        var laydate = layui.laydate;
        
        //时间选择器
        laydate.render({
          elem: '#form_open_time'
          ,type: 'datetime'
        });
    });
});

</script>
@endsection
