<%@LANGUAGE="VBSCRIPT" CODEPAGE="65001"%> <%Session.CodePage=65001%> <% function Content()'Content--------------------------------------------------- Dim cRet cRet = cRet & "
" & inputprocess() cRet = cRet & "

" & result() & "
" Content = cRet end function'-------------------------------------------------------------------- function inputprocess()'Content--------------------------------------------------- Dim cRet Dim sql sql = "SELECT subjectid AS Dataid, ctcap AS DataCap FROM subject" cRet = cRet & "
本中心各學科詞彙藏書目錄" cRet = cRet & "" cRet = cRet & "" cRet = cRet & "" cRet = cRet & "" & HTMLTag("form", "head", "frmSel", QueryString, "get") cRet = cRet & "" cRet = cRet & HTMLTag("form", "tail", "", "", "") & HTMLTag("form", "head", "frmSel", QueryString, "get") cRet = cRet & "" cRet = cRet & HTMLTag("form", "tail", "", "", "") & "
分科目瀏覽關鍵字搜尋
" & HTMLCbo(sql, "cboSubjectSel", Request("cboSubjectSel"), "", "", "2") cRet = cRet & " " & HTMLCbo(sql, "SearchSubjectSel", Request("SearchSubjectSel"), "", "", "1") cRet = cRet & "
" cRet = cRet & "
" inputprocess = cRet end function'-------------------------------------------------------------------- function result()'Content--------------------------------------------------- Dim cRet If not request("action") = "搜尋" then cRet = bySubject() Else cRet = bySearch() End If result = cRet end function'-------------------------------------------------------------------- function bySubject()'Content--------------------------------------------------- Dim cRet Dim sql Dim tmpAlph if Request("cboSubjectSel") = "0" then Response.Redirect "index.asp" if not Request("cboSubjectSel") = "" then Set rs = server.CreateObject("adodb.Recordset") rs.CacheSize=5 sql = "" if Request.Form("cboAlphSel") = "" and Request.QueryString("cboAlphSel") = "" then tmAlph = "%" Elseif Request.form("cboAlphSel") = "" then tmpAlph = Request.QueryString("cboAlphSel") Else tmpAlph = Request.Form("cboAlphSel") End if if tmpAlph = "0" then sql = sql & "SELECT * FROM Glossary WHERE (Subjectid = " & Request("cboSubjectSel") & ") and " sql = sql & "(NOT (ASCII(SUBSTRING(UPPER(enCap), 1, 1)) > 64 AND " sql = sql & "ASCII(SUBSTRING(UPPER(enCap), 1, 1)) < 91)) ORDER BY enCap" else sql = sql & "Select * from Glossary where (Subjectid = " & Request("cboSubjectSel") sql = sql & ") and (Upper(enCap) like N'" & tmpalph & "%') order by enCap" End if 'cret = cret & sql rs.Open sql,cstring,3 cRet = cRet & "
*部份資料由CDI提供" if not Request("cboSubjectSel") = "" then cRet = cRet & "

瀏覽" & cboAlphSel(tmpAlph) & "字母開首的學科用詞" cRet = cRet & "" cRet = cRet & "" cRet = HTMLTag("form", "head", "frmAlphSel", "", "Post") & cRet cRet = cRet & HTMLTag("form", "tail", "", "", "") cRet = cRet & JavaHead cRet = cRet & "function AlphSel(form) { " cRet = cRet & "form.txtAlphSel.value = ""AlphSel""; " cRet = cRet & "form.submit(); " cRet = cRet & "} " cRet = cRet & JavaTail End if cRet = cRet & "

" if not rs.eof then mypage=request("whichpage") If mypage="" then mypage=1 end if rs.movefirst rs.pagesize=20 maxpages=cint(rs.pagecount) maxrecs=cint(rs.pagesize) rs.absolutepage=mypage howmanyrecs=0 cRet = cRet & "" cRet = cRet & "" cRet = cRet & "" DO UNTIL rs.eof OR howmanyrecs>=maxrecs cRet = cRet & "" rs.movenext howmanyrecs=howmanyrecs+1 LOOP rs.Close set rs = nothing cRet = cRet & "
English中文
" & rs("enCap") & "" & rs("ctcap") & "
" cRet = cRet & "

" & PageNavBar(mypage,maxpages,"bySubject") Else cRet = cRet & "

〈沒有相關的資料,請再試!〉" End if End if bySubject = cRet end function'-------------------------------------------------------------------- function bySearch()'--------------------------------------------------- Dim cRet Dim sql Dim SearchStr SearchStr = Trim(request("SearchStr")) if SearchStr = "" then cRet = "〈請輸入要搜尋的關鍵字〉" Else if Request("SearchSubjectSel") = "0" then sql = "Select Glossary.encap as enStr, Glossary.ctcap as ctStr, " sql = sql & "Subject.ctcap as subcap from Glossary inner join subject on Glossary.subjectid = " sql = sql & "subject.subjectid where glossary.ctcap like N'%" & SQLChar(SearchStr) sql = sql & "%' or glossary.enCap like N'%" & SQLChar(Request("SearchStr")) & "%' order by enCap" Else sql = "Select Glossary.encap as enStr, Glossary.ctcap as ctStr, " sql = sql & "Subject.ctcap as subcap from Glossary inner join subject on Glossary.subjectid = " sql = sql & "subject.subjectid where Glossary.Subjectid = " & Request("SearchSubjectSel") & " and " sql = sql & "glossary.ctcap like N'%" & SQLChar(SearchStr) sql = sql & "%' or glossary.enCap like N'%" & SQLChar(Request("SearchStr")) & "%' order by enCap" End if Set rs = server.CreateObject("adodb.Recordset") rs.Open sql,cstring,3 cRet = cRet & "
*部份資料由CDI提供
" if not rs.eof then mypage=request("whichpage") If mypage="" then mypage=1 end if rs.movefirst rs.pagesize=20 maxpages=cint(rs.pagecount) maxrecs=cint(rs.pagesize) rs.absolutepage=mypage howmanyrecs=0 cRet = cRet & "" cRet = cRet & "" cRet = cRet & "" cRet = cRet & "" DO UNTIL rs.eof OR howmanyrecs>=maxrecs cRet = cRet & "" cRet = cRet & "" rs.movenext howmanyrecs=howmanyrecs+1 LOOP rs.Close set rs = nothing cRet = cRet & "
English中文相關科目
" & FocRpl(rs("enStr"), SearchStr) & "" cRet = cRet & FocRpl(rs("ctStr"), SearchStr) & "" & rs("subcap") & "
" cRet = cRet & "

" & PageNavBar(mypage,maxpages,"bySearch") Else cRet = cRet & "

〈沒有相關的資料,請再試!〉" End if End if bySearch = cRet end function'-------------------------------------------------------------------- function cboAlphSel(cData)'------------------------------------------------------------- Dim cRet, i Dim AryAlph(27,1) Dim tmpAlph AryAlph(0,0) = "%":AryAlph(0,1) = "任何" AryAlph(1,0) = "A":AryAlph(1,1) = "A" AryAlph(2,0) = "B":AryAlph(2,1) = "B" AryAlph(3,0) = "C":AryAlph(3,1) = "C" AryAlph(4,0) = "D":AryAlph(4,1) = "D" AryAlph(5,0) = "E":AryAlph(5,1) = "E" AryAlph(6,0) = "F":AryAlph(6,1) = "F" AryAlph(7,0) = "G":AryAlph(7,1) = "G" AryAlph(8,0) = "H":AryAlph(8,1) = "H" AryAlph(9,0) = "I":AryAlph(9,1) = "I" AryAlph(10,0) = "J":AryAlph(10,1) = "J" AryAlph(11,0) = "K":AryAlph(11,1) = "K" AryAlph(12,0) = "L":AryAlph(12,1) = "L" AryAlph(13,0) = "M":AryAlph(13,1) = "M" AryAlph(14,0) = "N":AryAlph(14,1) = "N" AryAlph(15,0) = "O":AryAlph(15,1) = "O" AryAlph(16,0) = "P":AryAlph(16,1) = "P" AryAlph(17,0) = "Q":AryAlph(17,1) = "Q" AryAlph(18,0) = "R":AryAlph(18,1) = "R" AryAlph(19,0) = "S":AryAlph(19,1) = "S" AryAlph(20,0) = "T":AryAlph(20,1) = "T" AryAlph(21,0) = "U":AryAlph(21,1) = "U" AryAlph(22,0) = "V":AryAlph(22,1) = "V" AryAlph(23,0) = "W":AryAlph(23,1) = "W" AryAlph(24,0) = "X":AryAlph(24,1) = "X" AryAlph(25,0) = "Y":AryAlph(25,1) = "Y" AryAlph(26,0) = "Z":AryAlph(26,1) = "Z" AryAlph(27,0) = "0":AryAlph(27,1) = "其他非英文" 'If Request("cboAlphSel") = "" then cRet = cRet & "" cboAlphSel = cRet end function'-------------------------------------------------------------------- %>