?? 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 + -