user_query.asp

来自「吻宇考试管理系统源码 吻宇考试管理系统源码」· ASP 代码 · 共 186 行

ASP
186
字号
<!--#include file="checkuser.asp"-->
<!--#include file="conn.asp"-->
<%
dim lx,tj
dim rs,sql
lx=request.querystring("lx")
tj=request.querystring("tj")
if lx=0 then
%>
<script language="vbscript">
msgbox("请正确输入查找类型~!")
window.history.go(-1)
</script>
<%end if
if tj="" then%>
<script language="vbscript">
msgbox("查找条件不能为空~!")
window.history.go(-1)
</script>
<%end if%>
<%if lx=1 then
sql="select * from user where name='"&tj&"'"
elseif lx=2 then
sql="select * from user where zkz='"&tj&"'"
elseif lx=3 then
sql="select * from user where class='"&tj&"'"
end if
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if not rs.eof then
pagesize=20 '每一页的信息条数
Page=clng(Request.QueryString ("Page")) 
if page<1 then page=1
if page>rs.PageCount then page=rs.PageCount
%>
<!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><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>
<script language="vbScript">
sub del(id)
if confirm("你真的要删除这个学生资料的记录吗~?") then
window.location.href"user_del.asp?id="&id
end if
end sub
sub sd(id)
if confirm("你真的要锁定该用户的状态吗~?") then
window.location.href"user_zt.asp?action=lock&id="&id
end if
end sub
</script>
</head>

<body>
<table width="476" border="0" align="center" cellpadding="1" cellspacing="1" bgcolor="#67B0ED">
  <tr bgcolor="#EFF8FE">
    <td colspan="7"><div align="center">考生管理系统</div></td>
  </tr>
  <tr bgcolor="#EFF8FE">
    <td colspan="7"><table width="478" cellpadding="0" cellspacing="0">
        <tr>
        <form name="cnwy" method="get" action="user_query.asp" onsubmit="return checkform()">
		<td width="87">考生条件查询:
       </td>
        <td width="225"><select name="lx" id="lx">
          <option value="0">查询类型</option>
          <option value="1">真实姓名</option>
          <option value="2">准考证号</option>
          <option value="3">所在班级</option>
		</select>
          <input name="tj" type="text" id="tj" value="输入你要查询的条件" size="18"></td>
        <td width="61">
          <input type="submit" name="Submit" value="查找">
        </td></form>
        <td width="97"><a href="user_gl.asp">返回考生管理首页</a></td>
      </tr>
    </table></td>
  </tr>
  <tr bgcolor="#EFF8FE">
    <td width="106"><div align="center">准考证号</div>      </td>
    <td width="107"><div align="center">考生姓名</div></td>
    <td width="96"><div align="center">所在班级</div></td>
    <td width="36"><div align="center">锁定</div></td>
    <td width="37"><div align="center">解锁</div></td>
    <td width="30"><div align="center">修改</div></td>
    <td width="42"><div align="center">删除</div></td>
<%
if not rs.eof then
rs.movefirst
rs.AbsolutePage=Page
for i=1 to pagesize
%>
  </tr>
  <tr bgcolor="#EFF8FE">
    <td><div align="center"><%=rs("zkz")%></div></td>
    <td><div align="center"><%=rs("name")%></div></td>
    <td><div align="center"><%=rs("class")%></div></td>
    <td><div align="center"><a href="#" onClick="call sd(<%=id%>)">锁定</a></div></td>
    <td><div align="center"><a href="user_unlock.asp?id=<%=id%>">解锁</a></div></td>
    <td><div align="center"><a href="user_xg.asp?id=<%=id%>">修改</a></div></td>
    <td><div align="center"><a href="#" onClick="call del(<%=id%>)">删除</a></div></td>
  </tr>
<%
				rs.MoveNext
                if rs.eof then exit for
				next
			else
			response.Write"暂时没有数据"
			end if 
			%>
<tr bgcolor="#EFF8FE"><td colspan="7"><div align="center">
  <table border=0 width='100%'>
    <tr>
      <td width="268" align=left>
        <div align="center">考生总数:<font color=#ff3333><%=rs.recordcount%></font>人 总页数:<font color=#ff3333><%=rs.PageCount%></font>页 当前第<font color=#ff3333><%=Page%></font>/<font color=#ff3333><%=rs.pagecount%></font>页</div></td>
      <td width="194" align="right">
        <div align="center"></div>
        <div align="center"> |<a href="user_query.asp?lx=<%=lx%>&tj=<%=tj%>&Page=1">第一页</a>|<a href="user_query.asp?lx=<%=lx%>&tj=<%=tj%>&Page=<%=Page-1%>">上一页</a>|<a href="user_query.asp?lx=<%=lx%>&tj=<%=tj%>&Page=<%=Page+1%>">下一页</a>|<a href="user_query.asp?lx=<%=lx%>&tj=<%=tj%>&Page=<%=rs.PageCount%>">最后一页</a>|</div></td>
    </tr>
  </table>
</div></td>
</table>
</body>
</html>
<%else%>
<SCRIPT LANGUAGE="VBSCRIPT">
msgbox("对不起没有查找的数据~!")
window.history.go(-1)
</SCRIPT>
<%
end if
rs.close
set rs=nothing
set conn=nothing
%>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?