@extends('vip.layouts')
@section('seo_title')
    开奖信息设置
@endsection
@section('content')
    <style>
        .layui-laydate-range {
            width: auto;
        }
        .menu{
            width: 140px;
        }
        .text{
            width: 88%;
        }
    </style>

    @push('dataTableJS')
        var active = {
        reload: function(){
        //执行重载
        table.reload('{{ $dataId }}', {
        page: {
        curr: 1 //重新从第 1 页开始
        }
        ,where: {
        name:$('#name').val(),
        }
        });
        }
        };
        $('.lay-btn-diy').on('click', function(){
        var type = $(this).data('type');
        active[type] ? active[type].call(this) : '';
        });

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

        var menu = [];
        $.ajax({
        type: 'get',
        url: '/admin/infos/getGame',
        data: {},
        dataType: 'json',
        async: false,
        success: function (json) {
        menu = json;
        }
        });

        //layui.tree({
        //    elem: '#tree' //传入元素选择器
        //    , click: function (item) { //点击节点回调
        //        var loadIndex = layer.load(2, {shade: true});

        //        $('.addTo').attr('game',item.game_name);
        //        window.location.href='/admin/infos/index?game='+item.game_name;

                // 关闭加载
        //        layer.close(loadIndex);
        //    }
        //    , nodes: menu.data
        //});

        $(document).on('click','.addTo',function(){
            var gameName=$(this).attr('game');
            openWin('/admin/infos/add?game='+gameName,'开奖信息设置','850px','600px')
        })

    @endpush
    <script type="text/html" id="edit">
       @{{#if(d.status == 2){ }}
            <a href="/admin/Infos/Edit?id=@{{ d.id }}&status=@{{ d.status }}&game={{$game}}"  class="layui-btn layui-btn-xs" >查看</a><br>
       @{{#}else{ }}
            <a href="/admin/Infos/Edit?id=@{{ d.id }}&status=@{{ d.status }}&game={{$game}}"  class="layui-btn layui-btn-xs layui-btn-warm" >修改</a><br>
       @{{#} }}
    </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-sm11 layui-col-md11 text">

            <form class="layui-form" action=""  eventType=eventForm>
                <div class="layui-form-item">
                @if(checkRriv('/admin/infos/add'))<!-- <div class="layui-inline"><a href="javascript:;" class="layui-btn layui-btn-sm layui-btn-danger addTo" game="{{$game}}">添加</a></div> -->@endif
                    <div class="layui-inline">
                        <label class="layui-form-label">{{ trans('gamemenu.name') }}</label>
                        <div class="layui-input-inline">
                            <select name="game" id="form_game" lay-verify="" autocomplete="off" class="layui-input"  eventType=event-query>
                                <option value="">{{ trans('gamemenu.select_game') }}</option>
                                <option value="jspk10" @if($game=='jspk10') selected @endif>三分pk10</option>
                                <option value="threessc" @if($game=='threessc') selected @endif>三分时时彩</option>
                                <option value="onepk10" @if($game=='onepk10') selected @endif>极速赛车</option>
                                <option value="onessc" @if($game=='onessc') selected @endif>极速分分彩</option>
                                <option value="one28" @if($game=='one28') selected @endif>极速28</option>
                                <option value="onekuai3" @if($game=='onekuai3') selected @endif>极速快三</option>
                                <option value="sfsixlottery" @if($game=='sfsixlottery') selected @endif>极速六合彩</option>
                            </select>
                        </div>
                        <div class="layui-inline">
                            <label class="layui-form-label">{{ trans('gamemenu.info_no') }}</label>
                            <div class="layui-input-inline">
                                <input type="text" name="no"  id="form_no" lay-verify="" autocomplete="off" class="layui-input" value="{{$no}}" eventType=event-query>
                            </div>
                        </div>
                        <!--时间-->
               <div class="layui-inline">
                                <label class="layui-form-label">{{ trans('system_user.star_time') }}</label>
                                <div class="layui-input-inline">
                                    <input type="text" name="star_time"  id="form_star_time" placeholder=" - "  lay-verify="" autocomplete="off" class="layui-input test-item" value="{{$star_time}}" eventType=event-query>
                                </div>
                            </div>
                            <div class="layui-inline">
                                <label class="layui-form-label">{{ trans('system_user.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" value="{{$end_time}}" eventType=event-query>
                                </div>
                           </div>
                        <div class="layui-inline">
                            <a class="layui-btn layui-btn-sm lay-btn-diy"   data-type="reload" eventType="event-query-submit" style="opacity: 1; pointer-events: auto;">提交</a>
                            <a  class="layui-btn   layui-btn-sm  layui-btn-normol 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;"><i class="layui-icon">ဂ</i></a>
                        </div>
                </div>
            </form>
            @include('vip.datatable')
        </div>
    </div>



@endsection
