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

📄 admin_add3.asp

📁 机票预定系统 各个模块的设计-ticket reservation systems detailed design system modules of the design
💻 ASP
字号:
<!--#include file="include/conn.asp"-->
<!--#include file="CheckSystem.asp"-->

<%
call checklimit(session("Limit"),"6")'调用验证管理员权限的函数
response.Clear()
auto=request("auto")
%>
<%
if Request.ServerVariables("REQUEST_METHOD")="POST" then
     fontColor="#FF0000"
	 'flightno=Ucase(trim(request.form("flightno")))
     price=trim(request.form("price"))
	 flyDate=request.form("flyDate")
	 endDatetime=request.form("endDatetime")
	 AirwayName=trim(request.form("AirwayName"))
	 rebate=request.form("rebate")
	 bunk=request.form("bunk")
	 TempifActiveStr="0"
	 startcity=request.form("startcity01")
	 endcity=request.form("endcity01")
     if trim(request.form("ifActiveStr"))="ON" then
	 	TempifActiveStr="1"
	 end if
	 ifActive=TempifActiveStr	'是否激活
	 ifDynamicBunk=2
	if AirwayName="" or not isnumeric(price) then
		response.write "<script language=javascript>alert('对不起,信息不全,请返回');window.history.back();</script>"
	end if
	set rs=server.CreateObject("adodb.recordset")
	if request.form("MyAction")<>"AddNew" then
		qsql=" select * from mybunkmessage where auto="&auto&" "  
		rs.open qsql,conn,1,3
		myActionStr="修改"
	else
		qsql=" select * from mybunkmessage " 
		rs.open qsql,conn,1,3
		rs.addnew
		myActionStr="添加"
	end if
		rs("datetime")=now()
		rs("price")=price
		rs("flyDate")=flyDate
		rs("AirwayName")=AirwayName
		rs("rebate")=rebate
		rs("bunk")=UCase(bunk)
		rs("endDatetime")=endDatetime
		rs("ifActive")=ifActive
		rs("ifDynamicBunk")=2
		rs("startcity")=startcity
		rs("endcity")=endcity
		rs.update
		rs.close:set rs=nothing
	 response.write "<script language=javascript>alert('记录已经"&myActionStr&"成功!');window.location.href='manage3.asp';</script>"
end if
%>
<%
ifDynamicBunk=2
myActionStr="添加"
ifActiveStr="checked"
ifDynamicBunkStr="checked"
flyDate=date+1
endDatetime=date+30
if auto<>"" then
	myActionStr="更新"
	dim szSQL
    set oRst=Server.CreateObject("AdoDb.recordset")
	szSQL="select * from myBunkmessage where auto="&auto
    oRst.Open szSQL,conn,1,3
	if not(oRst.eof or oRst.bof) then
    			if oRst("ifActive")<>"1" then
				ifActiveStr=""
				end if
				if oRst("ifDynamicBunk")<>"2" then
				ifDynamicBunkstr=2
				end if
                ifActive=oRst("ifActive")
				ifDynamicBunk=2
                flyDate=oRst("flyDate")
				AirwayName=oRst("AirwayName")
				rebate=oRst("Rebate")
				price=oRst("Price")
	            bunk=oRst("bunk")
				datetime=oRst("DateTime")
				endDatetime=oRst("endDatetime")
				startcity=oRst("startcity")
				endcity=oRst("endcity")
	end if
oRst.close
set oRst=nothing
end if
if rebate="" then rebate="特价舱"
%>

<HTML>
<HEAD>
<TITLE>添加座舱位</TITLE>
<link href="include/css.css" rel="stylesheet" type="text/css">
<link rel="stylesheet" type="text/css" href="style/comm.css" />
<link rel="stylesheet" type="text/css" href="style/skin0.css" />
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<SCRIPT language=javascript src="../js/address.js">
</SCRIPT>
<SCRIPT language=javascript src="../images_index/city.js"></SCRIPT>
<SCRIPT language=javascript>
<!--
function isFlightNo(s)
		{
			var patrn=/^[a-zA-Z0-9]{2}([0-9]){3,4}$/;
			if (!patrn.exec(s))
				return false;
			else
				return true;
		}
function isBunk(s)
	{
		var patrn=/^[a-zA-Z]{1}$/;
		if(!patrn.exec(s))
		return false;
		else
		return true;
	}
function checkinput()
{
	if (Seatform.flyDate.value==""){
	  alert("起飞日期不能为空!");
	  Seatform.flyDate.focus();
	  return false; 
    }
	if (Seatform.AirwayName.value==""){
		alert("航空公司不能为空,请选择航空公司");
		Searform.Airwayname.focus();
		return false;
	}
	if(!isBunk(Seatform.Bunk.value)){
		alert("舱位等级不规范,必须为字母,不区分大小写!");
		Seatform.Bunk.focus();
		return false;
	}
	if (isNaN(Seatform.price.value))
    	{
       	alert("折扣必须是数字!");	  
		Seatform.price.focus();
       	return false; 
     } 		
		//-->
}
</SCRIPT>
<script language="javascript" src="include/newjs/calendar.js"></script>

</head>
<body>
<div class="txt_title">添加动态航线特价(用途:针对某城市、航段、航空公司、舱位的特价政策,座次随航信数据自动变更)</div>
<table  border="0" cellpadding="0" cellspacing="1" bgcolor="#99CCFF">
 <form action="admin_add3.asp" method="post" name="Seatform" onSubmit="return checkinput();">
 <%if auto="" then%>
   <input type="hidden" name="MyAction" value="AddNew">
 <%end if%>
 <input type="hidden" name="Auto" value="<%=auto%>">
 <tr bgcolor="#C3E7F9">
  	<td width="13%" height="25" align="right" bgcolor="#FFFFFF">航班日期:</td>
	<td width="37%" bgcolor="#FFFFFF"><input name="flyDate" type="text"  value="<%=flyDate%>" size="10" maxlength="15" onClick=javascript:calendar(); >
	  --&gt;
	    <input name="endDatetime" type="text" value="<%=enddatetime%>"  size="10" maxlength="15" onClick=javascript:calendar(); ></td>
	<td width="50%" bgcolor="#FFFFFF">&nbsp;</td>
    </tr>
	<tr>
       <td height="25" align="right" bgcolor="#FFFFFF">航空公司:</td>
       <td bgcolor="#FFFFFF">
	   <select name=AirwayName id="AirwayName">
         <option value="CA" <%if AirwayName="CA" then response.write "selected"%>>中国国际航空公司</option>
         <option value="MU" <%if AirwayName="MU" then response.write "selected"%>>东方航空公司</option>
         <option value="CZ" <%if AirwayName="CZ" then response.write "selected"%>>南方航空公司</option>
         <option value="HU" <%if AirwayName="HU" then response.write "selected"%>>海南航空公司</option>
         <option value="FM" <%if AirwayName="FM" then response.write "selected"%>>上海航空公司</option>
         <option value="MF" <%if AirwayName="MF" then response.write "selected"%>>厦门航空公司</option>
         <option value="ZH" <%if AirwayName="ZH" then response.write "selected"%>>深圳航空公司</option>
         <option value="3U" <%if AirwayName="3U" then response.write "selected"%>>四川航空公司</option>
         <option value="SC" <%if AirwayName="SC" then response.write "selected"%>>山东航空公司</option>
         <option value="BK" <%if AirwayName="BK" then response.write "selected"%>>奥凯航空公司</option>
         <option value="EU" <%if AirwayName="EU" then response.write "selected"%>>鹰联航空公司</option>
         <option value="8C" <%if AirwayName="8C" then response.write "selected"%>>东星航空公司</option>
         <option value="8L" <%if AirwayName="8L" then response.write "selected"%>>祥鹏航空公司</option>
        </select></td>
        <td bgcolor="#FFFFFF">&nbsp;</td>
      </tr>
					<tr>
                      <td height="25" align="right" bgcolor="#FFFFFF">航线:</td>
                      <td bgcolor="#FFFFFF">
					  <select name=startcity01 id="startcity01" style="WIDTH: 100px">
					  <%if startcity<>"" then%>
					  	<option value="<%=startcity%>"><%=startcity%></option>
					  <%else%>
                        <option value="" selected>所有城市</option>
					  <%end if%>
                        <script> document.write(citystr)</script>
                      </select>
                        --&gt;
                        <select name=EndCity01 id="EndCity01" style="WIDTH: 100px">
						<%if endcity<>"" then%>
							<option value="<%=endcity%>"><%=endcity%></option>
						<%else%>
                          <option value=""  selected>所有城市</option>
						<%end if%>
                          <script> document.write(citystr)</script>
                        </select></td>
                      <td bgcolor="#FFFFFF">航线:(请选择相应城市)</td>
                    </tr>
                    <tr>
                      <td height="25" align="right" bgcolor="#FFFFFF">舱位名称:</td>
                      <td bgcolor="#FFFFFF"><input name="Rebate" type="text" id="Rebate" style="width:100px" value="<%=rebate%>" size="6" maxlength="6"></td>
                      <td bgcolor="#FFFFFF">舱位名称(如:特价舱,30折经济舱等)</td>
                    </tr>
                    <tr>
                      <td height="25" align="right" bgcolor="#FFFFFF">航位等级:</td>
                      <td bgcolor="#FFFFFF"><input name="Bunk" type="text" id="Bunk" value="<%=bunk%>" size="8" maxlength="1"></td>
                      <td bgcolor="#FFFFFF">航位等级:(如:A,Y,C等)</td>
                    </tr>
                    <tr>
                      <td height="25" align="right" bgcolor="#FFFFFF">折扣:</td>
                      <td bgcolor="#FFFFFF"><input name="price" type="text" id="price" value="<%if price<>"" then response.Write(price) else response.Write(0) end if%>" size="6" maxlength="4"></td>
                      <td bgcolor="#FFFFFF">折扣:(如:25,30,40,50等)</td>
                    </tr>
                    <tr>
                      <td height="25" align="right" bgcolor="#FFFFFF">有效:</td>
                      <td bgcolor="#FFFFFF"><input name="ifActiveStr" type="checkbox" value="ON" <%=ifActiveStr%>></td>
                      <td bgcolor="#FFFFFF">&nbsp;</td>
                    </tr>
                    <tr>
                      <td height="30" colspan="3" align="center" bgcolor="#FFFFFF">
						<input type="submit" value=" 确 认 " name="addRow">
                        &nbsp;
                      <input type="button" value=" 返 回 " name="CancelRow"  onClick="javascript:window.histroy.back();;"></td>
     </tr>
</form>
</table>

</BODY>
</HTML>




⌨️ 快捷键说明

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