<link rel="stylesheet" href="<?php echo base_url();?>public/js/vendor/bootstrap-datepicker/css/bootstrap-datepicker.standalone.min.css">
<link rel="stylesheet" href="<?php echo base_url();?>public/plugins/datatables/jquery.dataTables.min.css">
<link rel="stylesheet" href="<?php echo base_url();?>public/plugins/datatables/extensions/Responsive/css/dataTables.responsive.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="#activitysta/speedTable" id="totalForm">
                                        <span class="gap"></span>
                                        <div class="form-group">
                                            <label>活动ID</label>
                                            <input type="text" class="form-control" value="<?php if($aid) echo $aid;?>" placeholder="活动ID" name="aid" />
                                        </div>
                                        <span class="gap"></span>
                                        <input type="hidden" name="actType" value="<?php if($type) echo $type ?? '';?>">
                                        <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>
                    <section>
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm-12">
                                    <a href="#activitysta/speedChart/<?php echo $aid ?? 0;?>/<?php echo $type; ?>" class="btn btn-primary">进度图表展示</a>
                                    <a href="#activitysta/speedTable/<?php echo $aid ?? 0;?>/<?php echo $type; ?>" class="btn btn-primary">进度数据来源</a>
                                    <?php
                                    if($config['type'] == "rank"){
                                        ?>
                                        <a href="#activitysta/rankChart/<?php echo $aid ?? 0;?>" class="btn btn-primary">排名图表展示</a>
                                        <a href="#activitysta/rankTable/<?php echo $aid ?? 0;?>" class="btn btn-primary">排名数据来源</a>
                                        <?php
                                    }
                                    ?>
                                </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><?php echo $config['type']?>数据来源</header>
                    <section>
                        <div class="container-fluid">
                            <?php if(empty($config)){
                                echo '没有数据';
                            }else if($type && $config['type'] != $type){
                                echo '不是'.$type.'活动';
                            }else{ ?>
                            <?php foreach($retStage['config'] as $rid => $actConfig){ ?>
                            <div class="row">
                                <div class="col-sm-12">
                                    <div class="table-responsive">
                                        <table class="table table-striped table-bordered table-hover" cellspacing="0" width="100%">
                                            <thead>
                                            <tr>
                                                <th>区间</th>
                                                <th colspan="11"><?php echo $actConfig['star']."~".$actConfig['end'] ?></th>
                                            </tr>
                                            <tr>
                                                <th>收集层数</th>
                                                <th>结束活动停留人数</th>
                                                <th>到达过当前层的人数</th>
                                                <th>当前层通过率</th>
                                                <th>处于当前层付费的人数</th>
                                                <th>当前层付费率</th>
                                                <th>ARPPU</th>
                                                <th>ARPU</th>
                                                <th>当前层付费</th>
                                                <th>付费前平均当前体力</th>
                                                <th>付费时平均进度百分比</th>
                                                <th>通过当前层平均消耗了多少体力</th>
                                            </tr>
                                            </thead>
                                            <tbody>
                                            <?php foreach($actConfig['list'] as $vo){ ?>
                                            <tr>
                                                <th><?php echo $vo['stage']; ?></th>
                                                <td><?php echo $actStageLog[$rid][$vo['stage']] ?? 0; ?></td>
                                                <td><?php echo $stageSum[$rid][$vo['stage']] ?? 0; ?></td>
                                                <td><?php echo number_format($passRate[$rid][$vo['stage']],1,'.',''); ?>%</td>
                                                <td><?php echo $payNum[$rid][$vo['stage']]; ?></td>
                                                <td><?php echo empty($stageSum[$rid][$vo['stage']]) ? 0 : number_format($payNum[$rid][$vo['stage']] / $stageSum[$rid][$vo['stage']] * 100,1,".",""); ?>%</td>
                                                <td><?php echo empty($payNum[$rid][$vo['stage']]) ? 0 : number_format($payTotal[$rid][$vo['stage']] / $payNum[$rid][$vo['stage']],1,".",""); ?></td>
                                                <td><?php echo empty($stageSum[$rid][$vo['stage']]) ? 0 : number_format($payTotal[$rid][$vo['stage']] / $stageSum[$rid][$vo['stage']],3,".",""); ?></td>
                                                <td><?php echo number_format($payTotal[$rid][$vo['stage']],1,'.',''); ?></td>
                                                <td><?php echo number_format($paySpins[$rid][$vo['stage']],1,'.',''); ?></td>
                                                <td><?php echo number_format($paySpeed[$rid][$vo['stage']],1,'.',''); ?>%</td>
                                                <td><?php echo number_format($lowSpins[$rid][$vo['stage']],1,'.',''); ?></td>
                                            </tr>
                                            <?php } ?>
                                            </tbody>
                                        </table>
                                    </div>
                                </div>
                            </div>
                            <?php } } ?>
                        </div>
                    </section>
                </aside>
            </div>
        </div>


    </div>

</div>
<script type="text/javascript" src="<?php echo base_url();?>public/js/highcharts/highcharts.js"></script>
<script src="<?php echo base_url();?>public/plugins/datatables/jquery.dataTables.min.js"></script>
<script src="<?php echo base_url();?>public/plugins/datatables/extensions/Responsive/js/dataTables.responsive.min.js"></script>
<script src="<?php echo base_url();?>public/plugins/validate/jquery.validate-1.15.0.min.js"></script>
<script>
    //选择日期
    $('.datetimepicker').datepicker({
        language:'zh-CN',
        format:'yyyy-mm-dd',
        zIndexOffset:906  //控制z-index
    });

</script>
