<%response.expires=-1%> <% LoginID=trim(session("LoginID")) if LoginID="" then LoginID=0 UserName=GetTableValue ("tblUser","Name","ID",LoginID) Department = GetTableValue ("tblUser","Department","ID",LoginID) maxmessage=20 currentpage=request("page") if currentpage="" then currentpage=1 end if set rs=Server.CreateObject("ADODB.RecordSet") sql="select ID,ClassID,Title,KeyWords,FromName,Times,ToID, ToDepartMent,ToAll from tblBulletin where (ToID<>'' or ToAll=1 or toDepartment="& Department &" ) Order by ID desc" rs.pagesize=maxmessage rs.open sql,oConn,1,1 totalpage=rs.pagecount totalmessage=rs.recordcount if totalmessage<>0 then rs.AbsolutePage=currentpage msgArr=rs.getrows(maxmessage) end if rs.close %>

上页　　 下页

分类 | 标题 | 主题词 | 发布人 | 发布时间
<% if isempty(msgArr) then response.write "
暂时没有内容。
" else n=0 for i = 0 to UBound(msgArr,2) toAll=trim(msgArr(8,i)) toDepartment=trim(msgArr(7,i)) strToID=trim(msgArr(6,i)) arrToID=split(strToID,",") dim bToID bToID=false for k=0 to ubound(arrToID) if trim(LoginID)=trim(arrToID(k)) then bToID=true exit for end if next if (bToID=true or Toall="1" or toDepartment=trim(Department)) then n=n+1 if n mod 2 =0 then strColor="#FFFFFF" else strColor="#E6F2FF" end if %> <% end if next end if %>

<% Function GetTableValue(TableName,Field,ValueField,Value) if TableName<>"" and Value<>"" then Set RsTmp = Server.Createobject("Adodb.recordset") strSql = "Select "& Field &" from "& TableName &" where "& ValueField &"='"& Value &"'" Rstmp.open strSql,oConn,1,1 If not Rstmp.eof then GetTableValue=trim(Rstmp(Field)) else GetTableValue="" end if Rstmp.close 'set RsTmp = Nothing else GetTableValue="" end if End Function %>