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

📄 manage.asp

📁 一个超市管理系统
💻 ASP
字号:
<!-- #include file="setup.asp" -->
<%

if Request.Cookies("username")="" then
response.redirect "login.asp"
end if

sql="select * from user where username='"&HTMLEncode(Request.Cookies("username"))&"'"
rs.Open sql,Conn,1
if Request.Cookies("userpass")<>rs("userpass") then
error("<li>您的密码错误")
end if
if rs("membercode") > 3 then
pass=1
end if
rs.close


id=Request("id")
if isnumeric(""&id&"") = flase then
error("<li>非法操作")
end if
forumid=Conn.Execute("Select forumid From forum where id="&id)(0)


sql="select * from bbsconfig where id="&forumid&""
rs.Open sql,Conn,1
bbsname=rs("bbsname")
if instr(rs("moderated"),"|"&Request.Cookies("username")&"|")>0 then
pass=1
end if
rs.close

if pass<>1 then
error("<li>您的权限不够")
end if




sql="select * from forum where id="&Request("id")&" and forumid="&forumid&""
rs.Open sql,Conn,1,3
sql="select * from user where username='"&HTMLEncode(rs("username"))&"'"
rs1.Open sql,Conn,1,3
select case Request("menu")
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "deltopic"
rs1("deltopic")=rs1("deltopic")+1
rs1.update
rs1.close


conn.execute("update [forum] set deltopic=1,lasttime=now,content=content&'<br><br>[此帖子已被 "&Request.Cookies("username")&" 在 "&now&" 删除过]' where id="&Request("id")&" and forumid="&forumid&" and deltopic=0")
conn.execute("update [bbsconfig] set toltopic=toltopic-1,tolrestore=tolrestore-1 where id="&forumid&"")
succtitle="删除主题成功"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "delretopic"
if isnumeric(""&Request("retopicid")&"") = flase then
error("<li>非法操作")
end if
conn.execute("delete from [reforum] where topicid="&Request("id")&" and forumid="&forumid&" and id="&Request("retopicid")&"")
conn.execute("update [forum] set replies=replies-1 where id="&Request("id")&" and forumid="&forumid&"")
conn.execute("update [bbsconfig] set tolrestore=tolrestore-1 where id="&forumid&"")
succtitle="删除回贴成功"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "toptopic"
conn.execute("update [forum] set toptopic=1 where id="&Request("id")&" and forumid="&forumid&"")
succtitle="置顶主题成功"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "deltoptopic"
conn.execute("update [forum] set toptopic=0 where id="&Request("id")&" and forumid="&forumid&"")
succtitle="取消置顶主题成功"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "goodtopic"
if rs("goodtopic")=1 then
error("<li>此帖子已经加入精华区了,无需重复添加")
end if
rs1("goodtopic")=rs1("goodtopic")+1
rs1("experience")=rs1("experience")+60
rs1("money")=rs1("money")+60
rs1.update
rs1.close
rs("goodtopic")=1
rs.update
rs.close
succtitle="加入精华区成功"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "delgoodtopic"
if rs("goodtopic")=0 then
error("<li>此帖子已经移出精华区了")
end if
rs1("goodtopic")=rs1("goodtopic")-1
rs1("experience")=rs1("experience")-60
rs1("money")=rs1("money")-60
if rs1("money") < 0 then
rs1("money")=0
end if
if rs1("experience") < 0 then
rs1("experience")=0
end if
rs1.update
rs1.close
rs("goodtopic")=0
rs.update
rs.close
succtitle="移出精华区成功"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "locktopic"
conn.execute("update [forum] set locktopic=1 where id="&Request("id")&" and forumid="&forumid&"")
succtitle="关闭主题成功"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "dellocktopic"
conn.execute("update [forum] set locktopic=0 where id="&Request("id")&" and forumid="&forumid&"")
succtitle="开放主题成功"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "movenew"
conn.execute("update [forum] set lasttime=now where id="&Request("id")&" and forumid="&forumid&"")
succtitle="拉前主题成功"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "recommend"
if instr(rs("topic")," <font color=red>(荐)</font>")>0 then
error("<li>此主题已经推荐过了")
end if
rs1("experience")=rs1("experience")+30
rs1("money")=rs1("money")+30
rs1.update
rs1.close
rs("topic")=""&rs("topic")&" <font color=red>(荐)</font>"
rs.update
rs.close
succtitle="推荐主题成功"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "unrecommend"
if instr(rs("topic")," <font color=red>(荐)</font>")=0 then
error("<li>此主题已经取消推荐主题,无需重复取消")
end if
rs1("experience")=rs1("experience")-30
rs1("money")=rs1("money")-30
if rs1("money") < 0 then
rs1("money")=0
end if
if rs1("experience") < 0 then
rs1("experience")=0
end if
rs1.update
rs1.close
rs("topic")=replace(rs("topic")," <font color=red>(荐)</font>","")
rs.update
rs.close
succtitle="取消推荐主题成功"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "move"
if Request("moveid")="" then
error("<li>您没有选择要将主题移动哪个论坛")
end if
rs("forumid")=""&Request("moveid")&""
rs("toptopic")=0
rs("goodtopic")=0
rs("locktopic")=0
rs("lasttime")=now
rs.update
replies=rs("replies")
rs.close
if replies<>0 then
conn.execute("update [reforum] set forumid='"&Request("moveid")&"' where topicid="&Request("id")&" and  forumid="&forumid&"")
end if
succtitle="移动主题成功"
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
case "lookip"
error2(""&rs("username")&"的IP地址:"&rs("postip")&"")
case "lookreip"
rs1.close
sql="select * from reforum where topicid="&Request("id")&" and forumid="&forumid&" and id="&Request("retopicid")&""
rs1.Open sql,Conn
error2(""&rs1("username")&"的IP地址:"&rs1("postip")&"")
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
end select
if succtitle="" then
error("<li>无效命令")
end if
message=message&"<li><a href=ShowForum.asp?forumid="&forumid&">"&bbsname&"</a><li><a href=Default.asp?menu=listtitle>返回论坛首页</a>"
succeed(""&message&"<meta http-equiv=refresh content=3;url=ShowForum.asp?forumid="&forumid&">")
%>

⌨️ 快捷键说明

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