📄 ck_sys.asp
字号:
<!--#include file="conn.inc"-->
<%
if request.cookies("user")="" then'判断是否正常登录,如果没有正常登录则退回登录页面
response.redirect("index.asp")
end if
dim rs1,sql1
set rs1=server.createobject("adodb.recordset")'创建记录集对象
sql1="select * from user_info where username='"&request.cookies("user")&"'"'查询登录用户信息SQL语句
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>
<br>
<table width="760" height="30" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#006600">
<tr>
<td bgcolor="#FFFFFF" class="12"> -->>> 欢迎 <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>
</table>
<form name="form1" method="post" action="search.asp">
<table width="461" height="30" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#333333" class="12">
<tr>
<td bgcolor="#FFFFFF"> <img src="image/search.gif" width="15" height="15" align="bottom"> 请输入产品关键字:
<input name="txtkey" type="text" class="txt" id="txtkey" size="25">
<input name="Submit" type="submit" class="button" value="搜索"></td>
</tr>
</table>
</form>
<table width="760" border="0" align="center">
<tr>
<td class="12"><div align="right">[<a href="ck_sys.asp">刷新库存信息</a>]</div></td>
</tr>
</table>
<table width="760" height="54" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#FF6600" class="12">
<tr align="center" bgcolor="#FFFFFF">
<td width="149" height="22" ><font color="#FF0000">产品名称</font></td>
<td width="84"><font color="#FF0000">库存数量</font></td>
<td width="89"><font color="#FF0000">单价</font></td>
<td width="226"><font color="#FF0000">生产厂家</font></td>
<td width="69"><font color="#FF0000">入库日期</font></td>
<td width="136"><font color="#FF0000">最后更新时间</font></td>
</tr>
<%dim rs,sql
set rs=server.createobject("adodb.recordset")'创建记录集对象
sql="select * from ck order by update_time desc"'选取仓库表中的所有记录,按降序排序
rs.open sql,conn,1,1
'分页代码部分
dim total_record,currentpage
const MaxPerpage=10'每页显示最大记录条数
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>
</tr>
<%
i=i+1
if i>=Maxperpage then exit do'如果超出每页最大显示条数 则退出SUB
rs.movenext
loop
%>
<%end sub%>
</table>
<br>
<%sub show_page(total_record,Maxperpage)'翻页菜单过程定义
dim file_url'文件名
file_url="ck_sys.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%>
</body>
</html>
<script>
function MM_openBrWindow(theURL,winName,features)
{ //用于弹出页面函数
window.open(theURL,winName,features);
}
</script>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -