En_Eshop.asp
Upload User: ahxunteng
Upload Date: 2022-05-16
Package Size: 1606k
Code Size: 6k
Development Platform:

VBScript

  1. <!--#include file="../Inc/Conn.asp" -->
  2. <%
  3. Sub PutToShopBag( cpbm, ProductList )
  4. If Len(ProductList) = 0 Then
  5. ProductList = "'" & cpbm & "'"
  6. ElseIf InStr( ProductList, cpbm ) <= 0 Then
  7. ProductList = ProductList & ", '" & cpbm & "'"
  8. End If
  9. End Sub
  10. ProductList = Session("ProductList")
  11. Products = Split(Request("cpbm"), ", ")
  12. For I=0 To UBound(Products)
  13. PutToShopBag Products(I), ProductList
  14. Next
  15. Session("ProductList") = ProductList
  16. Head="The following is a products inventory that you choose" '以下是您所选购的产品清单
  17. ProductList = Session("ProductList")
  18. If Len(ProductList) =0 Then
  19. Response.Redirect "En_Product.asp"
  20. response.end
  21. end if
  22. If Request("MySelf") = "Yes" Then
  23. ProductList = ""
  24. Products = Split(Request("cpbm"), ", ")
  25. For I=0 To UBound(Products)
  26. PutToShopBag Products(I), ProductList
  27. Next
  28. Session("ProductList") = ProductList
  29. End If
  30. If Len(ProductList) = 0 Then
  31. Response.Redirect "En_Product.asp"
  32. response.end
  33. end if
  34. set rs=server.createobject("adodb.recordset")
  35. sql = "Select * from Product"
  36. sql = sql & " Where Product_Id In (" & ProductList & ")"
  37. rs.open sql,conn,3,3
  38. %>
  39. <html>
  40. <head>
  41. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  42. <title>The following is a products inventory that you choose</title>
  43. <link href="../Inc/Css.css" rel="stylesheet" type="text/css">
  44. </head>
  45. <script language="Javascript">
  46. //函数名:fucCheckNUM
  47. //功能介绍:检查是否为数字
  48. //参数说明:要检查的数字
  49. //返回值:1为是数字,0为不是数字
  50. function fucCheckNUM(NUM)
  51. {
  52. var i,j,strTemp;
  53. strTemp="0123456789";
  54. if ( NUM.length== 0)
  55. return 0
  56. for (i=0;i<NUM.length;i++)
  57. {
  58. j=strTemp.indexOf(NUM.charAt(i));
  59. if (j==-1)
  60. {
  61. //说明有字符不是数字
  62. return 0;
  63. }
  64. }
  65. //说明是数字
  66. return 1;
  67. }
  68. function clean()
  69. {
  70. window.location.href="En_clear.asp"
  71. }
  72. </script>
  73. <body bgcolor="#D9D9D9" leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
  74. <div align="center"> <br>
  75.   <table width="80%" border="0" align="center" cellspacing="0">
  76.     <tr>
  77. <td width="80%" valign="top"><p align="center">
  78. </p>
  79. <p align="center">
  80. <font color="#0000FF" ><%=Head%></font></p>
  81. <script Language="JavaScript"><!--
  82. function FrontPage_Form1_Validator(theForm)
  83. {
  84.   var checkOK = "0123456789-";
  85.   var checkStr = theForm.<%="Q_" & rs("Product_Id")%>.value;
  86.   var allValid = true;
  87.   var decPoints = 0;
  88.   var allNum = "";
  89.   for (i = 0;  i < checkStr.length;  i++)
  90.   {
  91.     ch = checkStr.charAt(i);
  92.     for (j = 0;  j < checkOK.length;  j++)
  93.       if (ch == checkOK.charAt(j))
  94.         break;
  95.     if (j == checkOK.length)
  96.     {
  97.       allValid = false;
  98.       break;
  99.     }
  100.     allNum += ch;
  101.   }
  102.   if (!allValid)
  103.   {
  104.     alert("In please input the correct quantity of product! Inside the country,can only input digit piece character."); //在 请输入正确的产品数量! 域中,只能输入 数字 个字符
  105.     theForm.<%="Q_" & rs("Product_Id")%>.focus();
  106.     return (false);
  107.   }
  108.   return (true);
  109. }
  110. //-->
  111. </script>
  112. <form Action="En_Eshop.asp" Method="POST" onsubmit="return FrontPage_Form1_Validator(this)" name="FrontPage_Form1">
  113.           <input type="hidden" name="MySelf" value="Yes">
  114.           <div align="center"><center>
  115.               <table border="0" cellspacing="1" width="100%"  cellpadding="0" bgcolor="#666666">
  116.                 <tr> 
  117.                   <td align="center" width="132"  height="22" bgcolor="#999999"><font color="#FFFFFF">ProductID</font></td>
  118.                   <td align="center" width="421"  height="22" bgcolor="#999999"><font color="#FFFFFF">ProductName</font></td>
  119.                   <td align="center" width="128" height="22" bgcolor="#999999"><font color="#FFFFFF">ProductQuantity</font></td>
  120.                   <td align="center" width="119"  height="22" bgcolor="#999999"><font color="#FFFFFF">Purchase</font></td>
  121.                 </tr>
  122.                 <%
  123. Sum = 0
  124. While Not rs.EOF
  125. Quatity = CInt( Request( "Q_" & rs("Product_Id")) )
  126. If Quatity <= 0 Then
  127. Quatity = CInt( Session(rs("Product_Id")) )
  128. If Quatity <= 0 Then Quatity = 1
  129. End If
  130. Session(rs("Product_Id")) = Quatity
  131. Sum = Sum + ccur(rs("P_NewPrice")) * Quatity
  132. %>
  133.                 <tr> 
  134.                   <td align="center" width="132" bgcolor="#F0FCFF"><%=rs("Product_Id")%> 
  135.                   </td>
  136.                   <td align="center" width="421" bgcolor="#F0FCFF"><%=rs("EnTitle")%> 
  137.                   </td>
  138.                   <td align="center" width="128" bgcolor="#F0FCFF"> 
  139.                     <!--webbot bot="Validation"
  140. S-Display-Name="请输入正确的产品数量!" S-Data-Type="Integer"
  141. S-Number-Separators="x" -->
  142.                     <input Name="<%="Q_" & rs("Product_Id")%>" Value="<%=Quatity%>" Size="3"> 
  143.                   </td>
  144.                   <td align="center" width="119" bgcolor="#F0FCFF"><input Type="CheckBox" Name="cpbm" Value="<%=rs("Product_Id")%>" Checked> 
  145.                   </td>
  146.                 </tr>
  147.                 <%
  148. rs.MoveNext
  149. Wend
  150. %>
  151.                 <tr bgcolor="#F0FCFF"> 
  152.                   <td height="22" ColSpan="4" Align="Right">&nbsp;</td>
  153.                 </tr>
  154.               </table>
  155. </center></div><blockquote>
  156. <p align="center">
  157. <input Type="submit" Value="AlterQuantity" name="B1" style="font-size: 9pt">&nbsp;&nbsp;&nbsp;
  158. <input type="button" value="ContinueShopping" name="B2" onclick="window.close();" style="font-size: 9pt">&nbsp;&nbsp;&nbsp;
  159. <input type="button" value="OrderCancelling" name="B3" OnClick="clean()" style="font-size: 9pt">&nbsp;&nbsp;&nbsp;
  160. <input type="button" value="GoCashier" name="B4" onclick="location.href='En_Ment.asp'" style="font-size: 9pt" >&nbsp;&nbsp;&nbsp;
  161. <input type="button" value="Close" name="B5" onclick="window.close();" style="font-size: 9pt">     <p align="center"><font color=FF0000;> Notice: Change " quantity of the products " and " buy ", need to click the button " alter the quantity "!   </font>   </blockquote>
  162. </form>
  163. </td></tr></table>
  164. </div>
  165. <%
  166. rs.close
  167. conn.close
  168. call CloseConn()
  169. %>
  170. </body>
  171. </html>