<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">
                                    <form class="form-inline" role="form" method="POST" action="#statistics/activityProgresPaySta" name="stanpform">
		                                <input type="hidden" value="1" name="payuserpost"/>
		                                <span class="gap"></span>
		                                <div class="form-group">
		                                    <label>统计时间</label>
		                                    <input type="text" class="form-control datetimepicker" value="<?php if($date) echo $date;?>" placeholder="统计时间" name="date" />
		                                </div>
		                                
		                                <button type="submit" class="btn btn-primary">查询</button>
		                            </form>
                                </div>
                            </div>
                        </div>
                    </section>
                </aside>
            </div>
        </div>

        	<?php
                foreach($aids as $aid => $aid2) {
                    ?>
        <div class="row">
            <div class="col-sm-12">
            <aside>
                <header><i class="fa fa-fw fa-file"></i>活动<?php echo $aid; ?></header>
                    <?php
                    $aidTemp = empty($aid) ? '' : "_".$aid;
                    foreach ($maxStage[$aid] as $rid => $num) {
                        ?>
                        <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="2" style="text-align: center;vertical-align: middle;width:200px;">
                                            日期(配置<?php echo $rid; ?>)
                                        </th>
                                        <th colspan="<?php echo $num + 1; ?>"
                                            style="text-align: center;vertical-align: middle;">进度
                                        </th>
                                        <th rowspan="2" style="text-align: center;vertical-align: middle;width:200px;">
                                            合计
                                        </th>
                                    </tr>
                                    <tr>
                                        <?php
                                        for ($i = 0; $i <= $num; $i++) {
                                            ?>
                                            <th style="text-align: center;vertical-align: middle;"><?php echo $i; ?></th>
                                        <?php } ?>
                                    </tr>
                                    </thead>
                                    <tbody id="reportBody">
                                    <tr>
                                        <td style="text-align: center;vertical-align: middle;"><?php echo $date; ?></td>
                                        <?php
                                        $rid = empty($rid) ? '' : $rid;
                                        for ($i = 0; $i <= $num; $i++) {
                                            echo '<td style="text-align: center;vertical-align: middle;">' . (empty($data['data' . $rid.$aidTemp][$i]) ? 0 : $data['data' . $rid.$aidTemp][$i]) . '</td>';
                                        }
                                        ?>
                                        <td style="text-align: center;vertical-align: middle;"><?php echo array_sum($data['data' . $rid.$aidTemp]); ?></td>
                                    </tr>
                                    </tbody>
                                </table>
                            </div>
                        </div>
                        <?php } ?>
            </aside>
            </div>
        </div>
                <?php } ?>

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


</script>
<script type="text/javascript">
    //选择日期
    $('.datetimepicker').datepicker({
        language:'zh-CN',
        format:'yyyy-mm-dd',
        zIndexOffset:906  //控制z-index
    });
</script>