<!--#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>
<%
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"))

	title=replace(trim(rs("title")),"'","''")
	body=replace(rtrim(rs("body")),"'","''")
	MainTo=trim(rs("MainTo"))
	CopyTo=trim(rs("CopyTo"))
	inDepartment=trim(rs("inDepartment"))
	FinishTime=trim(rs("FinishTime"))
	Recieved=trim(rs("Recieved"))&""
	CurrentStep=trim(rs("CurrentStep"))
	nOutin=trim(rs("outin"))
	nClass=trim(rs("Class"))
	if nOutin="1" then
	strOutin="发文"
	strFileName="Doc_look.htm"
	elseif nOutin="2" then
	strOutin="收文"
	strFileName="Doc_look2.htm"
	end if
end if
end if


set rs=server.createobject("adodb.recordset")
sql="select * from tblDoc where CurrentID<>0 order by ID desc"
rs.open sql,oConn
n=0
while not rs.eof

nFromID=trim(rs("FromID"))
CheckIDs=trim(rs("CheckIDs"))&""
CheckSteps=trim(rs("CheckStepNames"))&""

arrCheckIDs=split(CheckIDs,".")
arrCheckSteps=split(CheckSteps,",")
intN=0
for i=0 to ubound(arrCheckSteps)
	if trim(arrCheckSteps(i))="催办" then
		intN=i
	exit for
	end if
next
bPress=false
if intN<>"0" then

strCheckIDs=arrCheckIDs(intN)
arrCheck=split(strCheckIDs,",")
for j=0 to ubound(arrCheck)
	if trim(arrCheck(j))=LoginID then
		bPress=true
		exit for
	end if
next
end if
if trim(nFromID)=trim(LoginID) then bPress=true

if bPress then

	strTitle=trim(rs("Title"))
	if len(strTitle)>18 then
		strTitle=left(strTitle,16)&"..."
	end if
	if trim(rs("ID"))=ID then
		str = str& "<option value="& trim(rs("ID")) &" selected>" & strTitle &" ("&year(trim(rs("CreateTimes")))&"-"&month(trim(rs("CreateTimes")))&"-"&day(trim(rs("CreateTimes"))) &")<BR>"
	else
		str = str& "<option value="& trim(rs("ID")) &">" & strTitle &" ("&year(trim(rs("CreateTimes")))&"-"&month(trim(rs("CreateTimes")))&"-"&day(trim(rs("CreateTimes"))) &")<BR>"
	end if
end if

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

<BODY BGCOLOR="#FFFFFF">
<img src="../images/t-gwcb.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=0 width="100%">
	<tr><td width="50%" align=right><a href="<%=strFileName%>?ID=<%=ID%>">查看详情>></a></td>
	<td align=right><font color=red>当前流程：<%=GetTableValue("tblUser","Name","ID",CurrentID)&" ("&GetTableValue("tblDocStep","Name","ID",CurrentStep)&")"%></font></td></tr></table>
<table border=1 cellpadding=1 cellspacing=1 width="100%" bgcolor=#FFFFFF bordercolordark="#FFFFFF" bordercolorlight="#999999">
<tr>
	<td align=right width="20%">种类</td>
	<td disabled><%=strOutin&" ["&gettableValue("tblDocClass","Name","ID",nClass)&"]"%>&nbsp;</td>
</tr>
<tr>
	<td align=right>标题</td>
	<td disabled><a href="<%=strFileName%>?ID=<%=ID%>"><%=Title%></a></td>
</tr>

<tr>
	<td align=right valign=top>正文/摘要</td>
	<td disabled>
	<%if trim(body)<>"" then
	if len(body)>80 then%>
		<%=replace(replace(server.htmlencode(left(body,80)&" ")," ","&nbsp;"),chr(13),"<BR>")&"......"%>
		<%else%>
		<%=replace(replace(server.htmlencode(body&" ")," ","&nbsp;"),chr(13),"<BR>")%>
	<%end if%>
	<%else%>
	&nbsp;
	<%end if%></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 align=right valign=top>公文路径</td>
	<td 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 bgcolor="&strcolor&"><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" then%>
<form name="PressForm" method="post" action="SavePress.htm">
<div align=right>
<table border=0 width="60%">
<tr>
	<td valign=top>催办意见</td>
	<td><textarea rows=4 cols=40 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
%>
