📄 productcheck.asp
字号:
<%@language=vbscript codepage=936 %>
<!--#include file="conn.asp"-->
<!--#include file="admin.asp"-->
<!--#include file="Inc/Function.asp"-->
<!--#include file="Inc/admin_code_product.asp"-->
<%
dim strFileName
const MaxPerPage=20
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
dim ID
dim Title
dim arrClassID
strFileName="ProductCheck.asp"
Passed=trim(request("Passed"))
ClassID=Trim(request("ClassID"))
keyword=trim(request("keyword"))
strField=trim(request("Field"))
if Passed="" then
if Session("Passed")="" then
Passed="False"
else
Passed=Session("Passed")
end if
end if
session("Passed")=Passed
Title=Trim(request("Title"))
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
dim sql
dim rs
sql="select * from 0791idc_Product where Passed=" & Passed
if Title<>"" then
sql=sql & " and title like '%" & Title & "%' "
end if
if len(ClassID)>0 then
sqlClass="select RootID,ParentID,ParentPath From 0791idc_ProductClass"
sqlClass=sqlClass & " where ClassID=" & ClassID
set tClass=conn.execute(sqlClass)
if tClass.bof and tClass.eof then
FoundErr=True
ErrMsg=ErrMsg & "<br><li>找不到指定的类别</li>"
else
RootID=tClass(0)
ParentID=tClass(1)
ParentPath=tClass(2)
end if
tClass.close
arrClassID=ClassID
if RootID>0 then
set trs=conn.execute("select ClassID from 0791idc_ProductClass where RootID=" & RootID & " and Child=0 " )
end if
if not trs.eof then
do while not trs.eof
arrClassID=arrClassID & "," & trs(0)
trs.movenext
loop
trs.close
sql=sql & " and ClassID in (" & arrClassID & ")"
else
sql=sql & " and ClassID=" & ClassID
end if
end if
sql=sql & " order by ID 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>
<!-- #include file="Inc/Head.asp" -->
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="862" align="center" valign="top"> <br> <p align="center"><strong>产
品 审 核</strong></p>
<form name="Passed" method="Get" action="ProductCheck.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%>">
</div>
</form>
<table width="620" border="0" align="center" cellpadding="5" cellspacing="2" bgcolor="#000000" class="border">
<tr class="title">
<td height="25" bgcolor="A4B6D7">|
<%call Admin_ShowRootClass()%>
</td>
</tr>
</table>
<form action="ProductCheckSet.asp" method="Post" name="Check" id="Check">
<table width="620" height="22" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000">
<tr>
<td width="453" height="22" bgcolor="A4B6D7"><%
if Title="" 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
end if
end if
response.Write(" >> ")
call Admin_ShowPath("产品管理")
%>
</td>
<td width="161" bgcolor="#A4B6D7">
<%
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 width="620" border="0" cellpadding="0" cellspacing="1" bgcolor="#000000" class="border" style="word-break:break-all">
<tr bgcolor="#A4B6D7" class="title">
<td width="30" height="25" align="center"><strong>选择</strong></td>
<td width="37" height="20" align="center"><strong>ID</strong></td>
<td width="317" align="center" bgcolor="#A4B6D7" ><strong>产品名称</strong></td>
<td width="63" align="center" ><strong>加入时间</strong></td>
<td width="57" align="center" ><strong>点击数</strong></td>
<td width="40" align="center" ><strong>已审核</strong></td>
<td width="60" align="center" ><strong>操作</strong></td>
</tr>
<%do while not rs.eof%>
<tr class="tdbg">
<td width="30" height="22" align="center" bgcolor="#A4B6D7">
<input name='ID' type='checkbox' onClick="unselectall()" id="ID" value='<%=cstr(rs("ID"))%>'>
</td>
<td width="37" align="center" bgcolor="#ECF5FF"><%=rs("ID")%></td>
<td bgcolor="#ECF5FF"> <a href="../ProductShow.asp?ID=<%=rs("ID")%>" title="<%=replace(left(rs("Content"),200),chr(34),"") & "……"%>"> <%=rs("title")%></a></td>
<td width="63" align="center" bgcolor="#ECF5FF"><%= FormatDateTime(rs("UpdateTime"),2) %></td>
<td width="57" align="center" bgcolor="#ECF5FF"><%=rs("Hits")%> </td>
<td width="40" align="center" bgcolor="#ECF5FF">
<%if rs("Passed")=true then response.write "是" else response.write "否" end if%> </td>
<td width="60" align="center" bgcolor="#ECF5FF">
<%
If rs("Passed")=False Then %> <a href="ProductCheckSet.asp?Action=Check&ID=<%=rs("ID")%>">通过审核</a>
<% Else %> <a href="ProductCheckSet.asp?Action=CancelCheck&ID=<%=rs("ID")%>">取消通过</a>
<%
End If
%> </td>
</tr>
<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
<table width="620" border="0" cellpadding="0" cellspacing="0">
<tr>
<td width="250" height="30"><input name="chkAll" type="checkbox" id="chkAll" onclick=CheckAll(this.form) value="checkbox">
选中本页显示的所有产品</td>
<td><input name="submit" type='submit' value="<%if Passed="True" then response.write "取消"%>审核选定的产品">
<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="620" class="border">
<tr class="tdbg">
<form name="searchsoft" method="get" action="ProductCheck.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>
<!-- #include file="Inc/Foot.asp" -->
<%
rs.close
set rs=nothing
call CloseConn()
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -