<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<!--#include file="conn.asp"-->
<!--#include file="admin.asp"-->
<!-- #include file="Inc/Head.asp" -->
<%
dim SmallClassID,Action,BigClassName, SmallClassName, OldSmallClassName,rs,FoundErr,ErrMsg
SmallClassID=trim(Request("SmallClassID"))
Action=trim(Request("Action"))
BigClassName=trim(Request.form("BigClassName"))
SmallClassName=trim(Request.form("SmallClassName"))
wlink=Request.form("wlink")
linktarg=Request.form("linktarg")
OldSmallClassName=trim(request.form("OldSmallClassName"))
conclass=request.form("conclass")
if SmallClassID="" then
	response.Redirect("News_ClassManage.asp")
end if
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open "Select * from SmallClass_New where SmallClassID="&SmallClassID&"",conn,1,3
if rs.Bof or rs.EOF then
	FoundErr=True
	ErrMsg=ErrMsg & "<br><li>此文章小类不存在！</li>"
else
	if Action="Modify" then
		if SmallClassName="" then
			FoundErr=True
			ErrMsg=ErrMsg & "<br><li>文章小类名不能为空！</li>"
		end if
		if FoundErr<>True then
			rs("SmallClassName")=SmallClassName
			rs("wlink")=wlink
			rs("linktarg")=linktarg
			rs("conclass")=conclass
     		rs.update
			rs.Close
    	 	set rs=Nothing
			if SmallClassName<>OldSmallClassName then
				conn.execute "Update NEWS set SmallClassName='" & SmallClassName & "' where BigClassName='" & BigClassName & "' and SmallClassName='" & OldSmallClassName & "'"
	     	end if	
			call CloseConn()
    	 	Response.Redirect "News_ClassManage.asp"
		end if
	end if
	if FoundErr=True then
		call WriteErrMsg()
	else
%>
<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td width="150" align="center" valign="top" bgcolor="#A0CCD8"><!-- #include file="info_left.asp" --></td>
    <td align="center" valign="top"><table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr> 
    <td align="center" valign="top"> <table width="100%" height="0"  border="0" cellpadding="5" cellspacing="0">
      <tr>
        <td height="24" background="image/usercenter_3.jpg">
          <div align="center"><a href="ClassManage.asp"><strong><font color="#FFFFFF">新 闻 类 别 设 置</font></strong></a> </div></td>
      </tr>
    </table>      
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" class="border">
        <form name="form1" method="post" action="News_ClassModifySmall.asp">
		  <tr bgcolor="#C2DAE1" class="title"> 
            <td height="25" colspan="2" align="center"><strong>修改小类名称</strong></td>
          </tr>
          <tr class="tdbg"> 
            <td width="100" height="22" bgcolor="#C2DAE1"><strong>所属大类：</strong></td>
            <td width="548" bgcolor="#EFEEE9"><%=rs("BigClassName")%> <input name="SmallClassID" type="hidden" id="SmallClassID" value="<%=rs("SmallClassID")%>"> 
              <input name="OldSmallClassName" type="hidden" id="OldSmallClassName" value="<%=rs("SmallClassName")%>"> 
              <input name="BigClassName" type="hidden" id="BigClassName" value="<%=rs("BigClassName")%>"></td>
          </tr>
          <tr class="tdbg"> 
            <td height="22" bgcolor="#C2DAE1"><strong>小类名称：</strong></td>
            <td bgcolor="#EFEEE9"> <input name="SmallClassName" type="text" id="SmallClassName" value="<%=rs("SmallClassName")%>" size="20" maxlength="30"></td>
          </tr>
		  <tr class="tdbg"> 
            <td width="100" height="22" bgcolor="#C2DAE1"><strong>外链接：</strong></td>
            <td bgcolor="#EFEEE9"> <input name="wlink" type="text" value="<%=rs("wlink")%>" size="40" maxlength="100">
&nbsp;
<select name="linktarg" id="linktarg">
  <option value="_self" selected>_self</option>
  <option value="_blank">_blank</option>
  <option value="_parent">_parent</option>
  <option value="_top">_top</option>
</select> 
链接到外部地址，此项根据网站的需要可选。</td>
          </tr>
		  <tr class="tdbg"> 
            <td width="100" height="22" bgcolor="#C2DAE1"><strong>小类名称：</strong></td>
            <td bgcolor="#EFEEE9">
			<select name="conclass" id="conclass">
              <option <%if rs("conclass")="信息类" then response.Write("selected")%>>信息类</option>
              <option <%if rs("conclass")="图片类" then response.Write("selected")%>>图片类</option>
              <option <%if rs("conclass")="简介类" then response.Write("selected")%>>简介类</option>
			  <option <%if rs("conclass")="外链接" then response.Write("selected")%>>外链接</option>
            </select>
              请选择栏目类型。</td>
          </tr>
          <tr class="tdbg"> 
            <td height="22" align="center" bgcolor="#C2DAE1">&nbsp;</td>
            <td align="center" bgcolor="#EFEEE9"> <div align="left"> 
                <input name="Action" type="hidden" id="Action4" value="Modify">
                <input name="Save" type="submit" id="Save" value=" 修 改 ">
              </div></td>
          </tr>
		   </form>
        </table>
     </td>
  </tr>
</table>
<%
end if
end if
rs.close
set rs=nothing
%>
 </td>
  </tr>
</table>
<!-- #include file="Inc/Foot.asp" -->