⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 folder.inc

📁 物业管理和办公自动化系统
💻 INC
字号:
<%

Function FileStatisticTable()

	dim crs		: set crs = New CRecordset
	dim rs
	dim iFileCount

	' ****************************************************************************************************
	' 一、我在根目录中的文件
	' ****************************************************************************************************
	dim iRootFileCount, iRootShareFileCount
	dim sSQL	: sSQL = "select count(*) as file_count, count(opento) as share_file_count from t_files where emp_serial = " & iEmpSerial & " and folder is null"
	set rs = crs.Open(dbLocal, sSQL)
	iRootFileCount = crs.GetValue("file_count")
	iRootShareFileCount = crs.GetValue("share_file_count")
	rs.close()
	set rs = nothing

	' ****************************************************************************************************
	' 二、我自己的不在根目录中的文件统计信息
	' ****************************************************************************************************
	dim iMyFileCount, iMyShareFileCount
	sSQL = "select t2.folder_id, t2.folder_name, count(t1.serial) as file_count, count(t1.opento) as share_file_count" & _
			" from t_files t1 right join t_filefolder t2 on t1.folder = t2.folder_id" & _
			" where t2.emp_serial = " & ToSQL(iEmpSerial,"Number") & _
			" group by t2.folder_name, t2.folder_id" & _
			" order by t2.folder_name"
'	response.write sSQL : response.end
	set rs = crs.open(dbLocal,sSQL)
	dim sFolderId, sFolderName

	dim sTemp						: sTemp = ""				' 临时字符串变量
	dim iMyFileTotal				: iMyFileTotal = 0			' 总的文件数
	dim iMyShareFileTotal		: iMyShareFileTotal = 0		' 总的共享文件数
	while not rs.EOF
		sFolderId			= crs.GetValue("folder_id")
		sFolderName		= crs.GetValue("folder_name")
		iMyFileCount			= crs.GetValue("file_count")
		iMyShareFileCount	= crs.GetValue("share_file_count")

		'' 总文件数增加
		iMyFileTotal = iMyFileTotal + iMyFileCount
		iMyShareFileTotal = iMyShareFileTotal + iMyShareFileCount

		'' 如果是根目录,则文件夹标识和文件夹名称均为空字串
		if sFolderId = "" then sFolderName = "/"

		sTemp = sTemp & "<tr bgcolor=white height=20" & _
				" onmouseover=""this.style.backgroundColor='#B0E0E6';this.style.color='black';""" & _
				" onmouseout=""this.style.backgroundColor='white';this.style.color='black';"">" & vbLF & _
				"	<td nowrap><img border=0 width=35 height=0>" & _
					"<span style=""color:blue;"">" & sFolderName & "</span>" & _
					"&nbsp;<img border=0 src=""images/edit.gif"" width=13 height=10 style=""cursor:hand"" alt=""文件夹重命名""" & _
					" onclick=""window.open('folder_e.asp?folder_id=" & sFolderId & "&','','height=124,width=350,left=200,top=200')"">" & _
					"&nbsp;<img border=0 src=""images/delete.gif"" width=10 height=10 style=""cursor:hand"" alt=""删除文件夹""" & _
					" onclick=""window.open('folder_d.asp?folder_id=" & sFolderId & "&','','height=170,width=350,left=200,top=200');""></td>" & vbLF & _
				"	<td nowrap align=center>" & iMyFileCount & "</td>" & vbLF & _
				"	<td nowrap align=center>" & iMyShareFileCount & "</td>" & vbLF & _
				"	<td nowrap align=center>" & (iMyFileCount - iMyShareFileCount) & "</td>" & vbLF & _
				"</tr>" & vbLF
		rs.movenext
	wend
	rs.close()
	set rs = nothing

	' ****************************************************************************************************
	' 三、别人共享给我的文件统计信息:文件主人不是我,但共享人员中包括我
	' --------------------------------------------------------------------------------------------------------------------------------------------
	sSQL = "select count(*) as file_count from t_files where emp_serial <>" & iEmpSerial & " and PATINDEX('%," & iEmpSerial & ",%', ','+replace(opento,' ','')+',') >0"
	set rs = crs.Open(dbLocal, sSQL)
	dim iOtherShareFileCount	: iOtherShareFileCount = crs.GetValue("file_count")
	crs.Close()	

	'' 我的文件数=各目录中的文件数+根目录中的文件数
	iMyFileTotal = iMyFileTotal + iRootFileCount
	iMyShareFileTotal = iMyShareFileTotal + iRootShareFileCount
	FileStatisticTable = _
		"<table cellspacing=1 cellpadding=3 width=""100%"" align=center bgcolor=silver style=""table-layout:fixed"">" & vbLF & _
		"<tr bgcolor=white style=""display:none"">" & vbLF & _
		"	<td nowrap width=""*"">第一列</td>" & vbLF & _
		"	<td nowrap width=""130"">第二列</td>" & vbLF & _
		"	<td nowrap width=""130"">第三列</td>" & vbLF & _
		"	<td nowrap width=""130"">第四列</td>" & vbLF & _
		"</tr>" & vbLF & _
		"<tr height=20 bgcolor=""#0099cc""><td colspan=4><b class=shadow>::文件统计信息::</b></td></tr>" & vbLF & _
		"<tr height=20 bgcolor=""#eeeeee"" style=""font-weight:600"">" & vbLF & _
		"	<td align=center>所在文件夹</td>" & vbLF & _
		"	<td align=center>总文件数</td>" & vbLF & _
		"	<td align=center>共享文件数</td>" & vbLF & _
		"	<td align=center>不共享文件数</td>" & vbLF & _
		"</tr>" & vbLF & _
		"<tr bgcolor=""#FFE4C4"" style=""color:navy;font-weight:600"">" & vbLF & _
		"	<td>&nbsp;我的个人文件夹</td>" & vbLF & _
		"	<td align=center>" & iMyFileTotal & "</td>" & vbLF & _
		"	<td align=center>" & iMyShareFileTotal & "</td>" & vbLF & _
		"	<td align=center>" & (iMyFileTotal - iMyShareFileTotal) & "</td></tr>" & vbLF & _
		"<tr bgcolor=white" & vbLF & _
				" onmouseover=""this.style.backgroundColor='#B0E0E6';this.style.color='black';""" & _
				" onmouseout=""this.style.backgroundColor='white';this.style.color='black';"">" & vbLF & _
		"	<td><img border=0 width=35 height=0>/( 根目录 )</td>" & vbLF & _
		"	<td align=center>" & iRootFileCount & "</td>" & vbLF & _
		"	<td align=center>" & iRootShareFileCount & "</td>" & vbLF & _
		"	<td align=center>" & (iRootFileCount - iRootShareFileCount) & "</td></tr>" & vbLF & _
		sTemp & vbLF & _
		"<!-- 别人共享给我的文件 -->" & vbLF & _
		"<tr bgcolor=""#FFE4C4"" style=""color:navy;font-weight:600"">" & vbLF & _
		"	<td>&nbsp;其他人共享给我的文件</td>" & vbLF & _
		"	<td align=center>.</td>" & vbLF & _
		"	<td align=center>" & iOtherShareFileCount & "</td>" & vbLF & _
		"	<td align=center>.</td></tr>" & vbLF & _
		"</table>" & vbLF
End Function



Function TableLink()
	TableLink = _
		"<table width=600 cellspacing=0 cellpadding=0 border=0 align=center>" & vbLF & _
		"<tr height=10>" & vbLF & _ 
		"	<td width=600><img src=""../images/bg/line.gif"" width=600 height=3></td>" & vbLF & _
		"</tr>" & vbLF & _
		"<tr height=20>" & vbLF & _
		"	<td width=600>&nbsp;" & vbLF & _
				"<img src=""../images/goto.gif"">&nbsp;<a href=""getfile.asp"">上传文件</a>" & vbLF & _
				"&nbsp;&nbsp&nbsp;" & vbLF & _
				"<img src=""../images/goto.gif"">&nbsp;<a href=""file_l.asp"">文件列表</a>" & vbLF & _
				"&nbsp;&nbsp&nbsp;" & vbLF & _
				"<img src=""../images/goto.gif"">&nbsp;<a href=""#"" onclick=""window.open('folder_a.asp','','height=124,width=350,left=200,top=200');"">新建文件夹</a></td>" & vbLF & _
		"</tr>" & vbLF & _
		"</table>" & vbLF
End Function
%>

⌨️ 快捷键说明

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