<!--#include file="../conn/conn.asp"-->
<!--#include file="../conn/nosql.asp"-->
<!--#include file="../conn/config.asp"-->
<!--#include file="../conn/md5.asp"-->

<%if Not ChkPosturl then response.redirect ("login.asp")
if session("adminname")="" then
  response.Write "<script language='javascript'>alert('网络超时或您还没有登陆！');window.location.href='login.asp';</script>"
  response.End
end if
action=request.querystring("action")
if action="add" then
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from mini_bigclass",conn,1,3
rs.AddNew
rs("bigname")=nosql(trim(request("bigname2")))
rs("bigid")=nosql(int(request("bigid2")))
rs.Update
rs.Close
set rs=nothing
response.Redirect "mini_bigclass.asp"
end if
'//修改数据
if action="edit" then
if isChkInteger(request.QueryString("id")) then
id=request("id")
else
Response.Redirect ("../index.asp")
end if
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from mini_bigclass where id="&id,conn,1,3
rs("bigname")=nosql(trim(request("bigname")))
rs("bigid")=nosql(int(request("bigid")))
rs.Update
rs.Close
set rs=nothing
response.Redirect "mini_bigclass.asp"
end if
'//删除数据
if action="del" then
if isChkInteger(request.QueryString("id")) then
id=request("id")
else
Response.Redirect ("../index.asp")
end if
conn.execute ("delete from mini_bigclass where id="&id)
conn.execute ("delete from mini_smllclass where bigclassid="&id)
conn.execute ("delete from mini_minilist where bigclassid="&id)
response.Redirect "mini_bigclass.asp"
end if
%>

<html>
<head>
<title>Untitled Document</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../css.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style4 {color: #000000}
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
-->
</style>
</head>
<body>
<iframe width="260" height="165" id="colourPalette" src="../images/nc_selcolor.htm" style="visibility:hidden; position: absolute; left: 0px; top: 0px;border:1px gray solid" frameborder="0" scrolling="no" ></iframe>
<table width="100%" border="0" cellpadding="0" cellspacing="0" background="images/right_top2.gif">
  <tr>
    <td width="1%">&nbsp;</td>
    <td width="99%"><table width="100%" border="0" cellspacing="0" cellpadding="5">
        <tr>
          <td class="style4" style="font-size:14px;color:#ffffff">&nbsp;<strong><font color="#000000">大类管理 </font></strong></td>
        </tr>
    </table></td>
  </tr>
</table>
<br>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#9DB2D4">
  <tr bgcolor="#C7D3E6">
    <td>
    <div align="center">分类名称</div></td>
    <td>
    <div align="center">排序</div></td>
    <td>
    <div align="center">修改删除</div></td>
  </tr>
  <%set rs=server.CreateObject("adodb.recordset")
		  rs.Open "select * from mini_bigclass order by bigid ",conn,1,1
		  dim paixu
		  if rs.EOF and rs.BOF then
		  response.Write "<div align=center><font color=red>还没有分类</font></center>"
		  paixu=0
		  else
		  do while not rs.EOF
		  %>
  <form name="form1" method="post" action="?action=edit&id=<%=int(rs("id"))%>">
    <tr bgcolor="#F0F3F8">
      <td>
        <div align="center">
          <input name="bigname" class="wenbenkuang" type="text" id="bigname" size="32" value="<%=trim(rs("bigname"))%>">
      </div></td>
      <td>
        <div align="center">
          <input name="bigid" type="text" class="wenbenkuang" id="bigid" size="14" value="<%=int(rs("bigid"))%>">
      </div></td>
      <td>
        <div align="center">
          <input type="submit" name="Submit" value="立即修改" class="go-wenbenkuang">
      <a href="?id=<%=int(rs("id"))%>&action=del" onClick="return confirm('您确定进行删除操作吗？')"><font color=red>删除该分类</font></a> </div></td>
    </tr>
  </form>
  <%rs.MoveNext
          loop
          paixu=rs.RecordCount
          end if%>
</table>
<br>
<table width="90%" border="0" align="center" cellpadding="3" cellspacing="1" bgcolor="#9DB2D4">
  <tr bgcolor="#C7D3E6">
    <td>
    <div align="center">分类名称</div></td>
    <td>
    <div align="center">排序</div></td>
    <td>
    <div align="center">确定操作</div></td>
  </tr>
  <form name="form2" method="post" action="?action=add">
    <tr bgcolor="#F0F3F8">
      <td bgcolor="#F0F3F8">
        <div align="center">
          <input name="bigname2" type="text" class="wenbenkuang" id="bigname2" size="32">
      </div></td>
      <td>
        <div align="center">
          <input name="bigid2" class="wenbenkuang" type="text" id="bigid2" size="14" value="<%=paixu+1%>">
      </div></td>
      <td><div align="center">
          <input type="submit" name="Submit3" value="添加大类" class="go-wenbenkuang">
      </div></td>
    </tr>
  </form>
</table>
<br>
</body>
</html>
