⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 tj_searchgo.asp

📁 8款下载系统源代码 2003-3-11 21:37:45 433 949k · 都很常见: 猛虎山庄、燕衔泥(飞扬的软件第二版用的就是他
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%@ CODEPAGE = "936" %>
<%
'=================================
'
'      阿江酷站访问统计系统
'    Ajiang   info@ajiang.net 
'        www.ajiang.net
'
'     版权所有·抄袭挪用必究
'
'=================================
%>
<!--#include file="inc_config.asp"-->
<%
'权限检查
if session.Contents("master")=false and whatcan<4 then Response.Redirect "help.asp?id=004&error=您没有使用自定义统计的权限。"

'********************************** 处理查询条件 **********************************

'================================
'
'     从浏览器或者数据并处理
'
'================================

'从浏览器获取数据

onyear		=trim(Request("onyear"))
onmonth		=trim(Request("onmonth"))
onday		=trim(Request("onday"))

offyear		=trim(Request("offyear"))
offmonth	=trim(Request("offmonth"))
offday		=trim(Request("offday"))

vip			=trim(Request("vip"))
vwhere		=trim(Request("vwhere"))
vos1		=trim(Request("vos1"))
vos2		=trim(Request("vos2"))
vsoft1		=trim(Request("vsoft1"))
vsoft2		=trim(Request("vsoft2"))
vcome		=trim(Request("vcome"))
vpage		=trim(Request("vpage"))

outtype		=trim(Request("outtype"))
wherestr	=trim(Request("wherestr"))
name		=trim(Request("name"))
content		=trim(Request("content"))

'处理获取的数据
ontime=onyear & "-" & onmonth & "-" & onday
if (ontime <> "--") and (not isdate(ontime)) then Response.Redirect "help.asp?id=001&error=日期填写不合乎要求。"

offtime=offyear & "-" & offmonth & "-" & offday
if (offtime <> "--") and (not isdate(offtime)) then Response.Redirect "help.asp?id=001&error=日期填写不合乎要求。"
if (offtime <> "--") then offtime=cdate(offtime)+1		'因为SQL总是按所指日期的0时计算的,所以应该改为下一日

if (outtype ="") then Response.Redirect "help.asp?id=001&error=您没有指明要查看的项目。"

vos=vos2
if vos = "" then vos=vos1
vsoft=vsoft2
if vsoft="" then vsoft=vsoft1


'************************************ 运算和输出 ************************************

'================================
'
'         转换为 SQL 指令
'
'================================

'将查询条件转换为SQL查询指令
if wherestr="" then
wherestr=" where "

'如果存在查询条件,则将查询条件加入查询字串
if ontime <> "--" then wherestr=wherestr & "and (vtime>=datevalue('" & ontime & "')) "
if offtime <> "--" then wherestr=wherestr & "and (vtime<=datevalue('" & offtime & "')) "
if vip <> "" then wherestr=wherestr & "and (vip like '%" & vip & "%') "
if vwhere <> "" then wherestr=wherestr & "and ((vwhere like '%" & vwhere & "%') or (vwheref like '%" & vwhere & "%')) "
if vos <> "" then vherestr=wherestr & "and (vos like '%" & vos & "%') "
if vsoft <> "" then wherestr=wherestr & "and (vsoft like '%" & vsoft & "%') "
if vcome <> "" then wherestr=wherestr & "and (vcome like '%" & vcome & "%') "
if vpage <> "" then wherestr=wherestr & "and (vpage like '%" & vpage & "%') "

'去除第一个查询条件和 where 之间的 and
wherestr=replace(wherestr,"where and","where")

'如果没有查询条件,则查询字串应为空
if trim(wherestr)="where" then wherestr=""
end if

'如果要查看的内容只有详细记录,则直接转入详细记录页
if outtype="详细" then Response.Redirect "tj_all.asp?wherestr=" & server.URLEncode(wherestr)

'================================
'
'          主 程 序
'
'================================

'打开数据库
set conn=server.createobject("adodb.connection")
DBPath = Server.MapPath(connpath)
conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath
Set rs = Server.CreateObject("ADODB.Recordset")

%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Copyright" content="Ajiang http://www.ajiang.net">
<title><%=countname%>-自定义统计</title>
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<body topmargin=5 rightmargin=0 leftmargin=0 vlink=#000000>
<!--#include file="inc_top.asp"-->
<br>
<table width=500 cellspacing=0 align=center>
  <tr><td>
    <p style="line-height: 100%; margin-left: 15; margin-top: 5; margin-bottom: 0">
    恭喜: 下面显示的就是您要查询的内容的分析结果。</p>
  </td></tr>
</table>
<br>

<%
'根据查询条件输出相应的内容

if instr(outtype,"小时") then
statname="24小时访问分析"
tuwidth=15
thewhich="vhour"
tuhow=24
unit="时"
statheng statname,tuwidth,thewhich,tuhow,unit,wherestr
end if

if instr(outtype,"日") then
statname="日访问分析"
tuwidth=13
thewhich="vday"
tuhow=31
unit="日"
statheng statname,tuwidth,thewhich,tuhow,unit,wherestr
end if

if instr(outtype,"周") then
statname="周访问分析"
tuwidth=40
thewhich="vweek"
tuhow=7
unit=""
statheng statname,tuwidth,thewhich,tuhow,unit,wherestr
end if

if instr(outtype,"月") then
statname="月访问分析"
tuwidth=20
thewhich="vmonth"
tuhow=12
unit="月"
statheng statname,tuwidth,thewhich,tuhow,unit,wherestr
end if

if instr(outtype,"年") then
statname="年访问分析"
leftwidth=50
tuwhich="vyear"
statshu statname,leftwidth,tuwhich,wherestr
end if

if instr(outtype,"IP") then
statname="IP分析"
leftwidth=150
tuwhich="vIP"
statshu statname,leftwidth,tuwhich,wherestr
end if

if instr(outtype,"地区") then
statname="地区访问分析"
leftwidth=100
tuwhich="vwhere"
statshu statname,leftwidth,tuwhich,wherestr
end if

if instr(outtype,"浏览器") then
statname="不同浏览器用户访问分析"
tuwidth=50
thewhich="vsoft"
tuhow=7
unit=""
statheng statname,tuwidth,thewhich,tuhow,unit,wherestr
end if

if instr(outtype,"操作系统") then
statname="不同操作系统用户访问分析"
tuwidth=50
thewhich="vOS"
tuhow=7
unit=""
statheng statname,tuwidth,thewhich,tuhow,unit,wherestr
end if

if instr(outtype,"来路") then
statname="来路分析"
leftwidth=220
tuwhich="vcome"
statshu statname,leftwidth,tuwhich,wherestr
end if

if instr(outtype,"页面") then
statname="页面点击分析"
leftwidth=220
tuwhich="vpage"
statshu statname,leftwidth,tuwhich,wherestr
end if

'如果同时选择了详细,则提示点击继续
if instr(outtype,"详细") then
%>
<table width="500" cellspacing="0" align="center" cellpadding="0" border="0">
  <tr><td colspan="3"><img src="images/photoup.gif"></td></tr>
  <form action="tj_all.asp" method=post id=form1 name=form1>
  <tr height="30">
    <td width="1" class="backs"></td>
    <td width="498"class="backq">
		&nbsp; <img src="images/tb_title.gif" align=absmiddle><font style="font-size:16px">&nbsp;</font>∷∷∷ 查看详细记录 ∷∷∷<br>
		<p class="p1">因为详细记录需要翻页,不能和以上记录放在同一页,请点击下面的继续按钮查看相应内容。
	<p class="p1" style='margin-top: 0;' align="right">
	<a href='javascript:document.forms[0].submit();'>继续</a>
	<input type="hidden" name="wherestr" value="<%=wherestr%>">
	<input type="submit" value=" " name="save" class="backc2"><font style="font-size:16px">&nbsp;</font>&nbsp;
	</td>
    <td width="1" class="backs"></td>
  </tr>
  </form>
  <tr><td colspan="4"><img src="images/photodown.gif"></td></tr>
</table>
<br>
<%
end if

'保存数据表单
if session.Contents("master")=true or whatcan>=6 then
%>
<table width="500" cellspacing="0" align="center" cellpadding="0" border="0">
  <tr><td colspan="3"><img src="images/photoup.gif"></td></tr>
  <form action="tj_save.asp" method=post>
  <tr height="30">
    <td width="1" class="backs"></td>
    <td width="498"class="backq">
		&nbsp; <img src="images/tb_save.gif" align=absmiddle><font style="font-size:16px">&nbsp;</font>∷∷∷ 保存这次检索条件 ∷∷∷<br>

	<p class="p1"><font class="fonts"><b>检索条件</b></font>&nbsp; <%if wherestr="" then%>没有检索条件<%else%><%=wherestr%><%end if%>。
	<p class="p1" style='margin-bottom: 0;margin-top: 0;'><font class="fonts"><b>查询项目</b></font>&nbsp; <%=outtype%>。
	<p class="p1" style='line-height: 100%;margin-bottom: 0;margin-top: 0;'><font class="fonts"><b>取个名字</b></font>&nbsp; <input name="name" size="16" class="input" value="<%=name%>">&nbsp;
	<INPUT type="radio" name="overwrite" value="0"<%if name="" then%> checked<%end if%>> 同名时提示&nbsp;
	<INPUT type="radio" name="overwrite" value="1"<%if name<>"" then%> checked<%end if%>> 同名时覆盖
	<p class="p1" style='line-height: 100%;margin-bottom: 0;margin-top: 0;'><font class="fonts"><b>加个介绍</b></font>&nbsp; <input name="content" size="50" class="input" value="<%=content%>">
	<p class="p1" style='margin-top: 0;' align="right">
	<a href="help.asp?id=002">帮助</a>
	<a href='javascript:document.forms[0].submit();'>保存</a>
	<input type="hidden" name="wherestr" value="<%=wherestr%>"><input type="hidden" name="outtype" value="<%=outtype%>"><input type="submit" value=" " name="save" class="backc2"><font style="font-size:16px">&nbsp;</font>&nbsp;

	</td>
    <td width="1" class="backs"></td>
  </tr>
  </form>
  <tr><td colspan="4"><img src="images/photodown.gif"></td></tr>
</table>
<br>
<%
end if
%>
<!--#include file="inc_bottom.asp"-->
</body>
</html>
<%
' 关闭数据库
set rs=nothing
conn.Close
set conn=nothing
%>





<%

'******************************** 自定义函数和子程序 ********************************

'================================
'
'   输出图表数据的子程序(横)
'
'================================

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -