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

📄 ppst_class.asp

📁 系统用户管理为整个新闻发布系统提供了一个权限控制功能
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<!--#include file="PPst_Conn.asp"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>爬爬思特新闻管理系统1.2版 Powered By PaPasite</title>
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	SCROLLBAR-FACE-COLOR: #000000;
	MARGIN: 0px; 
	SCROLLBAR-HIGHLIGHT-COLOR: #EEEEEE;
	SCROLLBAR-SHADOW-COLOR: #EEEEEE;
	SCROLLBAR-3DLIGHT-COLOR: #CCCCCC; 
	SCROLLBAR-ARROW-COLOR: #EEEEEE; 
	SCROLLBAR-TRACK-COLOR: #EEEEEE; 
	SCROLLBAR-DARKSHADOW-COLOR: #CCCCCC; 
	TEXT-DECORATION: none
}
td,th {
	font-size: 12px;
	color: #000000;
}
a:link {
	color: #000000;
	text-decoration: none;
}
a:visited {
	text-decoration: none;
	color: #000000;
}
a:hover {
	text-decoration: underline;
	color: #FF0000;
}
a:active {
	text-decoration: none;
	color: #FF0000;
}
.cuti_baise {
	font-size: 12px;
	color: #FFFFFF;
	font-weight: bold;
}
.cuti_red {
	font-size: 20px;
	color: #FF0000;
	font-weight: bold;
}
.Heitable {
	border: 1px solid #000000;
}
.heisefont {
	font-size: 12px;
	color: #000000;
}
.baisefont {
	font-size: 12px;
	color: #ffffff;
}
input,select,Textarea{background-color: #FFFFFF; border: 1 solid #000000; color: #000000; font-family:Verdana, Arial,宋体; font-size: 9pt; line-height: 14px;}
-->
</style>
</head>
<!-- Powered  By  PaPasite -->
<body>

<%
Dim ID,BigClassName,BigClassURL,ButtonValue
If Action="Login" then
	If Request("UserName")<>UserName or Request("Password")<>UserPwd then
		response.Write "<br><br><br><center>用户名或密码错误...</a></center></body></html>"
		Conn.Close
		response.End()
	Else
		Session("adminLevel")=10
	End If
End If

If Action="Logout" then
	Session("adminLevel")=""
End If

If Session("adminLevel")<>10 then
	response.write "<br><br><br><center><table width=200 border=0 align=center cellpadding=0 cellspacing=1 bgcolor=#000000>"
	response.write "<form action="&ThisFileName&"?Action=Login method=post><tr><td height=20 align=center valign=middle colspan=2 bgcolor=#FFFFFF>后台登陆</td></tr>"
	response.write "<tr><td width=70 align=center valign=middle bgcolor=#FFFFFF>用户名:</td><td align=left valign=middle height=20 bgcolor=#FFFFFF>&nbsp;<input type=Text Name=UserName size=15></td></tr>"
	response.write "<tr><td width=70 align=center valign=middle bgcolor=#FFFFFF>密 码:</td><td align=left valign=middle height=20 bgcolor=#FFFFFF>&nbsp;<input type=PassWord Name=PassWord size=15></td></tr>"
	response.write "<tr><td height=20 align=center valign=middle colspan=2  bgcolor=#FFFFFF><input type=submit name=submit value=""登 陆""></td></tr>"
	response.write "</form></table></center></body></html>"
	Conn.Close
	response.end()
End If

If Action="AddBigClass"then
	If Request("TheClassName")="" then
		response.Write "<br><br><br><center>新闻大类名称不能为空..<br><br><a href="&ThisFileName&">》》返回...</a></center><body><html>"
		Conn.Close
		response.End()
	End If
	
	Set Rs=Server.CreateObject("Adodb.RecordSet")
	Sql="Select * From PPst_BigClass Where BigClassName='"&Request("TheClassName")&"'"
	rs.open sql,conn,1,1
	If Rs.RecordCount<>0 then
		response.Write "<br><br><br><center>你添加了一个相同的大类!!<br><br><a href="&ThisFileName&">》》返回...</a></center></body></html>"
		rs.Close
		Conn.Close
		response.End()
	End If
	rs.Close
	
	Set Rs=Server.CreateObject("Adodb.RecordSet")
	Sql="Select * From PPst_BigClass"
	rs.open sql,conn,1,3
	rs.AddNew
	rs("BigClassName")=Request("TheClassName")
	rs("BigClassURL")=Request("TheClassURL")
	rs.update
	rs.close
	response.redirect ThisFileName&"?Result=添加大类成功!"
End If

ButtonValue="添 加"		'设定按钮的默认值为"添加",

If Action="AddSmallClass"then
	If Request("TheClassName")="" or Request("ID")=""then
		response.Write "<br><br><br><center>新闻子类名称不能为空..或出现其他异常错误。<br><br><a href="&ThisFileName&">》》返回...</a></center><body><html>"
		Conn.Close
		response.End()
	End If

	Set Rs=Server.CreateObject("Adodb.RecordSet")
	Sql="Select * From PPst_SmallClass"
	rs.open sql,conn,1,3
	Rs.AddNew
	rs("SmallClassName")=Request("TheClassName")
	rs("SmallClassURL")=Request("TheClassURL")
	rs("ForBigClassID")=Request("ID")
	rs.update
	rs.close
	response.redirect ThisFileName&"?Result=添加子类成功!"
End If

If Action="DelBigClass" then
	Set Rs=Server.CreateObject("Adodb.RecordSet")
	Sql="Delete * From PPst_BigClass Where BigClassID="&Request("ID")
	rs.open sql,conn,1,3
	rs.close
	
	Set Rs=Server.CreateObject("Adodb.RecordSet")
	Sql="Select * From PPst_News Where BigClassID="&Request("ID")
	rs.open sql,conn,1,1
	For i=0 to rs.RecordCount
		Set Rs_Pinglun=Server.CreateObject("Adodb.RecordSet")
		Sql_Pinglun="Delete * From PPst_Pinglun Where NewsID="&Rs("ID")
		rs_Pinglun.open sql_Pinglun,conn,1,3
		rs_Pinglun.close
	rs.MoveNext
	Next
	rs.close
	
	Set Rs=Server.CreateObject("Adodb.RecordSet")
	Sql="Delete * From PPst_SmallClass Where ForBigClassID="&Request("ID")
	rs.open sql,conn,1,3
	rs.close
	
	Set Rs=Server.CreateObject("Adodb.RecordSet")
	Sql="Delete * From PPst_News Where BigClassID="&Request("ID")
	rs.open sql,conn,1,3
	rs.close
	response.redirect ThisFileName&"?Result=删除大类成功!"
End If

If Action="51EditBigClass" then
	'如果Action="Edit"表示是点了编辑按钮,则表单ID不为空,取出该新闻类别的ID和名字
	'并赋给参数,如ID=rs("ID"),设定表单各项的默认值等于相应参数
	'如果Action="",则表示不是点了编辑按钮,则不进行一下11行程序
	'所以表单各项的默认值等于空了,如ID
	'然后依次作为区别来判断提交的数据是更改还是添加
	'即使表单的Action的值都是Add
	Set Rs=Server.CreateObject("Adodb.RecordSet")
	Sql="Select * From PPst_BigClass Where BigClassID="&Request("ID")
	rs.open sql,conn,1,1
	ID=rs("BigClassID")
	TheClassName=rs("BigClassName")
	TheClassURL=rs("BigClassURL")
	rs.close
	ButtonValue=" 编 辑 "		'当前是新闻编辑状态,重新设定按钮的值为"编 辑"
End If

If Action="EditBigClass" then
	If Request("TheClassName")="" then
		response.Write "<br><br><br><center>新闻大类名称不能为空..<br><br><a href="&ThisFileName&">》》返回...</a></center><body><html>"
		Conn.Close
		response.End()
	End If

	Set Rs=Server.CreateObject("Adodb.RecordSet")
	Sql="Select * From PPst_BigClass Where BigClassID="&Request("ID")
	rs.open sql,conn,1,3
	rs("BigClassName")=Request("TheClassName")
	rs("BigClassURL")=Request("TheClassURL")
	rs.update
	rs.close
	response.redirect ThisFileName&"?Result=编辑大类成功!"
End If

If Action="DelSmallClass" then
	Set Rs=Server.CreateObject("Adodb.RecordSet")
	Sql="Delete * From PPst_SmallClass Where SmallClassID="&Request("ID")
	rs.open sql,conn,1,3
	rs.close
	
	Set Rs=Server.CreateObject("Adodb.RecordSet")
	Sql="Select * From PPst_News Where SmallClassID="&Request("ID")
	rs.open sql,conn,1,1

⌨️ 快捷键说明

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