⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 payment.asp

📁 非常棒的网上购物系统www.yuhuanrd.gov.cn www.yuhuanrd.gov.cn www.yuhuanrd.gov.cn www.yuhuanrd.gov.cn
💻 ASP
字号:
<!--#include file="../Comm/subconn.asp" -->
<%
'判断是否需要注册
if reg<>"1" then
	'判断是否正常购买,如果不是,需要登陆
	if session("estore_userid")="" then 
		response.redirect "../error.asp?error=006"
		response.end
	end if
end if
ProductList = Session("ProductList")
if productlist<>"" then
sql="select * from ProdMain where ProdId in ("&productlist&") order by ProdId"
Set rs = conn.Execute( sql )
else
response.redirect "../error.asp?error=007"
response.end
end if
%> 
<html>
<head>
<title>填写订单详细信息</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Robots" content="index,follow">
<link rel="stylesheet" href="../shop.css" type="text/css">
<script language="JavaScript">
function CheckForm()
{
	if (document.payment.post.value.length == 0) {
		alert("请选择配送方式");
		document.payment.post.focus();
		return false;
	}

	if (document.payment.Recname.value.length <2 || document.payment.Recname.value.length>20 ) {
		alert("请检查您输入的收货人姓名");
		document.payment.Recname.focus();
		return false;
	}

	if (document.payment.RecPhone.value.length < 6 || document.payment.RecPhone.value.length > 15) {
		alert("请检查您输入的联系电话");
		document.payment.RecPhone.focus();
		return false;
	}



	if (document.payment.Recmail.value.length <8 || document.payment.Recmail.value.length >=50) {
		alert("请检查您输入的电子信箱");
		document.payment.Recmail.focus();
		return false;
	}
	if (document.payment.Recmail.value.length > 0 && !document.payment.Recmail.value.match( /^.+@.+$/ ) ) {
	    alert("请检查您输入的电子信箱");
	    document.payment.Recmail.focus();
		return false;
	}

    if (document.payment.ZipCode.value.length != 6) {
		alert("请检查您输入的邮政编码");
		document.payment.ZipCode.focus();
		return false;
	}
	
	if (document.payment.address.value.length < 3) {
		alert("请检查您输入的收货地址");
		document.payment.address.focus();
		return false;
	}


	return true;
}

</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
 <br>

<%
userkou=session("userkou")
   Sum = 0
   While Not rs.EOF
     Quatity = CInt( Request( "Q_" & rs("ProdId")) )
     If Quatity <= 0 Then 
        Quatity = CInt( Session(rs("ProdId")) )
        If Quatity <= 0 Then Quatity = 1
     End If
     Session(rs("ProdName")) = Quatity
     Sum = Sum + csng(rs("PriceList")) * Quatity

                         
rs.MoveNext
Wend
rs.close
set rs=nothing

Sum=FormatNumber(Sum*userkou/10,2) 
session("sum")=sum

%> 

<table border="0" cellspacing="0" cellpadding="0" align="center" width="520" height="68">
  <tr bgcolor="#FFFFFF"> 
    <td height=29><font color="#FF3333"><b><%=session("estore_userid")%> 您选购的商品总价为:¥ <%=Sum%> 元</font></b>  
    </td>
  </tr>
  <tr bgcolor="#FFFFFF"> 
    <td align=center  height=39> <font color="#FF3333">请认真填写以下表格,带 * 号的必须填写</font></td>                        
  </tr>
  
</table>

<table border="0" cellspacing="1" cellpadding="2" align="center" width="520" bgcolor="#cccccc">
  <form name="payment" action="previeworder.asp" method="POST"  onSubmit="return CheckForm();">
<%
sql="select * from UserMain where userid='"&session("estore_userid")&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
Zipcode=rs("ZipCode")
HomePhone=rs("HomePhone")
CompPhone=rs("CompPhone")
address=rs("Address")
email=rs("UserMail")
name=rs("UserName")
rs.close
set rs=nothing

'读取配送方式和费用
info="select * from shopsetup"
set rrrs=server.createobject("adodb.recordset")
rrrs.open info,conn,1,1
fei1=rrrs("fei1")
fei2=rrrs("fei2")
fei3=rrrs("fei3")
fei4=rrrs("fei4")
pei1=rrrs("pei1")
pei2=rrrs("pei2")
pei3=rrrs("pei3")
pei4=rrrs("pei4")

mianyoufei=cint(rrrs("mianyoufei"))				'购物满XXX元免邮费
mianyoufei_msg=rrrs("mianyoufei_msg")				'免邮费的提示

if cint(session("sum"))<mianyoufei then	
pei1=rrrs("pei1") & ",配送费用:" & fei1 &"元"
if pei2<>"" then pei2=pei2 & ",配送费用:" & fei2 &"元"
if pei3<>"" then pei3=pei3 & ",配送费用:" & fei3 &"元"
if pei4<>"" then pei4=pei4 & ",配送费用:" & fei4 &"元"
end if

rrrs.close
set rrrs=nothing
%>

    <tr bgcolor="#FFFFFF">     
      <td width="20%" align=center>配送及运费</td>
      <td>

<select size="1" name="post">
          <option selected value="">请选择配送方式</option>
          <option value="1"><%=pei1%></option>
<%
if pei2<>"" then
%>
          <option value="2"><%=pei2%></option>
<%
if pei3<>"" then
%>
          <option value="3"><%=pei3%></option>
<%
if pei4<>"" then
%>
          <option value="4"><%=pei4%></option>
<%
end if
end if
end if
%>
        </select><b><font color="#FF3333">  *</font></b> 

<%
if cint(session("sum"))>=mianyoufei then
response.write mianyoufei_msg
end if
%>

</td></tr>  

    <tr bgcolor="#FFFFFF"> 
      <td  align=center>收货人姓名</td>
      <td><input type="text" name="Recname" class="form" size="25" value=<%=name%>><b><font color="#FF3333"> *</font></b> 请输入真实的中文姓名</td> </tr>

    <tr bgcolor="#FFFFFF"> 
    <td  align=center>收货人电话</td><td><input type="text" name="RecPhone" class="form" size="25" value=<%=HomePhone%>><b><font color="#FF3333"> *</font></b> </td></tr>                  

    <tr bgcolor="#FFFFFF"> 
    <td align=center>移动电话</td><td><input type="text" name="CompPhone" class="form" size="25" value=<%=CompPhone%>> 
      建议填写,以便联络</td></tr>                   

    <tr bgcolor="#FFFFFF"> 
    <td align=center>收货人邮箱</td><td><input type="text" name="Recmail"  size="25" value=<%=email%>> <b><font color="#FF3333"> *</font></b></td></tr>                    

    <tr bgcolor="#FFFFFF"> 
    	  <td align=center>邮政编码</td> 
      <td><input type="text" name="ZipCode" size="25" value=<%=Zipcode%>><b><font color="#FF3333">  
        *</font></b></td></tr>                 
      
	<tr bgcolor="#FFFFFF"><td align=center>收货人地址</td><td><input name="address" size=34 value='<%=address%>'><b><font color="#FF3333"> *</font></b></td>		                  
    </tr>
      
	<tr bgcolor="#FFFFFF"><td align=center>指定送达时间</td><td><input name="gettime" size=34 value='<%=gettime%>'></td>		                 
    </tr>
		<tr bgcolor="#FFFFFF"><td align=center >备&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;注</td><td><textarea name="Notes" cols="44" rows="3"></textarea><br><font color="#FF3333">例如可以写上您的QQ,以及其它要说明的内容。</font>
       </td>
    </tr>
    <tr bgcolor="#FFFFFF"> 
      <td height="35" colspan="2" align="center"> 
      <input type=hidden name="Sum" value="<%=Sum%>">

        <input type="submit" name="nextstep" value="确认订单">&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp; 
	<input type="button" name="Submit21" onclick="javascript:history.go(-1)" value="返回修改">
        


      </td>
    </tr>
  </form> 
</table>
</body>
</html>

<%
set conn=nothing
%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -