📄 htmlproduct.asp
字号:
sqlSearch=sqlSearch & " * from Product where Passed=True "
if BigClassName<>"" then
sqlSearch=sqlSearch & " and BigClassName='" & BigClassName & "' "
if SmallClassName<>"" then
sqlSearch=sqlSearch & " and SmallClassName='" & SmallClassName & "' "
end if
end if
if keyword<>"" then
select case strField
case "Title"
sqlSearch=sqlSearch & " and Title like '%" & keyword & "%' "
case "Content"
sqlSearch=sqlSearch & " and Content like '%" & keyword & "%' "
case else
sqlSearch=sqlSearch & " and Title like '%" & keyword & "%' "
end select
end if
sqlSearch=sqlSearch & " order by ID desc"
Set rsSearch= Server.CreateObject("ADODB.Recordset")
rsSearch.open sqlSearch,conn,1,1
if rsSearch.eof and rsSearch.bof then
response.write "<p align='center'><br><br>没有或没有找到任何产品</p>"
else
if currentPage=1 then
call SearchResultContent()
else
if (currentPage-1)*MaxPerPage<totalPut then
rsSearch.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rsSearch.bookmark
call SearchResultContent()
else
currentPage=1
call SearchResultContent()
end if
end if
end if
rsSearch.close
set rsSearch=nothing
end sub
sub SearchResultContent()
dim i,strTemp
i=0
do while not rsSearch.eof
strTemp=""
strTemp= strTemp & "<table width=100% border=0 cellspacing=3 cellpadding=0>"
strTemp= strTemp & "<tr>"
strTemp= strTemp & "<td width=25% rowspan=6>"
strTemp= strTemp & "<div align=center><a href=ProductShow.asp?ID=" & rsSearch("ID") & ">"
fileExt=lcase(getFileExtName(rsSearch("DefaultPicUrl")))
if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then
strTemp= strTemp & "<img border=0 src=" & rsSearch("DefaultPicUrl") & " width=105 height=80>"
else
if fileext="swf" then
strTemp= strTemp & "<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'>"
strTemp= strTemp &"<param name=movie value='"&rsSearch("DefaultPicUrl")&"'>"
strTemp= strTemp &"<param name=quality value=high>"
strTemp= strTemp &"<param name='Play' value='-1'>"
strTemp= strTemp &"<param name='Loop' value='0'>"
strTemp= strTemp &"<param name='Menu' value='-1'>"
strTemp= strTemp &"<param name='wmode' value='transparent'>"
strTemp= strTemp &"<embed src='"&rsSearch("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
strTemp= strTemp & "</a></div></td>"
strTemp= strTemp & "<td width=12% height=12>"
strTemp= strTemp & "产品名称:</td>"
strTemp= strTemp & "<td>"
strTemp= strTemp & "<a href=ProductShow.asp?ID=" & rsSearch("ID") & ">" & rsSearch("Title") & ""
strTemp= strTemp & "</a></td>"
'strTemp= strTemp & "</tr><tr>"
'strTemp= strTemp & "<td width=12% height=12>"
'strTemp= strTemp & "产品售价:</td>"
'strTemp= strTemp & "<td>" & rsSearch("Price") & "元</td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td width=12% height=12>"
strTemp= strTemp & "产品规格:</td>"
strTemp= strTemp & "<td>"
strTemp= strTemp & rsSearch("Spec") & ""
strTemp= strTemp & "</a></td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td width=12% height=12>"
strTemp= strTemp & "产品备注:</td>"
strTemp= strTemp & "<td>"
strTemp= strTemp & rsSearch("Memo") & ""
strTemp= strTemp & "</a></td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=12>"
strTemp= strTemp & "产品类别:</td>"
strTemp= strTemp & "<td><a href=Product.asp?BigClassName=" & rsSearch("BigClassName") & ">" & rsSearch("BigClassName") & "</a> → "
strTemp= strTemp & "<a href=Product.asp?BigClassName=" & rsSearch("BigClassName") & "&SmallClassName=" & rsSearch("SmallClassName") & ">" & rsSearch("SmallClassName") & ""
strTemp= strTemp & "</a></td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=12>产品信息:</td>"
strTemp= strTemp & "<td>"
strTemp= strTemp & "<a href=ProductShow.asp?ID=" & rsSearch("ID") & "><img src=Img/arrow_7.gif border=0></a></td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td colspan=2>"
strTemp= strTemp & "<table width=100% border=0 cellpadding=0 cellspacing=0>"
strTemp= strTemp & "<tr>"
strTemp= strTemp & "<td width=50% height=12>"
strTemp= strTemp & "<div align=center></div></td>"
strTemp= strTemp & "<td width=50% height=12>"
strTemp= strTemp & "<div align=center><input name='Product_Id' type='checkbox' id='Product_Id' value="&cstr(rsSearch("Product_Id"))&"> 选取"
strTemp= strTemp & "</div></td>"
strTemp= strTemp & "</tr>"
strTemp= strTemp & "</table>"
strTemp= strTemp & "</td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=1 colspan=3 bgcolor=#CCCCCC></td>"
strTemp= strTemp & "</tr>"
strTemp= strTemp & "</table>"
response.write strTemp
rsSearch.movenext
i=i+1
if i>=MaxPerPage then exit do
loop
end sub
'=================================================
'过程名:ShowSearch
'作 用:显示文章搜索表单
'参 数:ShowType ----显示方式。1为纵向,2为横向
'=================================================
dim count,StrSearch
if ShowType<>1 and ShowType<>2 then
ShowType=1
end if
set rs=server.createobject("adodb.recordset")
sql = "select * from SmallClass order by SmallClassID asc"
rs.open sql,conn,1,1
%>
<script language = "JavaScript">
var onecount;
subcat = new Array();
<%
count = 0
do while not rs.eof
%>
subcat[<%=count%>] = new Array("<%= trim(rs("SmallClassName"))%>","<%= trim(rs("BigClassName"))%>","<%= trim(rs("SmallClassName"))%>");
<%
count = count + 1
rs.movenext
loop
rs.close
%>
onecount=<%=count%>;
function changelocation(locationid)
{
document.myform.SmallClassName.length = 1;
var locationid=locationid;
var i;
for (i=0;i < onecount; i++)
{
if (subcat[i][1] == locationid)
{
document.myform.SmallClassName.options[document.myform.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
}
}
}
</script>
<%StrSearch="<table border=0 cellpadding=2 cellspacing=0 align=center>"
StrSearch=StrSearch&"<form method=Get name=myform action=search.asp>"
StrSearch=StrSearch&" <tr>"
StrSearch=StrSearch&" <td height=28> <select name=Field size=1>"
StrSearch=StrSearch&" <option value=Title selected size=12> 产品名称 </option>"
StrSearch=StrSearch&" <option value=Content> 产品说明 </option>"
StrSearch=StrSearch&" </select>"
StrSearch=StrSearch&" </td>"
StrSearch=StrSearch&"</tr>"
StrSearch=StrSearch& " <tr>"
StrSearch=StrSearch& " <td height=28>"
StrSearch=StrSearch& " <input type=text name=keywords size=12 value=关键字 maxlength=50 onFocus=this.select();>"
StrSearch=StrSearch& "<input type=submit name=Submit value=搜索> </td>"
StrSearch=StrSearch& " </tr>"
StrSearch=StrSearch& " </form>"
StrSearch=StrSearch& "</table>"
'=================================================
'过程名:ShowAllClass
'作 用:显示所有栏目(栏目导航)
'参 数:无
'=================================================
if rsBigClass.bof and rsBigClass.eof then
strClassname= " 没有任何栏目"
else
dim sqlClass,rsClass,strClassName
rsBigClass.movefirst
strClassName=""
do while not rsBigClass.eof
strClassName=strClassName & "【<a href='List_" & rsBigClass("BigClassID") & "_1.html'><b>" & rsBigClass("BigClassName") & "</b></a>】<br><br>"
sqlClass="select * from SmallClass where BigClassName='" & rsBigClass("BigClassName") & "' Order by SmallClassID"
Set rsClass= Server.CreateObject("ADODB.Recordset")
rsClass.open sqlClass,conn,1,1
do while not rsClass.eof
strClassName=strClassName & " <a href='Slist_" & rsClass("SmallClassID") &"_1.html'>" & rsClass("SmallClassName") & "</a> "
rsClass.movenext
loop
strClassName=strClassName & "<br><br>"
rsBigClass.movenext
loop
rsClass.close
set rsClass=nothing
end if
'=================================================
'过程名:ShowProductContent
'作 用:显示文章具体的内容,可以分页显示
'参 数:无
'=================================================
sub ShowProductContent()
dim ID,strContent,CurrentPage
dim ContentLen,MaxPerPage,pages,i,lngBound
dim BeginPoint,EndPoint
ID=rs("ID")
strContent=rs("Content")
response.write strContent
end sub
'=================================================
'过程名:ShowUserLogin
'作 用:显示用户登录表单
'参 数:无
'=================================================
dim strLogin
If Session("UserName")="" Then
strLogin= "<table width='100%' border='0' cellspacing='0' cellpadding='0'>"
strLogin=strLogin & "<form action='UserLogin.asp' method='post' name='UserLogin' onSubmit='return CheckForm();'>"
strLogin=strLogin & "<tr><td height='25' align='right'>用户名:</td><td height='25'><input name='UserName' type='text' id='UserName' size='10' maxlength='20'></td></tr>"
strLogin=strLogin & "<tr><td height='25' align='right'>密 码:</td><td height='25'><input name='Password' type='password' id='Password' size='10' maxlength='20'></td></tr>"
strLogin=strLogin & "<tr align='center'><td height='25' colspan='2'><input name='Login' type='submit' id='Login' value=' 登录 '> <input name='Reset' type='reset' id='Reset' value=' 清除 '>"
strLogin=strLogin & "</td></tr>"
strLogin=strLogin & "<tr><td height='20' align='center' colspan='2'><a href='UserReg.asp' target='_blank'>新用户注册</a> <a href='GetPassword.asp' target='_blank'>忘记密码?</a></td></tr>"
strLogin=strLogin & "</form></table>"
%>
<script language=javascript>
function CheckForm()
{
if(document.UserLogin.UserName.value=="")
{
alert("请输入用户名!");
document.UserLogin.UserName.focus();
return false;
}
if(document.UserLogin.Password.value == "")
{
alert("请输入密码!");
document.UserLogin.Password.focus();
return false;
}
}
</script>
<%
Else
strLogin= "欢迎您!" & Session("UserName") & "<br><br>"
strLogin=strLogin & "用户控制面板:<br><br> <a href='UserServer.asp'><b>进入会员中心</b></a><br><br>"
end if
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -