<!--#include file="conn.asp"-->
<!--#include file="seeion.asp"-->
<%
Dim Angel_languageid
    Angel_languageid=Trim(request.QueryString("Languageid"))
If Angel_languageid="" Then 
    Angel_languageid=1
Else
    Angel_languageid=Angel_languageid
End If 
Angel_main_id = request("Angel_main_id")
id = request("id")
If request.Form("update") = "yes" Then
    If Not IsNumeric(request("Angel_order_id")) Then
        response.Write("<script>alert(""排序字符必须为数字！""); history.back(1);</script>")
        response.End
    End If
    Set rs = server.CreateObject("adodb.recordset")
    sql = "select * from Angel_news_category where Angel_id="&id
    rs.Open sql, conn, 1, 3
    rs("Angel_title") = request.Form("Angel_title")
    rs("Angel_order_id") = request.Form("Angel_order_id")
    rs.update
End If
If request.Form("submit") = "修改新闻分类" Then
    Set rs = server.CreateObject("adodb.recordset")
    sql = "select * from Angel_news_category where Angel_id="&id
    rs.Open sql, conn, 1, 3
    rs("Angel_title") = request.Form("Angel_title")
    rs.update
	response.Write "<script language=javascript>alert(""新闻修改成功！"");window.location.href=""news_category.asp""</script>"
	response.End()
End If
If request("act") = "del" Then
    Set rs = server.CreateObject("adodb.recordset")
    id = Request.QueryString("id")
    sql = "select * from Angel_news_category where Angel_id="&id
    rs.Open sql, conn, 1, 3
    rs.Delete
    rs.update
    Response.Write "<script>alert('成功刪除分类！');window.location.href='news_category.asp';</script>"
End If
If request.Form("submit") = "添加分类" Then
    Angel_title = request.Form("Angel_title")
    Angel_order_id = request.Form("Angel_order_id")
    If Angel_title = "" Then
        response.Write("<script language=javascript>alert('标题不能为空!');history.back(1)</script>")
        response.End()
    End If
    If Angel_order_id = "" Or IsNumeric(Angel_order_id) = false Then
        response.Write("<script>alert(""排序字符必须为数字！""); history.back(1);</script>")
        response.End
    End If
    Set rs = Server.CreateObject("adodb.recordset")
    sql = "select * from Angel_news_category"
    rs.Open sql, conn, 1, 3
    rs.addnew
    rs("Angel_title") = Angel_title
    rs("Angel_order_id") = Angel_order_id
	rs("Angel_languageid")=Angel_languageid
    rs.update
    rs.Close
    Set rs = Nothing
    conn.Close
    Set conn = Nothing
    response.Write "<script language=javascript>alert(""新闻添加成功！"");window.location.href=""news_category.asp""</script>"
    response.End
End If
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>Angel_asp工作室网站后台管理系统</title>
<link href="css/style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!--#include file="header.asp"-->
<div id="top_banner" class="layout"></div>
<div id="content" class="layout">
  <!--#include file="left.asp"-->
  <div id="right">
    <div class="right_title">
      <h2>新闻分类调整</h2>
    </div>
    <div class="right_body">
<table align="center" style="margin-bottom:10px">
	<tr>
	<td>
<%If Int(Angel_languageid)=1 Then  %>
<div id="lglocatione1"><a href="news_category.asp?LanguageId=1" >添加中文</a></div>
<div id="lglocatione"><a href="news_category.asp?Languageid=2">添加英文</a></div>
<%else%>
<div id="lglocatione"><a href="news_category.asp?LanguageId=1" >添加中文</a></div>
<div id="lglocatione1"><a href="news_category.asp?Languageid=2">添加英文</a></div>
<%End If %>
</td>
	</tr>
</table>


      <table align="center" class="table">
        <%
Set rs = server.CreateObject("adodb.recordset")
exec = "select * from Angel_news_category where 1=1 and Angel_languageid="&Angel_languageid&" order by Angel_order_id"
rs.Open exec, conn, 1, 1
Do While Not rs.EOF
%>
        <form method="post" name="Angel">
          <tr>
            <td width="259"><input name="id" type="hidden" value="<%=rs("Angel_id")%>" />
              <input name="Angel_title" type="text" value="<%=rs("Angel_title")%>" size="30" /></td>
            <td width="261">排序：
              <input name="Angel_order_id" type="text" value="<%=rs("Angel_order_id")%>" size="8"></td>
            <td width="175"><input name="submit" type="submit" value="修改新闻分类" />
            <input name="delete" type="button" value="删除" onClick="javascript:if(confirm('确定要删除此新闻分类吗？删除后不可恢复!')){window.location.href='news_category.asp?act=del&id=<%=rs("Angel_id")%>';}else{history.go(0);}" /></td>
          </tr>
        </form>
        <%
rs.movenext
Loop
rs.Close
Set rs = Nothing
%>
      </table>
    </div>
    <div class="right_title">
      <h2>添加新闻分类</h2>
    </div>
    <div class="right_body">
      <table width="98%" border="0" cellpadding="0" cellspacing="0" class="table">
        <form  method="post" >
          <tr>
            <td width="38%">分类名称：
              <input name="Angel_title" type="text" size="30"/></td>
            <td width="23%">排序：
              <input name="Angel_order_id" type="text" size="10"/></td>
            <td width="39%"><input type="submit" name="submit" value="添加分类" /></td>
          </tr>
        </form>
      </table>
    </div>
  </div>
  <div class="clear"></div>
</div>
<!--#include file="footer.asp"-->
