@extends('vip.layouts')
@section('seo_title')
    {{ trans('menu.backwater') }}
@endsection
@section('content')
    <style>
        .layui-laydate-range {
            width: auto;
        }

        .layui-form-switch em {
            width: auto;
        }

        .layui-form-switch {
            width: 44px;
            line-height: 23px;
        }

        .layui-form-item .checkbox {
            width: auto;
        }
    </style>
	<script type="text/html" id="userdetail">
	  <span>@{{ d.order_id}}</span>
	</script>

    <script type="text/html" id="game_type">
        @{{#if(d.game_type=='Oggame'){ }}
            <p>OG视讯</p>
        @{{#}else if(d.game_type=='Kygame'){ }}
            <p>开元棋牌</p>
        @{{#}else if(d.game_type=='Lcqpgame'){ }}
            <p>龙城棋牌</p>
        @{{#}else if(d.game_type=='Lygame'){ }}
            <p>乐游棋牌</p>
        @{{#}else if(d.game_type=='Hjgame'){ }}
            <p>皇家视讯</p>
        @{{#}else if(d.game_type=='Ogsports'){ }}
            <p>OG体育</p>
        @{{#}else if(d.game_type=='fygame'){ }}
            <p>泛亚电竞</p>
        @{{#}else if(d.game_type=='bbingame'){ }}
            <p>BBIN视讯</p>
        @{{#}else if(d.game_type=='mggame'){ }}
            <p>MG电子</p>
        @{{#}else{ }}
            <p>AG视讯</p>
        @{{#} }}
    </script>

    <script type="text/html" id="status_water">
        @{{#if(d.status==1){ }}
        <p style="color:green;">成功</p>
        @{{#}else{ }}
         <p style="color:red;">失败</p>
        @{{#} }}
    </script>
<div class="layui-row">

    <div class="layui-col-xs12">
        <div class="layui-inline">
        </div>
		<form class="layui-form rewrite" action="" eventType=eventForm>
            <div class="layui-form-item">

                <div class="layui-inline">
                    <label class="layui-form-label">平台类型</label>
                    <div class="layui-input-inline" style="width: 200px">
                        <select name="game_type"  id="form_gametype"  lay-verify="" autocomplete="off" class="layui-input"  eventType=event-query>
                            @foreach($gamelist as $k=>$v):
                            @if($game_type==$v['game_type']))
                            <option value="{{$v['game_type']}}" selected="selected">{{$v['game_zh']}}</option>
                            @else
                            <option value="{{$v['game_type']}}" eventType=event-query>{{$v['game_zh']}}</option>
                            @endif
                            @endforeach
                        </select>
                    </div>
                </div>

                <div class="layui-inline">
					<label class="layui-form-label">{{ trans('money.account_name') }}</label>
					<div class="layui-input-inline">
						<input type="text" name="user_name" id="form_account_name" lay-verify="required" autocomplete="off" class="layui-input" eventType=event-query value="{{$user_name}}">
					</div>
					<div class="layui-input-inline checkbox">
						<input type="checkbox" name="sureblur" id="form_sureblur" lay-skin="switch" lay-text="精确|模糊" checked eventType=event-query>
					</div>
                </div>

                <div class="layui-inline">
                    <label class="layui-form-label">订单</label>
                    <div class="layui-input-inline">
                        <input type="text" name="order_id" id="form_order_id" lay-verify="required" autocomplete="off" class="layui-input" eventType=event-query value="{{$order_id}}">
                    </div>
                </div>

				<div class="layui-inline">
					<label class="layui-form-label">{{ trans('gamemenu.star_time') }}</label>
					<div class="layui-input-inline">
						<input type="text" name="star_time" id="form_star_time" placeholder=" - " lay-verify="" autocomplete="off"  value="{{$star_time}}" class="layui-input test-item" eventType=event-query>
					</div>
				</div>
				<div class="layui-inline">
					<label class="layui-form-label">{{ trans('gamemenu.end_time') }}</label>
					<div class="layui-input-inline">
						<input type="text" name="end_time" id="form_end_time" placeholder=" - " lay-verify="" autocomplete="off" value="{{$end_time}}" class="layui-input test-item" eventType=event-query>
					</div>
				</div>
                <div class="layui-inline">
                <a class="layui-btn layui-btn-sm lay-btn-diy"   data-type="reload" style="opacity: 1; pointer-events: auto;" eventType=event-query-submit>提交</a>
				<a  class="layui-btn   layui-btn-sm  layui-btn-normal 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>
    </div>
    </div>
@push('dataTableJS')
  function dataTableLoadFinished(res,curr,count){
        var str='';
        var game_type=$('#form_gametype').val();
        var star_time=$('#form_star_time').val();
        var end_time=$('#form_end_time').val();
        if(document.getElementById("statistics")){

        }else{
            $('.layui-table-page').after('<div id="statistics"></div>');
        }
        $.ajax({
            type: 'get',
            url: '/admin/Backwater_log/Countmoney',
            data: {game_type:game_type,star_time:star_time,end_time:end_time},
            dataType: 'json',
            success: function (data) {
            var data=data.data;

            for(var i in data){
                data[i]=parseFloat(data[i]);
            }

            <!-- str+='<p>总金额：<span class="blue">'+data.totalMoney+'</span> ,'; -->
            str+='<p style="text-align: center;">反水总金额：<span class="green" style="color: red;">'+data.money+'&nbspRMB</span> </p>';
            $('#statistics').html(str);
            var height1=$('.layui-table-view').height();
            var height2=$('#statistics').height();
            $('.layui-table-view').css({height:(height1+height2)});
            }
        });


   }

@endpush

@include('vip.datatable')
@endsection
