<?php require APPPATH_MVC.'views/header.php'; ?>
<div class="w960 clearfix mt10 pepcenterBox">
<?php require APPPATH_MVC.'views/left.php'; ?>

<!--会员左侧 End-->
<div class="user-main user-main02">
  
            <?php if($show_type == 'operate_log'): ?>
                   <form id="search_form" name="search_form" accept-charset="gbk" method="post" action="/statistic/operate_log"> 
					<div class="hd-bar pos-r">
						 <h2>操作日志</h2>
					</div>
					<div class="user-main user-main03">
						<div class="handle">
              <label class="data-label left" style="margin-left:20px">选择时间：
                  <input readonly type="text" name='count_date' value="<?=$count_date?>" onFocus="WdatePicker({dateFmt:'yyyy-M-d',minDate:'%y-%M-{%d-30}',maxDate:'%y-%M-{%d}'})" class="data-input"/>
              </label>
              <div class="ctr-label left">
              	<span class="left">操作类型：</span>
                <div id="operate-select" class="selectSimulate left">
                <input type="hidden" name="operate_type" class="selectSimulate-input" value="<?=$operate_type?>">
                    <span  class="selectSimulate-value"><?php if( $operate_type >= 0 ){ echo $operate_arr[$operate_type];}else{ echo '新增';}?></span>
                    <ul class="selectSimulate-list" style="display: none;">
                        <?php foreach( $operate_arr as $key=>$type ):?>
                            <?php if( $key != 10 ): ?>
                                <li rel="<?=$key?>"><?=$type?></li>
                            <? endif; ?>
                        <?php endforeach;?>
                    </ul>
                </div>
              </div>
              <a href="###" onclick = "sub_form()" class="btn1 left search-btn">查询</a>
             <?=form_hidden('page', $page);?>
        </div>
       			<div class="mod-list statistical">
            <table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-style-a">
              <tr>
                <th width="33%">时间</th>
                <th width="33%">类型</th>
                <th width="34%">房源编号</th>
              </tr>
              <?php if( count($operate_data) > 0 ): ?>
              <?php foreach ($operate_data as $key=>$vlaue): ?>
                <tr  <?php if ( $key % 2 == 1) { echo 'class="odd"';}?>>
                <td style="text-align: center"><?=$vlaue['datetime']?></td>
                <td style="text-align: center"><?=$operate_arr[$vlaue['type']]?></td>
                <td style="text-align: center"><?=$vlaue['rowid']?> <?=$house_type[$vlaue['tbl']]?></td>
                </tr>
              <? endforeach;?>
            	</table>
                <div class="solidDiv">&nbsp;</div>
                <?php else: ?>
                </table>
                <div class="mod-list ask">
                    <div class="mod-list h-source">
                    <div class="no-result">没有符合您搜索条件的操作日志记录</div>
                    </div>
                </div>
                <? endif; ?>
            </div>
	    </div>
        <?php elseif($show_type == 'login_log'): ?>
                   <form id="search_form" name="search_form" accept-charset="gbk" method="post" action="/statistic/login_log"> 
					<div class="hd-bar pos-r">
						 <h2>登录历史</h2>
					</div>
					<div class="user-main user-main03">
						<div class="handle">
						<label class="data-label left" style="margin-left:20px">
								选择时间：<input readonly type="text" name='count_date' value="<?=$count_date?>" onFocus="WdatePicker({dateFmt:'yyyy-M-d',minDate:'%y-%M-{%d-30}',maxDate:'%y-%M-{%d-1}'})" class="data-input"/>
						</label>
									<a href="###" onclick = "sub_form()" class="btn1 left search-btn">查询</a>
									<?=form_hidden('page', $page);?>
						</div>
						<div class="mod-list statistical">
								<table width="100%" border="0" cellspacing="0" cellpadding="0" class="table-style-a">
									<tr>
										<th width="50%">时间</th>
										<th width="50%">IP</th>
									</tr>
								<?php if( count($operate_data) > 0 ): ?>
										<?php foreach ($operate_data as $key=>$vlaue): ?>
										<tr  <?php if ( $key % 2 == 1) { echo 'class="odd"';}?>>
										<td><?=$vlaue['datetime']?></td>
										<td><?=$vlaue['ip']?></td>
										</tr>
										<? endforeach;?>
								</table>
								<div class="solidDiv">&nbsp;</div>
								 <?php else: ?>
								 </table>
								<div class="mod-list ask">
												<div class="mod-list h-source">
													 <div class="no-result">没有符合您检索条件的登录历史记录</div>
											 </div>
								</div>
								<? endif; ?>

						</div>
					</div>
        <?php elseif($show_type == 'house_click'): ?>
 <form id="search_form" name="search_form" accept-charset="gbk" method="post" action="/statistic/house_click">
        <script type="text/javascript">
        $(function () {
            var total_click = <?=$total_click?>;
            if ( total_click > 0 ) {
                $('#container').highcharts({
                    chart: {
                        type: 'line',
                        borderWidth: 0,
                        spacingTop: 30,
                        marginRight: 10,
                        marginBottom: 25
                    },
                  title: {
                        text: '',
                        x: -10  //center
                    },
                    subtitle: {
                        text: '',
                        x: -10
                    },
                    xAxis: {
						gridLineWidth: 1, //默认是0，即在图上没有纵轴间隔线
						lineWidth: 1, //自定义y轴宽度
						showFirstLabel: false,
						gridLineDashStyle: 'Dot',
						lineColor: '#808080',
                        categories: <?=$x_axis_json?>
                    },
                    yAxis: {
                        title: {
                            text: '点击次数'
                        },
						endOnTick: false,
						maxPadding: 2,
						minPadding: 0,
						tickWidth: 1, //刻度的宽度  
						lineWidth: 1, //自定义y轴宽度  
						gridLineWidth: 1, //默认是0，即在图上没有纵轴间隔线  
						maxPadding: 0.5,
						gridLineDashStyle: 'Dot',
						lineColor: '#808080',
                        plotLines: [{
                           value: 0,
                           width: 1,
                           color: '#808080'
                        }]
                    },
                   tooltip: {
                    formatter: function() {
                        return '<b>'+ this.series.name +'</b><br/>'+
                            this.x +'时'+' :'+ this.y + '次点击';
                    }
                },
                legend: {
                        enabled : false,//控制显示
                        layout: 'horizontal',
                        align: 'right',
                        verticalAlign: 'top',
                        x: -10,
                        y: -10,
                        shadow: true,
                        borderWidth: 1
                    },
                    series: [{
                        name	: '<?=$house_type_name?>',
                        color	: '#FEA010',
						marker: { symbol: 'square' },
                        data	: <?=$click_num_json?>
                    }]
                });
               } else {
                    $('#container').html('<div class="mod-list ask"><div class="mod-list h-source"><div class="no-result" style="text-align:left;">没有符合您检索条件的点击量数据！</div></div></div>');
                }
            });
        </script>
        <div class="hd-bar pos-r">
            <h2>点击统计</h2>
        </div>
        <div class="user-main user-main03">
        <div class="handle">
        <label class="data-label left" style="margin-left:20px;">
            选择时间：<input readonly type="text" name='count_date' value="<?=$count_date?>" onFocus="WdatePicker({dateFmt:'yyyy-M-d',minDate:'%y-%M-{%d-30}',maxDate:'%y-%M-{%d-1}'})" class="data-input"/>
        </label>
        <a href="####" onclick = "sub_form()" class="btn1 left search-btn">查询</a>
        <input type = 'hidden' name='house_type' id='house_type'value="<?=$house_type?>">
        </div>
        <div class="chart-tab">
            <div class="hd">
                <span>点击总量：<i><?=$total_click?></i></span>
                <span>出售点击量：<i><?=$sell_total_click?></i></span>
                <span>出租点击量：<i><?=$rent_total_click?></i></span>
                <span>统计时间：<i><?=$count_date?></i></span>
                <div class="cur">
                    <a href="####" onclick="chagne_type('all')" <?php if($house_type == 'all'){ ?>class="on" <?php }?> >全部</a>
                    <a href="####" onclick="chagne_type('sell')" <?php if($house_type == 'sell'){ ?>class="on" <?php }?> >出售</a>
                    <a href="####" onclick="chagne_type('rent')" <?php if($house_type == 'rent'){ ?>class="on" <?php }?> >出租</a>
                </div>
            </div>
            <div class="bd">
                <div class="panel" id ="container" style="display:block; width:688px;height:285px;"></div>
            </div>
        </div>

	</div>
        <? endif; ?>

        <?php if( !empty($pagination) ): ?>
        <!--分页-->
        <div class="cut-page clear" style="padding-top:10px;"><?=$pagination?></div>
        <!--分页-->
        <? endif; ?>

        <?=form_close()?>
    </div>
    <!--会员右侧 End-->

</div>
<script>
function sub_form()
{
    $("input[name='page']").val('');
    $('#search_form').submit();
}

function chagne_type(type)
{
    $('#house_type').val(type);
    $('#search_form').submit();
}
</script>

<?php
if($isa_website!=''){
?>
<script type="text/javascript">
	var isa_website = "<?=$isa_website?>";
	var isa_city = "<?=$isa_city?>";
	var isa_addones = "<?=$isa_addones?>";

	var _analyze365 = (('https:' == document.location.protocol) ? ' https://': ' http://');
	document.write(unescape('%3Cscript src="'+ _analyze365 + '<?=$isa_url?>" type="text/javascript"%3E%3C/script%3E'));
</script>
<?php
}
?>
<script type='text/javascript'>
	var website="2";
    var ga_city = "<?=$isa_city?>";
    var ga_channel = 'center';
    var ga_page= "/个人中心/统计分析";
</script>

<script language="javascript" src="http://stat.house365.com/365count.js"></script>

<!--会员中心主体 End-->
<?php require APPPATH_MVC.'views/footer.php'; ?>




