<!--#include file="../inc/Secure.htm"-->
<%dim ThisKey
ThisKey = "p"
%>
<!--#include file="../inc/permission.htm"-->
<!--#include file="../inc/conn.htm"-->
<%
LoginID=trim(session("LoginID"))
if LoginID="" then LoginID=0
Title=trim(Request("Title"))

maxmessage=15
currentpage=request("page")
if currentpage="" then 
currentpage=1
end if

set rs=Server.CreateObject("ADODB.RecordSet")
sql="select ID,FromID,Class,Title,Title2,CreateTimes,FromDepartment from tblDoc where Finish=1 and Reading=1 and IsOld=1  "
if Title<>"" then
sql=sql&" and Title like '%"& Title &"%' "
end if
sql=sql& " 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
%>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../CSS/main.css">
</HEAD>
<BODY BGCOLOR="#FFFFFF">
<h2><font color=#ff0000>已经归档的公文</font></h2>
<form name="DocSearch" method="post" action="">
公文标题检索：<input type="text" name="title" value="<%=title%>" class="input" size=30 maxlength=50>
<INPUT TYPE="submit" name="cmdUp" value="检  索" class="font9boldwhite">
</form>
<%
response.write "已归档的公文 共" & totalmessage & "条/" & totalpage & "页，每页"& maxmessage &"条"
if totalpage>0 then
	response.write "，第" & currentpage & "页　"
end if

if totalpage>1 then
	if currentpage>1 then%>
		<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?page=<%=currentpage-1%>&title=<%=title%>">上页</a>　　
		<%
	end if

	if currentpage+1<=totalpage then%>
		<a href="<%=Request.ServerVariables("SCRIPT_NAME")%>?page=<%=currentpage+1%>&title=<%=title%>">下页</a>
		<%
	end if
end if
%>
<table border=0 width="100%" bgcolor=#FFFFFF cellpadding=3>
<tr bgcolor=#eeeddb>
<td width="10%">部门</td>
<td width="10%">分类</td>
<td>标题</td>
<td width="20%">主题词</td>
<td width="15%">拟搞人</td>
<td>拟稿时间</td>
</tr>
<%
if isempty(msgArr) then
	response.write "<tr><td colspan=7>该内容暂时为空。</td></tr>"
else
for i = 0 to UBound(msgArr,2)
%>
	<tr>
		<td nowrap><%=GetTableValue("tblDepartment","Name","ID",trim(msgArr(6,i)))%></td>
		<td nowrap><%=GetTableValue("tblDocClass","Name","ID",trim(msgArr(2,i)))%></td>
		<td><a href="DocOldDetail.htm?ID=<%=trim(msgArr(0,i))%>"><%=trim(msgArr(3,i))%></a></td>
		<td><a href="DocOldDetail.htm?ID=<%=trim(msgArr(0,i))%>"><%=trim(msgArr(4,i))%></a></td>
		<td nowrap><%=GetTableValue("tblUser","Name","ID",trim(msgArr(1,i)))%></td>
		<td nowrap width=110><%=trim(msgArr(5,i))%></td>
		
	</tr>
<%
next
end if
%>

</table>


</BODY>
</HTML>
<%
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

%>
<!--#include file="../inc/conn_close.htm"-->
<script language=javascript>
function CheckDelete()
{
	return confirm("确实删除吗？");
}
</script>