📄 waitproduct.asp
字号:
<%
if instr(session("EAPurview"),"11")=0 then
response.redirect "../login.asp"
response.end
end if
%>
<%
SortID=trim(request("SortID"))
TypeID=trim(request("TypeID"))
ChildID=trim(request("ChildID"))
if (SortID<>"") and (not IsNumeric(SortID)) then
response.write "<SCRIPT language=JavaScript>alert('对不起,参数有误!');"
response.write "this.location.href='javascript:history.back();'</SCRIPT>"
end if
if (TypeID<>"") and (not IsNumeric(TypeID)) then
response.write "<SCRIPT language=JavaScript>alert('对不起,参数有误!');"
response.write "this.location.href='javascript:history.back();'</SCRIPT>"
end if
if (ChildID<>"") and (not IsNumeric(ChildID)) then
response.write "<SCRIPT language=JavaScript>alert('对不起,参数有误!');"
response.write "this.location.href='javascript:history.back();'</SCRIPT>"
end if
%>
<!--#include file="../../Inc/DBConn1.asp" -->
<LINK href="../../CSS/style.css" rel="stylesheet" type="text/css"></LINK>
<%
if request("action")="yesnom" then
conn.execute("update Product set Flag=1,IsNominate=true where PID=" & request("PID"))
end if
%>
<%
if request("action")="yesaud" then
conn.execute("update Product set Flag=1 where PID=" & request("PID"))
end if
%>
<%
if request("action")="del" then
set rsimage=server.createobject("adodb.recordset")
rsimage.open "select * from Product where PID=" & request("PID"),conn,1,1
if not rsimage.EOF then
if LCase(rsimage("BigPicture"))<>"nopic.jpg" then
strpath="../../Product/Pic/" & rsimage("BigPicture") '大图文件路径
Filename = Server.MapPath(strpath)
Set fs = CreateObject("Scripting.FileSystemObject")
if strpath<>"" then
If fs.FileExists(Filename) Then
fs.DeleteFile(Filename)
end if
end if
end if
if LCase(rsimage("SmallPicture"))<>"nopic.jpg" then
smallpath="../../Product/Pic/" & rsimage("SmallPicture") '小图文件路径
Filenamesmall= Server.MapPath(smallpath)
set smallfs = CreateObject("Scripting.FileSystemObject")
if smallpath<>"" then
if smallfs.FileExists(Filenamesmall) then
fs.DeleteFile(Filenamesmall)
end if
end if
end if
conn.execute("delete from Product where PID=" & request("PID"))
end if
rsimage.Close
Set rsimage=nothing
end if
%>
<center>
<TABLE border="0" cellPadding="0" cellSpacing="0" align="center" width="100%" ID="Table1">
<Form name="Form1" method="POST" action="WaitProduct.asp" ID="Form1">
<TR>
<td>
<IMG align=absmiddle border="0" src="../../images/search.gif">
搜索关键字:<input type="text" name="SearchText" size="16" value="<%=trim(request("SearchText"))%>">
<%
if request("SortID")<>"" and IsNumeric(SortID) then
SortID=Cint(request("SortID"))
else
SortID=0
end if
if request("TypeID")<>"" and IsNumeric(TypeID) then
TypeID=Cint(request("TypeID"))
else
TypeID=0
end if
if request("ChildID")<>"" and IsNumeric(ChildID) then
ChildID=Cint(request("ChildID"))
else
ChildID=0
end if
%>
<%
Dim TypeRs2,TypeStr2,count1
Set TypeRs2=server.CreateObject("ADODB.Recordset")
TypeStr2="select * from Sort2 order by TypeID ASC"
TypeRs2.open TypeStr2,conn,1,1
%>
<script language = "JavaScript">
var onecount1;
onecount1=0;
subcat1 = new Array();
<%
count1 = 0
do while not TypeRs2.eof
%>
subcat1[<%=count1%>] = new Array("<%= trim(TypeRs2("TypeName"))%>","<%= trim(TypeRs2("SortID"))%>","<%= trim(TypeRs2("TypeID"))%>");
<%
count1 = count1 + 1
TypeRs2.movenext
loop
TypeRs2.close
%>
onecount1=<%=count1%>;
function changelocation1(locationid)
{
document.Form1.TypeID.length = 0;
var locationid=locationid;
var i;
document.Form1.TypeID.options[0] = new Option("-行业子类-","");
for (i=0;i < onecount1; i++)
{
if (subcat1[i][1] == locationid)
{
document.Form1.TypeID.options[document.Form1.TypeID.length] = new Option(subcat1[i][0], subcat1[i][2]);
}
}
}
</script>
<%
Set SortRs1=server.CreateObject("ADODB.Recordset")
SortStr1="select * from Sort1 order by SortID ASC"
SortRs1.open SortStr1,conn,1,1
%>
<SELECT name=SortID onChange="javascript:changelocation1(document.Form1.SortID.options[document.Form1.SortID.selectedIndex].value)" size="1" ID="Select3">
<option value="">-行业大类-</option>
<%
while not SortRs1.eof
%>
<option value="<%=SortRs1("SortID")%>" <%if SortRs1("SortID")=SortID then%> selected <%end if%>><%=SortRs1("SortName")%></option>
<%
SortRs1.movenext
wend
%>
</select>
<%
SortRs1.close
Set SortRs1=nothing
%>
<select name="TypeID" ID="Select4">
<option value="">-行业子类-</option>
<%
Set TypeRs3=server.CreateObject("ADODB.recordset")
TypeStr3="select * from Sort2 where SortID="& SortID &" order by TypeID ASC"
TypeRs3.open TypeStr3,conn,1,1
if not(TypeRs3.eof and TypeRs3.bof) then
while not TypeRs3.eof
%>
<option value="<%=TypeRs3("TypeID")%>" <%if TypeRs3("TypeID")=TypeID then%> selected <%end if%>><%=TypeRs3("TypeName")%></option>
<%
TypeRs3.movenext
wend
end if
TypeRs3.close
set TypeRs3 = nothing
%>
</select>
<INPUT align=absmiddle border="0" src="../../images/search1.gif" type="image" ID="Image1" NAME="Image1">
</td>
</TR>
<tr>
<td height=10></td>
</tr>
</Form>
</TABLE>
<TABLE border="0" cellspacing="1" width="100%" cellpadding="4" ID="Table2">
<TR height=30 bgcolor="#F78200">
<TD width="10%" align="center"><font color="#FFFFFF"><b>ID号</b></font></TD>
<TD width="25%" align="center"><font color="#FFFFFF"><b>产品名称</b></font></TD>
<TD width="25%" align="center"><font color="#FFFFFF"><b>相关企业</b></font></TD>
<TD width="10%" align="center"><font color="#FFFFFF"><b>图片</b></font></TD>
<TD width="10%" align="center"><font color="#FFFFFF"><b>推荐</b></font></TD>
<TD width="10%" align="center"><font color="#FFFFFF"><b>审核</b></font></TD>
<TD width="10%" align="center"><font color="#FFFFFF"><b>删除</b></font></TD>
</TR>
<%
SearchText=trim(request("SearchText"))
SortID=trim(request("SortID"))
TypeID=trim(request("TypeID"))
set Rs=server.CreateObject("ADODB.Recordset")
RsStr="Select * from Product where flag=0 and IsNominate=false and (ProductName like '%" & SearchText & "%' or Explain like '%" & SearchText & "%' or Keyword like '%" & SearchText & "%')"
if SortID<>"" then
RsStr=RsStr & " and SortID=" & SortID
end if
if TypeID<>"" then
RsStr=RsStr & " and TypeID=" & TypeID
end if
'if ChildID<>"" then
' RsStr=RsStr & " and ChildID=" & ChildID
'end if
RsStr=RsStr & " Order By PID desc"
Rs.open RsStr,Conn,3,3
Rs_Rows=20
Rs.PageSize=Rs_Rows
Rs_Total=Rs.RecordCount
Page_Total=Rs.PageCount
CurrentPage=1
if (request.QueryString("CurrentPage")<>"" and isnumeric(request.QueryString("CurrentPage")) and request.QueryString("CurrentPage")>=1) then CurrentPage=request.QueryString("CurrentPage")
PageBegin=(CurrentPage-1)*Rs_Rows+1
PageEnd=PageBegin+Rs_Rows-1
if PageEnd>Rs.RecordCount then PageEnd=Rs.RecordCount
if Rs.recordCount<>0 then Rs.AbsolutePage=CurrentPage
if Not(Rs.bof and Rs.eof) then
while (not Rs.eof) and (PageBegin<=PageEnd)
%>
<TR height=23 <%if PageBegin mod 2=1 then%> bgcolor="#F6F6F6" <%else%> bgcolor="#FFFFFF" <%end if%>>
<TD width="10%" align="center"><%=Rs("PID")%></TD>
<TD width="25%" align="left"><a href="EditProduct.asp?PID=<%=Rs("PID")%>"><%=Rs("ProductName")%></a></TD>
<TD width="25%" align="left"><%Set UCRs=conn.execute("select * from UserCompany where UID=" & Rs("UID"))%><%if not UCRs.EOF then%><a href="../../Company/CompanyDetail.asp?UID=<%=UCRs("UID")%>" target=_blank><%=UCRs("CompanyName")%></a><%end if%></TD>
<TD width="10%" align="center"><%if LCase(Rs("SmallPicture"))="nopic.jpg" then%>NO<%else%><a href="../../Product/Pic/<%=Rs("SmallPicture")%>" target=_blank>Small</a><%end if%> <%if LCase(Rs("BigPicture"))="nopic.jpg" then%>NO<%else%><a href="../../Product/Pic/<%=Rs("BigPicture")%>" target=_blank>Big</a><%end if%></TD>
<TD width="10%" align="center"><a href="WaitProduct.asp?CurrentPage=<%=CurrentPage%>&SearchText=<%=SearchText%>&SortID=<%=SortID%>&TypeID=<%=TypeID%>&action=yesnom&PID=<%=Rs("PID")%>">设为推荐</a></TD>
<TD width="10%" align="center"><a href="WaitProduct.asp?CurrentPage=<%=CurrentPage%>&SearchText=<%=SearchText%>&SortID=<%=SortID%>&TypeID=<%=TypeID%>&action=yesaud&PID=<%=Rs("PID")%>">通过审核</a></TD>
<TD width="10%" align="center"><a href="WaitProduct.asp?CurrentPage=<%=CurrentPage%>&SearchText=<%=SearchText%>&SortID=<%=SortID%>&TypeID=<%=TypeID%>&action=del&PID=<%=Rs("PID")%>" onclick="return confirm('确定要删除这个产品吗?')">删除</a></TD>
</TR>
<%
PageBegin=PageBegin+1
Rs.movenext
wend
else
%>
<tr height=50>
<td colspan=6 align=center>没有您查找的产品!</td>
</tr>
<%
end if
Rs.close
%>
<TR height=30 bgcolor="#F78200">
<TD colspan=7 align=center style="color:#FFFFFF;">
<%
if Page_Total=0 then
CurrentPage=0
end if
%>
(共 <%=Page_Total%> 页,第 <%=CurrentPage%> 页,共检索到 <%=Rs_Total%> 条记录)
<%
if Cint(CurrentPage)<>1 and Page_Total<>0 then
response.Write "<a href='WaitProduct.asp?CurrentPage=1&SearchText=" & SearchText & "&SortID=" & SortID & "&TypeID=" & TypeID & "' class=Head1>首页</a>"
else
response.Write "首页"
end if
%>
<%
if Cint(CurrentPage)<>1 and Page_Total<>0 then
response.Write "<a href='WaitProduct.asp?CurrentPage=" & currentPage-1 & "&SearchText=" & SearchText & "&SortID=" & SortID & "&TypeID=" & TypeID & "' class=Head1>上一页</a>"
else
response.Write "上一页"
end if
%>
<%
if Cint(CurrentPage)<>Page_Total and Page_Total<>0 then
response.Write "<a href='WaitProduct.asp?CurrentPage=" & currentPage+1 & "&SearchText=" & SearchText & "&SortID=" & SortID & "&TypeID=" & TypeID & "' class=Head1>下一页</a>"
else
response.Write "下一页"
end if
%>
<%
if Cint(CurrentPage)<>Page_Total and Page_Total<>0 then
response.Write "<a href='WaitProduct.asp?CurrentPage=" & Page_Total & "&SearchText=" & SearchText & "&SortID=" & SortID & "&TypeID=" & TypeID & "' class=Head1>尾页</a>"
else
response.Write "尾页"
end if
%>
</TD>
</TR>
</table>
</center>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -