📄 searchlook.asp
字号:
<!--#include file="conn.asp"-->
<%
dim key
dim biao
key=Request("key")
biao=Request("biao")
%>
<%
Select case biao
case "车主姓名"
biao="车主姓名"
case "违法车辆"
biao="违法车辆"
case "违法车型"
biao="违法车型"
case "违法时间"
biao="违法时间"
case "违法地点"
biao="违法地点"
case "违法情况"
biao="违法情况"
case "操作员"
biao="操作员"
case Else
Response.Redirect("index.asp")
End Select
%>
<%If key<>"" and biao<>"" Then%>
<%
dim i,intPage,page,pre,last,filepath
set rs = server.CreateObject("adodb.recordset")
sql = "SELECT * FROM 违法车辆 where "+biao+" like '%"+key+"%' order by ID desc"
rs.PageSize = 20 //(HacKpp:这里设定每页显示的记录数
rs.CursorLocation = 3
rs.Open sql,conn,0,2,1 //(HacKpp:'这里执行你查询SQL并获得结果记录集
pre = true
last = true
page = trim(Request.QueryString("page"))
if len(page) = 0 then
intpage = 1
pre = false
else
if cint(page) =< 1 then
intpage = 1
pre = false
else
if cint(page) >= rs.PageCount then
intpage = rs.PageCount
last = false
else
intpage = cint(page)
end if
end if
end if
if not rs.eof then
rs.AbsolutePage = intpage
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="css.css">
<title>车辆违法查询系统</title>
<script language="JavaScript">
<!--
function checkdata() {
if( form.key.value =="") {
alert("\请输入有效的搜索关键字")
return false;
}
return true;
}
function isNumberString (InString,RefString)
{
if(InString.length==0) return (false);
for (Count=0; Count < InString.length; Count++) {
TempChar= InString.substring (Count, Count+1);
if (RefString.indexOf (TempChar, 0)==-1)
return (false);
}
return (true);
}
// -->
</script>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
</head>
<body bgcolor="#006699" leftmargin="0" topmargin="0">
<!--#include file="Head.asp"-->
<br>
<table width="776" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td width="16%" rowspan="3" align="center" valign="top"><table width="99%" border="1" align="center" cellpadding="3" cellspacing="1" bordercolor="#7C96B8" bordercolordark="#FFFFFF">
<tr>
<td height="200" align="center">交通<br>
警句</td>
</tr>
</table></td>
<td height="20" colspan="2" align="center"><table width="98%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td>您现在的位置:<a href="Index.asp"><font color="#336699">首页</font></a> >> 搜索结果</td>
</tr>
</table></td>
</tr>
<tr>
<td width="64%" align="center" valign="top"><table border="1" cellspacing="1" cellpadding="3" width="97%" align="center" bordercolor="#7C96B8" bordercolordark="#FFFFFF">
<form method="POST" action="searchlook.asp" name=form onSubmit="return checkdata()">
<tr>
<td width="600" align="center"><font color="#336699">车辆违法查询</font>:
<select name="biao">
<option selected>违法车辆</option>
<option>车主姓名</option>
<option>违法车型</option>
<option>违法时间</option>
<option>违法地点</option>
<option>违法情况</option>
</select>
关键字:
<input name="key" type="text" size="18">
<input type="submit" value="提交" name="B12">
<input type="reset" value="重写" name="B22">
</td>
</tr>
</form>
</table></td>
<td width="20%" align="center" valign="top"><font color="#336699">[ <a href="Login.asp"><font color="#336699">管理员登陆</font></a> ]<br>
<%=now()%></font></td>
</tr>
<tr>
<td colspan="2" align="center" valign="top">
<table width="98%" height="25" border="1" align="center" cellpadding="3" cellspacing="1" bordercolor="#7B96BD" bordercolordark="#FFFFFF">
<TR>
<td colspan="10" height="20" bgcolor="#7C96B8">
<div align="center"><font color="#FFFFFF">车辆违法情况搜索列表</font></div></td>
</TR>
<tr align="center">
<TD><font color="#336699">登记号</font></TD>
<td><font color="#336699">车主姓名</font></td>
<td><font color="#336699">违法车辆</font></td>
<td><font color="#336699">违法车型</font></td>
<td><font color="#336699">违法时间</font></td>
<td><font color="#336699">违法地点</font></td>
<td><font color="#336699">违法情况</font></td>
<td><font color="#336699">操作员</font></td>
</tr>
<%
for i=1 to rs.PageSize
if rs.EOF or rs.BOF then exit for
%>
<tr align=center>
<td><%=rs("ID")%></td>
<td> <%=rs("车主姓名")%></td>
<td> <%=rs("违法车辆")%></td>
<td> <%=rs("违法车型")%> </td>
<td> <%=rs("违法时间")%> </td>
<td> <%=rs("违法地点")%></td>
<td> <%=rs("违法情况")%> </td>
<td><%=rs("操作员")%></td>
</tr>
<%
rs.movenext
next
%>
</table>
<table width="98%" border="0" cellpadding="3" cellspacing="1" borderColorLight=#808080 borderColorDark=#ffffff>
<tr>
<%if rs.pagecount > 0 then%>
<td width="13%" align="left">当前页<%=intpage%>/<%=rs.PageCount%></td>
<%else%>
<td width="40%" align="left">当前页0/0</td><%end if%>
<td width="47%" align="right"> <a href="searchlook.asp?page=1">首页</a>|
<%if pre then%>
<a href="searchlook.asp?page=<%=intpage -1%>">上页</a>| <%end if%>
<%if last then%>
<a href="searchlook.asp?page=<%=intpage +1%>">下页</a> |<%end if%>
<a href="searchlook.asp?page=<%=rs.PageCount%>">尾页</a>|转到第
<select name="sel_page" onchange="javascript:location=this.options[this.selectedIndex].value;">
<%
for i = 1 to rs.PageCount
if i = intpage then%>
<option value="searchlook.asp?page=<%=i%>" selected><%=i%></option>
<%else%>
<option value="searchlook.asp?page=<%=i%>"><%=i%></option>
<%
end if
next
%>
</select>页</font>
</td>
</tr>
</table>
</td>
</tr>
</table>
<br>
<!--#include file="foot.asp"-->
</body>
</html>
<%
Else
response.Write "错误的请求"
end if%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -