<!-- #include file="conn.asp"-->
<%
dim str
str = server.HTMLEncode(request("str"))
Call OutPut(str)

Sub OutPut(str)	
	dim outstr		
	dim style,scount
	dim AllVisitor,AllPageView
	dim TodayPageView,TodayVisitor
	dim YestodayPageView,YestodayVisitor
	
	if instr(str,"$AllVisitor") then
	AllVisitor=hx.execute("select Sum(Visitor) from CC_D")(0)
	str=replace(str,"$AllVisitor",AllVisitor)
	end if
	
	if instr(str,"$AllPageView") then
	AllPageView=hx.execute("select Sum(PageView) from CC_D")(0)
	str=replace(str,"$AllPageView",AllPageView)
	end if
	
	dim ors
	if instr(str,"$TodayPageView") or instr(str,"$TodayVisitor") then
		If IsSqlDataBase = 1 Then
		Dim Date1
		Date1=Date()
		set ors=hx.execute("select Visitor,PageView from CC_D where CDate='"&Date1&"'")
		else
		set ors=hx.execute("select Visitor,PageView from CC_D where CDate=date()")	
		end if
		TodayVisitor=ors(0)
		TodayPageView=ors(1)
		set ors=nothing
		str=replace(str,"$TodayPageView",TodayPageView)
		str=replace(str,"$TodayVisitor",TodayVisitor)
	end if
	
	if instr(str,"$YestodayPageView") or instr(str,"$YestodayVisitor") then
		If IsSqlDataBase = 1 Then
		Dim Date2
		Date2=DateAdd("d",-1,Date())
		set ors=hx.execute("select Visitor,PageView from CC_D where CDate='"&Date2&"'")
		else
		set ors=hx.execute("select Visitor,PageView from CC_D where CDate=DateAdd('d',-1,Date())")	
		end if
	
		YestodayVisitor=ors(0)
		YestodayPageView=ors(1)
		set ors=nothing
		str=replace(str,"$YestodayPageView",YestodayPageView)
		str=replace(str,"$YestodayVisitor",YestodayVisitor)
	end if
	
	outstr=str
	
	response.write "document.write("& chr(34) & outstr & chr(34) &")"
End Sub
%>