<!--#include file="../inc/Secure.htm"-->
<%dim ThisKey
ThisKey = "q"
%>
<!--#include file="../inc/permission.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>
<%
ID=request("selectID")
LoginID=session("LoginID")


if ID<>"" and isnumeric(ID) then
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"))
	CurrentID=trim(rs("CurrentID"))
	CheckIDs=trim(rs("CheckIDs"))
	CheckNames=trim(rs("CheckNames"))
	CheckStepIDs=trim(rs("CheckStepIDs"))
	CheckStepNames=trim(rs("CheckStepNames"))

	nOutin=trim(rs("outin"))
	ClassID=trim(rs("Class"))
	PreID=trim(rs("PreID"))
	SecureClass=trim(rs("SecureClass"))
	JinjiClass=trim(rs("JinjiClass"))
	Title=trim(rs("Title"))
	CurrentStep=trim(rs("CurrentStep"))
end if
end if


set rs=server.createobject("adodb.recordset")
sql="select * from tblDoc where BackTo=0 and CurrentID<>0 order by ID desc"
rs.open sql,oConn
n=0
while not rs.eof
Outin=trim(rs("Outin"))
if Outin="1" then
	strOutin="发文"
elseif Outin="2" then
	strOutin="收文"
end if

strTitle=trim(rs("Title"))
if len(strTitle)>14 then
strTitle=left(strTitle,14)&"..."
end if

if trim(rs("ID"))=ID then
str = str& "<option value="& trim(rs("ID")) &" selected>" & "["&strOutin&"]"& strTitle &" ("&year(trim(rs("CreateTimes")))&"-"&month(trim(rs("CreateTimes")))&"-"&day(trim(rs("CreateTimes"))) &")<BR>"
else
str = str& "<option value="& trim(rs("ID")) &">" &"["&strOutin&"]"& strTitle &" ("&year(trim(rs("CreateTimes")))&"-"&month(trim(rs("CreateTimes")))&"-"&day(trim(rs("CreateTimes"))) &")<BR>"
end if


rs.movenext
wend
rs.close
set rs=nothing
%>

<BODY BGCOLOR="#FFFFFF">
<img src="../images/t-lcjk.jpg" border=0>
<div align=center>
<table border=1 cellpadding=3 cellspacing=1 width="100%" bgcolor=#FFFFFF bordercolordark="#FFFFFF" bordercolorlight="#999999">
<tr>
	<td>请选择您要查看的公文（双击）</td>
	<td>所选公文信息</td>
</tr>
<form name="DocForm" method="post" action="">
<tr>
	<td width="50%" valign=top>
	<select name="SelectIDList" multiple size="20" style="width:100%;" ondblClick="document.DocForm.SelectID.value=document.DocForm.SelectIDList[document.DocForm.SelectIDList.selectedIndex].value;document.DocForm.submit();">
	<%=str%>
	</select>
	</td>
	<td width="50%" valign=top>
	<%if ID<>"" and isnumeric(id) AND ID<>"0" then%>
	<table border=1 cellpadding=1 cellspacing=1 width="100%" bgcolor=#FFFFFF bordercolordark="#FFFFFF" bordercolorlight="#999999">
	<tr>
		<td align=right width="30%">流程状态：</td>
		<td disabled><%=GetTableValue("tblDocStep","Name","ID",CurrentStep)%>&nbsp;</td>
	</tr>

	<tr>
		<td align=right>当前用户：</td>
		<td disabled><%=GetTableValue("tblUser","Name","ID",CurrentID)%>&nbsp;</td>
	</tr>

	<tr>
		<td align=right>上步处理：</td>
		<td disabled><%=GetTableValue("tblUser","Name","ID",PreID)%>&nbsp;</td>
	</tr>
	<tr>
		<td align=right>公文种类：</td>
		<td disabled><%=GetTableValue("tblDocClass","Name","ID",ClassID)%>&nbsp;</td>
	</tr>
	<tr>
		<td align=right>紧急程度：</td>
		<td disabled><%=GetJinjiClass(JinjiClass)%>&nbsp;</td>
	</tr>
	<tr>
		<td align=right>秘密等级：</td>
		<td disabled><%=GetSecureClass(SecureClass)%>&nbsp;</td>
	</tr>
	<%
	if nOutin="1" then
	strFile="Doc_look.htm"
	elseif nOutin="2" then
	strFile="Doc_look2.htm"
	end if
	%>
	<tr>
		<td align=right>公文标题：</td>
		<td disabled><a href="<%=strFile%>?ID=<%=ID%>"><%=title%></a>&nbsp;</td>
	</tr>
	
	<%
		FromName=getTableValue("tblUser","Name","ID",FromID)
		arrName=split(CheckNames,".")
		arrStep=split(CheckStepNames,",")	
		if not isempty(arrName) then
		str1=""
		for i=0 to ubound(arrName)
			str1=str1&"("&arrName(i)&")"&"<font color=red>["&arrStep(i)&"]</font>—>"
		next
		str1=str1&"<font color=red>(完成)</font>"
		end if
	%>
	<tr>
		<td colspan=2 disabled><%=FromName&"<font color=red>[拟稿]</font>—>"&str1%></td>
	</tr>

<tr>
	<td colspan=2 disabled>
	<%
	set rs=server.createobject("adodb.recordset")
	sql="select * from tblDocsuggest where DocID="& ID &" order by ID"
	rs.open sql,oConn
	'n=0
	while not rs.eof
	'n=n+1
	'if n mod 2 =0 then
		strColor="#E6F2FF"
	'else
	'	strColor="#FFFFFF"
	'end if
		response.write "<table border=1 cellpadding=1 cellspacing=1 width='100%' bgcolor=#FFFFFF bordercolordark=#FFFFFF bordercolorlight=#999999><tr bgcolor="&strColor&"><td>"
		response.write trim(rs("FromName"))&" 在 "&trim(rs("Times"))&" 的处理："
		response.write "</td></tr><tr><td>"
		response.write replace(replace(rtrim(rs("body")),chr(13),"<br>")," ","&nbsp;")&"&nbsp;"
		response.write "</td></tr></table>"
	rs.movenext
	wend
	rs.close
	set rs=nothing
	%>
	&nbsp;
	</td>
</tr>
<tr>
	<td colspan=2 disabled>
	<%
	set rs=server.createobject("adodb.recordset")
	sql="select * from tblDocPress where DocID="& ID &" order by ID"
	rs.open sql,oConn
	while not rs.eof
		response.write "<table border=1 cellpadding=1 cellspacing=1 width='100%' bgcolor=#FFFFFF bordercolordark=#FFFFFF bordercolorlight=#999999><tr bgcolor=#FFCC66><td>"
		response.write trim(rs("FromName"))&" 在 "&trim(rs("Times"))&" 的催办意见："
		response.write "</td></tr><tr><td>"
		response.write replace(replace(rtrim(rs("body")),chr(13),"<br>")," ","&nbsp;")&"&nbsp;"
		response.write "</td></tr></table>"
	rs.movenext
	wend
	rs.close
	set rs=nothing
	%>
	&nbsp;
	</td>
</tr>

</table>
<%else%>
未选择...
<%end if%>
</td>	
</tr>
<INPUT TYPE="hidden" name="SelectID" value="<%=ID%>">
</form>
</table>
</div>
<%
if ID<>"" and isnumeric(id) AND ID<>"0" and nOutin="2" then%>
<form name="PressForm" method="post" action="SavePress.htm">
<div align=right>
<table border=0 width="50%">
<tr>
	<td>催办意见</td>
	<td><textarea rows=2 cols=30 name="Suggest"></textarea></td>
<tr>
	<td>&nbsp;</td>
	<td><INPUT TYPE="submit" name="cmdUp" value="保 存" onclick="return CheckData();" class="font9boldwhite">&nbsp;&nbsp;		
		<INPUT TYPE="button" name="cmdCancel" value="返  回" onclick="javascript:window.location.href='main.htm'"  class="font9boldwhite">
	</td>
</tr>
</table>
<INPUT TYPE="hidden" name="ID" value="<%=ID%>">
</form>
<%end if%>
<BR><BR>
</BODY>
</HTML>

<script language="JavaScript">

function CheckData()
{
	
	if(jtrim(document.PressForm.Suggest.value)=="")
	{
		alert("请填写催办意见。")
		return false;
	}
			
	return true;
}
</script>
<script language=javascript src="../inc/jtrim.js"></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 GetJinjiClass(byval nClass)
select case trim(nClass)
	case "0"
	GetJinjiClass="未定义"
	case "1"
	GetJinjiClass="缓"
	case "2"
	GetJinjiClass="急"
	case "3"
	GetJinjiClass="加急"
	case else
	GetJinjiClass="未定义"
end select
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
%>
