<!--#include file="../inc/Secure.htm"-->
<!--#include file="../inc/conn.htm"-->
<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>

<%
LoginID=trim(session("LoginID"))
if LoginID="" then LoginID=0
UserName=GetTableValue ("tblUser","Name","ID",LoginID)
Department=GetTableValue ("tblUser","Department","ID",LoginID)

set rs=Server.CreateObject("ADODB.RecordSet")
sql="select ID,FromID,Class,Title,Title2,CreateTimes,ReadID,ReadEvery,ReadDepartMentID,HaveRead from tblDoc where (Finish=1 and Reading=1 and isOld=0) Order by ID desc"
rs.open sql,oConn,1,1
%>
<table border=0 width="100%" bgcolor=#FFFFFF cellpadding=3>
<tr bgcolor=#eeeddb>
	<td>分类</td>
	<td>标题</td>
	<td>主题词</td>
	<td>拟搞人</td>
	<td>拟稿时间</td>
</tr>

<%
while not rs.eof

strReadID=trim(rs("ReadID"))
arrReadID=split(strReadID,",")
bYes=false
for i=0 to ubound(arrReadID)
	if trim(arrReadID(i))=trim(LoginID) then
	bYes=true
	exit for
	end if
next


if (bYes or trim(rs("ReadEvery"))="1" or trim(rs("ReadDepartMentID"))=Department) then
%>
	<tr>
		<td nowrap><%=GetTableValue("tblDocClass","Name","ID",trim(rs("Class")))%></td>
		<td><a href="DocFinal.htm?ID=<%=trim(rs("ID"))%>"><%=trim(rs("Title"))%></a></td>
		<td><a href="DocFinal.htm?ID=<%=trim(rs("ID"))%>"><%=trim(rs("title2"))%></a></td>
		<td nowrap width=50><%=GetTableValue("tblUser","Name","ID",trim(rs("Fromid")))%></td>
		<td nowrap width=110><%=trim(rs("CreateTimes"))%></td>		
	</tr>
<%
end if
rs.movenext
wend
rs.close
set rs=nothing
%>

</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>