checkout.asp
上传用户:syzzy1975
上传日期:2022-07-17
资源大小:670k
文件大小:9k
源码类别:

Jsp/Servlet

开发平台:

Java

  1. <%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
  2. <%
  3. %><!--#include file="manage/inc/config.asp"--> 
  4. <!--#include file="inc/conn.asp"--> 
  5. <!--#include file="inc/chk.asp"--> 
  6. <%
  7. set rs=server.CreateObject("adodb.recordset")
  8. rs.open "select recepit,userid,sex,useremail,city,address,postcode,usertel,paymethord,deliverymethord,realname from [user] where username='"&request.cookies(cookieName)("username")&"'",conn,1,1
  9. dim userid,id
  10. id=request("id")
  11. userid=rs("userid")
  12. %>
  13. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  14. <html>
  15. <head>
  16. <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
  17. <title>东区网上书店</title>
  18. <link href="style.css" rel="stylesheet" type="text/css">
  19. </head>
  20. <body>
  21. <!--#include file="head.htm"-->
  22. <table width="780" border="0" align="center" cellpadding="0" cellspacing="0">
  23.   <tr>
  24.     <td width="219" align="left" valign="top"><!--#include file="uleft.asp"-->      <br></td><td width="561" align="left" valign="top">      <br>      <table border="0" cellpadding="0" cellspacing="0">
  25.         <tr>
  26.           <td><img src="images/w.gif" width="18" height="18"></td>
  27.           <td style="color:#415373">结帐</td>
  28.         </tr>
  29.       </table>      <br>      <form action="vorder.asp" method="post" name="receiveaddr" id="receiveaddr">
  30.         <table width="100%" border="0" align="center" cellpadding="2" cellspacing="1" >
  31.           <tr >
  32.   <%
  33.   dim rs2
  34.  set rs2=server.CreateObject("adodb.recordset")
  35. rs2.open "select id from product where id in ("&id&") order by id",conn,1,1
  36. do while not rs2.eof
  37. %> <input name="<%="shop"&rs2("id")%>" type="hidden" value="<%=cint(request("shop"&rs2("id")))%>"> 
  38. <%
  39. rs2.movenext
  40. loop
  41. rs2.close
  42. set rs2=nothing%> 
  43.             <td width="114" style='PADDING-LEFT: 20px'>收货人姓名:</td>
  44.             <td width="436" height="28" style='PADDING-LEFT: 20px'> 
  45.               <input name="recepit" type="text" id="recepit" size="12" value=<%=trim(rs("recepit"))%>>
  46. &nbsp;&nbsp;性 别:
  47.       <select name="sex" id="sex">
  48.         <%select case rs("sex")
  49.   case ""
  50.   response.write "<option value=0 selected>男</option><option value=1>女</option>"
  51.   case "0"
  52.   response.write "<option value=0 selected>男</option><option value=1>女</option>"
  53.   case "1"
  54.   response.write "<option value=0 >男</option><option value=1 selected>女</option>"
  55.   end select%>
  56.       </select>
  57.       <input type=hidden name=realname value=<%=trim(rs("realname"))%>> <input name=userid type=hidden id="userid" value=<%=userid%>></td>
  58.           </tr>
  59.           <tr >
  60.             <td style='PADDING-LEFT: 20px'>收货人省/市:</td>
  61.             <td height="28" style='PADDING-LEFT: 20px'> <b>
  62.               <input name="city" type="text" id="city" value=<%=trim(rs("city"))%>>
  63.             </b></td>
  64.           </tr>
  65.           <tr >
  66.             <td style='PADDING-LEFT: 20px'>详细地址:</td>
  67.             <td height="28" style='PADDING-LEFT: 20px'> <b>
  68.               <input name="address" type="text" id="address" size="40" value=<%=trim(rs("address"))%>>
  69.             </b></td>
  70.           </tr>
  71.           <tr >
  72.             <td style='PADDING-LEFT: 20px'>邮编:</td>
  73.             <td height="28" style='PADDING-LEFT: 20px'> 
  74.             <input name="postcode" type="text" id="postcode" size="10" value=<%=rs("postcode")%>>            </td>
  75.           </tr>
  76.           <tr >
  77.             <td style='PADDING-LEFT: 20px'>电话:</td>
  78.             <td height="28" style='PADDING-LEFT: 20px'>
  79.             <input name="usertel" type="text" id="usertel" size="12" value=<%=trim(rs("usertel"))%>>            </td>
  80.           </tr>
  81.           <tr >
  82.             <td style='PADDING-LEFT: 20px'>电子邮件:</td>
  83.             <td height="28" style='PADDING-LEFT: 20px'> 
  84.             <input name="useremail" type="text" id="useremail" value=<%=trim(rs("useremail"))%>>            </td>
  85.           </tr>
  86.           <tr >
  87.             <td height="32" style='PADDING-LEFT: 20px'>送货方式:</td>
  88.             <td height="28" style='PADDING-LEFT: 20px'> <b>
  89.               <%dim rs3
  90.           set rs3=server.CreateObject("adodb.recordset")
  91.           rs3.Open "select * from delivery where methord=0 order by deliveryidorder",conn,1,1
  92.           response.Write "<select name=deliverymethord size="&rs3.recordcount&" id=deliverymethord>"
  93.           do while not rs3.EOF
  94.           response.Write "<option value="&rs3("deliveryidorder")
  95.           if int(rs("deliverymethord"))=int(rs3("deliveryidorder")) then 
  96.           response.Write " selected>"
  97.           else
  98.           response.Write ">"
  99.           end if
  100.           response.Write trim(rs3("subject"))&"</option>"
  101.           rs3.MoveNext
  102.           loop
  103.           response.Write "</select>"
  104.           rs3.Close
  105.           set rs3=nothing
  106.          %>
  107.               <font color=red>送货上门限制于本市</font></b></td>
  108.           </tr>
  109.           <tr >
  110.             <td height="32" style='PADDING-LEFT: 20px'>支付方式:</td>
  111.             <td height="28" style='PADDING-LEFT: 20px'> 
  112.             <%
  113.           set rs3=server.CreateObject("adodb.recordset")
  114.           rs3.open "select * from delivery where methord=1 order by deliveryidorder",conn,1,1
  115.           response.Write "<select name=paymethord size="&rs3.recordcount&" id=paymethord>"
  116.           do while not rs3.eof
  117.           response.Write "<option value="&rs3("deliveryidorder")
  118.           if int(rs("paymethord"))=int(rs3("deliveryidorder")) then
  119.           response.Write " selected>"
  120.           else
  121.           response.Write ">"
  122.           end if
  123.           response.Write trim(rs3("subject"))&"</option>"
  124.           rs3.movenext
  125.           loop
  126.           response.Write "</select>"
  127.           rs3.close
  128.           set rs3=nothing
  129.   rs.close
  130.   set rs=nothing%>            </td>
  131.           </tr>
  132.           <tr >
  133.             <td height="32" valign="top" style='PADDING-LEFT: 20px'>简单留言:</td>
  134.             <td height="28" style='PADDING-LEFT: 20px'> 
  135.             <textarea name="comments" cols="40" rows="5" id="comments"></textarea>            </td>
  136.           </tr>
  137.           <tr align="center" >
  138.             <td height="32" colspan="2" style='PADDING-LEFT: 20px'> <b>
  139.               <input name="Submit" type="submit" id="Submit" style="height:20; font:9pt; BORDER-BOTTOM: #cccccc 1px groove; BORDER-RIGHT: #cccccc 1px groove; BACKGROUND-COLOR: #eeeeee" onClick="return ssother();"value="提交订单">
  140.               <input name="id" type="hidden" id="id" value="<%=id%>">
  141.               <SCRIPT LANGUAGE="JavaScript">
  142. !--
  143. function checkspace(checkstr) {
  144.   var str = '';
  145.   for(i = 0; i < checkstr.length; i++) {
  146.     str = str + ' ';
  147.   }
  148.   return (str == checkstr);
  149. }
  150. function ssother()
  151. {
  152.    if(checkspace(document.receiveaddr.recepit.value)) {
  153. document.receiveaddr.recepit.focus();
  154.     alert("对不起,请填写收货人姓名!");
  155. return false;
  156.   }
  157.   if(checkspace(document.receiveaddr.city.value)) {
  158. document.receiveaddr.city.focus();
  159.     alert("对不起,请填写收货人所在省市!");
  160. return false;
  161.   }
  162.   if(checkspace(document.receiveaddr.address.value)) {
  163. document.receiveaddr.address.focus();
  164.     alert("对不起,请填写收货人详细收货地址!");
  165. return false;
  166.   }
  167.   if(checkspace(document.receiveaddr.postcode.value)) {
  168. document.receiveaddr.postcode.focus();
  169.     alert("对不起,请填写邮编!");
  170. return false;
  171.   }
  172.  
  173.     if(checkspace(document.receiveaddr.usertel.value)) {
  174. document.receiveaddr.usertel.focus();
  175.     alert("对不起,请留下您的电话!");
  176. return false;
  177.   }
  178.       if(checkspace(document.receiveaddr.deliverymethord.value)) {
  179. document.receiveaddr.deliverymethord.focus();
  180.     alert("对不起,您还没有选择送货方式!");
  181. return false;
  182.   }
  183.       if(checkspace(document.receiveaddr.paymethord.value)) {
  184. document.receiveaddr.paymethord.focus();
  185.     alert("对不起,您还没有选择支付方式!");
  186. return false;
  187.   }
  188.   if(document.receiveaddr.useremail.value.length!=0)
  189.   {
  190.     if (document.receiveaddr.useremail.value.charAt(0)=="." ||        
  191.          document.receiveaddr.useremail.value.charAt(0)=="@"||       
  192.          document.receiveaddr.useremail.value.indexOf('@', 0) == -1 || 
  193.          document.receiveaddr.useremail.value.indexOf('.', 0) == -1 || 
  194.          document.receiveaddr.useremail.value.lastIndexOf("@")==document.receiveaddr.useremail.value.length-1 || 
  195.          document.receiveaddr.useremail.value.lastIndexOf(".")==document.receiveaddr.useremail.value.length-1)
  196.      {
  197.       alert("Email地址格式不正确!");
  198.       document.receiveaddr.useremail.focus();
  199.       return false;
  200.       }
  201.    }
  202.  else
  203.   {
  204.    alert("Email不能为空!");
  205.    document.receiveaddr.useremail.focus();
  206.    return false;
  207.    }
  208.    
  209. }
  210. //-->
  211.               </script></td>
  212.           </tr>
  213.         </table>
  214.       </form>      <br>      <br>
  215.     </td>
  216.   </tr>
  217. </table>
  218. <!--#include file="foot.htm"-->
  219. </body>
  220. </html>