gusucode.com > asp+SQLServer网上书店系统设计(源代码+论文) > asp+SQLServer网上书店系统设计(源代码+论文)\网上书店asp+SQLServer\网上书店\eshop1.asp
<%@ LANGUAGE="VBSCRIPT" %> <!--#include file="util.asp" --> <!--#include file="conn.asp" --> <% bookList = Session("bookList") books = Split(Request("cpbm"), ", ") For I=0 To UBound(books) PutToShopBag books(I), bookList Next Session("bookList") = bookList Head="以下是您所选购的书籍清单" bookList = Session("bookList") If Len(bookList) =0 Then Response.Redirect "nothing.asp" response.end end if If Request("MySelf") = "Yes" Then bookList = "" books = Split(Request("cpbm"), ", ") For I=0 To UBound(books) PutToShopBag books(I), bookList Next Session("bookList") = bookList End If If Len(bookList) = 0 Then Response.Redirect "nothing.asp" response.end end if set rs=server.createobject("adodb.recordset") sql = "Select * From book" sql = sql & " Where ID In (" & bookList & ")" rs.open sql,cn,3,3 %> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312"> <title>以下是您所选购的书籍清单</title> <href="style.css"> <link rel="stylesheet" type="text/css" href="style.css"> </head> <script language="Javascript"> //函数名:fucCheckNUM //功能介绍:检查是否为数字 //参数说明:要检查的数字 //返回值:1为是数字,0为不是数字 function fucCheckNUM(NUM) { var i,j,strTemp; strTemp="0123456789"; if ( NUM.length== 0) return 0 for (i=0;i<NUM.length;i++) { j=strTemp.indexOf(NUM.charAt(i)); if (j==-1) { //说明有字符不是数字 return 0; } } //说明是数字 return 1; } function clean() { window.location.href="clear.asp" } </script> <body topmargin="5"> <center> <div align="center"> <center> <table width="80%" border="0" cellspacing="0"> <tr> <td width="80%" valign="top"><p align="center"> </p> <p align="center"> <font color="#FF0000" ><%=Head%></font></p> <!--webbot BOT="GeneratedScript" PREVIEW=" " startspan --><script Language="JavaScript"><!-- function FrontPage_Form1_Validator(theForm) { var checkOK = "0123456789-"; var checkStr = theForm.<%="Q_" & rs("ID")%>.value; var allValid = true; var decPoints = 0; var allNum = ""; for (i = 0; i < checkStr.length; i++) { ch = checkStr.charAt(i); for (j = 0; j < checkOK.length; j++) if (ch == checkOK.charAt(j)) break; if (j == checkOK.length) { allValid = false; break; } allNum += ch; } if (!allValid) { alert("在 请输入正确的书籍数量! 域中,只能输入 数字 个字符。"); theForm.<%="Q_" & rs("ID")%>.focus(); return (false); } return (true); } //--></script><!--webbot BOT="GeneratedScript" endspan --><form Action="eshop1.asp" Method="POST" onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1"> <input type="hidden" name="MySelf" value="Yes"> <div align="center"><center> <table border="0" cellspacing="1" width="550" class=main bgcolor="#000000"> <tr bgcolor="#006699"> <td align="center" width="82" height="22" bgcolor="#006699"><font color="#EEEEEE">编号</font></td> <td align="center" width="170" height="22" bgcolor="#006699"><font color="#EEEEEE">书名</font></td> <td align="center" width="76" height="22" bgcolor="#006699"><font color="#EEEEEE">价格</font></td> <td align="center" width="76" height="22" bgcolor="#006699"><font color="#EEEEEE">数量</font></td> <td align="center" width="60" height="22" bgcolor="#006699"><font color="#EEEEEE">购买</font></td> <td align="center" width="72" height="22" bgcolor="#006699"><font color="#EEEEEE">总价</font></td> </tr> <% Sum = 0 While Not rs.EOF Quatity = CInt( Request( "Q_" & rs("ID")) ) If Quatity <= 0 Then Quatity = CInt( Session(rs("ID")) ) If Quatity <= 0 Then Quatity = 1 End If Session(rs("ID")) = Quatity Sum = Sum + ccur(rs("book_price2")) * Quatity %> <tr> <td align="center" width="82" bgcolor="#EEEEEE"><%=rs("ID")%> </td> <td align="center" width="170" bgcolor="#EEEEEE"><%=rs("book_Name")%> </td> <td align="center" width="76" bgcolor="#EEEEEE"><%=rs("book_price2")%> </td> <td align="center" width="76" bgcolor="#EEEEEE"><!--webbot bot="Validation" S-Display-Name="请输入正确的商品数量!" S-Data-Type="Integer" S-Number-Separators="x" --><input Name="<%="Q_" & rs("ID")%>" Value="<%=Quatity%>" Size="3"></td> <td Align="center" width="60" bgcolor="#EEEEEE"><input Type="CheckBox" Name="cpbm" Value="<%=rs("ID")%>" Checked> </td> <td Align="center" width="72" bgcolor="#EEEEEE"><%=ccur(rs("book_price2"))*Quatity%>.00元 </td> </tr> <% rs.MoveNext Wend %> <tr> <td Align="Right" ColSpan="6" width="546" bgcolor="#EEEEEE"><font Color="Red">总价格=人民币 <%=Sum%>.00元</font></td> </tr> </table> </center></div><blockquote> <p align="center"> <input Type="submit" Value="更改数量" name="B1" style="font-size: 9pt"> <input type="button" value="继续购物" name="B2" onclick="window.close();" style="font-size: 9pt"> <input type="button" value="订单取消" name="B3" OnClick="clean()" style="font-size: 9pt"> <input type="button" value="去收银台" onClick="window.open('blank.asp',window.close(), 'Sample', 'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=610,height=600,left=100,top=100')" name="b4"> <p align="center"><font color="#FF0000">注意:改变“商品数量需按“更改数量”</font> </blockquote> </form> </center> </td></tr></table> </center> </div> <% rs.close cn.close %> </body> </html>