view.asp

来自「功能齐全的oa系统」· ASP 代码 · 共 133 行

ASP
133
字号
<%option explicit%>
<%
Response.Expires = -1
Response.AddHeader "Pragma","no-cache"
Response.AddHeader "Cache-Control","no-cache,must-revalidate"
%>
<!-- #include virtual="Include/DataEnvi.asp"-->
<!-- #include virtual="include/GetTrueName.asp" -->
<!-- #include virtual="include/ShowAttachs.asp" -->
<%
	Dim ObjDB,ObjRS,StrSQL
	Dim IntID,objRS1
	Dim C
	Dim StrCreateAccountName,StrUpdateAccountName

	IntID = Request.QueryString("ID")
	
	Set ObjDB = Server.CreateObject("Adodb.Connection")
	OpenDB ObjDB

	StrSQL = "Select * From t_OA_Work_Document where ID=" & IntID
	Set C = Server.CreateObject ("CMS2003.DBHandle")
	C.Init (ObjDB)
	
	Set ObjRS = C.View (StrSQL)
	
	StrCreateAccountName  = GetTrueName(ObjDB,ObjRS("CreateAccountID"))
	StrUpdateAccountName = GetTrueName(ObjDB,ObjRS("UpdateAccountID"))
	
	ObjDB.Close 
	Set ObjDB = Nothing
%>
<%'==================================================================%>
<%Sub Main%>
<%'------------------------------------------------------------------%>
<%
	Set ObjDB = Server.CreateObject("Adodb.Connection")
	OpenDB ObjDB
%>
	<%If ObjRS.Count > 0 then %>

	<script language=javascript>
	function setIsHTML(t){
		TBody1.style.display = "none"
		TBody2.style.display = "none"
		if(t==0)TBody1.style.display = ""
		if(t==1)TBody2.style.display = ""
	}

	function GetHTML(){
		var tmpHTML = frameEdit.getHTML()
		document.forms[0].BodyHTML.value = tmpHTML;
	}
	
	var isSetOK = false

	function CheckIsLoadOK(){
<%
	If ObjRS("IsHTML") Then 
%>
		if(frameEdit.IsLoadOK&&(!isSetOK)){
			frameEdit.setHTML("<%=Replace(ObjRS("Body"),Chr(34),"\"&Chr(34))%>")
			//isSetOK = true
		}
		setTimeout("CheckIsLoadOK()",500)
<%
	End If
%>
	}
	
	</script>

	<table class=Ltable cellspacing=1 cellpadding=3 height=96%>
	<tr class=LHtr>
	<td width=15%>查看文档</td>
	<td width=85%></td>
	</tr>
	<tr class=Ltr>
		<td>文档标题:</td>
		<td><input type="text" readonly class=Input Check=1 Show="文档标题" name="_Title" value="<%=ObjRS("Title")%>"></td>
	</tr>
	<tr class=Ltr>
	<td>文档附件:</td>
	<td><%=ShowAttachs(ObjDB,ObjRS("Attachs"))%></td>
	</tr>
	<tr class=Ltr>
		<td>文档信息:</td>
		<td>
		创建人:<%=StrCreateAccountName%> 创建时间:<%=ObjRS("CreateTime")%><br>
		归档人:<%=StrUpdateAccountName%> 归档时间:<%=ObjRS("UpdateTime")%>
		</td>
	</tr>

<%
	If Not ObjRS("IsHTML") Then 
%>

	<tr class=Ltr id=TBody1 height=100%>
	<td colspan=2><textarea style="width=100%;height=100%" name="Body" class=textbody readonly><%=ObjRS("Body")%></textarea></td>
	</tr>
<%
	Else
%>

	<tr class=Ltr id=TBody2 height=100%>
	<td colspan=2><iframe style="width=100%;height=100%" src="Showcontent.asp?ID=<%=Request.QueryString("ID")%>" class=textbody1 readonly frameborder=0 id=frameEdit></iframe></td>
	</tr>

<%
	End If
%>



	</table>
	<table cellspacing=1 cellpadding=3>
	<tr>
		<td><input type=button class=Button value='打 印' onclick=window.print()><input type="button" class=Button value="返 回"onclick="doBack()" id=button1 name=button1></td>
	</tr>
	</table>

	<script language=javascript>
	CheckIsLoadOK()
	</script>

	<%end if%>
	
	
<%'------------------------------------------------------------------%>
<%End Sub%>
<%'==================================================================%>
<!-- #include file="Templet.asp" -->

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?