?? 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 + -