www.gusucode.com > 乘风网站推广系统 3.99 (acc)码程序 > CF_Manage_2.asp

    <%
'乘风网站推广系统 Access版
'作者QQ:178575
'作者EMail:yliangcf@163.com
'作者网站:http://www.qqcf.com
'详细简介:http://www.qqcf.com/?action=list&list=cfwztg
'上面有程序在线演示,安装演示,使用疑难解答,最新版本下载等内容
'因为这些内容可能时常更新,就没有放在程序里,请自己上网站查看
%>
<%If Action="lylist" Then%>
<%
Set Rs = Server.CreateObject("ADODB.Recordset")
Sql="Select * From CFWztg_User where UserName='"&UserName&"'"
Rs.open Sql,Conn,1,1
If Rs("PasswordAsk")="你的默认密码回答答案是1234,请修改成别的!" Then Response.write "&nbsp;&nbsp;&nbsp;&nbsp;<a href='?Action=passwordanswermodify'><font color=ff0000><b>密码回答答案未设置,点击设置</b></font></a><br>"
If Rs("EMail")="" Then Response.write "&nbsp;&nbsp;&nbsp;&nbsp;<a href='?Action=datamodify'><font color=ff0000><b>你的安全Email未设置,点击设置</b></font></a><br>"
%>  
<table class="tb_1">
  <tr> 

      <td colspan="8" class="td_3">
          请选择查询的日期:
<select id='adddate' onChange="window.location=document.getElementById('adddate').options[document.getElementById('adddate').selectedIndex].value">
<option value=?Action=<%=Action%>>请选择日期</option>
            <%
Sql="Select AddDate From CFWztg_Visit_Ly Where UserName='"&UserName&"' Group By AddDate Order By AddDate Desc"
Set Rs = Server.CreateObject("Adodb.Recordset")
Rs.open Sql,Conn,1,1
While Not Rs.Eof
 Response.Write "<option value='?Action="&Action&"&AddDate="&Rs("AddDate")&"'"
 If ChkStr(Request("AddDate"),3)=Cstr(Rs("AddDate")) Then Response.Write " selected"
 Response.Write ">"&Rs("AddDate")&"</option>"
Rs.MoveNext
Wend
%>
          </select>
</td>

  </tr>
  <%
Px=ChkStr(Request("Px"),1)
AddDate=ChkStr(Request("AddDate"),3)

If Px="" Then  Px="IpCounter"
If AddDate="" Then AddDate=Date()

Call PxFilter(Px,"id,AD_ID,Ly,IpCounter,AddDate,AddTime,LastTime,Ip")

Sql="Select Sum(IpCounter) From CFWztg_Visit_Ly where UserName='"&UserName&"' And Datediff('d',AddDate,'"&AddDate&"')=0"
Set Rs=Conn.execute(Sql)
IpTotal=Rs(0)


Sql="Select * From CFWztg_Visit_Ly where UserName='"&UserName&"' And Datediff('d',AddDate,'"&AddDate&"')=0 And IpCounter>0"
Sql=Sql&" Order By "&Px&" Desc"

Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.Open Sql,Conn,1,1

If Not Rs.eof Then
 If ChkStr(Request("Page"),2) = "" Then
  Page = 1
 Else 
  Page = CLng(ChkStr(Request("Page"),2))
 End If
 
 Rs.pagesize=10
 TotalRs=Rs.RecordCount
 TotalPage=Rs.PageCount
 MyPageSize=Rs.PageSize
 Rs.AbsolutePage=Page
End If
%>
  <tr class="tr_1"> 
    <td colspan="8"><%=AddDate%> 页面来源统计[可点击标题排序]</td>
  </tr>
  <tr> 
	<td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=ID">序号</a></td>
    <td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=Ad_ID">广告编号</a></td>
	<td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=Ly">来源页面</a></td>
    <td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=IpCounter">点击数量</a></td>

    <td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=IpCounter">所占此天的比例</a></td>
    <td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=AddTime">开始时间</a></td>
    <td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=LastTime">最后访问时间</a></td>
    <td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=Ip">最后IP</a></td>
  </tr>
  <%
While Not Rs.Eof And MyPageSize>0
%>
  <tr> 
    <td><%=Rs.RecordCount-Rs.Pagesize*(Page)+MyPageSize%></td>
    <td><%=Rs("Ad_ID")%></td>
    <td>  
        <%
 If Rs("Ly")="" Then
  Response.Write "直接从浏览器输入"
 Else
  Response.Write "<a href="&Rs("Ly")&" target='_blank'>"&Left(BreakUrl(Rs("Ly"),2),30)&"</a>&nbsp;[<a href="&Rs("Ly")&" target='_blank'>详细</a>]"
 End If
%>
      </td>
    <td><%=Rs("IpCounter")%></td>

    <td><img src=images/redbar.gif width=<%=Rs("IpCounter")/IpTotal*150%> height=10><%=MyRate(Rs("IpCounter"),IpTotal)%>%</td>
    <td><%=GetTurnTime(Hour(Rs("AddTime")))&":"&GetTurnTime(Minute(Rs("AddTime")))&":"&GetTurnTime(Second(Rs("AddTime")))%></td>
    <td><%=GetTurnTime(Hour(Rs("LastTime")))&":"&GetTurnTime(Minute(Rs("LastTime")))&":"&GetTurnTime(Second(Rs("LastTime")))%></td>
    <td><%=Rs("Ip")%><%
 If Rs("IpArea")<>"" Then
  Response.write "<br>"&Rs("IpArea")
 End If
%></td>
  </tr>
  <%
MyPageSize=MyPageSize-1
Rs.MoveNext
Wend
%>
</table>
<table class="tb_3">
  <tr>
    <td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=<%=Px%>&Page=1">第一页</a>
<%
If Page>1 Then
%>
            <a href='?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=<%=Px%>&Page=<%=Page-1%>'>上一页</a>
<%
End If
%>
<%
If Page<Rs.PageCount Then
%>
            <a href='?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=<%=Px%>&Page=<%=Page+1%>'>下一页</a>
            <%

end if
%>
            <a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=<%=Px%>&Page=<%=Totalpage%>">最后一页</a> 页次:<font color="#ff0000"><%=Page%></font>/<%=TotalPage%>页&nbsp;&nbsp;共<%=TotalRs%>条记录&nbsp;&nbsp;每页显示<%=Rs.PageSize%>条
<%
Response.write "&nbsp;&nbsp;转到第<select id='page' onChange=""window.location=document.getElementById('page').options[document.getElementById('page').selectedIndex].value"">"
For I=1 To TotalPage
 Response.Write "<option value=?Action="&Action&"&AddDate="&AddDate&"&Px="&Px&"&Page="&I
 If Page=I Then Response.Write " selected"
 Response.Write ">"& I &"</option>"
Next
Response.write "</select>页"
%></td>
  </tr>
</table>
<%End If%>

<%If Action="iplist" Then%>

          
<table class="tb_1">
  <tr> 

      <td colspan="15" class="td_3">请选择查询的日期: 
<select id='adddate' onChange="window.location=document.getElementById('adddate').options[document.getElementById('adddate').selectedIndex].value">
<option value=?Action=<%=Action%>>请选择日期</option>
            <%
Sql="Select AddDate From CFWztg_Visit_Ip Where UserName='"&UserName&"' Group By AddDate Order By AddDate Desc"
Set Rs = Server.CreateObject("Adodb.Recordset")
Rs.open Sql,Conn,1,1
While Not Rs.Eof
 Response.Write "<option value='?Action="&Action&"&AddDate="&Rs("AddDate")&"'"
 If ChkStr(Request("AddDate"),3)=Cstr(Rs("AddDate")) Then Response.Write " selected"
 Response.Write ">"&Rs("AddDate")&"</option>"
Rs.MoveNext
Wend
%>
          </select>
</td>

  </tr>
  <%
Px=ChkStr(Request("Px"),1)
AddDate=ChkStr(Request("AddDate"),3)

If Px="" Then  Px="ID"

If AddDate="" Then AddDate=Date()


Call PxFilter(Px,"id,AD_ID,Ip,Ly,AddTime,LastTime,AgentStr,Alexa,WebWidth,WebHeight,WebTop,WebLeft,MouseTop,MouseLeft")

Sql="Select Count(*) From CFWztg_Visit_Ip where UserName='"&UserName&"' And Datediff('d',AddDate,'"&AddDate&"')=0"
Set Rs=Conn.Execute(Sql)
IpTotal=Rs(0)

Sql="Select Top 5000 * From CFWztg_Visit_Ip where UserName='"&UserName&"' And Datediff('d',AddDate,'"&AddDate&"')=0"
Sql=Sql&" Order By "&Px&" Desc"

Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.open Sql,Conn,1,1

If Not Rs.eof Then
 If ChkStr(Request("Page"),2) = "" Then
  Page = 1
 Else 
  Page = CLng(ChkStr(Request("Page"),2))
 End If
 
 Rs.pagesize=10
 TotalRs=Rs.RecordCount
 TotalPage=Rs.PageCount
 MyPageSize=Rs.PageSize
 Rs.AbsolutePage=Page
End If
%>
  <tr class="tr_1"> 
    <td colspan="15"><%=AddDate%> Ip记录[可点击标题排序]</td>
  </tr>
  <tr class="tr_2"> 
    <td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=ID">序号</a></td>
    <td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=Ip">IP</a></td>
    <td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=Ly">来源页面</a></td>
    <td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=Ad_ID">广告</a></td>
    <td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=AddTime">来访时间</a></td>
	<td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=LastTime">最后时间</a></td>
	<td>停留(秒)</td>
    <td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=AgentStr">参数</a></td>
    <td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=Alexa">Alexa</a></td>
    <td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=WebWidth">页宽</a></td>
    <td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=WebHeight">页高</a></td>
    <td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=WebTop">页顶</a></td>
    <td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=WebLeft">页左</a></td>
	<td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=MouseTop">鼠顶</a></td>
	<td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=MouseLeft">鼠左</a></td>
	
  </tr>
  <%
While Not Rs.Eof And MyPageSize>0
%>
  <tr class="tr_2"> 
    <td><%=Rs.RecordCount-Rs.Pagesize*(Page)+MyPageSize%></td>
    <td>  <%=Rs("IP")%> 
        <%
 If Rs("IpArea")<>"" Then
  Response.write "<br>"&Rs("IpArea")
 End If
%>
    </td>
    <td width="120px"> 
        <%
 If Rs("Ly")="" Then
  Response.Write "直接从浏览器输入"
 Else
  Response.Write "<a href="&Rs("Ly")&" target='_blank'>"&Left(BreakUrl(Rs("Ly"),2),30)&"</a>&nbsp;[<a href="&Rs("Ly")&" target='_blank'>详细</a>]"
 End If
%>
    </td>
    <td><%=Rs("Ad_ID")%></td>
    <td><%=GetTurnTime(Hour(Rs("AddTime")))&":"&GetTurnTime(Minute(Rs("AddTime")))&":"&GetTurnTime(Second(Rs("AddTime")))%></td>
	<td><%=GetTurnTime(Hour(Rs("LastTime")))&":"&GetTurnTime(Minute(Rs("LastTime")))&":"&GetTurnTime(Second(Rs("LastTime")))%></td>
    <td><%=DateDiff("s",Rs("AddTime"),Rs("LastTime"))%></td>
	<td width="160px"><%=Rs("AgentStr")%></td>
    <td> 
        <%If Rs("Alexa")=-1 Then
	  Response.write "已安装"
	 Else
	  Response.write "未安装"
	 End If%>
    </td>
    <td><%=Rs("WebWidth")%></td>
    <td><%=Rs("WebHeight")%></td>
    <td><%=Rs("WebTop")%></td>
    <td><%=Rs("WebLeft")%></td>
	<td><%=Rs("MouseTop")%></td>
	<td><%=Rs("MouseLeft")%></td>
  </tr>
  <%
MyPageSize=MyPageSize-1
Rs.MoveNext
Wend
%>
</table>
<table class="tb_3">
  <tr>
    <td><a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=<%=Px%>&Page=1">第一页</a>
<%
If Page>1 Then
%>
            <a href='?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=<%=Px%>&Page=<%=Page-1%>'>上一页</a>
<%
End If
%>
<%
If Page<Rs.PageCount Then
%>
            <a href='?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=<%=Px%>&Page=<%=Page+1%>'>下一页</a>
            <%

end if
%>
            <a href="?Action=<%=Action%>&AddDate=<%=AddDate%>&Px=<%=Px%>&Page=<%=Totalpage%>">最后一页</a> 页次:<font color="#ff0000"><%=Page%></font>/<%=TotalPage%>页&nbsp;&nbsp;共<%=IpTotal%>条记录&nbsp;&nbsp;每页显示<%=Rs.PageSize%>条
<%
Response.write "&nbsp;&nbsp;转到第<select id='page' onChange=""window.location=document.getElementById('page').options[document.getElementById('page').selectedIndex].value"">"
For I=1 To TotalPage
 Response.Write "<option value=?Action="&Action&"&AddDate="&AddDate&"&Px="&Px&"&Page="&I
 If Page=I Then Response.Write " selected"
 Response.Write ">"& I &"</option>"
Next
Response.write "</select>页"
%></td>
  </tr>
</table>
<%End If%>

<%If Action="daytj" Then%>
<%
Sql="Select Sum(Display_Counter),Sum(Click_Counter),Sum(Reg_Counter) From CFWztg_AD_Counter_Day where UserName='"&UserName&"'"
Set Rs=Conn.Execute(Sql)
DisplayTotal = Rs(0)
ClickTotal = Rs(1)
RegTotal = Rs(2)

Sql="Select AddDate From CFWztg_AD_Counter_Day Where UserName='"&UserName&"' Group By AddDate Order By AddDate Desc"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.open Sql,Conn,1,1

If Not rs.eof then
 If ChkStr(Request("Page"),2) = "" Then
  Page = 1
 Else 
  Page = CLng(ChkStr(Request("Page"),2))
 End If
 
 rs.pagesize=10
 totalrs=rs.RecordCount
 totalpage=rs.pageCount
 mypagesize=rs.pagesize
 rs.absolutepage=page
End If
%>

<table class="tb_1">
  <tr class="tr_1"> 
    <td colspan="9">每日报表</td>
  </tr>
  <tr> 
    <td>日 期</td>
    <td colspan="2">显示数</td>
    <td colspan="2">点击数</td>
    <td colspan="2">注册数</td>
    <td>点击率</td>
    <td>详细推广记录</td>
  </tr>
  <%
While Not Rs.Eof And MyPageSize>0

Sql="Select Sum(Display_Counter),Sum(Click_Counter),Sum(Reg_Counter) From CFWztg_AD_Counter_Day where UserName='"&UserName&"' And AddDate=#"&Rs("AddDate")&"#"
Set Rs1 = Conn.Execute(Sql)
DisplayNum=Rs1(0)
ClickNum=Rs1(1)
RegNum=Rs1(2)
%>
  <tr> 
    <td><%=Rs("AddDate")%></td>
    <td><%=DisplayNum%></td>
    <td><img src=images/bluebar.gif width=<%=MyRateWidth(DisplayNum,DisplayTotal,100)%> height=10><%=MyRate(DisplayNum,DisplayTotal)%>%</td>
    <td><%=ClickNum%></td>
    <td><img src=images/greenbar.gif width=<%=MyRateWidth(ClickNum,ClickTotal,100)%> height=10><%=MyRate(ClickNum,ClickTotal)%>%</td>
    <td><%=RegNum%></td>
    <td><img src=images/redbar.gif width=<%=MyRateWidth(RegNum,RegTotal,100)%> height=10><%=MyRate(RegNum,RegTotal)%>%</td>
    <td><%=MyRate(ClickNum,DisplayNum)%>%</td>
    <td><a href="?action=lylist&AddDate=<%=Rs("AddDate")%>">[查看]</a></td>
  </tr>
  <%
Mypagesize=Mypagesize-1
Rs.MoveNext
Wend%>
  <tr> 
    <td colspan="9">统计:广告显示总计<%=DisplayTotal%>次 广告点击总数<%=ClickTotal%>次 推荐注册用户总数<%=RegTotal%>个</td>
  </tr>
</table>


<table class="tb_3">
  <tr>
    <td><a href="?Action=<%=Action%>&Page=1">第一页</a>
<%
If Page>1 Then
%>
            <a href='?Action=<%=Action%>&Page=<%=Page-1%>'>上一页</a>
<%
End If
%>
<%
If Page<Rs.PageCount Then
%>
            <a href='?Action=<%=Action%>&Page=<%=Page+1%>'>下一页</a>
<%
End If
%>
            <a href="?Action=<%=Action%>&Page=<%=totalpage%>">最后一页</a> 页次:<font color="#ff0000"><%=page%></font>/<%=totalpage%>页&nbsp;&nbsp;共<%=totalrs%>条记录&nbsp;&nbsp;每页显示<%=rs.pagesize%>条
<%
Response.write "&nbsp;&nbsp;转到第<select id='page' onChange=""window.location=document.getElementById('page').options[document.getElementById('page').selectedIndex].value"">"
For I=1 To TotalPage
 Response.Write "<option value=?Action="&Action&"&Page="&I
 If Page=I Then Response.Write " selected"
 Response.Write ">"& I &"</option>"
Next
Response.write "</select>页"
%></td>
  </tr>
</table>
<%end if%>


<%If Action="hourtj" Then%>
  <table class="tb_1">
    <tr> 

        <td colspan="9" class="td_3">请选择你要查询的日期 
<select id='adddate' onChange="window.location=document.getElementById('adddate').options[document.getElementById('adddate').selectedIndex].value">
<option value=?Action=<%=Action%>>请选择日期</option>
<%
Sql="Select AddDate From CFWztg_AD_Counter_Hour Where UserName='"&UserName&"' Group By AddDate Order By AddDate Desc"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.open Sql,Conn,1,1
While Not Rs.Eof 
 Response.Write "<option value='?Action="&Action&"&AddDate="&Rs("AddDate")&"'"
 If ChkStr(Request("AddDate"),3)=Cstr(Rs("AddDate")) Then Response.Write " selected"
 Response.Write ">"&Rs("AddDate")&"</option>"  
Rs.MoveNext
Wend  
%>
            </select>
</td>

    </tr>

  
    
<%
AddDate=ChkStr(Request("AddDate"),3)

If AddDate="" Then AddDate=Date()

Sql="Select Sum(Display_Counter),Sum(Click_Counter),Sum(Reg_Counter) From CFWztg_AD_Counter_Hour where UserName='"&UserName&"' And AddDate=#"&AddDate&"#"
Set Rs=Conn.Execute(Sql)
DisplayTotal=Rs(0)
ClickTotal=Rs(1)
RegTotal=Rs(2)


Sql="Select AddHour,AddDate From CFWztg_AD_Counter_Hour Where UserName='"&UserName&"' And AddDate=#"&AddDate&"# Group By AddHour,AddDate Order By AddHour Desc"
Set Rs = Server.CreateObject("ADODB.Recordset")
Rs.open Sql,Conn,1,1
%>


  <tr class="tr_1"> 
    <td colspan="9"><%=AddDate%> 每小时报表</td>
  </tr>
  <tr> 
    <td>小时</td>
    <td colspan="2">显示数</td>
    <td colspan="2">点击数</td>
    <td colspan="2">注册数</td>
    <td>点击率</td>
    <td>详细推广记录</td>
  </tr>
  <%
While Not Rs.Eof
I=I+1

Sql="Select Sum(Display_Counter),Sum(Click_Counter),Sum(Reg_Counter) From CFWztg_AD_Counter_Hour where UserName='"&UserName&"' And AddDate=#"&AddDate&"# And AddHour="&Rs("AddHour")
Set Rs1=Conn.Execute(Sql)
DisplayNum=Rs1(0)
ClickNum=Rs1(1)
RegNum=Rs1(2)
%>
  <tr> 
    <td><%=Rs("AddHour")%>-<%=Rs("AddHour")+1%></td>
    <td><%=DisplayNum%></td>
    <td><img src=images/bluebar.gif width=<%=MyRateWidth(DisplayNum,DisplayTotal,100)%> height=10><%=MyRate(DisplayNum,DisplayTotal)%>%</td>
    <td><%=ClickNum%></td>
    <td><img src=images/greenbar.gif width=<%=MyRateWidth(ClickNum,ClickTotal,100)%> height=10><%=MyRate(ClickNum,ClickTotal)%>%</td>
    <td><%=RegNum%></td>
    <td><img src=images/redbar.gif width=<%=MyRateWidth(RegNum,RegTotal,100)%> height=10><%=MyRate(RegNum,RegTotal)%>%</td>
    <td><%=MyRate(ClickNum,DisplayNum)%>%</td>
    <td><a href="?Action=lylist&AddDate=<%=Rs("AddDate")%>">[查看]</a></td>
  </tr>
  <%
Rs.MoveNext
Wend
%>
  <tr> 
    <td colspan="9">统计:广告显示总计<%=DisplayTotal%>次 广告点击总数<%=ClickTotal%>次 推荐注册用户总数<%=RegTotal%>个</td>
  </tr>
</table>
<%End If%>