pay4.asp
来自「书店的管理系统。不错的一个源程序。提供给大家。」· ASP 代码 · 共 518 行
ASP
518 行
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
</HEAD>
<BODY style="font-size: 9pt">
<%
Session("name")=Request.Form("name")
Session("comaddr")=Request.Form("comaddr")
Session("zipcode")=Request.Form("zipcode")
Session("tel")=Request.Form("tel")
Session("e_mail")=Request.Form("e_mail")
Session("detaddr")=Request.Form("detaddr")
Session("othercom")=Request.Form("othercom")
Session("send_method")=Request.Form("R1")
Session("send_time")=Request.Form("send_time")
Session("leave_word")=Request.Form("leave_word")
session_id=Session.SessionID
Session("pay_method")=Request.Form("pay_method")
'Session("lack_goods")=Request.Form("lack_goods")
'Session("spare_money")=Request.Form("spare_money")
'Session("packaging")=Request.Form("packaging")
'Session("invoice")=Request.Form("invoice")
'Session("faster")=Request.Form("faster")
if Session("send_method")="送货上门" and Session("detaddr")="" then
%>
<p>您选择的送货方式为:送货上门</p>
<p></p>
<p>为了您能够准确快捷地收到货物,请您在上一步中填写您的详细地址</p>
<%
Response.End
end if
if Session("pay_method")="货到付款" and Session("send_method")<>"送货上门" then
%>
<p>您选择的付款方式为:货到付款</p>
<p>您选择的送货方式为:<%=Session("send_method")%></p>
<p></p>
<p>目前“货到付款”只支持“送货上门”服务,请您修改送货方式或付款方式</p>
<%
Response.End
end if
%>
<%
set con=server.createobject("ADODB.Connection")
con.open Application("str_con")
set res=server.createobject("ADODB.Recordset")
set res.ActiveConnection = con
set res1=server.createobject("ADODB.Recordset")
set res1.ActiveConnection = con
set res2=server.createobject("ADODB.Recordset")
set res2.ActiveConnection = con
res.source="select XHBID from tempgwc where s_id='"&session_id&"' and 书店ID='"&Application("ZDID")&"'"
res.cursorlocation=3
res.open ,,adOpenDaynamic
%>
<% if res.recordcount<1 then %>
<p> 购物车中没有书籍!</p>
<%
res.close
con.close
Response.End
%>
<% else %>
<p align="center"><B><FONT color=#003399 size=3>请确认如下信息,然后按提交键,确认购买</p>
<div align="center"><center>
<table border="0" width="100%" style="font-size: 9pt">
<tr align="center">
<td bgcolor="yellow"><strong>书名</strong></td>
<td bgcolor="yellow"><strong>数量</strong></td>
<td bgcolor="yellow"><strong>单价(元)</strong></td>
<td bgcolor="yellow"><strong>折扣</strong></td>
<td bgcolor="yellow"><strong>总价(元)</strong></td>
<td bgcolor="yellow"><strong>ISBN</strong></td>
<td bgcolor="yellow"><strong>备注</strong></td>
</tr>
<%
'///////////////////计算和显示特价书
res1.source="select XHBID ,number, 正书名,ISBN,定价,折扣,备注 from tempgwc where s_id='"&session_id&"' and 书店ID='"&Application("ZDID")&"' and 折扣 IS NOT NULL ORDER BY 折扣 desc"
res1.cursorlocation=3
res1.open ,,adOpenDaynamic
tot1=0.0 '实洋
tot1_zk=0.0 '实收
if res1.recordcount>0 then
For j = 1 to res1.recordcount
jg=res1("定价")*res1("number")
tot1=tot1+jg
tot1_zk=tot1_zk+jg*Cdbl(res1("折扣"))*0.1
%>
<tr align="left">
<td bgcolor="#e8e8ec"><a Href="../query/title_detail.asp?XHBID=<%=res1("XHBID")%>&book_name=<%=res1("正书名")%>" target=_black><%=res1("正书名")%></a> </td>
<td bgcolor="#e8e8ec" align="right"> <%=res1("number")%> </td>
<td bgcolor="#e8e8ec" align="right"> <%=res1("定价")%> </td>
<td bgcolor="#e8e8ec" align="right"> <font color="#FF0000"> <%=res1("折扣")%> </font> </td>
<td bgcolor="#e8e8ec" align="right"> <%=jg%> </td>
<td bgcolor="#e8e8ec" align="right"> <%=res1("ISBN")%> </td>
<td bgcolor="#e8e8ec" align="right"> <font color="#FF0000"> <%=res1("备注")%> </font> </td>
</tr>
<%
res1.movenext
Next
tot1_zk=round(tot1_zk,1)
%>
<tr>
<td bgcolor=#eee8aa colspan=4 align="right">小计:</td>
<td bgcolor="#eee8aa" align="right"><%=tot1%></td>
<td bgcolor="#eee8aa" align="right"> <font color="#FF0000"> 优惠价:<%=tot1_zk%> </font> </td>
<td bgcolor="#eee8aa" colspan=2></td>
</tr>
<% end if 'res1.recordcount>0
res1.close
%>
<%
'///////////////////计算和显示 普通 书
res2.source="select XHBID ,number, 正书名,ISBN,定价,折扣,备注 from tempgwc where s_id='"&session_id&"' and 书店ID='"&Application("ZDID")&"' and 折扣 IS NULL ORDER BY 定价 desc"
res2.cursorlocation=3
res2.open ,,adOpenDaynamic
tot2=0.0 '实洋
tot2_zk=0.0 '实收
if res2.recordcount>0 then
For j = 1 to res2.recordcount
jg=res2("定价")*res2("number")
tot2=tot2+jg
%>
<tr align="left">
<td bgcolor="#e8e8ec"><a Href="../query/title_detail.asp?XHBID=<%=res2("XHBID")%>&book_name=<%=res2("正书名")%>" target=_black><%=res2("正书名")%></a> </td>
<td bgcolor="#e8e8ec" align="right"> <%=res2("number")%> </td>
<td bgcolor="#e8e8ec" align="right"> <%=res2("定价")%> </td>
<td bgcolor="#e8e8ec" align="right"> <font color="#FF0000"> <%=res2("折扣")%> </font> </td>
<td bgcolor="#e8e8ec" align="right"> <%=jg%> </td>
<td bgcolor="#e8e8ec" align="right"> <%=res2("ISBN")%> </td>
<td bgcolor="#e8e8ec" align="right"> <font color="#FF0000"> <%=res2("备注")%> </font> </td>
</tr>
<%
res2.movenext
Next %>
<%
if tot2>1000 then
tot2_zk=tot2*0.73
zk_level="73折"
else
if tot2<=500 then
tot2_zk=tot2*0.8
zk_level="8折"
else
tot2_zk=tot2*0.75
zk_level="75折"
end if
end if
tot2_zk=round(tot2_zk,1)
%>
<tr>
<td bgcolor="#eee8aa" colspan=4 align="right">小计:</td>
<td bgcolor="#eee8aa" align="right"><%=tot2%></td>
<td bgcolor="#eee8aa" align="right"> <font color="#FF0000"> 优惠价:<%=tot2_zk%> </font> </td>
<td bgcolor="#eee8aa" colspan=2 align=center>您享受<font color="#FF0000"><%=zk_level%></font>优惠</td>
</tr>
<% end if 'res2.recordcount>0
res2.close
%>
</table><p></p>
<%
tot=tot1+tot2
tot_zk=tot1_zk+tot2_zk
%>
合计:<%=tot%>元,
打折后价格为<font color="#FF0000"><%=tot_zk%>元</font>,您共节省了<font color="#FF0000"><%=tot-tot_zk%>元</font>
<p></p><p></p>
<%
end if 'Response.Write "购物车中没有书籍!"
Res.close
con.close
%>
<%
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''计算各种费用'''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
book_exes=tot
zkj=tot_zk
everythingisok=true
'1.送书费,手续费
commission_exes=0
select case Session("send_method")
case "送货上门"
if book_exes>100 then
send_exes=0.00
else
send_exes=4.80
end if
case "EMS特快专递"
if book_exes>200 then
send_exes=10.00
else
send_exes=15.00
end if
case "大陆平邮"
if book_exes>1000 then
send_exes=0.00
else
if book_exes<=500 then
send_exes=book_exes*0.15
else
send_exes=book_exes*0.1
end if
end if
case "港澳台地区平邮"
send_exes=book_exes*0.5
commission_exes=44
case "港澳台地区空运"
send_exes=book_exes*1.5
commission_exes=44
case "其他国家或地区平邮"
send_exes=book_exes*1.0
commission_exes=44
case "其他国家或地区空运"
send_exes=book_exes*3.0
commission_exes=44
case else
response.write "您购买的过程出现了问题,请您检查一下上一步操作是否正确,或者重新登录网站,也可以直接和我们联系。(A)"
everythingisok=false
end select
send_exes=round(send_exes,1)
'2.包装费
'if everythingisok then
' select case Session("packaging")
' case "是的,我需要礼品装"
' packaging_exes=3.00
' case "不,我不需要礼品装"
' packaging_exes=0.00
' case else
' response.write "您购买的过程出现了问题,请您检查一下上一步操作是否正确,或者重新登录网站,也可以直接和我们联系。(B)"
' everythingisok=false
' end select
'end if
'3.加急费
'if everythingisok then
' select case Session("faster")
' case "是的,我需要加急"
' faster_exes=0.00
' case "不,我不需要加急"
' faster_exes=0.00
' case else
' response.write "<p>"&"您购买的过程出现了问题,请您检查一下上一步操作是否正确,或者重新登录网站,也可以直接和我们联系。(C)"&"</p>"
' everythingisok=false
' end select
'end if
'4.总费用
if everythingisok then
'total_exes=zkj+send_exes+packaging_exes+faster_exes+commission_exes
total_exes=zkj+send_exes+commission_exes
end if
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'''''''''''''''''''''''''计算各种费用--结束'''''''''''''''''''''''''''''
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
%>
<%
if everythingisok then %>
<TABLE WIDTH="75%" BORDERCOLOR=#CCCC00 BORDER=1 CELLSPACING=1 CELLPADDING=1 style="font-size: 9pt">
<TR>
<TD ALIGN=left>收货人姓名</TD>
<TD ALIGN=left><%=Session("name")%></TD> </TR>
<TR> <TD ALIGN=left>收货人通信地址</TD> <TD ALIGN=left><%=Session("comaddr")%></TD> </TR>
<TR> <TD ALIGN=left>收货人邮编</TD> <TD ALIGN=left><%=Session("zipcode")%></TD> </TR>
<TR> <TD ALIGN=left>收货人联系电话</TD> <TD ALIGN=left><%=Session("tel")%></TD> </TR>
<TR> <TD ALIGN=left>收货人E-mail</TD> <TD ALIGN=left><%=Session("e_mail")%></TD> </TR>
<TR> <TD ALIGN=left>收货人详细地址</TD> <TD ALIGN=left><%=Session("detaddr")%> </TD> </TR>
<TR> <TD ALIGN=left>收货人其他联系方式</TD> <TD ALIGN=left><%=Session("othercom")%> </TD> </TR>
</TABLE>
<p></p>
<TABLE WIDTH=75% BORDER=0 CELLSPACING=1 CELLPADDING=1 style="font-size: 9pt">
<TR>
<TD width="15%"><FONT color=#003399>送货方式: </TD>
<TD aling=left width="34%"><%=Session("send_method")%></TD>
<TD width="15%"><FONT color=#003399>付款方式: </TD>
<TD aling=left width="40%"><%=Session("pay_method")%></TD>
</TR>
</TABLE>
<p></p>
<TABLE WIDTH=75% BORDER=0 CELLSPACING=1 CELLPADDING=1 style="font-size: 9pt">
<TR>
<TD width="10%"><FONT color=#003399>
<div align="left">书费:</div>
</TD>
<TD width="9%">
<div align="left"><font color="#FF0000"><%=zkj%></font></div>
</TD>
<TD width="12%"><FONT color=#003399>
<div align="right">送书费:</div>
</TD>
<TD width="9%">
<div align="left"><font color="#FF0000"><%=send_exes%></font></div>
</TD>
<!--
<TD width="12%"><FONT color=#003399>
<div align="right">包装费:</div>
</TD>
<TD width="6%">
<div align="left"><font color="#FF0000"><%=packaging_exes%></font></div>
</TD>
<TD width="12%"><FONT color=#003399>
<div align="right">加急费:</div>
</TD>
<TD width="6%">
<div align="left"><font color="#FF0000"><%=faster_exes%></font></div>
</TD>
-->
<TD width="10%"><FONT color=#003399>
<div align="right">共计:</div>
</TD>
<TD width="15%">
<div align="right"><font color="#FF0000"><%=total_exes%>元</font></div>
</TD>
</TR>
</TABLE>
<p></p>
<TABLE WIDTH=75% BORDER=0 CELLSPACING=1 CELLPADDING=1 style="font-size: 9pt">
<TR>
<TD width="30%" bgcolor="#CCCC00"><FONT color=#003399>其他<BR>
</TD>
<TD width="70%" bgcolor="#CCCC00"></TD>
</TR>
<!--
<TR>
<TD width="30%"><FONT color=#003399>图书缺货时:</TD>
<TD width="70%"><%=Session("lack_goods")%></TD>
</TR>
<TR>
<TD width="30%"><FONT color=#003399>剩下(或者多余)的款:</TD>
<TD width="70%"><%=Session("spare_money")%></TD>
</TR>
<TR>
<TD width="30%"><FONT color=#003399>礼品包装:</TD>
<TD width="70%"><%=Session("packaging")%></TD>
</TR>
<TR>
<TD width="30%"><FONT color=#003399>发票:</TD>
<TD width="70%"><%=Session("invoice")%></TD>
</TR>
<TR>
<TD width="30%"><FONT color=#003399>加急:</TD>
<TD width="70%"><%=Session("faster")%></TD>
</TR>
-->
<TR>
<TD width="30%"><FONT color=#003399>方便的收货时间:</TD>
<TD width="70%"><%=Session("send_time")%></TD>
</TR>
<TR>
<TD width="30%"><FONT color=#003399>留言:</TD>
<TD width="70%"><%=Session("leave_word")%></TD>
</TR>
</TABLE>
<p></p>
<TABLE WIDTH=75% BORDER=0 CELLSPACING=1 CELLPADDING=1 style="font-size: 9pt">
<TR>
<TD><FONT color=red>您现在将向系统提交订单,提交之后将进入收款程序。您按下确认提交订单后,本订单的全部内容将向系统提交,同时,现购物车的内容将被清空。
</FONT>
</TD>
</TR>
</TABLE>
<p></p>
<TABLE WIDTH=75% BORDER=0 CELLSPACING=1 CELLPADDING=1 style="font-size: 9pt">
<TR>
<TD>
<form method="POST" action="pay5.asp" name="form">
<input type="hidden" value="<%=book_exes%>" name="book_exes">
<input type="hidden" value="<%=zkj%>" name="zkj">
<input type="hidden" value="<%=zk_level%>" name="zk_level">
<input type="hidden" value="<%=send_exes%>" name="send_exes">
<!--
<input type="hidden" value="<%=packaging_exes%>" name="packaging_exes">
<input type="hidden" value="<%=faster_exes%>" name="faster_exes">
-->
<input type="hidden" value="<%=total_exes%>" name="total_exes">
<p align="center">
<input type="submit" value="下一步" name="B1">
</p>
</form>
</TD>
</TR>
</TABLE>
<%
end if ' if everythingisok then
%></center></div></FONT></B>
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?