?? search_admin.asp
字號(hào):
<!--#include file="conn.inc"-->
<%
if request.cookies("admin")="" then
response.redirect("index.asp")
elseif request.form("txtkey")="" then%>
<script>alert("關(guān)鍵詞不能為空");</script>
<%end if%>
<%
dim rs1,sql1
set rs1=server.createobject("adodb.recordset")
sql1="select * from user_info where username='"&request.cookies("admin")&"'"
rs1.open sql1,conn,1,1
%>
<html>
<head>
<title>搜索結(jié)果</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="css.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="760" height="55" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#006600">
<tr>
<td height="25" bgcolor="#FFFFFF" class="12"> -->>> 歡迎 <font color="#006600"><%=rs1("username")%></font>
登陸,部門:<font color="#006600"><%=rs1("department")%></font> 職務(wù):<font color="#006600"><%=rs1("job")%></font> [<a href="#" onclick="javascript:window.open('edit_password.asp','','width=450,height=150,top=300,left=300,scrollbars=yes')">修改登陸密碼</a>] [<a href="logout.asp">退出系統(tǒng)</a>]</td>
</tr>
<tr>
<td bgcolor="#FFFFFF" class="12"> 您可以:[<a href="ck_sys_admin.asp?action=add">添加庫存信息</a>]</td>
</tr>
</table>
<br>
<br>
<table width="760" height="54" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FF6600" class="12">
<tr align="center" bgcolor="#FFFFFF">
<td width="139" height="22" ><font color="#FF0000">產(chǎn)品名稱</font></td>
<td width="78"><font color="#FF0000">庫存數(shù)量</font></td>
<td width="83"><font color="#FF0000">單價(jià)</font></td>
<td width="199"><font color="#FF0000">生產(chǎn)廠家</font></td>
<td width="67"><font color="#FF0000">入庫日期</font></td>
<td width="116"><font color="#FF0000">最后更新時(shí)間</font></td>
<td width="35">編輯</td>
<td width="34">刪除</td>
</tr>
<%dim rs,sql
set rs=server.createobject("adodb.recordset")
sql="select * from ck where prod_name like '%"& request.form("txtkey") &"%'"
rs.open sql,conn,1,1
dim total_record,currentpage
const MaxPerpage=20
total_record=rs.recordcount
currentpage=request("page")
if currentpage<1 then
currentpage=1
end if
if currentpage=1 then
show_content
show_page total_record,Maxperpage
else
rs.move (currentpage-1)*Maxperpage
dim bookmark
bookmark=rs.bookmark
show_content
show_page total_record,Maxperpage
end if
%>
<%sub show_content
dim i
i=0
do while not rs.eof
%>
<tr bgcolor="#FFFFFF">
<td height="29" > <%=rs("prod_name")%></td>
<td align="center"><%=rs("prod_num")%></td>
<td align="center">¥<%=FormatNumber(rs("prod_price"),2)%></td>
<td> <%=rs("prod_com")%></td>
<td align="center"><%=rs("add_date")%> </td>
<td align="center"><font color="#006600"><%=rs("update_time")%></font></td>
<td align="center"><a href="ck_sys_admin.asp?action=edit&id=<%=rs("id")%>"><img src="image/edit.gif" width="16" height="16" border="0"></a></td>
<td align="center"><a href="ck_sys_admin.asp?action=del&id=<%=rs("id")%>"><img src="image/del.gif" width="16" height="16" border="0"></a></td>
</tr>
<%
i=i+1
if i>=Maxperpage then exit do
rs.movenext
loop
rs.close
%>
<%end sub%>
</table>
<br>
<%sub show_page(total_record,Maxperpage)
dim file_url'文件名
file_url="search_admin.asp"
dim total_page
if total_record mod Maxperpage=0 then
total_page=total_record \ Maxperpage
else
total_page=total_record \ Maxperpage+1
end if
%>
<p></p>
<table width="439" height="36" border="0" align="center" class="12">
<tr>
<td width="141"><table width="141" border="0" cellspacing="1" class="12">
<tr>
<td class="12">
<%if currentpage<2 then%>
第一頁
<%else%>
<a href='<%=file_url%>?id=<%=id%>&page=1' class="link"><font color="#FF0000">第一頁</font></a>
<%end if%>
</td>
<td>
<%if currentpage<2 then%>
<span class="12">上一頁
<%else%>
<a href='<%=file_url%>?id=<%=id%>&page=<%=currentpage-1%>'><font color="#FF0000">上一頁</font></a></span></td>
<%end if%>
</tr>
</table></td>
<td width="125"><div align="justify"><font color="#FF0000"> <span class="12">共</span></font><span class="12"><%=total_record%><font color="#FF0000">條</font>
<font color="#FF0000">共分</font><%=total_page%><font color="#FF0000">頁</font> </span></div></td>
<td width="159"><table width="159" border="0" cellpadding="0" cellspacing="1" class="12">
<tr>
<td width="73">
<%if total_page-currentpage<1 then%>
<span class="12">下一頁
<%else%>
<a href='<%=file_url%>?id=<%=id%>&page=<%=currentpage+1%>' class="12"><font color="#FF0000">下一頁</font></a>
<%end if%>
</span></td>
<td width="59">
<%if total_page-currentpage<1 then%>
<span class="12"> 最后一頁
<%else%>
<a href='<%=file_url%>?id=<%=id%>&page=<%=total_page%>' class="12"><font color="#FF0000">最后一頁</font></a>
<%end if%>
</span></td>
</tr>
</table></td>
</tr>
</table>
<%end sub%>
<br>
<br>
</body>
</html>
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號(hào)
Ctrl + =
減小字號(hào)
Ctrl + -