www.gusucode.com > QQ空间互踩联盟源码程序asp编程 > admin_manage.asp

    <!--#include file="conn.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML lang="gb2312" xmlns="http://www.w3.org/1999/xhtml"><HEAD>
<META http-equiv=Content-Type content="text/html; charset=gb2312"><title>Qzone人气联盟后台管理 <%=ChannelName%></title>
<meta http-equiv="content-type" content="text/html;charset=gb2312"/>
<link rel="icon" href="images/favicon.ico" type="image/x-icon" />
<link rel="shortcut icon" href="images/favicon.ico" type="image/x-icon" />
<meta content=<%=ChannelName%> name=description>
<meta content=<%=ChannelName%> name=Keywords>
<link rel="stylesheet" href="qzonev_com.css" type="text/css"/>
</HEAD>
<BODY style="MARGIN: 0px; TEXT-ALIGN: center">
<%
on error resume next
if session("qzonev_com_admin")<>"OK" then
response.redirect("admin_login.asp")
end if
dim action
action=request.QueryString("action")
%>
<!--#include file="top.asp"-->
<TABLE borderColor=#000000 cellSpacing=2 cellPadding=1 width=950 align=center bgColor=#000000 border=1>
<tr>
<td borderColor=#333333 bgColor=#000000 background="images/top_2.jpg"><div align="center">| <a href="admin_manage.asp">风云榜管理首页</a> | <a href="?action=ListSite">查看所有用户</a> | <a href="?action=Summary">查看统计记录</a> | <a href="?action=ShowLog">查看点击记录</a> | <a href="?action=ClearCache" onClick="return confirm('此功能将删除本系统上的缓存,你确认要继续吗?')">删除系统缓存</a> | <a href="?action=BatchDelform">批量删除数据</a> | <a href="?action=CompactDB" onClick="return confirm('你确定要压缩吗?')">压缩DB数据库</a> | <a href="?action=init" onClick="return confirm('初始化后,所有数据将清零,你确认要继续吗?')">初始所有数据</a> | <a href="admin_login.asp?action=exit">退出后台管理</a> |</div></td>
</tr>
</table>



<table border="0" align="center" cellpadding="0" cellspacing="0">
<tr> 
<td> <%
select case action
case "del"
call dellink
case "init"
call init
case "BatchDelform"
call BatchDelform
case "BatchDelWeb"
call BatchDelWeb
case "BatchDelLog"
call BatchDelLog
case "ShowLog"
call ShowLog
case "ListSite"
call ListSite
case "CompactDB"
call Compact
case "ClearCache"
call ClearCache
case "Summary"
call Summary
case else
call main
end select
sub main
%>
<TABLE borderColor=#000000 cellSpacing=2 cellPadding=1 width=950 align=center bgColor=#000000 border=1>
<tr borderColor=#333333 bgColor=#1D1D1D> 
<td align="center"></td>
</tr>
</table> 
<%
end sub
sub ListSite
dim find,webtype,pl
dim rs,sql
dim condition,linkstr
find=hx.checkstr(request("find"),20)
webtype=request("webtype")

sql="select * from Qzonev_Com_Link"
condition = " where 1=1 " 

pl=request("pl")
if pl="" then
pl="inj"
end if
linkstr = "pl=" & pl

if webtype="" or not isnumeric(webtype) then
webtype=0 
elseif webtype>0 then
condition = condition & " and webtype="&webtype
end if
linkstr = linkstr & "&action=ListSite&webtype="&webtype


if find<>"" then
condition = condition & " and (sitename like '%"&find&"%' or siteurl like '%"&find&"%')"
linkstr = linkstr & "&action=ListSite&find="&find
end if

'分页信息
dim PageNo
PageNo=Request.QueryString("PageNo")
if PageNo="" or not isnumeric(PageNo) then
PageNo=1
else
PageNo=int(PageNo)
end if

'普通sql语句
sql=sql & condition &" ORDER BY "&pl&" DESC"

%> 
<TABLE borderColor=#000000 cellSpacing=2 cellPadding=1 width=950 align=center bgColor=#000000 border=1>
<form method="post" action="?action=ListSite">
<tr> 
<td height="30" align="center" valign="middle" borderColor=#333333 bgColor=#1D1D1D><p>用户名[QQ]: 
<input name="find" type="text" id="find" value="<%=find%>" size="15" maxlength="20" class='inbox0'>
所在地区: 
<select name="webtype" size="1" class='inbox0'>
<!--option value="">全部类别</option-->
<%hx.listwebtype(webtype)%>
</select>
排序: 
<select name="pl" size="1" class='inbox0'>
<option value="inc"<%if pl="inc" then%> selected<%end if%>>总计票数</option>
<option value="inj"<%if pl="inj" then%> selected<%end if%>>今日得票</option>
<option value="outc"<%if pl="outc" then%> selected<%end if%>>总计被踩</option>
<option value="outj"<%if pl="outj" then%> selected<%end if%>>今天被踩</option>
<option value="indate"<%if pl="indate" then%> selected<%end if%>>近期得票</option>
<option value="fromdate"<%if pl="fromdate" then%> selected<%end if%>>统计时间</option>
<option value="dateandtime"<%if pl="dateandtime" then%> selected<%end if%>>注册时间</option>
<option value="vip"<%if pl="vip" then%> selected<%end if%>>查询会员</option>
</select>
<input name="submit" type="submit" value="查 询" class='ann0'>
</td>
</tr></form>

</table>
</td>
</tr>
</table>


<TABLE borderColor=#000000 cellSpacing=2 cellPadding=1 width=950 align=center bgColor=#000000 border=1>

<tr align="center">


<td borderColor=#333333 bgColor=#1D1D1D><form action="admin_editlink.asp"><font color="#FFFF99">输入QQ号码</font>:<input name="username" type="text" value="" size="9" maxlength="9" class='inbox0'> <input type="submit" value="修改数据" class="ann0"></td></form>


</tr><table>


<%
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1

if not rs.eof then
rs.PageSize = MaxPageSize
rs.AbsolutePage = PageNo 
dim i
i=0 
%>
<TABLE borderColor=#000000 cellSpacing=2 cellPadding=1 width=950 align=center bgColor=#000000 border=1>
<tr align="center" borderColor=#333333 bgColor=#000000> 

<td width="7%" borderColor=#333333 bgColor=#000000 background="images/top_2.jpg">QQ状态</td>
<td width="6%" borderColor=#333333 bgColor=#000000 background="images/top_2.jpg">空间形象</td>
<td width="15%" borderColor=#333333 bgColor=#000000 background="images/top_2.jpg">QQ空间名称</td>
<td width="8%" borderColor=#333333 bgColor=#000000 background="images/top_2.jpg">QQ号码</td>
<td width="8%" borderColor=#333333 bgColor=#000000 background="images/top_2.jpg">密码保护</td>
<td width="8%" borderColor=#333333 bgColor=#000000 background="images/top_2.jpg">所在地区</td>
<td width="6%" borderColor=#333333 bgColor=#000000 background="images/top_2.jpg">会员级别</td>
<td width="8%" borderColor=#333333 bgColor=#000000 background="images/top_2.jpg">用户登记时间</td>
<td width="8%" borderColor=#333333 bgColor=#000000 background="images/top_2.jpg">开始统计时间</td>
<td width="8%" borderColor=#333333 bgColor=#000000 background="images/top_2.jpg">近期得票时间</td>
</tr>
<%Do While Not rs.EOF and i<MaxPageSize%>
<tr align="center" borderColor=#333333 bgColor=#1D1D1D>

<td><a target=blank href=tencent://message/?uin=<%=rs("username")%>><img border="0" SRC=http://wpa.qq.com/pa?p=1:<%=rs("username")%>:14 alt="点击这里给我发消息"></a></td>
<td><a href="http://<%=hx.BaseUrl%>out.asp?username=<%=rs("username")%>" target="_blank"><img src=<%=hx.htmlencode2(rs("sitelogo"))%> width=40 height=40 border="0"></a></td>
<td><%=(PageNo-1)*MaxPageSize+i+1%><%=rs("sitename")%></td>
<td><%=hx.htmlencode2(rs("siteurl"))%></td>
<td><%=rs("siteintro")%></td>
<td><%=hx.showwebtype(rs("webtype"))%></td>
<td><% if rs("vip") = 0 then %>
<A href="buyvip.asp" target=_blank><u><img src="images/vip_no.gif" border="0" alt="普通成员"></u></A><% else %>
<A href="buyvip.asp" target=_blank><u><img src="images/vip_yes.gif" border="0" alt="高级会员"></u></A><% end if %></td>
<td><%=rs("dateandtime")%></td>
<td><%=rs("fromdate")%></td>
<td><%=rs("indate")%></td>

</tr>

<tr borderColor=#333333 bgColor=#1D1D1D> 
<td align="center">贡献统计</td>
<td colspan="10"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr borderColor=#333333 bgColor=#1D1D1D> 
<td width="20%">今日/本月得票:<font color="#FFFF99"><%=rs("inj")%>/<%=rs("inc")%>:票</font></td>
<td width="20%">今日/本月被踩:<font color="#FFFF99"><%=rs("outj")%>/<%=rs("outc")%>:次</font></td>
<td width="40%"><div align="right"><a href="admin_editlink.asp?username=<%=rs("username")%>" target="_blank"><u>修改数据</u></a> <a href="?Action=del&username=<%=rs("username")%>" onClick="return confirm('删除后,此空间数据将消失,你确认要继续吗?')"><u>删除数据</u></a> <a href="?action=init&username=<%=rs("username")%>" target="_blank" onClick="return confirm('初始后,此空间数据将清零,你确认要继续吗?')"><u>初始数据</u></a> <a href="?action=ShowLog&username=<%=rs("username")%>&inout=0" target="_blank"><u>点入记录</u></a> <a href="?action=ShowLog&username=<%=rs("username")%>&inout=1" target="_blank"><u>点出记录</u></a></div></td>

</tr>
</table></td>
</tr>

<tr> 
<td height="5" colspan=7></td>
</tr>
<%
i=i+1
rs.MoveNext
Loop
else
%>
<tr> 
<td height=80 colspan=7> <div align="center"><B>没有找到你所查询的空间</B></div></td>
</tr>
<%
end if
rs.close
set rs=nothing

%>
</table>

<TABLE borderColor=#000000 cellSpacing=0 cellPadding=0 width=950 align=center bgColor=#000000 border=0>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><TABLE borderColor=#000000 cellSpacing=2 cellPadding=1 width=100% align=center bgColor=#000000 border=1>
<tr align="center" borderColor=#333333 bgColor=#000000>
<td background="images/top_2.jpg">
<%hx.showPageInfo "Qzonev_Com_Link","username",condition,PageNo,MaxPageSize,linkstr%>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>



<%end sub%>
<%sub BatchDelform%>
<TABLE borderColor=#000000 cellSpacing=2 cellPadding=1 width=950 align=center bgColor=#000000 border=1>
<tr borderColor=#333333 bgColor=#000000> 
<td><div align="center"><form name="form1" method="post" action="?action=BatchDelWeb">
删除初始化后 <input name="daynum" type="text" value="30" size="3" maxlength="4" class='inbox03'> 天内总票数小于 
<input name="hitsnum" type="text" id="hitsnum" value="1" size="3" maxlength="4" class='inbox03'> 的空间 <input type="submit" name="Submit" value="删除" class='ann0'>
</form></div></td>

<td><div align="center"><form name="form1" method="post" action="?action=BatchDelLog">
删除风云榜内 <input name="daynum" type="text" value="0" size="3" maxlength="4" class='inbox03'>
天前的[投票记录]及[被踩记录] <input type="submit" name="Submit" value="删除" class='ann0'>
</form></div></td>

</tr>

</table>
<%
Call GoBack
end sub

sub dellink
dim username
username=hx.checkstr(request("username"),12)
hx.execute("delete from Qzonev_Com_Link where username='"&username&"'")
response.write "<script>alert('友情提示!\n\n完成删除操作!');history.back();</script>"
Call GoBack
end sub

sub init
dim username
username=hx.checkstr(request("username"),12)
if username="" then
hx.execute("update Qzonev_Com_Link set outc=0,outj=0,inc=0,inj=0,fromdate=date(),indate=date()")
response.write "<p align=center>初始化完毕!所有数据已清零,从今天起开始重新统计!</p>"
else
hx.execute("update Qzonev_Com_Link set inc=0,inj=0,outc=0,outj=0,fromdate=date(),indate=date() where username='"&username&"'")
response.write "<p align=center>"&username&"的空间初始化完毕!所有数据已清零,从今天起开始重新统计!</p>"
end if
Call GoBack
end sub

sub BatchDelWeb
dim rs,daynum,hitsnum,TotalCount
daynum=request.form("daynum")
hitsnum=request.form("hitsnum")
'容错判断
if daynum="" or not isnumeric(daynum) then daynum=30
if hitsnum="" or not isnumeric(hitsnum) then hitsnum=1
'开始删除
set rs=hx.execute("select count(*) from Qzonev_Com_Link where fromdate<"&SqlNowString&"-"&daynum&" and inc<"&hitsnum)
TotalCount=rs(0)
set rs=nothing
if TotalCount>0 then
hx.execute("delete from Qzonev_Com_Link where fromdate<"&SqlNowString&"-"&daynum&" and inc<"&hitsnum)
response.write "成功删除了" & TotalCount &"个空间"
else
response.write "暂时没有符合删除条件的空间"
end if
Call GoBack
end sub

sub BatchDelLog
dim rs,daynum,TotalCount
daynum=request.form("daynum")
'容错判断
if daynum="" or not isnumeric(daynum) then daynum=15
'开始删除
set rs=hx.execute("select count(*) from Qzonev_Com_Log where dateandtime<"&SqlNowString&"-"&daynum)
TotalCount=rs(0)
set rs=nothing
if TotalCount>0 then
hx.execute("delete from Qzonev_Com_Log where dateandtime<"&SqlNowString&"-"&daynum)
response.write "成功删除了" & TotalCount &"条记录"
else
response.write "暂时没有符合删除条件的记录"
end if
Call GoBack
end sub

sub ShowLog
dim rs,sql
dim inout
dim username
dim strtitle
username=hx.checkstr(request.QueryString("username"),12)
inout=request.QueryString("inout")
if inout="0" then
strtitle="点入记录(你站对我站的贡献)"
elseif inout="1" then
strtitle="点出记录(我站对你站的贡献)"
else
strtitle="投票以及踩出记录"
end if

dim PageNo
PageNo=Request.QueryString("PageNo")
if PageNo="" or not isnumeric(PageNo) then
PageNo=1
else
PageNo=int(PageNo)
end if
dim condition,linkstr
if username="" then
if inout="" then
condition=""
linkstr="action=ShowLog"
else
condition="where inout="&inout
linkstr="action=ShowLog&inout="&inout
end if
else
strtitle= "<a href=admin_editlink.asp?username="&username&" title='查看"&username&"的空间资料'>"&username&"</a>的空间的" & strtitle
if inout="" then
condition="where username='"&username&"'"
linkstr="action=ShowLog&username="&username
else
condition="where inout="&inout &" and username='"&username&"'"
linkstr="action=ShowLog&inout="&inout &"&username="&username
end if
end if
if inout<>"" then

end if
%>
<TABLE borderColor=#000000 cellSpacing=2 cellPadding=1 width=950 align=center bgColor=#000000 border=1>
<tr borderColor=#333333 bgColor=#000000> 
<td><div align="center"><%=strtitle%></div></td>
</tr>

<%
if username="" and inout="" then
set rs = hx.execute("select count(inout) from Qzonev_Com_Log where Datediff('d',dateandtime,date())=0 and inout=0")
response.write "<tr borderColor=#333333 bgColor=#000000> <div align=center>今天总计投票:" & rs(0)
set rs = nothing
set rs = hx.execute("select count(inout) from Qzonev_Com_Log where Datediff('d',dateandtime,date())=0 and inout=1")
response.write " 今天总计踩出:" & rs(0) & "</div></tr></table>"
set rs = nothing
end if%>
<TABLE borderColor=#000000 cellSpacing=2 cellPadding=1 width=950 align=center bgColor=#000000 border=1>
<tr borderColor=#333333 bgColor=#000000> 
<tr align="center" borderColor=#333333 bgColor=#000000> 
<%if username="" then response.write "<td width=60 background=images/top_2.jpg>用户名</td>"
if inout="" then response.write "<td width=30 align=center background=images/top_2.jpg>状态</td>"
%>
<td width="120" background=images/top_2.jpg>时间</td>
<td width="100" background=images/top_2.jpg>IP地址</td>
</tr>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from Qzonev_Com_Log "&condition&" order by id desc"
rs.open sql,conn,1,1
if rs.eof then
Response.write "<tr><td colspan=4 align=center>暂时还没有记录</td></tr>"
else
rs.PageSize = MaxPageSize
rs.AbsolutePage = PageNo 
dim i
i=0 
do while not rs.eof and i<MaxPageSize
%>
<tr style="word-break:break-all;Width:fixed">
<%if username="" then response.write "<td><a href=?action=ShowLog&username="&rs("username")&">"&rs("username")&"</a></td>"
if inout="" then
response.write "<td width=30 align=center>"
response.write "<a href=?action=ShowLog&username="&username&"&inout="&rs("inout")&">"
if rs("inout")=0 then
response.write "<font color=#FF0000>投票</font>"
else
response.write "<font color=#99FF00>踩出</font>"
end if
response.write "</a>"
response.write "</td>"
end if
 %>
<td><%=rs("dateandtime")%></td>
<td><%=""&rs("ip")&""%></td>
</tr>
<%
i=i+1
rs.movenext
loop
end if
set rs=nothing%>
</table>
<p align=center>
<%hx.showPageInfo "Qzonev_Com_Log","id",condition,PageNo,MaxPageSize,linkstr%>
</p>

<%
Call GoBack
end sub%>
<%
Sub Compact
Response.Write CompactDB(Server.Mappath(db),false)
Response.write "<p align=center><< <a href=javascript:history.go(-1)>返回上一页</a></p>"
End Sub
'=====================压缩参数=========================
Function CompactDB(dbPath, boolIs97)
On Error Resume Next
Dim fso, Engine, strDBPath,JET_3X
strDBPath = left(dbPath,instrrev(DBPath,"\"))
Set fso = CreateObject("Scripting.FileSystemObject")
If Err Then
Err.Clear
CompactDB = "您当前操作的目录不支持FSO,请手动进行压缩数据库操作!" & vbCrLf
Exit Function
End If
If fso.FileExists(dbPath) Then
fso.CopyFile dbpath,strDBPath & "temp.mdb"
Set Engine = CreateObject("JRO.JetEngine")

If boolIs97 = "True" Then
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb", _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp1.mdb;" _
& "Jet OLEDB:Engine Type=" & JET_3X
Else
Engine.CompactDatabase "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp.mdb", _
"Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & strDBPath & "temp1.mdb"
End If

fso.CopyFile strDBPath & "temp1.mdb",dbpath
fso.DeleteFile(strDBPath & "temp.mdb")
fso.DeleteFile(strDBPath & "temp1.mdb")
Set fso = Nothing
Set Engine = Nothing
CompactDB = "你的数据库, " & dbpath & ", 已经压缩成功!" & vbCrLf
Else
CompactDB = "数据库名称或路径不正确. 请重试!" & vbCrLf
End If
End Function

Sub ClearCache
response.write "<p align=center>删除本系统缓存成功</p>"
hxcache.DelCahe("js")
Call GoBack
End Sub

Sub Summary
dim rs
dim TotalSite,TotalSite1,Totalinc,Totaloutc,Totalinj,Totaloutj
TotalSite = hx.execute("select count(0) from Qzonev_Com_Link")(0)
TotalSite1 = hx.execute("select count(0) from Qzonev_Com_Link where inc > 0")(0)
set rs = hx.execute("select sum(inc),sum(outc) from Qzonev_Com_Link")
Totalinc = rs(0)
Totaloutc = rs(1)
set rs =nothing
set rs = hx.execute("select sum(inj),sum(outj) from Qzonev_Com_Link")
Totalinj = rs(0)
Totaloutj = rs(1)
set rs =nothing
Response.Write "<TABLE borderColor=#000000 cellSpacing=2 cellPadding=1 width=950 align=center bgColor=#000000 border=1><tr borderColor=#333333 bgColor=#1D1D1D align=center>"
response.write "<td>注册用户:<FONT color=#FFFF99>"&TotalSite
response.write "</FONT></td><td>有效用户:<FONT color=#FFFF99>"&TotalSite1
response.write "</FONT></td><td>总计投票:<FONT color=#FFFF99>"&Totalinc
response.write "</FONT></td><td>总计踩出:<FONT color=#FFFF99>"&Totaloutc
response.write "</FONT></td><td>今天投票:<FONT color=#FFFF99>"&Totalinj
response.write "</FONT></td><td>今天踩出:<FONT color=#FFFF99>"&Totaloutj
response.write "</FONT></td>"
'Call GoBack
End Sub

Sub GoBack
Response.Write "<p align=center><< <a href='javascript:history.go(-1)'>返回上一页</a></p>"
Response.Write "</tr></TABLE>"
End Sub
%>
</td>
</tr>
</table> 
<%CloseDatabase%><!--#include file="under.asp"-->
</body>
</html>