📄 typecontrol.asp
字号:
<%
if session("longin")<>1 then '判断是否登录
response.Redirect("login.asp") '转移到登录页面
end if
%>
<!--#include file="conn.asp"-->
<script language="javascript">
<!--
//
function submitcheck()
{
if(form1.typename.value == "")
{window.alert ("请填写类型名称!");
form1.typename.focus();
return false;
}
}
-->
</script>
<html>
<head>
<meta http-equiv="Content-Language" content="zh-cn">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css.css" type="text/css">
<title>后台管理——设计类型</title>
</head>
<%
action=request("action")
if action="deltypepost" then
typeid=request("typeid")
StrSQL1="delete from designtype where typeid="&typeid
conn.Execute StrSQL1
end if
if action="addtypepost" then
Set rs=Server.CreateObject("ADODB.Recordset")
sql="SELECT * FROM designtype"
rs.Open sql,conn,1,3
rs.Addnew
rs("typename")=Server.Htmlencode(Request("typename"))
rs.Update
rs.Close
Set rs=Nothing
end if
Set rs = conn.Execute("select *from designtype order by typeid")
%>
<table width="80%" border="0" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
<tr bgcolor="#FFFFFF">
<td align="center">[类型编号]</td>
<td align="center">[类型名称]</td>
<td colspan="2" align="center">[操作]</td>
</tr>
<%
do while not rs.eof
%>
<tr bgcolor="#FFFFFF">
<td align="center"><%=rs("typeid")%></td>
<td align="center"><%=rs("typename")%></td>
<td align="center"><a href="edittype.asp?typeid=<%=rs("typeid")%>" style="text-decoration: none">修改</a></td>
<td align="center"><a href="typecontrol.asp?action=deltypepost&typeid=<%=rs("typeid")%>" style="text-decoration: none">删除</a>
</td>
<%
rs.movenext
loop
rs.close
set rs=nothing
set coon=nothing
%>
</tr>
</table>
<br>
<table border="0" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC" >
<form method="post" action="typecontrol.asp?action=addtypepost" name="form1" onsubmit="return submitcheck()" >
<tr>
<td colspan="3">增加新的类型:</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" >类型名称:</td>
<td bgcolor="#FFFFFF"> <input name="typename" type="text" id="typename" size="11"></td>
<td bgcolor="#FFFFFF"><input type="submit" name="Submit" value="确认">
<input type="reset" name="Submit2" value="复位"></td>
</tr>
</form>
</table>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -