📄 deplist.asp
字号:
<!--#include file="check.asp"-->
<!--#include file="checkpower.asp"-->
<!--#INCLUDE FILE="connect.asp" -->
<html>
<head>
<title>部门管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="JavaScript" src="apply.js"></script>
<link rel="stylesheet" href="apply.css" type="text/css">
</head>
<%
if Request.ServerVariables("Request_Method")="POST" then
if request("choosedel")="choosedel" then
j=request("checkbox").count
sql=request("checkbox")(1)
for i=2 to j
delid=request("checkbox")(i)
sql=sql&" or id="&delid
next
sql="delete from depart where id="&sql
conn.execute(sql)
response.write("<script language=javascript>alert('删除部门成功!')</script>")
else
set rs=server.createobject("adodb.recordset")
sql="select * from depart where id=1"
rs.open sql,conn,1,3
rs.addnew
rs("depname")=request("dep")
rs("depno")=request("depno")
rs.update
rs.close
response.write("<script language=javascript>alert('添加部门成功!')</script>")
end if
end if
%>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" oncontextmenu="return false">
<%set rs=server.createobject("adodb.recordset")
sql="select * from depart"
rs.open sql,conn,1,1
%>
<div align="center"> </div>
<table width="100%" cellpadding="0" cellspacing="0" align="center">
<tr>
<td valign="top" height="477" width="940">
<form name="form" method="post" action="">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="50">
<tr>
<td align="center" class="title"> <img src="images/systemdep.gif"></td>
</tr>
</table>
<table width="90%" border="0" cellspacing="0" cellpadding="0" align="center" height="26">
<tr height=1>
<td bgcolor="#A7BAE4" height="1" colspan="4"></td>
</tr>
<tr>
<td bgcolor="#D4DEF4" valign="top">
<table width="100%" border="0" cellspacing="0" cellpadding="0" height="26">
<tr>
<td width="30">
<input type="hidden" name="choosedel">
</td>
<td width="160">目前共有<font class="picknum"><b><%=rs.recordcount %></b></font>个部门 </td>
<td><a href="#" onClick="return checkadddep()" class="aapply">添加部门</a>
<a href="#" onClick="return checkdeldep()" class="aapply">删 除</a>
<a href="javascript:gosystem()" class="aapply"> 返 回</a> </td>
</tr>
</table>
</td>
</tr>
<tr height=1>
<td bgcolor="#A7BAE4" height="1" colspan="4"></td>
</tr>
</table>
<table width="90%" border="0" cellspacing="0" align="center" cellpadding="0">
<tr align="center" bgcolor="#E7ECF7">
<td height="26" width="24%">部 门 编 号:</td>
<td height="26" width="57%">部 门 名 称:</td>
<td height="26" width="19%">删 除:</td>
</tr>
<%if rs.eof then %>
<tr height="1">
<td bgcolor="#ffffff" colspan="4"><img src="images/spacer.gif" width="1" height="1"></td>
</tr>
<tr bgcolor="#F5FAFD" align="center">
<td height="26" colspan="4" class="f6wait">目前您还没有添加部门</td>
</tr>
<tr height="1">
<td bgColor="#D6E1F8" colspan="4"><img src="images/spacer.gif" width="1" height="1"></td>
</tr>
<%
else
dim i
i=0
while not rs.eof
response.write("<script language=javascript>id["&i&"]='"&rs("depno")&"';</script>")
i=i+1
%>
<tr height="1">
<td bgcolor="#ffffff" colspan="4"><img src="images/spacer.gif" width="1" height="1"></td>
</tr>
<tr align="center" bgcolor="#F5FAFD">
<td height="26" width="24%"><%=rs("depno")%></td>
<td height="26" width="57%"><%=rs("depname")%></td>
<td height="26" width="19%">
<input type="checkbox" name="checkbox" value="<%=rs("id")%>">
</td>
</tr>
<tr height="1">
<td bgColor="#D6E1F8" colspan="3"><img src="images/spacer.gif" width="1" height="1"></td>
</tr>
<%rs.movenext
wend
end if
%>
</table>
<table width="90%" border="0" cellspacing="0" cellpadding="0" align="center" height="26">
<tr height=1>
<td bgcolor="#A7BAE4" height="1" colspan="4"></td>
</tr>
<tr>
<td bgcolor="#D4DEF4" align="center">部门编号:
<input type="text" name="depno" size="10" maxlength="4">
部门名称:
<input type="text" name="dep" size="20" maxlength="30">
</td>
</tr>
<tr height=1>
<td bgcolor="#A7BAE4" height="1" colspan="4"></td>
</tr>
</table>
<table width="60%" border="0" cellspacing="0" cellpadding="0" align="center" height="40">
<tr>
<td >
<div align="center" class="9blue">注:部门编号只能输入数字,位数不能超过四位,各部门编号唯一。例如1001</div>
</td>
</tr>
</table>
</form>
</td>
</tr>
</table>
<!--#include file="close.asp"-->
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -