@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-wrench"></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>{{ __('auto.玩家') }}GameID</th>
                                    <th>{{ __('auto.转账数量') }}</th>
                                    <th>{{ __('auto.转账原因') }}</th>
                                    <th>{{ __('auto.邮件标题') }}</th>
                                    <th>{{ __('auto.邮件内容') }}</th>
                                </tr>
                                </thead>
                                <tbody>
                                @foreach($list as $k=>$v)
                                    <tr>
                                        @foreach($v as $k1=>$v1)
                                        <td style="width: 5%">{{ $v1 }}</td>
                                        @endforeach
                                    </tr>
                                @endforeach
                                </tbody>
                                <form class="forms-sample" id="form">
                                    <input type="hidden" name="text" value="{{$str}}">
                                    <button type="button" onclick="commit()" class="btn btn-sm btn-gradient-primary btn-icon-text">
                                        <i class="mdi mdi-file-check btn-icon-prepend"></i>
                                        {{ __('auto.提交') }}
                                    </button>
                                    <button type="button" onclick="cancel()" class="btn btn-sm btn-gradient-warning btn-icon-text">
                                        <i class="mdi mdi-reload btn-icon-prepend"></i>
                                        {{ __('auto.取消') }}
                                    </button>
                                </form>
                            </table>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        function commit(){
            if(!checkForm()){
                return false;
            }
            var data = $("#form").serializeObject();
            myConfirm("{{ __('auto.是否继续') }}?",function(){
                myRequest("/admin/card/give/","post",data,function(res){
                    layer.msg(res.msg)
                    if(res.code === 200){
                        setTimeout(function(){
                            window.location.href="/admin/card/give";
                        },1500)
                    }
                });
            });
        }
        function cancel() {
            window.location.href="/admin/card/give";
        }
    </script>
@endsection
