?? payment.asp
字號:
<!--#include file="../Comm/subconn.asp" -->
<%on error resume next%>
<%
'判斷是否需要注冊
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.Recname.value.length == 0) {
alert("請輸入收貨人的 姓名.");
document.payment.Recname.focus();
return false;
}
if (document.payment.address.value.length == 0) {
alert("請輸入收貨人的 地址.");
document.payment.address.focus();
return false;
}
if (document.payment.paytype.value.length == 0) {
alert("請選擇您的支付方式.");
document.payment.paytype.focus();
return false;
}
if (document.payment.Recmail.value.length == 0) {
alert("請輸入此訂單收貨人的EMAIL.");
document.payment.Recmail.focus();
return false;
}
if (document.payment.Recmail.value.length > 0 && !document.payment.Recmail.value.match( /^.+@.+$/ ) ) {
alert("EMAIL 錯誤!請重新輸入");
document.payment.Recmail.focus();
return false;
}
if (document.payment.RecPhone.value.length == 0) {
alert("請收貨人的電話.");
document.payment.RecPhone.focus();
return false;
}
return true;
}
</script>
</head>
<body bgcolor="#FFFFFF" text="#000000" leftmargin="0" topmargin="0">
<br>
<table border="0" cellspacing="1" cellpadding="0" align="center" width="520" bgcolor="B0266D">
<tr bgcolor="#FFFFFF">
<td colspan="4" height="25"> <font color=B0266D><%=session("estore_userid")%> 您選購的商品清單如下:</font>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="50%" height="25" align="center">
<font color="B0266D">商 品 名 稱</font>
</td>
<td width="10%" align="center">
<font color="B0266D">數 量</font>
</td>
<td width="20%" align="center">
<font color="B0266D">單 價</font>
</td>
<td width="20%" align="center">
<font color="B0266D">合 計</font>
</td>
</tr>
<%
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
Sum=FormatNumber(Sum,2)
session("sum")=sum
%>
<tr bgcolor="#FFFFFF">
<td width="50%" height="20"> <font color="B0266D"><%=rs("ProdName")%></font></td>
<td width="10%"> <font color="B0266D"><%=Quatity%></font></td>
<td width="20%"> <font color="B0266D"><%=FormatNumber(rs("PriceList"),2)%></font></td>
<td width="20%"> <font color="B0266D"><%=FormatNumber(csng(rs("PriceList"))*Quatity,2)%></font></td>
</tr>
<%
rs.MoveNext
Wend
rs.close
set rs=nothing
%>
<tr bgcolor="#FFFFFF">
<td colspan="4" height="25" align="right">
<b><font color="#B0266D">總價格=<%=Sum%></font>
</td>
</tr>
</table>
<br>
<br>
<table border="0" cellspacing="1" cellpadding="3" align="center" width="520" bgcolor="B0266D">
<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")
address=rs("Address")
email=rs("UserMail")
name=rs("UserName")
rs.close
set rs=nothing
%>
<tr bgcolor="#FFFFFF">
<td width="20%"> 收貨人姓名</td>
<td width="30%"><input type="text" name="Recname" class="form" size="15" value=<%=name%>>
<b><font color="#FF3333">*</font></b> </td>
<td> 收貨人電話</td>
<td><input type="text" name="RecPhone" class="form" size="15" value=<%=HomePhone%>>
<b><font color="#FF3333">*</font></b> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="27">收貨人郵箱</td>
<td height="27"><input type="text" name="Recmail" size="16" value=<%=email%>> <b><font color="#FF3333">*</font></b></td>
<td height="30">支付方式</td>
<td><select name="paytype">
<option value="" selected>請選擇支付方式</option>
<%
sqlp="select paytype from paydefault"
set rsp=server.createobject("ADODB.Recordset")
rsp.open sqlp,conn,1,1
while not rsp.eof
%>
<option value="<%=rsp("paytype")%>"><%=rsp("paytype")%></option>
<%
rsp.movenext
wend
rsp.close
set rsp=nothing
%>
</select>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="30">郵政編碼</td>
<td colspan=3>
<input type="text" name="ZipCode" size="15" value=<%=Zipcode%>>
</td>
</tr>
<tr bgcolor="#FFFFFF"><td height="30" >
收貨人地址</td><td colspan=3><input name="address" size=45 value='<%=address%>'><b><font color="#FF3333">*</font></b></td>
</tr>
<tr bgcolor="#FFFFFF"><td height="30" >備注留言</td><td colspan="3">
<textarea name="Notes" cols="35" rows="4"></textarea>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="35" colspan="4" align="center">
<input type=hidden name="Sum" value="<%=Sum%>">
<input type="button" name="Submit21" onclick="javascript:history.go(-1)" value="<< 返回修改">
<input type="submit" name="nextstep" value="確認訂單 >>">
<input type="reset" name="reset" value="重新填寫信息">
</td>
</tr>
</form>
</table>
</body>
</html>
<%
set conn=nothing
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -