www.gusucode.com > 黑鹰自助链管理系统 1.1 商业版码程序 > adminhymm/admin_class_add.asp

    <!--#include file="mdb.asp"-->
<!--#include file="aq.asp"-->
<%
if session("adminlogin")<>sessionvar then
Response.Write("<script language=javascript>alert('你尚未登录,或者超时了!请重新登录');this.location.href='index.asp';</script>")
Response.End
End if
%>
<HTML>
<HEAD>
<TITLE>类别添加管理</TITLE>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312"> 
<LINK REL="stylesheet" HREF="css.css" TYPE="text/css">
<link href="img/css_body.css" rel="stylesheet" type="text/css" />
</HEAD>
<%
dim rs(5)
function listunder(i)
set rs(i)=server.createobject("adodb.recordset")
rs(i).open "select classid,classname,verity from feilei where topclass="&rs(i-1)("classid"),conn,1,3
while not rs(i).eof
dim topclassname
topclassname=""
for x=0 to i-1
topclassname=topclassname&rs(x)("classname")&">"
next
fujia=""
response.write "<option value='"&rs(i)("classid")&"'>"&topclassname&rs(i)("classname")&fujia&"</option>"&vbCrLf
if i<Ubound(rs) then
call listunder(i+1)
end if
rs(i).movenext
wend
end function
%>
<BODY>

<table width="100%"  border="0" cellpadding="1" cellspacing="1" align="center" class="tb_style">

<tr>
      <td colspan="2" height="30" class="td_title">&nbsp;类别添加管理</td>
    </tr>

<tr> 
<td bgcolor="#FFFFFF">
<%
dim action,classname,leibie,memo,show,newname
action=request("action")
classname=request("classname")
leibie=request("leibie")
memo=request("memo")
show=request("show")
ku=request("ku")
newname=request("newname")
if action="add" then
if classname="" or leibie="" then
Response.Write("<script language=javascript>alert('表单填写不完整!');this.location.href='admin_class_add.asp';</script>")
Response.End
end if
if Session("lastadded")<>classname then
set rss=server.createobject("adodb.recordset")
rss.open "select * from feilei",conn,1,3
rss.addnew
rss("classname")=classname
rss("topclass")=leibie

set r=server.createobject("adodb.recordset")
r.open "select * from feilei where classid="&leibie,conn,1,3
if not r.eof then
level=r("level")+1
else
level=1
end if
r.close
set r=nothing
rss("level")=level
if memo="" then memo=" "
rss("memo")=memo
rss("show")=show
rss("ku")=ku
rss("verity")=1
rss.update
rss.close
set rss=nothing
Session("lastadded")=classname
Response.Write("<script language=javascript>alert('分类成功添加!!');this.location.href='admin_class_add.asp';</script>")
Response.End
end if
end if
%>
<form action="admin_class_add.asp" method="post">

<tr>
      <td width="150" height="25" align="right" class="td_border">新类别名:</td>
      <td align="left" class="td_border"><input name="classname" size="12" maxlength='4'>&nbsp;&nbsp;<font color="#FF0000">最多四个数字,防主页不变形</font></td>
  </tr>

<tr>
      <td width="150" height="25" align="right" class="td_border">上级类别:</td>
      <td align="left" class="td_border"><select name="leibie"> 
<option value='0'>无上级类别</option>
<%
set rs(0)=server.createobject("adodb.recordset")
rs(0).open "select classid,classname,verity from feilei where topclass=0",conn,1,3
while not rs(0).eof
fujia=""
response.write "<option value='"&rs(0)("classid")&"'>"&rs(0)("classname")&fujia&"</option>"&vbCrLf
call listunder(1)
rs(0).movenext
wend
%>
</select></td>
  </tr>


<tr>
      <td width="150" height="25" align="right" class="td_border">首页显示:</td>
      <td align="left" class="td_border"><select name="show" id="show">
<option value="1">显 示</option>
<option value="0">不显示</option></select><font color="#FF0000">*</font> 是否在首页显示</td>
  </tr>

<tr>
      <td width="150" height="25" align="right" class="td_border">酷站显示:</td>
      <td align="left" class="td_border"><select name="ku" id="ku">
<option value="1">显 示</option>
<option value="0">不显示</option></select><font color="#FF0000">*</font> 是否在首页酷站显示</td>
  </tr>

<tr>
      <td width="150" height="25" align="right" class="td_border">类别注释:</td>
      <td align="left" class="td_border"><input name="memo" size="50"></td>
  </tr>

<tr>
      <td width="150" height="25" align="right" class="td_border"></td>
      <td align="left" class="td_border"><input type="hidden" name="action" value="add"><input type="submit" value="添加新类别"> </td>
  </tr>



</form>
</td>
</tr>
</table>
</BODY>
</HTML>