<!--#include file="../inc/conn.htm"-->
<%
ID=trim(request("ID"))
LoginID=session("LoginID")
if LoginID="" then response.end
UserName= trim(session("RealName"))

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"))
	CheckIDs=trim(rs("CheckIDs"))
	CheckNames=trim(rs("CheckNames"))
	CheckStepIDs=trim(rs("CheckStepIDs"))
	CheckStepNames=trim(rs("CheckStepNames"))

	inDepartment=trim(rs("inDepartment"))
	inTime=trim(rs("inTime"))
	intoDepartment=trim(rs("intoDepartment"))
	inFromName=trim(rs("inFromName"))
	intoName=trim(rs("intoName"))
	inSerial=trim(rs("inSerial"))
	inTelcode=trim(rs("inTelcode"))
	inRecieved=trim(rs("inRecieved"))

	title=replace(trim(rs("title")),"'","''")
	nClass=trim(rs("Class"))
	if nClass="" then nClass=0
	body=replace(rtrim(rs("body")),"'","''")
	body2=replace(rtrim(rs("body2")),"'","''")
	remark=replace(rtrim(rs("remark")),"'","''")
	attachfile=replace(trim(rs("attachfile")),"'","''")
	OutWord=trim(rs("OutWord"))
	OutSerial=trim(rs("OutSerial"))
	JinjiClass=trim(rs("JinjiClass"))
	SecureClass=trim(rs("SecureClass"))
	SecureTime=trim(rs("SecureTime"))
	Author=trim(rs("Author"))
	OutGoing=trim(rs("OutGoing"))
	PrintDepartment=trim(rs("PrintDepartment"))
	PrintTime=trim(rs("PrintTime"))
	NigaoDepartment=trim(rs("NigaoDepartment"))
	Nigao=trim(rs("Nigao"))
	Printer=trim(rs("Printer"))
	Publish=trim(rs("Publish"))
	Jiaodui=trim(rs("Jiaodui"))
	Copys=trim(rs("Copys"))
	MainTo=trim(rs("MainTo"))
	CopyTo=trim(rs("CopyTo"))
	CopyTo2=trim(rs("CopyTo2"))
	SendTo=trim(rs("SendTo"))
	Title2=trim(rs("Title2"))
	FinishTime=trim(rs("FinishTime"))
	AttachFileBody=trim(rs("AttachFileBody"))
	Recieved=trim(rs("Recieved"))&""
	CurrentStep=trim(rs("CurrentStep"))
	Pigebody=rtrim(rs("pigebody"))&""
	CheckNames=trim(rs("CheckNames"))
	CheckStepNames=trim(rs("CheckStepNames"))
end if
rs.close
set rs=nothing


set rs=server.createobject("adodb.recordset")
sql="select top 1 * from tblDocSuggest where DocID="& ID &" and StepName='签发'"
rs.open sql,oConn
if not rs.eof then
	strQianfa=trim(rs("body"))
	strQianfa2=getTableValue("tblUser","Signature","ID",trim(rs("FromID")))
	if strQianfa2<>"" then
	strQianfa2="<img src=../File_up/Photo/"&LoginID&"/"&getTableValue("tblUser","Signature","ID",trim(rs("FromID")))&" border=0>"

	else
	strQianfa2=trim(rs("FromName"))
	end if
	strQianfa3=trim(rs("Times"))
end if
rs.close
sql="select top 1 * from tblDocSuggest where DocID="& ID &" and StepName='会签'"
rs.open sql,oConn
if not rs.eof then
	strHuiQian=trim(rs("body"))
	strHuiQian2=getTableValue("tblUser","Signature","ID",trim(rs("FromID")))
	if strHuiqian2<>"" then
	strHuiQian2="<img src=../File_up/Photo/"&LoginID&"/"&getTableValue("tblUser","Signature","ID",trim(rs("FromID")))&" border=0>"
	else
		strHuiQian2=trim(rs("FromName"))
	end if
	strHuiQian3=trim(rs("Times"))
end if
rs.close

if trim(body)<>trim(body2) and trim(body2)<>"" then body=body2
%>
<html>
<head>
<title>公文打印</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../CSS/print.css">
</head>
<script src="Popup.js"></script>
<body bgcolor="#FFFFFF" leftmargin=20>

<div align=left><font color=red><b>密级：</b><%=GetSecureClass(SecureClass)%></font></div>
<BR><BR>
<div align=center><b><font color=#FF0000 size=6 style="letter-spacing:6pt">敦卫科技 &nbsp;&nbsp;发文稿纸</font></b>
</div>
<BR>
<table border=0 width="100%">
<tr bgcolor=#FFFFFF>
	<td align=center><font color=red><%=OutWord%>   [</font> <%=OutSerial%> <font color=red>]  号</font></td>
</tr>
</table><BR>
<table border=1 bordercolor=#FF0000 cellpadding=0 cellspacing=0 width="100%" bgcolor=#FF0000 >

<tr bgcolor=#FFFFFF height=110>
	<td width="50%" valign=top>&nbsp;<font color=red><b>签发：</b></font><BR><BR>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<%=strQianfa&"<br><div align=right>"&strQianfa2&"<BR>"&year(strQianfa3)&"-"&month(strQianfa3)&"-"&day(strQianfa3)&"</div>"%>
	</td>
	<td width="50%" valign=top>&nbsp;<font color=red><b>会签：</b></font><BR><BR>
	&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
	<%=strHuiQian&"<br><div align=right>"&strHuiQian2&"<BR>"&year(strHuiQian3)&"-"&month(strHuiQian3)&"-"&day(strHuiQian3)&"</div>"%>
</td>
</tr>
<tr bgcolor=#FFFFFF height=80>
	<td width="50%" valign=top>&nbsp;<font color=red><b>主送：</b></font><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=Mainto%></td>
	<td valign=top>&nbsp;<font color=red><b>发：</b></font><BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<%=Sendto%></td>
</tr>
<tr bgcolor=#FFFFFF height=35>
	<td valign=center colspan=2>&nbsp;<font color=red><b>抄报：</b></font>&nbsp;<%=copyTo2%></td>
</tr>
<tr bgcolor=#FFFFFF height=35>
	<td valign=center colspan=2>&nbsp;<font color=red><b>抄送：</b></font>&nbsp;<%=Copyto%></td>
</tr>
<tr bgcolor=#FFFFFF height=35>
	<td valign=center colspan=2>
	<table border=0 width="100%">
	<tr>
	<td width="40%">&nbsp;<font color=red><b>拟稿单位：</b></font><%=NigaoDepartment%></td>
	<td width="30%">&nbsp;<font color=red><b>拟稿：</b></font><%=Nigao%></td>
	<td width="30%">&nbsp;<font color=red><b>核稿：</b></font><%=Author%></td>
	</tr>
	</table>
	</td>
</tr>
<tr bgcolor=#FFFFFF height=35>
	<td valign=center colspan=2>
	<table border=0 width="100%">
	<tr>
	<td width="40%">&nbsp;<font color=red><b>打印：</b></font><%=Printer%></td>
	<td width="30%">&nbsp;<font color=red><b>校对：</b></font><%=Jiaodui%></td>
	<td width="30%">&nbsp;<font color=red><b>份数：</b></font><%=Copys%></td>
	</tr>
	</table>
	</td>
</tr>
<tr bgcolor=#FFFFFF height=35>
	<td valign=center colspan=2>&nbsp;<font color=red><b>附件：</b></font>&nbsp;</td>
</tr>
<tr bgcolor=#FFFFFF height=35>
	<td valign=center colspan=2>&nbsp;<font color=red><b>主题词：</b></font>&nbsp;<%=Title2%></td>
</tr>
<tr bgcolor=#FFFFFF height=35>
	<td valign=center colspan=2>&nbsp;<font color=red><b>标题：</b></font>&nbsp;<%=Title%></td>
</tr>
<tr bgcolor=#FFFFFF height=35>
	<td valign=center colspan=2>&nbsp;<font color=red>（正文）</td>
</tr>
<tr bgcolor=#FFFFFF>
	<td valign=top colspan=2 align=center>
	<table border=0 width="100%" cellpadding=3 cellspacing=3><tr><td>
	<%if len(body)>198 then%>
	<P><%=replace(replace(left(server.htmlencode(body&" "),198)," ","&nbsp;"),chr(13),"<BR>")%></P>
	<%else%>
	<P><%=replace(replace(server.htmlencode(body&" ")," ","&nbsp;"),chr(13),"<BR>")%></P>
	<%end if%>
	</td></tr></table>
	</td>
</tr>
</table>
</div>

<table border=0 width="100%">
<tr id="PrintM">
<td align=right><input type="button" value="打  印" class="font9boldwhite" onclick="SetPrint();"></td></tr>
</table>
<BR><BR>
<table border=0 width="100%">
<tr ID="PrintOther" style="display:none"><td>
<%if len(body)>198 then%>
<P><%=replace(replace(right(server.htmlencode(body&" "),(len(body)-197))," ","&nbsp;"),chr(13),"<BR>")%></P>
<%end if%>
</td></tr>
</table>
</body>
</html>
<script language="javascript">
function SetPrint(){
document.all('PrintM').style.display="none";
document.all('PrintOther').style.display="";
print();
}
</script>
<!--#include file="../inc/conn_close.htm"-->

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


Private function GetSecureClass(byval nClass)
select case trim(nClass)
	case "0"
	GetSecureClass="未定义"
	case "1"
	GetSecureClass="普通"
	case "2"
	GetSecureClass="秘密"
	case "3"
	GetSecureClass="机密"
	case "4"
	GetSecureClass="绝密"
	case else
	GetSecureClass="未定义"
end select
end function
%>