<link rel="stylesheet" href="<?php echo base_url();?>public/js/vendor/bootstrap-datepicker/css/bootstrap-datepicker.standalone.min.css">
<div class="content_wrapper">
    <div id="msg-tip"></div>

    <style>
        .change {
            background: lightgoldenrodyellow;
        }
        .td-nowrap {
            white-space: nowrap;
        }
    </style>

    <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 class="col-sm-12">
                                    <form class="form-inline" role="form" method="post" action="#/statistics/userMoneyBlind" >
                                        <input type="hidden" value="1" name="user_blind_post"/>
                                        <span class="gap"></span>
                                        <div class="form-group">
                                            <label>开始时间</label>
                                            <input type="text" class="form-control datetimepicker" value="<?php echo $stime?>" placeholder="开始时间" name="user_blind_stime" />
                                        </div
                                        <span class="gap"></span>
                                        <span class="gap"></span>
                                        <div class="form-group">
                                            <label>结束时间</label>
                                            <input type="text" class="form-control datetimepicker" value="<?php echo $etime?>" placeholder="结束时间" name="user_blind_etime" />
                                        </div>

                                        <span class="gap"></span>
                                        <button type="submit" class="btn btn-primary" id="searchBtn">查询</button>
                                    </form>
                                </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">
                                        <table id="reportTable" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th rowspan="3" style="text-align: center;vertical-align: middle;">序号</th>
                                                <th rowspan="3" style="text-align: center;vertical-align: middle;">日期</th>
                                                <th rowspan="3" style="text-align: center;vertical-align: middle;">盲注级别</th>
                                                <th colspan="2" style="text-align: center">级别1</th>
                                                <th colspan="2" style="text-align: center">级别2</th>
                                                <th colspan="2" style="text-align: center">级别3</th>
                                                <th colspan="2" style="text-align: center">级别4</th>
                                                <th colspan="2" style="text-align: center">级别5</th>
                                                <th colspan="2" style="text-align: center">级别6</th>
                                                <th colspan="2" style="text-align: center">级别7</th>
                                                <th colspan="2" style="text-align: center">级别8</th>
                                                <th rowspan="3" style="text-align: center;vertical-align: middle;">合计</th>

                                            </tr>
                                            <tr>
                                                <th colspan="2" style="text-align: center">500/1000<br/>【10K-200K】</th>
                                                <th colspan="2" style="text-align: center">1000/2000<br/>【80K-400K】</th>
                                                <th colspan="2" style="text-align: center">2500/5000<br/>【200K-1M】</th>
                                                <th colspan="2" style="text-align: center">5000/10K<br/>【400K-2M】</th>
                                                <th colspan="2" style="text-align: center">10K/20K<br/>【800K-4M】</th>
                                                <th colspan="2" style="text-align: center">50K/100K<br/>【4M-20M】</th>
                                                <th colspan="2" style="text-align: center">100K/200K<br/>【8M-40M】</th>
                                                <th colspan="2" style="text-align: center">500K/1M<br/>【40M以上】</th>
                                            </tr>
                                            <tr>
                                                <th>手选</th>
                                                <th>快速开始</th>
                                                <th>手选</th>
                                                <th>快速开始</th>
                                                <th>手选</th>
                                                <th>快速开始</th>
                                                <th>手选</th>
                                                <th>快速开始</th>
                                                <th>手选</th>
                                                <th>快速开始</th>
                                                <th>手选</th>
                                                <th>快速开始</th>
                                                <th>手选</th>
                                                <th>快速开始</th>
                                                <th>手选</th>
                                                <th>快速开始</th>
                                            </tr>
                                            </thead>
                                            <tbody id="reportBody">

                                            <?php foreach ($list as $k => $val) {
                                                $selectBlindList = unserialize($val['selectBlindList']);
                                                $quickBlindList = unserialize($val['quickBlindList']);
                                                $totalNum = 0;
                                                for($i=0; $i < 8; $i++){
                                                    $totalNum += $quickBlindList[$i] ?? 0;
                                                }

                                                ?>
                                                <tr>
                                                    <td rowspan="2"><?php echo $page+$k+1;?></td>
                                                    <td rowspan="2"><?php echo date('Y-m-d',strtotime($val['date'])) ?? 0?></td>
                                                    <td>人数</td>
                                                    <td><?php echo number_format($selectBlindList[7] ?? 0);?></td>
                                                    <td><?php echo number_format($quickBlindList[7] ?? 0);?></td>
                                                    <td><?php echo number_format($selectBlindList[6] ?? 0);?></td>
                                                    <td><?php echo number_format($quickBlindList[6] ?? 0);?></td>
                                                    <td><?php echo number_format($selectBlindList[5] ?? 0);?></td>
                                                    <td><?php echo number_format($quickBlindList[5] ?? 0);?></td>
                                                    <td><?php echo number_format($selectBlindList[4] ?? 0);?></td>
                                                    <td><?php echo number_format($quickBlindList[4] ?? 0);?></td>
                                                    <td><?php echo number_format($selectBlindList[3] ?? 0);?></td>
                                                    <td><?php echo number_format($quickBlindList[3] ?? 0);?></td>
                                                    <td><?php echo number_format($selectBlindList[2] ?? 0);?></td>
                                                    <td><?php echo number_format($quickBlindList[2] ?? 0);?></td>
                                                    <td><?php echo number_format($selectBlindList[1] ?? 0);?></td>
                                                    <td><?php echo number_format($quickBlindList[1] ?? 0);?></td>
                                                    <td><?php echo number_format($selectBlindList[0] ?? 0);?></td>
                                                    <td><?php echo number_format($quickBlindList[0] ?? 0);?></td>
                                                    <td><?php echo number_format($totalNum ?? 0);?></td>
                                                </tr>


                                            <tr>
                                                <td>人数占比</td>
                                                <td><?php echo empty($totalNum) ? '0%' : round(($selectBlindList[7] ?? 0)*100/$totalNum, 2).'%';?></td>
                                                <td><?php echo empty($totalNum) ? '0%' : round(($quickBlindList[7] ?? 0)*100/$totalNum, 2).'%';?></td>
                                                <td><?php echo empty($totalNum) ? '0%' : round(($selectBlindList[6] ?? 0)*100/$totalNum, 2).'%';?></td>
                                                <td><?php echo empty($totalNum) ? '0%' : round(($quickBlindList[6] ?? 0)*100/$totalNum, 2).'%';?></td>
                                                <td><?php echo empty($totalNum) ? '0%' : round(($selectBlindList[5] ?? 0)*100/$totalNum, 2).'%';?></td>
                                                <td><?php echo empty($totalNum) ? '0%' : round(($quickBlindList[5] ?? 0)*100/$totalNum, 2).'%';?></td>
                                                <td><?php echo empty($totalNum) ? '0%' : round(($selectBlindList[4] ?? 0)*100/$totalNum, 2).'%';?></td>
                                                <td><?php echo empty($totalNum) ? '0%' : round(($quickBlindList[4] ?? 0)*100/$totalNum, 2).'%';?></td>
                                                <td><?php echo empty($totalNum) ? '0%' : round(($selectBlindList[3] ?? 0)*100/$totalNum, 2).'%';?></td>
                                                <td><?php echo empty($totalNum) ? '0%' : round(($quickBlindList[3] ?? 0)*100/$totalNum, 2).'%';?></td>
                                                <td><?php echo empty($totalNum) ? '0%' : round(($selectBlindList[2] ?? 0)*100/$totalNum, 2).'%';?></td>
                                                <td><?php echo empty($totalNum) ? '0%' : round(($quickBlindList[2] ?? 0)*100/$totalNum, 2).'%';?></td>
                                                <td><?php echo empty($totalNum) ? '0%' : round(($selectBlindList[1] ?? 0)*100/$totalNum, 2).'%';?></td>
                                                <td><?php echo empty($totalNum) ? '0%' : round(($quickBlindList[1] ?? 0)*100/$totalNum, 2).'%';?></td>
                                                <td><?php echo empty($totalNum) ? '0%' : round(($selectBlindList[0] ?? 0)*100/$totalNum, 2).'%';?></td>
                                                <td><?php echo empty($totalNum) ? '0%' : round(($quickBlindList[0] ?? 0)*100/$totalNum, 2).'%';?></td>
                                                <td><?php echo '100%';?></td>
                                            </tr>

                                            <?php }?>
                                            </tbody>

                                        </table>
                                    </div>

                                    <nav>
                                        <ul class="pagination">
                                            <li class="disabled"><a href="#">共<span class="pagetotal"><?php echo $total;?></span>条</a></li>
                                            <?php echo $pageurl;?>
                                        </ul>
                                    </nav>

                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
    </div>

</div>


<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>
<script src="<?php echo base_url();?>public/js/common.js?version=1"></script>
<script type="text/javascript">
    //选择日期
    $('.datetimepicker').datepicker({
        language:'zh-CN',
        format:'yyyy-mm-dd',
        zIndexOffset:906  //控制z-index
    });


</script>