?? ip.asp
字號(hào):
<!-- #INCLUDE FILE = "conn.asp" -->
<!-- #INCLUDE FILE = "date.asp" -->
<!-- #INCLUDE FILE = "function.asp" -->
<!-- #INCLUDE FILE = "session.asp" -->
<%
dim Rs,sql,bydate,pagenum,totalnum,pagesizes,currentpage,nextpage,prepage,i,rowsdata,iti,BeginTime
BeginTime=Timer
pagesizes=20
if(request.QueryString("bydate")<>"") then
bydate=trim(request.QueryString("bydate"))
else
bydate=iYear&"-"&iMonth&"-"&iDay
end if
if(request.QueryString("page")<>"") then
currentpage=Cint(request.QueryString("page"))
else
currentpage=1
end if
If databaseType = 1 Then
sql="select count(*) from t_ip WHERE f_date=#"&bydate&"#"
Else
sql="SELECT count(*) from t_ip WHERE CONVERT(varchar(10),f_date,121)='"&bydate&"'"
sql="SELECT count(*) from t_ip WHERE f_date='"&bydate&"'"
end if
totalnum=conn.execute(sql)(0)
pagenum=Cint((totalnum+pagesizes-1)/pagesizes)
%>
<!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>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Untitled Document</title>
<link href="style/css.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.style1 {
color: #FFFFFF;
font-weight: bold;
}
.style2 {
color: #cc3300;
font-weight: bold;
}
.style3 {
color: #006699;
font-weight: bold;
}
.style4 {
color: #000000;
font-weight: bold;
}
-->
</style>
<script language="javascript">
function goto(frm)
{
var gourl ="?bydate=<%=bydate%>&";
gourl += "page=" + (frm.page.value);
var hid=parseInt(frm.hid.value);
if(parseInt(frm.page.value)>hid||frm.page.value<=0){
alert("錯(cuò)誤!請(qǐng)確定你輸入的數(shù)字在1-"+hid+"之間");
return false;
}
window.location.href(gourl);
}</script>
</head>
<body>
<p><br />
<span class="style3">來(lái)路統(tǒng)計(jì):</span><span class="style2"><%=totalnum%></span></p>
<table width="98%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr>
<td height="20" bgcolor="#006699"><div align="center" class="style1">來(lái)路訪問(wèn)統(tǒng)計(jì)</div></td>
</tr>
<tr>
<td bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td width="40%" height="20" valign="bottom" bgcolor="#F5F5F5"> <div align="center">來(lái)源IP</div>
<td width="44%" valign="bottom" bgcolor="#F5F5F5"> <div align="center">時(shí)間</div>
<td width="16%" valign="bottom" bgcolor="#F5F5F5"><div align="center">點(diǎn)擊</div></td>
</tr>
<%
Set Rs=Server.CreateObject("ADODB.Recordset")
If databaseType = 1 Then
sql="select f_ip,f_date,f_hits from t_ip WHERE f_date=#"&bydate&"# order by f_hits desc,id desc"
Else
if(currentpage=1) then
sql = "SELECT top "&pagesizes&" f_ip,f_date,f_hits from t_ip WHERE CONVERT(varchar(10),f_date,121) = '"&bydate&"' order by f_hits desc"
else
sql = "SELECT top "&pagesizes&" f_ip,f_date,f_hits from t_ip WHERE id not in (select top "&(pagesizes*(currentpage-1))&" id from t_ip where CONVERT(varchar(10),f_date,121) = '"&bydate&"' order by f_hits desc) and CONVERT(varchar(10),f_date,121) = '"&bydate&"' order by f_hits desc"
end if
end if
dim startIndex
if(databaseType=1) then
startIndex=pagesizes*(currentpage-1)
else
startIndex=0
end if
Rs.open sql,conn,3,1
if not rs.eof then
rowsdata=rs.GetRows()
rs.close
set rs=nothing
for iti=startIndex to startIndex+pagesizes-1
if(iti>ubound(rowsdata,2)) then
exit for
end if
%>
<tr>
<td height="20" valign="bottom" bgcolor="#FFFFFF"><div align="left"><%=iti+1%>:<%=rowsdata(0,iti)%></div>
<td valign="bottom" bgcolor="#FFFFFF"><div align="center"><%=rowsdata(1,iti)%></div>
<td valign="bottom" bgcolor="#FFFFFF"><div align="center"><%=rowsdata(2,iti)%></div></td>
</tr>
<%
next
else
response.Write("no data")
rs.close
set rs=nothing
end if
%>
</table></td>
</tr>
</table>
<br />
<%
dim preY,nextY,preM,nextM,preD,nextD
preY=iYear-1
nextY=iYear+1
preM=getPreMonth(iMonth)
nextM=getNextMonth(iMonth)
preD=getPreDay(iDay)
nextD=getNextDay(iDay)
%>
<table width="98%" height="20" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td>
<div align="center">
<a href="?y=<%=preY%>"><<</a> <%=iYear%>年
<a href="?y=<%=nextY%>">>></a>
<a href="?m=<%=preM%>"><<</a><%=iMonth%>月
<a href="?m=<%=nextM%>">>></a>
<a href="?d=<%=preD%>"><<</a><%=iDay%>日
<a href="?d=<%=nextD%>">>></a>
</div>
<div align="center">
<%
nextpage=currentpage+1
prepage=currentpage-1
if prepage>0then
response.write("["&"<a href='?page="&cstr(prepage)&"&y="&iYear&"&m="&iMonth&"&d="&iDay&"'>上一頁(yè)</a>] ")
else
response.write("上一頁(yè) ")
end if
if (nextpage-1)*pagesizes>=totalnum then
response.write("下一頁(yè)" )
else
response.Write("["&"<a href='?page="&cstr(nextpage)&"&y="&iYear&"&m="&iMonth&"&d="&iDay&"'>下一頁(yè)</a>]")
end if
response.write(" 共"&totalnum&"條 ")
response.Write(" 共"&pagenum&"頁(yè) ")
response.Write(" 第"¤tpage&"頁(yè) ")
response.Write(" 執(zhí)行時(shí)間"&CStr(FormatNumber((Timer-BeginTime),2))& "秒")
%>
</div></td>
</tr>
</table>
</body>
</html>
<%
call connclose()
%>
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -