<?php require APPPATH.'/views/'.TEMPLATE_NAME.'/page_css.php'; ?>
<div id="centre" class="layout">
    <div class="centreInner ">
        <div class="mainInner radius5 "> 
            <!--头部 tab 开始-->
            <div class="titleTabBox">
                <div class="titleTab"><?php echo $tab;?></div>
            </div>
            <!--头部 tab 结束-->
            <div class="statisticsReport">
               <?=form_open(uri_string(),array('method'=>'POST','name'=>'search_form','id'=>'search_form'))?>
                <div class="forms ">
                    <dl class="list">
                        <dd class="list_item clearfix">
                            <label class="label">选择时间：</label>
                            <div class="fields">
                                <div class="fgInput">
                                    <input readonly="" type="text" name="stime" style="cursor:pointer" class="Wdate input_text w126" value="<?php echo $stime;?>" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'%y-%M-{%d-30}',maxDate:'%y-%M-{%d-1}'})">
                                </div>
                                <span class="fg">一</span>
                                <div class="fgInput">
                                    <input readonly="" type="text" name="etime" style="cursor:pointer" class="Wdate input_text w126" value="<?php echo $etime; ?>" onfocus="WdatePicker({dateFmt:'yyyy-MM-dd',minDate:'%y-%M-{%d-30}',maxDate:'%y-%M-{%d-1}'})">
                                </div>
                                <p class="textFg textFg2">&nbsp; </p>
                                <div class="fgInput"> 
                                    <input type="submit" style="width:50px;float: left;" class="downReportBtn btnCon radius5" id="search_button" href="####" value="查询" /> 
                                </div>
                                <a href="####" onclick='download_history()' class="downReportBtn btnCon radius5">下载报表</a> </div>
                        </dd>
                    </dl>
                    <?php echo validation_errors(); ?>
                </div>
                <div class="belongBox statisticsReportTable radius5">
                    <style>
                        .w156{width:200px;}
                        .w97{width:140px;}
                        .w48{width:70px;} 
                    </style>
                    <table class="table">
                        <tbody>
                            <tr>
                                <th class="th w156 br inset">时间</th>
                                <th colspan="2" class="th w97 br inset"> <div class="thDiv inset">激活总量</div>
                        <table class="table">
                            <tbody>
                                <tr>
                                    <td class="thhTg br inset">出售</td>
                                    <td class="thhTg inset">出租</td>
                                </tr>
                            </tbody>
                        </table>
                        </th>
						<?php if($is_publish_360): ?>
						<th  class="th w97 br inset"> <div class="thDiv inset">激活全景总量</div>
							<table class="table">
								<tbody>
									<tr>
										<td class="thhTg br inset">出售</td>
									</tr>
								</tbody>
							</table>
						</th>
						<?php endif; ?>

                        <th colspan="2" class="th w97 br inset"> <div class="thDiv inset">激活多图总量</div>
                        <table class="table">
                            <tbody>
                                <tr>
                                    <td class="thhTg br inset">出售</td>
                                    <td class="thhTg inset">出租</td>
                                </tr>
                            </tbody>
                        </table>
                        </th>

                        <th colspan="2" class="th w97 br"> <div class="thDiv inset">新增房源总量</div>
                        <table class="table">
                            <tbody>
                                <tr>
                                    <td class="thhTg br inset">有效</td>
                                    <td class="thhTg inset">失效</td>
                                </tr>
                            </tbody>
                        </table>
                        </th>
                        <th colspan="2" class="th w97 br"> <div class="thDiv inset">刷新量</div>
                        <table class="table">
                            <tbody>
                                <tr>
                                    <td class="thhTg br inset">已用</td>
                                    <td class="thhTg inset">剩余</td>
                                </tr>
                            </tbody>
                        </table>
                        </th>
                        <?php if(GB_CITY=='nj' || GB_CITY=='wx'){?>
                        <th colspan="2" class="th w97 br"> <div class="thDiv inset">急推标签</div>
                        <table class="table">
                            <tbody>
                                <tr>
                                    <td class="thhTg br inset">已用</td>
                                    <td class="thhTg inset">剩余</td>
                                </tr>
                            </tbody>
                        </table>
                        </th>
                        <?php }?>

                        <th colspan="2" class="th w97 br"> <div class="thDiv inset">放心看</div>
                        <table class="table">
                            <tbody>
                                <tr>
                                    <td class="thhTg br inset">在用</td>
                                    <td class="thhTg inset">剩余</td>
                                </tr>
                            </tbody>
                        </table>
                        </th>
                        <th class="th w48 br inset">点击总量</th>
                        </tr>
                        <?php if($list) { foreach($list as $v) {?>
                        <tr>
                            <td class="td w156 br"><?=$v['stattime']?></td>
							
                            <td class="td w48 br"><?=$v['sell_house_num']?></td>
                            <td class="td w48 br"><?=$v['rent_house_num']?></td>
							<?php if($is_publish_360): ?>
							<td class="td w48 br" ><?=$v['panorama']?></td>
							<?php endif; ?>
                            <td class="td w48 br"><?=$v['sell_star_num']?></td>
                            <td class="td w48 br"><?=$v['rent_star_num']?></td>
                            <td class="td w48 br"><?=$v['house_add']?></td>
                            <td class="td w48 br"><?=$v['house_add_valid']?></td>
                            <td class="td w48 br"><?=$v['refresh']?></td>
                            <td class="td w48 br"><?=$v['remain_refresh']?></td>
                            <?php if(GB_CITY=='nj'){?>
                            <td class="td w48 br"><?=$v['is_tag_num']?></td>
                            <td class="td w48 br"><?=$v['remain_tag_num']?></td>
                            <?php }?>

                            <td class="td w48 br"><?=$v['real_house_num']?></td>
                            <td class="td w48 br"><?php  print_r($v['real_house_limit']-$v['real_house_num']);?></td>

                            <td class="td w48 br"><?=$v['click_num']?></td>
                        </tr>
                        <?php } } ?>
						<?php if(!$list) { ?>
							<tr>
							<td colspan = '14' class="td br">没有符合您搜索条件的记录</td>
							</tr>
						<?php } ?>
                        </tbody>
                    </table>
                </div>

                <!--翻页-->
				<?php if (!empty($pagination)) { ?>
				<div class="picPreviewPagBox">
				<div class="picPreviewPag">
				<?php echo $pagination; ?>
				</div>
				<input type='hidden' name='page' value='1'>
				</div>
				<?php } ?>
				<!--结束-->
				<?=form_close()?>
            </div>

            <!----> 
        </div>
    </div>
</div>
<script>
function download_history()
{	
	$('#search_form').attr("action","<?php echo GB_WO_URL;?>/statistics_analysis/history_download/");
	$('#search_form').submit();
	$('#search_form').attr("action","");
}
</script>