<!--#include file="utf-8.asp" -->
<!--#include file="js/Function.asp" -->
<!--#include file="CheckAdmin.asp" -->
<%
'版权：世纪伟成(http://yidacms.com)
'本信息不会影响您网站的正常访问，无论免费用户或是收费用户请保留这里的信息.
'如果您删除了这里的版权信息,将追究法律责任.

		if request("template")="default" Then
		set rs=server.createobject("adodb.recordset")
        	sql="select * from shuaiweb_templateurl ORDER BY id DESC"
		rs.open sql,dbok,1,3
			rs("shuaiweb_temp")=request("choose")
		rs.update
		rs.close
		set rs=nothing
		response.write "<script language=javascript> alert('设置成功！');location.replace('admin_template.asp');</script>"
		End If


        Response.Buffer=true 
	On Error Resume Next
	Server.ScriptTimeOut = 5000
	Response.Expires=0 
	Dim StartTime,IsReplace,ImageFolder
	IsReplace = true	'是否过滤编辑时文件的<textarea></textarea>标记，如不过滤遇到有<textarea>标记的文件时编辑有显示不完全的现象
        ImageFolder = "fsoimg"
	StatrTime = Timer()

'****************************************
'函数定义部分结束
'****************************************
	Dim Fso,FsoFile,FileType,FileSize,FileTime,Path
	Dim Dir
	action=Trim(Request.QueryString("action"))
	Set Fso=Server.CreateObject("Scripting.FileSystemObject")
	IsErr
	If action = "Del" then
		Call DelAll
	ElseIf action = "NewFile" then
		Call NewFile
	ElseIf action = "NewFolder" then
		Call NewFolder
	ElseIf action = "Rname" then
		Call Rname
	ElseIf action = "Edit" then
		Call Edit
	ElseIf action = "Save" then
		Call Edit
	Else
		Dir=Trim(Request.QueryString("Dir"))
		Path = Server.MapPath(""&webpath&"template/") & Dir
		Set FsoFile = Fso.GetFolder(Server.MapPath(""&webpath&"template/"))
			FsoFileSize = FsoFile.size	'空间大小统计
		Set	FsoFile = nothing
		Set	FsoFile = Fso.GetFolder(Path)
%>
<html>
<head>
<title>列遍模板目录</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="js/admin.css" rel="stylesheet" type="text/css">
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
  <div class="yidamoban">
    <ul>
<%
	For Each DirFolder in FsoFile.SubFolders
	FolderName=DirFolder.name
	FolderSize=GetFileSize(DirFolder.size)
	FolderTime=DirFolder.DateLastModified

	set rs = server.createobject("adodb.recordset")
	sql="select * from shuaiweb_templateurl ORDER BY id DESC"
	rs.open sql,dbok,1,1

	do while not rs.eof
        mobanurl = rs("shuaiweb_temp")

        if mobanurl = FolderName then
		yidacms_mobanshiyong = "<font color='green'> √ 已使用 </font>"
			else
		yidacms_mobanshiyong = "<a href='admin_template.asp?template=default&choose="&FolderName&"'>使用</a>"
	end if
	rs.MoveNext 
	loop

                   fpath=server.MapPath ("../template/"&FolderName&"/index.jpg")
                   if fso.FileExists(fpath) then
		    		mobanurl2 = "../template/"&FolderName&"/index.jpg"
                     else
		    		mobanurl2 = "../images/mobanpic.jpg"
                   end if
%>
<li>目录:<%=FolderName%> | 大小:<%=FolderSize%><br /><img src="<%=mobanurl2%>" widht="200" height="210"><br />
<%if FolderName = "user" then%>
	会员中心模板
		<%elseif FolderName = "wap" then%>
		手机系统模板
			<%else%>
				<%=yidacms_mobanshiyong%>
</li>
<%
  end if
	Next
%>
    </ul>
  </div>
  </td>
 </tr>
</table>
</body>
</html>

<%	End If
	Set FsoFile = nothing
	Set Fso = nothing
%>