📄 affiche_admin.asp
字号:
<!--#include file="admin.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/admin.css" rel="stylesheet" type="text/css">
<script language=javascript src="inc/select.js"></script>
</head>
<body>
<%
select case Request("menu")
case ""
affichelist
case "addaffiche"
addaffiche
case "addafficheok"
sql="select * from affiche"
rs.Open sql,Conn,1,3
rs.addnew
rs("title")=Request.form("title")
rs("content")=Request("content")
rs.update
rs.close
Response.redirect "affiche_admin.asp"
case "delaffiche"
chk_admin_login(3)
id=request("id")
if ID="" then
Response.Write "<br><li>请指定要删除的对象</li>"
end if
if instr(ID,",")>0 then
ID=replace(ID," ","")
sql="delete from [affiche] where id in (" & ID & ")"
else
sql="delete from [affiche] where id=" & Clng(ID)
end if
Conn.Execute sql
response.redirect "affiche_admin.asp"
case "editaffiche"
chk_admin_login(2)
id=request("id")
sql="select * from [affiche] where id="&id&""
rs.Open sql,Conn,1,3
editaffiche
case "editafficheok"
id=request.form("id")
sql="select * from [affiche] where id="&id&""
rs.Open sql,Conn,1,3
rs("title")=Request.form("title")
rs("content")=Request("content")
rs.update
rs.close
Response.redirect "affiche_admin.asp"
end select
sub affichelist
%>
<a href="?menu=addaffiche">发布公告</a><br>
<table border="0" cellpadding="5" cellspacing="1" class=a2 width=97%>
<tr>
<td width="5%" align="center" height="25" class=a1>ID</td>
<td width="35%" align="center" height="25" class=a1>标题</td>
<td width="15%" align="center" height="25" class=a1>发布时间</td>
<td width="15%" align="center" height="25" class=a1>管理</td>
</tr>
<%
sql="select * from [affiche] order by posttime Desc"
rs.Open sql,Conn,1
pagesetup=20 '设定每页的显示数量
rs.pagesize=pagesetup
TotalPage=rs.pagecount '总页数
PageCount = cint(Request.QueryString("ToPage"))
if PageCount <1 then PageCount = 1
if PageCount > TotalPage then PageCount = TotalPage
if TotalPage>0 then rs.absolutepage=PageCount '跳转到指定页数
i=0
%>
<form action="?menu=delaffiche" method="post" onSubmit="return Confirm()">
<%
Do While Not RS.EOF and i<pagesetup
i=i+1
if j mod 2 = 0 then
a="a3"
else
a="a4"
end if
%>
<tr class="<%=a%>">
<td height="25" align="center"><input name='id' type='checkbox' value='<%=cstr(rs("id"))%>'>
<td height="25"><%=rs("title")%>
<td height="25" align="center"><%=rs("posttime")%>
<td height="25" align="center"><a href="?menu=editaffiche&id=<%=rs("id")%>">修改</a></td>
</tr>
<%
j=j+1
RS.MoveNext
loop
RS.Close
%>
<tr class="a4">
<td height="25" colspan="4" align="center" bgcolor="FFFFFF"><input name=chkall type=checkbox id="chkall" onclick=CheckAll(this.form) value="ON">
全选
<input name="Submit" type="submit" id="Submit" value=" 删 除 "></tr>
</form>
</table>
[<b>共有
<font color="990000"><%=TotalPage%></font> 页
<script>
ShowPage(<%=TotalPage%>,<%=PageCount%>,"")
</script>
</b>]
<%
end sub
sub addaffiche
%>
<table cellspacing="1" cellpadding="4" width="90%" border="0" class="a2" align="center">
<form name="coolform" method="post" action="?menu=addafficheok" onSubmit="return CheckForm(this);">
<input name="content" type="hidden">
<tr height=25>
<td class=a1 align=middle colspan=2>发布公告</td>
</tr>
<tr height=25 class=a3 >
<td align=middle width="16%">
标题:</td>
<td width="82%">
<input type="text" name="title" size="60"></td></tr>
<tr height=25 class=a4 >
<td width="16%" height="25" align=middle>
内容:</td>
<td width="82%" height="250"><SCRIPT src="inc/post.js"></SCRIPT> </td>
</tr>
<tr align="center" height=25 class=a3 >
<td colspan=2>
<input type="submit" value=" 发 送 " name=EditSubmit>
<input name="reset" type="reset" value=" 取 消 " onClick="javascript:history.back()"></td>
</tr></form></table>
<%
end sub
sub editaffiche
%>
<table cellspacing="1" cellpadding="4" width="90%" border="0" class="a2" align="center">
<form name="coolform" method="post" action="?menu=editafficheok" onSubmit="return CheckForm(this);">
<input type="hidden" name="id"" value="<%=id%>">
<input name="content" type="hidden" value='<%=rs("content")%>'>
<tr height=25>
<td class=a1 align=middle colspan=2>修改公告</td>
</tr>
<tr height=25 class=a3 >
<td class=a3 align=middle width="16%">
标题:</td>
<td width="82%">
<input type="text" name="title" size="60" value=<%=rs("title")%>></td></tr>
<tr height=25 class=a4>
<td width="16%" height="25" align=middle>
内容:</td>
<td width="82%" height="250"><SCRIPT src="inc/post.js"></SCRIPT></td>
</tr>
<tr align="center" height=25 class=a3 >
<td colspan=2>
<input type="submit" value=" 发 送 " name=EditSubmit>
<input name="reset2" type="reset" value=" 取 消 " onClick="javascript:history.back()"></td>
</tr></form></table>
<%
end sub
%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -