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

📄 admin_flightcompany.asp

📁 依蓝旅游网站管理系统Elan2008.SP2
💻 ASP
📖 第 1 页 / 共 2 页
字号:
<%
Option Explicit
Response.Buffer = True
Response.Expires = -1
Response.ExpiresAbsolute = Now() - 1
%>
<!--#Include File="../Conn.asp"-->
<!--#Include File="Admin_CheckPurview.asp"-->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href='Admin_Style.css' type='text/css' rel='stylesheet'>
<title><%=EL_Channel.ChannelName%>管理</title>
<script language="javascript" src="../js/Common.js"></script>
<script language="javascript" src="../js/InstallDir.js"></script>
</head>
<body>
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="Border">
  <tr>
    <td align="center" class="top_25"><strong><%=EL_Channel.ChannelName%> —— 航空公司管理</strong></td>
  </tr>
  <tr>
    <td class="td_50">
	管理导航:
	<a href="<%=EL_CurrentScriptName%>?ChannelID=<%=EL_Channel.ChannelID%>">航空公司管理首页</a> | 
	<a href="<%=EL_CurrentScriptName%>?ChannelID=<%=EL_Channel.ChannelID%>&Action=Add">添加航空公司</a>
	</td>
  </tr>
</table>
<br>
<%
Select Case Action
  Case "": Call ManageCompany()
  Case "Add": Call AddCompany()
  Case "SaveNewCompany": Call SaveCompany(0)
  Case "Modify": Call ModifyCompany()
  Case "SaveModify": Call SaveCompany(1)
  Case "Delete": Call SaveCompany(2)
  Case "CreateJs": Call CreateJs()
End Select
Call EL_Common.Bottom()
Call ApplicationTerminate()

Sub CreateSearchFormJs()
  On Error Resume Next
  Dim JsContent
  Dim f0, f1, f2, f3, f4, f5, f6, f7, f8, f9, f10, f11, f12, f13, f14, f15, DefaultDepartCity, DefaultDestinationCity
  
  f0 = EL_Common.ReplaceText(EL_Common.Lang("Flight.SearchField.f0", ""), "\{\$ItemName\}", EL_Channel.ItemName)
  f1 = EL_Common.ReplaceText(EL_Common.Lang("Flight.SearchField.f1", ""), "\{\$ItemName\}", EL_Channel.ItemName)
  f2 = EL_Common.ReplaceText(EL_Common.Lang("Flight.SearchField.f2", ""), "\{\$ItemName\}", EL_Channel.ItemName)
  f3 = EL_Common.ReplaceText(EL_Common.Lang("Flight.SearchField.f3", ""), "\{\$ItemName\}", EL_Channel.ItemName)
  f4 = EL_Common.ReplaceText(EL_Common.Lang("Flight.SearchField.f4", ""), "\{\$ItemName\}", EL_Channel.ItemName)
  f5 = EL_Common.ReplaceText(EL_Common.Lang("Flight.SearchField.f5", ""), "\{\$ItemName\}", EL_Channel.ItemName)
  f6 = EL_Common.ReplaceText(EL_Common.Lang("Flight.SearchField.f6", ""), "\{\$ItemName\}", EL_Channel.ItemName)
  f7 = EL_Common.ReplaceText(EL_Common.Lang("Flight.SearchField.f7", ""), "\{\$ItemName\}", EL_Channel.ItemName)
  f8 = EL_Common.ReplaceText(EL_Common.Lang("Flight.SearchField.f8", ""), "\{\$ItemName\}", EL_Channel.ItemName)
  f9 = EL_Common.ReplaceText(EL_Common.Lang("Flight.SearchField.f9", ""), "\{\$ItemName\}", EL_Channel.ItemName)
  f10 = EL_Common.ReplaceText(EL_Common.Lang("Flight.SearchField.f10", ""), "\{\$ItemName\}", EL_Channel.ItemName)
  f11 = EL_Common.ReplaceText(EL_Common.Lang("Flight.SearchField.f11", ""), "\{\$ItemName\}", EL_Channel.ItemName)
  f12 = EL_Common.ReplaceText(EL_Common.Lang("Flight.SearchField.f12", ""), "\{\$ItemName\}", EL_Channel.ItemName)
  f13 = EL_Common.ReplaceText(EL_Common.Lang("Flight.SearchField.f13", ""), "\{\$ItemName\}", EL_Channel.ItemName)
  f14 = EL_Common.ReplaceText(EL_Common.Lang("Flight.SearchField.f14", ""), "\{\$ItemName\}", EL_Channel.ItemName)
  f15 = EL_Common.ReplaceText(EL_Common.Lang("Flight.SearchField.f15", ""), "\{\$ItemName\}", EL_Channel.ItemName)
  DefaultDepartCity = EL_Common.Lang("Flight.DefaultDepartCity", "")
  DefaultDestinationCity = EL_Common.Lang("Flight.DefaultDestinationCity", "")
  
  JsContent = "document.write(""<table width='180' border='0' cellspacing='0' cellpadding='0'>"
  JsContent = JsContent &"<form name='searchflightform' id='searchform' action='"& InstallDir &"Flight/Search.asp' method='post'><tr>"
  JsContent = JsContent &"<td width='63' nowrap class='blacktext'>"& f0 &"</td>"
  JsContent = JsContent &"<td width='117' class='blacktext'><input name='FlightType' type='radio' value='1' checked onClick='SearchfSetFlightType(this.value)'> "& f14 &""
  JsContent = JsContent &"<input type='radio' name='FlightType' value='2' onClick='SearchfSetFlightType(this.value)'> "& f15 &"</td>"
  JsContent = JsContent &"</tr><tr><td nowrap class='blacktext'>"& f1 &"</td><td><select name='DepartCity' id='DepartCity' class='select_f'></select>"
  JsContent = JsContent &"</tr><tr><td nowrap class='blacktext'>"& f2 &"</td><td><select name='DestinationCity' id='DestinationCity' class='select_f'></select>"
  JsContent = JsContent &"</tr><tr><td nowrap class='blacktext'>"& f3 &"</td><td>"
  JsContent = JsContent &"<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr>"
  JsContent = JsContent &"<td width='67%'><input name='DepartDate' type='text' class='input_date' id='DepartDate' value='yyyy-mm-dd' size='10' onClick=\""event.cancelBubble=true;ShowCalendar(this.id, 'BackDate', '', '', '', '', 'DepartDate', '')\""></td>"
  JsContent = JsContent &"<td width='33%'><a id='DepartA' href=\""javascript:ShowCalendar('imgDepartDate', 'imgBackDate', '', '', '', '', 'DepartDate', '')\""><img id='imgDepartDate' src='"& InstallDir &"Skin/Default/Calendar.gif' width='24' height='20' border='0'></a></td>"
  JsContent = JsContent &"</tr></table></td></tr><tr><td nowrap class='blacktext'>"& f4 &"</td><td><select name='DepartTime' id='DepartTime' class='select_f'>"
  JsContent = JsContent &"<option value='0'>"& f8 &"</option><option value='1'>00:00-12:00</option><option value='2'>12:00-18:00</option><option value='3'>18:00-24:00</option></select></td>"
  JsContent = JsContent &"</tr><tr id='tr_backdate' style='display:none;'><td nowrap class='blacktext'>"& f5 &"</td><td>"
  JsContent = JsContent &"<table width='100%' border='0' cellspacing='0' cellpadding='0'><tr>"
  JsContent = JsContent &"<td width='67%'><input name='BackDate' type='text' class='input_date' id='BackDate' value='yyyy-mm-dd' size='10' onClick=\""event.cancelBubble=true;ShowCalendar(this.id, '', document.getElementById('DepartDate').value, '', '', '', 'BackDate', '')\""></td>"
  JsContent = JsContent &"<td width='33%'><a href=\""javascript:ShowCalendar('imgBackDate', '', document.getElementById('DepartDate').value, '', '', '', 'BackDate', '')\""><img id='imgBackDate' src='"& InstallDir &"Skin/Default/Calendar.gif' width='24' height='20' border='0'></a></td>"
  JsContent = JsContent &"</tr></table></td></tr><tr id='tr_backtime' style='display:none;'><td nowrap class='blacktext'>"& f6 &"</td>"
  JsContent = JsContent &"<td><select name='BackTime' id='BackTime' class='select_f'><option value='0'>"& f8 &"</option><option value='1'>00:00-12:00</option><option value='2'>12:00-18:00</option><option value='3'>18:00-24:00</option></select></td>"
  JsContent = JsContent &"</tr><tr><td nowrap class='blacktext'>"& f7 &"</td><td><select name='FCY' id='FCY' class='select_f'><option value='0'>"& f9 &"</option><option value='1'>"& f10 &"</option><option value='2'>"& f11 &"</option><option value='3'>"& f12 &"</option></select></td>"
  JsContent = JsContent &"</tr><tr><td colspan='2' height='40' align='center'><input type='submit' class='search_btn' value=' "& f13 &" '></td></tr></form></table>"
  JsContent = JsContent &"<scr"&"ipt language='javascript'>"
  JsContent = JsContent &"function SearchfInitCity(ObjectName, Default){"
  JsContent = JsContent &"var object = document.getElementById(ObjectName);"
  JsContent = JsContent &"for(var i=0;i<City.length;i++){     "
  JsContent = JsContent &"object.add(new Option(City[i].spell +\"" \""+ City[i].name, City[i].spell +\""$\""+ City[i].name));"
  JsContent = JsContent &"if(Default == City[i].name){object.selectedIndex = i;}}}"  
  JsContent = JsContent &"function SearchfSetFlightType(value){"
  JsContent = JsContent &"switch(value){"
  JsContent = JsContent &"case '1':document.getElementById('tr_backdate').style.display = 'none';document.getElementById('tr_backtime').style.display = 'none';"
  JsContent = JsContent &"document.getElementById('DepartA').href = \""javascript:ShowCalendar('imgDepartDate', '', '', '', '', '', 'DepartDate', '')\"";"
  JsContent = JsContent &"document.getElementById('DepartDate').onclick = function(){event.cancelBubble=true;ShowCalendar(this.id, '', '', '', '', '', 'DepartDate', '');};"
  JsContent = JsContent &"break;"
  JsContent = JsContent &"case '2':document.getElementById('tr_backdate').style.display = '';document.getElementById('tr_backtime').style.display = '';"
  JsContent = JsContent &"document.getElementById('DepartA').href = \""javascript:ShowCalendar('imgDepartDate', 'imgBackDate', '', '', '', '', 'DepartDate', 'BackDate')\"";"
  JsContent = JsContent &"document.getElementById('DepartDate').onclick = function(){event.cancelBubble=true;ShowCalendar(this.id, 'BackDate', '', '', '', '', 'DepartDate', 'BackDate');};"
  JsContent = JsContent &"break;default:break;}}"
  JsContent = JsContent &"SearchfInitCity('DestinationCity', getCookie('"& EL_Sn &"','Flight_DestinationCity')?getCookie('"& EL_Sn &"','Flight_DestinationCity').split('$')[1]:'"& DefaultDepartCity &"');"
  JsContent = JsContent &"SearchfInitCity('DepartCity', getCookie('"& EL_Sn &"','Flight_DepartCity')?getCookie('"& EL_Sn &"','Flight_DepartCity').split('$')[1]:'"& DefaultDestinationCity &"');"
  JsContent = JsContent &"document.getElementById('DepartDate').value = getCookie('"& EL_Sn &"','Flight_DepartDate')?getCookie('"& EL_Sn &"','Flight_DepartDate'):'yyyy-mm-dd'; "
  JsContent = JsContent &"document.getElementById('BackDate').value = getCookie('"& EL_Sn &"','Flight_BackDate')?getCookie('"& EL_Sn &"','Flight_BackDate'):'yyyy-mm-dd'; "
  JsContent = JsContent &"</scr"&"ipt>"");"
  
  Call EL_Common.CreateFile(JsContent, InstallDir & EL_Channel.ChannelDir &"/Js/ShowSearchForm.js", True)
  
  EL_Common.ShowScriptError()
End Sub

Sub CreateJs()
  On Error Resume Next  
  Call CreateCompanyJs()
  Call CreateSearchFormJs()
  ComeURL = "Admin_FlightCompany.asp?ChannelID="& EL_Channel.ChannelID
  EL_Common.ShowSuccessMsg("成功生成航空公司Js文件")  
  EL_Common.ShowScriptError() 
End Sub

Sub CreateCompanyJs()
  On Error Resume Next
  Dim CompanyCmd, rsCompany, RowCount, i
  Dim JsDir, JsContent
  
  JsDir = InstallDir &"Js/Company.js"
  
  Call EL_Common.InitCommonCmd(CompanyCmd, rsCompany, "EL_FlightCompany", "CompanyID,CompanyFullName", "ChannelID="& EL_Channel.ChannelID &" ORDER BY CompanyFullName ASC")
  rsCompany.Close()
  RowCount = CompanyCmd(0)
  If RowCount = 0 Then
     Set rsCompany = Nothing
	 Set CompanyCmd = Nothing
	 Exit Sub
  End If
  
  JsContent = "function CompanyObject(id, name){"
  JsContent = JsContent &"this.id = id; this.name = name;"
  JsContent = JsContent &"}"
  JsContent = JsContent & VBCRLF
  JsContent = JsContent & "var Company = new Array();"& VBCRLF
  rsCompany.Open()
  For i = 1 To RowCount
    JsContent = JsContent &"Company["& (i-1)&"] = new CompanyObject("& rsCompany(0) &", """& EL_Common.ServerHTMLEncode(rsCompany(1)) &""");"& VBCRLF
	If i<RowCount Then rsCompany.MoveNext
  Next
  rsCompany.Close()
  Set rsCompany = Nothing
  Set CompanyCmd = Nothing
  
  Call EL_Common.CreateFile(JsContent, JsDir, True)
  
  EL_Common.ShowScriptError()

End Sub

Sub SaveCompany(UpdateType)
  On Error Resume Next
  Dim CompanyCmd
  Dim CompanyID, CompanyShortName, CompanyFullName, LogoURL, Content
  
  CompanyID = EL_Common.ELRequest("CompanyID", 2)
  CompanyShortName = EL_Common.ELRequest("CompanyShortName", 1)
  CompanyFullName = EL_Common.ELRequest("CompanyFullName", 1)
  LogoURL = EL_Common.ELRequest("LogoURL", 1)
  Content = EL_Common.ELRequest("Content", 1)
  
  Call EL_Common.InitCommand(CompanyCmd, "EL_SP_FlightCompany")
  With CompanyCmd
    .Parameters.Append .CreateParameter("RETURN", 2, 4)
	.Parameters.Append .CreateParameter("@UpdateType", 3, 1, 4, UpdateType)
	.Parameters.Append .CreateParameter("@CompanyID", 3, 1, 4, CompanyID)
	.Parameters.Append .CreateParameter("@ChannelID", 3, 1, 4, EL_Channel.ChannelID)
	.Parameters.Append .CreateParameter("@CompanyShortName", 200, 1, 20, CompanyShortName)
	.Parameters.Append .CreateParameter("@CompanyFullName", 200, 1, 100, CompanyFullName)
	.Parameters.Append .CreateParameter("@LogoURL", 200, 1, 255, LogoURL)
	.Parameters.Append .CreateParameter("@Content", 203, 1, EL_Common.LenParameter(Content), Content)
	.Execute()
  End With
  Select Case CompanyCmd(0)
    Case 40: EL_Common.ShowErrorMsg("频道参数错误") : Set CompanyCmd = Nothing : Exit Sub
	Case 41: EL_Common.ShowErrorMsg("指定公司不存在") : Set CompanyCmd = Nothing : Exit Sub
  End Select
  Set CompanyCmd = Nothing
  Call CreateCompanyJs()
  Call CreateSearchFormJs()
  EL_Common.ShowScriptError()
  If UpdateType = 0 Then
     EL_Common.ShowSuccessMsg("成功添加公司!<br>简称:<span class=bluetext>"& CompanyShortName &"</span><br>全称:<span class=bluetext>"& CompanyFullName &"</span>")
  ElseIf UpdateType = 1 Then
     EL_Common.ShowSuccessMsg("成功修改公司!<br>简称:<span class=bluetext>"& CompanyShortName &"</span><br>全称:<span class=bluetext>"& CompanyFullName &"</span>")
  ElseIf UpdateType = 2 Then
     Response.Redirect ComeURL
  End If
  
End Sub

Sub ModifyCompany()
On Error Resume Next
Dim CompanyCmd, rsCompany
Dim CompanyID
CompanyID = EL_Common.ELRequest("CompanyID", 2)
Call EL_Common.InitCommonCmd(CompanyCmd, rsCompany, "EL_FlightCompany", "*", "ChannelID="& EL_Channel.ChannelID &" AND CompanyID="& CompanyID)
rsCompany.Close()
If CompanyCmd(0) <> 1 Then
   Set rsCompany = Nothing
   Set CompanyCmd = Nothing
   EL_Common.ShowErrorMsg("指定航空公司不存在")
   Exit Sub
End If

⌨️ 快捷键说明

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