?? checkbuy.asp
字號:
<%
if session("username")="" or session("password")="" then
session.timeout=5
response.write "<script language='javascript'>"
response.write "alert('賬號或密碼錯誤!');"
response.write "history.go(-1);"
response.write "</script>"
response.end
else
username=session("username")
end if
%>
<!--#include file="../conn.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>當前顧客定單</title>
<meta name="GENERATOR" content="Microsoft FrontPage 5.0">
<link rel="stylesheet" type="text/css" href="../css.css">
</head>
<SCRIPT>
<!--
function openwindow(url) {
window.open(url,'new','toolbar=no,scrollbars=yes,width=200,height=120');
}
//-->
</SCRIPT>
<%
const MaxPerPage=10
dim totalPut
dim CurrentPage
dim TotalPages
dim i,j
if not isempty(request("page")) then
currentPage=cint(request("page"))
else
currentPage=1
end if
%>
<body bgcolor="#7bb5de">
<div align="center">
<table width="47%" border="0" height="240">
<tr>
<td align="center" height="27"><font color="#000000" style="font-size: 14px"><strong><font size="3">當前顧客定單</font></strong></font>
</td>
</tr>
<tr>
<td valign="top" height="156">
<%
dim sql
dim rs
sql="select * from buy where jshname='"&username&"'"
Set rs= Server.CreateObject("ADODB.Recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<p align='center'> 還 沒 有 顧 客 定 單 !</p>"
else
totalPut=rs.recordcount
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showpage totalput,MaxPerPage,"down1.asp"
showContent
showpage totalput,MaxPerPage,"down1.asp"
else
if (currentPage-1)*MaxPerPage<totalPut then
rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showpage totalput,MaxPerPage,"down1.asp"
showContent
showpage totalput,MaxPerPage,"down1.asp"
else
currentPage=1
showpage totalput,MaxPerPage,"down1.asp"
showContent
showpage totalput,MaxPerPage,"down1.asp"
end if
end if
rs.close
end if
set rs=nothing
conn.close
set conn=nothing
sub showContent
dim i
i=0
%>
<table width="464" border="1" bordercolor="#6699FF" height="101" cellspacing="0" cellpadding="0">
<tr>
<td height="136">
<table border="0" cellspacing="0" width="741" style="border-collapse: collapse" bordercolor="#F6F6EC" cellpadding="0" height="73">
<tr bgcolor="#6699FF">
<td colspan="5" align="center" height="5"> </td>
</tr>
<tr>
<td width="96" align="center" height="28"> <font color="#BB0000" face="Arial"><strong>ID</strong></font></td>
<td width="87" align="center" height="28"> <font color="#BB0000"><strong>顧客名</strong></font></td>
<td width="140" align="center" height="28">
<div align="center"><b><font color="#BB0000" face="Arial">E-mail</font></b></div>
</td>
<td width="86" align="center" height="28">
<div align="center"><b><font color="#BB0000" face="Arial">QQ</font></b></div>
</td>
<td width="332" align="center" height="28">
<div align="center"><font color="#BB0000"><b>地址</b></font></div>
</td>
</tr>
<%do while not rs.eof%>
<tr>
<td valign="top" height="23" width="96">
<p align="center"><%=rs("id")%>
</td>
<td valign="top" width="87">
<p align="center"><%=rs("bname")%>
</td>
<td valign="top" align="center" width="140">
<div align="center"><%=rs("bemail")%></div>
</td>
<td valign="top" align="center" width="86">
<div align="center"><%=rs("bqq")%></div>
</td>
<td valign="top" align="center" width="332">
<div align="center"><%=rs("baddress")%></div>
</td>
</tr>
<tr>
<td align="center" height="23" width="96"> <font color="#BB0000"><b>訂購的產品:</b></font></td>
<td width="87"><font color="#BB0000"></font></td>
<td valign="top" align="center" width="140"> </td>
<td valign="top" align="center" width="86"> </td>
<td valign="top" align="center" width="332"> </td>
</tr>
<tr align="center">
<td height="23" colspan="5"><%=rs("bly")%></td>
</tr>
<tr align="center" bgcolor="#6699FF">
<td height="2" colspan="5"> </td>
</tr>
<% i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
</table>
</td>
</tr>
</table>
<%
end sub
function showpage(totalnumber,maxperpage,filename)
dim n
if totalnumber mod maxperpage=0 then
n= totalnumber \ maxperpage
else
n= totalnumber \ maxperpage+1
end if
response.write "<form method=Post action="&filename&">"
response.write "<p align='center'>>>分頁 "
if CurrentPage<2 then
response.write "<font color='999966'>首頁 上一頁</font> "
else
response.write "<a href="&filename&"?page=1&>首頁</a> "
response.write "<a href="&filename&"?page="&CurrentPage-1&">上一頁</a> "
end if
if n-currentpage<1 then
response.write "<font color='999966'>下一頁 尾頁</font>"
else
response.write "<a href="&filename&"?page="&(CurrentPage+1)
response.write ">下一頁</a> <a href="&filename&"?page="&n&">尾頁</a>"
end if
response.write " 頁次:<strong><font color=red>"&CurrentPage&"</font>/"&n&"</strong>頁 "
response.write " 共<b>"&totalnumber&"</b>條 <b>"&maxperpage&"</b>條/頁 "
response.write " 轉到:<input type='text' name='page' size=4 maxlength=10 class=smallInput value="¤tpage&">"
response.write "<input class=buttonface type='submit' value=' Goto ' name='cndok'></span></p></form>"
end function
%>
</td>
</tr>
</table>
</div>
</body>
</html>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -