<!--#include file="conn.asp"-->
<!--#include file="adminset.asp"-->
<%if session("admin")="" then
response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
response.End
end if
if session("flag")>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
if qx6<>1 then
response.Write "<div align=center><font size=80 color=red><b>您没有此项目管理权限！</b></font></div>"
response.End
end if
%>
<%
if request("action")="adda" then
classname=trim(request("classname"))
''检验此一级分类是否唯一
sql="select * from shop_news_class where classname='"&classname&"' order by id desc"
set rs=server.createobject("ADODB.Recordset")
rs.open sql,conn,1,3
if not(rs.eof or rs.bof) then
response.write"<SCRIPT language=JavaScript>alert('对不起，此分类名已经存在,请核实！');"
response.write"javascript:history.go(-1)</SCRIPT>"
response.end
else
rs.addnew
rs("classname")=classname
rs("class")=trim(request("class"))
rs("px")=trim(request("px"))
rs("adddate")=now()
rs.update

end if
rs.close
set rs=nothing

response.redirect "news_anclass.asp"
response.end
end if
%>
<html>
<head>
<title>网软志成在线购物系统</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="../css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
}
-->
</style>
</head>

<body>
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td width="1%" height="28">&nbsp;</td>
    <td width="99%"><table width="100%" border="0" cellspacing="0" cellpadding="5">
      <tr>
        <td width="77%" height="27" style="font-size:14px;color:#ffffff">&nbsp;<strong><font color="#000000">网软志成购物后台管理系统 &gt;&gt; 新闻管理 &gt;&gt; 新闻一级大类管理 </font></strong></td>
        <td width="23%" style="font-size:14px;color:#ffffff"><span class="STYLE1">* 为必添项目</span></td>
      </tr>
    </table></td>
  </tr>
</table>
<br>
<table width="95%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#999999">
  <tr bgcolor="#cccccc">
    <td width="5%">
    <div align="center">排 序</div></td>
    <td width="11%"><div align="center">分类名称</div></td>
    <td width="70%">
    <div align="center">说明</div></td>
    <td colspan="2">
    <div align="center">操作</div></td>
  </tr>
  <%set rs=server.CreateObject("adodb.recordset")
		  rs.Open "select * from shop_news_class order by px ",conn,1,1
          paixu=1
		  if rs.EOF and rs.BOF then
		  response.Write "<div align=center><font color=red>还没有分类</font></center>"
		  else
		  do while not rs.EOF
		  %>
  <form name="form1" method="post" action="news_anclass_save.asp?action=edit&id=<%=int(rs("id"))%>">
    <tr bgcolor="#F3F3F3">
      <td>
        <div align="center">
          <input name="px" type="text" class="wenbenkuang" id="px" size="4" value="<%=int(rs("px"))%>" onKeyPress="return event.keyCode>=48&&event.keyCode<=57">
        </div></td>
      <td><div align="center">
          <input name="classname" class="wenbenkuang" type="text" id="classname2" size="15" value="<%=trim(rs("classname"))%>">
            </div></td>
      <td>
        <div align="center">
          <textarea name="class" cols="80" rows="1" class="wenbenkuang" id="class"><%=trim(rs("class"))%></textarea>
      </div></td>
      <td width="7%" bgcolor="#F3F3F3">
        <div align="center">
          <input type="submit" name="Submit" value="修改" class="go-wenbenkuang">
      </div></td>
      <td width="7%" bgcolor="#F3F3F3"><div align="center"><a href="news_anclass_save.asp?id=<%=int(rs("id"))%>&action=del" onClick="return confirm('您确定进行删除操作吗？')"><font color=red>删除</font></a> </div></td>
    </tr>
  </form>
  <%paixu=paixu+1
  rs.MoveNext
          loop
          
          end if%>
</table>
<br>
<br>
<table border="0" cellspacing="1" cellpadding="3" bgcolor="#999999" align="center" width="95%" class="border">
  <tr bgcolor="#cccccc"> 
    <td height="25" colspan="2" class="title"><div align="center">添加新闻大类</div></td>
  </tr>
  <form name="addsort" method="post" action="news_anclass.asp" onSubmit="return ck1()">
  <script language="javascript">
function ck1()
{



if(addsort.classname.value=="")
{
alert("请输入名称")
addsort.classname.focus()
return false
}

if(addsort.px.value=="")
{
alert("请输入排序")
addsort.px.focus()
return false
}

}
</script>
    <tr bgcolor="#F3F3F3"> 
      <td width="14%" align="right" class="tdbg">分类名：</td>
      <td width="86%" class="tdbg"> <input name="classname" type="text" class="wenbenkuang" id="classname">
      　排序： <input name="px" type="text" class="wenbenkuang" id="px" value="<%=paixu%>" size="8" onKeyPress="return event.keyCode>=48&&event.keyCode<=57" ></td>
    </tr>
    <tr bgcolor="#F3F3F3"> 
      <td align="right" bgcolor="#F3F3F3" class="tdbg">说明：</td>
      <td class="tdbg"><textarea name="class" cols="80" rows="8" class="wenbenkuang" id="class"></textarea></td>
    </tr>
    <tr bgcolor="#F3F3F3"> 
      <td colspan="2" align="center" class="tdbg"> <input name="Submit3" type="submit" class="go-wenbenkuang" value="添 加"> 
      <input type="hidden" name="action" value="adda"> </td>
    </tr>
  </form>
</table>
<!--#include file="copyright.asp"-->
<p>&nbsp;</p>
<p>&nbsp;</p>
</body>
</html>
