📄 class.asp
字号:
<!--#include file="conn.asp"-->
<!--#include file="checkuser.asp"-->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>吻宇考试管理系统</title>
<style type="text/css">
<!--
body {
background-color: #EFF8FE;
}
body,td,th {
font-size: 12px;
}
a:link {
color: #000000;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #000000;
}
a:hover {
text-decoration: none;
}
a:active {
text-decoration: none;
color: #000000;
}
-->
</style>
<%action=trim(request.querystring("action"))
if action="index.asp" then
%>
<script language="javascript">
function checkform()
{
if(document.cnwy.class.value=="")
{
alert("班级的名称不能为空~!")
return false;
}
}
</script>
</head>
<body>
<form action="class.asp?action=add.asp" method="post" name="cnwy" id="cnwy" onsubmit="return checkform()">
<table width="262" align="center" cellpadding="1" cellspacing="1" bgcolor="#67B0ED">
<tr>
<td colspan="2" bgcolor="#EFF8FE"><div align="center">班级增加</div></td>
</tr>
<tr>
<td width="63" bgcolor="#EFF8FE">班级名称:</td>
<td width="190" bgcolor="#EFF8FE"><input name="class" type="text" id="class"></td>
</tr>
<tr>
<td colspan="2" bgcolor="#EFF8FE"><table align="center" cellpadding="1" cellspacing="1">
<tr>
<td width="71"><input type="submit" name="Submit" value="增加"></td>
<td width="68"><div align="right">
<input type="submit" name="Submit2" value="清除">
</div></td>
</tr>
</table></td>
</tr>
</table>
</form>
<%elseif action="add.asp" then
dim sql
class1=request.form("class")
sql="insert into class (class) values ('"&class1&"')"
conn.execute(sql)
conn.close
set conn=nothing
%>
<script language="vbscript">
msgbox("恭喜你添加班级的操作成功~!")
window.location.href"class.asp?action=index.asp"
</script>
<%elseif action="gl.asp" then
set rs=server.createobject("adodb.recordset")
sql="select * from class order by id desc"
rs.open sql,conn,1,1
%>
<script language="vbScript">
sub del(id)
if confirm("你真的要删除这个班级吗~?") then
window.location.href"class.asp?action=del.asp&id="&id
end if
end sub
</script>
<script language="javascript">
function checkform()
{
if(document.cnwy.class.value=="")
{
alert("班级的名称不能为空~!")
return false;
}
}
</script>
</head>
<body>
<table width="265" align="center" cellpadding="1" cellspacing="1" bgcolor="#67B0ED">
<tr>
<td colspan="3" bgcolor="#EFF8FE"><div align="center">班级管理</div></td>
</tr>
<tr>
<td width="171" bgcolor="#EFF8FE"><div align="center">班级名称</div></td>
<td width="42" bgcolor="#EFF8FE"><div align="center">修改</div></td>
<td width="40" bgcolor="#EFF8FE"><div align="center">删除</div></td>
</tr>
<%if not rs.eof then
rs.movefirst
do while not rs.eof
id=rs("id")
class1=rs("class")%>
<form action="class.asp?action=xg.asp&id=<%=id%>" method="post" name="cnwy" id="cnwy" onsubmit="return checkform()">
<tr>
<td bgcolor="#EFF8FE"><input name="class" type="text" id="class" value="<%=class1%>"></td>
<td bgcolor="#EFF8FE"><input type="submit" name="Submit" value="修改"></td>
<td bgcolor="#EFF8FE"><input name="Submit2" type="button" onClick="call del(<%=id%>)" value="删除"></td>
</tr>
</form>
<%
rs.movenext
loop
else
response.write"暂时没有任何数据~!"
end if
rs.close
set rs=nothing
set conn=nothing
%>
</table>
<%elseif action="xg.asp" then
dim class1
id=request.querystring("id")
class1=request.form("class")
sql="update class set class='"&class1&"' where id="&id
conn.execute(sql)
conn.close
set conn=nothing
%>
<script language="vbscript">
msgbox("恭喜你修改班级成功~!")
window.location.href"class.asp?action=gl.asp"
</script>
<%elseif action="del.asp" then
dim id
id=request.querystring("id")
sql="delete * from class where id="&id
conn.execute(sql)
conn.close
set conn=nothing
%>
<script language="vbscript">
msgbox("恭喜你删除班级的操作成功~!")
window.location.href"class.asp?action=gl.asp"
</script>
<%else%>
<script language="vbscript">
msgbox("吻宇提示你非法操作~!")
window.location.href"admin.asp"
</script>
<%end if%>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -