www.gusucode.com > asp+SQLServer网上书店系统设计(源代码+论文) > asp+SQLServer网上书店系统设计(源代码+论文)\网上书店asp+SQLServer\网上书店\displayorderlist.asp
<!--#include file="conn.asp" --> <% set rs=server.createobject("adodb.recordset") order_id=Trim(Request("order_id")) user_name=session("user") method=Trim(Request("reserch_method")) if method=2 then sqltext="select * from orderlist " sqltext=sqltext &" where order_id ='"&order_id&"'and user_name='"&user_name&"'" rs.open sqltext,cn,1,1 else if user_name<>order_id then Response.redirect "login2.asp?msg=对不起你不能查看别人的订单!" end if sqltext="select * from orderlist " sqltext=sqltext &" where user_name='"&order_id&"'" rs.open sqltext,cn,1,1 end if if rs.Eof then Response.redirect "login2.asp?msg=没有此订单,请确认输入是否正确!" else dim MaxPerPage MaxPerPage=3 '取得页数,并判断用户输入的是否数字类型的数据,如不是将以第一页显示 dim text,checkpage text="0123456789" Rs.PageSize=MaxPerPage for i=1 to len(request("page")) checkpage=instr(1,text,mid(request("page"),i,1)) if checkpage=0 then exit for end if next If checkpage<>0 then If NOT IsEmpty(request("page")) Then CurrentPage=Cint(request("page")) If CurrentPage < 1 Then CurrentPage = 1 end if If CurrentPage > Rs.PageCount Then CurrentPage = Rs.PageCount end if Else CurrentPage= 1 End If If not Rs.eof Then Rs.AbsolutePage = CurrentPage end if Else CurrentPage=1 End if %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <meta name="GENERATOR" content="Microsoft FrontPage 4.0"> <meta name="ProgId" content="FrontPage.Editor.Document"> <title>显示所有书籍</title> <href="style.css"> <link rel="stylesheet" type="text/css" href="style.css"> </head> <body> <center> <div align="center"> <table border="0" cellpadding="0" cellspacing="0" width="600" height="92" > <tr> <td width="100%" height="70"> <div align="center"> <table border="0" cellpadding="0" cellspacing="0" width="100%" height="148" > <tr><td valign="top"> <div align="center"> <table border="0" cellspacing="1" width="100%" bordercolorlight="#006699" bordercolordark="#FFFFFF" height="55" bgcolor="#000000"> <tr> <td width="15%" align="center" bgcolor="#006699" height="23"><font color="#FFFFFF">订单号</font></td> <td width="15%" align="center" bgcolor="#006699" height="23"><font color="#FFFFFF">收货人</font></td> <td width="25%" align="center" bgcolor="#006699" height="23"><font color="#FFFFFF">收货地址</font></td> <td width="15%" align="center" bgcolor="#006699" height="23"><font color="#FFFFFF">订单处理情况</font></td> <td width="15%" align="center" bgcolor="#006699" height="23"><font color="#FFFFFF">下订日期</font></td> <td width="15%" align="center" bgcolor="#006699" height="23"><font color="#FFFFFF">付款方式</font></td> </tr> <% row_count=1 Sub list()%> <%i=0 Do While Not rs.EOF%> <tr> <td width="15%" align="center" height="23" bgcolor="#EEEEEE"><%=rs("order_id")%></td> <td width="15%" align="center" height="23" bgcolor="#EEEEEE" ><%=rs("enbracer")%></td> <td width="25%" align="center" height="23" bgcolor="#EEEEEE"><%=rs("Address")%></td> <td width="15%" align="center" height="23" bgcolor="#EEEEEE"><%=rs("flag")%></td> <td width="15%" align="center" height="23" bgcolor="#EEEEEE"><%=rs("order_date")%></td> <td width="15%" align="center" height="23" bgcolor="#EEEEEE"><%=rs("pay_method")%></td> </tr> <% i=i+1 if i >= MaxPerpage then exit do rs.MoveNext Loop end Sub %> <% call list If Rs.recordcount > MaxPerPage then call showpages end if%> </table> </div> </td></tr> </table> </div> </td> </tr> </table> </div> <% '显示翻页的子程序 sub showpages()%> <table bgColor="#f8e8a0" border="0" cellPadding="0" cellSpacing="0" width="400" > <tr><td > <form method="POST" action="displayorderlist.asp"> <input type="hidden" name="order_id" value="<%=order_id%>"> <input type="hidden" name="reserch_method" value="<%=method%>"> <table bgColor="#006699" border="0" cellPadding="0" cellSpacing="0" width="583" height="30"> <tr> <td bgcolor="#eeeeee" width="510"> <font color="#000000"> <p align="center"> <% Response.write "<font color='#000000'>页次:</font>" & "<font color=#FF0000>" & Cstr(CurrentPage) & "</font>" & "<font color='#000000'>/" & Cstr(rs.pagecount) & "</font> " Response.write "<font color=#ff0000>" & Cstr(MaxPerPage) & "</font>" & "<font color='#000000'>张订单/页 " & "共</font>" & "<font color=#FF0000>" & Cstr(Rs.RecordCount) & "</font>" & "<font color='#000000'>张订单</font> " response.write "</td><td align='right'>" response.write "<font color='#000000' >到:</font><input type='text' name='page' size=2 maxlength=3 class=smallInput value="&Currentpage&"> " response.write "<input class=buttonface type='submit' value='Go' name='cndok' style='background-color: #eeeeee'></span>" %> </font> </td> </tr> </table> </center> </td></tr> </table> </form> <%end sub%> <%end if%> </body> </html>