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

📄 xt_order_add.asp

📁 用ASP写的电子购物系统
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%@ LANGUAGE=vbscript %><!--#INCLUDE FILE="include/shop.asp" --><!--#INCLUDE FILE="include/util.asp" --><% REM ##########################################################################%><% REM                                                                          #%><% REM   CONFIRMED.ASP                                                          #%><% REM   订单确认                                                               #%><% REM                                                                          #%><% REM   Copyright (c) 1996-98 Microsoft Corporation.  All rights reserved.     #%><% REM                                                                          #%><% REM ##########################################################################%><%cardnum=session("atm_cardnum")password=session("atm_password")dim errorList    cmdTemp.CommandText = "SELECT * FROM CARRIAGE"        Set recordSet = Server.CreateObject("ADODB.Recordset")    recordSet.Open cmdTemp, , adOpenKeyset, adLockOptimistic	while not(recordset.EOF)		if recordset("id")="1" then cost1=recordset("cost")		if recordset("id")="2" then cost2=recordset("cost")		if recordset("id")="3" then cost3=recordset("cost")		if recordset("id")="4" then cost4=recordset("cost")		recordset.MoveNext 	wend	recordset.Close     cmdTemp.CommandText = "SELECT * FROM basket WHERE session_id = '" & session.SessionID  & "' order by product_id"    Set recordSet = Server.CreateObject("ADODB.Recordset")    recordSet.Open cmdTemp, , adOpenKeyset, adLockOptimistic       if recordset.RecordCount =0 then        errorList=errorList & "您的购物篮是空的。<br>"    end if         if (Isnull(ShopperID) or isempty(ShopperID)) then		errorList=errorList & "用户未登录或操作超时。<br>"    end if        bill_to_name = checklength(Request("bill_to_name"), 25)    if IsNull(bill_to_name) then        errorList=errorList & "付款人必须在1到25个汉字。<br>"    end if    bill_to_street  = checklength(Request("bill_to_street"), 120)    if IsNull(bill_to_street) then        errorList=errorList & "付款人地址必须在1到120个汉字。<br>"    end if    bill_to_state = checklength(Request("bill_to_state"),15)    if IsNull(bill_to_state) then        errorList=errorList & "付款人位置付款人地址必须在1到15个汉字。<br>"    end if    bill_to_method = checklength(Request("bill_to_method"),4)    if IsNull(bill_to_method) then        errorList=errorList & "付款方式必须在1到4个汉字。<br>"    end if    PayMode_name=bill_to_method    select case bill_to_method		case "国际汇兑"			bill_to_method="1"		case "西联汇款"			bill_to_method="2"		case "货到付款"			bill_to_method="3"		case "邮支付卡"			bill_to_method="4"	    case "网银支付"			bill_to_method="5"	end select    bill_to_city = checklength(Request("bill_to_city"), 25)    if IsNull(bill_to_city) then        errorList=errorList & "付款人城市必须在1到25个汉字。<br>"    end if    bill_to_zip = checklength(Request("bill_to_zip"), 15)    if IsNull(bill_to_zip) then        errorList=errorList & "付款人邮编位置必须在1到15个数字。<br>"    end if        bill_to_phone = checklength(Request("bill_to_phone"), 20)    if IsNull(bill_to_phone) then        errorList=errorList & "付款人电话必须是1到20个字符。<br>"    end if    ship_to_name = checklength(Request("ship_to_name"), 25)    if IsNull(ship_to_name) then        errorList=errorList & "收货人必须在1到25个汉字。<br>"    end if    ship_to_street  = checklength(Request("ship_to_street"), 120)    if IsNull(ship_to_street) then        errorList=errorList & "收货人地址必须在1到120个汉字。<br>"    end if        ship_to_state = checklength(Request("ship_to_state"),15)    if IsNull(ship_to_state) then        errorList=errorList & "收货人位置必须在1到15个汉字。<br>"    else        if trim(cstr(session("Product_type")))<>"" and trim(cstr(ship_to_state))<>"北京" then           errorList=errorList & "对不起,暂时不提供北京以外的服务。<br>"        end if    end if       ship_to_city = checklength(Request("ship_to_city"), 25)    if IsNull(ship_to_city) then        errorList=errorList & "收货人城市必须在1到25个汉字。<br>"    end if    ship_to_zip = checklength(Request("ship_to_zip"), 15)    if IsNull(ship_to_zip) then        errorList=errorList & "收货人邮编位置必须在1到15个数字。<br>"    end if        ship_to_phone = checklength(Request("ship_to_phone"), 20)    if IsNull(ship_to_phone) then        errorList=errorList & "收货人电话必须是1到20个字符。<br>"    end if        description = checklength(Request("note"), 100)    ship_to_email = checklength(Request("ship_to_email"), 50)    bill_to_email = checklength(Request("bill_to_email"), 50)   '计算运费    if trim(bill_to_state)="其它" then 		pay_currency="美金"	else 		pay_currency="人民币"	end if		if trim(ship_to_state)="北京" and pay_currency="人民币" then		ship_fee=cost1	elseif trim(ship_to_state)<>"北京" and pay_currency="人民币" then		ship_fee=cost2	elseif trim(ship_to_state)="北京" and pay_currency="美金" then		ship_fee=cost3	else 	    ship_fee=cost4	end if%><%if errorList="" then    cmdTemp.CommandText = " select seq_orderid.nextval as orderid from dual"    Set rstTemp = Server.CreateObject("ADODB.Recordset")    rstTemp.Open cmdTemp, , adOpenStatic, adLockReadOnly        orderid=rstTemp("orderid")    rstTemp.Close         Set rstOrder = Server.CreateObject("ADODB.Recordset")        cmdTemp.CommandText = "SELECT * FROM basket WHERE session_id = '" & session.SessionID  & "' order by product_id"    rstOrder.Open cmdTemp, , adOpenKeyset, adLockReadOnly    total_price=0    For i = 1 to rstOrder.RecordCount        If rstOrder.EOF then exit for	        quantity=rstOrder("quantity").value	        if pay_currency="美金" then 				adjusted_price=rstOrder("list_price").value			else 				adjusted_price=rstOrder("rmb_price").value			end if 	        subtotal_price=formatnumber(quantity)*formatnumber(adjusted_price,2)			total_price=total_price+subtotal_price		rstOrder.MoveNext	next 			rstOrder.Close     total_price=total_price+formatnumber(ship_fee)          if bill_to_method="4" then    tradesum=cstr(clng(total_price*100))    set check=server.CreateObject ("eprojm.epro")password=check.epropassword (cardnum,password)checkstr=check.eprocmp(cardnum)set connbj=server.CreateObject ("adodb.connection")connbj.Open "DSN=Web ORA;UID=zj;PWD=zj;"'检验用户set rs=server.CreateObject ("adodb.recordset")rs.Open "select * from tbaccount where cardnum='"  + cardnum + "'",connbj,1,3if rs.RecordCount <>1 then errorList="您所输入的账号不存在,请您查实后再交易!"set check=nothingrs.Close set rs=nothingconnbj.Closeset connbj=nothing%><!--#INCLUDE FILE="include/error.asp" --><%Response.End else'Response.Write checkstr'Response.Write "<br>"'Response.Write rs("checkstr")'Response.Endsession("pagusername")=rs("username")if rs("checkstr")<>checkstr then errorList="您所输入的账号有误,请您查实后再交易!"set check=nothingrs.Close set rs=nothingconnbj.Closeset connbj=nothing%><!--#INCLUDE FILE="include/error.asp" --><%Response.End else'检验口令if password<>rs("password") thenerrorList="您所输入的密码有误,请您查实后再交易!"set check=nothingrs.Close set rs=nothingconnbj.Closeset connbj=nothing%><!--#INCLUDE FILE="include/error.asp" --><%Response.End else'检验死户if rs("state")<>0 thenerrorList="您的账户已被冻结,请您与邮储部门联系!"set check=nothingrs.Close set rs=nothingconnbj.Closeset connbj=nothing%><!--#INCLUDE FILE="include/error.asp" --><%Response.End else'检验待扣额'Response.Write check.eprorecremains(rs("cardnum"),rs("remains"))'Response.End 'Response.Write check.eprorecremains(rs("cardnum"),rs("remains"))'Response.End remains=clng(check.eprorecremains(rs("cardnum"),rs("remains")))total=clng(rs("recoup"))+remainsif (clng(rs("recoup"))<0) or (remains<0) or (total<>20000) thenerrorList="您的账户有问题,请您去邮储部门查实!"set check=nothingrs.Close set rs=nothingconnbj.Closeset connbj=nothing%><!--#INCLUDE FILE="include/error.asp" --><%Response.End else'检验余额是否足够remains=remains-clng(tradesum)if remains<0 then if session("city")="北京" then   session("remain")=0-remains   remains=0 else errorList="您的余额不足!" set check=nothing rs.Close  set rs=nothing connbj.Close set connbj=nothing

⌨️ 快捷键说明

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