?? articlecheck.asp
字號:
<%@language=vbscript codepage=936 %>
<!--#include file="Admin.asp"-->
<!--#include file="Conndb.asp"-->
<!--#include file="../Inc/Ubbcode.asp"-->
<!--#include file="Inc/Function.asp"-->
<%
dim strFileName
const MaxPerPage=20
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim ArticleID
dim Title
dim BigClassName,SmallClassName,SpecialName
dim Passed
dim PurviewChecked
dim strAdmin,arrAdmin
PurviewChecked=false
Passed=trim(request("Passed"))
strFileName="ArticleCheck.asp?BigClassName=" & BigClassName & "&SmallClassName=" & SmallClassName & "&SpecialName=" & SpecialName
if Passed="" then
if Session("Passed")="" then
Passed="False"
else
Passed=Session("Passed")
end if
end if
session("Passed")=Passed
Title=Trim(request("Title"))
ArticleID=Request("ArticleID")
BigClassName=Trim(request("BigClassName"))
SmallClassName=Trim(request("SmallClassName"))
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
dim sql
dim rs
sql="select * from Product where Passed=" & Passed
if Title<>"" then
sql=sql & " and title like '%" & Title & "%' "
else
if BigClassName<>"" then
sql=sql & " and BigClassName='" & BigClassName & "' "
if SmallClassName<>"" then
sql=sql & " and SmallClassName='" & SmallClassName & "' "
end if
else
if SpecialName<>"" then
sql=sql & " and SpecialName='" & SpecialName & "' "
end if
end if
end if
sql=sql & " order by articleid desc"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
%>
<SCRIPT language=javascript>
function unselectall()
{
if(document.Check.chkAll.checked){
document.Check.chkAll.checked = document.Check.chkAll.checked&0;
}
}
function CheckAll(form)
{
for (var i=0;i<form.elements.length;i++)
{
var e = form.elements[i];
if (e.Name != "chkAll")
e.checked = form.chkAll.checked;
}
}
</SCRIPT>
<html>
<head>
<title>審核管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="Admin_Style.css" rel="stylesheet" type="text/css">
</head>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="862" align="center" valign="top" bgcolor="#FFFFFF">
<br>
<strong>產 品 審 核</strong><form name="Passed" method="Get" action="ArticleCheck.asp">
<div align="center"><strong>產品選項:</strong>
<input name="Passed" type="radio" value="False" onclick="submit();" <%if Passed="False" then response.write " checked"%>>
未審核的產品
<input name="Passed" type="radio" value="True" onclick="submit();" <%if Passed="True" then response.write " checked"%>>
已審核的產品
<input name="BigClassName" type="hidden" id="BigClassName" value="<%=BigClassName%>">
<input name="SmallClassName" type="hidden" id="SmallClassName" value="<%=SmallClassName%>">
<input name="SpecialName" type="hidden" id="SpecialName" value="<%=SpecialName%>">
</div>
</form>
<table width="680" border="0" align="center" cellpadding="5" cellspacing="2" class="border">
<tr class="title">
<td height="25" bgcolor="#E1F4EE">|
<%
dim sqlBigClass,sqlSmallClass,rsBigClass,rsSmallClass,sqlSpecial,rsSpecial
sqlBigClass="select * from BigClass"
Set rsBigClass= Server.CreateObject("ADODB.Recordset")
rsBigClass.open sqlBigClass,conn,1,1
if rsBigClass.eof then
response.Write("還沒有任何類別,請首先添加類別。")
end if
do while not rsBigClass.eof
if rsBigClass("BigClassName")=BigClassName then
response.Write("<a href='ArticleCheck.asp?BigClassName=" & rsBigClass("BigClassName") & "'><font color='red'>" & rsBigClass("BigClassName") & "</font></a> | ")
if session("purview")=3 then
strAdmin=rsBigClass("Admin")
if Instr(strAdmin,"|")>0 then
arrAdmin=split(strAdmin)
for i=0 to ubound(arrAdmin)
if trim(arrAdmin(i))=session("admin") then
PurviewChecked=True
exit for
end if
next
else
if trim(strAdmin)=session("Admin") then
PurviewChecked=True
end if
end if
end if
else
response.Write("<a href='ArticleCheck.asp?BigClassName=" & rsBigClass("BigClassName") & "'>" & rsBigClass("BigClassName") & "</a> | ")
end if
rsBigClass.movenext
loop
rsBigClass.close
set rsBigClass=nothing
%>
</td>
</tr>
<%
if BigClassName<>"" then
sqlSmallClass="select * from SmallClass where BigClassName='" & BigClassName & "'"
Set rsSmallClass= Server.CreateObject("ADODB.Recordset")
rsSmallClass.open sqlSmallClass,conn,1,1
if not (rsSmallClass.bof and rsSmallClass.eof) then
response.write "<tr class='tdbg'><td bgcolor='#CCCCCC'>"
do while not rsSmallClass.eof
if rsSmallClass("SmallClassName")=SmallClassName then
response.Write(" <a href='ArticleCheck.asp?BigClassName=" & rsSmallClass("BigClassName") & "&SmallClassName=" & rsSmallClass("SmallClassName") & "'><font color='red'>" & rsSmallClass("SmallClassName") & "</font></a> ")
if session("purview")=4 then
strAdmin=rsSmallClass("Admin")
if Instr(strAdmin,"|")>0 then
arrAdmin=split(strAdmin)
for i=0 to ubound(arrAdmin)
if trim(arrAdmin(i))=session("admin") then
PurviewChecked=True
exit for
end if
next
else
if trim(strAdmin)=session("Admin") then
PurviewChecked=True
end if
end if
end if
else
response.Write(" <a href='ArticleCheck.asp?BigClassName=" & rsSmallClass("BigClassName") & "&SmallClassName=" & rsSmallClass("SmallClassName") & "'>" & rsSmallClass("SmallClassName") & "</a> ")
end if
rsSmallClass.movenext
loop
response.write "</td></tr>"
end if
rsSmallClass.close
set rsSmallClass=nothing
end if
%>
</table>
<form action="ArticleCheckSet.asp" method="Post" name="Check" id="Check">
<table width="680" height="22" border="0" cellpadding="0" cellspacing="2">
<tr>
<td width="453" height="22" bgcolor="#E1F4EE"><a href="ArticleCheck.asp"> 產品審核</a> >>
<%
if Title="" and BigClassName="" and SmallClassName="" and SpecialName="" then
if Passed="False" then
response.write "所有未審核的產品"
else
response.write "所有已審核的產品"
end if
else
if request("Query")<>"" then
if Title<>"" then
response.write "標題中含有“<font color=blue>" & Title & "</font>”并且未審核的產品"
else
response.Write("所有未審核的產品")
end if
else
if BigClassName<>"" then
response.write "<a href='ArticleCheck.asp?BigClassName=" & BigClassName & "'>" & BigClassName & "</a> >> "
if SmallClassName<>"" then
response.write "<a href='ArticleCheck.asp?BigClassName=" & BigClassName & "&SmallClassName=" & SmallClassName & "'>" & SmallClassName & "</a>"
else
response.write "所有小類"
end if
end if
if SpecialName<>"" then
response.write "<font color=red>[專題]</font> " & SpecialName
end if
end if
end if
%>
</td>
<td width="221" bgcolor="#E1F4EE">
<%
if rs.eof and rs.bof then
response.write "共找到 0 個產品</td></tr></table>"
else
totalPut=rs.recordcount
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
response.Write "共找到 " & totalPut & " 個產品"
%>
</td>
</tr>
</table>
<%
if currentPage=1 then
showContent
showpage strFileName,totalput,MaxPerPage,true,false," 個產品"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage strFileName,totalput,MaxPerPage,true,false," 個產品"
else
currentPage=1
showContent
showpage strFileName,totalput,MaxPerPage,true,false," 個產品"
end if
end if
end if
%>
<%
sub showContent
dim i
i=0
%>
<table class="border" border="0" cellspacing="2" width="678" cellpadding="0" style="word-break:break-all">
<tr bgcolor="#C0C0C0" class="title">
<td width="30" height="25" align="center" bgcolor="#E1F4EE"><strong>選擇</strong></td>
<td width="37" height="20" align="center" style="background-color: #E1F4EE"><strong>ID</strong></td>
<td width="317" align="center" style="background-color: #E1F4EE" ><strong>產品名稱</strong></td>
<td width="63" align="center" style="background-color: #E1F4EE" ><strong>加入時間</strong></td>
<td width="57" align="center" style="background-color: #E1F4EE" ><strong>點擊數</strong></td>
<td width="40" align="center" style="background-color: #E1F4EE" ><strong>已審核</strong></td>
<td width="118" align="center" style="background-color: #E1F4EE" ><strong>操作</strong></td>
</tr>
<%do while not rs.eof%>
<tr class="tdbg">
<td width="30" height="22" align="center">
<input name='ArticleID' type='checkbox' onclick="unselectall()" id="ArticleID2" value='<%=cstr(rs("articleID"))%>'>
</td>
<td width="37" align="center"><%=rs("articleid")%></td>
<td> <a href="../ArticleShow.asp?ArticleID=<%=rs("articleid")%>" title="<%=replace(left(nohtml(rs("Content")),200),chr(34),"") & "……"%>"> <%=rs("title")%></a></td>
<td width="63" align="center"><%= FormatDateTime(rs("UpdateTime"),2) %></td>
<td width="57" align="center"><%=rs("Hits")%>
</td>
<td width="40" align="center">
<%if rs("Passed")=true then response.write "是" else response.write "否" end if%>
</td>
<td width="118" align="center">
<%
if session("purview")<=2 or PurviewChecked=True then
If rs("Passed")=False Then %>
<a href="ArticleCheckSet.asp?Action=Check&ArticleID=<%=rs("ArticleID")%>">通過審核</a>
<% Else %>
<a href="ArticleCheckSet.asp?Action=CancelCheck&ArticleID=<%=rs("ArticleID")%>">取消通過</a>
<%
End If
end if %>
</td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<table width="675" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="250" height="30" bgcolor="#E1F4EE"><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
選中本頁顯示的所有產品</td>
<td bgcolor="#E1F4EE"><input name="submit" type='submit' value="<%if Passed="True" then response.write "取消"%>審核選定的產品" <%if session("purview")>=3 and session("purview")<=4 and PurviewChecked=False then response.write "disabled"%>>
<input name="Action" type="hidden" id="Action" value="<% if Passed="False" then
response.write "Check"
else
response.write "CancelCheck"
end if%>"></td>
</tr>
</table>
<%
end sub
%>
</form>
<table width="679" class="border">
<tr class="tdbg">
<form name="searchsoft" method="get" action="ArticleCheck.asp">
<td height="30"> <strong>查找產品:</strong>
<input name="Title" type="text" class=smallInput id="Title3" size="20">
<input name="Query" type="submit" id="Query" value="查 詢">
請輸入產品名稱。如果為空,則查找所有產品。 </td>
</form>
</tr>
</table></td>
</tr>
</table>
<%
rs.close
set rs=nothing
call CloseConn()
sub CheckArticle(id)
dim sql
sql="update article set Passed = True 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
sub CancelCheckArticle(id)
dim sql
sql="update article set Passed = False 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
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -