@extends('vip.layouts')

@section('seo_title')
{{ trans('menu.prizeRecord') }}
@endsection
@section('content')
    <style>
        .layui-laydate-range {
            width: auto;
        }
        .menu {
            position: fixed;
            left: 0px;
            top: 20px;
            height: 500px;
            overflow: auto;
        }
        .menu{
            width: 140px;
        }

         .layui-table-body {
             position: relative;
             overflow: auto;
             margin-right: -1px;
         }

        /*.text{*/
            /*width: 88%;*/
        /*}*/
    </style>

    @push('dataTableJS')
        //获取树形菜单
        var menu = [];
        $.ajax({
        type: 'get',
        url: '/admin/game/GameList',
        data: {},
        dataType: 'json',
        async: false,
        success: function (json) {
        menu = json;
        }
        });

        //获取表头
        var tit=function (game){
            var header=[];
            $.ajax({
                type: 'post',
                url: '/admin/Egame/open?data=1&game='+ game,
                data: {},
                dataType: 'json',
                async: false,
                success: function (json) {
                header=json.data.dataCols
                }
            });
            return header;
        }

        //layui.tree({
        //elem: '#tree' //传入元素选择器
        //, click: function (item) { //点击节点回调
        ////layer.msg('当前节名称：' + item.id);
//
        //// 加载中...
        //var loadIndex = layer.load(2, {shade: false});
//
        ////tit(item.gameCode);
        //// 刷新表格
        //tableIns.reload({
        //   where: {
        //        game: item.gameCode
        //   },
        //   page: {
        //       curr: 1 //重新从第 1 页开始
        //   },
        //   cols:tit(item.gameCode)
        //})
//
        ////window.location='/admin/game/open?data=1&game='+ item.gameCode
//
//
        //// 关闭加载
        //layer.close(loadIndex);
//
        //}
        //, nodes: menu.data
        //});



  //重置表单
  $('.reset').on('click',function(){
	  $('input').val('');
	  $('#trade_type').val('');
	//  var type = $(this).data('type');
	//  active[type] ? active[type].call(this) : '';
  });

        var height = document.documentElement.clientHeight;
        $('.menu').css({height: (height-30)});
    @endpush
    <script type="text/html" id="openTool">
        <!-- 这里的 checked 的状态只是演示 -->
        @{{#if(d.status!=2){ }}
        <a href="/admin/egame/openAgian?no=@{{d.info_no}}&game=@{{d.game}}" class="layui-btn layui-btn-sm">开奖</a>
        @{{# } }}
    </script>
    <!---开奖管理-->
    <div class="layui-row">

        <!--<div class="layui-col-sm1 layui-col-md1 menu">

            <ul id="tree" class="tree-table-tree-box"></ul>
        </div> -->
        <div class="layui-col-sm12 layui-col-md12 text">

            <form class="layui-form rewrite" action="" eventType=eventForm>
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <label class="layui-form-label">{{ trans('gamemenu.game_no') }}</label>
                        <div class="layui-input-inline">
                            <input type="text" name="info_no" id="form_info_no" lay-verify="" autocomplete="off"
                                   class="layui-input" value="{{$info_no}}" eventType=event-query>
                        </div>
                    </div>

                    <div class="layui-inline">
                        <label class="layui-form-label">{{ trans('gamemenu.name') }}</label>
                        <div class="layui-input-inline layui-form" lay-filter="test2" style="width: 125px">
                            <select name="game" id="form_game" lay-verify="" autocomplete="off" class="layui-input" eventType=event-query>
                                <option value="">{{ trans('gamemenu.select_game') }}</option>
                                @foreach(trans('gamemenu.egame_type') as $k=>$v):
									@if(checkRriv('/game/result/'.$k))
                                        <option value="{{$k}}" @if($game==$k) selected @endif>{{$v}}</option>
                                    @endif
                                @endforeach
                            </select>
                        </div>
                    </div>


                    <div class="layui-inline">
                        <label class="layui-form-label">{{ trans('gamemenu.star_time') }}</label>
                        <div class="layui-input-inline">
                            <input type="text" name="start_time" id="form_start_time" placeholder=" - " lay-verify=""
                                   autocomplete="off" class="layui-input test-item" eventType=event-query value="{{$start_time}}">
                        </div>
                    </div>
                    <div class="layui-inline">
                        <label class="layui-form-label">{{ trans('gamemenu.end_time') }}</label>
                        <div class="layui-input-inline">
                            <input type="text" name="end_time" id="form_end_time" placeholder=" - " lay-verify=""
                                   autocomplete="off" class="layui-input test-item" eventType=event-query value="{{$end_time}}">
                        </div>
                    </div>

                    <div class="layui-inline">
                        <a class="layui-btn layui-btn-sm lay-btn-diy" data-type="reload"
                           style="opacity: 1; pointer-events: auto;" eventType=event-query-submit >提交</a>
                        <a class="layui-btn   layui-btn-sm  layui-btn-normal reset" data-type="reload"
                           style="opacity: 1; pointer-events: auto;">重置</a>
                           <a class="layui-btn layui-btn-sm layui-btn-green set" data-type="reload" style="opacity: 1; pointer-events: auto;"
                           href="javascript:window.location.reload()"><i class="layui-icon">ဂ</i></a>
                    </div>
                    <div class="layui-inline">
                        <a class="layui-btn layui-btn-sm" href="/admin/competition/add?game={{ $game }}"
                           style="opacity: 1; pointer-events: auto;">新加一期</a>
                    </div>
                </div>
            </form>
             @include('game.'.$game)
        </div>
    </div>


@endsection
