<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>

<div class="content_wrapper">
    <div class="container-fluid">
        <div class="row">
            <div class="col-sm-12">
                <aside>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm-12">
                                    <form class="form-inline" role="form" method="POST" action="#statistics/treasureSlotSta" name="stanpform" id="formSlot">
                                        <span class="gap"></span>
                                        <div class="form-group">
                                            <label>开始时间</label>
                                            <input type="text" class="form-control datetimepicker" value="<?php if($stime) echo $stime;?>" placeholder="开始时间" name="stime" />
                                        </div>
                                        <span class="gap"></span>
                                        <div class="form-group">
                                            <label>结束时间</label>
                                            <input type="text" class="form-control datetimepicker" value="<?php if($etime) echo $etime;?>" placeholder="结束时间" name="etime" />
                                        </div>
                                        <button type="submit" class="btn btn-primary">查询</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">
                                            <style>
                                                #slotBody td{
                                                        text-align: center;
                                                        vertical-align: middle;
                                                }
                                            </style>
                                            <table id="reportTable" class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                                <thead>
                                                <tr>
                                                    <!--                                    <th rowspan="2" style="text-align: center;vertical-align: middle;">序号</th>-->
                                                    <th rowspan="2" style="text-align: center;vertical-align: middle;">关卡</th>
                                                    <th colspan="18" style="text-align: center;vertical-align: middle;">类型</th>
                                                    <th rowspan="2" style="text-align: center;vertical-align: middle;">关卡汇总</th>
                                                </tr>
                                                <tr>
                                                    <th>转盘</th>
                                                    <th>小王子*3</th>
                                                    <th>狐狸*3</th>
                                                    <th>小王子*2</th>
                                                    <th>王冠*3</th>
                                                    <th>小王子*1</th>
                                                    <th>黑桃*3</th>
                                                    <th>红桃*3</th>
                                                    <th>方块*3</th>
                                                    <th>黑桃+红桃+方块</th>
                                                    <th>没有奖励</th>
                                                    <th>转盘1</th>
                                                    <th>转盘2</th>
                                                    <th>转盘3</th>
                                                    <th>转盘4</th>
                                                    <th>转盘5</th>
                                                    <th>转盘6</th>
                                                    <th>转盘7</th>
                                                </tr>
                                                </thead>
                                                <tbody id="slotBody">
                                                <?php
                                                if(is_array($data)){
                                                    foreach ($data as $levelId => $val) {
                                                    
                                                        ?>
                                                        
                                                        <?php if($val['count'] != 0){ ?>
                                                        
                                                        <tr>
                                                            <td style="white-space: nowrap" rowspan="2"><?php echo $levelId;?></td>
                                                            <td style="white-space: nowrap"><?php echo $val['slot'];?></td>
                                                            <td style="white-space: nowrap"><?php echo $val['king3'];?></td>
                                                            <td style="white-space: nowrap"><?php echo $val['fox'];?></td>
                                                            <td style="white-space: nowrap"><?php echo $val['king2'];?></td>
                                                            <td style="white-space: nowrap"><?php echo $val['crown3'];?></td>
                                                            <td style="white-space: nowrap"><?php echo $val['king1'];?></td>
                                                            <td style="white-space: nowrap"><?php echo $val['spade3'];?></td>
                                                            <td style="white-space: nowrap"><?php echo $val['heart3'];?></td>
                                                            <td style="white-space: nowrap"><?php echo $val['block3'];?></td>
                                                            <td style="white-space: nowrap"><?php echo $val['spade_heart_block'];?></td>
                                                            <td style="white-space: nowrap"><?php echo $val['none'];?></td>
                                                            <td style="white-space: nowrap"><?php echo $val['slot1'];?></td>
                                                            <td style="white-space: nowrap"><?php echo $val['slot2'];?></td>
                                                            <td style="white-space: nowrap"><?php echo $val['slot3'];?></td>
                                                            <td style="white-space: nowrap"><?php echo $val['slot4'];?></td>
                                                            <td style="white-space: nowrap"><?php echo $val['slot5'];?></td>
                                                            <td style="white-space: nowrap"><?php echo $val['slot6'];?></td>
                                                            <td style="white-space: nowrap"><?php echo $val['slot7'];?></td>
                                                            <td style="white-space: nowrap" rowspan="2"><?php echo $val['count'];?></td>
                                                        </tr>
                                                        <tr>
                                                            <td style="white-space: nowrap"><?php echo round($val['slot']/$val['count']*100,2)."%";?></td>
                                                            <td style="white-space: nowrap"><?php echo round($val['king3']/$val['count']*100,2)."%";?></td>
                                                            <td style="white-space: nowrap"><?php echo round($val['fox']/$val['count']*100,2)."%";?></td>
                                                            <td style="white-space: nowrap"><?php echo round($val['king2']/$val['count']*100,2)."%";?></td>
                                                            <td style="white-space: nowrap"><?php echo round($val['crown3']/$val['count']*100,2)."%";?></td>
                                                            <td style="white-space: nowrap"><?php echo round($val['king1']/$val['count']*100,2)."%";?></td>
                                                            <td style="white-space: nowrap"><?php echo round($val['spade3']/$val['count']*100,2)."%";?></td>
                                                            <td style="white-space: nowrap"><?php echo round($val['heart3']/$val['count']*100,2)."%";?></td>
                                                            <td style="white-space: nowrap"><?php echo round($val['block3']/$val['count']*100,2)."%";?></td>
                                                            <td style="white-space: nowrap"><?php echo round($val['spade_heart_block']/$val['count']*100,2)."%";?></td>
                                                            <td style="white-space: nowrap"><?php echo round($val['none']/$val['count']*100,2)."%";?></td>
                                                            <td style="white-space: nowrap"><?php echo round($val['slot1']/$val['count']*100,2)."%";?></td>
                                                            <td style="white-space: nowrap"><?php echo round($val['slot2']/$val['count']*100,2)."%";?></td>
                                                            <td style="white-space: nowrap"><?php echo round($val['slot3']/$val['count']*100,2)."%";?></td>
                                                            <td style="white-space: nowrap"><?php echo round($val['slot4']/$val['count']*100,2)."%";?></td>
                                                            <td style="white-space: nowrap"><?php echo round($val['slot5']/$val['count']*100,2)."%";?></td>
                                                            <td style="white-space: nowrap"><?php echo round($val['slot6']/$val['count']*100,2)."%";?></td>
                                                            <td style="white-space: nowrap"><?php echo round($val['slot7']/$val['count']*100,2)."%";?></td>
                                                        </tr>
                                                        
                                                        <?php }else{ ?>
                                                            <tr>
                                                                <td style="white-space: nowrap"><?php echo $levelId;?></td>
                                                                <td colspan="18">0</td>
                                                                <td style="white-space: nowrap"><?php echo $val['count'];?></td>
                                                            </tr>
                                                        <?php } ?>
                                                    <?php } } else{?>
                                                    <tr>
                                                        <td colspan="10">暂无数据</td>
                                                    </tr>
                                                <?php } ?>
                                                </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">
    //选择日期
    $('.datetimepicker').datepicker({
        language:'zh-CN',
        format:'yyyy-mm-dd',
        zIndexOffset:906  //控制z-index
    });
    
</script>