?? payment.asp
字號:
<!--#include file="inc/conn.asp" -->
<%
'企業站英文版
%>
<%on error resume next%>
<%
'判斷是否需要注冊
if reg<>"1" then
'判斷是否正常購買,如果不是,需要登陸
if session("UserName")="" then
response.redirect "error.asp?error=006"
response.end
end if
end if
username=Session("username")
set Rs = Server.CreateObject("ADODB.recordset")
sql="select * from [User] where username='"&username&"'"
rs.open sql,conn,1,1
'判斷購物車是否為空
ProductList = Session("ProductList")
if productlist<>"" then
sql="select * from Productwygk where Product_Id in ("&productlist&") order by Product_Id"
Set rs = conn.Execute( sql )
else
response.redirect "error.asp?error=007"
response.end
end if
%>
<html>
<head>
<title>shopping information</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<meta name="Contact" content="www.wygk.cn 網域高科 QQ:38306293">
<link href="mt_style.css" rel="stylesheet" type="text/css">
<script language="JavaScript">
function CheckForm()
{
if (document.payment.Recname.value.length == 0) {
alert("Please input Consignee name.");
document.payment.Recname.focus();
return false;
}
if (document.payment.address.value.length == 0) {
alert("please input consigee address.");
document.payment.address.focus();
return false;
}
if (document.payment.paytype.value.length == 0) {
alert("please choose payment type.");
document.payment.paytype.focus();
return false;
}
if (document.payment.Recmail.value.length == 0) {
alert("please input the EMAIL.");
document.payment.Recmail.focus();
return false;
}
if (document.payment.Recmail.value.length > 0 && !document.payment.Recmail.value.match( /^.+@.+$/ ) ) {
alert("EMAIL Error!please reset");
document.payment.Recmail.focus();
return false;
}
if (document.payment.RecPhone.value.length == 0) {
alert("please input telphone.");
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="#000000">
<tr bgcolor="#FFFFFF">
<td colspan="4" height="25"> <font color=B0266D><%=session("UserName")%> you shopping list:</font>
</td>
</tr>
<tr bgcolor="#FFFFFF">
<td width="50%" height="25" align="center">
<font color="B0266D">ProductName</font>
</td>
<td width="10%" align="center">
<font color="B0266D">ProductQuantity</font>
</td>
<td width="20%" align="center">
<font color="B0266D">unit price</font>
</td>
<td width="20%" align="center">
<font color="B0266D">Total</font>
</td>
</tr>
<%
Sum = 0
While Not rs.EOF
Quatity = CInt( Request( "Q_" & rs("Product_Id")) )
If Quatity <= 0 Then
Quatity = CInt( Session(rs("Product_Id")) )
If Quatity <= 0 Then Quatity = 1
End If
Session(rs("Title")) = Quatity
Sum = Sum + csng(rs("Price")) * Quatity
Sum=FormatNumber(Sum,2)
Session("sum")=sum
%>
<tr bgcolor="#FFFFFF">
<td width="50%" height="20"> <font color="B0266D"><%=rs("Title")%></font></td>
<td width="10%"> <font color="B0266D"><%=Quatity%></font></td>
<td width="20%"> <font color="B0266D"><%=FormatNumber(rs("Price"),2)%></font></td>
<td width="20%"> <font color="B0266D"><%=FormatNumber(csng(rs("Price"))*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">total prices=<%=Sum%></font>
</td>
</tr>
</table>
<br>
<br>
<table border="0" cellspacing="1" cellpadding="3" align="center" width="520" bgcolor="#000000">
<form name="payment" action="previeworder.asp" method="POST" onSubmit="return CheckForm();">
<%
sql="select * from [User] where UserName='"&session("UserName")&"'"
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
Postcode=rs("Postcode")
Phone=rs("Phone")
Add=rs("Add")
Email=rs("Email")
Receiver=rs("Receiver")
CompanyName=rs("CompanyName")
Fax=rs("Fax")
rs.close
set rs=nothing
%>
<tr bgcolor="#FFFFFF">
<td width="20%">consignee name</td>
<td width="30%"><input type="text" name="Receiver" class="form" size="15" value=<%=Receiver%>>
<b><font color="#FF3333">*</font></b> </td>
<td>consignee telphone</td>
<td><input type="text" name="Phone" class="form" size="15" value=<%=Phone%>>
<b><font color="#FF3333">*</font></b> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="27">Consignee email</td>
<td height="27"><input type="text" name="Email" size="16" value=<%=Email%>>
<b><font color="#FF3333">*</font></b></td>
<td height="30">pay type</td>
<td><select name="Paytype">
<option value="" selected>please choose pay type</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>
<b><font color="#FF3333">*</font></b> </td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="30">Zipcode</td>
<td> <input type="text" name="Postcode" size="15" value=<%=Postcode%>></td>
<td>Fax</td>
<td><input type="text" name="Fax" size="15" value=<%=Fax%>></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="30" >Company</td>
<td colspan=3><input type="text" name="CompanyName" size="45" value=<%=CompanyName%>></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="30" > Consignee address</td>
<td colspan=3><input name="Add" size=45 value='<%=Add%>'>
<b><font color="#FF3333">*</font></b></td>
</tr>
<tr bgcolor="#FFFFFF">
<td height="30" >Notes</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="<< reture amend">
<input type="submit" name="nextstep" value="affirm order >>">
<input type="reset" name="reset" value="reset"> </td>
</tr>
</form>
</table>
</body>
</html>
<%
set conn=nothing
%>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -