📄 browseinfo.asp
字号:
<% @ language="vbscript" %>
<HTML>
<HEAD>
<TITLE>查询设备资料</TITLE>
</HEAD>
<BODY bgcolor="#aabbaa">
<%
if session("hy_id")="" then
response.redirect "1.htm"
end if
%>
<font color="red" face="幼圆">
<p><a href="vod1.asp">返回首页</a>|
<% if session("level")>1 then%>
<a href="editinfo.asp">修改资料</a>|
<a href="addinfo.asp">添加资料</a>|
<a href="deleteinfo.asp">删除资料</a>|
<% end if %></p>
<hr width="100%" noshade size="1" color="red">
</font>
<div align="center">
<table>
<form name="form1" method="post" action="browseinfo.asp">
<p><font color="#551155" size="4">设备查询:
<select size="1" name="1stfld">
<option selected value="all">全部显示</potion>
<option selected value="equ_department">所在部门</potion>
<option selected value="equ_data">购买日期</potion>
<option selected value="equ_id">设备编号</potion>
<option selected value="equ_name">设备名称</potion>
</select>
值:<input name="txtvalue" type="text" size="10">
<input name="btnsubmit" type="submit" value=" 查 询 "></font></p>
</form>
</table>
<%
dim cnn,rst,ssql,currentpage,rowcount,i
if request.form("btnsubmit")="" then
response.end
end if
currentpage=request.querystring("currentpage")
if currentpage="" then
currentpage=1
end if
set cnn=server.createobject("adodb.connection")
set rst= server.createobject("adodb.recordset")
connstr="provider=sqloledb;data source=(local);"&_
"uid=sa;pwd=0335;database=vod"
cnn.open connstr
psize=12
set rst=server.createobject("adodb.recordset")
field=trim(request.form("1stfld"))
value=trim(request.form("txtvalue"))
if field="all" then
ssql="select * from shebei order by equ_id"
end if
if field<>"all" and value="" then
response.redirect"browseinfo.asp"
end if
if field<>"all" and value<>"" then
ssql="select * from shebei where "&field&"='"&value&"' order by equ_id"
end if
rst.open ssql, cnn,1
if rst.recordcount=0 then
response.write"<p><font color=red>没有找到符合条件的记录!</font></p>"
else
rst.pagesize=cint(psize)
pagen=request.form("tempage")
if pagen="" then
pagen=1
end if
sa=request.form("coms")
if sa="上一页" then
pagen=pagen-1
elseif sa="下一页" then
pagen=pagen+1
elseif sa="确定" then
pagen=request.form("p")
end if
rst.absolutepage=pagen
response.write"<center>"
pagebegin=rst.pagesize*(pagen-1)+1
if rst.pagesize*pagen<rst.recordcount then
pagend=rst.pagesize*pagen
else
pagend=rst.recordcount
end if
total=rst.recordcount
%>
<table border="1" bgcolor="#bbdddd" width="80%">
<caption><b>查询结果:</b>共<%=rst.recordcount %>件设备
<tr>
<th width="200">设备号</th><th width="200">设备名称</th><th width="200">所属部门</th><th width="200">设备价格</th>
</tr>
<%
rowcount=0
while not rst.eof and rowcount<rst.pagesize %>
<tr>
<td><a href=detailinfo.asp?equ_id=<% =rst("equ_id") %>>
<% =rst("equ_id") %></a></td>
<td><% =rst("equ_name") %></td>
<td><% =rst("equ_department") %></td>
<td><% =rst("equ_value") %></td>
</tr>
<%
rowcount=rowcount+1
rst.movenext
wend
%>
</table>
<p>每页<% =rst.pagesize %>件设备
当前页次:<% =currentPage %>/<%=rst.pageCount %>页
<form method="post" action="browseinfo.asp"name="aaa">
<input type="hidden" name="tempage" value="<%=pagen%>">
<%response.write"<br><p></p>"
if pagen>1 then
response.write"<input type=submit name='coms' value='上一页'>"
end if
if pagen<> total then
response.write"<input type=submit name='coms' value='下一页'>"
end if
response.write"<br><p></p>"
response.write"显示第<input type=text name='p' size=5>页"
response.write"<input type=submit name='coms' value=' 确 定 '>"
response.write"</form>"
end if
%>
</form><div></div>
</p></div>
</body></html>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -