@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>
                            <form class="well form-inline margin-top-20" method="post" action='/admin/global/userlist'>
                                <div>
                                    @csrf
                                </div>


                            </form>
                            <table class="table table-bordered">
                                <thead>
                                <tr>
                                    <th width="6%">{{ __('auto.菜单名称') }}</th>
                                    <th width="4%">{{ __('auto.当前设定值') }}</th>
                                    <th width="6%">{{ __('auto.最后操作人') }}</th>
                                    <th width="6%">{{ __('auto.更新时间') }}</th>
                                    <th width="6%">{{ __('auto.操作') }}</th>

                                </tr>
                                </thead>
                                <tbody class="search_checkbox">
                                {{--                                @foreach($list as $k=>$item)--}}
                                <tr>
                                    <td>{{ __('auto.人工审核额度设置') }}</td>
                                    <td>{{$artificial->StatusValue}}</td>
                                    <td>{{$artificial->account}}</td>
                                    <td>{{$artificial->create_at}}</td>
                                    <td>
                                        @if (!session()->has('hidden'))
                                            <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text"
                                                    onclick="update('rengong')">
                                                {{ __('auto.修改') }}
                                                <i class="mdi mdi-file-check btn-icon-append"></i>
                                            </button>
                                        @endif
                                    </td>
                                </tr>
                                <tr>
                                    <td>{{ __('auto.茶叶手续费设置') }}</td>
                                    <td>{{$fee->StatusValue}}%</td>
                                    <td>{{$fee->account}}</td>
                                    <td>{{$fee->create_at}}</td>
                                    <td>
                                        @if (!session()->has('hidden'))
                                            <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text"
                                                    onclick="update('shouxufei')">
                                                {{ __('auto.修改') }}
                                                <i class="mdi mdi-file-check btn-icon-append"></i>
                                            </button>
                                        @endif
                                    </td>
                                </tr>
                                <tr>
                                    <td>{{ __('auto.茶叶金额比例设置') }}</td>
                                    <td>{{$proportion->StatusValue}}%</td>
                                    <td>{{$proportion->account}}</td>
                                    <td>{{$proportion->create_at}}</td>
                                    <td>
                                        @if (!session()->has('hidden'))
                                            <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text"
                                                    onclick="update('bilie')">
                                                {{ __('auto.修改') }}
                                                <i class="mdi mdi-file-check btn-icon-append"></i>
                                            </button>
                                        @endif
                                    </td>
                                </tr>
                                <tr>
                                    <td>{{ __('auto.茶叶最低值') }}</td>
                                    <td>{{$WithDrawMin->StatusValue}}</td>
                                    <td>{{$WithDrawMin->account}}</td>
                                    <td>{{$WithDrawMin->create_at}}</td>
                                    <td>
                                        @if (!session()->has('hidden'))
                                            <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text"
                                                    onclick="update('WithDrawMin')">
                                                {{ __('auto.修改') }}
                                                <i class="mdi mdi-file-check btn-icon-append"></i>
                                            </button>
                                        @endif
                                    </td>
                                </tr>
                                <tr>
                                    <td>{{ __('auto.茶叶最大值') }}</td>
                                    <td>{{$WithDrawMax->StatusValue}}</td>
                                    <td>{{$WithDrawMax->account}}</td>
                                    <td>{{$WithDrawMax->create_at}}</td>
                                    <td>
                                        @if (!session()->has('hidden'))
                                            <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text"
                                                    onclick="update('WithDrawMax')">
                                                {{ __('auto.修改') }}
                                                <i class="mdi mdi-file-check btn-icon-append"></i>
                                            </button>
                                        @endif
                                    </td>
                                </tr>

                                <tr>
                                    <td>{{ __('auto.茶叶保底额度') }}</td>
                                    <td>{{$WithDrawPoint->StatusValue}}</td>
                                    <td>{{$WithDrawPoint->account}}</td>
                                    <td>{{$WithDrawPoint->create_at}}</td>
                                    <td>
                                        @if (!session()->has('hidden'))
                                            <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text"
                                                    onclick="update('WithDrawPoint')">
                                                {{ __('auto.修改') }}
                                                <i class="mdi mdi-file-check btn-icon-append"></i>
                                            </button>
                                        @endif
                                    </td>
                                </tr>
                                <tr>
                                    <td>0{{ __('auto.充玩家茶叶限制最高额度') }}</td>
                                    <td>{{$MaxTXNotRecharge->StatusValue}}</td>
                                    <td>{{$MaxTXNotRecharge->account}}</td>
                                    <td>{{$MaxTXNotRecharge->create_at}}</td>
                                    <td>
                                        @if (!session()->has('hidden'))
                                            <button type="button" class="btn btn-sm btn-gradient-dark btn-icon-text"
                                                    onclick="update('MaxTXNotRecharge')">
                                                {{ __('auto.修改') }}
                                                <i class="mdi mdi-file-check btn-icon-append"></i>
                                            </button>
                                        @endif
                                    </td>
                                </tr>

                                {{--                                @endforeach--}}
                                </tbody>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>

        function update(val) {
            if (val !== '') {
                if (val === 'rengong') {
                    var page = layer.open({
                        type: 2,
                        title: '{{ __('auto.人工审核额度设置') }}',
                        shadeClose: true,
                        shade: 0.8,
                        area: ['40%', '60%'],
                        content: '/admin/withdrawal/artificial?'
                    });
                } else if (val === 'shouxufei') {
                    var page = layer.open({
                        type: 2,
                        title: '{{ __('auto.茶叶手续费设置') }}',
                        shadeClose: true,
                        shade: 0.8,
                        area: ['40%', '60%'],
                        content: '/admin/withdrawal/fee'
                    });
                } else if (val === 'WithDrawMax') {
                    var page = layer.open({
                        type: 2,
                        title: '{{ __('auto.茶叶最大值') }}',
                        shadeClose: true,
                        shade: 0.8,
                        area: ['40%', '60%'],
                        content: '/admin/withdrawal/WithDrawMax'
                    });
                } else if (val === 'WithDrawMin') {
                    var page = layer.open({
                        type: 2,
                        title: '{{ __('auto.茶叶最小值') }}',
                        shadeClose: true,
                        shade: 0.8,
                        area: ['40%', '60%'],
                        content: '/admin/withdrawal/WithDrawMin'
                    });
                }else if (val === 'WithDrawPoint') {
                    var page = layer.open({
                        type: 2,
                        title: '{{ __('auto.茶叶保底额度') }}',
                        shadeClose: true,
                        shade: 0.8,
                        area: ['40%', '60%'],
                        content: '/admin/withdrawal/WithDrawPoint'
                    });
                }else if (val === 'MaxTXNotRecharge') {
                    var page = layer.open({
                        type: 2,
                        title: '0{{ __('auto.充玩家茶叶限制最高额度') }}',
                        shadeClose: true,
                        shade: 0.8,
                        area: ['40%', '60%'],
                        content: '/admin/withdrawal/MaxTXNotRecharge'
                    });
                }  else {
                    var page = layer.open({
                        type: 2,
                        title: '{{ __('auto.茶叶金额比例设置') }}',
                        shadeClose: true,
                        shade: 0.8,
                        area: ['40%', '60%'],
                        content: '/admin/withdrawal/proportion'
                    });
                }
            }

        }
    </script>
@endsection
