📄 cartfunction.asp
字号:
<%
'//无或改信息资料
sub edit_userxx()
set rs=server.CreateObject("adodb.recordset")
rs.open "select shouname,shousex,shengshi,city,shouhuodizhi,youbian,usertel,songid,zhifufangshi from shop_user where username='"&request.cookies("bookshop")("username")&"' ",conn,1,1
set rss=server.createobject("adodb.recordset")
rss.open "select * from shop_sheng order by shengidorder",conn,1,1
response.Write "<table width=100% border=0 align=center cellpadding=2 cellspacing=1>"
response.Write "<tr><td align=center><img src=imgw/gw04.gif width=100% height=35></td></tr>"
response.Write "</table>"
response.Write "<table width=95% border=0 align=center cellpadding=0 cellspacing=1 bgcolor='#e8e8e8'>"
response.write "<tr><td STYLE='PADDING-LEFT: 10px'><img src='images\buylist.gif' border='0'></td><td align=center><b>您的订单个人信息</b></td><td align=right STYLE='PADDING-right: 10px'><img src='images\buylist.gif' border='0'></td></tr>"
response.Write "</table>"
response.Write "<table width=95% border=0 align=center cellpadding=1 cellspacing=1 bgcolor='#acacac'>"
response.Write "<form name=shouhuoxx method=post action=orderedit.asp?action=updatexx>"
response.write "<tr><td bgcolor='#ffffff'>"
response.Write "<table width=100% border=0 align=center cellpadding=1 cellspacing=1 bgcolor='#ffffff'>"
response.Write "<tr><td align=right><b>收货人姓名:</b></td>"
response.Write "<td><input name=shouname type=text id=shouname size=12 value="&trim(rs("shouname"))&"> <b>性别:</b>"
response.Write "<select name=shousex id=shousex>"
select case rs("shousex")
case ""
response.write "<option value=0 selected>男</option><option value=1>女</option>"
case "0"
response.write "<option value=0 selected>男</option><option value=1>女</option>"
case "1"
response.write "<option value=0 >男</option><option value=1 selected>女</option>"
end select
response.Write "</select></td></tr><tr><td align=right>"
response.write "<b>收货人省份:</b><td><select name=shengshi size=1 id=shengshi onChange='changeshengclass(document.shouhuoxx.shengshi.options[document.shouhuoxx.shengshi.selectedIndex].value)'>"
do while not rss.eof
response.write "<option value="&rss("shengid")
if int(rs("shengshi"))=int(rss("shengid")) then
response.Write " selected>"
else
response.Write ">"
end if
response.Write trim(rss("shengname"))&"</option>"
rss.movenext
loop
response.Write "</select>"
rss.close
set rss=nothing
response.Write " "
response.write "<b>城区:</b>"
set rs0=server.CreateObject("adodb.recordset")
rs0.Open "select * from shop_city where shengid=" &int(rs("shengshi"))& " order by cityidorder",conn,1,1
response.write "<select name=cityclass size=1 id=cityclass onChange='changecityclass(document.shouhuoxx.cityclass.options[document.shouhuoxx.cityclass.selectedIndex].value)'>"
do while not rs0.eof
response.write "<option value="&rs0("cityid")
if int(rs("city"))=int(rs0("cityid")) then
response.Write " selected>"
else
response.Write ">"
end if
response.Write trim(rs0("cityname"))&"</option>"
rs0.movenext
loop
response.Write "</select>"
rs0.close
set rs0=nothing
response.Write "</td></tr>"
response.Write "<tr><td align=right><b>详细地址:</b></td><td><input name=shouhuodizhi type=text id=shouhuodizhi size=40 value="&trim(rs("shouhuodizhi"))&"></td></tr>"
response.Write "<tr><td align=right><b>邮编:</b></td><td><input name=youbian type=text id=youbian value="&cstr(rs("youbian"))&" onkeypress = 'return regInput(this,/^[0-9]*$/, String.fromCharCode(event.keyCode))' onpaste= 'return regInput(this,/^[0-9]*$/, window.clipboardData.getData('Text'))' ondrop= 'return regInput(this, /^[0-9]*$/, event.dataTransfer.getData('Text'))'> <b>电话:</b><input name=usertel type=text id=usertel value="&trim(rs("usertel"))&"></td></tr>"
response.Write "<tr><td align=right><b>送货方式:</b></td><td>"
'//送货方式
set rs0=server.CreateObject("adodb.recordset")
rs0.Open "select * from shop_city where cityid=" &int(rs("city"))& " order by cityidorder",conn,1,1
set rs1=server.CreateObject("adodb.recordset")
rs1.Open "select * from shop_songclass where faid="&rs0("faid"),conn,1,1
dim sid(9,9),i1,i2,i3,i4
i1=0:i2=0:i3=0:i4=rs1.recordcount
'//获得类型的ID地址,并存入数组1列
do while not rs1.eof
sid(i1,0)=rs1("songid")
rs1.movenext
i1=i1+1
loop
rs0.close
set rs0=nothing
rs1.close
set rs1=nothing
set rs5=server.CreateObject("adodb.recordset")
rs5.Open "select * from shop_songhuo where fangshi=0 order by songidorder",conn,1,1
'//通过ID地址,获得SUBJECT,并存入数组2列
do while not rs5.eof
for i2=0 to i4-1
if rs5("songid")= sid(i2,0) then
sid(i2,1) = rs5("subject")
end if
next
rs5.movenext
loop
rs5.close
set rs5=nothing
response.write "<select name=songid size=5 id=songid>"
'//显示整个2维数组
for i3=0 to i4-1
if sid(i3,0)=rs("songid") then
response.write "<option selected value=" &sid(i3,0)& ">" &sid(i3,1)& "</option>"
else
response.write "<option value=" &sid(i3,0)& ">" &sid(i3,1)& "</option>"
end if
next
response.Write "</select>"
response.Write "<font color=red> 送货上门限制于北京地区四环以内</font>"
response.Write "</tr><tr><td align=right><b>支付方式:</b></td><td>"
'//支付方式
set rs2=server.CreateObject("adodb.recordset")
rs2.Open "select * from shop_songhuo where fangshi=1 order by songidorder",conn,1,1
response.Write "<select name=zhifufangshi size="&rs2.recordcount&" id=zhifufangshi>"
do while not rs2.eof
response.Write "<option value="&rs2("songid")
if int(rs("zhifufangshi"))=int(rs2("songid")) then
response.Write " selected>"
else
response.Write ">"
end if
response.Write trim(rs2("subject"))&"</option>"
rs2.movenext
loop
response.Write "</select>"
rs2.close
set rs2=nothing
response.Write "<font color=red> 如要发票将增加购书款5%的税费</font>"
response.Write "</tr></table>"
response.Write "<tr bgcolor='#ffffff'><td height=32 colspan=2 ><div align=right STYLE='PADDING-right: 100px'><input type=submit name=Submit value=提交保存 onclick='return checkshouhuoxx();'></div></td></tr>"
response.Write "</form></table>"
rs.close
set rs=nothing
end sub
'//有信息资料
sub list_userxx()
dim cha_name
i=0:total0=0:total1=0:total2=0:total3=0:cha_smlmoney=0:cha_summoney=0
response.Write "<table width=100% border=0 align=center cellpadding=2 cellspacing=1>"
response.Write "<tr><td align=center><img src=imgw/gw03.gif width=100% height=35></td></tr>"
response.Write "</table>"
response.Write "<table width=95% border=0 align=center cellpadding=2 cellspacing=1 bgcolor='#acacac'>"
response.Write "<tr>"
response.Write "<td width=34% bgcolor=#e8e8e8><div align=center>商品名称</div></td>"
response.Write "<td bgcolor=#e8e8e8><div align=center>市场价</div></td>"
response.Write "<td bgcolor=#e8e8e8><div align=center>会员价</div></td>"
response.Write "<td bgcolor=#e8e8e8><div align=center>数量</div></td>"
response.Write "<td bgcolor=#e8e8e8><div align=center>市场价小计</div></td>"
response.Write "<td bgcolor=#e8e8e8><div align=center>会员价小计</div></td>"
response.Write "<td bgcolor=#e8e8e8><div align=center>节省金额</div></td>"
response.Write "</tr>"
while i<bkindex
bookid = bk(i,0)
bookname = bk(i,1)
purchase = bk(i,2)
shichangjia = bk(i,3)
huiyuanjia = bk(i,4)
if bk(i,2)<>0 then
response.Write "<tr>"
response.Write "<td width=34% bgcolor=#ffffff><div align=center><font color=blue>"&bookname&"</font></td>"
response.Write "<td bgcolor=#ffffff><div align=center><strike><font color=blue>"&shichangjia&"</font></strike></td>"
response.Write "<td bgcolor=#ffffff><div align=center><font color=blue>"&huiyuanjia&"</font></td>"
response.Write "<td bgcolor=#ffffff><div align=center><font color=blue>"&purchase&"</font></td>"
total2=purchase*shichangjia
total1=purchase*huiyuanjia
response.Write "<td bgcolor=#ffffff><div align=center><strike><font color=blue>"&formatnumber(total2,2)&"</font></strike></td>"
response.Write "<td bgcolor=#ffffff><div align=center><font color=blue>"&formatnumber(total1,2)&"</font></td>"
response.Write "<td bgcolor=#ffffff><div align=center><font color=blue>"&formatnumber((total2-total1),2)&"</font></td>"
response.Write "</tr>"
total0=total0+total1
total3=total3+total2
i=i+1
else
i=i+1
end if
wend
'//根据送货方式计算送货费用
set rs3=server.CreateObject("adodb.recordset")
rs3.open "select shop_songhuo.subject,shop_songhuo.jsmoney,shop_songhuo.gsmoneyside,shop_songhuo.gsmoneybili from shop_user INNER JOIN shop_songhuo ON shop_user.songid = shop_songhuo.songid where shop_user.username='"&request.Cookies("bookshop")("username")&"' ",conn,1,1
if rs3.eof and rs3.bof then
cha_name="方式已被删除"
cha_smlmoney=0
cha_summoney=0
else
if total0<rs3("gsmoneyside") then
cha_name=trim(rs3("subject"))
cha_smlmoney=rs3("jsmoney")
cha_summoney=formatnumber((rs3("jsmoney")+total0),2)
else
if total0<2*rs3("gsmoneyside") then
cha_name=trim(rs3("subject"))
cha_smlmoney=formatnumber((rs3("jsmoney")+(total0*rs3("gsmoneybili")*0.5)), 2)
cha_summoney=formatnumber((rs3("jsmoney")+total0*(1+rs3("gsmoneybili")*0.5)),2)
else
cha_name=trim(rs3("subject"))
cha_smlmoney=formatnumber((rs3("jsmoney")+total0*rs3("gsmoneybili")), 2)
cha_summoney=formatnumber((rs3("jsmoney")+total0*(1+rs3("gsmoneybili"))),2)
end if
end if
end if
rs3.Close
set rs3=nothing
response.Write "<tr>"
response.Write "<td width=40% bgcolor=#ffffff height=18><div align=center><font color=#FF0000><b>商品价格总计</b></font></div></td>"
response.Write "<td bgcolor=#ffffff><td bgcolor=#ffffff><td bgcolor=#ffffff><td bgcolor=#ffffff><div align=center><font color=#FF0000><strike>"&formatnumber(total3,2)&"</strike>元</font></div><td bgcolor=#ffffff><div align=center><font color=#FF0000>"&formatnumber(total0,2)&"元</font></div></td><td bgcolor=#ffffff></font></td>"
response.Write "</tr>"
response.Write " </table>"
response.Write "<table width=95% border=0 align=center cellpadding=2 cellspacing=1 bgcolor='#acacac'>"
response.Write "<tr><td bgcolor=#e8e8e8 colspan=2 align=center>送货费用明细</td>"
response.Write "<tr><td bgcolor=#ffffff width=80% align=right>配送费用 <font color=#FF0000>"&cha_name&"+"&cha_smlmoney&"</font>元 </td><td bgcolor=#ffffff><div align=center><font color=#FF0000>"&cha_smlmoney&"元</font></div></td>"
response.Write "<tr><td bgcolor=#e8e8e8 width=80% align=center><font color=#FF0000><b>您的订单总金额</b></font></td><td bgcolor=#e8e8e8><div align=center><font color=#FF0000>"&cha_summoney&"元</font></div></td>"
response.Write "</tr></table><br>"
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -