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

📄 pro_data.asp

📁 机票预定系统 各个模块的设计-ticket reservation systems detailed design system modules of the design
💻 ASP
📖 第 1 页 / 共 2 页
字号:

<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<%
'日期格式转换
Function SenFe_Date(Content) 
If IsDate(Content) = False Then Exit Function 
Content = CDate(Content) 
SenFe_Date = Year(Content)&"-"& Right("0"&Month(Content),2)&"-"&Right("0"&Day(Content),2) 
End Function
'字符分割转换函数
function  split_str(str,nu1,nu2)
   if len(str)>20 then
     aa=split(str,"&")
     bb=split(aa(nu1),"=")
     split_str=bb(nu2)
	else
	 exit function
	end if
end function
'================================
function ta_you(StartCity8,EndCity8)
		sqlf="select top 1 FeeOil1,FeeOil2,FeeOilDistance from system"
 	set rsf=conn.execute(sqlf)
 	if not rsf.eof then
 	  FeeOil1=rsf("FeeOil1")
 	  FeeOil2=rsf("FeeOil2")
 	  FeeOilDistance=rsf("FeeOilDistance")
	  if isnull(rsf("FeeOil1")) or rsf("FeeOil1")="" then
	   FeeOil1=0
	  end if
	  if isnull(rsf("FeeOil2")) or rsf("FeeOil2")="" then
	   FeeOil2=0
	  end if
	  if isnull(rsf("FeeOilDistance")) or rsf("FeeOilDistance")="" then
	   FeeOilDistance=0
	  end if
 	end if
 rsf.close
 set rsf=nothing
 	
   		sql2="  select distance  from TAPrice   where  not isnull(distance) and (航段='"&trim(StartCity8)+trim(EndCity8)&"'  or 航段='"&trim(EndCity8)+trim(StartCity8)&"')  "		  
           
	  
		   set rs=conn.execute(sql2)
  if not rs.eof then
  		if isnull(rs("distance")) or rs("distance")="" then 
		  ryou=clng(FeeOilDistance)
		  else
	      ryou=clng(rs("distance"))
		end if
		  session(ryou)=trim(ryou)
	      if ryou=>clng(FeeOilDistance) then ta_you=trim(FeeOil2)
	      if ryou<clng(FeeOilDistance) then ta_you=trim(FeeOil1)
		 else
		  ta_you=trim(FeeOil2) 
  end if
	rs.close
	set rs=nothing
end function
'=========================================
function ta_jianshe(StartCity8,EndCity8)

	sqlo="select top 1 FeeAirBuilding1,FeeAirBuilding2 from system"
 	set rso=conn.execute(sqlo)
 	if not rso.eof then
 	  FeeAirBuilding1=rso("FeeAirBuilding1")
 	  FeeAirBuilding2=rso("FeeAirBuilding2")
	  if isnull(rso("FeeAirBuilding1")) or rso("FeeAirBuilding1")="" then
	   FeeAirBuilding1=0
	  end if
	  if isnull(rso("FeeAirBuilding2")) or rso("FeeAirBuilding2")="" then
	   FeeAirBuilding2=0
	  end if	  
 	end if
 	rso.close
	set rso=nothing


   	sql3="  select ConstracteTax  from TAPrice   where  not isnull(ConstracteTax) and (航段='"&trim(StartCity8)+trim(EndCity8)&"'  or 航段='"&trim(EndCity8)+trim(StartCity8)&"')  "		  
    set rs=conn.execute(sql3)
	
if not rs.eof then
	    jianshe=clng(rs("ConstracteTax"))
		session(jianshe)=trim(jianshe)
	      if jianshe="" then 
		  ta_jianshe=FeeAirBuilding1
			  Else
		  ta_jianshe=FeeAirBuilding2
		  end If
	Else
	ta_jianshe=FeeAirBuilding1 
end if
	rs.close
	set rs=nothing
end function
'=========================================
function ta_distance(StartCity8,EndCity8)
	    	set rs=conn.execute("select distance from TAprice where  not isnull(distance) and (航段='"&trim(StartCity8)+trim(EndCity8)&"'  or  航段='"&trim(EndCity8)+trim(StartCity8)&"') ")
	if not rs.eof then
	ta_distance=clng(rs("distance"))   '里程
	end if
	rs.close
	set rs=nothing
end function
'=========================================


function    split_fly(str,nu1)
   if len(str)>1 then
           dd=split(str,"^")
		   If nul<=UBound(dd) then
           split_fly=dd(nu1)
		   Else 
		   split_fly=dd(UBound(dd))
		   End if

	else
	   exit function
	end if
end function
'=====================
function  fly_str(str)
 if len(str)>70 then
      proid=split(str,"&")
	  if ubound(proid)-1>=7 then
		  for i=7 to ubound(proid)-1 '分离
					fly_str=fly_str+proid(i)+"&"  '组合
		  next
		  fly_str=left(fly_str,len(fly_str)-1)
	  else
		errclose("对不起,暂无航班信息!")
		response.End
	  end if
 else
 	errclose("对不起,暂无航班信息!")
	response.End
 end if
end function
'=============================
function spzz(str)
  select case str
    case "YY"
          spzz="经济舱"
	case "FF"
	      spzz="头等舱"
	case "CC"
	      spzz="公务舱"
	case "00"
	      spzz="特价舱"
	case else
	spzz=str&"折"
  end select
end function
'==============================
function  isnonull(str,spstr)
  if len(str)>0 then
      arraystr=split(str,spstr)
        for t= 0 to ubound(arraystr)
           cstrdd=Mid(arraystr(t),3,1)
		    If cstrdd<>"0" Then
		          zz=zz+arraystr(t)+spstr			  
            Else
     		   If Mid(arraystr(t),5,1)<>""  Then
			     If Mid(arraystr(t),5,1)<>0 Then
			       zz=zz+arraystr(t)+spstr
				   ElseIf t=0 Then zz=""
				 End If 
			   Else
			    zz=zz+arraystr(t)+spstr
               End If   
            End If     
         Next
'isnonull=mid("BA000@",1,Len("BA000@")-1)
    If zz="" Then
    isnonull=str
	else
	isnonull=mid(zz,1,len(zz)-1)
	End if
  else
   isnonull=str
  end If
 end function
 '========================================
 %>
 <%
'' function  dprice(strd,spstrd,FlightNos,startcity,endcity)
	 
 '' if len(strd)>0 then
     ''str=split(strd,spstrd)
     ''for td= 0 to ubound(str)
 		  ''dsql="select Rebate,bunk,price from mybunkmessage where (FlightNo<>'' and  bunk<>'' and ifDynamicBunk=1 and bunk='"&UCase(left(str(td),1))&"' and  FlightNo='"&trim(FlightNos)&"' and flydate<=#"&Dates&"#  and endDatetime>=#"&Dates&"# ) or ( bunk<>'' and bunk='"&UCase(left(str(td),1))&"' and ifDynamicBunk=2 and AirwayName='"&trim(F_Airways(left(split_fly(fly_values(i),3),2)))&"' and  startcity='"&startcity&"' and  endcity='"&endcity&"' and  flydate<=#"&Dates&"#  and endDatetime>=#"&Dates&"# ) "
			'response.Write(dsql)&"<br>"
    	    ''set rs2=conn.execute(dsql)
    		''if not rs2.eof then
			    ''dprice=rs2("price")
				''dprice=((dprice*0.35+5)\10)*10
            	''zznew=left(str(td),2)&"00"&dprice
                ''zzd=zzd+zznew+spstrd
		   ''else
                ''zzd=zzd+str(td)+spstrd
				
         '' end if
              ''rs2.close

         ''Next
 	''dprice=mid(zzd,1,len(zzd)-1)
 ''Else
    ''dprice=strd 
''end if	
   ''set rs2=nothing
 ''end function%>
 <%
'===LYQ说明:此函数没有用上
 function  dRebate(strd,spstrd,FlightNos,startcity,endcity)
	 
  if len(strd)>0 then
     str=split(strd,spstrd)
     for td= 0 to ubound(str)
 		  dsql="select Rebate,bunk,price from mybunkmessage where ( ifDynamicBunk=1 and bunk='"&UCase(left(str(td),1))&"' and  FlightNo='"&trim(FlightNos)&"' and flydate<=#"&Dates&"#  and endDatetime>=#"&Dates&"# ) or ( bunk='"&UCase(left(str(td),1))&"' and ifDynamicBunk=2 and AirwayName='"&trim(F_Airways(left(split_fly(fly_values(i),3),2)))&"' and (startcity='"&startcity&"' or startcity='') and  (endcity='"&endcity&"' or endcity='') and  flydate<=#"&Dates&"#  and endDatetime>=#"&Dates&"# ) "
			'response.Write(dsql)&"<br>"
    	    set rs8=conn.execute(dsql)
    		if not rs8.eof then 
			    dRebate=rs8("Rebate")
				zzRebate=dRebate
				zzr=zzr+zzRebate+spstrd
		   else
				zzr=zzr+str(td)+spstrd
				
          end if
              rs8.close
         Next
	dRebate=mid(zzr,1,len(zzr)-1)
 Else
	dRebate=strd 
end if	
   set rs8=nothing
 end Function
'===LYQ说明:此函数没有用上
  function  dbunk(strd,spstrd,FlightNos,startcity,endcity)
	 
  if len(strd)>0 then
     str=split(strd,spstrd)
     for td= 0 to ubound(str)
 		  dsql="select Rebate,bunk,price from mybunkmessage where (FlightNo<>'' and  bunk<>'' and ifDynamicBunk=1 and bunk='"&UCase(left(str(td),1))&"' and  FlightNo='"&trim(FlightNos)&"' and flydate<=#"&Dates&"#  and endDatetime>=#"&Dates&"# ) or ( bunk<>'' and bunk='"&UCase(left(str(td),1))&"' and ifDynamicBunk=2 and AirwayName='"&trim(F_Airways(left(split_fly(fly_values(i),3),2)))&"' and  startcity='"&startcity&"' and  endcity='"&endcity&"' and  flydate<=#"&Dates&"#  and endDatetime>=#"&Dates&"# ) "
			'response.Write(dsql)&"<br>"
    	    set rs7=conn.execute(dsql)
    		if not rs7.eof then 
			    dbunk=rs7("bunk")
				zzbunk=dbunk
				zzb=zzb+zzbunk+spstrd
		   else
	            dbunk=""
				zzb=zzb+str(td)+spstrd
          end if
              rs7.close
         Next
    dbunk=mid(zzb,1,len(zzb)-1)
 Else
	dbunk=strd 
end if	
   set rs7=nothing
 end function

'===================================
function  sp_bunk(allstr,sp,leftnum) 'Split Bunk or Bunk of number only
    if len(allstr)>0 then
	   forstr=split(allstr,sp)
	   for pn=0 to ubound(forstr)
	     p1=p1+left(forstr(pn),leftnum)
	   next
	   sp_bunk=p1
	else
	 sp_bunk=allstr
	end if
end function
'==================================================
function  F_Airways(str)
         sql="select top 1 AirwayName,shortname from Airways where CarrierCode='"&trim(str)&"'"
		  set rs=conn.execute(sql)
		  if not rs.eof then
		      F_Airways=trim(rs("AirwayName"))
		  end if
			rs.close
end function
'=====================================
function  Airimg(str)
         sql="select PictureLogoPath from Airways where CarrierCode='"&trim(str)&"'"
		  set rs=conn.execute(sql)
		  if not rs.eof then
		      Airimg=trim(rs("PictureLogoPath"))
		   end if
			rs.close
end function
'============================
function   fly_time(str)
    fly_time=left(str,2)+":"+right(str,2)
end function
'=================================
function bunk_num(str)
    select case str
	  case "A"
	    bunk_num="≥9"
	   case else
	   bunk_num=str
	   end select
end function	
'=================================
function  codetocity(str)'中文三支代码
		   set rs=conn.execute("select CityName from city where CityCode='"&str&"'")
		   if not rs.eof then
		     codetocity=trim(rs("CityName"))
		   else
		     codetocity=str
		   end if
			rs.close
end function
'=================================


function pricetodiscount(price,fullprice,ifint) '1 价钱转换折扣,并且取5倍整数 2折扣转换价钱 0价钱转换折扣,
	if fullprice="" then
	fullprice=0
	end if
  if fullprice=0 then 
     pricetodiscount=0
	 exit function
  end if
  select case ifint
  	case 0
      aprice=price/fullprice*100
      aprice=round(aprice)
	  pricetodiscount=aprice
	case 1
      aprice=price/fullprice*100
      aprice=round(aprice)
      byu=aprice mod 10
       c=5
      if byu<3 then c=0 end if
      if byu>7 then c=10 end if
      pricetodiscount= aprice-(aprice mod 10)+c 
	case 2
	   if price=97 then
	    price=100
	   end if
	   if price=98 then
	    price=130
	   end if 
	   if price=99 then
	    price=150
	   end if
      pricetodiscount=((fullprice*price/100+5)\10)*10
  end select
end function

''LYQ说明:之前常规舱位的格式是:90T@0@*@常规价^85K@0@*@常规价^80H@0@*@常规价
''改过之后为:90T@9@*@常规价^85K@9@*@常规价^80H@9@*@常规价@G    G表示一般价格
function graner(airways)
  sql="select * from TADiscount where [航空公司]='"&airways&"'"
  set rs =conn.execute(sql)
  if not rs.eof then
     sssa=""
	 for ii=95 to 10 step -5
	   if isnull(rs("y"&ii)) then 
	      bb=""
	   else 
	      bb=Trim(rs("y"&ii))
	   end if
	   if bb<>"" then 
	   sssa=sssa+cstr(ii)&bb&"@"&"9"&"@"&"*"&"@"&"常规价"&"@"&"G"&"^"
	   end if 
	 next 
  end if 
  sssa=sssa+"97"&"Y"&"@"&"9"&"@"&"*"&"@"&"常规价"&"@"&"G"&"^"
  sssa=sssa+"98"&"C"&"@"&"9"&"@"&"*"&"@"&"常规价"&"@"&"G"&"^"

⌨️ 快捷键说明

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