<%
const x_ddy=8
const x_ddm=1000
const x_ddck="EESaigysok"
const x_ddgx="@@"
const x_ddga="##"
const x_ddgb="||"
dim x_ddtj:x_ddtj=i_dir&"?deal/3/asai.html"
dim x_dddcs,x_dddus,x_dddjj,x_dddsn,x_dddsl
'-----------------------------------
'order main sub (start)
'ddsai(ddfty=11del cokies|1=del|2=jian|>3=jia|8=act,ddfstr,ddfsn=0|,ddfjg,ddfsl,ddfbt,ddfus)
'-----------------------------------
function ddsai(ddfty,ddfstr,ddfsn,ddfjg,ddfsl,ddfbt,ddfus)
if not isNumeric(ddfty) then ddfty=0
if ddfsn="" or ddfsn="0" then
if ddfty=11 then
response.Cookies(x_ddck)=""
else
response.Cookies(x_ddck)=ddfstr
end if
else
if not isNumeric(ddfjg) then ddfjg=0
if not isNumeric(ddfsl) then ddfsl=0
if ddfbt="" then ddfbt=ddfsn
if ddfus="" then ddfus=ew_kz
dim ddxdrr,ddxdi,ddxdls,ddxdud,ddadrr,ddadi,ddadls,ddadud,ddbdrr,ddbdsn,ddbdjg,ddbdsl,ddbdbt,ddadus,ddzdcl,ddzdck,ddzdty,ddzdact
ddzdty=0
ddzdck=""
ddzdcl=x_ddgx&ddfus&x_ddga&ddfsn&x_ddgb&ddfjg&x_ddgb&ddfsl&x_ddgb&ddfbt
if ddfstr<>"" then'0-1-A
ddxdrr=split(ddfstr,x_ddgx)
ddxdud=ubound(ddxdrr)
if ddxdud>0 then
if instr(ddfstr,x_ddgx&ddfus)>0 then'0-3-A
ddzdty=1
for ddxdi=1 to ddxdud'@@
ddxdls=ddxdrr(ddxdi)
if ddxdls<>"" then
ddadrr=split(ddxdls,x_ddga)
ddadud=ubound(ddadrr)
ddadus=ddadrr(0)
if ddadud>0 then
if ddadus=ddfus then'0-5-A
ddzdcl=x_ddgx&ddadus
if instr(ddxdls,x_ddga&ddfsn&x_ddgb)>0 then'0-6-A
for ddadi=1 to ddadud'##
ddadls=ddadrr(ddadi)
ddbdrr=split(ddadls,x_ddgb)'||
if ubound(ddbdrr)=3 then
ddbdsn=ddbdrr(0)
ddbdjg=ddbdrr(1)
ddbdsl=ddbdrr(2)
ddbdbt=ddbdrr(3)
if not isNumeric(ddbdjg) then ddbdjg=0
if not isNumeric(ddbdsl) then ddbdsl=0
if ddbdsn=ddfsn then'0-8-A
if ddfty=1 then'0-9-A------del
'ddzdcl=ddzdcl
elseif ddfty=2 then'0-9-A------jian
if ddfsl<2 then ddfsl=1
ddbdsl=ddbdsl-ddfsl
if ddbdsl>0 then ddzdcl=ddzdcl&x_ddga&ddbdsn&x_ddgb&ddbdjg&x_ddgb&ddbdsl&x_ddgb&ddbdbt
elseif ddfty>2 then'0-9-A------jia
if ddfjg>0 and not ddbdjg=ddfjg then ddbdjg=ddfjg
if ddfty=3 then
if ddfsl>0 then ddbdsl=ddfsl
ddzdcl=ddzdcl&x_ddga&ddbdsn&x_ddgb&ddbdjg&x_ddgb&ddbdsl&x_ddgb&ddbdbt
elseif ddfty>3 then
if ddfsl<2 then ddfsl=1
ddbdsl=ddbdsl+ddfsl
ddzdcl=ddzdcl&x_ddga&ddbdsn&x_ddgb&ddbdjg&x_ddgb&ddbdsl&x_ddgb&ddbdbt
if ddfty=9 then ddzdact="<script language=javascript>alert('提示：购物车已有["&ddbdbt&"]，本操作在原数量上增加"&ddfsl&"件，当前共有["&ddbdsl&"]件。');</script>"
end if
end if'0-9-C
else'0-8-B
ddzdcl=ddzdcl&x_ddga&ddadls
end if'0-8-C
end if
next
else'0-6-B
ddzdcl=x_ddgx&ddxdls&x_ddga&ddfsn&x_ddgb&ddfjg&x_ddgb&ddfsl&x_ddgb&ddfbt
if ddfty=9 then ddzdact="<script language=javascript>alert('提示：成功添加"&ddadus&"["&ddfbt&"]"&ddfsl&"件。');</script>"
end if'0-6-C
else'0-5-B
ddzdck=ddzdck&x_ddgx&ddxdls
end if'0-5-C
end if
end if
next
end if'0-3-C
end if
end if'0-1-C
if ddzdty>0 then
ddzdck=ddzdcl&ddzdck
else
ddzdck=ddzdcl&ddfstr
if ddfty=9 then ddzdact="<script language=javascript>alert('提示：成功添加["&ddfbt&"]"&ddfsl&"件。');</script>"
end if
if ddfty>0 then response.Cookies(x_ddck)=ddzdck
if ddzdact<>"" and ddfty=9 then ddsai=ddzdact
end if
end function
'-----------------------------------
'order show
'-----------------------------------
dim ddshid,ddshyh,ddshhj,ddshsf,ddshzl,ddshsl,ddshyhx,ddshhjx,ddshsfx,ddshzlx,ddshslx,ddshxxx,ddshusx,dddts,ddduhty,ddduhjq,ddduhje,ddduhus
function ddshow(ddfstr,ddfty,ddfjm)
'response.Write ddfstr
dim ddjmrr,ddjmy,ddjmx,ddjmn,ddjmh,ddjmlm
'ddfjm=减免|限额|编码|用户
ddjmrr=split(ddfjm,"|")
ddjmlm=0
if ubound(ddjmrr)=3 then
ddjmy=int(ddjmrr(0))
ddjmx=int(ddjmrr(1))
ddjmn=ddjmrr(2)
ddjmh=ddjmrr(3)
else
ddjmy=0
ddjmx=0
ddjmn=""
ddjmh=""
end if
dim ddxdrr,ddxdi,ddxdls,ddxdud,ddadrr,ddadi,ddadls,ddadud,ddbdrr,ddbdsn,ddbdjg,ddbdsl,ddbdbt,ddadus
ddshyhx=0
ddshzlx=0
ddshslx=0
ddshhjx=0
ddshid=0
ddshxxx=""
if not isNumeric(ddfty) then ddfty=4
ddshow="<table border=0 cellspacing=0 cellpadding=0 class=d-vt>"
if ddfstr<>"" then'0-1-A
ddxdrr=split(ddfstr,x_ddgx)
ddxdud=ubound(ddxdrr)
x_dddcs=ddxdud
if ddxdud>0 then
for ddxdi=1 to ddxdud'@@
ddxdls=ddxdrr(ddxdi)
if ddxdls<>"" then
ddadrr=split(ddxdls,x_ddga)
ddadud=ubound(ddadrr)
ddadus=ddadrr(0)
if ddadud>0 then
ddshzl=0
ddshsl=0
ddshhj=0
ddshid=ddshid+1
x_dddus=x_dddus&x_ddgx&ddadus
ddshow=ddshow&"<tr class=d-vta><td colspan="&ddfty&">"&ddadus&" 订单"&ddxdi&"</td></tr>"
if ddfty="7" then
ddshow=ddshow&"<tr class=d-vtt><td>名称</td><td width=32>单价</td><td width=68 align=center colspan=3>数量</td><td width=32>小计</td><td width=32 align=center>删除</td></tr>"
else
ddshow=ddshow&"<tr class=d-vtt><td>名称</td><td width=32>单价</td><td width=32 align=center>数量</td><td width=68>小计</td></tr>"
end if
for ddadi=1 to ddadud'##
ddadls=ddadrr(ddadi)
ddbdrr=split(ddadls,x_ddgb)'||
if ubound(ddbdrr)=3 then
ddbdsn=ddbdrr(0)
ddbdjg=ddbdrr(1)
ddbdsl=ddbdrr(2)
ddbdbt=ddbdrr(3)
x_dddsn=x_dddsn&x_ddgx&ddbdsn
x_dddsl=x_dddsl&x_ddgx&ddbdsl
if not isNumeric(ddbdjg) then ddbdjg=0
if not isNumeric(ddbdsl) then ddbdsl=0
if ddadi mod 2=0 then
ddshow=ddshow&"<tr class=d-vt1>"
else
ddshow=ddshow&"<tr class=d-vt0>"
end if
ddshow=ddshow&"<td><a target=""_blank"" href=""/?info/"&ddbdsn&".html"">"&ddbdbt&"</a></td><td>"&ddbdjg&"</td>"
if ddfty="7" then
ddshow=ddshow&"<td align=left>"
if ddbdsl<2 then
ddshow=ddshow&"<span class=d-vfs title=已达最小值>-</span>"
else
ddshow=ddshow&"<a class=d-vaj href=?jian/"&ddbdsn&"/"&ddadus&">-</a>"
end if
ddshow=ddshow&"</td><td align=center><input type=text value="&ddbdsl&" class=d-vfi onchange=""if(this.value!=0&&this.value!==''){location.href='?edit/"&ddbdsn&"/"&ddadus&"/'+this.value+'';}""></td><td align=right><a class=d-vaj href=?jia/"&ddbdsn&"/"&ddadus&">+</a></td><td>"&ddbdjg*ddbdsl&"</td><td align=center><a class=d-vajx href=?del/"&ddbdsn&"/"&ddadus&">×</a></td>"
else
ddshow=ddshow&"<td align=center>"&ddbdsl&"</td><td>"&ddbdjg*ddbdsl&"</td>"
end if
ddshow=ddshow&"</tr>"
ddshzl=ddshzl+1
ddshsl=ddshsl+ddbdsl
ddshhj=ddshhj+int(ddbdjg*ddbdsl)
end if
next
if ddshhj<x_ddm then:ddshyh=x_ddy:else:ddshyh=0:end if
ddshsf=ddshhj+ddshyh
ddshow=ddshow&"<tr class=d-vtd><td colspan="&ddfty&" align=left>单品种类："&ddshzl&" 种<br>商品数量："&ddshsl&" 件<br>总计价格："&ddshhj&" 元"
ddshow=ddshow&"<br>服务费用："&ddshyh&" 元（如快递费、安装费、售后服务费等，满"&x_ddm&"元免服务费）"
if ddjmh<>"" and ddjmh=ddadus and ddshsf>=ddjmx then
ddjmlm=1
ddshow=ddshow&"<br>优惠信息："&ddjmy&" 元（使用"&ddjmh&"优惠券"&ddjmn&"满"&ddjmx&"减免"&ddjmy&"）"
ddshsf=ddshsf-ddjmy
end if
x_dddjj=x_dddjj&x_ddgx&ddshsf
ddshow=ddshow&"<br>实际应付：<span class=d-vsb>"&ddshsf&"</span> 元"
ddshxxx=ddshxxx&"|"&ddadus&"|"&ddshsf
ddshow=ddshow&"</td></tr>"
ddshzlx=ddshzlx+ddshzl
ddshslx=ddshslx+ddshsl
ddshhjx=ddshhjx+ddshhj
ddshyhx=ddshyhx+ddshyh
ddshsfx=ddshsfx+ddshsf
end if
end if
next
dim ddshlin
ddshlin="<tr class=d-vtd><td colspan="&ddfty&" align=left>单品种类："&ddshzlx&" 种<br>商品数量："&ddshslx&" 件<br>总计价格："&ddshhjx&" 元"
ddshlin=ddshlin&"<br>服务费用："&ddshyhx&" 元"
if ddjmh<>"" and ddjmh=ew_kt and ddshsfx>=ddjmx then
ddjmlm=2
ddshlin=ddshlin&"<br>优惠信息：约"&ddjmy&" 元（使用优惠券"&ddjmn&"满"&ddjmx&"减免约"&ddjmy&"）"
ddshsfx=ddshsfx-ddjmy
end if
if ddshid>1 and ddjmlm=2 then
dim ddsxrr,ddsxi,ddsxsfl,ddsxsf,ddsxjm
ddsxrr=split(ddshxxx,"|")
ddsxsfl=ddshsfx
ddshsfx=0
ddshlin=ddshlin&"<br>子订单优惠价格如下："
for ddsxi=1 to ubound(ddsxrr) step 2
ddsxsf=int(ddsxrr(ddsxi+1))
ddshlin=ddshlin&"<br>"&ddsxrr(ddsxi)&"："&ddsxsf&"-"&int(ddjmy*(ddsxsf/ddsxsfl))&"="
ddsxsf=ddsxsf-int(ddjmy*(ddsxsf/ddsxsfl))
ddshlin=ddshlin&"<span class=d-vsb>"&ddsxsf&"</span> 元"
ddshsfx=ddshsfx+ddsxsf
next
end if
ddshusx=""
if ddxdi=2 then ddshusx=ddadus
if ddshusx="" then ddshusx=ew_kf
ddshlin=ddshlin&"<br>最终支付：<span class=d-vsb>"&ddshsfx&"</span> 元"
ddshlin=ddshlin&"</td></tr>"
if x_dddcs>1 then ddshow=ddshow&ddshlin
end if
end if'0-1-C
if ddshslx=0 then ddshow=ddshow&"<tr class=d-vtd><td colspan="&ddfty&" align=center>暂无商品</td></tr>"
ddshow=ddshow&"</table>"
End function
'-----------------------------------
'car show
'-----------------------------------
function ddcar(ddfstr)
'ddcar=ddshow(ddfstr,7,"200|2000|ddfgtgvbcvgh|eesai")
ddcar=ddshow(ddfstr,7,"100|2000|ddfgtgvbcvgh|"&ew_kt&"")
'ddcar=ddshow(ddfstr,7,0)
End function
'-----------------------------------
'order read
'-----------------------------------
function ddread(ddfstr,ddfjm)
ddread=ddshow(ddfstr,4,ddfjm)
end function
%>