⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 zhxn.asp

📁 基于ASP的SQL小区物业管理系统课程设计
💻 ASP
字号:
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
<!--#include file="sub/conn.asp"-->
<!--#include file="sub/gaoji.asp"-->
<!--#include file="sub/rightnav.asp"-->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>住户管理系统</title>
<script language="javascript">
 function AXzhz(hideme)
  {
    var a1=document.all(hideme); //声明一个变量
    a1.style.display=a1.style.display=="none"?"":"none"; //判断是否隐藏
  }
  
 function del() {
    var isok=true;
	isok=confirm("确定要删除吗?")
	return isok;
 }
</script>
<link href="cbody.css" rel="stylesheet" type="text/css" />
<link href="nav.css" rel="stylesheet" type="text/css" />
</head>
<body>
<!--#include file="sub/mheader.asp"-->
  <div id="abody">
    <div id="lbody">
	  <div class="zh1">
	  <p class="mzhusi">---------- 选中全部,关键字为空即可查询全部。-----------</p>
		<h5>简单查询:</h5>
		<div class="zhcxb">
		<form id="form1" name="form1" method="post" action="zhxn.asp" >
		  <select name="s1" id="s1">
            <option value="all">全部</option>
			<option value="owner">姓名</option>
            <option value="identify">身份证</option>
            <option value="sex">性别</option>
            <option value="room_id">房间号</option>
            <option value="person">家庭人口</option>
            <option value="room_size">房间大小</option>
            <option value="car">汽车</option>
            <option value="carrydate">迁入日期</option>
            <option value="jianli">个人简历</option>
          </select>
		  <input name="keyword" type="text" class="yinput" id="keyword" onFocus="this.value=''" value="关键字" />
		  <input type="submit" name="B1" value="立即提交" />
		  <input type="button" name="B2" value="高级查询" onClick="AXzhz('a1')" />
		  </form>
		</div>
		<div id="a1" style="display:none"><% call gaoji() %></div>
		<!--查询结果-->
		<% 
   dim jian,keyword,biao
   keyword=trim(Request("keyword"))
   jian=Request("s1")
   vari="zhxn.asp?s1="&jian&"&keyword="&keyword
   if jian="" or keyword="关键字" then
   Response.Write("")
   else
        if jian="all" then
		sql="select * from room order by room_id"
		else
        sql="select * from room where "&jian&" like '%"&keyword&"%' order by ID"
		end if
   set rs=Server.CreateObject("ADODB.RecordSet")
   rs.open sql,conn,1,1
   if rs.recordcount=0  then '判断是否存在该记录
   Response.Write("</br>")
   Response.Write("对不起,该记录不存在!!!")
   else
   dim m,readed,cur_page
   m=rs.recordcount
   readed=1
   rs.pagesize=10
%>
<%
      if not IsEmpty(Request.QueryString("page")) then 
          cur_page=Cint(Request.QueryString("page"))
	      if cur_page<1 then cur_page=1 end if
	      if cur_page>rs.pagecount then cur_page=rs.pagecount  end if
	  else
	      cur_page=1
	  end if
	  if not rs.eof then
	     rs.AbsolutePage=cur_page
	  else 
	     cur_page=1
	  end if 
%>
        <% 
		   select case jian
		   case "all"
		   biao="全部"
		   case "owner"
		   biao="住户名"
		   case "identify"
		   biao="身份证"
		   case "sex"
		   biao="性别"
		   case "room_id"
		   biao="房间号"
		   case "person"
		   biao="家庭人口"
		   case "room_size"
		   biao="房间大小"
		   case "car"
		   biao="汽车"
		   case "carrydate"
		   biao="迁入日期"
		   case "jianli"
		   biao="个人简历"
		   end select
		%>
		<h5><%= biao %>关键字为<%= keyword %>   查询结果:</h5>
			<table class="browser">
			  <tr>
  			    <th width="50" class="b1">ID</th>
				<th width="80">姓名</th>
				<th width="140">身份证号</th>
				<th width="110">房间号</th>
				<th width="65">详细查看</th>
			    <th width="48" class="b2">删除</th>
			  </tr>
<% 
   do while (readed<=rs.pagesize) and (not rs.eof) 
%>
			  <tr>
  			    <td class="b1"><%= rs(0) %></td>
			    <td><%= rs(7) %></td>
				<td><%= rs(8) %></td>
				<td><%= rs(1) %></td>
				<td><a href="muser_update.asp?id=<%= rs(0) %>">详细查看</a></td>
			    <td class="b2"><a href="del.asp?id=<%= rs(0) %>&tname=room" onClick="return del()">删除</a></td>
			  </tr>
<%
    rs.movenext
	readed=readed+1
	loop
%>
			</table>
   <div id="fanye">
     <p align="center"><a href="<%= vari %>&page=<%=cstr(1)%>">首页</a>---<a href="<%= vari %>&page=<%=cstr(cur_page+1)%>">下一页</a>--<a href="<%= vari %>&page=<%=cstr(cur_page-1)%>">上一页</a>---<a href="<%= vari %>&page=<%=cstr(rs.pagecount)%>">末页</a>---总共<strong><%=rs.pagecount%></strong> 页---页次<%= cstr(cur_page) %>/<%= cstr(rs.pagecount) %>--记录数(<%= m %>)</p>
   </div>
<% 
   end if
   rs.close
   set rs=nothing
   end if
%>
 <!-- 查询结果完	-->
	  </div>
	</div>
  <div id="rbody">
    <% call rightnav() %>
  </div>
</div>
<!--#include file="sub/cbottom.asp"-->
</body>
</html>

⌨️ 快捷键说明

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