@extends('base.base')
@section('base')
    <!-- 内容区域 -->
    <div class="main-panel">
        <div class="content-wrapper">
            <div class="page-header">
                <h3 class="page-title">
                     <span class="page-title-icon bg-gradient-primary text-white mr-2">
                        <i class="mdi mdi-settings"></i>
                    </span>
                    {{ __('auto.跑马灯') }}
                </h3>
                <nav aria-label="breadcrumb">
                    <ol class="breadcrumb">
                        <li class="breadcrumb-item"><a href="#">{{ __('auto.活动管理') }}</a></li>
                        <li class="breadcrumb-item active" aria-current="page">{{ __('auto.跑马灯') }}</li>
                    </ol>
                </nav>
            </div>
            <div class="row">
                <div class="col-lg-12 grid-margin stretch-card">
                    <div class="card">
                        <div class="card-body">
                            <h4 class="card-title">{{ __('auto.跑马灯') }}</h4>

                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th width="5%">{{ __('auto.对应游戏') }}</th>
                                    <th width="5%">{{ __('auto.超过金额播报') }}</th>
                                    <th width="8%">{{ __('auto.控制金额修改') }}</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($list as $val)
                                    <tr>
                                        <td>{{$val->KindName}}</td>
                                        <td>{{$val->Gap}}</td>
                                        <td>
                                            <button class="btn  btn-sm btn-gradient-dark"
                                                    onclick="update({{$val->KindID}})">
                                                {{ __('auto.修改') }}
                                            </button>

                                        </td>

                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                            {{--                            <div class="box-footer clearfix" id="pages">--}}
                            {{--                                {{ __('auto.总共') }} <b>{{ $list->appends([--}}
                            {{--                                        'list'=>$list,--}}

                            {{--])->total() }}</b> {{ __('auto.条,分为') }}<b>{{ $list->lastPage() }}</b>{{ __('auto.页') }}--}}
                            {{--                                {!! $list->links() !!}--}}
                            {{--                            </div>--}}
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>


        // 修改
        function update(id) {
            layer.open({
                type: 2,
                title: '{{ __('auto.修改') }}',
                shadeClose: true,
                shade: 0.8,
                area: ['50%', '60%'],
                content: '/admin/notice/horse_race_lamp_update/' + id
            });
        }


        function switch_control(id, ChannelIndex, AndroidVersion, type) {

            myConfirm("{{ __('auto.操作不可逆,是否继续') }}?", function () {
                myRequest("/admin/channel/switch/" + id, "post", {ChannelIndex, AndroidVersion, type}, function (res) {
                    layer.msg(res.msg)
                    setTimeout(function () {
                        window.location.reload();
                    }, 2000)
                });
            });
        }


    </script>
@endsection
