📄 class.asp
字号:
<!--#include file="checkuser.asp"-->
<!--#include file="conn.asp"-->
<%
if request("sort_id")<>"" or request("sort")<>"" then
'------------------------------------类别管理--------------------------------------------------
select case request.form("options")
case "del"
sql="delete * from class where sort_id="&request("sort_id")&"" '删除总类
conn.execute sql
sql="delete * from product where sort_id="&request("sort_id")&"" '删除所属类货物
conn.execute sql
response.write "<script language=javascript>alert('成功删除ID为"&request("sort_id")&"的总类及相关产品!');location='class.asp';</script>"
case "rename"
sql="update class set sort='"&request("sort")&"' where sort_id="&request("sort_id")&""
conn.execute sql
response.write "<script language=javascript>alert('成功将ID为"&request("sort_id")&"更名为"&request("sort")&"!');location='class.asp';</script>"
case "new"
sql="insert into class(sort) values('"&request("sort")&"')"
conn.execute sql
response.write "<script language=javascript>alert('成功添加总类 "&request("sort")&"!');location='class.asp';</script>"
end select
'------------------------------------管理结束---------------------------------------------------
end if
sql="select * from class"
set res=server.createobject("adodb.recordset")
res.open sql,conn,1,1
%>
<html>
<head>
<link href=style.css rel=STYLESHEET type=text/css>
<title></title>
<style type="text/css">
<!--
.style2 {color: #FF0000}
-->
</style>
</head>
<body bgcolor="#FFFFFF">
<table border="0" width="350" cellspacing="0" align="center" cellpadding="0">
<form method="POST" action="class.asp">
<input type="hidden" name="options" value>
<tr>
<td>
<table cellspacing=1 cellpadding=3 width="100%" border=0 bgcolor="#CCCCCC">
<tr bgcolor="#FFFFFF">
<td width="80" height="30" noWrap id=titlemedium>
<div align="center">产品分类</div>
</td>
<td height="30" noWrap id=titlemedium>
<div align="left">
<select name="sort_id" size="1" id="sort_id"style="font-size: 9pt">
<option value="" selected>选择类别</option>
<%
if res.eof and res.bof then
response.write "<option value=>请增加类别"
else
Do while not res.eof
response.write "<option value='" + Cstr(res("sort_id")) + "'>" + res("sort") + "</option>"
res.MoveNext
Loop
end if
%>
</select>
</div>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="30" width="80">
<div align="center">修改分类</div>
</td>
<td height="30" align=middle>
<div align="left">
<input name="sort" type="text" class=smallinput id="sort" style="FONT-SIZE: 12px; WIDTH: 110px" size="20">
</div>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="30" width="80"> </td>
<td height="30" >
<input name="submit3" type=image id="submit2" alt=删除 src="images/delete.gif" width="45" height="20" onClick="form.options.value='del'">
<input name="submit" type=image id="submit4" alt=改名 src="IMAGES/mod.gif" width="45" height="20" onClick="form.options.value='rename'">
<input name="submit2" type=image id="submit22" alt=新增 src="images/add.gif" width="74" height="20" onClick="form.options.value='new'">
</td>
</tr>
</table>
</td>
</tr>
</form>
</table>
</body>
</html>
<%
res.close
set res=nothing
conn.close
set con=nothing
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -