📄 htmlproduct.asp
字号:
<!--#include file="Conn.asp"-->
<!--#include file="Config.asp"-->
<!--#include file="Function.asp"-->
<%
dim strFileName,MaxPerPage,ShowSmallClassType
dim totalPut,CurrentPage,TotalPages
dim BeginTime,EndTime
dim founderr, errmsg
dim BigClassName,SmallClassName,keyword,strField
dim rs,sql,sqlProduct,rsProduct,sqlSearch,rsSearch,sqlBigClass,rsBigClass
BeginTime=Timer
BigClassName=Trim(request("BigClassName"))
SmallClassName=Trim(request("SmallClassName"))
keyword=trim(request("keyword"))
if keyword<>"" then
keyword=replace(replace(replace(replace(keyword,"'","‘"),"<","<"),">",">")," "," ")
end if
strField=trim(request("Field"))
if request("page")<>"" then
currentPage=cint(request("page"))
else
currentPage=1
end if
sqlBigClass="select * from BigClass order by BigClassID"
Set rsBigClass= Server.CreateObject("ADODB.Recordset")
rsBigClass.open sqlBigClass,conn,1,1
'=================================================
'过程名:ShowSmallClass_Tree
'作 用:树形目录方式显示栏目
'参 数:无
'=================================================
%>
<SCRIPT language=javascript>
function opencat(cat,img){
if(cat.style.display=="none"){
cat.style.display="";
img.src="img/class2.gif";
} else {
cat.style.display="none";
img.src="img/class1.gif";
}
}
</Script>
<%
dim i,strsmallclass
strsmallclass="<TABLE cellSpacing=0 cellPadding=0 width=99% border=0>"
set rsbig = server.CreateObject ("adodb.recordset")
sql="select * from BigClass"
rsbig.open sql,conn,1,1
if rsbig.eof and rsbig.bof then
Response.Write "栏目正在建设中……"
else
i=1
do while not rsbig.eof
strsmallclass=strsmallclass&"<TR><TD language=javascript onmouseup=""opencat(cat10"&i&"000, img10"&i&"000);"" id=item$pval[catID]) style=""CURSOR: hand"" width=34 height=24 align=center><IMG id=img10"&i&"000 src=img/class1.gif width=20 height=20></TD><TD width=662><a href='List_"&rsbig("BigClassID")&"_1.html'>"&rsbig("BigClassName")&"</a></TD></TR><TR>"
strsmallclass=strsmallclass&"<TD id=cat10"&i&"000 "
if rsbig("BigClassName")=BigClassName then
strsmallclass=strsmallclass&"style='DISPLAY' "
else
strsmallclass=strsmallclass&"style='DISPLAY: none' "
end if
strsmallclass=strsmallclass&"colspan=2>"
set rsSmall = server.CreateObject ("adodb.recordset")
sqls="select * from SmallClass where BigClassName='" & rsbig("BigClassName") & "' order by SmallClassID"
rsSmall.open sqls,conn,1,1
if rsSmall.eof and rsSmall.bof then
strsmallclass=strsmallclass&"没有小类"
else
j=1
do while not rsSmall.eof
strsmallclass=strsmallclass&" <IMG height=20 src=img/class3.gif width=26 align=absMiddle border=0><a href=Slist_"&rsSmall("SmallClassId")&"_1.html>" & rsSmall("SmallClassName") & "</a><BR>"
rsSmall.movenext
j=j+1
loop
end if
rsSmall.close
set rsSmall=nothing
strsmallclass=strsmallclass&"</TD></TR>"
rsbig.movenext
i=i+1
loop
rsbig.close
set rsbig=nothing
end if
strsmallclass=strsmallclass&"</TABLE>"
'=================================================
'过程名:ShowVote
'作 用:显示网站调查
'参 数:无
'=================================================
sub ShowVote()
dim sqlVote,rsVote,i
sqlVote="select top 1 * from Vote where IsSelected=True"
Set rsVote= Server.CreateObject("ADODB.Recordset")
rsVote.open sqlVote,conn,1,1
if rsVote.bof and rsVote.eof then
response.Write " 没有任何调查"
else
response.write "<form name='VoteForm' method='post' action='vote.asp' target='_blank'><td>"
response.write rsVote("Title") & "<br><br>"
if rsVote("VoteType")="Single" then
for i=1 to 8
if trim(rsVote("Select" & i) & "")="" then exit for
response.Write "<input type='radio' name='VoteOption' value='" & i & "'>" & rsVote("Select" & i) & "<br>"
next
else
for i=1 to 8
if trim(rsVote("Select" & i) & "")="" then exit for
response.Write "<input type='checkbox' name='VoteOption' value='" & i & "'>" & rsVote("Select" & i) & "<br>"
next
end if
response.write "<br><input name='VoteType' type='hidden'value='" & rsVote("VoteType") & "'>"
response.write "<input name='Action' type='hidden' value='Vote'>"
response.write "<input name='ID' type='hidden' value='" & rsVote("ID") & "'>"
response.write "<a href='javascript:VoteForm.submit();'><img src='images/voteSubmit.gif' width='52' height='18' border='0'></a> "
response.write "<a href='Vote.asp?Action=Show' target='_blank'><img src='images/voteView.gif' width='52' height='18' border='0'></a>"
response.write "</td></form>"
end if
rsVote.close
set rsVote=nothing
end sub
'=================================================
'过程名:ShowClassGuide
'作 用:显示栏目导航位置
'参 数:无
'=================================================
sub ShowClassGuide()
strguide= " <a href='Products.asp'>产品</a> >>"
if BigClassName="" and SmallClassName="" then
strguide=strguide& " 所有产品"
else
if BigClassName<>"" then
strguide=strguide& " <a href='Product.asp?BigClassName=" & BigClassName & "'>" & BigClassName & "</a> >> "
if SmallClassName<>"" then
strguide=strguide& "<a href='Product.asp?BigClassName=" & BigClassName & "&SmallClassName=" & SmallClassName & "'>" & SmallClassName & "</a>"
else
strguide=strguide& "所有小类"
end if
end if
end if
end sub
'=================================================
'过程名:ShowProductTotal
'作 用:显示文章总数
'参 数:无
'=================================================
sub ShowProductTotal()
dim sqlTotal
dim rsTotal
sqlTotal="select Count(*) from Product where Passed=True "
if BigClassName<>"" then
sqlTotal=sqlTotal & " and BigClassName='" & BigClassName & "' "
if SmallClassName<>"" then
sqlTotal=sqlTotal & " and SmallClassName='" & SmallClassName & "' "
end if
end if
Set rsTotal= Server.CreateObject("ADODB.Recordset")
rsTotal.open sqlTotal,conn,1,1
if rsTotal.eof and rsTotal.bof then
totalPut=0
response.write "共有 0 个产品"
else
totalPut=rsTotal(0)
response.Write "共有 " & totalPut & " 个产品"
end if
rsTotal.close
set rsTotal=nothing
end sub
'=================================================
'过程名:ShowProduct
'=================================================
if TitleLen<0 or TitleLen>200 then
TitleLen=50
end if
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
sqlProduct="select top " & MaxPerPage
else
sqlProduct="select "
end if
sqlProduct=sqlProduct & " ID,Product_Id,BigClassName,SmallClassName,IncludePic,Title,Price,Spec,Unit,Memo,DefaultPicUrl,UpdateTime,Hits from Product where Passed=True "
if BigClassName<>"" then
sqlProduct=sqlProduct & " and BigClassName='" & BigClassName & "' "
if SmallClassName<>"" then
sqlProduct=sqlProduct & " and SmallClassName='" & SmallClassName & "' "
end if
end if
sqlProduct=sqlProduct & " order by UpdateTime desc"
Set rsProduct= Server.CreateObject("ADODB.Recordset")
rsProduct.open sqlProduct,conn,1,1
if rsProduct.bof and rsProduct.eof then
strproduct("<br><li>没有任何产品</li>")
else
if currentPage=1 then
do while not rsProduct.eof
strproduct=""
strproduct= strproduct & "<table width=100% border=0 cellspacing=3 cellpadding=0>"
strproduct= strproduct & "<tr>"
strproduct= strproduct & "<td width=25% rowspan=6>"
strproduct= strproduct & "<div align=center><a href=ProductShow.asp?ID=" & rsProduct("ID") & ">"
fileExt=lcase(getFileExtName(rsProduct("DefaultPicUrl")))
if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then
strproduct= strproduct & "<img style='BORDER-LEFT-COLOR: #cccccc; BORDER-BOTTOM-COLOR: #cccccc; BORDER-TOP-COLOR: #cccccc; BORDER-RIGHT-COLOR: #cccccc' src=" & rsProduct("DefaultPicUrl") & " width=105 height=80 onload='javascript:DrawImage(this);'>"
else
if fileext="swf" then
strproduct= strproduct & "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0' width='105' height='84'>"
strproduct= strproduct &"<param name=movie value='"&rsProduct("DefaultPicUrl")&"'>"
strproduct= strproduct &"<param name=quality value=high>"
strproduct= strproduct &"<param name='Play' value='-1'>"
strproduct= strproduct &"<param name='Loop' value='0'>"
strproduct= strproduct &"<param name='Menu' value='-1'>"
strproduct= strproduct &"<embed src='"&rsProduct("DefaultPicUrl")&"' width='105' height='84' pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'></embed> </object>"
end if
end if
strproduct= strproduct & "</a></div></td>"
strproduct= strproduct & "<td width=12% height=12>"
strproduct= strproduct & "产品名称:</td>"
strproduct= strproduct & "<td>"
strproduct= strproduct & "<a href=ProductShow.asp?ID=" & rsProduct("ID") & ">" & rsProduct("Title") & ""
strproduct= strproduct & "</a></td>"
'strproduct= strproduct & "</tr><tr>"
'strproduct= strproduct & "<td width=12% height=12>"
'strproduct= strproduct & "产品售价:</td>"
'strproduct= strproduct & "<td>" & rsProduct("Price") & "元</td>"
strproduct= strproduct & "</tr><tr>"
strproduct= strproduct & "<td width=12% height=12>"
strproduct= strproduct & "产品规格:</td>"
strproduct= strproduct & "<td>"
strproduct= strproduct & rsProduct("Spec") & ""
strproduct= strproduct & "</a></td>"
strproduct= strproduct & "</tr><tr>"
strproduct= strproduct & "<td width=12% height=12>"
strproduct= strproduct & "产品备注:</td>"
strproduct= strproduct & "<td>"
strproduct= strproduct & rsProduct("Memo") & ""
strproduct= strproduct & "</a></td>"
strproduct= strproduct & "</tr><tr>"
strproduct= strproduct & "<td height=12>"
strproduct= strproduct & "产品类别:</td>"
strproduct= strproduct & "<td><a href=Product.asp?BigClassName="& rsProduct("BigClassName")&">"&rsProduct("BigClassName")&"</a> → "
strproduct= strproduct & "<a href=Product.asp?BigClassName=" & rsProduct("BigClassName") & "&SmallClassName=" & rsProduct("SmallClassName") & ">" & rsProduct("SmallClassName") & ""
strproduct= strproduct & "</a></td>"
strproduct= strproduct & "</tr><tr>"
strproduct= strproduct & "<td height=12>产品信息:</td>"
strproduct= strproduct & "<td>"
strproduct= strproduct & "<a href=ProductShow.asp?ID=" & rsProduct("ID") & " target=_blank><img src=Img/arrow_7.gif border=0></a></td>"
strproduct= strproduct & "</tr><tr>"
strproduct= strproduct & "<td colspan=2>"
strproduct= strproduct & "<table width=100% border=0 cellpadding=0 cellspacing=0>"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -