<link rel="stylesheet" href="<?php echo base_url();?>public/js/vendor/bootstrap-datepicker/css/bootstrap-datepicker.standalone.min.css">
<script src="<?php echo base_url();?>public/js/vendor/bootstrap-datepicker/js/bootstrap-datepicker.min.js"></script>
<script src="<?php echo base_url();?>public/js/vendor/bootstrap-datepicker/locales/bootstrap-datepicker.zh-CN.min.js"></script>
<style type="text/css">
    th, td {
        text-align: center;
    }
    td {
        font-size: 14px;
    }

    .has-num {
        color: rgb(51, 51, 255);
        font-weight: bold;
    }
    .has-num2 {
        color: green;
        font-weight: bold;
    }
    .title-text {
        text-align: center;
        font-size:16px;
    }
</style>
    <div class="content_wrapper">
        <div class="container-fluid">
            <div class="row">
                <div class="col-sm-12">
                    <aside>
                        <header><i class="fa fa-fw fa-file"></i>场次玩牌人数统计</header>
                        <section>
                            <div class="container-fluid">
                                <div class="row">
                                    <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
                                </div>
                            </div>
                        </section>
                    </aside>
                </div>
            </div>


            <div class="row">
            <div class="col-sm-12">
                <aside>
                    <header><i class="fa fa-fw fa-file"></i>桌子在线实时统计</header>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <!--德州场-->
                                <div class="col-sm-12">
                                    <div class="table-responsive">
                                        <?php if(!empty($game)) {
                                            $blindKeys = array_keys($game);
                                            $count = count($blindKeys);
                                        } ?>
                                        <table id="configTable" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th colspan="<?php echo ($count ?? 0 ) + 1;?>" class="title-text">德州场</th>
                                            </tr>
                                            <tr>
                                                <th>盲注</th>
                                                <?php if(!empty($blindKeys)) {
                                                    foreach ($blindKeys as $k => $blind) { ?>
                                                        <th ><?php echo $blind;?></th>
                                                    <?php  }
                                                } ?>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr>
                                                <td>桌子数</td>
                                                <?php if(!empty($game)) {
                                                    foreach ($game as $k => $num) { ?>
                                                        <td class="<?php if($num > 0){echo 'has-num';}?>"><?php echo $num;?></td>
                                                    <?php  }
                                                } ?>
                                            </tr>
                                            <tr>
                                                <td>人数</td>
                                                <?php if(!empty($texasNum)) {
                                                    foreach ($texasNum as $k => $num) { ?>
                                                        <td class="<?php if($num > 0){echo 'has-num2';}?>"><?php echo $num;?></td>
                                                    <?php  }
                                                } ?>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>

                                <!--私人房-->
                                <div class="col-sm-3">
                                    <div class="table-responsive">
                                        <table id="configTable4" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th colspan="2" class="title-text">私人房</th>
                                            </tr>
                                            <tr>
                                                <th>场次</th>
                                                <th>100</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr>
                                                <td>桌子数</td>
                                                <td class="<?php if($private[100] > 0){echo 'has-num';}?>"><?php echo $private[100];?></td>
                                            </tr>
                                            <tr>
                                                <td>人数</td>
                                                <td class="<?php if($privateNum[100] > 0){echo 'has-num2';}?>"><?php echo $privateNum[100];?></td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                                <!--奥马哈场-->
                                <div class="col-sm-9">
                                    <div class="table-responsive">
                                        <?php if(!empty($omaha)) {
                                            $blindKeys2 = array_keys($omaha);
                                            $count2 = count($blindKeys2);
                                        } ?>
                                        <table id="configTable2" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th colspan="<?php echo ($count2 ?? 0 ) + 1;?>" class="title-text">奥马哈场</th>
                                            </tr>
                                            <tr>
                                                <th>盲注</th>
                                                <?php if(!empty($blindKeys2)) {
                                                    foreach ($blindKeys2 as $k => $blind2) { ?>
                                                        <th ><?php echo $blind2;?></th>
                                                    <?php  }
                                                } ?>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr>
                                                <td>桌子数</td>
                                                <?php if(!empty($omaha)) {
                                                    foreach ($omaha as $k => $num2) { ?>
                                                        <td class="<?php if($num2 > 0){echo 'has-num';}?>"><?php echo $num2;?></td>
                                                    <?php  }
                                                } ?>
                                            </tr>
                                            <tr>
                                                <td>人数</td>
                                                <?php if(!empty($omahaNum)) {
                                                    foreach ($omahaNum as $k => $num2) { ?>
                                                        <td class="<?php if($num2 > 0){echo 'has-num2';}?>"><?php echo $num2;?></td>
                                                    <?php  }
                                                } ?>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>

                                </div>

                                <!--百人场-->
                                <div class="col-sm-3">
                                    <div class="table-responsive">
                                        <table id="configTable4" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th colspan="2" class="title-text">百人场</th>
                                            </tr>
                                            <tr>
                                                <th>场次</th>
                                                <th>601</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr>
                                                <td>桌子数</td>
                                                <td class="<?php if($redblack[601] > 0){echo 'has-num';}?>"><?php echo $redblack[601];?></td>
                                            </tr>
                                            <tr>
                                                <td>人数</td>
                                                <td class="<?php if($redblackNum[601] > 0){echo 'has-num2';}?>"><?php echo $redblackNum[601];?></td>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>

                                <!--比赛场-->
                     <!--           <div class="col-sm-9">
                                    <div class="table-responsive">
                                        <?php if(!empty($match)) {
                                            $levelKeys3 = array_keys($match);
                                            $count3 = count($levelKeys3);
                                        } ?>
                                        <table id="configTable3" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th colspan="<?php echo ($count3 ?? 0 ) + 1;?>" class="title-text">比赛场</th>
                                            </tr>
                                            <tr>
                                                <th>场次</th>
                                                <?php if(!empty($levelKeys3)) {
                                                    foreach ($levelKeys3 as $k => $level) { ?>
                                                        <th ><?php echo $level;?></th>
                                                    <?php  }
                                                } ?>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr>
                                                <td>桌子数</td>
                                                <?php if(!empty($match)) {
                                                    foreach ($match as $k => $num3) { ?>
                                                        <td class="<?php if($num3 > 0){echo 'has-num';}?>"><?php echo $num3;?></td>
                                                    <?php  }
                                                } ?>
                                            </tr>
                                            <tr>
                                                <td>人数</td>
                                                <?php if(!empty($matchNum)) {
                                                    foreach ($matchNum as $k => $num3) { ?>
                                                        <td class="<?php if($num3 > 0){echo 'has-num2';}?>"><?php echo $num3;?></td>
                                                    <?php  }
                                                } ?>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div> -->


                                <!--必下场-->
                                <div class="col-sm-9">
                                    <div class="table-responsive">
                                        <?php if(!empty($allin)) {
                                            $levelKeys3 = array_keys($allin);
                                            $count3 = count($levelKeys3);
                                        } ?>
                                        <table id="configTable3" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th colspan="<?php echo ($count3 ?? 0 ) + 1;?>" class="title-text">必下场</th>
                                            </tr>
                                            <tr>
                                                <th>场次</th>
                                                <?php if(!empty($levelKeys3)) {
                                                    foreach ($levelKeys3 as $k => $level) { ?>
                                                        <th ><?php echo $level;?></th>
                                                    <?php  }
                                                } ?>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <tr>
                                                <td>桌子数</td>
                                                <?php if(!empty($allin)) {
                                                    foreach ($allin as $k => $num3) { ?>
                                                        <td class="<?php if($num3 > 0){echo 'has-num';}?>"><?php echo $num3;?></td>
                                                    <?php  }
                                                } ?>
                                            </tr>
                                            <tr>
                                                <td>人数</td>
                                                <?php if(!empty($allinNum)) {
                                                    foreach ($allinNum as $k => $num3) { ?>
                                                        <td class="<?php if($num3 > 0){echo 'has-num2';}?>"><?php echo $num3;?></td>
                                                    <?php  }
                                                } ?>
                                            </tr>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>


                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
        </div>
</div>
</div>
<script type="text/javascript" src="<?php echo base_url();?>public/js/highcharts/highcharts.js"></script>
<script type="text/javascript" src="<?php echo base_url();?>public/js/highcharts/modules/exporting.js"></script>
<script type="text/javascript">
Highcharts.chart('container', {
    chart: {
        type: 'line'
    },
    title: {
        text: '场次玩牌人数统计'
    },
    subtitle: {
        text: ''
    },
    xAxis: {
        categories: [<?php echo "'".implode("','", $timeList)."'";?>]
    },
    yAxis: {
        title: {
            text: '数值'
        }
    },
    plotOptions: {
        line: {
            dataLabels: {
                enabled: true
            },
            enableMouseTracking: false
        }
    },
    series: [<?php echo $info;?>]
});
</script>
<script type="text/javascript">
    //选择日期
    $('.datetimepicker').datepicker({
        language:'zh-CN',
        format:'yyyy-mm-dd',
        zIndexOffset:906  //控制z-index
    });
</script>