- 论坛徽章:
- 0
|
请看下列代码:
不加
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver" .newInstance();
String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=pubs";
String user="sa";
String password="sql_roy13810839968";
Connection conn= DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement();
String sql1="delete from table1";
String sql2="insert into table1(context) values('sss')";
stmt.executeUpdate(sql1);
stmt.executeUpdate(sql2);
这段就可以编译....一加就出错.....在header.jsp里有import bean.*和import java.sql.*,重复import会有异常?可是我去掉了还是不行呀....在同一个页面里不让我同时处理两个库?
代码如下
<%@ page contentType="text/html; charset=GB2312" autoFlush="true"
import="Bean.*"
import ="java.util.*"
import ="java.lang.Math"
%>;
<jsp:include page="/jsp/header.jsp" flush="true" />;
</table>;
<table width=1000 border=0 align="left" bgcolor="B1D2E1">;
<tr>;
<td>;
<table width=880 height=450 border=0 align=center>;
<tr>;<td bgcolor="#B1D2E1">;
<div id=overDiv style=" OSITION:absolute;Z-INDEX:1">;</div>;
<script language=javascript src="/jsp/popup.js">;</script>;
<script language="vbscript">;
function IfValidateSubTime
if DateDiff("n",Now,document.all.Form1.DepTime.value)<30 then
'msgbox "不能预订"
IfValidateSubTime = 0
else
IfValidateSubTime = 1
end if
end function
</script>;
<%
if (session.getAttribute(" RICEDATA" !=null)
{
%>;
<script language=javascript>;
<!--
function showPrice()
{
alert("<%=session.getAttribute(" RICEDATA" %>;"
}
-->;
</script>;
<%
}
/*
Class.forName("com.microsoft.jdbc.sqlserver.SQLServerDriver" .newInstance();
String url="jdbc:microsoft:sqlserver://localhost:1433;DatabaseName=pubs";
String user="sa";
String password="sql_roy13810839968";
Connection conn= DriverManager.getConnection(url,user,password);
Statement stmt=conn.createStatement();
String sql1="delete from table1";
String sql2="insert into table1(context) values('sss')";
stmt.executeUpdate(sql1);
stmt.executeUpdate(sql2);
*/
String tkCount = request.getParameter("TicketCount" ;
String prType = request.getParameter("pnrType" ;
String dptCity = "";
String dstCity = "";
String depCityName=new String();
String dstCityName=new String();
String depDateTime = new String();
String arvDateTime = "";
String strAfterToday = request.getParameter("hdAfterToday" ;
int iNowYear;
int iNowMonth;
int iNowHour;
int iNowMinute;
Calendar c = Calendar.getInstance();
Date d = c.getTime();
iNowHour = d.getHours();
iNowMinute = d.getMinutes();
//String strAirlineCompany = "";
//String strFlightNo = "";
//String strDepAirPort = "";
//String strDstAirPort = "";
String strDepTime = "";
String strDepTimeH = "";
String strDepTimeM = "";
//String strDstTime = "";
//String strPlaneStyle = "";
//String strStandartPrice = "";
//String strDiscountPrice = "";
int nSgResultLength = 0;
int nRdResultLength1 = 0;
int nRdResultLength2 = 0;
int nRdFwdResultLength=0,nRdBkResultLength=0;
%>;
<!--处理单程航班-->;
<%if(request.getParameter("QueryType" .compareTo("SINGLE" ==0)
{ int i = 1;
int j = 0;
float fYprice=0;
AVQueryResult rst=(AVQueryResult)request.getSession().getAttribute("AVQUERYOBJECT");
dptCity = rst.getQueryDepCity();
dstCity = rst.getQueryDstCity();
if (dptCity.compareToIgnoreCase("SHA")==0 || dptCity.compareToIgnoreCase(" VG")==0)
dptCity="上海";
else
dptCity = rst.getDepCity();
if (dstCity.compareToIgnoreCase("SHA")==0 || dstCity.compareToIgnoreCase(" VG")==0)
dstCity="上海";
else
dstCity = rst.getDstCity();
depDateTime = rst.getDepDate();
%>;
<div align=center>; <b>;<%=depDateTime%>; <%=dptCity%>; 至<%=dstCity%>;共查到<%=rst.getAVResultCount()%>;条航班记录,查询结果如下</b>;
<%
if (session.getAttribute(" RICEDATA")!=null)
{
%>;
<Br>;<font color=gray>;<a href="javascript:showPrice()">;点击本处查看票价信息</a>;</font>;
<%
}
%>;
</div>;
<br>; <br>;
<table width="100%" border = "1" cellspacing=0 cellpadding=0 align=center bordercolor=#cccccc>;
<tr bgcolor=#FFFFCC height=40>;
<!--<td width = "100" align=center>;航空公司 </td>;-->;
<td width = "40" align=center>;航班号 </td>;
<td width = "60" align=center>;起止机场 </td>;
<td width = "50" align=center>;起止时间 </td>;
<td width = "30" align=center>;机型 </td>;
<td width = "20" align=center>;经停 </td>;
<!--<td width = "60" align=center>;最低折扣 </td>; -->;
<td colspan="16" align=center>;舱位情况</td>;
</tr>;
<%
while (rst.next())
{
int nSegCount = rst.getSegmentCount();
if (nSegCount==1)
{
%>;
<tr>;
<%
fYprice = Float.parseFloat(rst.getStandartPrice());
strDepTime = rst.getDeptime();
strDepTimeH = strDepTime.substring(0,2);
strDepTimeM = strDepTime.substring(3,5);
if (rst.getValidateFlag()==0)
{
//无效航空公司
//out.println("无效航空公司"+rst.getValidateFlag());
%>;
<td align=center id = tdFlightNo>;<%=rst.getFlightNo()%>;</td>;
<td align=center >;<%=rst.getDepAirport()%>;<br>;
<%=rst.getDstAirport()%>;</td>;
<td align=center id = tdTime>;<%=rst.getDeptime()%>;<br>;
<%=rst.getDsttime()%>;</td>;
<td align=center id = tdPnStyle>;<%=rst.getPlaneStyle()%>;</td>;
<td align=center id = tdPnStyle>;<%=rst.getStop()%>;</td>;
<td align=center colspan=15>;此航班无效</td>;
</tr>;
<%
}
else if(rst.getValidateFlag()==3)
{
%>;
<td align=center id = tdFlightNo>;<%=rst.getFlightNo()%>;</td>;
<td align=center >;<%=rst.getDepAirport()%>;<br>;
<%=rst.getDstAirport()%>;</td>;
<td align=center id = tdTime>;<%=rst.getDeptime()%>;<br>;
<%=rst.getDsttime()%>;</td>;
<td align=center id = tdPnStyle>;<%=rst.getPlaneStyle()%>;</td>;
<td align=center id = tdPnStyle>;<%=rst.getStop()%>;</td>;
<td align=center colspan=16>;此航班票已售完</td>;
</tr>;
<%
}
else
{
%>;
<td rowspan="4" align=center id = tdFlightNo>;<%=rst.getFlightNo()%>;</td>;
<td rowspan="4" align=center>;<%=rst.getDepAirport()%>;<br>;
<%=rst.getDstAirport()%>;</td>;
<td rowspan="4" id = tdTime align=center>;<%=rst.getDeptime()%>;<br>;
<%=rst.getDsttime()%>;</td>;
<td rowspan="4" align=center id = tdPnStyle>;<%=rst.getPlaneStyle()%>;</td>;
<td rowspan="4" align=center id = tdPnStyle>;<%=rst.getStop()%>;</td>;
<%
String s = rst.getBerthString();
char chBerth;
%>;
<%
for (int k=0;k<s.length();k++)
{
//舱位
chBerth =s.charAt(k);
//状态
char status = rst.getStatusByBerth(chBerth);
%>;
<td align=center>;<%=chBerth%>;<%=status%>;</td>;
<%
}
//电子客票
if (rst.getETicketBerth(0)!='-')
{
char status = rst.getETicketStatus(0);
%>;
<td align=center>;<%=rst.getETicketBerth(0)%>;<%=status%>;</td>;
<%
}
%>;
</tr>;
<tr>;
<%
for (int k=0;k<s.length();k++)
{
//舱位
chBerth =s.charAt(k);
if (chBerth=='-')
{
%>;
<td align=center>;&</td>;
<%
}
else
{
//折扣
float fdis = rst.getDiscountByBerth(chBerth);
if (fdis==1 )
{
%>;
<td align=center>;&</td>;
<%
continue;
}
%>;
<td align=center>;<%=Math.round(fdis*100)%>;折</td>;
<%
}
}
//电子客票
if (rst.getETicketBerth(0)!='-')
{
%>;
<td align=center>;E</td>;
<%
}
%>;
</tr>;
<tr>;
<%
for (int k=0;k<s.length();k++)
{
//舱位
chBerth =s.charAt(k);
if (chBerth=='-')
{
%>;
<td align=center>;&</td>;
<%
}
else
{
%>;
<td align=center>;<%
//out.println("'"+rst.getPriceByBerth(chBerth)+"'");
if (rst.getPriceByBerth(chBerth).compareTo("0")!=0)
{
out.print(rst.getPriceByBerth(chBerth));
}
else
out.print("&");
%>;</td>;
<%
}
}
//电子客票
if (rst.getETicketBerth(0)!='-')
{
%>;
<td align=center>;时价</td>;
<%
}
%>;
</tr>;
<tr>;
<%
for (int k=0;k<s.length();k++)
{
//舱位
chBerth =s.charAt(k);
char status = rst.getStatusByBerth(chBerth);
float fdis = rst.getDiscountByBerth(chBerth);
if (chBerth=='-'
|| status=='-' || (!(status<='9' && status>;='1') && status!='Q' && status!='A'))
{
%>;
<td align=center>;&</td>;
<%
}
else
{
%>;
<td align=center bgcolor=#ffeeee>;<input type = radio name = "SgRadioIsSelected" value = "<%=rst.getPriceByBerth(chBerth)%>;,<%=chBerth%>;,1,<%=rst.getFlightNo()%>;,<%=rst.getPlaneStyle()%>;,<%=depDateTime+" "+rst.getDeptime()%>;,<%=depDateTime+" "+rst.getDsttime()%>;,<%=status%>;,<%=0.03%>;,<%=rst.getDepCityCode()%>;,<%=rst.getDstCityCode()%>;" onclick = '<%
if (status=='Q')
{
%>;
RequestDiscount(<%=j%>;,<%=rst.getPriceByBerth(chBerth)%>;,"<%=chBerth%>;",<%=fdis%>;,"<%=rst.getFlightNo()%>;","<%=rst.getPlaneStyle()%>;","<%=depDateTime+" "+rst.getDeptime()%>;","<%=depDateTime+" "+rst.getDsttime()%>;","<%=rst.getDepCityCode()%>;","<%=rst.getDstCityCode()%>;");'>;
<%
}
else
{
%>;FillHidden(0);'>;
</td>;
<%
}
}
}
//电子客票
if (rst.getETicketBerth(0)!='-')
{
chBerth = rst.getETicketBerth(0);
char status = rst.getETicketStatus(0);
if( status=='-' || (!(status<='9' && status>;='1') && status!='Q' && status!='A'))
{
%>;
<td align=center>;&</td>;
<%
}
else
{
%>;
<td align=center bgcolor=#ffeeee>;<input type = radio name = "SgRadioIsSelected" value = "<%=0%>;,<%=chBerth%>;,0,<%=rst.getFlightNo()%>;,<%=rst.getPlaneStyle()%>;,<%=depDateTime+" "+rst.getDeptime()%>;,<%=depDateTime+" "+rst.getDsttime()%>;,<%=status%>;,<%=0.03%>;,<%=rst.getDepCityCode()%>;,<%=rst.getDstCityCode()%>;" onclick = '<%
if (status=='Q')
{
%>;
RequestDiscount(<%=j%>;,<%=0%>;,"<%=chBerth%>;",0,"<%=rst.getFlightNo()%>;","<%=rst.getPlaneStyle()%>;","<%=depDateTime+" "+rst.getDeptime()%>;","<%=depDateTime+" "+rst.getDsttime()%>;","<%=rst.getDepCityCode()%>;","<%=rst.getDstCityCode()%>;");'>;
<%
}
else
{
%>;FillHidden(0);'>;
</td>;
<%
}
}
}
}
%>;
</tr>;
<%
}
else
{
for (int nSeg = 0;nSeg<nSegCount;nSeg++)
{
rst.setCurrentSegment(nSeg);
%>;
<tr>;
<%
fYprice = Float.parseFloat(rst.getStandartPrice());
strDepTime = rst.getDeptime();
strDepTimeH = strDepTime.substring(0,2);
strDepTimeM = strDepTime.substring(3,5);
if (rst.getValidateFlag()==0)
{
//无效航空公司
//out.println("无效航空公司"+rst.getValidateFlag());
%>;
<td bgcolor="aliceblue" align=center id = tdFlightNo>;<%=rst.getFlightNo()%>;</td>;
<td bgcolor="aliceblue" align=center >;<%=rst.getDepAirport()%>;<br>;
<%=rst.getDstAirport()%>;</td>;
<td bgcolor="aliceblue" align=center id = tdTime>;<%=rst.getDeptime()%>;<br>;
<%=rst.getDsttime()%>;</td>;
<td bgcolor="aliceblue" align=center id = tdPnStyle>;<%=rst.getPlaneStyle()%>;</td>;
<td bgcolor="aliceblue" align=center id = tdPnStyle>;<%=rst.getStop()%>;</td>;
<td bgcolor="aliceblue" align=center colspan=15>;此航班无效</td>;
</tr>;
<%
}
else if(rst.getValidateFlag()==3)
{
%>;
<td bgcolor="aliceblue" align=center id = tdFlightNo>;<%=rst.getFlightNo()%>;</td>;
<td rowspan="4" bgcolor="aliceblue" align=center>;<%=rst.getDepAirport()%>;<%
if (nSeg==1)
out.print("("+rst.getDepCityByAirport()+")");
%>;<br>;
<%=rst.getDstAirport()%>;<%
if (nSeg==0)
out.print("("+rst.getDstCityByAirport()+")");
%>;</td>; <td bgcolor="aliceblue" align=center id = tdTime>;<%=rst.getDeptime()%>;<br>;
<%=rst.getDsttime()%>;</td>;
<td bgcolor="aliceblue" align=center id = tdPnStyle>;<%=rst.getPlaneStyle()%>;</td>;
<td bgcolor="aliceblue" align=center id = tdPnStyle>;<%=rst.getStop()%>;</td>;
<td bgcolor="aliceblue" align=center colspan=16>;此航班票已售完</td>;
</tr>;
<%
}
else
{
%>;
<td rowspan="4" bgcolor="aliceblue" align=center id = tdFlightNo>;<%=rst.getFlightNo()%>;</td>;
<td rowspan="4" bgcolor="aliceblue" align=center>;<%=rst.getDepAirport()%>;<%
if (nSeg==1)
out.print("("+rst.getDepCityByAirport()+")");
%>;<br>;
<%=rst.getDstAirport()%>;<%
if (nSeg==0)
out.print("("+rst.getDstCityByAirport()+")");
%>;</td>;
<td rowspan="4" bgcolor="aliceblue" id = tdTime align=center>;<%=rst.getDeptime()%>;<br>;
<%=rst.getDsttime()%>;</td>;
<td rowspan="4" bgcolor="aliceblue" align=center id = tdPnStyle>;<%=rst.getPlaneStyle()%>;</td>;
<td rowspan="4" bgcolor="aliceblue"align=center id = tdPnStyle>;<%=rst.getStop()%>;</td>;
<%
String s = rst.getBerthString();
char chBerth;
%>;
<%
for (int k=0;k<s.length();k++)
{
//舱位
chBerth =s.charAt(k);
//状态
char status = rst.getStatusByBerth(chBerth);
%>;
<td bgcolor="aliceblue" align=center>;<%=chBerth%>;<%=status%>;</td>;
<%
}
//电子客票
if (rst.getETicketBerth(0)!='-')
{
char status = rst.getETicketStatus(0);
%>;
<td bgcolor="aliceblue" align=center>;<%=rst.getETicketBerth(0)%>;<%=status%>;</td>;
<%
}
%>;
</tr>;
<tr>;
<%
for (int k=0;k<s.length();k++)
{
//舱位
chBerth =s.charAt(k);
if (chBerth=='-')
{
%>;
<td bgcolor="aliceblue" align=center>;&</td>;
<%
}
else
{
//折扣
float fdis = rst.getDiscountByBerth(chBerth);
if (fdis==1 )
{
%>;
<td bgcolor="aliceblue" align=center>;&</td>;
<%
continue;
}
%>;
<td bgcolor="aliceblue" align=center>;<%=Math.round(fdis*100)%>;折</td>;
<%
}
}
//电子客票
if (rst.getETicketBerth(0)!='-')
{
%>;
<td bgcolor="aliceblue" align=center>;E</td>;
<%
}
%>;
</tr>;
<tr>;
<%
for (int k=0;k<s.length();k++)
{
//舱位
chBerth =s.charAt(k);
if (chBerth=='-')
{
%>;
<td bgcolor="aliceblue" align=center>;&</td>;
<%
}
else
{
%>;
<td bgcolor="aliceblue" align=center>;&</td>;
<%
}
}
//电子客票
if (rst.getETicketBerth(0)!='-')
{
%>;
<td bgcolor="aliceblue" align=center>;时价</td>;
<%
}
%>;
</tr>;
<tr>;
<%
for (int k=0;k<s.length();k++)
{
//舱位
chBerth =s.charAt(k);
char status = rst.getStatusByBerth(chBerth);
float fdis = rst.getDiscountByBerth(chBerth);
if (chBerth=='-'
|| status=='-' || (!(status<='9' && status>;='1') && status!='Q' && status!='A'))
{
%>;
<td bgcolor="aliceblue" align=center>;&</td>;
<%
}
else
{
%>;<td bgcolor="aliceblue" align=center>;&</td>;
<%
}
}
//电子客票
if (rst.getETicketBerth(0)!='-')
{
chBerth = rst.getETicketBerth(0);
char status = rst.getETicketStatus(0);
if( status=='-' || (!(status<='9' && status>;='1') && status!='Q' && status!='A'))
{
%>;
<td bgcolor="aliceblue" align=center>;&</td>;
<%
}
else
{
%>;
<td bgcolor="aliceblue" align=center>;<input type = radio name = "SgRadioIsSelected" value = "<%=0%>;,<%=chBerth%>;,0,<%=rst.getFlightNo()%>;,<%=rst.getPlaneStyle()%>;,<%=depDateTime+" "+rst.getDeptime()%>;,<%=depDateTime+" "+rst.getDsttime()%>;,<%=status%>;,<%=3%>;,<%=rst.getDepCityCode()%>;,<%=rst.getDstCityCode()%>;" onclick = '<%
if (status=='Q')
{
%>;
RequestDiscount(<%=j%>;,<%=0%>;,"<%=chBerth%>;",0,"<%=rst.getFlightNo()%>;","<%=rst.getPlaneStyle()%>;","<%=depDateTime+" "+rst.getDeptime()%>;","<%=depDateTime+" "+rst.getDsttime()%>;","<%=rst.getDepCityCode()%>;","<%=rst.getDstCityCode()%>;");'>;
<%
}
else
{
%>;FillHidden(0);'>;
</td>;
<%
}
}
}
}
%>;
</tr>;
<%
}
}
i = i+3; //i是代表radio的长度
j = j+1;
nSgResultLength = i;
}%>;
</table>;
<input type=hidden name="YPrice" value="<%=fYprice%>;">;
<!--提交给下一页的FORM 处理SINGLE-->;
<input type=hidden name="URL" value="">;
<script language="javascript">;
<!--
function ClearPackage()
{
document.all.URL.value="";
}
function groupPackage(tag,value)
{
if (URL.value.length==0)
document.all.URL.value =tag+"="+value;
else
document.all.URL.value += "&"+tag+"="+value;
}
function VerifyRole()
{
//alert("验证身份");
document.all.RoleID.value=agent.GetRoleID();
var rst = agent.GetErrorCode();
if (rst!=0)
{
alert("安全操作出错,请确认驻留程序是否启动!");
return false;
}
//for (i=0;i<Form1.length ;i++)
// alert(Form1.item(i).name+Form1.item(i).value)
ClearPackage();
groupPackage("ArvTime",document.all.ArvTime.value);
groupPackage("Cangwei",document.all.Cangwei.value);
groupPackage("DepCity",document.all.DepCity.value);
groupPackage("DepTime",document.all.DepTime.value);
groupPackage("DstCity",document.all.DstCity.value);
groupPackage("EVENT",document.all.EVENT.value);
groupPackage("FlightDate",document.all.FlightDate.value);
groupPackage("FlightNo",document.all.FlightNo.value);
groupPackage(" laneStyle",document.all.PlaneStyle.value);
groupPackage("RateBack",document.all.RateBack.value);
groupPackage("RoleID",document.all.RoleID.value);
groupPackage("TicketCount",document.all.TicketCount.value);
groupPackage("TicketDiscount",document.all.TicketDiscount.value);
groupPackage("TicketPrice",document.all.TicketPrice.value);
groupPackage("pnrType",document.all.pnrType.value);
groupPackage("sb",document.all.sb.value);
groupPackage("tmpitemno",document.all.tmpitemno.value);
//alert(URL.value)
var data = agent.EncrySign(URL.value);
//alert(data);
if (data.substring(0,5)=="ERROR")
{
//alert("出现错误")
}
else
{
document.all.SIGNED.value=data;
}
}
function FillHidden(binit)
{
//填充出发地点,到达地点,事件
var len;
if (binit==2)
{
if (document.all.Form1.EVENT.value!="INPUTPNRFORRESERVE")
{
Form1.submit();
return;
}
}
if (binit==1 && document.all.Form1.EVENT.value.length!=0)
{
return;
}
if (binit==1)
{
if (typeof(SgRadioIsSelected.length)=="undefined")
{
SgRadioIsSelected.checked = true;
}
else
{
SgRadioIsSelected.item(0).checked = true;
}
}
document.all.Form1.EVENT.value="INPUTPNRFORRESERVE";
//无有效航班
if (typeof(SgRadioIsSelected)=="undefined")
{
Form1.sb.disabled =true;
return false;
}
//单一航班
if (typeof(SgRadioIsSelected.length)=="undefined")
{
var str =SgRadioIsSelected.value;
n = str.indexOf(",",0);
//票价
if (document.all.pnrType.value=="1")
{
//儿童
document.all.Form1.TicketPrice.value = document.all.YPrice.value*0.5;
document.all.Form1.Cangwei.value = 'Y';
}
else
{
document.all.Form1.TicketPrice.value = SgRadioIsSelected.value.substring(0,n);
//舱位
document.all.Form1.Cangwei.value = SgRadioIsSelected.value.substring(n+1,n+2);
}
//票折扣
document.all.Form1.TicketDiscount.value = str.substring(n+3,n = str.indexOf(",",n+3));
//航班号
document.all.Form1.FlightNo.value = str.substring(n+1,n = str.indexOf(",",n+1));
//机型
document.all.Form1.PlaneStyle.value = str.substring(n+1,n = str.indexOf(",",n+1));
//起飞时间
document.all.Form1.DepTime.value = str.substring(n+1,n = str.indexOf(",",n+1));
//到达时间
document.all.Form1.ArvTime.value = str.substring(n+1,n = str.indexOf(",",n+1));
var tcount= str.substring(n+1,n = str.indexOf(",",n+1));
var rateback = str.substring(n+1,n = str.indexOf(",",n+1));
var depcity = str.substring(n+1,n = str.indexOf(",",n+1));
var dstcity = str.substring(n+1,str.length);
document.all.Form1.DepCity.value = depcity;
document.all.Form1.DstCity.value = dstcity;
document.all.Form1.RateBack.value = rateback*document.all.Form1.TicketPrice.value;
if (tcount=='A')
tcount=">;9";
//票数
if (tcount!=">;9")
{
if (tcount<document.all.TicketCount.value)
{
alert("该舱位目前余留的座位数不能满足您要求");
return false;
}
}
if (IfValidateSubTime()==0)
{
//不能预订
if (binit!=1)
alert("该航班起飞时间距离现在不足半个小时,无法预订");
return false;
}
else
{
if (binit==2)
return VerifyRole();
return true;
}
}
else
len = SgRadioIsSelected.length;
for(i = 0; i < len; i++)
{
if(SgRadioIsSelected.item(i).checked == 1)
{
var str =SgRadioIsSelected.item(i).value;
n = str.indexOf(",",0);
//票价
if (document.all.pnrType.value=="1")
{
//儿童
document.all.Form1.TicketPrice.value = document.all.YPrice.value*0.5;
document.all.Form1.Cangwei.value = 'Y';
}
else
{
//票价
document.all.Form1.TicketPrice.value = SgRadioIsSelected.item(i).value.substring(0,n);
//舱位
document.all.Form1.Cangwei.value = SgRadioIsSelected.item(i).value.substring(n+1,n+2);
}
//票折扣
document.all.Form1.TicketDiscount.value = str.substring(n+3,n = str.indexOf(",",n+3));
//alert(document.all.Form1.TicketDiscount.value );
//航班号
document.all.Form1.FlightNo.value = str.substring(n+1,n = str.indexOf(",",n+1));
//alert(document.all.Form1.FlightNo.value );
//机型
document.all.Form1.PlaneStyle.value = str.substring(n+1,n = str.indexOf(",",n+1));
//alert(document.all.Form1.PlaneStyle.value);
//起飞时间
document.all.Form1.DepTime.value = str.substring(n+1,n = str.indexOf(",",n+1));
//alert(document.all.Form1.DepTime.value)
//到达时间
document.all.Form1.ArvTime.value = str.substring(n+1,n = str.indexOf(",",n+1));
var tcount= str.substring(n+1,n = str.indexOf(",",n+1));
var rateback = str.substring(n+1,n = str.indexOf(",",n+1));
var depcity = str.substring(n+1,n = str.indexOf(",",n+1));
var dstcity = str.substring(n+1,str.length);
document.all.Form1.DepCity.value = depcity;
document.all.Form1.DstCity.value = dstcity;
document.all.Form1.RateBack.value = rateback*document.all.Form1.TicketPrice.value;
//票数
if (tcount!=">;9")
{
if (tcount<document.all.TicketCount.value)
{
alert("该舱位目前余留的座位数不能满足您要求");
return false;
}
}
if (IfValidateSubTime()==0)
{
//不能预订
if (binit!=1)
alert("该航班起飞时间距离现在不足半个小时,无法预订");
return false;
}
else
{
if (binit==2)
return VerifyRole();
return true;
}
}
}
}
function parseDiscount(d)
{
var str=d;
if (str=="全价")
return 1;
else
{
return str.substr(0,d.length-1)/100;
}
}
function RequestDiscount(itemno,price,cangwei,discount,flightno,planestyle,deptime,arvtime,depcity,dstcity)
{
document.all.Form1.TicketPrice.value = price;
//舱位
document.all.Form1.Cangwei.value = cangwei;
//票折扣
document.all.Form1.TicketDiscount.value = discount;
//航班号
document.all.Form1.FlightNo.value = flightno;
//机型
document.all.Form1.PlaneStyle.value = planestyle;
//起飞时间
document.all.Form1.DepTime.value = deptime;
//到达时间
document.all.Form1.ArvTime.value = arvtime;
document.all.Form1.EVENT.value = "INPUTPNRFORREQUESTRESERVE";
document.all.Form1.tmpitemno.value = itemno;
document.all.Form1.DepCity.value = depcity;
document.all.Form1.DstCity.value = dstcity;
if (IfValidateSubTime()==0)
{
//不能预订
alert("该航班起飞时间距离现在不足半个小时,无法预订");
}
else
{
//document.all.Form1.submit();
}
}
function init()
{
FillHidden(1);
}
-->;
</script>;
<%}
%>;
<!--处理单程航班结束-->;
</td>;</tr>;</table>;
</td>;</tr>;</table>;
</body>;
</html>; |
|