<%@LANGUAGE="VBSCRIPT" CODEPAGE="950"%> <% Session.TimeOut = 120 '單位:分鐘 %> <% Dim RecMain Dim RecMain_numRows Set RecMain = Server.CreateObject("ADODB.Recordset") RecMain.ActiveConnection = MM_connM2_STRING RecMain.Source = "SELECT * FROM mainPage" RecMain.CursorType = 0 RecMain.CursorLocation = 2 RecMain.LockType = 1 RecMain.Open() RecMain_numRows = 0 %> <% Dim Repeat1__numRows Dim Repeat1__index Repeat1__numRows = 20 Repeat1__index = 0 RecMain_numRows = RecMain_numRows + Repeat1__numRows %> <% ' *** Recordset Stats, Move To Record, and Go To Record: declare stats variables Dim RecMain_total Dim RecMain_first Dim RecMain_last ' set the record count RecMain_total = RecMain.RecordCount ' set the number of rows displayed on this page If (RecMain_numRows < 0) Then RecMain_numRows = RecMain_total Elseif (RecMain_numRows = 0) Then RecMain_numRows = 1 End If ' set the first and last displayed record RecMain_first = 1 RecMain_last = RecMain_first + RecMain_numRows - 1 ' if we have the correct record count, check the other stats If (RecMain_total <> -1) Then If (RecMain_first > RecMain_total) Then RecMain_first = RecMain_total End If If (RecMain_last > RecMain_total) Then RecMain_last = RecMain_total End If If (RecMain_numRows > RecMain_total) Then RecMain_numRows = RecMain_total End If End If %> <% ' *** Recordset Stats: if we don't know the record count, manually count them If (RecMain_total = -1) Then ' count the total records by iterating through the recordset RecMain_total=0 While (Not RecMain.EOF) RecMain_total = RecMain_total + 1 RecMain.MoveNext Wend ' reset the cursor to the beginning If (RecMain.CursorType > 0) Then RecMain.MoveFirst Else RecMain.Requery End If ' set the number of rows displayed on this page If (RecMain_numRows < 0 Or RecMain_numRows > RecMain_total) Then RecMain_numRows = RecMain_total End If ' set the first and last displayed record RecMain_first = 1 RecMain_last = RecMain_first + RecMain_numRows - 1 If (RecMain_first > RecMain_total) Then RecMain_first = RecMain_total End If If (RecMain_last > RecMain_total) Then RecMain_last = RecMain_total End If End If %> <% ' *** Move To Record and Go To Record: declare variables Dim MM_rs Dim MM_rsCount Dim MM_size Dim MM_uniqueCol Dim MM_offset Dim MM_atTotal Dim MM_paramIsDefined Dim MM_param Dim MM_index Set MM_rs = RecMain MM_rsCount = RecMain_total MM_size = RecMain_numRows MM_uniqueCol = "main_id" MM_paramName = "id" MM_offset = 0 MM_atTotal = false MM_paramIsDefined = false If (MM_paramName <> "") Then MM_paramIsDefined = (Request.QueryString(MM_paramName) <> "") End If %> <% ' *** Move To Record: handle 'index' or 'offset' parameter if (Not MM_paramIsDefined And MM_rsCount <> 0) then ' use index parameter if defined, otherwise use offset parameter r = Request.QueryString("index") If r = "" Then r = Request.QueryString("offset") If r <> "" Then MM_offset = Int(r) ' if we have a record count, check if we are past the end of the recordset If (MM_rsCount <> -1) Then If (MM_offset >= MM_rsCount Or MM_offset = -1) Then ' past end or move last If ((MM_rsCount Mod MM_size) > 0) Then ' last page not a full repeat region MM_offset = MM_rsCount - (MM_rsCount Mod MM_size) Else MM_offset = MM_rsCount - MM_size End If End If End If ' move the cursor to the selected record i = 0 While ((Not MM_rs.EOF) And (i < MM_offset Or MM_offset = -1)) MM_rs.MoveNext i = i + 1 Wend If (MM_rs.EOF) Then MM_offset = i ' set MM_offset to the last possible record End If %> <% ' *** Move To Record: if we dont know the record count, check the display range If (MM_rsCount = -1) Then ' walk to the end of the display range for this page i = MM_offset While (Not MM_rs.EOF And (MM_size < 0 Or i < MM_offset + MM_size)) MM_rs.MoveNext i = i + 1 Wend ' if we walked off the end of the recordset, set MM_rsCount and MM_size If (MM_rs.EOF) Then MM_rsCount = i If (MM_size < 0 Or MM_size > MM_rsCount) Then MM_size = MM_rsCount End If ' if we walked off the end, set the offset based on page size If (MM_rs.EOF And Not MM_paramIsDefined) Then If (MM_offset > MM_rsCount - MM_size Or MM_offset = -1) Then If ((MM_rsCount Mod MM_size) > 0) Then MM_offset = MM_rsCount - (MM_rsCount Mod MM_size) Else MM_offset = MM_rsCount - MM_size End If End If End If ' reset the cursor to the beginning If (MM_rs.CursorType > 0) Then MM_rs.MoveFirst Else MM_rs.Requery End If ' move the cursor to the selected record i = 0 While (Not MM_rs.EOF And i < MM_offset) MM_rs.MoveNext i = i + 1 Wend End If %> <% ' *** Move To Record: update recordset stats ' set the first and last displayed record RecMain_first = MM_offset + 1 RecMain_last = MM_offset + MM_size If (MM_rsCount <> -1) Then If (RecMain_first > MM_rsCount) Then RecMain_first = MM_rsCount End If If (RecMain_last > MM_rsCount) Then RecMain_last = MM_rsCount End If End If ' set the boolean used by hide region to check if we are on the last record MM_atTotal = (MM_rsCount <> -1 And MM_offset + MM_size >= MM_rsCount) %> <% ' *** Go To Record and Move To Record: create strings for maintaining URL and Form parameters Dim MM_keepNone Dim MM_keepURL Dim MM_keepForm Dim MM_keepBoth Dim MM_removeList Dim MM_item Dim MM_nextItem ' create the list of parameters which should not be maintained MM_removeList = "&index=" If (MM_paramName <> "") Then MM_removeList = MM_removeList & "&" & MM_paramName & "=" End If MM_keepURL="" MM_keepForm="" MM_keepBoth="" MM_keepNone="" ' add the URL parameters to the MM_keepURL string For Each MM_item In Request.QueryString MM_nextItem = "&" & MM_item & "=" If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then MM_keepURL = MM_keepURL & MM_nextItem & Server.URLencode(Request.QueryString(MM_item)) End If Next ' add the Form variables to the MM_keepForm string For Each MM_item In Request.Form MM_nextItem = "&" & MM_item & "=" If (InStr(1,MM_removeList,MM_nextItem,1) = 0) Then MM_keepForm = MM_keepForm & MM_nextItem & Server.URLencode(Request.Form(MM_item)) End If Next ' create the Form + URL string and remove the intial '&' from each of the strings MM_keepBoth = MM_keepURL & MM_keepForm If (MM_keepBoth <> "") Then MM_keepBoth = Right(MM_keepBoth, Len(MM_keepBoth) - 1) End If If (MM_keepURL <> "") Then MM_keepURL = Right(MM_keepURL, Len(MM_keepURL) - 1) End If If (MM_keepForm <> "") Then MM_keepForm = Right(MM_keepForm, Len(MM_keepForm) - 1) End If ' a utility function used for adding additional parameters to these strings Function MM_joinChar(firstItem) If (firstItem <> "") Then MM_joinChar = "&" Else MM_joinChar = "" End If End Function %> <% ' *** Move To Record: set the strings for the first, last, next, and previous links MM_keepMove = MM_keepBoth MM_moveParam = "index" ' if the page has a repeated region, remove 'offset' from the maintained parameters If (MM_size > 0) Then MM_moveParam = "offset" If (MM_keepMove <> "") Then params = Split(MM_keepMove, "&") MM_keepMove = "" For i = 0 To UBound(params) nextItem = Left(params(i), InStr(params(i),"=") - 1) If (StrComp(nextItem,MM_moveParam,1) <> 0) Then MM_keepMove = MM_keepMove & "&" & params(i) End If Next If (MM_keepMove <> "") Then MM_keepMove = Right(MM_keepMove, Len(MM_keepMove) - 1) End If End If End If ' set the strings for the move to links If (MM_keepMove <> "") Then MM_keepMove = MM_keepMove & "&" urlStr = Request.ServerVariables("URL") & "?" & MM_keepMove & MM_moveParam & "=" MM_moveFirst = urlStr & "0" MM_moveLast = urlStr & "-1" MM_moveNext = urlStr & Cstr(MM_offset + MM_size) prev = MM_offset - MM_size If (prev < 0) Then prev = 0 MM_movePrev = urlStr & Cstr(prev) %> 金證照討論區
金證照顧問有限公司
<% If Not RecMain.EOF Or Not RecMain.BOF Then %>
<% If Session("MM_Username") <> "" Then %> <% =session("MM_Username") %> 您好!歡迎光臨! <% End If %> |會員註冊 | 熱門主題 | 精選主題 
<% While ((Repeat1__numRows <> 0) AND (NOT RecMain.EOF)) %> <% Repeat1__index=Repeat1__index+1 Repeat1__numRows=Repeat1__numRows-1 RecMain.MoveNext() Wend %>
發表主題 發言人 點閱 回應 最新回應時間
">
"><%=(RecMain.Fields.Item("main_subject").Value)%> <% if RecMain.Fields.Item("NewUpdate").Value > date()-1 Then 'start db_sc script %> <% end if 'end db_sc script %> <% if RecMain.Fields.Item("num_re").Value >= 5 Then 'start db_sc script %> <% end if 'end db_sc script %> <%=(RecMain.Fields.Item("main_name").Value)%>
<%=(RecMain.Fields.Item("num_hits").Value)%>
<%=(RecMain.Fields.Item("num_re").Value)%>
<%=FormatDateTime(RecMain.Fields.Item("NewUpdate").Value,2)%>
記錄 <%=(RecMain_first)%> 到 <%=(RecMain_last)%> 共 <%=(RecMain_total)%> 主題數
<% ipage = (MM_offset \ MM_size) +1 iTotalPage =RecMain_total\MM_size+1 ifirst = ipage - 4 if iTotalPage > 9 and ( iTotalPage - ipage ) < 5 then ifirst = iTotalPage - 9 if iTotalPage < 10 and ( iTotalPage - ipage ) < 5 then ifirst = 1 if ( ipage - 5 ) < 0 then ifirst = 1 %> <% for i = 1 to 10 if ifirst = iTotalPage + 1 then exit for if ifirst - ipage = 0 then %> <% else %> <% end if ifirst = ifirst + 1 next if i < 11 then for j = i to 10 %> <% next end if %>
?<% =MM_keepMovepage %>offset=0">第一筆 <% 'ipage = 0 if ipage <= 1 then %> <% else %> ?<% =MM_keepMovepage %>offset=<%=(ipage-2)*MM_size %>"> <% end if %> <%=ifirst%> ?<% =MM_keepMovepage %>offset=<%=(ifirst-1)*MM_size %>"><%=ifirst%> <% if ipage - iTotalPage = 0 then %> <% else %> ?<% =MM_keepMovepage %>offset=<%=(ipage)*MM_size %>"> <% end if 'end if %> ?<% =MM_keepMovepage %>offset=<%=(iTotalPage)*MM_size %>">最後一筆
共<%=iTotalPage%>頁

本討論區係供網友就證照、進修或投資理財等主題交流之用,若發言內容偏離前述主題或有推銷等目的,本版主管理人有權刪除。討論內容如涉及違反中華民國法律或公序良俗,本版主管理人有責刪除。

金證照網站•版權所有•不得轉載 Copyrightc© Gocharter.com.tw All rights reserved.
地址:台北市中正區重慶南路一段57號6樓之4;電話:(02)2375-3000;客服信箱:serve@gocharter.com.tw
<% End If ' end Not RecMain.EOF Or NOT RecMain.BOF %> <% If RecMain.EOF And RecMain.BOF Then %>
資料庫中沒有任何資料,請新增留言。
<% End If ' end RecMain.EOF And RecMain.BOF %>
<% RecMain.Close() Set RecMain = Nothing %>