view_attach.asp

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

ASP
82
字号
<% option explicit%>
<!-- #include virtual="include/DataEnvi.asp" -->
<!-- #include file="GetGifURL.asp" -->
<%
Dim ObjDB,ObjRS,StrSQL,StrSQL1
Dim IntComMsgID,StrAttachs


IntComMsgID = Request.QueryString ("ID")

Set ObjDB=Server.CreateObject ("ADODB.Connection")
OpenDB ObjDB

StrSQL = "Select Attachs From T_CRM_Stock_Application where ID=" & IntComMsgID

Set ObjRS = ObjDB.Execute(StrSQL)
StrAttachs = ObjRS("Attachs")

If StrAttachs<>"" Then

	StrAttachs = Replace(StrAttachs,",","','")
	StrAttachs = "'" & StrAttachs & "'"

	StrSQL1 = "Select * From t_OA_Attach where keypath In (" & StrAttachs & ") Order By ID"
	Set ObjRS = ObjDB.Execute(StrSQL1)

End If

%>


<style>
td         { font-size:12px }
textarea         { font-size:12px }
</style>

<table   cellspacing=1 cellpadding=3 width=100%>
<%
	If StrAttachs<>"" Then
%>
<%

	Dim i,j
	i = 0
	While Not ObjRS.Eof
		i = i + 1
		If (i mod 8)=1 Then Response.Write "<tr>"
%>
<%
	Dim StrFileName,PicName
	StrFileName = ObjRS("FileName")

%>

<td align=center width=12% style="line-height: 150%;cursor:hand" onclick="window.open('<%=Application("RootPath")%>OA/Attach/View.asp?ID=<%=ObjRS("KeyPath")%>')">
<img src="<%=Application("RootPath")%>Images/OA/Attach/Icon/<%=GetGifURL(StrFileName)%>"><br><%=StrFileName%></td>
<%
		ObjRS.MoveNext
	If (i mod 8)=0 Then Response.Write "</tr>" & vbcrlf
	Wend
	
	If (i Mod 8) <> 0 Then
		For j = 1 To 8- (i Mod 8)
			Response.Write "<td width='12%'></td>" & vbcrlf
		Next
		Response.Write "</tr>" & vbcrlf	
	End If
	
	
	
%>

<%
Else Response.write "<td align=center>没有附件</td>"

End If

%>
</table>
</body>
</html>

⌨️ 快捷键说明

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