<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>刀客建站系统   管理中心 - 流量分析 </title>
<%{include file="header.html"}%>
<script language="JavaScript" src="js/FusionCharts.js"></script>
<script>
function escape_c(str)
{
	str	=	str.replace(/&quot;/g,escape('&quot;'));
	str	=	str.replace(/&#039;/g,escape("&#039;"));
	str	=	str.replace(/>/g,escape('>'));
	str	=	str.replace(/</g,escape("<"));
	str	=	str.replace(/"/g,escape('"'));
	str	=	str.replace(/'/g,escape("'"));
	str	=	str.replace(/&amp;/g,escape("&amp;"));
	str	=	str.replace(/&lt;/g,escape("&lt;"));
	str	=	str.replace(/&gt;/g,escape("&gt;"));
	str	=	str.replace(/\&/g,escape("&"));
	return str;
}

</script>

</head>
<body>
<h1>


<span class="action-span1"><a href="index.php?act=index.default_page">刀客建站系统   管理中心</a>  - 流量分析 </span>
<span style='float:right;margin-right:10px;'><img src='images/top_help.gif'><a href="http://sitepub.cn/help"> 帮助 </a></span>
<span style='float:right;margin-right:10px;'><img src='images/top_forum.gif'><a href="http://bbs.sitepub.cn"> 论坛 </a></span>
<div style="clear:both"></div>
</h1>
<div class="form-div" style="overflow:hidden;height:1%;">
  <form action="index.php" method="get"  id='form_id' style="float: left">
	 <input type='hidden' name='act' value='site.stat'>
 	 开始日期&nbsp;&nbsp;
    <input name="start_date"  id='start_date_id' value="<%{$smarty.get.start_date}%>" style="width:80px;"  />
		
    结束日期&nbsp;&nbsp;
    <input name="end_date"  id='end_date_id' value="<%{$smarty.get.end_date}%>" style="width:80px;" />
    <input type="submit"  value=" 查询 " class="button" />
		&nbsp;&nbsp;<a href="index.php?act=help.get&h=site_stat&width=450"   class="jTip"  name="我希望获得更多帮助"><img src='images/help.png'></a>
	<input type='hidden' name='searchengine' id='searchengine_id' value='<%{$smarty.get.searchengine}%>' >
	<input type='hidden' name='tab_box' id='tab_box_id' >
	</form>
    <span class="action-span"><a href="index.php?act=site.stat&report_file=1&start_date=<%{$smarty.get.start_date}%>&end_date=<%{$smarty.get.end_date}%>">流量分析报表
下载</a></span>
</div>
<div class="tab-div">

    <!-- tab bar -->
    <div id="tabbar-div">
      <p>
        <span  id="general-tab"  <%{if $smarty.get.tab_box!=''}%>class='tab-back'<%{else}%>class="tab-front"<%{/if}%> > 综合访问量</span><span
        class="tab-back" id="area-tab">地区分布</span><span
        class="tab-back" id="from-tab">来源网站</span><span
        <%{if $smarty.get.tab_box=='keyword_report_box'}%>class='tab-front'<%{else}%>class="tab-back"<%{/if}%>  id="keyword-tab"> 关键词来源</span>
      </p>
    </div>

    <!-- tab body -->

    <div id="tabbody-div">
        <table width="90%" id="general-table" <%{if $smarty.get.tab_box!=''}%>style='display:none;'<%{/if}%> >
          <tr><td align="center" id='day_report_box'>
          </td>
        		<script>   
					var day_xml	=	'<graph chartRightMargin="60" yAxisName="访问数量"   xAxisName="时间" rotateYAxisName="0">';
					<%{foreach from=$out.day_report item=val key=k}%>
							day_xml	+=	'<set name="<%{$val.time|escape:html}%>" value="<%{$val.count|escape:html}%>" color="<%{$val.chart_color|escape:html}%>"/>';	
					<%{/foreach}%>
					day_xml	+=	'</graph>';
					var chart = new FusionCharts("images/charts/line.swf", "ChartId", "700", "350", "0", "0");
					chart.setDataXML(escape_c(day_xml));
					chart.render("day_report_box");
				</script>	
			 </tr>
        </table>

        <table width="90%" id="area-table" style="display:none">
          <tr><td align="center" id='area_report_box'>
          </td>
			 <script>
				var country_area_xml	=	'<chart palette="4" decimals="0" enableSmartLabels="1" enableRotation="0" bgColor="99CCFF,FFFFFF" bgAlpha="40,100" bgRatio="0,100" bgAngle="360" showBorder="1" startingAngle="70">';
				<%{foreach item=v key=k from=$out.area_report}%>
					country_area_xml	+=	'<set label="<%{$v.area|escape:html}%>" value="<%{$v.count}%>" />';
				<%{/foreach}%>	
				country_area_xml	+=	'</chart>';
				var chart = new FusionCharts("images/charts/pie3d.swf", "ChartId", "600", "350", "0", "0");
				chart.setDataXML(escape_c(country_area_xml));			 
				chart.render("area_report_box");
			 </script>
			 
			 </tr>
        </table>

        <table width="90%" id="from-table" style="display:none">
          <tr><td align="center" id='domin_report_box'>
          </td>
				<script>
				var domin_xml	=	'<chart palette="4" decimals="0" enableSmartLabels="1" enableRotation="0" bgColor="99CCFF,FFFFFF" bgAlpha="40,100" bgRatio="0,100" bgAngle="360" showBorder="1" startingAngle="70">';
				<%{foreach item=v key=k from=$out.domin_report}%>
					domin_xml	+=	'<set label="<%{$v.referer_domain|escape:html}%>" value="<%{$v.count}%>" />';
				<%{/foreach}%>	
				domin_xml	+=	'</chart>';
				var chart = new FusionCharts("images/charts/pie3d.swf", "ChartId", "600", "350", "0", "0");
				chart.setDataXML(escape_c(domin_xml));			 
				chart.render("domin_report_box");
			 </script> 
			 
			 
			 </tr>
        </table>
	
	  
        <table width="90%" id="keyword-table" <%{if $smarty.get.tab_box=='keyword_report_box'}%>style='display:table;'<%{else}%> style="display:none" <%{/if}%>>
		  <tr><td align='center'>
				选择来源&nbsp;:&nbsp;
				<input type='radio' name='searchengine' value=''   <%{if $smarty.get.searchengine==''}%>checked=true<%{/if}%> onclick='$("#searchengine_id").val(this.value);$("#tab_box_id").val("keyword_report_box");$("#form_id")[0].submit();'  >全部&nbsp;
				<%{foreach from=$out.searchengine_type item=v key=k}%>
				<input type='radio' value='<%{$v}%>' <%{if $smarty.get.searchengine==$v}%>checked=true<%{/if}%>  name='searchengine' onclick='$("#searchengine_id").val(this.value);$("#tab_box_id").val("keyword_report_box");$("#form_id")[0].submit();' ><%{$v}%>&nbsp;
				<%{/foreach}%>
			</td></tr>
		  	<tr><td align="center" id='keyword_report_box'>
          </td>
				<script>
				var keyword_xml	=	'<graph><categories>';
				<%{foreach item=v key=k from=$out.keyword_arr}%>
					keyword_xml	+=	'<category label="<%{$v|escape:html}%>" />';
				<%{/foreach}%>	
				keyword_xml	+=	'</categories>';
				<%{foreach from=$out.keyword_report key=k item=v}%>
					keyword_xml	+='<dataset seriesName="<%{$k}%>" showValues="0">';	
					<%{foreach from=$v key=v_k item=v_v}%>
						keyword_xml	+='<set value="<%{$v_v.count}%>"/>';
					<%{/foreach}%>
					keyword_xml	+=	'</dataset>';
				<%{/foreach}%>
				keyword_xml		+='</graph>';
				var chart = new FusionCharts("images/charts/StackedColumn3D.swf", "ChartId", "800", "350", "0", "0");
				chart.setDataXML(escape_c(keyword_xml));			 
				chart.render("keyword_report_box");
			 </script> 
			 </tr>
        </table>	
	</div>
</div>
<script>
$(document).ready(function(){
	change_table(['area-tab','general-tab','from-tab','keyword-tab']);	
});
$(function(){
 $("#start_date_id").datepicker({ dateFormat: 'yy-mm-dd',dayNamesMin: ['一', '二', '三', '四', '五', '六', '日'] ,monthNames: ['一月','二月','三月','四月','五月','六月','    七月','八月','九月','十月','十一月','十二月']});
 $("#end_date_id").datepicker({ dateFormat: 'yy-mm-dd',dayNamesMin: ['一', '二', '三', '四', '五', '六', '日'] ,monthNames: ['一月','二月','三月','四月','五月','六月','七    月','八月','九月','十月','十一月','十二月']});
});

</script>


</body>
</html>

