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

📄 search_admin.asp

📁 倉庫管理繫統源碼,具有添加,查看,搜索,删除等功能
💻 ASP
字号:
<!--#include file="conn.inc"-->
<%
if request.cookies("admin")="" then
	response.redirect("index.asp")
elseif request.form("txtkey")="" then%>
	<script>alert("关键词不能为空");</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>搜索结果</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">  --&gt;&gt;&gt; 欢迎 <font color="#006600"><%=rs1("username")%></font> 
      登陆,部门:<font color="#006600"><%=rs1("department")%></font> 职务:<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">退出系统</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">产品名称</font></td>
    <td width="78"><font color="#FF0000">库存数量</font></td>
    <td width="83"><font color="#FF0000">单价</font></td>
    <td width="199"><font color="#FF0000">生产厂家</font></td>
    <td width="67"><font color="#FF0000">入库日期</font></td>
    <td width="116"><font color="#FF0000">最后更新时间</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>

⌨️ 快捷键说明

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