<!--#include file="../siteconfig/conn.asp"-->
<!--#include file="../siteconfig/md5.asp"-->
<%
if session("adminlogin")<>sessionvar then
Response.Write("<script language=javascript>alert('你尚未登录，或者超时了！请重新登录');this.location.href='login.asp';</script>")
Response.End
End if
%>
<!--#include file="Admin_ManageFunction.asp"-->
<HTML>
<HEAD>
<TITLE>添加模板分类</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<LINK REL="stylesheet" HREF="css.css" TYPE="text/css">
</HEAD>
<script language="JavaScript" type="text/javascript" src="js.js"></script>
<BODY>
<%dim Menu,Skin_Name,Skin_Memo,Skin_Skin,Skin_SkinClassId,Skin_Html,Skin_HtmlYn,Skin_Id
Skin_Name=Trim(Request("Skin_Name"))
Skin_Memo=Request("Skin_Memo")
Skin_Id=Request("Skin_Id")
Skin_Skin=Request("Skin_Skin")
Skin_Html=Request("Skin_Html")
Skin_HtmlYn=Request("Skin_HtmlYn")
Skin_SkinClassId=Request("Skin_SkinClassId")
Menu=Request("Menu")
redim SkinArray(j,6)
if Menu="UpSkin" then
   rs.open"select Skin_Id from Skin where Skin_Html='"&Skin_Html&"'",conn,1,3
   if not rs.eof and not rs.bof then
      if rs("Skin_Id")<>int(Skin_Id) then
          Response.Write("<script language=javascript>alert('后缀名已存在');javascript:history.go(-1)</script>")
	      Response.End()
	  end if
   end if
   rs.close
   rs.open"select * from Skin where Skin_Id="&Skin_Id,conn,1,3
	  rs("Skin_Name")=Skin_Name
	  rs("Skin_Memo")=Skin_Memo
	  rs("Skin_Skin")=Skin_Skin
	  rs("Skin_Html")=Skin_Html
	  rs("Skin_HtmlYn")=Skin_HtmlYn
	  rs("Skin_SkinClassId")=Skin_SkinClassId
   rs.update
   rs.close
   Response.Write("<script language=javascript>alert('模板修改成功');parent.window.location.reload();DivOpenClose('',2,0,0);</script>")
   Response.End()
end if
rs.open"select * from Skin where Skin_Id="&Skin_Id,conn,1,3
   SkinArray(j,0)=rs("Skin_Id")
   SkinArray(j,1)=rs("Skin_Name")
   SkinArray(j,2)=rs("Skin_Memo")
   SkinArray(j,3)=rs("Skin_HtmlYn")
   SkinArray(j,4)=rs("Skin_Html")
   SkinArray(j,5)=rs("Skin_SkinClassId")
   SkinArray(j,6)=rs("Skin_Skin")
rs.close%>
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#EEEEEE">
  <tr>
    <td width="45%">修改模板</td>
    <td width="55%" align="right"><a href="#" onClick="javascript:DivOpenClose('',2,0,0);return false">关闭</a></td>
  </tr>
</table>
<form name="SkinFrom" method="post" action="?Menu=UpSkin" id="SkinFrom" onSubmit="return SkinCheck();">
<table width="100%" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#EEEEEE">
  <tr bgcolor="#FFFFFF">
    <td>模板ID</td>
    <td><%=SkinArray(j,0)%><input name="Skin_Id" type="hidden" class="inputcss" id="Skin_Id" value="<%=SkinArray(j,0)%>" size="20"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>模板名称</td>
    <td><input name="Skin_Name" type="text" class="inputcss" id="Skin_Name" value="<%=SkinArray(j,1)%>" size="20"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>模板描术</td>
    <td><input name="Skin_Memo" type="text" class="inputcss" id="Skin_Memo" value="<%=SkinArray(j,2)%>" size="20"></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>生成HTML</td>
    <td>
	<%if SkinArray(j,3)=0 then%>
	<label>
      是
          <input type="radio" name="Skin_HtmlYn" value="1" onClick="javascript:SkinHtmlCheck();">
      否
      <input name="Skin_HtmlYn" type="radio" value="0" checked onClick="javascript:SkinHtmlCheck();">
      </label>
	  <%else%>
	  	<label>
      是
          <input type="radio" name="Skin_HtmlYn" value="1" checked onClick="javascript:SkinHtmlCheck();">
      否
      <input name="Skin_HtmlYn" type="radio" value="0" onClick="javascript:SkinHtmlCheck();">
      </label>
	  <%end if%>
	  </td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>生成后缀</td>
    <td><label>
	<%if SkinArray(j,3)=0 then%>
    <input name="Skin_Html" type="text" disabled class="inputcss" id="Skin_Html" value="<%=SkinArray(j,4)%>" size="20">
	<%else%>
	<input name="Skin_Html" type="text" class="inputcss" id="Skin_Html" value="<%=SkinArray(j,4)%>" size="20">
	<%end if%>
    </label></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>所属分类</td>
    <td>
	<select name="Skin_SkinClassId">
	<%rs.open"select SkinClass_Id,SkinClass_Name from SkinClass",conn,1,3
	while not rs.eof
	  if rs("SkinClass_Id")=SkinArray(j,5) then%>
	      <option value="<%=rs("SkinClass_Id")%>" selected><%=rs("SkinClass_Name")%></option>
	  <%else%>
	      <option value="<%=rs("SkinClass_Id")%>"><%=rs("SkinClass_Name")%></option>
	  <%end if
	rs.movenext
	wend
	rs.close%>
    </select></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>模板内容</td>
    <td><textarea name="Skin_Skin" cols="60" rows="10" class="inputcss" id="Skin_Skin"><%=SkinArray(j,6)%></textarea></td>
  </tr>
  <tr bgcolor="#FFFFFF">
    <td>&nbsp;</td>
    <td><input name="Submit" type="submit" class="SubmitCss" value="修改分类"></td>
  </tr>
</table>
</form>
</BODY>
</HTML>

