📄 dqe_class.asp
字号:
<!--#include file="DQE_Conn.asp"-->
<!--#include file="check.asp"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>欢迎使用星旧新闻管理系统1.0</title>
<style type="text/css">
<!--
body {
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
SCROLLBAR-FACE-COLOR: #8F6DC4;
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 #636EA2;
}
.heisefont {
font-size: 12px;
color: #000000;
}
.baisefont {
font-size: 12px;
color: #ffffff;
}
input,select,Textarea{background-color: #FFFFFF; border: 1px solid #636EA2; color: #636EA2; font-family:Verdana, Arial,宋体; font-size: 9pt; line-height: 14px;}
.style2 {
color: #FFFFFF;
font-weight: bold;
}
.style6 {color: #333333; font-weight: bold; }
-->
</style>
</head>
<!-- 董祁恩制作 -->
<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> <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> <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 DQE_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 DQE_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 DQE_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
conn,close
response.redirect ThisFileName&"?Result=添加子类成功!"
End If
If Action="DelBigClass" then
Set Rs=Server.CreateObject("Adodb.RecordSet")
Sql="Select * From DQE_BigClass Where BigClassID="&Request("ID")
rs.open sql,conn,1,3
if not rs.EOF then
rs.Delete
end if
conn.Close
rs.close
Set Rs=Server.CreateObject("Adodb.RecordSet")
Sql="Select * From DQE_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="Select * From DQE_Pinglun Where NewsID="&Rs("ID")
rs_Pinglun.open sql_Pinglun,conn,1,3
if not rs.EOF then
rs.Delete
end if
conn.Close
rs.MoveNext
Next
rs.close
Set Rs=Server.CreateObject("Adodb.RecordSet")
Sql="Select * From DQE_SmallClass Where ForBigClassID="&Request("ID")
rs.open sql,conn,1,3
if not rs.EOF then
rs.Delete
end if
conn.Close
rs.close
Set Rs=Server.CreateObject("Adodb.RecordSet")
Sql="Select * From DQE_News Where BigClassID="&Request("ID")
rs.open sql,conn,1,3
rs.Delete
conn.Close
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 DQE_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 DQE_BigClass Where BigClassID="&Request("ID")
rs.open sql,conn,1,3
rs("BigClassName")=Request("TheClassName")
rs("BigClassURL")=Request("TheClassURL")
rs.update
rs.close
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -