<% On Error Resume Next 'Session.Timeout=5 'Session.Abandon ListIndex = 4 '//-- 顯示幾個項目 my_choice = "" my_choice_table_name = "" my_amtb_index = "" my_menu_name = "" my_left_menu_name = "" my_menu_content = "" '程式前頭 Myself = Request.ServerVariables("PATH_INFO") '抓出檔案名稱 Myself = split(Myself , "/") my_file = Myself(Ubound(Myself)) Dim selectedWebKey(2) selectedWebKey(1) = "" selectedWebKey(2) = "" my_search = Request.Form("web_search") my_key = Request.Form("web_key") selectedWebKey(my_key) = " selected" SET CONN=SERVER.CREATEOBJECT("ADODB.CONNECTION") CONN.OPEN "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=" & Server.MapPath("../cgi-bin/amtb_web_db.mdb") '---------------------------------------------------------------------------- '補web_choice or get web_choice into "my_choice" if Request.QueryString("web_choice") = "" then SQL = "SELECT * FROM electric_bookcase order by list_index" Set RS = Conn.Execute(SQL) if Err.Number<>0 then Response.Write "
" & SQL & "
" & Err.description else IF NOT RS.EOF THEN my_choice = RS("amtb_index") else Response.Write "資料庫未建資料!" & vbCRLF END IF end if else my_choice = Request.QueryString("web_choice") end if '查choice table name SQL = "SELECT * FROM electric_bookcase where amtb_index =" & my_choice Set RS = Conn.Execute(SQL) if Err.Number<>0 then Response.Write "
" & SQL & "
" & Err.description else IF NOT RS.EOF THEN my_menu_name = RS("menu_name") else Response.Write "資料庫未建資料!!" & vbCRLF END IF end if if Request.QueryString("web_order") <> "" then my_order = Request.QueryString("web_order") end if if Request.QueryString("order_field") <> "" then order_by = Request.QueryString("order_field") end if '--------------------------------------------------------------------------- IF my_key = "1" Then '//-- 查詢書名 SQL1 = " (book_name like '%" & Trim(my_search) & "%')" ElseIF my_key = "2" Then '//-- 查詢作者 SQL1 = " (author_name like '%" & Trim(my_search) & "%')" Else '//-- 一般 非查詢模式 SQL1 = " (relation_index = " & my_choice & ")" End IF SQL = "SELECT * FROM electric_bookcase_content WHERE " & SQL1 & " order by in_date DESC" if my_choice <> "" then if order_by = "書名" then SQL = "SELECT * FROM electric_bookcase_content WHERE " & SQL1 & " order by Right(book_name,Len(book_name)-InStr(book_name,'>')) " & my_order elseif order_by = "上網日期" then SQL = "SELECT * FROM electric_bookcase_content WHERE " & SQL1 & " order by in_date " & my_order end if Set RS = Conn.Execute(SQL) if Err.Number<>0 then Response.Write "
" & SQL & "
" & Err.description else IF RS.EOF THEN 'Response.Write "資料庫未建資料!!!" & vbCRLF END IF end if end if %> <% IF my_menu_name <> "" then %> 電子書坊> <% Response.Write my_menu_name %> <% else %> 電子書坊 <% end if %>
" & vbCRLF SET RS2=Nothing RS1.MoveNext Loop else Response.Write "" & vbCRLF END IF end if SET RS1=Nothing %>

陳列櫃瀏覽

<% SQL = "SELECT * FROM electric_bookcase order by list_index" Set RS1 = CONN.Execute(SQL) if Err.Number<>0 then Response.Write "
" & SQL & "
" & Err.description else IF NOT RS1.EOF THEN Do While Not RS1.EOF myCount = "" SQL = "SELECT count(*) as myCount FROM electric_bookcase_content WHERE relation_index = " & RS1("amtb_index") Set RS2 = CONN.Execute(SQL) Response.Write "

" & RS1("menu_name") & "" & RS2("myCount") & "
錯誤!查無此資料!!!
<% IF my_menu_name <> "" then %>
您的位置>首頁>電子書坊> <% Response.Write my_menu_name %>
<% else %>
您的位置>首頁>電子書坊
<% end if %>

<% '//-- show最新的四個圖 SQL = "SELECT * FROM electric_bookcase_content order by in_date DESC,amtb_index DESC" Set RS1 = CONN.Execute(SQL) if Err.Number<>0 then Response.Write "
" & SQL & "
" & Err.description else IF NOT RS1.EOF THEN newsIndex = 1 Do While Not RS1.EOF IF RS1("book_pic") <> "" then tmp_book_pic1 = trim(RS1("book_pic")) Else tmp_book_pic1 = "book.jpg" End IF Response.Write "" & vbCRLF If newsIndex >= ListIndex then exit do end if newsIndex = newsIndex + 1 RS1.MoveNext Loop else Response.Write "" & vbCRLF END IF end if SET RS1=Nothing %>

" & RS1("book_name") & "

查無資料!

   ">    
  電子書坊 > 教學叢書 現依日期排序,也可依書名排序,按右鍵可另存到電腦裡。電子書使用說明>>

 
  ">▲   書名   ">▼   作者   ">▲ 上網日期 ">▼   檔案大小
<% IF NOT RS.EOF THEN tmp_index = 1 Do While Not RS.EOF s_file_name="" s_file_name=Replace(RS("book_name")," "" then tmp_book_pic = trim(RS("book_pic")) Else tmp_book_pic = "book.jpg" End IF Response.Write "" & vbCRLF 'Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF Response.Write "" & vbCRLF '//測試用-- Response.Write "
" & tmp_index & "" & vbCRLF Response.Write " " & vbCRLF Response.Write "
" & RS("book_name") & "
 " & RS("author_name") & " " & RS("in_date") & "  測試用
" & vbCRLF Response.Write "

 " & ShowFileSize(s_file_name,"") & "
" & vbCRLF Response.Write "" & vbCRLF Response.Write " " & vbCRLF Response.Write " " & vbCRLF Response.Write " " & vbCRLF Response.Write "
" & vbCRLF tmp_index = tmp_index + 1 RS.MoveNext Loop else Response.Write "
查無資料!!!
" & vbCRLF END IF %>


淨空法師專集網站 e-mail: amtb@amtb.tw

<% SET RS=Nothing CONN.Close SET CONN=Nothing %>