<%@ codepage ="936" %>
<%charset="gb2312"%>
<%Session.CodePage=936%>
<!--#include file="Admin.asp"-->
<!--#include file="Conn.asp"-->
<!--#include file="Inc/Function.asp"-->
<%
dim SmallClassID,Action,BigClassID, SmallClassName, OldSmallClassName,rs,FoundErr,ErrMsg
SmallClassID=trim(Request("SmallClassID"))
Action=trim(Request("Action"))
BigClassID=trim(Request.form("BigClassID"))
SmallClassName=trim(Request.form("SmallClassName"))
OldSmallClassName=trim(request.form("OldSmallClassName"))
if SmallClassID="" then
	response.Redirect("News_ClassManage.asp")
end If
orders=trim(request("orders"))
If orders="" Then orders=0
show=trim(request("show"))
If show="" Then show=0
Set rs=Server.CreateObject("Adodb.RecordSet")
rs.Open "Select * from NewsSmallClass 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("orders")=orders
			rs("show")=show
			rs("html")=0
     		rs.update
			rs.Close
    	 	set rs=Nothing
			call CloseConn()
    	 	Response.Redirect "News_ClassManage.asp"
		end if
	end if
	if FoundErr=True then
		call WriteErrMsg()
	Else
		tjzShow=0
		sqlt="select show from Newsbigclass where BigClassID=" & rs("BigClassID") & ""
		Set rst = Server.CreateObject("ADODB.Recordset")
		rst.Open sqlt,conn,1,1
		If Not(rst.bof And rst.eof) Then
			If rst(0)>0 Then tjzShow=1
		End If
		rst.close
		Set rst=nothing

%>
<!-- #include file="Inc/Head.asp" -->
<div align=center>
<TABLE class=tableBorder1 style="WIDTH: 100%" cellSpacing=0 cellPadding=3 
align=center border=0>
  <TBODY>
  <TR>
    <TD height=50></TD></TR></TBODY></TABLE>
<TABLE class=tableBorder cellSpacing=0 cellPadding=0 width="85%" align=center border=0>
	<tr> 
		<TH align=left height=23 class="tableHeaderText"><div align="center"><font color=white>频 道 类 别 设 置</font></div></TH>
	</tr>
	<tr> 
	  <td height="25" class=forumrow>
		<form name="form1" method="post" action="News_ClassModifySmall.asp">
        <table width="100%" border="0" align="center" cellpadding="1" cellspacing="2">
          <tr> 
            <td class=forumHeaderBackgroundAlternate height="25" colspan="2" align="center"><strong>修改小类名称</strong></td>
          </tr>
          <tr> 
            <td width="15%" height="22"  class=forumRow_shui align=right><strong>所属大类：</strong></td>
            <td width="85%" bgcolor="#E3E3E3">
			  <%=conn.execute("select bigclassname from NewsbigClass where bigClassID="&rs("BigClassID"))(0)%>
              <input name="SmallClassID" type="hidden" id="SmallClassID" value="<%=rs("SmallClassID")%>"> 
              <input name="OldSmallClassName" type="hidden" id="OldSmallClassName" value="<%=rs("SmallClassName")%>"> 
              <input name="BigClassID" type="hidden" id="BigClassID" value="<%=rs("BigClassID")%>"></td>
          </tr>
          <tr> 
            <td height="22"  class=forumRow_shui align=right><strong>小类名称：</strong></td>
            <td bgcolor="#E3E3E3">
				<input name="SmallClassName" type="text" id="SmallClassName" value="<%=rs("SmallClassName")%>" size="30" maxlength="30"></td>
          </tr>

          <tr> 
            <td class=forumRow_shui height="25" bgcolor="#C0C0C0"> 
              <div align="right"><strong>排序：</strong></div></td>
            <td bgcolor="#E3E3E3"> 
              <input name="orders" type="text" size="5" maxlength="5" value="<%=rs("orders")%>">
            </td>
          </tr>

          <tr<%if cint(tjzShow)=0 then response.write " style='display:none;'"%>> 
            <td class=forumRow_shui height="25" bgcolor="#C0C0C0"> 
              <div align="right"><strong>首页推荐值：</strong></div></td>
            <td bgcolor="#E3E3E3"> 
              <input name="show" type="text" size="5" maxlength="5" value="<%=rs("show")%>">　　<font color=#777777>(说明：值越大越靠前显示，最多显示3个)</font>
            </td>
          </tr>

          <tr> 
            <td height="22" align="center"  class=forumRow_shui>&nbsp;</td>
            <td align="center" bgcolor="#E3E3E3"> <div align="left">
                <input name="Action" type="hidden" id="Action4" value="Modify">
                <input name="Save" type="submit" id="Save" value=" 修 改 ">&nbsp;&nbsp;&nbsp;
				<input name="back" type="button" id="back" value=" 返 回 " onclick="history.go(-1);">
              </div></td>
          </tr>
        </table>  
  </form>
   </td>
  </tr>
</table>
<!-- #include file="Inc/Foot.asp" -->
</div>
<%
	end if
end if
rs.close
set rs=nothing
call CloseConn()
%>
