En_SysProduct3.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 EnBigClassName,EnSmallClassName,SpecialName,keyword,strField
  7. dim rs,sql,sqlArticle,rsArticle,sqlSearch,rsSearch,sqlBigClass,rsBigClass,sqlSpecial,rsSpecial
  8. dim SpecialTotal
  9. BeginTime=Timer
  10. EnBigClassName=Trim(request("EnBigClassName"))
  11. EnSmallClassName=Trim(request("EnSmallClassName"))
  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 "The column is under construction……"
  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=26 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='En_Product.asp?EnBigClassName=<%=rsBigClass("EnBigClassName")%>'><%=rsBigClass("EnBigClassName")%></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 EnBigClassName='" & rsBigClass("EnBigClassName") & "'order by SmallClassID"
  63. rss.open sqls,conn,1,1
  64. if rss.eof and rss.bof then
  65. Response.Write "No small class"
  66. else
  67. j=1
  68. do while not rss.eof
  69. %>
  70. <IMG height=20 src="../img/class3.gif" width=26 align=absMiddle border=0><a href="En_Product.asp?EnBigClassName=<%=rss("EnBigClassName")%>&EnSmallclassname=<%=rss("EnSmallClassName")%>"><%=rss("EnSmallClassName")%></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;There is not any investigation" 'There is not any investigation没有任何调查
  102. else
  103. response.write "<form name='VoteForm'method='post'action='En_vote.asp'target='_blank'><td>"
  104. response.write "&nbsp;&nbsp;&nbsp;&nbsp;" & rsVote("EnTitle") & "<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='En_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='En_Product.asp'>ProductShow</a>&nbsp;&gt;&gt;" 'ProductShow 产品展示
  134. if EnBigClassName="" and EnSmallClassName="" then
  135. response.write "&nbsp;All products"
  136. else
  137. if EnBigClassName<>"" then
  138. response.write "&nbsp;<a href='En_Product.asp?EnBigClassName=" & EnBigClassName & "'>" & EnBigClassName & "</a>&nbsp;&gt;&gt;&nbsp;"
  139. if EnSmallClassName<>"" then
  140. response.write "<a href='En_Product.asp?EnBigClassName=" & EnBigClassName & "&EnSmallClassName=" & EnSmallClassName & "'>" & EnSmallClassName & "</a>"
  141. else
  142. response.write "All small class"
  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 EnBigClassName<>"" then
  157. sqlTotal=sqlTotal & " and EnBigClassName='" & EnBigClassName & "'"
  158. if EnSmallClassName<>"" then
  159. sqlTotal=sqlTotal & " and EnSmallClassName='" & EnSmallClassName & "'"
  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 "Altogether 0 a product" '共有  个产品
  171. else
  172. totalPut=rsTotal(0)
  173. response.Write "Altogether " & totalPut & " a product" '共有  个产品
  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,EnBigClassName,EnSmallClassName,IncludePic,EnTitle,EnSpec,Size,EnMemo,DefaultPicUrl,UpdateTime,Hits from Product where Passed=True "
  201. if EnBigClassName<>"" then
  202. sqlArticle=sqlArticle & " and EnBigClassName='" & EnBigClassName & "'"
  203. if EnSmallClassName<>"" then
  204. sqlArticle=sqlArticle & " and EnSmallClassName='" & EnSmallClassName & "'"
  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>There are not any products</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
  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,strTemp
  236.     i=0
  237. do while not rsArticle.eof
  238. strTemp=""
  239. 'strTemp = strTemp & ""
  240. strTemp= strTemp & "<table width=100% border=0 cellspacing=3 cellpadding=0>"
  241. strTemp= strTemp & "<tr>"
  242. strTemp= strTemp & "<td width=30% rowspan=6>"
  243. strTemp= strTemp & "<div align=center><a href=En_ProductShow.asp?ArticleID=" & rsArticle("articleid") & ">" 
  244. strTemp= strTemp & "<img border=0 src='" & rsArticle("DefaultPicUrl") & "' width=120 height=120>" 
  245. strTemp= strTemp & "</a></div></td>"
  246. strTemp= strTemp & "<td width=12% height=12>Name:</td>"
  247. strTemp= strTemp & "<td><a href=En_ProductShow.asp?ArticleID=" & rsArticle("articleid") & ">" & rsArticle("EnTitle") & "</a></td>"
  248. strTemp= strTemp & "</tr>"
  249. strTemp= strTemp & "<tr>"
  250. strTemp= strTemp & "<td width=12% height=12>Spec:</td>"
  251. strTemp= strTemp & "<td>" & rsArticle("EnSpec") & "</td>"
  252. strTemp= strTemp & "</tr>"
  253. strTemp= strTemp & "<tr>"
  254. strTemp= strTemp & "<td width=12% height=12>Size:</td>"
  255. strTemp= strTemp & "<td>" & rsArticle("Size") & "</td>"
  256. strTemp= strTemp & "</tr>"
  257. strTemp= strTemp & "<tr>"
  258. strTemp= strTemp & "<td height=12>class:</td>"
  259. strTemp= strTemp & "<td><a href='En_Product.asp?EnBigClassName=" & rsArticle("EnBigClassName") & "'>" & rsArticle("EnBigClassName") & "</a> → "
  260. strTemp= strTemp & "<a href='En_Product.asp?EnBigClassName=" & rsArticle("EnBigClassName") & "&EnSmallClassName=" & rsArticle("EnSmallClassName") & "'>" & rsArticle("EnSmallClassName") & ""
  261. strTemp= strTemp & "</a></td>"
  262. strTemp= strTemp & "</tr>" 
  263. strTemp= strTemp & "<tr>"
  264. strTemp= strTemp & "<td height=12>Info:</td>"
  265. strTemp= strTemp & "<td><a href=En_ProductShow.asp?ArticleID=" & rsArticle("articleid") & "><img src=../Img/En_arrow_7.gif border=0></a></td>"
  266. strTemp= strTemp & "</tr>"
  267. strTemp= strTemp & "<tr>"
  268. strTemp= strTemp & "<td colspan=2>"
  269. strTemp= strTemp & "<table width=100% border=0 cellpadding=0 cellspacing=0>"
  270. strTemp= strTemp & "<tr>" 
  271. strTemp= strTemp & "<td width=50% height=12>"
  272. strTemp= strTemp & "<div align=center></div></td>"
  273. strTemp= strTemp & "<td width=50% height=12>"
  274. strTemp= strTemp & "<div align=center><a href='javascript:eshop(" & rsArticle("Product_Id") & ")'><img border=0 src=../Img/En_addtocart.gif width=95 height=17>"
  275. strTemp= strTemp & "</a></div></td>"
  276. strTemp= strTemp & "</tr>"
  277. strTemp= strTemp & "</table>"
  278. strTemp= strTemp & "</td>"
  279. strTemp= strTemp & "</tr>" 
  280. strTemp= strTemp & "<tr>" 
  281. strTemp= strTemp & "<td height=1 colspan=3 bgcolor=#CCCCCC></td>"
  282. strTemp= strTemp & "</tr>"
  283. strTemp= strTemp & "</table>"
  284. response.write strTemp
  285. rsArticle.movenext
  286. i=i+1
  287. if i>=MaxPerPage then exit do
  288. loop
  289. end sub 
  290. '=========================================================================
  291. '过程名:ShowSearchTerm
  292. '作  用:显示搜索条件信息
  293. '参  数:无
  294. '=========================================================================
  295. sub ShowSearchTerm()
  296. response.write "|&nbsp;ProductSearch&nbsp;&gt;&gt; " 'Product search产品搜索
  297. if EnBigClassName<>"" then
  298. response.write "<a href='En_Default.asp?EnBigClassName=" & EnBigClassName & "'>" & EnBigClassName & "</a>&nbsp;&gt;&gt;&nbsp;"
  299. if EnSmallClassName<>"" then
  300. response.write "<a href='En_Default.asp?EnBigClassName=" & EnBigClassName & "&EnSmallClassName=" & EnSmallClassName & "'>" & EnSmallClassName & "</a>&nbsp;&gt;&gt;&nbsp;"
  301. else
  302. response.write "All Small Class &nbsp;&gt;&gt;&nbsp;" 'All Small Class所有小类
  303. end if
  304. end if
  305. if keyword<>"" then
  306.   select case strField
  307. case "EnTitle"
  308. response.Write "Contain in the name <font color=red>"&keyword&"</font> Products" '名称中含有  的产品
  309. case "EnContent"
  310. response.Write "Contain description <font color=red>"&keyword&"</font> Products" '说明含有  的产品 
  311. case else
  312. response.Write "Contain name <font color=red>"&keyword&"</font> Products" '名称中含有  的产品 
  313.   end select
  314. else
  315.   response.write "&nbsp;All products" '所有产品
  316. end if
  317. end sub
  318. '=========================================================================
  319. '过程名:SearchResultTotal
  320. '作  用:显示搜索结果总数
  321. '参  数:无
  322. '=========================================================================
  323. sub SearchResultTotal()
  324. dim rsTotal,sqlTotal
  325. sqlTotal="select count(*) from Product where Passed=True "
  326. if EnBigClassName<>"" then
  327. sqlTotal=sqlTotal & " and EnBigClassName='" & EnBigClassName & "'"
  328. if EnSmallClassName<>"" then
  329. sqlTotal=sqlTotal & " and EnSmallClassName='" & EnSmallClassName & "'"
  330. end if
  331. else
  332. if SpecialName<>"" then
  333. sqlTotal=sqlTotal & " and SpecialName='" & SpecialName & "'"
  334. end if
  335. end if
  336. if keyword<>"" then
  337. select case strField
  338. case "EnTitle"
  339. sqlTotal=sqlTotal & " and EnTitle like '%" & keyword & "%'"
  340. case "EnContent"
  341. sqlTotal=sqlTotal & " and EnContent like '%" & keyword & "%'"
  342. case else
  343. sqlTotal=sqlTotal & " and EnTitle like '%" & keyword & "%'"
  344. end select
  345. end if
  346. Set rsTotal= Server.CreateObject("ADODB.Recordset")
  347. rsTotal.open sqlTotal,conn,1,1
  348. if rsTotal.eof and rsTotal.bof then
  349. totalPut=0
  350. response.write "Altogether 0 a product" '共有 0 个产品
  351. else
  352. totalPut=rsTotal(0)
  353. response.Write "Find altogether " & totalPut & " a product" '共找到  个产品
  354. end if
  355. end sub
  356. '=========================================================================
  357. '过程名:ShowSearchResult
  358. '作  用:分页显示搜索结果
  359. '参  数:无
  360. '=========================================================================
  361. sub ShowSearchResult()
  362.     if currentpage<1 then
  363.     currentpage=1
  364.     end if
  365. if (currentpage-1)*MaxPerPage>totalput then
  366. if (totalPut mod MaxPerPage)=0 then
  367.     currentpage= totalPut  MaxPerPage
  368. else
  369.     currentpage= totalPut  MaxPerPage + 1
  370. end if
  371.     end if
  372. if currentPage=1 then
  373.         sqlSearch="select top " & MaxPerPage
  374. else
  375. sqlSearch="select "
  376. end if
  377. sqlSearch=sqlSearch & " * from Product where Passed=True "
  378. if EnBigClassName<>"" then
  379. sqlSearch=sqlSearch & " and EnBigClassName='" & EnBigClassName & "'"
  380. if EnSmallClassName<>"" then
  381. sqlSearch=sqlSearch & " and EnSmallClassName='" & EnSmallClassName & "'"
  382. end if
  383. else
  384. if SpecialName<>"" then
  385. sqlSearch=sqlSearch & " and SpecialName='" & SpecialName & "'"
  386. end if
  387. end if
  388. if keyword<>"" then
  389. select case strField
  390. case "EnTitle"
  391. sqlSearch=sqlSearch & " and EnTitle like '%" & keyword & "%'"
  392. case "EnContent"
  393. sqlSearch=sqlSearch & " and EnContent like '%" & keyword & "%'"
  394. case else
  395. sqlSearch=sqlSearch & " and EnTitle like '%" & keyword & "%'"
  396. end select
  397. end if
  398. sqlSearch=sqlSearch & " order by articleid desc"
  399. Set rsSearch= Server.CreateObject("ADODB.Recordset")
  400. rsSearch.open sqlSearch,conn,1,1
  401.   if rsSearch.eof and rsSearch.bof then 
  402.         response.write "<p align='center'><br><br>Have not had or found any products</p>" '没有或没有找到任何产品
  403.     else 
  404.     if currentPage=1 then 
  405.         call SearchResultContent()
  406.     else 
  407.         if (currentPage-1)*MaxPerPage<totalPut then 
  408.         rsSearch.move  (currentPage-1)*MaxPerPage 
  409.         dim bookmark 
  410.         bookmark=rsSearch.bookmark 
  411.         call SearchResultContent()
  412.        else 
  413.          currentPage=1 
  414.         call SearchResultContent()
  415.        end if 
  416.     end if 
  417.     end if 
  418.     rsSearch.close 
  419.     set rsSearch=nothing   
  420. end sub
  421. sub SearchResultContent()
  422.     dim i,strTemp,Encontent
  423. i=1
  424. do while not rsSearch.eof
  425. strTemp=""
  426. strTemp=strTemp & cstr(i) & ".<a href='En_ProductShow.asp?ArticleID=" & rsSearch("articleid") & "'>"
  427. if strField="EnTitle" then
  428. strTemp=strTemp & "<b>" & replace(rsSearch("EnTitle"),""&keyword&"","<font color=red>"&keyword&"</font>") & "</b></font></a>"
  429. else
  430. strTemp=strTemp & "<b>" & rsSearch("EnTitle") & "</b></a>"
  431. end if
  432. strTemp=strTemp & " [" & FormatDateTime(rsSearch("UpdateTime"),1) & "]"
  433. EnContent=left(nohtml(rsSearch("EnContent")),200)
  434. if strField="EnContent" then
  435. strTemp=strTemp & "<div style='padding:10px 20px'>" & replace(EnContent,""&keyword&"","<font color=red>"&keyword&"</font>") & "……</div>"
  436. else
  437. strTemp=strTemp & "<div style='padding:10px 20px'>" & EnContent & "……</div>"
  438. end if
  439. 'strTemp=strTemp & "</a>"
  440. response.write strTemp
  441. i=i+1
  442. if i>MaxPerPage then exit do
  443. rsSearch.movenext
  444. loop
  445. end sub 
  446. '=========================================================================
  447. '过程名:ShowSearch
  448. '作  用:显示文章搜索表单
  449. '参  数:ShowType ----显示方式。1为纵向,2为横向
  450. '=========================================================================
  451. sub ShowSearch(ShowType)
  452. dim count
  453. if ShowType<>1 and ShowType<>2 then
  454. ShowType=1
  455. end if
  456. set rs=server.createobject("adodb.recordset")
  457. sql = "select * from PrSmallClass order by SmallClassID asc"
  458. rs.open sql,conn,1,1
  459. %>
  460. <script language = "JavaScript">
  461. var onecount;
  462. subcat = new Array();
  463.         <%
  464.         count = 0
  465.         do while not rs.eof 
  466.         %>
  467. subcat[<%=count%>] = new Array("<%= trim(rs("EnSmallClassName"))%>","<%= trim(rs("EnBigClassName"))%>","<%= trim(rs("EnSmallClassName"))%>");
  468.         <%
  469.         count = count + 1
  470.         rs.movenext
  471.         loop
  472.         rs.close
  473.         %>
  474. onecount=<%=count%>;
  475. function changelocation(locationid)
  476.     {
  477.     document.myform.EnSmallClassName.length = 1; 
  478.     var locationid=locationid;
  479.     var i;
  480.     for (i=0;i < onecount; i++)
  481.         {
  482.             if (subcat[i][1] == locationid)
  483.             { 
  484.                 document.myform.EnSmallClassName.options[document.myform.EnSmallClassName.length] = new Option(subcat[i][0], subcat[i][2]);
  485.             }        
  486.         }
  487.     }    
  488. </script>
  489. <table border="0" cellpadding="2" cellspacing="0" align="center">
  490. <form method="Get" name="myform" action="En_search.asp">
  491. <tr><td height="28">
  492. <select name="Field" size="1">
  493.     <option value="EnTitle" selected>Produc name</option><!-- 产品名称 -->
  494.     <option value="EnContent">Product description</option><!-- 产品说明 -->
  495. </select>
  496. <%if ShowType=1 then%>
  497. </td></tr>
  498. <tr><td height="28">
  499. <%end if%>
  500. <select name="EnBigClassName" onChange="changelocation(document.myform.EnBigClassName.options[document.myform.EnBigClassName.selectedIndex].value)" size="1">
  501. <option selected value="">All big class</option>
  502. <%
  503. if not (rsBigClass.bof and rsBigClass.eof) then
  504. rsBigClass.movefirst
  505. do while not rsBigClass.eof
  506.         response.Write "<option value='" & trim(rsBigClass("EnBigClassName")) & "'>" & trim(rsBigClass("EnBigClassName")) & "</option>"
  507.     rsBigClass.movenext
  508. loop
  509. end if
  510. %>
  511. </select>
  512. <%if ShowType=1 then%>
  513. </td></tr>
  514. <tr><td height="28">
  515. <%end if%>
  516. <select name="EnSmallClassName" size="1">                  
  517.     <option selected value="">All small class</option>
  518. </select>
  519. <%if ShowType=1 then%>
  520. </td></tr>
  521. <tr><td height="28">
  522. <%end if%>
  523. <input type="text" name="keyword"  size=16 value="Key word" maxlength="50" onFocus="this.select();">
  524. <input type="submit" name="Submit"  value="Search">
  525. </td></tr>
  526. </form>
  527. </table>
  528. <%
  529. end sub
  530. '=========================================================================
  531. '过程名:ShowAllClass
  532. '作  用:显示所有栏目(栏目导航)
  533. '参  数:无
  534. '=========================================================================
  535. sub ShowAllClass()
  536. if rsBigClass.bof and rsBigClass.eof then 
  537. response.Write "&nbsp;There is not any column" 'There is not any column没有任何栏目
  538. else
  539. dim sqlClass,rsClass,strClassName
  540. rsBigClass.movefirst
  541. do while not rsBigClass.eof
  542. strClassName= "【<a href='En_Product.asp?EnBigClassName=" & rsBigClass("EnBigClassName") & "'><b>" & rsBigClass("EnBigClassName") & "</b></a>】<br><br>"
  543. sqlClass="select * from PrSmallClass where EnBigClassName='" & rsBigClass("EnBigClassName") & "'Order by SmallClassID"
  544. Set rsClass= Server.CreateObject("ADODB.Recordset")
  545. rsClass.open sqlClass,conn,1,1
  546. do while not rsClass.eof
  547. strClassName=strClassName & "&nbsp;<a href='En_Product.asp?EnBigClassName=" & rsClass("EnBigClassName") & "&EnSmallClassName=" & rsClass("EnSmallClassName") & "'>" & rsClass("EnSmallClassName") & "</a>&nbsp;"
  548. rsClass.movenext
  549. loop
  550. response.write strClassName & "<br><br>"
  551. rsBigClass.movenext
  552. loop
  553. rsClass.close
  554. set rsClass=nothing
  555. end if
  556. end sub
  557. '=========================================================================
  558. '过程名:ShowArticleContent
  559. '作  用:显示文章具体的内容,可以分页显示
  560. '参  数:无
  561. '"<img border=0 src=" & rsArticle("DefaultPicUrl") & " width=100 height=120>"
  562. '=========================================================================
  563. sub ShowArticleContent()
  564. dim ArticleID,strContent,CurrentPage
  565. dim ContentLen,MaxPerPage,pages,i,lngBound
  566. dim BeginPoint,EndPoint
  567. ArticleID=rs("ArticleID")
  568. strContent=rs("EnContent")
  569. ContentLen=len(strContent)
  570. CurrentPage=trim(request("ArticlePage"))
  571. if ShowContentByPage="No" or ContentLen<=200000 then
  572. response.write strContent
  573. if ShowContentByPage="Yes" then
  574. response.write "</p><p align='center'></p>"
  575. end if
  576. else
  577. if CurrentPage="" then
  578. CurrentPage=1
  579. else
  580. CurrentPage=Cint(CurrentPage)
  581. end if
  582. pages=ContentLenMaxPerPage_Content
  583. if MaxPerPage_Content*pages<ContentLen then
  584. pages=pages+1
  585. end if
  586. lngBound=MaxPerPage_Content          '最大误差范围
  587. if CurrentPage<1 then CurrentPage=1
  588. if CurrentPage>pages then CurrentPage=pages
  589. dim lngTemp
  590. dim lngTemp1,lngTemp1_1,lngTemp1_2,lngTemp1_1_1,lngTemp1_1_2,lngTemp1_1_3,lngTemp1_2_1,lngTemp1_2_2,lngTemp1_2_3
  591. dim lngTemp2,lngTemp2_1,lngTemp2_2,lngTemp2_1_1,lngTemp2_1_2,lngTemp2_2_1,lngTemp2_2_2
  592. dim lngTemp3,lngTemp3_1,lngTemp3_2,lngTemp3_1_1,lngTemp3_1_2,lngTemp3_2_1,lngTemp3_2_2
  593. dim lngTemp4,lngTemp4_1,lngTemp4_2,lngTemp4_1_1,lngTemp4_1_2,lngTemp4_2_1,lngTemp4_2_2
  594. dim lngTemp5,lngTemp5_1,lngTemp5_2
  595. dim lngTemp6,lngTemp6_1,lngTemp6_2
  596. if CurrentPage=1 then
  597. BeginPoint=1
  598. else
  599. BeginPoint=MaxPerPage_Content*(CurrentPage-1)+1
  600. lngTemp1_1_1=instr(BeginPoint,strContent,"</table>",1)
  601. lngTemp1_1_2=instr(BeginPoint,strContent,"</TABLE>",1)
  602. lngTemp1_1_3=instr(BeginPoint,strContent,"</Table>",1)
  603. if lngTemp1_1_1>0 then
  604. lngTemp1_1=lngTemp1_1_1
  605. elseif lngTemp1_1_2>0 then
  606. lngTemp1_1=lngTemp1_1_2
  607. elseif lngTemp1_1_3>0 then
  608. lngTemp1_1=lngTemp1_1_3
  609. else
  610. lngTemp1_1=0
  611. end if
  612. lngTemp1_2_1=instr(BeginPoint,strContent,"<table",1)
  613. lngTemp1_2_2=instr(BeginPoint,strContent,"<TABLE",1)
  614. lngTemp1_2_3=instr(BeginPoint,strContent,"<Table",1)
  615. if lngTemp1_2_1>0 then
  616. lngTemp1_2=lngTemp1_2_1
  617. elseif lngTemp1_2_2>0 then
  618. lngTemp1_2=lngTemp1_2_2
  619. elseif lngTemp1_2_3>0 then
  620. lngTemp1_2=lngTemp1_2_3
  621. else
  622. lngTemp1_2=0
  623. end if
  624. if lngTemp1_1=0 and lngTemp1_2=0 then
  625. lngTemp1=BeginPoint
  626. else
  627. if lngTemp1_1>lngTemp1_2 then
  628. lngtemp1=lngTemp1_2
  629. else
  630. lngTemp1=lngTemp1_1+8
  631. end if
  632. end if
  633. lngTemp2_1_1=instr(BeginPoint,strContent,"</p>",1)
  634. lngTemp2_1_2=instr(BeginPoint,strContent,"</P>",1)
  635. if lngTemp2_1_1>0 then
  636. lngTemp2_1=lngTemp2_1_1
  637. elseif lngTemp2_1_2>0 then
  638. lngTemp2_1=lngTemp2_1_2
  639. else
  640. lngTemp2_1=0
  641. end if
  642. lngTemp2_2_1=instr(BeginPoint,strContent,"<p",1)
  643. lngTemp2_2_2=instr(BeginPoint,strContent,"<P",1)
  644. if lngTemp2_2_1>0 then
  645. lngTemp2_2=lngTemp2_2_1
  646. elseif lngTemp2_2_2>0 then
  647. lngTemp2_2=lngTemp2_2_2
  648. else
  649. lngTemp2_2=0
  650. end if
  651. if lngTemp2_1=0 and lngTemp2_2=0 then
  652. lntTemp2=BeginPoint
  653. else
  654. if lngTemp2_1>lngTemp2_2 then
  655. lngtemp2=lngTemp2_2
  656. else
  657. lngTemp2=lngTemp2_1+4
  658. end if
  659. end if
  660. lngTemp3_1_1=instr(BeginPoint,strContent,"</ur>",1)
  661. lngTemp3_1_2=instr(BeginPoint,strContent,"</UR>",1)
  662. if lngTemp3_1_1>0 then
  663. lngTemp3_1=lngTemp3_1_1
  664. elseif lngTemp3_1_2>0 then
  665. lngTemp3_1=lngTemp3_1_2
  666. else
  667. lngTemp3_1=0
  668. end if
  669. lngTemp3_2_1=instr(BeginPoint,strContent,"<ur",1)
  670. lngTemp3_2_2=instr(BeginPoint,strContent,"<UR",1)
  671. if lngTemp3_2_1>0 then
  672. lngTemp3_2=lngTemp3_2_1
  673. elseif lngTemp3_2_2>0 then
  674. lngTemp3_2=lngTemp3_2_2
  675. else
  676. lngTemp3_2=0
  677. end if
  678. if lngTemp3_1=0 and lngTemp3_2=0 then
  679. lngTemp3=BeginPoint
  680. else
  681. if lngTemp3_1>lngTemp3_2 then
  682. lngtemp3=lngTemp3_2
  683. else
  684. lngTemp3=lngTemp3_1+5
  685. end if
  686. end if
  687. if lngTemp1<lngTemp2 then
  688. lngTemp=lngTemp2
  689. else
  690. lngTemp=lngTemp1
  691. end if
  692. if lngTemp<lngTemp3 then
  693. lngTemp=lngTemp3
  694. end if
  695. if lngTemp>BeginPoint and lngTemp<=BeginPoint+lngBound then
  696. BeginPoint=lngTemp
  697. else
  698. lngTemp4_1_1=instr(BeginPoint,strContent,"</li>",1)
  699. lngTemp4_1_2=instr(BeginPoint,strContent,"</LI>",1)
  700. if lngTemp4_1_1>0 then
  701. lngTemp4_1=lngTemp4_1_1
  702. elseif lngTemp4_1_2>0 then
  703. lngTemp4_1=lngTemp4_1_2
  704. else
  705. lngTemp4_1=0
  706. end if
  707. lngTemp4_2_1=instr(BeginPoint,strContent,"<li",1)
  708. lngTemp4_2_1=instr(BeginPoint,strContent,"<LI",1)
  709. if lngTemp4_2_1>0 then
  710. lngTemp4_2=lngTemp4_2_1
  711. elseif lngTemp4_2_2>0 then
  712. lngTemp4_2=lngTemp4_2_2
  713. else
  714. lngTemp4_2=0
  715. end if
  716. if lngTemp4_1=0 and lngTemp4_2=0 then
  717. lngTemp4=BeginPoint
  718. else
  719. if lngTemp4_1>lngTemp4_2 then
  720. lngtemp4=lngTemp4_2
  721. else
  722. lngTemp4=lngTemp4_1+5
  723. end if
  724. end if
  725. if lngTemp4>BeginPoint and lngTemp4<=BeginPoint+lngBound then
  726. BeginPoint=lngTemp4
  727. else
  728. lngTemp5_1=instr(BeginPoint,strContent,"<img",1)
  729. lngTemp5_2=instr(BeginPoint,strContent,"<IMG",1)
  730. if lngTemp5_1>0 then
  731. lngTemp5=lngTemp5_1
  732. elseif lngTemp5_2>0 then
  733. lngTemp5=lngTemp5_2
  734. else
  735. lngTemp5=BeginPoint
  736. end if
  737. if lngTemp5>BeginPoint and lngTemp5<BeginPoint+lngBound then
  738. BeginPoint=lngTemp5
  739. else
  740. lngTemp6_1=instr(BeginPoint,strContent,"<br>",1)
  741. lngTemp6_2=instr(BeginPoint,strContent,"<BR>",1)
  742. if lngTemp6_1>0 then
  743. lngTemp6=lngTemp6_1
  744. elseif lngTemp6_2>0 then
  745. lngTemp6=lngTemp6_2
  746. else
  747. lngTemp6=0
  748. end if
  749. if lngTemp6>BeginPoint and lngTemp6<BeginPoint+lngBound then
  750. BeginPoint=lngTemp6+4
  751. end if
  752. end if
  753. end if
  754. end if
  755. end if
  756. if CurrentPage=pages then
  757. EndPoint=ContentLen
  758. else
  759.   EndPoint=MaxPerPage_Content*CurrentPage
  760.   if EndPoint>=ContentLen then
  761. EndPoint=ContentLen
  762.   else
  763. lngTemp1_1_1=instr(EndPoint,strContent,"</table>",1)
  764. lngTemp1_1_2=instr(EndPoint,strContent,"</TABLE>",1)
  765. lngTemp1_1_3=instr(EndPoint,strContent,"</Table>",1)
  766. if lngTemp1_1_1>0 then
  767. lngTemp1_1=lngTemp1_1_1
  768. elseif lngTemp1_1_2>0 then
  769. lngTemp1_1=lngTemp1_1_2
  770. elseif lngTemp1_1_3>0 then
  771. lngTemp1_1=lngTemp1_1_3
  772. else
  773. lngTemp1_1=0
  774. end if
  775. lngTemp1_2_1=instr(EndPoint,strContent,"<table",1)
  776. lngTemp1_2_2=instr(EndPoint,strContent,"<TABLE",1)
  777. lngTemp1_2_3=instr(EndPoint,strContent,"<Table",1)
  778. if lngTemp1_2_1>0 then
  779. lngTemp1_2=lngTemp1_2_1
  780. elseif lngTemp1_2_2>0 then
  781. lngTemp1_2=lngTemp1_2_2
  782. elseif lngTemp1_2_3>0 then
  783. lngTemp1_2=lngTemp1_2_3
  784. else
  785. lngTemp1_2=0
  786. end if
  787. if lngTemp1_1=0 and lngTemp1_2=0 then
  788. lngTemp1=EndPoint
  789. else
  790. if lngTemp1_1>lngTemp1_2 then
  791. lngtemp1=lngTemp1_2-1
  792. else
  793. lngTemp1=lngTemp1_1+7
  794. end if
  795. end if
  796. lngTemp2_1_1=instr(EndPoint,strContent,"</p>",1)
  797. lngTemp2_1_2=instr(EndPoint,strContent,"</P>",1)
  798. if lngTemp2_1_1>0 then
  799. lngTemp2_1=lngTemp2_1_1
  800. elseif lngTemp2_1_2>0 then
  801. lngTemp2_1=lngTemp2_1_2
  802. else
  803. lngTemp2_1=0
  804. end if
  805. lngTemp2_2_1=instr(EndPoint,strContent,"<p",1)
  806. lngTemp2_2_2=instr(EndPoint,strContent,"<P",1)
  807. if lngTemp2_2_1>0 then
  808. lngTemp2_2=lngTemp2_2_1
  809. elseif lngTemp2_2_2>0 then
  810. lngTemp2_2=lngTemp2_2_2
  811. else
  812. lngTemp2_2=0
  813. end if
  814. if lngTemp2_1=0 and lngTemp2_2=0 then
  815. lngTemp2=EndPoint
  816. else
  817. if lngTemp2_1>lngTemp2_2 then
  818. lngTemp2=lngTemp2_2-1
  819. else
  820. lngTemp2=lngTemp2_1+3
  821. end if
  822. end if
  823. lngTemp3_1_1=instr(EndPoint,strContent,"</ur>",1)
  824. lngTemp3_1_2=instr(EndPoint,strContent,"</UR>",1)
  825. if lngTemp3_1_1>0 then
  826. lngTemp3_1=lngTemp3_1_1
  827. elseif lngTemp3_1_2>0 then
  828. lngTemp3_1=lngTemp3_1_2
  829. else
  830. lngTemp3_1=0
  831. end if
  832. lngTemp3_2_1=instr(EndPoint,strContent,"<ur",1)
  833. lngTemp3_2_2=instr(EndPoint,strContent,"<UR",1)
  834. if lngTemp3_2_1>0 then
  835. lngTemp3_2=lngTemp3_2_1
  836. elseif lngTemp3_2_2>0 then
  837. lngTemp3_2=lngTemp3_2_2
  838. else
  839. lngTemp3_2=0
  840. end if
  841. if lngTemp3_1=0 and lngTemp3_2=0 then
  842. lngTemp3=EndPoint
  843. else
  844. if lngTemp3_1>lngTemp3_2 then
  845. lngtemp3=lngTemp3_2-1
  846. else
  847. lngTemp3=lngTemp3_1+4
  848. end if
  849. end if
  850. if lngTemp1<lngTemp2 then
  851. lngTemp=lngTemp2
  852. else
  853. lngTemp=lngTemp1
  854. end if
  855. if lngTemp<lngTemp3 then
  856. lngTemp=lngTemp3
  857. end if
  858. if lngTemp>EndPoint and lngTemp<=EndPoint+lngBound then
  859. EndPoint=lngTemp
  860. else
  861. lngTemp4_1_1=instr(EndPoint,strContent,"</li>",1)
  862. lngTemp4_1_2=instr(EndPoint,strContent,"</LI>",1)
  863. if lngTemp4_1_1>0 then
  864. lngTemp4_1=lngTemp4_1_1
  865. elseif lngTemp4_1_2>0 then
  866. lngTemp4_1=lngTemp4_1_2
  867. else
  868. lngTemp4_1=0
  869. end if
  870. lngTemp4_2_1=instr(EndPoint,strContent,"<li",1)
  871. lngTemp4_2_1=instr(EndPoint,strContent,"<LI",1)
  872. if lngTemp4_2_1>0 then
  873. lngTemp4_2=lngTemp4_2_1
  874. elseif lngTemp4_2_2>0 then
  875. lngTemp4_2=lngTemp4_2_2
  876. else
  877. lngTemp4_2=0
  878. end if
  879. if lngTemp4_1=0 and lngTemp4_2=0 then
  880. lngTemp4=EndPoint
  881. else
  882. if lngTemp4_1>lngTemp4_2 then
  883. lngtemp4=lngTemp4_2-1
  884. else
  885. lngTemp4=lngTemp4_1+4
  886. end if
  887. end if
  888. if lngTemp4>EndPoint and lngTemp4<=EndPoint+lngBound then
  889. EndPoint=lngTemp4
  890. else
  891. lngTemp5_1=instr(EndPoint,strContent,"<img",1)
  892. lngTemp5_2=instr(EndPoint,strContent,"<IMG",1)
  893. if lngTemp5_1>0 then
  894. lngTemp5=lngTemp5_1-1
  895. elseif lngTemp5_2>0 then
  896. lngTemp5=lngTemp5_2-1
  897. else
  898. lngTemp5=EndPoint
  899. end if
  900. if lngTemp5>EndPoint and lngTemp5<EndPoint+lngBound then
  901. EndPoint=lngTemp5
  902. else
  903. lngTemp6_1=instr(EndPoint,strContent,"<br>",1)
  904. lngTemp6_2=instr(EndPoint,strContent,"<BR>",1)
  905. if lngTemp6_1>0 then
  906. lngTemp6=lngTemp6_1+3
  907. elseif lngTemp6_2>0 then
  908. lngTemp6=lngTemp6_2+3
  909. else
  910. lngTemp6=EndPoint
  911. end if
  912. if lngTemp6>EndPoint and lngTemp6<EndPoint+lngBound then
  913. EndPoint=lngTemp6
  914. end if
  915. end if
  916. end if
  917. end if
  918.   end if
  919. end if
  920. response.write mid(strContent,BeginPoint,EndPoint-BeginPoint)
  921. response.write "</p><p align='center'><b>"
  922. if CurrentPage>1 then
  923. response.write "<a href='En_ProductShow.asp?ArticleID=" & ArticleID & "&ArticlePage=" & CurrentPage-1 & "'>Previous page</a>&nbsp;&nbsp;"
  924. end if
  925. for i=1 to pages
  926. if i=CurrentPage then
  927. response.write "<font color='red'>[" & cstr(i) & "]</font>&nbsp;"
  928. else
  929. response.write "<a href='En_ProductShow.asp?ArticleID=" & ArticleID & "&ArticlePage=" & i & "'>[" & i & "]</a>&nbsp;"
  930. end if
  931. next
  932. if CurrentPage<pages then
  933. response.write "&nbsp;<a href='En_ProductShow.asp?ArticleID=" & ArticleID & "&ArticlePage=" & CurrentPage+1 & "'>Next page</a>"
  934. end if
  935. response.write "</b></p>"
  936. end if
  937. end sub
  938. %>