📄 pro_data.asp
字号:
sssa=sssa+"99"&"F"&"@"&"9"&"@"&"*"&"@"&"常规价"&"@"&"G"&"^"
graner=sssa
graner=mid(graner,1,len(graner)-1)
'response.write graner
rs.close
end function
function returndiscountstr(adiscount)
select case adiscount
case 97
returndiscountstr="经济舱"
case 98
returndiscountstr="商务舱"
case 99
returndiscountstr="头等舱"
case else
returndiscountstr=adiscount&"折"
end select
end function
function isnulltovalue(str)
if isnull(str) then
isnulltovalue=""
else
isnulltovalue=str
end if
end function
function onlyY(SC,EC)
set rs=conn.execute(" select Y from taprice where 航段='"&SC+EC&"' or 航段='"&EC+SC&"' ")
If Not(rs.eof Or rs.bof) then
onlyY=rs("Y")
Else
onlyY=0
End if
rs.close
end function
'''客户端静态、动态特价,格式是:折扣+舱位@静/动标志@数量@Rebate(@标志@航班号@航空公司)^
'''服务器参数格式:折扣、舱位@静动@数量@rabte@标志@航班号@航空公司@供应商@返点@返绝对价格@条件说明
'==================lyq====================2007-3-14 此函数是获取客户端的动\静特价的原始数据
function get_c_actionbunk(date,sc,ec,fullprice)
sql="select price,bunk,num,rebate,ifdynamicbunk,flightno,airwayName from MyBunkMessage where (ifactive=true and flyDate<=#"&date&"# and endDatetime>=#"&date&"# and (ifdynamicbunk=1 or ifdynamicbunk=0 or (ifdynamicbunk=2 and (startcity='"&sc&"' or startcity='') and (endcity='"&ec&"' or endcity='') ))) order by price"
''response.Write (sql)&"<br>"
set rs =conn.execute(sql)
if not rs.eof then
do while not rs.eof
if isnull(rs("price")) then
zheprice=0
else
if rs("price")>100 then
zheprice=pricetodiscount(rs("price"),fullprice,1)
else
zheprice=rs("price")
end if
end if
sss=sss+trim(rs("bunk"))
str=zheprice&trim(isnulltovalue(rs("bunk")))&"@"&rs("ifdynamicbunk")&"@"&isnulltovalue(rs("num"))&"@"&isnulltovalue(rs("rebate"))&"@"&"C"&"@"&rs("flightno")&"@"&rs("airwayname")&"^"
'response.Write(str)
sstr=sstr+str
rs.movenext
loop
end if
rs.close
set rs=nothing
if len(sstr)>1 then
get_c_actionbunk=mid(sstr,1,len(sstr)-1)
else
get_c_actionbunk=""
end if
end function
'''=========lyq===========2007-3-27 求客户端及服务器端的特价信息进行处理
function getactionbunk(flightno,client_bunk,server_bunk)
c_bunk=""
if len(trim(client_bunk))>6 then
array_client_bunk=split(client_bunk,"^")
for m=lbound(array_client_bunk) to ubound(array_client_bunk)
C_array_bunk_infor=split(array_client_bunk(m),"@")
select case C_array_bunk_infor(1)
case 2'动航线
if C_array_bunk_infor(6)=trim(left(split_fly(fly_values(i),3),2)) then'航空公司
c_bunk=c_bunk+array_client_bunk(m)+"^"
end if
case 1'动航班
if C_array_bunk_infor(5)=flightno then
c_bunk=c_bunk+array_client_bunk(m)+"^"
end if
case 0'静态特价
if C_array_bunk_infor(5)=flightno then
c_bunk=c_bunk+array_client_bunk(m)+"^"
end if
end select
next
end if
s_bunk=""
if len(trim(server_bunk))>9 then
array_server_bunk=split(server_bunk,"#")
for n=lbound(array_server_bunk) to ubound(array_server_bunk)
array_bunk_infor=split(array_server_bunk(n),"@",3)
if array_bunk_infor(0)="" then
zheprice=0
else
if CDbl(array_bunk_infor(0))>100 then
zheprice=pricetodiscount(CDbl(array_bunk_infor(0)),fullprice,1)
else
zheprice=CDbl(array_bunk_infor(0))
end if
end if
s_bunk=s_bunk+cstr(zheprice)&array_bunk_infor(1)&"@"&array_bunk_infor(2)+"^"
next
end if
sum_bunk=trim(c_bunk)+trim(s_bunk)
if len(sum_bunk)>0 then
getactionbunk=mid(sum_bunk,1,len(sum_bunk)-1)
else
getactionbunk=""
end if
'response.write getactionbunk&"<br>"
end function
function availbunk(str)
ssbunk=split(str,"^")
for y=0 to Ubound(ssbunk)
aabunk=aabunk+mid(ssbunk(y),3,1)
next
availbunk=aabunk
end function
function IsValidAvial(abunk)
IsValidAvial=false
if Instr("A123456789",abunk)>0 then
IsValidAvial=true
end if
end function
'90T@0@*@常规价^85K@0@*@常规价^80H@0@*@常规价^75M@0@*@常规价^70G@0@*@常规价^65S@0@*@常规价^60L@0@*@常规价^55Q@0@*@常规价^50E@0@*@常规价^45V@0@*@常规价^40X@0@*@常规价
'40P@1@@特价舱^55T@1@@特价舱^70R@1@@特价舱^80K@1@@特价舱
'FAFF1100@YAYY730@TA90660@KA85620@HA80580@P2000@R2000@Z5000
'''对舱位进行组合
'==============lyq2007-3-17=================================
function findbunk(graner,getactionbunk,str)
getactionbunkIfAction=split(getactionbunk,"^")
for ifAction=lbound(getactionbunkIfAction) to ubound(getactionbunkIfAction)
strIfAction=split(getactionbunkIfAction(ifAction),"@")
if strIfAction(1)=0 then'静态
getactionbunk2=getactionbunk2+getactionbunkIfAction(ifAction)+"#"
else'动航线、动航班
getactionbunk1=getactionbunk1+getactionbunkIfAction(ifAction)+"^"
end if
next
if len(getactionbunk2)=0 then
getactionbunk2=""
end if
if len(getactionbunk1)<>0 then
getactionbunk1=mid(getactionbunk1,1,len(getactionbunk1)-1)
else
getactionbunk1=""
end if
sfindbunk=graner&"^"&getactionbunk1 '得到所有常规和动态仓位列表
'response.write sfindbunk&"<br>"
Arrayfindbunk=split(sfindbunk,"^") '装入到数组
''response.write str&"<br>"
Arrayavailbunk=split(str,"@") '从服务器传来的舱位(可用数量为)
for k=ubound(Arrayfindbunk) to lbound(Arrayfindbunk) step -1 '从常规和动态先循环,保证同一舱位既有常规还有动态都可以显示
sstr=Arrayfindbunk(k)
genbunk=mid(sstr,3,1) '预先取出舱位
if sstr<>"" and genbunk<>"" then
for j=lbound(Arrayavailbunk) to ubound(Arrayavailbunk)
'response.write mid(Arrayavailbunk(j),1,1)&"<br>"
if genbunk=mid(Arrayavailbunk(j),1,1) and IsValidAvial(mid(Arrayavailbunk(j),2,1)) then '如果在服务器的舱包含,而且票数>0
'response.write mid(sstr,1,2)&"L"&mid(Arrayavailbunk(j),1,2)&"<br>"
resultstr=resultstr+mid(sstr,1,2)+mid(Arrayavailbunk(j),1,2)+mid(sstr,4,len(sstr)-3)+"#" '则常规的描述,放入到可用数组中
' response.write resultstr&"resultstr"&"<br>"
exit for
end if
next
end if
next
if len(resultstr)<>0 then
resultstr2=resultstr+getactionbunk2
findbunk=mid(resultstr2,1,len(resultstr2)-1)
'response.write findbunk&"<br>"
else
findbunk=""
end if
end function
'===========================
function onlyY(SC,EC)
set rs=conn.execute(" select Y from taprice where 航段='"&SC+EC&"' or 航段='"&EC+SC&"' ")
if not rs.eof then
onlyY=rs("Y")
else
onlyY=0
end if
rs.close
end function
function fullpricebunk(str,SC,EC)
ipos=instr(str,"YY")
if (ipos>0) then
parstr=mid(str,ipos+2,len(str)-ipos-1)
endindex=instr(parstr,"@")
if endindex<>0 then
otherindex=instr(parstr,"|")
if otherindex>0 then
fullpricebunk=mid(parstr,1,otherindex-1)
else
fullpricebunk=mid(parstr,1,endindex-1)
end if
end if
if isnull(fullpricebunk) then
fullpricebunk=onlyY(SC,EC)
end if
end if
end function
'=======================
function restr(aa)
ra=Split(aa,"@")
For e=0 To UBound(ra)-1
For r=e+1 To UBound(ra)
If ra(e)=ra(r) Then
ra(r)=""
Exit For
End If
Next
Next
restr=ra(0)
For e=1 To UBound(ra)
If Not ra(e)="" Then
restr=restr&"@"&ra(e)
End If
next
end function
'==========
function falsebunk(str,flyNo,date)'去假位
sql="select bunk from Repbunk where FlightNo='"&flyNo&"' and flyDate<=#"&date&"# and endDatetime>=#"&date&"#"
set rs =conn.execute(sql)
if not rs.eof then
bunk8=rs("bunk")
end if
rs.close
Arrayavailbunki=split(str,"@")
for ij=lbound(Arrayavailbunki) to ubound(Arrayavailbunki)
if instr(bunk8,mid(Arrayavailbunki(ij),1,1))=0 then
'Arrayavailbunki(ij)=Arrayavailbunki(ij+1)
'else
falsebunk3=falsebunk3+Arrayavailbunki(ij)+"@"
end if
next
if len(falsebunk3)>0 then
falsebunk3=mid(falsebunk3,1,len(falsebunk3)-1)
else
falsebunk3=""
end if
falsebunk=falsebunk3
end function
'===========================
sub substrtoint(str)
if len(str)>2 then
substrtoint=Cint(mid(str,1,2))
else
substrtoint=0
end if
'response.Write(substrtoint)
end sub
Sub QuickSort1(arr,Low,High)
Dim i,j,x,y,k
i=Low
j=High
x=cint(mid(arr(Cint((Low+High)/2),1,2)))
Do
While (cint(mid(arr(i),1,2)-x<0 and i<High))
i=i+1
Wend
While (x-cint(mid(arr(j),1,2))<0 and j>Low)
j=j-1
Wend
If i<=j Then
y=arr(i)
arr(i)=arr(j)
arr(j)=y
i=i+1
j=j-1
End if
Loop while i<=j
If Low<j Then call QuickSort1(arr,Low,j)
If i<High Then call QuickSort1(arr,i,High)
End sub
Function BubbleSort(ary)''排序函数
Dim KeepChecking,I,FirstValue,SecondValue
KeepChecking = TRUE
Do Until KeepChecking = FALSE
KeepChecking = FALSE
For I = 0 to UBound(ary)
If I = UBound(ary) Then Exit For
If (cint(mid(ary(I),1,2))>cint(mid(ary(I+1),1,2))) Then
FirstValue = ary(I)
SecondValue = ary(I+1)
ary(I) = SecondValue
ary(I+1) = FirstValue
KeepChecking = TRUE
End If
total=total+1
Next
Loop
BubbleSort = ary
End Function
'dim ID,ArrayID,Myarray,M
'ID="55,48,78,10,90"
'ArrayID=split(ID,",")
'Myarray=Sort(ArrayID)
'排序测试
'For M=0 To Ubound(Myarray)
' Response.Write Myarray(M) & "<br>" & vbCRLF
'Next
'当然也可以用下面的,
'Dim Myarray
'Myarray=Array(12,10,25,78,45)
'Myarray=Sort(ArrayID)
'排序测试
'For M=0 To Ubound(Myarray)
' Response.Write Myarray(M) & "<br>" & vbCRLF
'Next
'--------------------------返回航空公司代码
'function check_hang(str)
'sql="select AirwayName,CarrierCode from Airways"
' set rs=conn.execute(sql)
' Do while not rs.eof
' F_Airways=trim(rs("AirwayName"))
' F_CarrierCode=trim(rs("CarrierCode"))
'select case(str)
' case F_Airways returnvalue=F_CarrierCode
'end Select
' rs.movenext
' Loop
' rs.close
' Set rs=nothing
' check_hang=returnvalue
'end function
'------------------------------
function check_hang(str)
select case(str)
case "中国国际航空公司" returnvalue="CA"
case "东方航空公司" returnvalue="MU"
case "南方航空公司" returnvalue="CZ"
case "海南航空公司" returnvalue="HU"
case "上海航空公司" returnvalue="FM"
case "厦门航空公司" returnvalue="MF"
case "深圳航空公司" returnvalue="ZH"
case "四川航空公司" returnvalue="3U"
case "山东航空公司" returnvalue="SC"
end select
check_hang=returnvalue
end function
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -