<!--#include file="../inc/Secure.htm"-->
<%dim ThisKey
ThisKey = "o"
%>
<!--#include file="../inc/permission.htm"-->
<!--#include file="../inc/conn.htm"-->
<!--#include file="../inc/dbtools.htm"-->

<%
LoginID=trim(session("LoginID"))
if LoginID="" then LoginID=0

ID=trim(request("ID"))
if ID="" then response.redirect "NewDoc.htm"


set rs=server.createobject("adodb.recordset")
sql="select * from tblDoc where ID="& ID
rs.open sql,oConn
if not rs.eof then
	FromID=trim(rs("FromID"))
	title=trim(rs("title"))
	title2=trim(rs("title2"))
	nClass=trim(rs("Class"))
	if nClass="" then nClass=0
	body=trim(rs("body2"))
	remark=trim(rs("remark2"))
	confirmer=trim(rs("confirmer"))
	collate=trim(rs("collate"))
	CheckName=trim(rs("CheckName"))
	CheckStatus=trim(rs("CheckStatus"))
	CheckID=TRIM(rs("CheckID"))
	AttachFile=trim(rs("AttachFile"))
	Times=trim(rs("Times"))
end if
rs.close
set rs=nothing

%>
<HTML>
<HEAD>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../CSS/main.css">
</HEAD>
<script src="Popup.js"></script>

<BODY BGCOLOR="#FFFFFF">
<table border=1 cellpadding=3 cellspacing=1 width="90%" bgcolor=#EEEEEE bordercolordark="#FFFFFF" bordercolorlight="#999999">
<tr><td colspan=4 align=center><font color=red>归档前请确认有足够的时间以保证每个需要传阅的人都有批阅！</font></td></tr>
<tr width="100%">
	<td align=right width=80>标题</td>
	<td><%=Title&"&nbsp;"%></td>
	<td align=right width="15%" nowrap>主题词</td>
	<td><%=Title2&"&nbsp;"%></td>
</tr>

<tr>
	<td align=right>分类</td>
	<td><%=getTableValue ("tblDocClass","Name","ID",nClass)%></td>
	<td align=right>审批路径</td>
	<td><%=CheckName&"&nbsp;"%></td>
</tr>
<tr>
	<td align=right>内容</td>
	<td colspan=3><textarea name="body" rows=5 cols=55 readonly><%=body%></textarea></td>
</tr>
<tr>
	<td align=right>备注</td>
	<td colspan=3><textarea name="Remark" rows=5 cols=55 readonly><%=remark%></textarea></td>
</tr>
<tr>
	<td align=right>附件</td>
	<td colspan=3>
		<%if AttachFile<>"" then%>
		<a target="_blank" href="../File_Up/Doc/<%=ID%>/<%=AttachFile%>"><%=AttachFile%></a>
		<%else
		response.write "&nbsp;"
		end if%>
	</td>
</tr>
<tr>
	<td align=right>核搞人</td>
	<td colspan=3 valign=top><%=confirmer&"&nbsp;"%></td>
</tr>
<tr>
	<td align=right>校对人</td>
	<td colspan=3><%=collate&"&nbsp;"%></td>
</tr>
<tr bgcolor=#CCCCFF>
	<td align=right>&nbsp;</td>
	<td colspan=3>现有的阅文意见</td>
</tr>
<tr>
	<td align=right>&nbsp;</td>
	<td colspan=3>
	<%
	set rs=server.createobject("adodb.recordset")
	sql="select * from tblDocFinal where DocID="& ID
	rs.open sql,oConn
	while not rs.eof
		response.write "<table border=0 width='100%'><tr bgcolor=#ffffff><td>"
		response.write trim(rs("FromName"))&" 在 "&trim(rs("Times"))&" 的批示："
		response.write "</td></tr><tr><td>"
		response.write replace(replace(trim(rs("body")),chr(13),"<br>")," ","&nbsp;")
		response.write "</td></tr></table>"
	rs.movenext
	wend
	rs.close
	set rs=nothing
	%>
	
	</td>
</tr>
<form name="DocForm" method="post" action="DocToOldProg.htm">
<tr>
<td>&nbsp;</td>
<td colspan=2><INPUT TYPE="submit" name="cmdUp" value="确认归档" class="font9boldwhite"></td>
<td><INPUT TYPE="button" name="return" value="返  回" class="font9boldwhite" onclick="javascript:history.back(-1);"></td>
</tr>
<input type="hidden" name="ID" value="<%=ID%>">
</form>
</table>
<BR><BR>
</BODY>
</HTML>
<!--#include file="../inc/conn_close.htm"-->
<script language=javascript>
function CheckDelete()
{
	return confirm("确实删除吗？");
}
function OpenWindow(url,windowname)
{
window.open(url,windowname,'left=100,top=50,height=350,width=650,toolbar=no,menubar=no,scrollbars=yes')
}
function OpenWindow1(url,windowname)
{
window.open(url,windowname,'left=150,top=100,height=80,width=420,toolbar=no,menubar=no,scrollbars=yes')
}
function CheckData()
{
	if ((jtrim(document.UserForm.ReadNameList.value)=="") && (document.UserForm.ReadEvery.checked==false) && (jtrim(document.UserForm.ReadDepartmentID.value)=="0"))
	{
		alert ("请指定传阅人！");
		return false;
	}
	return true;
}
</script>
<script language="javascript" src="../inc/jtrim.js"></script>
<%
sub DeleteOneDir (PathName)
	PathName=Server.Mappath(PathName)
	dim fsfl
	Set fsfl = server.CreateObject("Scripting.FileSystemObject")
	if trim(PathName)<>"" and fsfl.FolderExists(PathName) then 
		fsfl.DeleteFolder PathName
	end if
	set fsfl=nothing	
end sub
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

Sub AddFinal()
	sql="INSERT INTO tblDocFinal(FromID, DocID,FromName,Body) VALUES(" & FromID & _
		","& DocID & _
		",'" & FromName & _
		"','"& body & _
		"');"		
		'response.write sql
		oConn.execute (sql)

end sub
%>