% IF request("review") = "exit" THEN Session("password") = false END IF%> <% PAGE = Request("PAGE") ' 接收所要瀏覽的頁次 Review = Request("Review") ' 接收快速瀏覽的模式 IF PAGE = "" THEN PAGE = 1 ELSE PAGE = PAGE END IF IF Review = "" THEN Review = "all" END IF ' 快速瀏覽模式 SELECT CASE Review CASE "exit" viewmode = "ALL" Message = "Sorry! No Notice!" Sql = "ID <> 0" CASE "all" viewmode = "ALL" Message = "Sorry ! No Notice!" Sql = "ID <> 0" CASE "today" viewmode = "Today" Message = "Sorry! Today no notice!" Sql = "postdate = cstr(date())" End Select ' 開啟資料檔 Set conn = Server.CreateObject("ADODB.Connection") DBPath = Server.MapPath("news.mdb") conn.Open "driver={Microsoft Access Driver (*.mdb)};dbq=" & DBPath Set rs = Server.CreateObject("ADODB.Recordset") SortSql = "Select *From news Where " & Sql & " order by postdate Desc,posttime Desc" rs.Open SortSql, conn, 1,3 RS.PageSize =1 ' 設定每頁顯示 5 筆,可修改 If Not rs.eof Then ' 有資料才執行 RS.AbsolutePage = PAGE ' 將資料錄移至 PAGE 頁 End if %>
| Add• <% IF session("password") = true then %> Exit•Change PW <% else %> Admin•Change PW <% end if %> | 1 notice per page / Now at page <%=page%> / Total <%=rs.pagecount%> pages / Total <%=rs.recordcount%> notices |
| Now showing <%=viewmode%> |
<%=Message%> <%Else ' 如果有資料 %> <%FOR SH=1 to rs.pageSize ' 顯示資料 IF rs("id") = "急件" Then ' 判斷急件,來設定字型顏色 fontcolor = "#ffffff" ' 白色 Else fontcolor = "#ffffff" ' 白色 End If %> <% rs.movenext if rs.eof then exit for next end if rs.close %>