<!--#include file="conn.asp"-->
<!--#include file="ad_chk.asp"-->
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href=inc/css.css rel=STYLESHEET type=text/css>
<body topmargin="5" leftmargin="5" rightmargin="5" bottommargin="5">
<%
if Request.Cookies("WrzcNethtml")("admin_class")<>0 then
response.write "你没有这个权限!"
response.end
end if
%>
<%
if request("action")="add" then
set rs=server.createobject("adodb.recordset")
sql="select top 1 * from WrzcNethtml_system"
rs.open sql,conn,1,3
allskin=split(rs("allskin"),"##")
askin=split(allskin(0),"/")
bskin=split(allskin(1),"/")
rs("allskin")=allskin(0)&"/"&request("WrzcNethtml_skin")&"##"&allskin(1)&"/"&request("skin_name")
rs.update
rs.close
set rs=nothing
call addok(addt,"ad_skin.asp","ad_skin.asp")
end if

if request("action")="go" then
set rs=server.createobject("adodb.recordset")
sql="select top 1 * from WrzcNethtml_system"
rs.open sql,conn,1,3
rs("skin")=request("WrzcNethtml_skin")
rs.update
rs.close
set rs=nothing
call editok(editt,"ad_skin.asp","ad_skin.asp")
end if

set rs=server.createobject("adodb.recordset")
sql="select top 1 skin,allskin from WrzcNethtml_system"
rs.open sql,conn,1,1
skin=rs("skin")
allskin=split(rs("allskin"),"##")
askin=split(allskin(0),"/")
bskin=split(allskin(1),"/")
rs.close
set rs=nothing
%>

<table border="0" cellpadding="5" cellspacing="0" class="st">
<tr><td class="sa">ID</td><td class="sa">模板名称</td><td class="sa">对应目录</td>
	<td class="sa">状态</td><td class="sa">操作</td></tr>
<%
set fso=server.CreateObject("scripting.filesystemobject")
set objFolder=fso.GetFolder(Server.MapPath("../skin/"))
set objSubFolders=objFolder.Subfolders

xx=0
for each objSubFolder in objSubFolders
nowpath=lcase(objSubFolder.name)
nowis=0
for i=0 to ubound(askin)
if askin(i)=nowpath then
nowname=bskin(i)
nowis=1
end if
next
if nowis=0 then nowname=""
xx=xx+1%><%if nowis=0 then%><form method="POST" action="ad_skin.asp?WrzcNethtml_skin=<%=nowpath%>&action=add"><%end if%>

<tr><td class="s<%=xx mod 2%>"><%=xx%></td>
	<td class="s<%=xx mod 2%>"><%=nowname%></td>
<td class="s<%=xx mod 2%>"><%=nowpath%></td>
	<td class="s<%=xx mod 2%>"><%if nowis=1 then%>已添加<%else%>未添加<%end if%><%if skin=nowpath then%>&nbsp;&nbsp;<font color="#FF0000">正在使用</font><%end if%></td>
	<td class="s<%=xx mod 2%>">
	<%if nowis=1 then%>
	<input onClick="javascript:window.open('ad_skin.asp?WrzcNethtml_skin=<%=nowpath%>&action=go','_self','')" type="button" value="使用">
	<input onClick="javascript:window.open('../icreat.asp?WrzcNethtml_skin=<%=nowpath%>','_blank','')" type="button" value="预览">
	<%else%>
	输入名称：<input type="text" name="skin_name" class="input" size="10">
	<input type="submit" value="添加" name="B1">
	<input onClick="javascript:window.open('../icreat.asp?WrzcNethtml_skin=<%=nowpath%>','_blank','')" type="button" value="预览">
	<%end if%>
	</td></tr><%if nowis=0 then%></form><%end if%>
<%
next
set objFolder=nothing 
set objSubFolders=nothing 
set fso=nothing 
%>
</table>
<!--#include file="ad_bottom.asp"-->