📄 article_up.asp
字号:
<%
if session("admin")="" then
response.redirect "admin.asp"
else
if session("flag")>2 then
response.write "<br><p align=center>您没有操作的权限</p>"
response.end
end if
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>文章列表</title>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<link rel="stylesheet" type="text/css" href="style.css">
</head>
<!--#include file="conn.asp"-->
<%
const MaxPerPage=18
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim idlist
dim title
title=request("txtitle")
sort=request("sort")
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
'开始审核操作
if request("action")="shen" then
id=request("id")
sql="Select syxs,dateandtime from learning where articleid=" & id
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open sql,conn,1,2
rs("syxs")=1
rs("dateandtime")=now()
rs.update
rs.Close
set rs=Nothing
url="article_up.asp?page=" & currentPage & "&sort=" &sort
response.redirect url
response.end
end if
'否决审核操作
if request("action")="fou" then
id=request("id")
sql="Select * from learning where articleid=" & id
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open sql,conn,1,2
rs("syxs")=0
rs.update
rs.Close
set rs=Nothing
url="article_up.asp?page=" & currentPage & "&sort=" &sort
response.redirect url
response.end
end if
'精品操作
if request("action")="jtj" then
id=request("id")
sql="Select * from learning where articleid=" & id
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open sql,conn,1,2
rs("syxs")=5
rs.update
rs.Close
set rs=Nothing
url="article_up.asp?page=" & currentPage & "&sort=" &sort
response.redirect url
response.end
end if
'否精品操作
if request("action")="yjtj" then
id=request("id")
sql="Select * from learning where articleid=" & id
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open sql,conn,1,2
rs("syxs")=6
rs.update
rs.Close
set rs=Nothing
url="article_up.asp?page=" & currentPage & "&sort=" &sort
response.redirect url
response.end
end if
'删除操作
if not isempty(request("selAnnounce")) then
idlist=request("selAnnounce")
if instr(idlist,",")>0 then
dim idarr
idArr=split(idlist)
dim id
for i = 0 to ubound(idarr)
id=clng(idarr(i))
call deleteannounce(id)
next
else
call deleteannounce(clng(idlist))
end if
end if
dim sql
dim rs
%>
<body leftmargin="0" topmargin="0">
<table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" class="border">
<tr background="images/bg.gif"> <td class="topbg" height="22" colspan="2" align="center"><b>文
章 管 理</b></td></tr> <tr> <td class="tdbg" width="70" height="30"><b>管理导航:</b></td>
<td class="tdbg" height="30"> <a href="article_up.asp">管理首页</a> | <a href="article_add.asp">添加文章</a> | <a href="article_up.asp">查看未审核</a></td>
</tr>
</table><table border="0" width="100%" cellspacing="0" cellpadding="0">
<tr> <td width="100%">
<form method=Post action="article_up.asp"> <table width="100%" border="0" cellspacing="0" cellpadding="3">
<tr> <td width="58%" valign="bottom"> <%
if title<>"" and sort="" then
sql="select * from learning where title like '%"&trim(title)&"%' and syxs=0 order by articleid desc"
elseif sort="" and title="" then
sql="select * from learning where syxs=0 order by articleid desc"
elseif sort<>"" and title="" then
sql="select * from learning where sort='"&sort&"' and syxs=0 order by articleid desc"
end if
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'> 还 没 有 任 何 文 章 <br><br><a href='javascript:history.go(-1)'><font color=#FF0000>返回上页</font></a></p>"
else
totalPut=rs.recordcount
ye=totalPut/MaxPerPage
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,"article_up.asp"
showContent
showpage totalput,MaxPerPage,"article_up.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,"article_up.asp"
showContent
showpage totalput,MaxPerPage,"article_up.asp"
else
currentPage=1
showpage totalput,MaxPerPage,"article_up.asp"
showContent
showpage totalput,MaxPerPage,"article_up.asp"
end if
end if
rs.close
end if
set rs=nothing
conn.close
set conn=nothing
sub showContent
dim i
i=0
%> </td><td width="29%" valign="middle"> <font color="#FF0000">查找文章</font>:
<input class=smallInput type="text" name="txtitle" size="13"> <input class=buttonface type="submit" value="查 询" name="title">
</td><td width="13%" valign="middle" align="center"> <select onChange="if(this.options[this.selectedIndex].value!=''){location=this.options[this.selectedIndex].value;}" name="select" >
<option selected>分类查看</option> <option value=article_up.asp>全部分类</option> <%
dim rsss,sqlss
set rsss=server.createobject("adodb.recordset")
sqlss="select * from sort"
rsss.open sqlss,conn,1,1
if rsss.eof and rsss.bof then
response.write "Not record."
else
do while not rsss.eof%> <option value=article_up.asp?sort=<%=rsss("sort")%>><%=rsss("sort")%></option>
<%
rsss.movenext
loop
end if
rsss.close
set rsss=nothing
%> </select> </td></tr> </table><table border="0" cellspacing="1" width="100%" cellpadding="2" class="border">
<tr> <td width="80" align="center" class="title" height="20"><strong>ID</strong></td><td align="center" class="title" width="597"><strong>文章名/分类</strong></td><td width="183" align="center" class="title"><b>审核</b></td>
<td width="138" align="center" class="title">
<input type='submit' class=buttonface value='删 除'> </td></tr> <%do while not rs.eof%>
<tr> <td height="23" class="tdbg" align="center" width="80"> <%=rs("articleid")%>
</td><td class="tdbg" width="597"> <li><a href="article_edit1.asp?id=<%=rs("articleid")%>&sort=<%=rs("sort")%>">[<%=rs("sort")%>]
<%=rs("title")%></a></td><td width="183" class="tdbg" align="center">
<%if rs("syxs")=0 then
response.write "<a href='article_up.asp?page="&CurrentPage&"&id="&rs("articleid")&"&action=shen'>审核</a>"
else
response.write "<a href='article_up.asp?page="&CurrentPage&"&id="&rs("articleid")&"&action=fou'><font color=#FF0000>审核</font></a>"
end if%></td>
<td width="138" class="tdbg" align="center">
<p> <input type='checkbox' name='selAnnounce' value='<%=cstr(rs("articleID"))%>'>
</td></tr> <%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%> </table><div align="right"><br> <TABLE WIDTH="98%" BORDER="0" CELLSPACING="3" CELLPADDING="0"><TR><TD ALIGN="RIGHT" WIDTH="79%" VALIGN="BOTTOM"><%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<font color='#000000'> 页次:</font><strong><font color=red>"&CurrentPage&"</font><font color='#000000'>/"&n&"</strong>页</font> "
response.write "<font color='#000000'> 共<b><font color=red>"&totalnumber&"</font></b>篇文章 <b>"&maxperpage&"</b>篇文章/页</font> "
if CurrentPage<2 then
response.write "<font color='#000000'>首页 上一页</font> "
else
response.write "<a href="&filename&"?page=1&sort="&sort&">首页</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&"&sort="&sort&">上一页</a> "
end if
if n-currentpage<1 then
response.write "<font color='#000000'>下一页 尾页</font>"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)&"&sort="&sort&">"
response.write "下一页</a> <a href="&filename&"?page="&n&"&sort="&sort&">尾页</a>"
end if
end function
sub deleteannounce(id)
dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="delete from learning where articleid="&cstr(id)
conn.execute sql
if err.Number<>0 then
err.clear
response.write "删 除 失 败 !<br>"
else
response.write "操作成功!<br>"
end if
End sub
%></TD><TD WIDTH="21%"> 直接到第 <SELECT NAME="page"><%for ii=1 to ye%><OPTION VALUE="<%=ii%>"><%=ii%></OPTION><%next%></SELECT>
页 <INPUT TYPE="submit" NAME="go" VALUE="Go"> <INPUT TYPE="hidden" NAME="sort" VALUE=<%=sort%>>
</TD></TR></TABLE></div></form></td></tr> </table>
<br>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -