<!--#include file="../inc/Secure.htm"-->
<%dim ThisKey
ThisKey = "n"
%>
<!--#include file="../inc/permission.htm"-->
<html>
<head>
<title>Directory</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" type="text/css" href="../CSS/main.css">
</head>
<!--#include file="../inc/conn.htm"-->
<body bgcolor="#FFFFFF" >
<FORM ACTION="default.htm" METHOD="Get">

<TABLE WIDTH="100%" cellpadding=1 border=1 bordercolor=#eeeeee>
	<TR>
		
		<TD valign=top>
			<TABLE cellpadding=2 Border=1 BorderColor="#FFFFFF">
				<TR align=center BorderColor="#808080" BGColor="D3D3D3">

					<TH align=left colspan=2 border=1 width="20%">文件/目录名</TH>
					<TH align=left border=1 width="25%">目录描述</TH>
					<TH align=left border=1 width="15%">文件类型</TH>
					<TH border=1>文件大小</TH>
					<TH border=1>最后修改时间</TH>
				</TR>
				<%
				If Not oFolder.IsRootFolder Then
				%>
					<TD align=right>
						<IMG Name="Arrow" src="Arrow.gif">
					</TD>
					<TD align=left colspan=4>
					<%if CurrentPath<>RootDir then%>
						<FONT Face="Verdana" SIZE ="2" Color="Blue">
						
						<B><A HREF=default.htm?Path=<%= Replace(oFolder.ParentFolder.Path," ","+") %>>
							...</A></B>

						</FONT>
						<%else%>
						根目录
						<%end if%>
					</TD>
				<%
				End If


				For Each oSubFolder in oFolder.SubFolders
				%>
				<TR BorderColor="#FFFFFF" >
					<TD align=right>
						<IMG Name="Folder" src="Folder.gif">
					</TD>
					<TD align=left>

						<FONT Face="Verdana" SIZE ="2" Color="Blue"><B>
							<A HREF=default.htm?Path=<%= Replace(oSubFolder.Path," ","+") %>>
							<%= oSubFolder.Name %></A></B>
						</FONT>
					</TD>
					<TD align=left>
						<%
						str=oSubFolder.Name
						str1=unMappath(oSubFolder.ParentFolder)
						if str1="/FileDir" then

							if isnumeric(str) and str1="/FileDir" then
								str2=GetTableValue("tblUser","Name","ID",cint(str))
								response.write str2&"的私人目录"
							elseif isnumeric(left(str,len(str)-6)) and str1="/FileDir" then
								str2=GetTableValue("tblUser","Name","ID",cint(left(str,len(str)-6)))
								response.write str2&"的共享目录"
							elseif str="Public" and str1="/FileDir" then
								response.write "公共目录"
							end if
						end if
						
						%>
					</TD>
					<TD align=left>
						<FONT Face="Tahoma" SIZE ="2" COLOR="DarkGreen">目录</FONT>
					</TD>
					<TD>
					</TD>
					<TD align=left>
						<FONT Face="Tahoma" SIZE ="2" COLOR="DarkGreen"><%= oSubFolder.DateLastModified %></FONT>
					</TD>
				</TR>
				<%
				Next

				For Each oFileItem in oFolder.Files
				%>
				<TR BorderColor="#FFFFFF">
					<TD align=right>
						<IMG Name="File" src="Files.gif">
					</TD>
					<TD align=left>
						<A target="_blank" HREF=default.htm?Path=<%= Replace(oFileItem.Path," ","+") %>>
						<FONT Face="Verdana" SIZE ="2" COLOR="Blue"><%= oFileItem.Name %></FONT>
					</TD>
					<td></td>
					<TD align=left>
						<FONT Face="Tahoma" SIZE ="2" COLOR="DarkGreen"><%= oFileItem.Type%></FONT>
					</TD>
					<TD align=right>
						<FONT Face="Tahoma" SIZE ="2" COLOR="DarkGreen"><%= oFileItem.Size %></FONT>
					</TD>
					<TD align=left>
						<FONT Face="Tahoma" SIZE ="2" COLOR="DarkGreen"><%= oFileItem.DateLastModified %></FONT>
					</TD>
				</TR>
			<%
			Next
			%>
			</TABLE>
		</TD>

	</TR>
</TABLE>
</FORM>
</body>
</html>
<!--#include file="../inc/conn_close.htm"-->

<%
Private Function UnMappath(byVal FullPath)
		'take a mappath-ed directory and make it virtual
		dim root, tmp1, tmp2
		root = server.mappath("/")
		'FullPath = FullPath
		tmp1 = Replace(fullPath, root, "")
		tmp2 = Replace(tmp1, "\", "/")
		'if not right(tmp2, 1) = "/" then tmp2 = tmp2 & "/"
		UnMappath = Trim(tmp2)
End Function

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
%>