@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="8%">{{ __('auto.开关名称') }}</th>
                                    <th width="8%">{{ __('auto.开关状态') }}</th>
                                    <th width="8%">{{ __('auto.操作') }}</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($list as $k=>$v)
                                    <tr>
                                        <td>{{$v->channel == -1 ? __('auto.全部') : $v->channel}}</td>
                                        <td>
                                            {{$v->name}}
                                        </td>
                                        <td>
                                            {{$v->status == 1 ?  __('auto.已开启') : __('auto.已关闭') }}
                                        </td>
                                        <td>
                                            <button class="btn btn-sm
                                            layer-switch {{$v->status ? 'btn-gradient-danger' : 'btn-gradient-dark'}}"
                                                    href="/admin/switches/set_status/{{$v->id}}">
                                                {{$v->status == 1 ?  __('auto.已开启') : __('auto.已关闭') }}
                                            </button>
                                        </td>
                                    </tr>
                                @endforeach
                                </tbody>
                            </table>
                            <div class="box-footer clearfix" id="pages">
                                {{ __('auto.总共') }} <b>{{ $list->appends($request->all())->total() }}</b> {{ __('auto.条,分为') }}
                                <b>{{ $list->lastPage() }}</b>{{ __('auto.页') }}
                                {!! $list->links() !!}
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
@endsection
