<%dbdns="../../"%>
<!--#include file="../../inc/conn.asp"-->
<!--#include file="../cook.asp"-->
<%if fla5<>1 then
response.write "<script>alert('操作权限出错，您没有权限操作些功能');history.go(-1);</Script>"
Response.End 
end if%>
<%
if request("action")="del" then
conn.execute("delete from SMT_newssort where SMT_id=" & request("id"))

set Fs = Server.CreateObject("Scripting.FileSystemObject")
set rs = Server.CreateObject("ADODB.Recordset")
sql="select * from SMT_news where SMT_newssort=" & request("id")
rs.open sql,conn,1,1
do while not rs.eof
filename="../../html/news/"&year(rs("SMT_date"))&month(rs("SMT_date"))&"/"&replace(replace(replace(rs("SMT_date"),"-",""),":","")," ","")&".html"
If Fs.FileExists(server.mappath(filename)) Then
set Os = Fs.GetFile(server.mappath(filename))
Os.Delete
end if
conn.execute("delete from SMT_leaveword where SMT_book_sort=7 and SMT_book_table="&rs("SMT_id")&"")
rs.movenext
loop
rs.close
set rs=nothing
set fs=nothing

conn.execute("delete from SMT_news where SMT_newssort=" & request("id"))
end if%>
<%=citycss%>
<br>
<table width="95%" height="0" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">
  <form name="form1" method="post" action="news_sort_save.asp?action=add">
    <tr align="center" bgcolor="#efefef"> 
      <td width="29%" height="25">添加分类</td>
      <td width="37%"><input type="text" name="newssort"></td>
      <td width="34%"><input type="submit" name="Submit" value="添加" class=input1></td>
    </tr>
  </form>
</table>
<br>
<!--#######################################################################-->
<table width="95%" height="0" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">
<tr align=center>
<%sql="select * from SMT_newssort order by SMT_date desc"
set rs=Server.CreateObject("ADODB.Recordset")                                                    
rs.open sql,conn,1,1 
if (rs.eof and rs.bof) then
	response.write "<td height=20 colspan=3>暂无内容</td>"
else                                                 
n=0
do while not rs.eof
n=n+1%>
<td width="20%" height="25"><a href=news_sort.asp?id=<%=rs("SMT_id")%>&newssort=<%=rs("SMT_newssort")%>><%=rs("SMT_newssort")%></a> <a href=news_sort_save.asp?id=<%=rs("SMT_id")%>&action=aa><font color=#cccccc>排序</font></a></td>
<%if n mod 5=0 then response.write("</tr><tr align=center>")
rs.movenext
loop
end if
rs.close
set rs=nothing%>
</tr>
</table>
<!--#######################################################################-->
<%if request("newssort")<>"" then%>
<br>
<table width="95%" height="0" border="1" align="center" cellpadding="0" cellspacing="0" bordercolorlight="#cccccc" bordercolordark="#FFFFFF">
  <form name="form1" method="post" action="news_sort_save.asp?action=edit&id=<%=request("id")%>">
    <tr align="center" bgcolor="#efefef"> 
      <td width="29%" height="25">修改分类</td>
      <td width="37%"><input type="text" name="newssort" value="<%=request("newssort")%>"></td>
      <td width="34%"><input type="submit" name="Submit" value="修改" class=input1>　　<a href=news_sort.asp?id=<%=request("id")%>&action=del>删除</a></td>
    </tr>
  </form>
</table>
<%end if%>