<!--#include file="pysjzx_conn.asp"-->
<!--#include file="session.asp"-->
<%
id=request.QueryString("id")
action=request.QueryString("action")
'//添加新数据
select case action
case "add"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from newsclass",conn,1,3
rs.AddNew
rs("class")=trim(request("class"))
rs("classorder")=int(request("classorder"))
rs.Update
rs.Close
set rs=nothing
response.redirect "newsclass.asp"
'//修改数据
case "edit"
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from newsclass where id="&request.QueryString("id"),conn,1,3
rs("class")=trim(request("class"))
rs("classorder")=int(request("classorder"))
rs.update
rs.close
set rs=nothing
response.redirect "newsclass.asp"
'//删除数据
case "del"
conn.execute ("delete from newsclass where id="&request.QueryString("id"))
conn.execute ("delete from news where class="&request.QueryString("id"))
response.redirect "newsclass.asp"
end select
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css/style.css" rel="stylesheet" type="text/css">
</head>
<body>
<div align="center">
<table cellpadding="3" cellspacing="1" border="1" width="100%" class="tableBorder" style="border-collapse: collapse" bordercolor="#C0C0C0">
  <tr height=25> 
	<th class="tableHeaderText" colspan=6 height=20 bgcolor="#E8F1FF" >
	新闻类型管理</font></th>	
  </tr>
  <tr> 
    <td colspan=3  class="forumRowHighlight"><div align="center">
	</div>
    </td>
  </tr>
  <tr> 
   <td width="47%" class="forumRowHighlight" ><div align="center">分类名称</div></td>
   <td width="19%" class="forumRowHighlight"><div align="center">分类排序</div></td>
   <td width="34%" class="forumRowHighlight"><div align="center">确定操作</div></td>
 </tr><%set rs=server.createobject("adodb.recordset")
		rs.Open "select * from newsclass order by classorder",conn,1,1
         do while not rs.EOF
    %>
   <form name="form1" method="post" action="newsclass.asp?action=edit&id=<%=rs("id")%>">
   <tr> 
     <td width="47%" class="forumRowHighlight" ><div align="center">
	 <input name="class" type="text" id="class" size="16" value="<%=trim(rs("class"))%>"></div>
     </td>
     <td width="19%"  class="forumRowHighlight"><div align="center"><input name="classorder" type="text" id="classorder" size="4" value="<%=int(rs("classorder"))%>"></div></td>
	<td width="34%"  class="forumRowHighlight"><div align="center"><input class=button type="submit" name="Submit" value="修 改">&nbsp;<a href="newsclass.asp?action=del&id=<%=rs("id")%>" onClick="return confirm('此删除操作，会删除此分类下的所有信息！您确定进行删除操作吗？')"><font color=red>删除</font></a> </div></td>
  </tr>
 </form>
 <%rs.movenext
        loop
        paixu=rs.RecordCount
        rs.close
        set rs=nothing

	%>
  </table>
</div>
<br>
<div align="center">
<table cellpadding="3" cellspacing="1" border="1" width="100%" class="tableBorder" style="border-collapse: collapse" bordercolor="#C0C0C0">
  <tr height=25> 
	<th class="tableHeaderText" colspan=3 height=20 bgcolor="#E8F1FF">
	新闻类型添加</font></th>	
  </tr>
    <tr> 
   <td colspan=3 valign="top" class="forumRowHighlight">　</td>
  </tr>
  <tr> 
   <td width="47%" class="forumRowHighlight"><div align="center">分类名称</div></td>
   <td width="19%" class="forumRowHighlight"><div align="center">分类排序</div></td>
   <td width="34%" class="forumRowHighlight"><div align="center">确定操作</div></td>
 </tr>
 <form name="form2" method="post" action="newsclass.asp?action=add">
 <tr> 
   <td width="47%" class="forumRowHighlight"><div align="center"><input name="class" type="text" id="class" size="16"></div></td>
   <td width="19%" class="forumRowHighlight"><div align="center"><input name="classorder" type="text" id="nclassidorder22" size="4" value="<%=paixu+1%>"></div></td>
   <td width="34%" class="forumRowHighlight"><div align="center"><input class="button" type="submit" name="Submit2" value="添 加"></div></td>
 </tr>
</form>
</table>
</div>
<br>
</body>
</html>
 