<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="csrf-token" content="{{ csrf_token() }}">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <title>layui在线调试</title>
    <link rel="stylesheet" href="{{ URL::asset('admin/frame/layui/css/layui.css')}}">
    <link rel="stylesheet" href="{{ URL::asset('admin/frame/static/css/style.css')}}">
    <style>
        body {
            margin: 10px;
        }

        .demo-carousel {
            height: 200px;
            line-height: 200px;
            text-align: center;
        }

        .statistics {
            text-align: center;
        }

        .statistics > div > div {
            height: 100px;
            padding: 20px 0px;
        }

        .pic {
            line-height: 60px;
        }

        .data > p {
            line-height: 30px;
        }

        .over {
            height: 300px;
            overflow: auto;
            border: 1px solid #e2e2e2;
        }

        .tab > .layui-table[lay-size=lg] td {
            padding: 15px;
        }

        .layui-bg-g {
            background-color: rgba(18, 207, 45, 0.81);
        }
    </style>
</head>
<body>
<script>
</script>
<script type="text/html" id="userdetail">
</script>
<div class="layui-row layui-col-space10">
    <div class="layui-col-xs12 layui-col-space10 statistics">
        <div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
            <div class="layui-col-xs6 layui-col-sm6 layui-col-md6 layui-bg-red pic">
                <i class="layui-icon" style="font-size: 50px; color: #fefffd;">&#xe612;</i>
            </div>
            <div class="layui-col-xs6 layui-col-sm6 layui-col-md6 data">
                <p>{{$total['total_user']['today_user']}}</p>
                <p>今日新增会员数量</p>
            </div>
        </div>
        <div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
            <div class="layui-col-xs6 layui-col-sm6 layui-col-md6 layui-bg-green pic">
                <i class="layui-icon" style="font-size: 30px; color: #fefffd;">&#xe613;</i>
            </div>
            <div class="layui-col-xs6 layui-col-sm6 layui-col-md6 data">
                <p>{{$total['total_user']['user_count']}}</p>
                <p>会员总数量</p>
            </div>
        </div>
        <div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
            <div class="layui-col-xs6 layui-col-sm6 layui-col-md6 layui-bg-blue pic">
                <i class="layui-icon" style="font-size: 30px; color: #fefffd;">&#xe654;</i>
            </div>
            <div class="layui-col-xs6 layui-col-sm6 layui-col-md6 data">
                <p>{{$total['total_user']['last_online']}}</p>
                <p>今日曾经在线</p>
            </div>
        </div>
        <div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
            <div class="layui-col-xs6 layui-col-sm6 layui-col-md6 layui-bg-orange pic">
                <i class="layui-icon" style="font-size: 30px; color: #fefffd;">&#xe60a;</i>
            </div>
            <div class="layui-col-xs6 layui-col-sm6 layui-col-md6 data">
                <p>{{$get_money_count}}</p>
                <p>今日存款笔数</p>
            </div>
        </div>
        <div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
            <div class="layui-col-xs6 layui-col-sm6 layui-col-md6 layui-bg-cyan pic">
                <i class="layui-icon" style="font-size: 30px; color: #fefffd;">&#xe65e;</i>
            </div>
            <div class="layui-col-xs6 layui-col-sm6 layui-col-md6 data">
                <p>{{$total['today_rimit']['count']}}</p>
                <p>今日汇款笔数</p>
            </div>
        </div>
        <div class="layui-col-xs4 layui-col-sm4 layui-col-md4">
            <div class="layui-col-xs6 layui-col-sm6 layui-col-md6 layui-bg-g pic">
                <i class="layui-icon" style="font-size: 30px; color: #ffffff;">&#xe63c;</i>
            </div>
            <div class="layui-col-xs6 layui-col-sm6 layui-col-md6 data">
                <p>{{$total['today_take']['count']}}</p>
                <p>今日提现笔数</p>
            </div>
        </div>
    </div>

    <div class="layui-col-md5 tab">
        <table class="layui-table" lay-size="lg">
            <thead>
            <tr>
                <th colspan="4">今日数据统计</th>
            </tr>
            <tr>
                <td>名称</td>
                <td>笔数</td>
                <td>金额</td>
                <td>人数</td>
            </tr>
            </thead>
            <tbody>
            <tr>
                <td>今日注单：</td>
                <td>{{$total['total_bet']['count']}}</td>
                <td>{{$total['total_bet']['money_count']}}</td>
                <td>{{$total['total_bet']['user_count']}}</td>
            </tr>
            <tr>
                <td>今日提现：</td>
                <td>{{$total['today_take']['count']}}</td>
                <td>{{$total['today_take']['money_count']}}</td>
                <td>{{$total['today_take']['user_count']}}</td>
            </tr>
            <tr>
                <td>今日存款：</td>
                @if(checkRriv('/admin/Priv_code/today_recharge'))<td>{{$total['today_recharge']['count']}}</td>@else<td>*****</td>@endif

                @if(checkRriv('/admin/Priv_code/today_recharge_money'))<td>{{$total['today_recharge']['money_count']}}</td>@else<td>*****</td>@endif

                @if(checkRriv('/admin/Priv_code/today_recharge_user'))<td>{{$total['today_recharge']['user_count']}}</td>@else<td>*****</td>@endif
            </tr>
            <tr>
                <td>今日回水：</td>
                <td>{{$total['today_return']['count']}}</td>
                <td>{{$total['today_return']['money_count']}} </td>
                <td>{{$total['today_return']['user_count']}}</td>
            </tr>
            <tr>
                <td>今日汇款：</td>
                <td>{{$total['today_rimit']['count']}}</td>
                <td>{{$total['today_rimit']['money_count']}} </td>
                <td>{{$total['today_rimit']['user_count']}}</td>
            </tr>
            </tbody>
        </table>
    </div>
    <div class="layui-col-md5 layui-col-md-offset2">
        <table class="layui-table" lay-size="lg" style="margin-bottom: 0">
            <thead>
            <tr>
                <th lay-data="{field:'username',width:'750'}">系统公告</th>
            </tr>
            </thead>
        <!--  <tbody>
           @foreach($notice as $v)
            <tr data-id="{{$v['id']}}">
                    <td>{{$v['time']}} {{$v['title']}}"</td>
                </tr>
            @endforeach
                </tbody>-->
        </table>
        <div class="over">
            <table class="layui-table" lay-size="lg" style="margin-top: 0">
                <tbody>
                @foreach($notice as $v)
                    <tr data-id="{{$v['id']}}">
                        <td>{{$v['time']}} {{$v['title']}}"</td>
                    </tr>
                @endforeach
                </tbody>
            </table>
        </div>

    </div>
</div>
<div class="layui-row layui-col-space10">

</div>


<div class="layui-tab layui-tab-brief" lay-filter="docDemoTabBrief">
    <ul class="layui-tab-title">
        <li class="layui-this">最近注册用户记录</li>
        <li >最近7天财务情况</li>
        <li>今日来源分析</li>
        <li>今日注单分析</li>
        <li>最近7天投注总额趋势图</li>
    </ul>
    <div class="layui-tab-content">
        <div class="layui-tab-item layui-show">
            <div id="sevenMember" style="width: 1000px;height:400px;margin: auto;"></div>
        </div>
        <div class="layui-tab-item ">
            <div id="sevenData" style="width: 1000px;height:400px;margin: auto;"></div>
        </div>
        
        <div class="layui-tab-item">
            <div class="layui-row layui-col-space10">
                <div class="layui-col-md5">
                    <div id="main-bing1" style="width: 480px;height:700px;"></div>
                </div>
                <div class="layui-col-md5 layui-col-md-offset2">
                    <div id="main-bing2" style="width: 480px;height:700px;"></div>
                </div>
            </div>
        </div>

        <div class="layui-tab-item">
            <div class="layui-row layui-col-space10">
                <div class="layui-col-md5">
                    <div id="main-bing3" style="width: 480px;height:700px;"></div>
                </div>
                <div class="layui-col-md5 layui-col-md-offset2">
                    <div id="main-bing4" style="width: 480px;height:700px;"></div>
                </div>
            </div>
        </div>
        <div class="layui-tab-item">
            <div id="total" style="width: 1000px;height:400px;margin: auto;"></div>
        </div>
    </div>
</div>


<script type="text/javascript" src="{{ URL::asset('admin/frame/layui/layui.js')}}"></script>
<script src="<?php echo e(URL::asset('admin/js/jquery-1.11.3.js')); ?>" charset="utf-8"></script>
<script type="text/javascript" src="{{ URL::asset('admin/frame/echarts/echarts.min.js')}}"></script>

<script>
    $.ajaxSetup({
        headers: {
            'X-CSRF-TOKEN': $('meta[name="csrf-token"]').attr('content')
        }
    });

    //注意：选项卡 依赖 element 模块，否则无法进行功能性操作
    layui.use('element', function () {
        var element = layui.element;

        //…
    });

    // 基于准备好的dom，初始化echarts实例
    var chart1 = echarts.init(document.getElementById('main-bing1'));
    var chart2 = echarts.init(document.getElementById('main-bing2'));
    var chart3 = echarts.init(document.getElementById('main-bing3'));
    var chart4 = echarts.init(document.getElementById('main-bing4'));


    var chart5 = echarts.init(document.getElementById('sevenData'));
    var chart6 = echarts.init(document.getElementById('sevenMember'));
    var chart7 = echarts.init(document.getElementById('total'));

    var n = [chart5, chart6,chart7];
    var  pie= [chart1, chart2, chart3, chart4];
    // 配置
    for (var x = 0; x< pie.length; x++) {
        pie[x].setOption({
            title: {
                text: '',
                left: 'center'
            },
            tooltip: {
                trigger: 'item',
                formatter: "{a} <br/>{b} : {c} ({d}%)"
            },
            legend: {
                bottom: 10,
                left: 'center',
                data: []
            },
            series: [
                {
                    type: 'pie',
                    radius: '55%',
                    data:[]
                }
            ]
        });
    }


    for (var i = 0; i < n.length; i++) {
        n[i].setOption({
            title: {
                text: ''
            },
            tooltip: {
                trigger: 'axis'
            },
            legend: {
                data: []
            },
            color:['red','black','blue','yellow','#15f77a','#02f1d0','#ed02f1'],
            grid: {
                left: '3%',
                right: '4%',
                bottom: '3%',
                containLabel: true
            },
            toolbox: {
                feature: {
                    saveAsImage: {}
                }
            },
            xAxis: {
                type: 'category',
                boundaryGap: false,
                data: []
            },
            yAxis: {
                type: 'value'
            },
            series: []
        });
    }

    // 异步加载数据
    @if(checkRriv('/admin/Index/onlineUser'))$.get('/admin/index/getBetUrl').done(function (data) {
        var data = data.data;
        // 填入数据
        chart1.setOption({
            title: {
                text: data.text
            },
            legend: {
                data: data.title
            },
            series:{
                data:data.data
            }
        });
    });


    // 异步加载数据/admin/index/onlineUser/admin/game/allTotalBetmoney
    $.get('/admin/index/onlineUser').done(function (data) {
        var data = data.data;
		//console.log('onlineUser');
		//console.log(data);
        // 填入数据
        chart2.setOption({
            title: {
                text: data.text
            },
            legend: {
                data: data.title
            },
            series:{
                data:data.data
            }
        });
    });@endif

    // 异步加载数据
  //   @if(checkRriv('/admin/game/allTotalBetmoney'))$.get('/admin/game/allTotalBetmoney').done(function (data) {
  //       var data = data.data;
		// //console.log('allTotalBetmoney');
		// //console.log(data);
  //       // 填入数据
  //       chart3.setOption({
  //           title: {
  //               text: '今日注单金额'
  //           },
  //           legend: {
  //               data: data.title
  //           },
  //           series:{
  //               data:data.data
  //           }
  //       });
  //   });
    // 异步加载数据
    $.get('/admin/index/TodayGameNote').done(function (data) {
        var data = data.data;
        // 填入数据
        chart4.setOption({
            title: {
                text: data.text
            },
            legend: {
                data: data.title
            },
            series:{
                data:data.data
            }
        });
    });@endif

    // 异步加载数据
    @if(checkRriv('/admin/index/money'))$.get('/admin/index/money').done(function (data) {
        var data = data.data;
        var legend = data.legend;
        var arr = [], tit = [];
        for (var i in legend) {
            var no = legend[i];
            var obj = {};
            obj.name = legend[i];
            obj.type = 'line';
            obj.data = data.data[i];
            arr.push(obj);
            tit.push(no);
        }
        // 填入数据
        chart5.setOption({
            title: {
                text: '最近7天财务情况'
            },
            legend: {
                data: tit
            },
            xAxis: {
                data: data.title
            },
            series: arr
        });
    });@endif

    @if(checkRriv('/admin/index/regUser'))$.get('/admin/index/regUser').done(function (data) {
        var data = data.data;
        var legend = data.legend;
        var arr = [];
        for (var i = 0; i < legend.length; i++) {
            var no = legend[i];
            var obj = {};
            obj.name = legend[i];
            obj.type = 'line';
            obj.data = data.data.num;
            arr.push(obj);
        }

        // 填入数据
        chart6.setOption({
            title: {
                text: '最近注册用户记录'
            },
            legend: {
                data: data.legend
            },
            xAxis: {
                data: data.title
            },
            series: arr
        });
    });@endif

    // @if(checkRriv('/admin/game/sevendayBetmoney'))$.get('/admin/game/sevendayBetmoney').done(function (data) {
    //     var data = data.data;
    //     var legend = data.lenged;
    //     var arr = [],tit=[];
    //     for (var i in legend) {
    //         var no = legend[i];
    //         var obj = {};
    //         obj.name = legend[i];
    //         obj.type = 'line';
    //         obj.data = data.data[i];
    //         arr.push(obj);
    //         tit.push(no);
    //     }

    //     // 填入数据
    //     chart7.setOption({
    //         title: {
    //             text: '最近7天投注总额趋势图'
    //         },
    //         legend: {
    //             data: tit
    //         },
    //         xAxis: {
    //             data: data.title
    //         },
    //         series: arr
    //     });
    // });@endif


</script>
</body>
</html>
