@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">
		{{$data['gname']}}编辑
	</div>
	
	 <div class="layui-form-item">
		<label class="layui-form-label">{{ trans('sixlottery.name') }}</label>
		<div class="layui-input-block">
		<input type="text"  lay-verify="" placeholder="" autocomplete="off" value="{{ $data['gname'] }}" class="layui-input" disabled="disabled">
		</div>
	</div>
	 <div class="layui-form-item">
		<label class="layui-form-label">{{ trans('sixlottery.info_no') }}:</label>
		<div class="layui-input-block">
		<input type="text" name="info_no"   id="info_no"  required  lay-verify="" placeholder="" autocomplete="off" value="@isset($data) {{ $data['info_no'] }} @endisset" class="layui-input">
		</div>
	</div>
	 <div class="layui-form-item">
		<label class="layui-form-label">{{ trans('sixlottery.open_time') }}:</label>
		<div class="layui-input-block">
			<input type="text" name="open_time" class="layui-input" id="form_open_time" placeholder=""  required value="@isset($data) {{ $data['open_time'] }} @endisset">
		</div>
	</div>
	 <div class="layui-form-item">
		<label class="layui-form-label">{{ trans('sixlottery.time') }}:</label>
		<div class="layui-input-block">
			<input type="text" name="time" class="layui-input" id="form_time" placeholder=""  required value="@isset($data) {{ $data['time'] }} @endisset">
		</div>
	</div>
	 <div class="layui-form-item">
		<label class="layui-form-label">{{ trans('sixlottery.close_time') }}:</label>
		<div class="layui-input-block">
			<input type="text" name="close_time" class="layui-input" id="form_close_time" placeholder="" required value="@isset($data) {{ $data['close_time'] }} @endisset">
		</div>
	</div>
	 <div class="layui-form-item" style="color:red;">				注意：开奖时间必须大于封盘时间。时间格式务必填写正确，如2014-10-10-10 10:10:10
	</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="" class="layui-btn layui-btn-primary returnpage">返回</button>
    </div>
  </div>
@endif
</form>

<script>
//Demo
$('.returnpage').on('click',function(){
	window.history.go(-1);
});
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(){
		window.history.go(-1);//返回上一页
	},2500);
}

layui.use('laydate', function(){
  var laydate = layui.laydate;
  
  //时间选择器
  laydate.render({
    elem: '#form_open_time'
    ,type: 'datetime'
  });
  laydate.render({
    elem: '#form_time'
    ,type: 'datetime'
  });
  laydate.render({
    elem: '#form_close_time'
    ,type: 'datetime'
  });
});
</script>
@endsection
