SysProduct.asp
Upload User: ahxunteng
Upload Date: 2022-05-16
Package Size: 1606k
Code Size: 32k
Development Platform:

VBScript

  1. <%
  2. dim strFileName,MaxPerPage,ShowSmallClassType
  3. dim totalPut,CurrentPage,TotalPages
  4. dim BeginTime,EndTime
  5. dim founderr, errmsg
  6. dim BigClassName,SmallClassName,SpecialName,keyword,strField
  7. dim rs,sql,sqlArticle,rsArticle,sqlSearch,rsSearch,sqlBigClass,rsBigClass,sqlSpecial,rsSpecial
  8. dim SpecialTotal
  9. BeginTime=Timer
  10. BigClassName=Trim(request("BigClassName"))
  11. SmallClassName=Trim(request("SmallClassName"))
  12. SpecialName=trim(request("SpecialName"))
  13. keyword=trim(request("keyword"))
  14. if keyword<>"" then 
  15. keyword=replace(replace(replace(replace(keyword,"'","‘"),"<","&lt;"),">","&gt;")," ","&nbsp;")
  16. end if
  17. strField=trim(request("Field"))
  18. if request("page")<>"" then
  19.     currentPage=cint(request("page"))
  20. else
  21. currentPage=1
  22. end if
  23. sqlBigClass="select * from PrBigClasss order by BigClassID"
  24. Set rsBigClass= Server.CreateObject("ADODB.Recordset")
  25. rsBigClass.open sqlBigClass,conn,1,1
  26. '=================================================
  27. '过程名:ShowSmallClass_Tree
  28. '作  用:树形目录方式显示栏目
  29. '参  数:无
  30. '=================================================
  31. Sub ShowSmallClass_Tree()
  32. %>
  33. <SCRIPT language=javascript>
  34. function opencat(cat,img){
  35. if(cat.style.display=="none"){
  36. cat.style.display="";
  37. img.src="../img/class2.gif";
  38. } else {
  39. cat.style.display="none"; 
  40. img.src="../img/class1.gif";
  41. }
  42. }
  43. </Script>
  44. <TABLE cellSpacing=0 cellPadding=0 width="99%" border=0>
  45. <%
  46. dim i
  47. if rsBigClass.eof and rsBigClass.bof then
  48. Response.Write "栏目正在建设中……"
  49. else
  50. i=1
  51. do while not rsBigClass.eof
  52. %>
  53. <TR>
  54. <TD language=javascript onmouseup="opencat(cat10<%=i%>000,&#13;&#10; img10<%=i%>000);" id=item$pval[catID]) style="CURSOR: hand" width=32 height=24 align=center><IMG id=img10<%=i%>000 src="../img/class1.gif" width=20 height=20></TD>
  55. <TD class='ML_Tdbg'><a href='Product.asp?BigClassName=<%=rsBigClass("BigClassName")%>'language=javascript onmouseover="opencat(cat10<%=i%>000,&#13;&#10; img10<%=i%>000);"><%=rsBigClass("BigClassName")%></a></TD>
  56. </TR>
  57. <TR>
  58. <TD id=cat10<%=i%>000 style="DISPLAY: none" bgColor=#fefdf5 colspan="2">
  59. <%
  60. dim rss,sqls,j
  61. set rss = server.CreateObject ("adodb.recordset")
  62. sqls="select * from PrSmallClass where BigClassName='" & rsBigClass("BigClassName") & "'order by SmallClassID"
  63. rss.open sqls,conn,1,1
  64. if rss.eof and rss.bof then
  65. Response.Write "没有小分类"
  66. else
  67. j=1
  68. do while not rss.eof
  69. %>
  70. &nbsp;<IMG height=20 src="../img/class3.gif" width=26 align=absMiddle border=0><a href="Product.asp?BigClassName=<%=rss("BigClassName")%>&Smallclassname=<%=rss("SmallClassName")%>"><%=rss("SmallClassName")%></a><BR>
  71. <%
  72. rss.movenext
  73. j=j+1
  74. loop
  75. end if
  76. rss.close
  77. set rss=nothing
  78. %>
  79. </TD>
  80. </TR>
  81. <%
  82. rsBigClass.movenext
  83. i=i+1
  84. loop
  85. end if
  86. %>
  87. </TABLE>
  88. <%
  89. end Sub 
  90. '=================================================
  91. '过程名:ShowVote
  92. '作  用:显示网站调查
  93. '参  数:无
  94. '=================================================
  95. sub ShowVote()
  96. dim sqlVote,rsVote,i
  97. sqlVote="select top 1 * from Vote where IsSelected=True"
  98. Set rsVote= Server.CreateObject("ADODB.Recordset")
  99. rsVote.open sqlVote,conn,1,1
  100. if rsVote.bof and rsVote.eof then 
  101. response.Write "&nbsp;没有任何调查"
  102. else
  103. response.write "<form name='VoteForm'method='post'action='vote.asp'target='_blank'><td>"
  104. response.write "&nbsp;&nbsp;&nbsp;&nbsp;"& rsVote("Title") &"<br>"
  105. if rsVote("VoteType")="Single" then
  106. for i=1 to 8
  107. if trim(rsVote("Select"& i) &"")="" then exit for
  108. response.Write "<input type='radio'name='VoteOption'value='"& i &"'>" & rsVote("Select" & i) &"<br>"
  109. next
  110. else
  111. for i=1 to 8
  112. if trim(rsVote("Select"& i) &"")="" then exit for
  113. response.Write "<input type='checkbox'name='VoteOption'value='"& i &"'>"& rsVote("Select" & i) &"<br>"
  114. next
  115. end if
  116. response.write "<br><input name='VoteType'type='hidden'value='"& rsVote("VoteType") &"'>"
  117. response.write "<input name='Action'type='hidden'value='Vote'>"
  118. response.write "<input name='ID'type='hidden'value='"& rsVote("ID") &"'>"
  119. response.write "<div align='center'>"
  120. response.write "<a href='javascript:VoteForm.submit();'><img src='../images/voteSubmit.gif' width='52'height='18'border='0'></a>&nbsp;&nbsp;"
  121.         response.write "<a href='Vote.asp?Action=Show'target='_blank'><img src='../images/voteView.gif' width='52'height='18'border='0'></a>"
  122. response.write "</div></td></form>"
  123. end if
  124. rsVote.close
  125. set rsVote=nothing
  126. end sub
  127. '=================================================
  128. '过程名:ShowClassGuide
  129. '作  用:显示栏目导航位置
  130. '参  数:无
  131. '=================================================
  132. sub ShowClassGuide()
  133. response.write  "<a href='Product.asp'>产品展示</a>&nbsp;&gt;&gt;"
  134. if BigClassName="" and SmallClassName="" then
  135. response.write "&nbsp;所有产品"
  136. else
  137. if BigClassName<>"" then
  138. response.write "&nbsp;<a href='Product.asp?BigClassName="& BigClassName &"'>"& BigClassName &"</a>&nbsp;&gt;&gt;&nbsp;"
  139. if SmallClassName<>"" then
  140. response.write "<a href='Product.asp?BigClassName="& BigClassName &"&SmallClassName="& SmallClassName &"'>"& SmallClassName &"</a>"
  141. else
  142. response.write "所有小类"
  143. end if
  144. end if
  145. end if
  146. end sub
  147. '=================================================
  148. '过程名:ShowArticleTotal
  149. '作  用:显示文章总数
  150. '参  数:无
  151. '=================================================
  152. sub ShowArticleTotal()
  153. dim sqlTotal
  154. dim rsTotal
  155. sqlTotal="select Count(*) from Product where Passed=True "
  156. if BigClassName<>"" then
  157. sqlTotal=sqlTotal &" and BigClassName='"& BigClassName &"'"
  158. if SmallClassName<>"" then
  159. sqlTotal=sqlTotal &" and SmallClassName='"& SmallClassName &"'"
  160. end if
  161. else
  162. if SpecialName<>"" then
  163. sqlTotal=sqlTotal &" and SpecialName='"& SpecialName &"'"
  164. end if
  165. end if
  166. Set rsTotal= Server.CreateObject("ADODB.Recordset")
  167. rsTotal.open sqlTotal,conn,1,1
  168. if rsTotal.eof and rsTotal.bof then
  169. totalPut=0
  170. response.write "共有 0 个产品"
  171. else
  172. totalPut=rsTotal(0)
  173. response.Write "共有 "& totalPut  &" 个产品"
  174. end if
  175. rsTotal.close
  176. set rsTotal=nothing
  177. end sub
  178. '=================================================
  179. '过程名:ShowArticle
  180. '=================================================
  181. sub ShowArticle(TitleLen)
  182. if TitleLen<0 or TitleLen>200 then
  183. TitleLen=50
  184. end if
  185.     if currentpage<1 then
  186.     currentpage=1
  187.     end if
  188. if (currentpage-1)*MaxPerPage>totalput then
  189. if (totalPut mod MaxPerPage)=0 then
  190.     currentpage= totalPut  MaxPerPage
  191. else
  192.     currentpage= totalPut  MaxPerPage + 1
  193. end if
  194.   end if
  195. if currentPage=1 then
  196.         sqlArticle="select top "& MaxPerPage
  197. else
  198. sqlArticle="select "
  199. end if
  200. sqlArticle=sqlArticle &" ArticleID,Product_Id,BigClassName,SmallClassName,IncludePic,Title,Spec,Size,Memo,DefaultPicUrl,UpdateTime,Hits from Product where Passed=True "
  201. if BigClassName<>"" then
  202. sqlArticle=sqlArticle &" and BigClassName='" & BigClassName &"'"
  203. if SmallClassName<>"" then
  204. sqlArticle=sqlArticle & " and SmallClassName='" & SmallClassName & "'"
  205. end if
  206. else
  207. if SpecialName<>"" then
  208. sqlArticle=sqlArticle & " and SpecialName='" & SpecialName & "'"
  209. end if
  210. end if
  211. sqlArticle=sqlArticle & " order by ArticleID desc"
  212. Set rsArticle= Server.CreateObject("ADODB.Recordset")
  213. rsArticle.open sqlArticle,conn,1,1
  214. if rsArticle.bof and  rsArticle.eof then
  215. response.Write("<br><li>没有任何产品</li>")
  216. else
  217. if currentPage=1 then
  218. call ArticleContent(TitleLen)
  219. else
  220. if (currentPage-1)*MaxPerPage<totalPut then
  221.          rsArticle.move (currentPage-1)*MaxPerPage-1 '修正不显示第2页以后第一个产品的问题
  222.          dim bookmark
  223.          bookmark=rsArticle.bookmark
  224.          call ArticleContent(TitleLen)
  225.        else
  226.        currentPage=1
  227.          call ArticleContent(TitleLen)
  228.      end if
  229. end if
  230. end if
  231. rsArticle.close
  232. set rsArticle=nothing
  233. end sub
  234. sub ArticleContent(intTitleLen)
  235.     dim i,lb,strli
  236. Response.Write "<table width=100% border=0 cellspacing=2 cellpadding=0><TR><TD></TD></TR>"
  237.     i=1
  238. Response.Write "<TR align=""center"">"
  239. do while not rsArticle.eof
  240. strli=""
  241. strli=strli & " ● &nbsp;&nbsp;产品名称:"& rsArticle("Title") &" "&chr(13)
  242. strli=strli & " ● &nbsp;&nbsp;产品规格:"& rsArticle("Spec") &" "&chr(13)
  243. strli=strli & " ● &nbsp;&nbsp;产品尺寸:"& rsArticle("Size") &" "
  244. lb=""
  245. lb=lb & "<TD>"
  246. lb=lb & "<table width=130 border=0 cellspacing=0 cellpadding=0>"
  247. lb=lb & "<TR><TD height=5></TD></TR>"
  248. lb=lb & "<tr>"
  249. lb=lb & "<td width='98%'><div align=center>"
  250. lb=lb & "<a href='ProductShow.asp?ArticleID=" & rsArticle("articleid") & "'title='" & strli &"'>" 
  251. lb=lb & "<img border=0 src='"& rsArticle("DefaultPicUrl") &"' width=100 height=100></a>" 
  252. lb=lb & "</div></td>"
  253. lb=lb & "</tr>"
  254. lb=lb & "<TR><TD height=3></TD></TR>"
  255. lb=lb & "<tr>"
  256. lb=lb & "<td height=23 background=../img/tablebg1.gif><div align=center>"
  257. lb=lb & "<a href='ProductShow.asp?ArticleID="& rsArticle("articleid") &"'title='" & strli &"'>"& gotTopic(rsArticle("Title"),16) &"</a>"
  258. lb=lb & "</div></td>"
  259. lb=lb & "</tr>"
  260. lb=lb & "<tr>"
  261. lb=lb & "<td height=20 background=../img/tablebg2.gif><div align=center>"
  262. lb=lb & "<a href='ProductShow.asp?ArticleID="& rsArticle("articleid") &"'>查看</a>&nbsp;&nbsp;&nbsp;&nbsp;"
  263. lb=lb & "<a href='javascript:eshop("& rsArticle("Product_Id") &")'>订购</a>"
  264. lb=lb & "</div></td>"
  265. lb=lb & "</tr>"
  266. lb=lb & "<tr>" 
  267. lb=lb & "<td height=7 background='../img/tablebg3.gif'><IMG height=1 src='../img/1x1_pix.gif' width=1></td>"
  268. lb=lb & "</tr>"
  269. lb=lb & "</table>"
  270. lb=lb & "</TD>"
  271. response.write lb
  272. if i mod 4 =0 then
  273.   Response.Write "</TR><TR>"
  274. end if
  275. rsArticle.movenext
  276. i=i+1
  277. if i>=MaxPerPage then exit do
  278. loop
  279.  Response.Write "</TR><TR><TD></TD></TR></Table>"
  280. end sub 
  281. '=================================================
  282. '过程名:ShowSearchTerm
  283. '作  用:显示搜索条件信息
  284. '参  数:无
  285. '=================================================
  286. sub ShowSearchTerm()
  287. response.write "产品搜索&nbsp;&gt;&gt; "
  288. if BigClassName<>"" then
  289. response.write "<a href='Product.asp?BigClassName=" & BigClassName & "'>" & BigClassName & "</a>&nbsp;&gt;&gt;&nbsp;"
  290. if SmallClassName<>"" then
  291. response.write "<a href='Product.asp?BigClassName=" & BigClassName & "&SmallClassName=" & SmallClassName & "'>" & SmallClassName & "</a>&nbsp;&gt;&gt;&nbsp;"
  292. else
  293. response.write "所有小类&nbsp;&gt;&gt;&nbsp;"
  294. end if
  295. end if
  296. if keyword<>"" then
  297.   select case strField
  298. case "Title"
  299. response.Write "名称中含有 <font color=red>"&keyword&"</font> 的产品"
  300. case "Content"
  301. response.Write "说明含有 <font color=red>"&keyword&"</font> 的产品"
  302. case else
  303. response.Write "名称中含有 <font color=red>"&keyword&"</font> 的产品"
  304.   end select
  305. else
  306.   response.write "&nbsp;所有产品"
  307. end if
  308. end sub
  309. '=================================================
  310. '过程名:SearchResultTotal
  311. '作  用:显示搜索结果总数
  312. '参  数:无
  313. '=================================================
  314. sub SearchResultTotal()
  315. dim rsTotal,sqlTotal
  316. sqlTotal="select count(*) from Product where Passed=True "
  317. if BigClassName<>"" then
  318. sqlTotal=sqlTotal & " and BigClassName='" & BigClassName & "'"
  319. if SmallClassName<>"" then
  320. sqlTotal=sqlTotal & " and SmallClassName='" & SmallClassName & "'"
  321. end if
  322. else
  323. if SpecialName<>"" then
  324. sqlTotal=sqlTotal & " and SpecialName='" & SpecialName & "'"
  325. end if
  326. end if
  327. if keyword<>"" then
  328. select case strField
  329. case "Title"
  330. sqlTotal=sqlTotal & " and Title like '%" & keyword & "%'"
  331. case "Content"
  332. sqlTotal=sqlTotal & " and Content like '%" & keyword & "%'"
  333. case else
  334. sqlTotal=sqlTotal & " and Title like '%" & keyword & "%'"
  335. end select
  336. end if
  337. Set rsTotal= Server.CreateObject("ADODB.Recordset")
  338. rsTotal.open sqlTotal,conn,1,1
  339. if rsTotal.eof and rsTotal.bof then
  340. totalPut=0
  341. response.write "共有 0 个产品"
  342. else
  343. totalPut=rsTotal(0)
  344. response.Write "共找到 " & totalPut & " 个产品"
  345. end if
  346. end sub
  347. '=================================================
  348. '过程名:ShowSearchResult
  349. '作  用:分页显示搜索结果
  350. '参  数:无
  351. '=================================================
  352. sub ShowSearchResult()
  353.     if currentpage<1 then
  354.     currentpage=1
  355.     end if
  356. if (currentpage-1)*MaxPerPage>totalput then
  357. if (totalPut mod MaxPerPage)=0 then
  358.     currentpage= totalPut  MaxPerPage
  359. else
  360.     currentpage= totalPut  MaxPerPage + 1
  361. end if
  362.     end if
  363. if currentPage=1 then
  364.         sqlSearch="select top " & MaxPerPage
  365. else
  366. sqlSearch="select "
  367. end if
  368. sqlSearch=sqlSearch & " * from Product where Passed=True "
  369. if BigClassName<>"" then
  370. sqlSearch=sqlSearch & " and BigClassName='" & BigClassName & "'"
  371. if SmallClassName<>"" then
  372. sqlSearch=sqlSearch & " and SmallClassName='" & SmallClassName & "'"
  373. end if
  374. else
  375. if SpecialName<>"" then
  376. sqlSearch=sqlSearch & " and SpecialName='" & SpecialName & "'"
  377. end if
  378. end if
  379. if keyword<>"" then
  380. select case strField
  381. case "Title"
  382. sqlSearch=sqlSearch & " and Title like '%" & keyword & "%'"
  383. case "Content"
  384. sqlSearch=sqlSearch & " and Content like '%" & keyword & "%'"
  385. case else
  386. sqlSearch=sqlSearch & " and Title like '%" & keyword & "%'"
  387. end select
  388. end if
  389. sqlSearch=sqlSearch & " order by articleid desc"
  390. Set rsSearch= Server.CreateObject("ADODB.Recordset")
  391. rsSearch.open sqlSearch,conn,1,1
  392.   if rsSearch.eof and rsSearch.bof then 
  393.         response.write "<p align='center'><br><br>没有或没有找到任何产品</p>" 
  394.     else 
  395.     if currentPage=1 then 
  396.         call SearchResultContent()
  397.     else 
  398.         if (currentPage-1)*MaxPerPage<totalPut then 
  399.         rsSearch.move  (currentPage-1)*MaxPerPage 
  400.         dim bookmark 
  401.         bookmark=rsSearch.bookmark 
  402.         call SearchResultContent()
  403.        else 
  404.          currentPage=1 
  405.         call SearchResultContent()
  406.        end if 
  407.     end if 
  408.     end if 
  409.     rsSearch.close 
  410.     set rsSearch=nothing   
  411. end sub
  412. sub SearchResultContent()
  413.     dim i,strTemp,content
  414. i=1
  415. do while not rsSearch.eof
  416. strTemp=""
  417. strTemp=strTemp & cstr(i) & ".<a href='ProductShow.asp?ArticleID=" & rsSearch("articleid") & "'>"
  418. if strField="Title" then
  419. strTemp=strTemp & "<b>" & replace(rsSearch("title"),""&keyword&"","<font color=red>"&keyword&"</font>") & "</b></font></a>"
  420. else
  421. strTemp=strTemp & "<b>" & rsSearch("title") & "</b></a>"
  422. end if
  423. strTemp=strTemp & " [" & FormatDateTime(rsSearch("UpdateTime"),1) & "]"
  424. content=left(nohtml(rsSearch("content")),200)
  425. if strField="Content" then
  426. strTemp=strTemp & "<div style='padding:10px 20px'>" & replace(content,""&keyword&"","<font color=red>"&keyword&"</font>") & "……</div>"
  427. else
  428. strTemp=strTemp & "<div style='padding:10px 20px'>" & content & "……</div>"
  429. end if
  430. 'strTemp=strTemp & "</a>"
  431. response.write strTemp
  432. i=i+1
  433. if i>MaxPerPage then exit do
  434. rsSearch.movenext
  435. loop
  436. end sub 
  437. '=================================================
  438. '过程名:ShowSearch
  439. '作  用:显示文章搜索表单
  440. '参  数:ShowType ----显示方式。1为纵向,2为横向
  441. '=================================================
  442. sub ShowSearch(ShowType)
  443. dim count
  444. if ShowType<>1 and ShowType<>2 then
  445. ShowType=1
  446. end if
  447. set rs=server.createobject("adodb.recordset")
  448. sql = "select * from PrSmallClass order by SmallClassID asc"
  449. rs.open sql,conn,1,1
  450. %>
  451. <script language = "JavaScript">
  452. var onecount;
  453. subcat = new Array();
  454.         <%
  455.         count = 0
  456.         do while not rs.eof 
  457.         %>
  458. subcat[<%=count%>] = new Array("<%= trim(rs("SmallClassName"))%>","<%= trim(rs("BigClassName"))%>","<%= trim(rs("SmallClassName"))%>");
  459.         <%
  460.         count = count + 1
  461.         rs.movenext
  462.         loop
  463.         rs.close
  464.         %>
  465. onecount=<%=count%>;
  466. function changelocation(locationid)
  467.     {
  468.     document.myform.SmallClassName.length = 1; 
  469.     var locationid=locationid;
  470.     var i;
  471.     for (i=0;i < onecount; i++)
  472.         {
  473.             if (subcat[i][1] == locationid)
  474.             { 
  475.                 document.myform.SmallClassName.options[document.myform.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
  476.             }        
  477.         }
  478.     }    
  479. </script>
  480. <table border="0" cellpadding="2" cellspacing="0" align="center">
  481.   <form method="Get" name="myform" action="Search.asp">
  482.     <tr>
  483.       <td height="28"> <select name="Field" size="1">
  484.         <option value="Title" selected>产品名称</option>
  485.         <option value="Content">产品说明</option>
  486.        </select>
  487.        <%if ShowType=1 then%>
  488.      </td>
  489.    </tr>
  490.    <tr>
  491.      <td height="28">
  492. <%end if%>
  493. <select name="BigClassName" onChange="changelocation(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].value)" size="1">
  494. <option selected value="">所有大类</option>
  495. <%
  496. if not (rsBigClass.bof and rsBigClass.eof) then
  497. rsBigClass.movefirst
  498. do while not rsBigClass.eof
  499.         response.Write "<option value='" & trim(rsBigClass("BigClassName")) & "'>" & trim(rsBigClass("BigClassName")) & "</option>"
  500.     rsBigClass.movenext
  501. loop
  502. end if
  503. %>
  504.       </select>
  505.       <%if ShowType=1 then%>
  506.     </td>
  507.   </tr>
  508.   <tr>
  509.     <td height="28">
  510.       <%end if%>
  511.       <select name="SmallClassName">                  
  512.         <option selected value="">所有小类</option>
  513.       </select>
  514.       <%if ShowType=1 then%>
  515.     </td>
  516.   </tr>
  517.   <tr>
  518.     <td height="28">
  519.       <%end if%>
  520.       <input type="text" name="keyword"  size=15 value="关键字" maxlength="50" onFocus="this.select();">
  521.       <input type="submit" name="Submit"  value="搜索"> </td>
  522.   </tr>
  523. </form>
  524. </table>
  525. <%
  526. end sub
  527. '=========================================================================
  528. '过程名:ShowSearch4
  529. '作  用:显示文章搜索表单
  530. '参  数:ShowType ----显示方式。1为纵向,2为横向
  531. '=========================================================================
  532. sub ShowSearch4(ShowType)
  533. dim count
  534. if ShowType<>1 and ShowType<>2 then
  535. ShowType=1
  536. end if
  537. set rs=server.createobject("adodb.recordset")
  538. sql = "select * from PrSmallClass order by SmallClassID asc"
  539. rs.open sql,conn,1,1
  540. %>
  541. <script language = "JavaScript">
  542. var onecount;
  543. subcat = new Array();
  544.         <%
  545.         count = 0
  546.         do while not rs.eof 
  547.         %>
  548. subcat[<%=count%>] = new Array("<%= trim(rs("SmallClassName"))%>","<%= trim(rs("BigClassName"))%>","<%= trim(rs("SmallClassName"))%>");
  549.         <%
  550.         count = count + 1
  551.         rs.movenext
  552.         loop
  553.         rs.close
  554.         %>
  555. onecount=<%=count%>;
  556. function changelocation(locationid)
  557.     {
  558.     document.myform.SmallClassName.length = 1; 
  559.     var locationid=locationid;
  560.     var i;
  561.     for (i=0;i < onecount; i++)
  562.         {
  563.             if (subcat[i][1] == locationid)
  564.             { 
  565.                 document.myform.SmallClassName.options[document.myform.SmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
  566.             }        
  567.         }
  568.     }    
  569. </script>
  570. <table border="0" cellpadding="2" cellspacing="0" align="center">
  571.   <form method="Get" name="myform" action="Search.asp">
  572.     <tr>
  573.       <td height="28"> <select name="Field" size="1">
  574.         <option value="Title" selected>产品名称</option>
  575.         <option value="Content">产品说明</option>
  576.        </select>
  577.        <%if ShowType=1 then%>
  578.      </td>
  579.    </tr>
  580.    <tr>
  581.      <td height="28">
  582. <%end if%>
  583. <select name="BigClassName" onChange="changelocation(document.myform.BigClassName.options[document.myform.BigClassName.selectedIndex].value)" size="1">
  584. <option selected value="">所有大类</option>
  585. <%
  586. if not (rsBigClass.bof and rsBigClass.eof) then
  587. rsBigClass.movefirst
  588. do while not rsBigClass.eof
  589.         response.Write "<option value='" & trim(rsBigClass("BigClassName")) & "'>" & trim(rsBigClass("BigClassName")) & "</option>"
  590.     rsBigClass.movenext
  591. loop
  592. end if
  593. %>
  594.       </select>
  595.       <%if ShowType=1 then%>
  596.     </td>
  597.   </tr>
  598.   <tr>
  599.     <td height="28">
  600.       <%end if%>
  601.       <select name="SmallClassName">                  
  602.         <option selected value="">所有小类</option>
  603.       </select>
  604.       <%if ShowType=1 then%>
  605.     </td>
  606.   </tr>
  607.   <tr>
  608.     <td height="28">
  609.       <%end if%>
  610.       <input type="text" name="keyword"  size=15 value="关键字" maxlength="50" onFocus="this.select();">
  611.       <input type="submit" name="Submit"  value="搜索"> </td>
  612.   </tr>
  613. </form>
  614. </table>
  615. <%
  616. end sub
  617. '=================================================
  618. '过程名:ShowAllClass
  619. '作  用:显示所有栏目(栏目导航)
  620. '参  数:无
  621. '=================================================
  622. sub ShowAllClass()
  623. if rsBigClass.bof and rsBigClass.eof then 
  624. response.Write "&nbsp;没有任何栏目"
  625. else
  626. dim sqlClass,rsClass,strClassName
  627. rsBigClass.movefirst
  628. do while not rsBigClass.eof
  629. strClassName= "【<a href='Product.asp?BigClassName=" & rsBigClass("BigClassName") & "'><b>" & rsBigClass("BigClassName") & "</b></a>】<br><br>"
  630. sqlClass="select * from PrSmallClass where BigClassName='" & rsBigClass("BigClassName") & "'Order by SmallClassID"
  631. Set rsClass= Server.CreateObject("ADODB.Recordset")
  632. rsClass.open sqlClass,conn,1,1
  633. do while not rsClass.eof
  634. strClassName=strClassName & "&nbsp;<a href='Product.asp?BigClassName=" & rsClass("BigClassName") & "&SmallClassName=" & rsClass("SmallClassName") & "'>" & rsClass("SmallClassName") & "</a>&nbsp;"
  635. rsClass.movenext
  636. loop
  637. response.write strClassName & "<br><br>"
  638. rsBigClass.movenext
  639. loop
  640. rsClass.close
  641. set rsClass=nothing
  642. end if
  643. end sub
  644. '=================================================
  645. '过程名:ShowArticleContent
  646. '作  用:显示文章具体的内容,可以分页显示
  647. '参  数:无
  648. '=================================================
  649. sub ShowArticleContent()
  650. dim ArticleID,strContent,CurrentPage
  651. dim ContentLen,MaxPerPage,pages,i,lngBound
  652. dim BeginPoint,EndPoint
  653. ArticleID=rs("ArticleID")
  654. strContent=rs("Content")
  655. ContentLen=len(strContent)
  656. CurrentPage=trim(request("ArticlePage"))
  657. if ShowContentByPage="No" or ContentLen<=200000 then
  658. response.write strContent
  659. if ShowContentByPage="Yes" then
  660. response.write "</p><p align='center'></p>"
  661. end if
  662. else
  663. if CurrentPage="" then
  664. CurrentPage=1
  665. else
  666. CurrentPage=Cint(CurrentPage)
  667. end if
  668. pages=ContentLenMaxPerPage_Content
  669. if MaxPerPage_Content*pages<ContentLen then
  670. pages=pages+1
  671. end if
  672. lngBound=MaxPerPage_Content          '最大误差范围
  673. if CurrentPage<1 then CurrentPage=1
  674. if CurrentPage>pages then CurrentPage=pages
  675. dim lngTemp
  676. dim lngTemp1,lngTemp1_1,lngTemp1_2,lngTemp1_1_1,lngTemp1_1_2,lngTemp1_1_3,lngTemp1_2_1,lngTemp1_2_2,lngTemp1_2_3
  677. dim lngTemp2,lngTemp2_1,lngTemp2_2,lngTemp2_1_1,lngTemp2_1_2,lngTemp2_2_1,lngTemp2_2_2
  678. dim lngTemp3,lngTemp3_1,lngTemp3_2,lngTemp3_1_1,lngTemp3_1_2,lngTemp3_2_1,lngTemp3_2_2
  679. dim lngTemp4,lngTemp4_1,lngTemp4_2,lngTemp4_1_1,lngTemp4_1_2,lngTemp4_2_1,lngTemp4_2_2
  680. dim lngTemp5,lngTemp5_1,lngTemp5_2
  681. dim lngTemp6,lngTemp6_1,lngTemp6_2
  682. if CurrentPage=1 then
  683. BeginPoint=1
  684. else
  685. BeginPoint=MaxPerPage_Content*(CurrentPage-1)+1
  686. lngTemp1_1_1=instr(BeginPoint,strContent,"</table>",1)
  687. lngTemp1_1_2=instr(BeginPoint,strContent,"</TABLE>",1)
  688. lngTemp1_1_3=instr(BeginPoint,strContent,"</Table>",1)
  689. if lngTemp1_1_1>0 then
  690. lngTemp1_1=lngTemp1_1_1
  691. elseif lngTemp1_1_2>0 then
  692. lngTemp1_1=lngTemp1_1_2
  693. elseif lngTemp1_1_3>0 then
  694. lngTemp1_1=lngTemp1_1_3
  695. else
  696. lngTemp1_1=0
  697. end if
  698. lngTemp1_2_1=instr(BeginPoint,strContent,"<table",1)
  699. lngTemp1_2_2=instr(BeginPoint,strContent,"<TABLE",1)
  700. lngTemp1_2_3=instr(BeginPoint,strContent,"<Table",1)
  701. if lngTemp1_2_1>0 then
  702. lngTemp1_2=lngTemp1_2_1
  703. elseif lngTemp1_2_2>0 then
  704. lngTemp1_2=lngTemp1_2_2
  705. elseif lngTemp1_2_3>0 then
  706. lngTemp1_2=lngTemp1_2_3
  707. else
  708. lngTemp1_2=0
  709. end if
  710. if lngTemp1_1=0 and lngTemp1_2=0 then
  711. lngTemp1=BeginPoint
  712. else
  713. if lngTemp1_1>lngTemp1_2 then
  714. lngtemp1=lngTemp1_2
  715. else
  716. lngTemp1=lngTemp1_1+8
  717. end if
  718. end if
  719. lngTemp2_1_1=instr(BeginPoint,strContent,"</p>",1)
  720. lngTemp2_1_2=instr(BeginPoint,strContent,"</P>",1)
  721. if lngTemp2_1_1>0 then
  722. lngTemp2_1=lngTemp2_1_1
  723. elseif lngTemp2_1_2>0 then
  724. lngTemp2_1=lngTemp2_1_2
  725. else
  726. lngTemp2_1=0
  727. end if
  728. lngTemp2_2_1=instr(BeginPoint,strContent,"<p",1)
  729. lngTemp2_2_2=instr(BeginPoint,strContent,"<P",1)
  730. if lngTemp2_2_1>0 then
  731. lngTemp2_2=lngTemp2_2_1
  732. elseif lngTemp2_2_2>0 then
  733. lngTemp2_2=lngTemp2_2_2
  734. else
  735. lngTemp2_2=0
  736. end if
  737. if lngTemp2_1=0 and lngTemp2_2=0 then
  738. lntTemp2=BeginPoint
  739. else
  740. if lngTemp2_1>lngTemp2_2 then
  741. lngtemp2=lngTemp2_2
  742. else
  743. lngTemp2=lngTemp2_1+4
  744. end if
  745. end if
  746. lngTemp3_1_1=instr(BeginPoint,strContent,"</ur>",1)
  747. lngTemp3_1_2=instr(BeginPoint,strContent,"</UR>",1)
  748. if lngTemp3_1_1>0 then
  749. lngTemp3_1=lngTemp3_1_1
  750. elseif lngTemp3_1_2>0 then
  751. lngTemp3_1=lngTemp3_1_2
  752. else
  753. lngTemp3_1=0
  754. end if
  755. lngTemp3_2_1=instr(BeginPoint,strContent,"<ur",1)
  756. lngTemp3_2_2=instr(BeginPoint,strContent,"<UR",1)
  757. if lngTemp3_2_1>0 then
  758. lngTemp3_2=lngTemp3_2_1
  759. elseif lngTemp3_2_2>0 then
  760. lngTemp3_2=lngTemp3_2_2
  761. else
  762. lngTemp3_2=0
  763. end if
  764. if lngTemp3_1=0 and lngTemp3_2=0 then
  765. lngTemp3=BeginPoint
  766. else
  767. if lngTemp3_1>lngTemp3_2 then
  768. lngtemp3=lngTemp3_2
  769. else
  770. lngTemp3=lngTemp3_1+5
  771. end if
  772. end if
  773. if lngTemp1<lngTemp2 then
  774. lngTemp=lngTemp2
  775. else
  776. lngTemp=lngTemp1
  777. end if
  778. if lngTemp<lngTemp3 then
  779. lngTemp=lngTemp3
  780. end if
  781. if lngTemp>BeginPoint and lngTemp<=BeginPoint+lngBound then
  782. BeginPoint=lngTemp
  783. else
  784. lngTemp4_1_1=instr(BeginPoint,strContent,"</li>",1)
  785. lngTemp4_1_2=instr(BeginPoint,strContent,"</LI>",1)
  786. if lngTemp4_1_1>0 then
  787. lngTemp4_1=lngTemp4_1_1
  788. elseif lngTemp4_1_2>0 then
  789. lngTemp4_1=lngTemp4_1_2
  790. else
  791. lngTemp4_1=0
  792. end if
  793. lngTemp4_2_1=instr(BeginPoint,strContent,"<li",1)
  794. lngTemp4_2_1=instr(BeginPoint,strContent,"<LI",1)
  795. if lngTemp4_2_1>0 then
  796. lngTemp4_2=lngTemp4_2_1
  797. elseif lngTemp4_2_2>0 then
  798. lngTemp4_2=lngTemp4_2_2
  799. else
  800. lngTemp4_2=0
  801. end if
  802. if lngTemp4_1=0 and lngTemp4_2=0 then
  803. lngTemp4=BeginPoint
  804. else
  805. if lngTemp4_1>lngTemp4_2 then
  806. lngtemp4=lngTemp4_2
  807. else
  808. lngTemp4=lngTemp4_1+5
  809. end if
  810. end if
  811. if lngTemp4>BeginPoint and lngTemp4<=BeginPoint+lngBound then
  812. BeginPoint=lngTemp4
  813. else
  814. lngTemp5_1=instr(BeginPoint,strContent,"<img",1)
  815. lngTemp5_2=instr(BeginPoint,strContent,"<IMG",1)
  816. if lngTemp5_1>0 then
  817. lngTemp5=lngTemp5_1
  818. elseif lngTemp5_2>0 then
  819. lngTemp5=lngTemp5_2
  820. else
  821. lngTemp5=BeginPoint
  822. end if
  823. if lngTemp5>BeginPoint and lngTemp5<BeginPoint+lngBound then
  824. BeginPoint=lngTemp5
  825. else
  826. lngTemp6_1=instr(BeginPoint,strContent,"<br>",1)
  827. lngTemp6_2=instr(BeginPoint,strContent,"<BR>",1)
  828. if lngTemp6_1>0 then
  829. lngTemp6=lngTemp6_1
  830. elseif lngTemp6_2>0 then
  831. lngTemp6=lngTemp6_2
  832. else
  833. lngTemp6=0
  834. end if
  835. if lngTemp6>BeginPoint and lngTemp6<BeginPoint+lngBound then
  836. BeginPoint=lngTemp6+4
  837. end if
  838. end if
  839. end if
  840. end if
  841. end if
  842. if CurrentPage=pages then
  843. EndPoint=ContentLen
  844. else
  845.   EndPoint=MaxPerPage_Content*CurrentPage
  846.   if EndPoint>=ContentLen then
  847. EndPoint=ContentLen
  848.   else
  849. lngTemp1_1_1=instr(EndPoint,strContent,"</table>",1)
  850. lngTemp1_1_2=instr(EndPoint,strContent,"</TABLE>",1)
  851. lngTemp1_1_3=instr(EndPoint,strContent,"</Table>",1)
  852. if lngTemp1_1_1>0 then
  853. lngTemp1_1=lngTemp1_1_1
  854. elseif lngTemp1_1_2>0 then
  855. lngTemp1_1=lngTemp1_1_2
  856. elseif lngTemp1_1_3>0 then
  857. lngTemp1_1=lngTemp1_1_3
  858. else
  859. lngTemp1_1=0
  860. end if
  861. lngTemp1_2_1=instr(EndPoint,strContent,"<table",1)
  862. lngTemp1_2_2=instr(EndPoint,strContent,"<TABLE",1)
  863. lngTemp1_2_3=instr(EndPoint,strContent,"<Table",1)
  864. if lngTemp1_2_1>0 then
  865. lngTemp1_2=lngTemp1_2_1
  866. elseif lngTemp1_2_2>0 then
  867. lngTemp1_2=lngTemp1_2_2
  868. elseif lngTemp1_2_3>0 then
  869. lngTemp1_2=lngTemp1_2_3
  870. else
  871. lngTemp1_2=0
  872. end if
  873. if lngTemp1_1=0 and lngTemp1_2=0 then
  874. lngTemp1=EndPoint
  875. else
  876. if lngTemp1_1>lngTemp1_2 then
  877. lngtemp1=lngTemp1_2-1
  878. else
  879. lngTemp1=lngTemp1_1+7
  880. end if
  881. end if
  882. lngTemp2_1_1=instr(EndPoint,strContent,"</p>",1)
  883. lngTemp2_1_2=instr(EndPoint,strContent,"</P>",1)
  884. if lngTemp2_1_1>0 then
  885. lngTemp2_1=lngTemp2_1_1
  886. elseif lngTemp2_1_2>0 then
  887. lngTemp2_1=lngTemp2_1_2
  888. else
  889. lngTemp2_1=0
  890. end if
  891. lngTemp2_2_1=instr(EndPoint,strContent,"<p",1)
  892. lngTemp2_2_2=instr(EndPoint,strContent,"<P",1)
  893. if lngTemp2_2_1>0 then
  894. lngTemp2_2=lngTemp2_2_1
  895. elseif lngTemp2_2_2>0 then
  896. lngTemp2_2=lngTemp2_2_2
  897. else
  898. lngTemp2_2=0
  899. end if
  900. if lngTemp2_1=0 and lngTemp2_2=0 then
  901. lngTemp2=EndPoint
  902. else
  903. if lngTemp2_1>lngTemp2_2 then
  904. lngTemp2=lngTemp2_2-1
  905. else
  906. lngTemp2=lngTemp2_1+3
  907. end if
  908. end if
  909. lngTemp3_1_1=instr(EndPoint,strContent,"</ur>",1)
  910. lngTemp3_1_2=instr(EndPoint,strContent,"</UR>",1)
  911. if lngTemp3_1_1>0 then
  912. lngTemp3_1=lngTemp3_1_1
  913. elseif lngTemp3_1_2>0 then
  914. lngTemp3_1=lngTemp3_1_2
  915. else
  916. lngTemp3_1=0
  917. end if
  918. lngTemp3_2_1=instr(EndPoint,strContent,"<ur",1)
  919. lngTemp3_2_2=instr(EndPoint,strContent,"<UR",1)
  920. if lngTemp3_2_1>0 then
  921. lngTemp3_2=lngTemp3_2_1
  922. elseif lngTemp3_2_2>0 then
  923. lngTemp3_2=lngTemp3_2_2
  924. else
  925. lngTemp3_2=0
  926. end if
  927. if lngTemp3_1=0 and lngTemp3_2=0 then
  928. lngTemp3=EndPoint
  929. else
  930. if lngTemp3_1>lngTemp3_2 then
  931. lngtemp3=lngTemp3_2-1
  932. else
  933. lngTemp3=lngTemp3_1+4
  934. end if
  935. end if
  936. if lngTemp1<lngTemp2 then
  937. lngTemp=lngTemp2
  938. else
  939. lngTemp=lngTemp1
  940. end if
  941. if lngTemp<lngTemp3 then
  942. lngTemp=lngTemp3
  943. end if
  944. if lngTemp>EndPoint and lngTemp<=EndPoint+lngBound then
  945. EndPoint=lngTemp
  946. else
  947. lngTemp4_1_1=instr(EndPoint,strContent,"</li>",1)
  948. lngTemp4_1_2=instr(EndPoint,strContent,"</LI>",1)
  949. if lngTemp4_1_1>0 then
  950. lngTemp4_1=lngTemp4_1_1
  951. elseif lngTemp4_1_2>0 then
  952. lngTemp4_1=lngTemp4_1_2
  953. else
  954. lngTemp4_1=0
  955. end if
  956. lngTemp4_2_1=instr(EndPoint,strContent,"<li",1)
  957. lngTemp4_2_1=instr(EndPoint,strContent,"<LI",1)
  958. if lngTemp4_2_1>0 then
  959. lngTemp4_2=lngTemp4_2_1
  960. elseif lngTemp4_2_2>0 then
  961. lngTemp4_2=lngTemp4_2_2
  962. else
  963. lngTemp4_2=0
  964. end if
  965. if lngTemp4_1=0 and lngTemp4_2=0 then
  966. lngTemp4=EndPoint
  967. else
  968. if lngTemp4_1>lngTemp4_2 then
  969. lngtemp4=lngTemp4_2-1
  970. else
  971. lngTemp4=lngTemp4_1+4
  972. end if
  973. end if
  974. if lngTemp4>EndPoint and lngTemp4<=EndPoint+lngBound then
  975. EndPoint=lngTemp4
  976. else
  977. lngTemp5_1=instr(EndPoint,strContent,"<img",1)
  978. lngTemp5_2=instr(EndPoint,strContent,"<IMG",1)
  979. if lngTemp5_1>0 then
  980. lngTemp5=lngTemp5_1-1
  981. elseif lngTemp5_2>0 then
  982. lngTemp5=lngTemp5_2-1
  983. else
  984. lngTemp5=EndPoint
  985. end if
  986. if lngTemp5>EndPoint and lngTemp5<EndPoint+lngBound then
  987. EndPoint=lngTemp5
  988. else
  989. lngTemp6_1=instr(EndPoint,strContent,"<br>",1)
  990. lngTemp6_2=instr(EndPoint,strContent,"<BR>",1)
  991. if lngTemp6_1>0 then
  992. lngTemp6=lngTemp6_1+3
  993. elseif lngTemp6_2>0 then
  994. lngTemp6=lngTemp6_2+3
  995. else
  996. lngTemp6=EndPoint
  997. end if
  998. if lngTemp6>EndPoint and lngTemp6<EndPoint+lngBound then
  999. EndPoint=lngTemp6
  1000. end if
  1001. end if
  1002. end if
  1003. end if
  1004.   end if
  1005. end if
  1006. response.write mid(strContent,BeginPoint,EndPoint-BeginPoint)
  1007. response.write "</p><p align='center'><b>"
  1008. if CurrentPage>1 then
  1009. response.write "<a href='ProductShow.asp?ArticleID=" & ArticleID & "&ArticlePage=" & CurrentPage-1 & "'>上一页</a>&nbsp;&nbsp;"
  1010. end if
  1011. for i=1 to pages
  1012. if i=CurrentPage then
  1013. response.write "<font color='red'>[" & cstr(i) & "]</font>&nbsp;"
  1014. else
  1015. response.write "<a href='ProductShow.asp?ArticleID=" & ArticleID & "&ArticlePage=" & i & "'>[" & i & "]</a>&nbsp;"
  1016. end if
  1017. next
  1018. if CurrentPage<pages then
  1019. response.write "&nbsp;<a href='ProductShow.asp?ArticleID=" & ArticleID & "&ArticlePage=" & CurrentPage+1 & "'>下一页</a>"
  1020. end if
  1021. response.write "</b></p>"
  1022. end if
  1023. end sub
  1024. %>