📄 class.asp
字号:
<%
'###########################################################################################
' Copyright (C) 2006 FreeLin rights reserved. '
' 本系统由FREELIN工作室独立开发2006.3.20 '
' 版权所有,并保留所有版权,不得修改传播 '
' http://www.yisky.com '
' co_lin@126.com '
'###########################################################################################
%>
<!--#include file="config.asp"-->
<!--#include file="freelin.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理类别--FreeLin设计</title>
<LINK href="../images/style.css" type=text/css rel=stylesheet>
<script>
function del(id)
{
var msg;
msg=window.confirm("FreeLin 提示:真的要删除该类别?");
if (msg)
{
location.href="class.asp?action=del&id="+id;
}
}
</script>
</head>
<body>
<%
if request.querystring("action") = "modify" then
modId = trim(request.querystring("id"))
if request.form("modify")<>"" then
modClass = trim(request("mclassName"))
if modClass = "" then xln_showmsg "操作失败","类别不能为空","class.asp","自动返回"
conn.execute "update class set className='"& modClass &"' where id="& modId &""
xln_showmsg "操作成功","修改类别成功","class.asp","自动返回"
else
set rs = conn.execute("select * from class where id="& modId &"")
end if
%>
<table width="60%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolor="#f0f0f0">
<form name="form1" method="post" action="">
<tr align="center" bgcolor="#FAFAFA">
<td height="40" colspan="3"><strong>修改分类</strong></td>
</tr>
<tr align="center">
<td width="19%">客房类别</td>
<td width="57%">
<input name="mclassName" type="text" size="25" maxlength="50" value=<%=rs("className")%>>
</td>
<td width="24%">
<input name="modify" type="submit" id="modify" value="修改"></td>
</tr>
</form>
</table>
<%
conn.close
else
if request.form("addPro")<>"" then
proClass = trim(request("className"))
if proClass = "" then xln_showmsg "操作失败","类别不能为空","class.asp","自动返回"
conn.execute "insert into class (className) values ('"&proClass&"')"
conn.close
xln_showmsg "操作成功","添加类别成功","class.asp","自动返回"
end if
if request.querystring("action") = "del" then
proId = trim(request.querystring("id"))
conn.execute "delete from class where id="& proId &""
conn.close
xln_showmsg "操作成功","删除类别成功","class.asp","自动返回"
end if
%>
<table width="60%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolor="#f0f0f0">
<form name="form1" method="post" action="">
<tr align="center" bgcolor="#FAFAFA">
<td height="40" colspan="3"><strong>添加分类</strong></td>
</tr>
<tr align="center">
<td width="19%">客房类别</td>
<td width="57%">
<input name="className" type="text" size="25" maxlength="50">
</td>
<td width="24%">
<input name="addPro" type="submit" id="addPro" value="添加类别"></td>
</tr>
</form>
</table>
<br>
<table width="60%" border="1" align="center" cellpadding="3" cellspacing="0" bordercolor="#f0f0f0">
<form name="form1" method="post" action="">
<tr align="center" bgcolor="#FAFAFA">
<td height="40" colspan="3"><strong>管理分类</strong></td>
</tr>
<tr align="center" bgcolor="#F3FAF4">
<td width="19%">序号</td>
<td width="57%">客房类别</td>
<td width="24%">管理操作 </td>
</tr>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from class order by id desc"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
all_record=rs.recordcount
If(all_record<1) Then
response.Write "<div align=center>对不起,没有新的客房类别!请添加</div>"
else
for i=1 to rs.PageSize
if rs.EOF then
exit for
end if
id = rs("id")
%>
<tr align="center">
<td><%=i%></td>
<td><%=rs("className")%></td>
<td><a href='class.asp?action=modify&id=<%=id%>'>修改</a> <a href="javascript:del('<%=id%>');">删除</a></td>
</tr>
<%
rs.movenext
next
end if
%>
</form>
</table>
<%end if%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -