<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="Conn.asp"-->
<!--#include file="Ex_Cls/Ex_SkinCls.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
</head>
<link href="Admin_STYLE.CSS" rel="stylesheet" type="text/css"> 
<body leftmargin="2" topmargin="0" marginwidth="0" marginheight="0" class="bgcolor">
<%
Dim ExCls
Set ExCls=new ExClass
ExCls.execute
Class ExClass
Private ExComm,ExFso
Private Sub class_initialize
	Set ExComm=new Ex_CommonCls
	ExComm.IsAdLogin 
	ExComm.IsIpAllow
	Set ExFso=new Ex_FsoCls
End Sub
Private Sub class_terminate
	Set ExComm=Nothing 
End Sub
public Sub Execute
dim action
	action=request.querystring("action")
	select case action
	case "show"
	call show()
	case "del"
	call del()
	case "change"
	call change()
	case "addform"
	call addform()
	case "add"
	call add()
	end Select
End Sub 
sub ReFreshCache
	ExComm.ClearCaches(sn)
	Dim ExSkin
	Set ExSkin=new Ex_SkinCls
	ExSkin.RefreshSkinCache
	Set ExSkin=Nothing 
End Sub 
%>
<%sub addform()%>
<center>
<form name="form1" method="post" action="?action=add">
  <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="border">
    <tr>
      <th width="690" class="topbg">添加分类</th>
      </tr>
    <tr>
      <td class="tdbg"><table width="99%" border="0" align="center" bgcolor="#FFFFFF">
        <tr>
          <td width="16%" class="tdbg"><div align="center">分类名称</div></td>
          <td width="18%" class="tdbg"><div align="center">静态目录名</div></td>
          <td width="16%" class="tdbg"><div align="center">是否转向</div></td>
          <td width="16%" class="tdbg"><div align="center">转向地址</div></td>
          <td width="18%" class="tdbg"><div align="center">新窗口打开</div></td>
          <td width="16%" class="tdbg"><div align="center">序号</div></td>
        </tr>
        <tr>
          <td class="tdbg"><div align="center">
            <input name="classx1" type="text" id="classx1">
          </div></td>
          <td class="tdbg"><div align="center">
            <input name="classfolder1" type="text" id="classfolder1">
          </div></td>
          <td class="tdbg"><div align="center">
              <input name="default1" type="radio" value="true" checked>
      否
      <input type="radio" name="default1" value="false">
      是 </div></td>
          <td class="tdbg"><div align="center">
              <input name="classurl1" type="text" id="classurl1">
          </div></td>
          <td class="tdbg"><div align="center">
            <input name="openmode1" type="radio" value="true" checked>
            是
            <input type="radio" name="openmode1" value="false">
            否</div></td>
          <td class="tdbg"><div align="center">
              <input name="orderx1" type="text" id="orderx1" value="0">
          </div></td>
        </tr>
		<tr>
          <td class="tdbg"><div align="center">
            <input name="classx2" type="text" id="classx2">
          </div></td>
          <td class="tdbg"><div align="center">
            <input name="classfolder2" type="text" id="classfolder2">
          </div></td>
          <td class="tdbg"><div align="center">
              <input name="default2" type="radio" value="true" checked>
      否
      <input type="radio" name="default2" value="false">
      是 </div></td>
          <td class="tdbg"><div align="center">
              <input name="classurl2" type="text" id="classurl2">
          </div></td>
          <td class="tdbg"><div align="center">
            <input name="openmode2" type="radio" value="true" checked>
            是
            <input type="radio" name="openmode2" value="false">
            否</div></td>
          <td class="tdbg"><div align="center">
              <input name="orderx2" type="text" id="orderx2" value="0">
          </div></td>
        </tr>
		<tr>
          <td class="tdbg"><div align="center">
            <input name="classx3" type="text" id="classx3">
          </div></td>
          <td class="tdbg"><div align="center">
            <input name="classfolder3" type="text" id="classfolder3">
          </div></td>
          <td class="tdbg"><div align="center">
              <input name="default3" type="radio" value="true" checked>
      否
      <input type="radio" name="default3" value="false">
      是 </div></td>
          <td class="tdbg"><div align="center">
              <input name="classurl3" type="text" id="classurl3">
          </div></td>
          <td class="tdbg"><div align="center">
            <input name="openmode3" type="radio" value="true" checked>
            是
            <input type="radio" name="openmode3" value="false">
            否</div></td>
          <td class="tdbg"><div align="center">
              <input name="orderx3" type="text" id="orderx3" value="0">
          </div></td>
        </tr>
		<tr>
          <td class="tdbg"><div align="center">
            <input name="classx4" type="text" id="classx4">
          </div></td>
          <td class="tdbg"><div align="center">
            <input name="classfolder4" type="text" id="classfolder4">
          </div></td>
          <td class="tdbg"><div align="center">
              <input name="default4" type="radio" value="true" checked>
      否
      <input type="radio" name="default4" value="false">
      是 </div></td>
          <td class="tdbg"><div align="center">
              <input name="classurl4" type="text" id="classurl4">
          </div></td>
          <td class="tdbg"><div align="center">
            <input name="openmode4" type="radio" value="true" checked>
            是
            <input type="radio" name="openmode4" value="false">
            否</div></td>
          <td class="tdbg"><div align="center">
              <input name="orderx4" type="text" id="orderx4" value="0">
          </div></td>
        </tr>
		<tr>
          <td class="tdbg"><div align="center">
            <input name="classx5" type="text" id="classx5">
          </div></td>
          <td class="tdbg"><div align="center">
            <input name="classfolder5" type="text" id="classfolder5">
          </div></td>
          <td class="tdbg"><div align="center">
              <input name="default5" type="radio" value="true" checked>
      否
      <input type="radio" name="default5" value="false">
      是 </div></td>
          <td class="tdbg"><div align="center">
              <input name="classurl5" type="text" id="classurl5">
          </div></td>
          <td class="tdbg"><div align="center">
            <input name="openmode5" type="radio" value="true" checked>
            是
            <input type="radio" name="openmode5" value="false">
            否</div></td>
          <td class="tdbg"><div align="center">
              <input name="orderx5" type="text" id="orderx5" value="0">
          </div></td>
        </tr>
		<tr>
          <td class="tdbg"><div align="center">
            <input name="classx6" type="text" id="classx6">
          </div></td>
          <td class="tdbg"><div align="center">
            <input name="classfolder6" type="text" id="classfolder6">
          </div></td>
          <td class="tdbg"><div align="center">
              <input name="default6" type="radio" value="true" checked>
      否
      <input type="radio" name="default6" value="false">
      是 </div></td>
          <td class="tdbg"><div align="center">
              <input name="classurl6" type="text" id="classurl6">
          </div></td>
          <td class="tdbg"><div align="center">
            <input name="openmode6" type="radio" value="true" checked>
            是
            <input type="radio" name="openmode6" value="false">
            否</div></td>
          <td class="tdbg"><div align="center">
              <input name="orderx6" type="text" id="orderx6" value="0">
          </div></td>
        </tr>
		<tr>
          <td class="tdbg"><div align="center">
            <input name="classx7" type="text" id="classx7">
          </div></td>
          <td class="tdbg"><div align="center">
            <input name="classfolder7" type="text" id="classfolder7">
          </div></td>
          <td class="tdbg"><div align="center">
              <input name="default7" type="radio" value="true" checked>
      否
      <input type="radio" name="default7" value="false">
      是 </div></td>
          <td class="tdbg"><div align="center">
              <input name="classurl7" type="text" id="classurl7">
          </div></td>
          <td class="tdbg"><div align="center">
            <input name="openmode7" type="radio" value="true" checked>
            是
            <input type="radio" name="openmode7" value="false">
            否</div></td>
          <td class="tdbg"><div align="center">
              <input name="orderx7" type="text" id="orderx7" value="0">
          </div></td>
        </tr>
      </table></td>
      </tr>
    <tr>
      <td class="tdbg"><div align="center">
        <input type="submit" name="Submit2" value="提交">
      </div></td>
      </tr>
  </table>
</form>
</center>
提示：<br>1.序号越小排名越靠前！！<br>2.分类类型选否必须填写后面的网址转向，点击分类后将打开所填的地址。<br>3.除网址转向视情况而定外，其它都应该填写！！
<br>
<a href="http://www.ex123.net/bbs" target="_blank"><font color="red">如果您对日志分类的添加和管理还有什么疑问,点此查看易心博客使用教程</font></a>
<%end sub%>
<%sub add()
	Dim I,Sql,ClassX,Default,ClassUrl,OrderX,OpenMode,ClassFolder
	For I=1 To 7
		Classx=Request.Form("classx"&I)
		Default=Request.Form("Default"&I)
		ClassUrl=Request.Form("ClassUrl"&I)
		OrderX=Request.Form("OrderX"&I)
		OpenMode=Request.Form("OpenMode"&I)
		ClassFolder=Request.Form("ClassFolder"&I)
		If Trim(Classx)<>"" Then 
			Sql="insert into Ex_Class (ClassX,Default,ClassUrl,OrderX,OpenMode,ClassFolder) values('"&ClassX&"',"&Default&",'"&ClassUrl&"',"&OrderX&","&OpenMode&",'"&ClassFolder&"')"
			Conn.Execute Sql
		End If 
	Next 
	ReFreshCache
	ExComm.ShowMsg "添加成功","admin_class.asp?action=addform"
 end sub%>
 <%sub show()
   dim strsql,rs,i
   i=0
   strsql="select * from Ex_Class"
   set rs=Conn.execute(strsql)
   %>
   <center>
<form name="form1" method="post" action="?action=change">
  <table width="98%" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#FFFFFF" class="border">
    <tr>
      <th colspan="7" class="topbg"><div align="center">日志分类</div></th>
    </tr>
    <tr>
      <td class="tdbg" width="75"><div align="center">分类名称</div></td>
      <td class="tdbg" width="76"><div align="center">静态目录名</div></td>
      <td class="tdbg" width="228"><div align="center">是否转向</div></td>
      <td class="tdbg" width="203"><div align="center">转向地址</div></td>
	  <td class="tdbg" width="151"><div align="center">新窗口打开</div></td>
      <td class="tdbg" width="100"><div align="center">序号</div></td>
      <td class="tdbg" width="92"><div align="center">操作</div></td>
    </tr>
	<%do while not rs.eof%>
    <tr>
      <td class="tdbg"><div align="center"><input id="<%=i%>" name="<%=i%>" type="hidden" value="<%=rs("id")%>">
        <input name="classx<%=rs("id")%>" type="text" id="classx<%=rs("id")%>" value="<%=rs("classx")%>" size="15">
      </div></td>
      <td class="tdbg"><input name="classfolder<%=rs("id")%>" type="text" id="classfolder<%=rs("id")%>2" value="<%=rs("classfolder")%>" size="15"></td>
      <td class="tdbg"><%if rs("default")=true then%>
        <input name="default<%=rs("id")%>" type="radio" value="true" checked>        
        否
          <input type="radio" name="default<%=rs("id")%>" value="false">
        是<%else%>
        <input name="default<%=rs("id")%>" type="radio" value="true">        
        否
          <input type="radio" name="default<%=rs("id")%>" value="false"  checked>
        是<%end if%>		</td>
      <td class="tdbg"><div align="center">
        <input name="classurl<%=rs("id")%>" type="text" id="classurl<%=rs("id")%>" value="<%=rs("classurl")%>">
      </div></td>
	  <td class="tdbg"><%if rs("openmode")=true then%>
        <input name="openmode<%=rs("id")%>" type="radio" value="true" checked>        
        是
          <input type="radio" name="openmode<%=rs("id")%>" value="false">
        否<%else%>
        <input name="openmode<%=rs("id")%>" type="radio" value="true">        
        是
          <input type="radio" name="openmode<%=rs("id")%>" value="false"  checked>
        否<%end if%>		</td>
      <td class="tdbg"><div align="center">
        <input name="orderx<%=rs("id")%>" type="text" id="orderx<%=rs("id")%>" value="<%=rs("orderx")%>" size="10">
      </div></td>
      <td class="tdbg"><div align="center"><a href="?action=del&id=<%=rs("id")%>" onClick="return confirm('确定删除?')">删除
      </a></div></td>
	  <input name="ids" value="<%=Rs("id")%>" type="hidden">
    </tr>
	<%rs.movenext
	i=i+1
	loop%>
    <tr>
      <td class="tdbg" colspan="7"><div align="center">
        <input type="submit" name="Submit" value="提交">
      </div></td>
      </tr>
  </table>
</form></center>
提示：<br>1.序号越小排名越靠前！！<br>2.分类类型选否必须填写后面的网址转向，点击分类后将打开所填的地址。<br>3.除网址转向视情况而定外，其它都应该填写！！
<br>
<a href="http://www.ex123.net/bbs" target="_blank"><font color="red">如果您对日志分类的添加和管理还有什么疑问,点此查看易心博客使用教程</font></a>
   <%end sub%>
   <%sub del()
    dim id,strsql
	id=request.querystring("id")
	strsql="delete from Ex_class where id="&id
    'response.write(strsql)
	Conn.execute(strsql)
	ReFreshCache
	ExComm.ShowMsg "删除成功",request.servervariables("http_referer")
   End Sub
   Sub Change()
		Dim I,Sql,ClassX,Default,ClassUrl,OrderX,OpenMode,ClassFolder,Ids
		Ids=Split(Request.Form("ids"),",")
		response.write(UBound(Ids))
		For I=0 To UBound(Ids)
			Classx=Request.Form("classx"&Trim(Ids(I)))
			Default=Request.Form("Default"&Trim(Ids(I)))
			ClassUrl=Request.Form("ClassUrl"&Trim(Ids(I)))
			OrderX=Request.Form("OrderX"&Trim(Ids(I)))
			OpenMode=Request.Form("OpenMode"&Trim(Ids(I)))
			ClassFolder=Request.Form("ClassFolder"&Trim(Ids(I)))
			If Trim(Classx)<>"" Then 
				Sql="update Ex_Class set Classx='"&ClassX&"',default="&Default&",classurl='"&ClassUrl&"',orderx="&orderx&",openmode="&openmode&",classfolder='"&ClassFolder&"' where id="&ids(I)
				Conn.Execute Sql
			End If 
		Next 
		ReFreshCache
		ExComm.ShowMsg "修改成功",request.servervariables("http_referer")
   End Sub
   End Class
   %>
</body>
</html>
