📄 bumen_set.asp
字号:
<!--#include file = "Startup.asp"-->
<!-- #include file="Function.asp" -->
<%
call adminer()
Call ComeUrl()
Call xiaoquandadmin()
page=request("page")
if instr(page,",")<>0 then
page=left(page,instr(page,",")-1)
end if
'response.write "page="&page
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="common.css" type="text/css" rel="stylesheet">
<title>无标题文档</title>
</head>
<body>
<table width="100%" height="100%" border="0">
<tr>
<td align="center" valign="top">
<table width="500" border="0" align="center" cellpadding="2" cellspacing="1" bgcolor="#CCCCCC" >
<tr align="center" bgcolor="#E0E0E0">
<td width="30%" height="20" align="left"><strong> <font color="#FF0000">部门名称</font></strong></td>
<td width="15%" height="20" align="left"><strong> <font color="#FF0000">所属校区</font></strong></td>
<td width="25%" height="20" align="left"><strong> <font color="#FF0000">负责人</font></strong></td>
<%if session("userclass")=1 then%>
<td width="15%" align="center"><strong><font color="#FF0000">修改</font></strong></td>
<td width="15%" align="center"><strong><font color="#FF0000">操作</font></strong></td>
<%end if %>
</tr>
<%
xiaoqu=trim(request("所属校区"))
if xiaoqu<>"" then
sql="select * from bumen where 所属校区='"&xiaoqu&"'"
else
sql="select * from bumen"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,oconn,1,2
if rs.eof then
response.Write("暂无部门!")
else
rs.PageSize =15 '每页记录
totalput = rs.RecordCount '总记录数
pgnum=rs.Pagecount '总页数
if page="" then page=1
if page-pgnum>0 then page=pgnum
rs.AbsolutePage=page
n=0
do while not rs.eof and n<rs.pagesize
n=n+1
id=rs("id")
s=rs("部门名称")
response.write "<tr align=left bgcolor=#ffffff><form name=form2 method=post action=bumen_edt.asp>"
response.write "<td bgcolor=#ffffff><a href='wuzi_magic.asp?所属部门="&s&"&所属校区="&rs("所属校区")&"&utype=2' title='点击可查看该部门所有设备' target='_self'>"& s &"</a></td>"
response.write"<td bgcolor=#ffffff>"& rs("所属校区")&"</td>"
if session("userclass")=1 then
response.write"<td bgcolor=#ffffff><input value="& rs("部门主管")&" type=text name=bmadmin size=15></td>"
response.write"<td bgcolor=#ffffff><input type=hidden name=id value="&rs("id")&"><input value=修改 type=submit></a></td>"
response.write"<td bgcolor=#ffffff><a href=delbumen.asp?id="&id&">删除</a></td>"
else
response.write"<td bgcolor=#ffffff>"& rs("部门主管")&"</td>"
end if
response.write "</form></tr>"
rs.movenext
loop
end if
%>
</table>
<br>
<%If session("userclass")=1 Then%>
<table width="80%" border="0">
<tr>
<td align="center">
<form name="form1" method="post" action="bumen_add.asp">
<table width="500" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr align="center" bgcolor="#FFFFFF">
<td width="25%"> <input name="bmname" type="text" id="bmname" value="输入部门名称" size="15"></td>
<td width="25%"><input name="bmadmin" type="text" id="bmadmin" value="输入部门主管" size="15"></td>
<td width="25%"><select name="ssxq">
<option>所属校区</option>
<%
set xqrs=server.createobject("adodb.recordset")
xqsql="select 校区名称 from shcool_class"
xqrs.open xqsql,oConn,1,1
do while not xqrs.eof
response.write "<option value="&xqrs("校区名称")&">"&xqrs("校区名称")&"</option>"
xqrs.movenext
loop
xqrs.close
%>
</select></td>
<td width="25%"> <input type="submit" name="Submit" value="添加部门"></td>
</tr>
</table>
</form></td>
</tr>
</table>
<%end if %>
<table align=center width="80%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align=center>
<%
if page>1 then
sstr=request.servervariables("query_string")
sstr=right(sstr,len(sstr)-instr(sstr,"&"))
'sstr=replace(sstr,restr,"")
else
sstr=request.servervariables("query_string")
end if
if totalput>rs.pagesize then %>
[<%=rs.pagesize%>条/页 共<%=totalput%>条]
<%
if page=1 then%>
[首 页] [上一页]
<% else %>
[<a href="?page=1&<%=sstr%>">首 页</a>] [<a href="?page=<%=page-1%>&<%=sstr%>">上一页</a>]
<%end if%>
<%if rs.pagecount-page=0 then%>
[下一页] [尾 页]
<%else%>
[<a href="?page=<%=page+1%>&<%=sstr%>">下一页</a>] [<a href="?page=<%=rs.pagecount%>&<%=sstr%>">尾
页</a>]
<%
end if
else
end if
rs.close
%>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -