<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>
                    <header><i class="fa fa-fw fa-file"></i>查询</header>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm-12">

                                    <button type="button" class="btn btn-primary" onclick="javascript:location.href='/#statistics/newHandLossSta/1'">一天</button>
									
									<button type="button" class="btn btn-primary" onclick="javascript:location.href='/#statistics/newHandLossSta/7'">七天</button>
									
									<button type="button" class="btn btn-primary" onclick="javascript:location.href='/#statistics/newHandLossSta/15'">十五天</button>
									
									<button type="button" class="btn btn-primary" onclick="javascript:location.href='/#statistics/newHandLossSta/30'">三十天</button>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>
        
        <?php
        function formatChipRound($value, $round=2)
        {
            $value = ceil($value);

            if(1 <= abs($valueB = round($value / 1000000000, $round))) {
                return  $valueB . 'B';
            }else if(1 <= abs($valueM=round($value / 1000000, $round))) {
                return $valueM . 'M';
            }else if(1 <= abs($valueK = round($value / 1000), $round)) {
                return $valueK . 'K';
            }else {
                return $value;
            }
        }
        ?>
                                            
		
        <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="table-responsive">
                                    <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 colspan="19" style="text-align: center;vertical-align: middle;">步骤</th>
                                        </tr>
                                        <tr>
                                        	<?php
                                        		for($i = 0; $i < 19; $i++){
                                        			echo '<th>'.$i.'</th>';
                                        		}
                                        	?>
                                        </tr>
                                        </thead>
                                        <tbody id="reportBody">
                                        
                                                <tr>
                                                	<td style="white-space: nowrap" rowspan="1">总量</td>
                                                	<?php
			                           
			                                            foreach($data as $k => $val){
			                                                ?>
															<td style="white-space: nowrap" rowspan="1"><?php echo $val['total'];?></td>
													
															<?php
			                                            }
			                                         
			                                        ?>
                                                </tr>
                                                
                                                <tr>
                                                	<td style="white-space: nowrap" rowspan="1">在玩玩家数量</td>
                                                	<?php
			 
			                                            foreach($data as $k => $val){
			                                                ?>
															<td style="white-space: nowrap" rowspan="1"><?php echo $val['onlineNumber'];?></td>
													
															<?php
			                                            }
			                                         
			                                        ?>
                                                </tr>
                                                
                                                <tr>
                                                	<td style="white-space: nowrap" rowspan="1">流失玩家数量</td>
													<?php
			                                            foreach($data as $k => $val){
			                                                ?>
															<td style="white-space: nowrap" rowspan="1"><?php echo $val['lossNumber'];?></td>
													
															<?php
			                                            }
			                                        ?>
                                                </tr>
                                                
                                                <tr>
                                                	<td style="white-space: nowrap" rowspan="1">流失率</td>
													<?php
			                                            foreach($data as $k => $val){
			                                                ?>
															<td style="white-space: nowrap" rowspan="1"><?php echo number_format($val['lossNumber'] / $val['total'] * 100,2);?>%</td>
													
															<?php
			                                            }
			                                        ?>
                                                </tr>
                                        </tbody>
                                    </table>
                                </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>