?? syscode.asp
字號(hào):
<!--#include file="conn.asp"-->
<!--#include file="config.asp"-->
<!--#include file="ubbcode.asp"-->
<!--#include file="function.asp"-->
<%
dim strFileName,MaxPerPage,ShowSmallClassType
dim totalPut,CurrentPage,TotalPages
dim BeginTime,EndTime
dim founderr, errmsg
dim BigClassName,SmallClassName,SpecialName,keyword,strField
dim rs,sql,sqlArticle,rsArticle,sqlSearch,rsSearch,sqlBigClass,rsBigClass,sqlSpecial,rsSpecial
dim SpecialTotal
BeginTime=Timer
BigClassName=Trim(request("BigClassName"))
SmallClassName=Trim(request("SmallClassName"))
SpecialName=trim(request("SpecialName"))
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
'=================================================
'過(guò)程名:ShowSmallClass_Tree
'作 用:樹(shù)形目錄方式顯示欄目
'參 數(shù):無(wú)
'=================================================
sub ShowSmallClass_Tree()
if rsBigClass.bof and rsBigClass.eof then
response.Write "欄目正在建設(shè)中……"
else
dim sqlClass,rsClass,strTree,BigClassNum,i,j
rsBigClass.movefirst
BigClassNum=rsBigClass.recordcount
i=1
do while not rsBigClass.eof
if i<BigClassNum then
strTree=""
else
strTree=""
end if
sqlClass="select * from SmallClass where BigClassName='" & rsBigClass("BigClassName") & "' Order by SmallClassID"
Set rsClass= Server.CreateObject("ADODB.Recordset")
rsClass.open sqlClass,conn,1,1
strTree= strTree & "<table width=180 border=0 cellpadding=0 cellspacing=0>"
strTree= strTree & "<tr>"
strTree= strTree & "<td width=24 height=22>"
strTree= strTree & "<div align=center><img src=Img/arrow_2.gif width=13 height=11></div></td>"
strTree= strTree & "<td width=150>"
strTree= strTree & "<a href='Product.asp?BigClassName=" & rsBigClass("BigClassName") & "'>"
strTree=strTree & rsBigClass("BigClassName")
strTree=strTree & "</a></td>"
'strTree=strTree & "</td>"
strTree= strTree & "</tr><tr>"
strTree=strTree & "<TD height=1 colspan=2 background=img/naSzarym.gif>"
strTree=strTree & "<IMG height=1 src=img/1x1_pix.gif width=10></TD>"
strTree=strTree & "</TR>"
strTree=strTree & "</table>"
SmallClassNum=rsClass.recordcount
j=1
do while not rsClass.eof
rsClass.movenext
j=j+1
loop
response.write strTree
rsBigClass.movenext
i=i+1
loop
rsClass.close
set rsClass=nothing
end if
end sub
'=================================================
'過(guò)程名:ShowVote
'作 用:顯示網(wǎng)站調(diào)查
'參 數(shù):無(wú)
'=================================================
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 " 沒(méi)有任何調(diào)查"
else
response.write "<form name='VoteForm' method='post' action='vote.asp' target='_blank'><td>"
response.write " " & rsVote("Title") & "<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 "<div align='center'>"
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 "</div></td></form>"
end if
rsVote.close
set rsVote=nothing
end sub
'=================================================
'過(guò)程名:ShowClassGuide
'作 用:顯示欄目導(dǎo)航位置
'參 數(shù):無(wú)
'=================================================
sub ShowClassGuide()
response.write "| <a href='Products.asp'>產(chǎn)品展示</a> >>"
if BigClassName="" and SmallClassName="" then
response.write " 所有產(chǎn)品"
else
if BigClassName<>"" then
response.write " <a href='Product.asp?BigClassName=" & BigClassName & "'>" & BigClassName & "</a> >> "
if SmallClassName<>"" then
response.write "<a href='Product.asp?BigClassName=" & BigClassName & "&SmallClassName=" & SmallClassName & "'>" & SmallClassName & "</a>"
else
response.write "所有小類"
end if
end if
end if
end sub
'=================================================
'過(guò)程名:ShowArticleTotal
'作 用:顯示文章總數(shù)
'參 數(shù):無(wú)
'=================================================
sub ShowArticleTotal()
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
else
if SpecialName<>"" then
sqlTotal=sqlTotal & " and SpecialName='" & SpecialName & "' "
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 個(gè)產(chǎn)品"
else
totalPut=rsTotal(0)
response.Write "共有 " & totalPut & " 個(gè)產(chǎn)品"
end if
rsTotal.close
set rsTotal=nothing
end sub
'=================================================
'過(guò)程名:ShowArticle
'=================================================
sub ShowArticle(TitleLen)
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
sqlArticle="select top " & MaxPerPage
else
sqlArticle="select "
end if
sqlArticle=sqlArticle & " ArticleID,Product_Id,BigClassName,SmallClassName,IncludePic,Title,DefaultPicUrl,UpdateTime,Hits from Product where Passed=True "
if BigClassName<>"" then
sqlArticle=sqlArticle & " and BigClassName='" & BigClassName & "' "
if SmallClassName<>"" then
sqlArticle=sqlArticle & " and SmallClassName='" & SmallClassName & "' "
end if
else
if SpecialName<>"" then
sqlArticle=sqlArticle & " and SpecialName='" & SpecialName & "' "
end if
end if
sqlArticle=sqlArticle & " order by articleid desc"
Set rsArticle= Server.CreateObject("ADODB.Recordset")
rsArticle.open sqlArticle,conn,1,1
if rsArticle.bof and rsArticle.eof then
response.Write("<br><li>沒(méi)有任何產(chǎn)品</li>")
else
if currentPage=1 then
call ArticleContent(TitleLen)
else
if (currentPage-1)*MaxPerPage<totalPut then
rsArticle.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rsArticle.bookmark
call ArticleContent(TitleLen)
else
currentPage=1
call ArticleContent(TitleLen)
end if
end if
end if
rsArticle.close
set rsArticle=nothing
end sub
sub ArticleContent(intTitleLen)
dim i,strTemp
i=0
do while not rsArticle.eof
strTemp=""
'strTemp = strTemp & ""
strTemp= strTemp & "<table width=100% border=0 cellspacing=3 cellpadding=0>"
strTemp= strTemp & "<tr>"
strTemp= strTemp & "<td width=25% rowspan=5>"
strTemp= strTemp & "<div align=center><a href=ArticleShow.asp?ArticleID=" & rsArticle("articleid") & ">"
strTemp= strTemp & "<img border=0 src=" & rsArticle("DefaultPicUrl") & " width=100 height=120>"
strTemp= strTemp & "</a></div></td>"
strTemp= strTemp & "<td width=12% height=18>"
strTemp= strTemp & "產(chǎn)品名稱:</td>"
strTemp= strTemp & "<td>"
strTemp= strTemp & "<a href=ArticleShow.asp?ArticleID=" & rsArticle("articleid") & ">" & rsArticle("Title") & ""
strTemp= strTemp & "</a></td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=18>"
strTemp= strTemp & "產(chǎn)品類別:</td>"
strTemp= strTemp & "<td><a href=Product.asp?BigClassName=" & rsArticle("BigClassName") & ">" & rsArticle("BigClassName") & "</a> → "
strTemp= strTemp & "<a href=Product.asp?BigClassName=" & rsArticle("BigClassName") & "&SmallClassName=" & rsArticle("SmallClassName") & ">" & rsArticle("SmallClassName") & ""
strTemp= strTemp & "</a></td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=18>"
strTemp= strTemp & "產(chǎn)品編號(hào):</td>"
strTemp= strTemp & "<td>" & rsArticle("Product_Id") & "</td>"
strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td height=18>產(chǎn)品信息:</td>"
strTemp= strTemp & "<td>"
strTemp= strTemp & "<a href=ArticleShow.asp?ArticleID=" & rsArticle("articleid") & "><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=18>"
strTemp= strTemp & "<div align=center></div></td>"
strTemp= strTemp & "<td width=50% height=18>"
strTemp= strTemp & "<div align=center><a href='javascript:eshop(" & rsArticle("Product_Id") & ")'><img border=0 src=img/addtocart.gif width=75 height=18>"
strTemp= strTemp & "</a></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
rsArticle.movenext
i=i+1
if i>=MaxPerPage then exit do
loop
end sub
'=================================================
'過(guò)程名:ShowSearchTerm
'作 用:顯示搜索條件信息
'參 數(shù):無(wú)
'=================================================
sub ShowSearchTerm()
response.write "| 產(chǎn)品搜索 >> "
if BigClassName<>"" then
response.write "<a href='Default.asp?BigClassName=" & BigClassName & "'>" & BigClassName & "</a> >> "
if SmallClassName<>"" then
response.write "<a href='Default.asp?BigClassName=" & BigClassName & "&SmallClassName=" & SmallClassName & "'>" & SmallClassName & "</a> >> "
else
response.write "所有小類 >> "
end if
end if
if keyword<>"" then
select case strField
case "Title"
response.Write "名稱中含有 <font color=red>"&keyword&"</font> 的產(chǎn)品"
case "Content"
response.Write "說(shuō)明含有 <font color=red>"&keyword&"</font> 的產(chǎn)品"
case else
response.Write "名稱中含有 <font color=red>"&keyword&"</font> 的產(chǎn)品"
end select
else
response.write " 所有產(chǎn)品"
end if
end sub
'=================================================
'過(guò)程名:SearchResultTotal
'作 用:顯示搜索結(jié)果總數(shù)
'參 數(shù):無(wú)
'=================================================
sub SearchResultTotal()
dim rsTotal,sqlTotal
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
else
if SpecialName<>"" then
sqlTotal=sqlTotal & " and SpecialName='" & SpecialName & "' "
end if
end if
if keyword<>"" then
select case strField
case "Title"
sqlTotal=sqlTotal & " and Title like '%" & keyword & "%' "
case "Content"
sqlTotal=sqlTotal & " and Content like '%" & keyword & "%' "
case else
sqlTotal=sqlTotal & " and Title like '%" & keyword & "%' "
end select
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 個(gè)產(chǎn)品"
else
totalPut=rsTotal(0)
response.Write "共找到 " & totalPut & " 個(gè)產(chǎn)品"
end if
end sub
?? 快捷鍵說(shuō)明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -