<% userPageRights="{tour}" %>
<!--#include file="check.asp"-->
<!--#include file="../Include/Char.asp" -->
<!--#include file="../include/md5.asp"-->
<%
'Define Variable 
dim i
dim rs
dim mGrade,m_SQL,mFlag,mBgColor
'initialization 
mFlag=true'add


'Sort Grade Up
If Request.QueryString("action")="up" then
   mSql="update Tour_TravelLine set F_index=F_index+1 where F_ID="&Request.QueryString("SortID")
   conn.execute(mSql)
   mBgColor=Request.QueryString("SortID")
   Response.Redirect "tour_travellinemanage.asp?pageno="&Request("pageno")&"&BgColor="&mBgColor
 End if

'Sort Grade Down
If Request.QueryString("action")="down" then
   mSql="update Tour_TravelLine set F_index=F_index-1 where F_ID="&Request.QueryString("SortID")
   conn.execute(mSql)
   mBgColor=Request.QueryString("SortID")
   Response.Redirect "tour_travellinemanage.asp?pageno="&Request("pageno")&"&BgColor="&mBgColor
 End if

'Display
if request("action")="edit" then 
 m_SQL="Select * From Tour_TravelLine Where F_ID="&Request.QueryString("ModifyID")
 Set rs = conn.Execute(m_SQL)
 if Not rs.Eof then
   m_TravelAgencyID = rs("F_TravelAgencyID")
   m_LineName = rs("F_LineName")
   m_StartCityName = rs("F_StartCityName")
   m_EndCityName = rs("F_EndCityName")
   m_Routing = rs("F_Routing")
   m_Linger = rs("F_Linger")
   m_Traffic = rs("F_Traffic")
   m_StartoffTime = rs("F_StartoffTime")
   m_Price = rs("F_Price")
   m_MemberPrice = rs("F_MemberPrice")
   m_AirWays = rs("F_AirWays")
   m_Berth = rs("F_Berth")
   m_StarGrade = rs("F_StarGrade")
   m_RoomType = rs("F_RoomType")
   m_SightFlag = rs("F_SightFlag")
   m_Intro = rs("F_Intro")
   m_Image = rs("F_Image")
   m_event = rs("F_event")
   m_careful = rs("F_careful")
   m_way = rs("F_way")
   m_typeid=rs("f_typeid")
  End if
  mFlag=false
  rs.Close
end if

if Request.ServerVariables("REQUEST_METHOD")="POST" then
   m_TravelAgencyID = checkStr(Trim(Request.Form("selTravelAgency")))
   m_LineName = Trim(Request.Form("txtLineName"))
   m_StartCityName = checkStr(Trim(Request.Form("selStartCityName")))
   m_EndCityName = checkStr(Trim(Request.Form("selEndCityName")))
   m_Routing = checkStr(Trim(Request.Form("txtRouting")))
   m_Linger = checkStr(Trim(Request.Form("txtLinger"))) 
   m_Traffic = checkStr(Trim(Request.Form("txtTraffic")))
   m_StartoffTime = checkStr(Trim(Request.Form("selStartOffTime")))
   m_Price = checkStr(Trim(Request.Form("txtPrice")))
   m_MemberPrice = checkStr(Trim(Request.Form("txtMemberPrice")))
   m_AirWays = checkStr(Trim(Request.Form("txtAirWays")))
   m_Berth = checkStr(Trim(Request.Form("radBerth")))
   m_StarGrade = checkStr(Trim(Request.Form("selStarGrade")))
   m_RoomType = checkStr(Trim(Request.Form("selRoomType")))
   m_SightFlag = checkStr(Trim(Request.Form("chkSightFlag")))
  ' m_Image = checkStr(Trim(Request.Form("txtImage")))
   m_Intro = checkStr(rTrim(Request.Form("txtContent")))
   m_event = checkStr(rTrim(Request.Form("event")))
   m_careful = checkStr(rTrim(Request.Form("careful")))
   m_way = checkStr(rTrim(Request.Form("way")))
   m_typeid = checkStr(rTrim(Request.Form("selTraveltype")))
   
 if Request.Querystring("action")="Insert" then
    m_SQL = "Select * From Tour_TravelLine Where F_LineName='"&m_LineName&"'"
	Set rs = conn.Execute(m_SQL)
	if not rs.Eof then
	   rs.Close
	   call msgbox("对不起，该旅行线路已存在!",1)
	else
	  rs.Close
	  m_Sql = "Insert Into Tour_TravelLine(F_LineName,F_TravelAgencyID,F_EndCityName,F_StartCityName,F_Routing,F_Linger,F_Traffic,F_StartOffTime,F_Price,F_typeid,F_MemberPrice,F_AirWays,F_Berth,F_StarGrade,F_RoomType,F_SightFlag,F_Image,F_Intro,F_event,F_careful,F_way)"
	  m_Sql = m_Sql + "Values('"&m_LineName&"',"&m_TravelAgencyID&",'"&m_EndCityName&"','"&m_StartCityName&"','"&m_Routing&"',"&m_Linger&",'"&m_Traffic&"','"&m_StartoffTime&"',"&m_Price&","&m_typeid&","&m_MemberPrice&",'"&m_AirWays&"','"&m_Berth&"','"&m_StarGrade&"',"&m_RoomType&",'"&m_SightFlag&"','"&application("newsuploadpic")&"','"&m_Intro&"','"&m_event&"','"&m_careful&"','"&m_way&"')"
	  conn.Execute(m_Sql)
	  application("newsuploadpic")=""
	    m_SQL = "Select * From Tour_TravelLine Where F_LineName='"&m_LineName&"'"
	    Set rs = conn.Execute(m_SQL)
		if not rs.eof then
		m_travelline_id=rs("f_id")
		end if
		rs.close
	   '写入日程安排
	     if m_Linger<>0  then
         for i=1 to m_linger   
            m_Sql = "Insert Into Tour_TravelLineday ( f_travelline_id,f_content) values ("&m_travelline_id&",'"&checkStr(rTrim(Request.Form("lookmoviepathX"&i&"")))&"')"
            conn.Execute(m_Sql)
         next   
         end if  
	  
      response.redirect "Tour_TravelLineManage.asp?action=IsInsert&pageno="&Request("pageno")
     end if '//rs.eof
  else 
      m_SQL = "UPDATE Tour_TravelLine SET"
      m_SQL = m_SQL+" F_LineName='"&m_LineName&"',"
      m_SQL = m_SQL+" F_TravelAgencyID="&m_TravelAgencyID&","
      m_SQL = m_SQL+" F_EndCityName='"&m_EndCityName&"',"
      m_SQL = m_SQL+" F_StartCityName='"&m_StartCityName&"',"
      m_SQL = m_SQL+" F_Routing='"&m_Routing&"',"
      m_SQL = m_SQL+" F_Linger="&m_Linger&","
      m_SQL = m_SQL+" F_Traffic='"&m_Traffic&"',"
      m_SQL = m_SQL+" F_StarGrade='"&m_StarGrade&"',"
      m_SQL = m_SQL+" F_StartOffTime='"&m_StartOffTime&"',"
      m_SQL = m_SQL+" F_Price="&m_Price&","
	  m_SQL = m_SQL+" F_typeid="&m_typeid&","
      m_SQL = m_SQL+" F_MemberPrice="&m_MemberPrice&","
      m_SQL = m_SQL+" F_AirWays='"&m_AirWays&"',"
      m_SQL = m_SQL+" F_Berth='"&m_Berth&"',"
      m_SQL = m_SQL+" F_RoomType="&m_RoomType&","
      m_SQL = m_SQL+" F_SightFlag='"&m_SightFlag&"',"
      m_SQL = m_SQL+" F_Intro='"&m_Intro&"',"
      m_SQL = m_SQL+" F_Image='"&application("newsuploadpic")&"',"
	  m_SQL = m_SQL+" F_event='"&m_event&"',"
	  m_SQL = m_SQL+" F_careful='"&m_careful&"',"
	  m_SQL = m_SQL+" F_way='"&m_way&"'"
      m_SQL = m_SQL +" WHERE F_ID=" & Request("ModifyID") 
      conn.Execute(m_SQL)
	   application("newsuploadpic")="" 
		
	    '写入日程安排
	     if m_Linger<>0  then
		 m_SQL = "Select * From Tour_TravelLineday Where F_travelline_id="&Request("ModifyID")
	     Set rs = conn.Execute(m_SQL)
		 i=0
         do while not rs.eof
         i=i+1           
         m_Sql = "UPDATE Tour_TravelLineday SET f_content='"&checkStr(rTrim(Request.Form("lookmoviepathX"&i&"")))&"' where f_id="&rs("f_id")
         conn.Execute(m_Sql)      
         rs.movenext
         loop
         rs.close  
        end if  
		 
      Response.redirect "Tour_TravelLineManage.asp?action=IsModify&pageno="&Request("pageno")
   End if
 End if

'Delect Records
if request("action")="Delete" then
  m_SQL = "DELETE FROM Tour_TravelLine WHERE F_ID=" &Request.QueryString("DeleteID")
  conn.execute m_SQL
    m_SQL = "DELETE FROM Tour_TravelLineday WHERE F_travelline_id=" &Request.QueryString("DeleteID")
  conn.execute m_SQL
  Response.write "<script>location.replace('Tour_TravelLineManage.asp?action=IsDelete&pageno="&Request.Querystring("pageno")&"')</script>"
end if
%>

<html>
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link href="../Files/Style.css" rel="stylesheet" type="text/css">
<script>
function addlookmovie(X,N)
{
lookmoviepath.innerHTML=""
for (loop=1; loop<=X;loop++)
{
lookmoviepath.innerHTML=lookmoviepath.innerHTML+'<table width="100%"><tr><td>第'+loop+'天行程安排：<textarea name="lookmoviepathX'+loop+'" cols="60" rows="3">'+N+'</textarea></td></tr></table>'
}
}

</script>
<SCRIPT language="JavaScript">
function jDelete(url)
{
  if((confirm(" 警告:请确定是否删除,删除后不能恢复! "))==true) 
	self.location=url+'&action=Delete';
}
</SCRIPT>
<script language="javascript">
function CheckData(){
  if (document.form1.txtLineName.value=="")
   {
    alert("对不起,请输入旅游线路名称！");
	document.form1.txtLineName.focus();
	return false;
   }
}
</script>
</head>
<body text="#000000" >
<table width="100%" height="1"  border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td></td>
  </tr>
</table>
<TABLE width=100% height=22 border=1 align="center" cellPadding=0 
cellSpacing=0 borderColor=#7c96b8 borderColorDark=#ffffff>
  <TBODY>
    <TR align="center" > 
      <TD width="100%" height=20 align="left" background="Images/mmTo.gif" > <span style="CURSOR: hand; FILTER: dropshadow(color=#FFFFFF, offx=1, offy=1, positive=1);  WIDTH: 100%"> 
        <FONT color=#336699>※当前路径：网站后台管理 → 旅游预订 → 旅行路线</FONT></span></TD>
    </TR>
  </TBODY>
</TABLE>
<TABLE width=100% height=95% border=1 align="center" cellPadding=0 
cellSpacing=0 borderColor=#7c96b8 borderColorDark=#ffffff>
  <TBODY>
    <TR> 
      <TD width="100%" align=center valign="top">
<table width="100%" border="0" cellspacing="1" cellpadding="0" align="center">
          <tr style="cursor:hand" onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#EBEEF6'"  bgcolor="#dde1ec" align="center"> 
            <td width="4%"><font color="#666666"><b>ID</b></font></td>
            <td width="28%"><font color="#666666"><b>线路名称</b></font></td>
            <td width="7%"><strong><font color="#666666">排序</font></strong></td>
            <td width="20%"><font color="#666666"><b>旅行社</b></font></td>
            <td width="13%"><font color="#666666"><b>目的城市</b></font></td>
            <td width="7%"><font color="#666666"><b>价格</b></font></td>
            <td width="8%"><font color="#666666"><b>会员价</b></font></td>
            <td width="13%"><font color="#666666"><b>管理<a title="添加记录" href='Tour_TravelLineManage.asp?pageno=<%=mPage%>#anInsert'><font color="#FF0000">[添加]</font></a></b></font></td>
          </tr>
        </table>
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="1" bgcolor="#ebeef6">
          <%  
	Set rs=Server.createobject("Adodb.RecordSet")
    pageno=request.querystring("pageno")
    pmcount=16  
    m_SQL="select * from Tour_TravelLine order by F_ID desc"
	rs.open m_SQL,conn,1,1
	if rs.eof then
	  'response.write "<br><p  align='center'><font color=red><B> 对不起，数据已清空！</B></font></p>"
    else
    rs.pagesize=pmcount
    mpage=rs.pagecount
    if pageno="" then pageno=1
    if  cint(pageno)<1 or cint(pageno)>mpage then  pageno=1
    rs.absolutepage=pageno

 Dim rc,re
 rc=rs.pagesize
 re=1
 do while not rs.eof and rc>0
 mBgColor=Request.Querystring("BgColor")
 if Trim(rs("F_ID"))=Trim(mBgColor) then mColor= "D6DFFF" else mColor= "ffffff"
%>
          <tr bgcolor="<%=mColor%>"   onmouseout="this.style.backgroundColor=''" onmouseover="this.style.backgroundColor='#EBEEF6'" > 
            <td  width="4%" align="center"><%=rs("F_ID")%></td>
            <td width="28%" > <a target="_blank" href="../Tour/Travel_LineShow.asp?ID=<%=rs("F_ID")%>"> 
              <%=rs("F_LineName")%> </a> </td>
            <td width="7%" align="center" ><%=rs("F_index")%> [<a href="tour_travellinemanage.asp?pageno=<%=cstr(pageno)%>&action=up&SortID=<%=rs("F_ID")%>">+</a>][<a href="tour_travellinemanage.asp?pageno=<%=cstr(pageno)%>&action=down&SortID=<%=rs("F_ID")%>">-</a>]</td>
            <td width="20%" >
			<%
			 m_SQL = "SELECT F_TravelAgencyName FROM Tour_TravelAgency WHERE F_ID="&rs("F_TravelAgencyID")
			 Set rst = conn.Execute(m_SQL)
			 if Not rst.eof then Response.write rst(0) else Response.write "无"
			 rst.Close
			%> </td>
            <td width="14%" align="center" ><%=rs("F_EndCityName")%></td>
            <td width="7%" align="center" > <%=rs("F_Price")%> </td>
            <td width="8%" align="center" > <%=rs("F_MemberPrice")%> </td>
            <td width="12%" align="center" ><a title="修改记录" href='Tour_TravelLineManage.asp?action=edit&ModifyID=<%=rs("F_ID")%>&BgColor=<%=rs("F_ID")%>&pageno=<%=cstr(pageno)%>#anModify'><font color="#666666">[修改]</font></a><a title="请确定是否删除,删除后不能恢复!" href="javascript:jDelete('Tour_TravelLineManage.asp?DeleteID=<%=rs("F_ID")%>&pageno=<%=cstr(pageno)%>')"><font color="#666666">[删除]</font></a></td>
          </tr>
          <%
 rs.movenext
 re=re+1
 rc=rc-1
 loop
 end if
%>
        </table> 
        <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="FFFFFF">
          <tr> 
            <td width="35%" height="22">
			  &nbsp;共
			  <font color=red><strong><% = rs.recordcount%></strong></font>
			  条记录 当前第
			  <font color=red><strong><% = Trim(pageno)%></strong></font>页/共
			  <font color=red><strong><% = Trim(mpage)%></strong></font>页
			  </td>
            <td width="65%" align="right"> 
<%
if pageno="" then pageno=1
if pageno>1 then
   response.write "<a href='Tour_TravelLineManage.asp'> <img alt='首页' src='Images/boqb02.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='首页' src='Images/boqb02.gif' border=0 width='15' height='14'>"
end if

if pageno>1 then
   response.write "<a href='Tour_TravelLineManage.asp?pageno="&pageno-1&"'><img alt='上一页' src='Images/bob02.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='上一页' src='Images/bob02.gif' border=0 width='15' height='14'>"
end if

add=5'数字分页个数+1
if pageno-int(add/2)<=1 then m=1 else m=pageno-int(add/2)
if m+add>mpage then 
   n=mpage
   if mpage-add<=1 then m=1 else m=mpage-add
else
   n=m+add
end if

for pno=m to n
 if pno=cint(pageno) then
   response.write "&nbsp;<font color=red>"&pno&"</font>"
 else
   response.write "<b>&nbsp;<a href='Tour_TravelLineManage.asp?pageno="&pno&"'>"&pno&"</a></b>"
 end if
next
response.write "&nbsp"

if int(pageno) < int(rs.pagecount) then
  response.write "<a href='Tour_TravelLineManage.asp?pageno="&pageno+1&"'><img alt='下一页' src='Images/fbob02.gif' border=0 width='15' height='14'></a>"
else 
  response.write "<img alt='下一页' src='Images/fbob02.gif' border=0 width='15' height='14'>"
end if

if int(pageno) < int(rs.pagecount) then
   response.write "<a href='Tour_TravelLineManage.asp?pageno="&mpage&"'><img alt='末页' src='Images/fboqb02.gif' border=0 width='15' height='14'></a>"
else
   response.write "<img alt='末页' src='Images/fboqb02.gif' border=0 width='15' height='14'>"
end if
Response.write "&nbsp;&nbsp;"
%>
            </td>
          </tr>
        </table>
        <%if mFlag=true then'add%>
        <strong><font color=red><a name="anInsert"></a></font></strong> 
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td height="32" align="center" bgcolor="FFFFFF"><strong><font color=red> 
              <%
		  if Request.QueryString("action")="IsInsert" then response.write "提示：记录添加成功！" 
		  if Request.QueryString("action")="IsDelete" then response.write "提示：记录删除成功！" 
		  if Request.QueryString("action")="IsModify" then response.write "提示：记录修改成功！" 
  		  if Trim(Request.QueryString("action"))="" then response.write "提示：当前为添加状态！" 
		%>
              </font></strong></td>
          </tr>
        </table> 
        <strong><font color=red> </font></strong> 
        <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
          <tr> 
            <form name="form1" method="post" action="Tour_TravelLineManage.asp?action=Insert" onSubmit="return CheckData()">
              <td> <table width="100%" border="0" cellpadding="2" cellspacing="0">
                  <tr background="Images/mmTo.gif"> 
                    <td height="6" background="Images/mmTo.gif"> <span style="CURSOR: hand; FILTER: dropshadow(color=#FFFFFF, offx=1, offy=1, positive=1);  WIDTH: 100%">功能：添加记录</span></td>
                  </tr>
                  <tr> 
                    <td valign="top" bgcolor="fcfcfc"> 
                      <table width="100%" border="0" cellspacing="2" cellpadding="0">
                        <tr> 
                          <td width="12%" height="19">线路名称：</td>
                          <td width="88%"><input name="txtLineName" type="text"  class="text" value="" size="36" maxlength="50"> 
                          </td>
                        </tr>
						 <tr> 
                          <td width="12%" height="19">线路类型：</td>
                          <td width="88%"><select class="text" name="selTraveltype">
                              <%
							  m_SQL = "SELECT F_ID,F_value FROM Tour_Traveltype"
							  Set rst = conn.Execute(m_SQL)
							  Do While Not rst.Eof
							    Response.Write "<option value='"&rst(0)&"'>"&rst(1)&"</option>"
								rst.MoveNext
						      Loop
							  rst.Close
							 %>
                            </select></td>
                        </tr>
                        <tr> 
                          <td width="12%" height="19">旅 行 社：</td>
                          <td width="88%"> <select class="text" name="selTravelAgency">
                              <%
							  m_SQL = "SELECT F_ID,F_TravelAgencyName FROM Tour_TravelAgency"
							  Set rst = conn.Execute(m_SQL)
							  Do While Not rst.Eof
							    Response.Write "<option value='"&rst(0)&"'>"&rst(1)&"</option>"
								rst.MoveNext
						      Loop
							  rst.Close
							 %>
                            </select> <a href="Tour_TravelAgencyManage.asp">设置</a> 
                          </td>
                        </tr>
                        <tr> 
                          <td width="12%" height="19">目的城市：</td>
                          <td width="88%"> <select class="text" name="selEndCityName">
                              <%
							  m_SQL = "SELECT * FROM Tour_TravelCity"
							  Set rst = conn.Execute(m_SQL)
							  Do While Not rst.Eof
							    Response.Write "<option value='"&rst("F_CityName")&"'>"&rst("F_CityName")&"</option>"
								rst.MoveNext
						      Loop
							  rst.Close
							 %>
                            </select> <a href="Tour_TravelCityManage.asp">设置</a></td>
                        </tr>
                        <tr> 
                          <td width="12%" height="19">出发城市：</td>
                          <td width="88%"><select class="text" name="selStartCityName">
                              <%
							  m_SQL = "SELECT * FROM Tour_TravelCity"
							  Set rst = conn.Execute(m_SQL)
							  Do While Not rst.Eof
							    Response.Write "<option value='"&rst("F_CityName")&"'>"&rst("F_CityName")&"</option>"
								rst.MoveNext
						      Loop
							  rst.Close
							 %>
                            </select> <a href="Tour_TravelCityManage.asp">设置</a></td>
                        </tr>
                        <tr> 
                          <td width="12%" height="8">价　　格：</td>
                          <td width="88%"><input name="txtPrice" type="text"  class="text" value="0" size="4" maxlength="5" onBlur="if (isNaN(this.value)){this.value='0';  alert('类型错误,请输入数值型！');this.focus(); }">
                            元</td>
                        </tr>
                        <tr> 
                          <td width="12%" height="8">会 员 格：</td>
                          <td width="88%"><input name="txtMemberPrice" type="text"  class="text" value="0" size="4" maxlength="5" onBlur="if (isNaN(this.value)){this.value='0';  alert('类型错误,请输入数值型！');this.focus(); }">
                            元</td>
                        </tr>
                        <tr> 
                          <td width="12%" height="19">逗留日数：</td>
                          <td width="88%"><input name="txtLinger" type="text"  class="text" value="0" size="4" maxlength="2" onBlur="if (isNaN(this.value)){this.value='0';  alert('类型错误,请输入数值型！');this.focus(); }">
                            天 
                            <input type="button" value="激活" name="addlook" onclick="addlookmovie(document.form1.txtLinger.value,document.form1.MovieName.value)"> 
                            <input type="hidden" name="MovieName" value=""> </td>
                        </tr>
                        <tr> 
                          <td height="19">每日安排：</td>
                          <td valign="middle" id="lookmoviepath"> </td>
                        </tr>
                        <tr> 
                          <td width="12%" height="22">出团时间：</td>
                          <td width="88%"> <input name="selStartOffTime" type="text"  class="text" value="" size="20" maxlength="50">
                            1,3 </td>
                        </tr>
                        <tr> 
                          <td width="12%" height="2">线路说明：</td>
                          <td width="88%"><textarea name="txtRouting" cols="80" rows="5" class="text"></textarea></td>
                        </tr>
                        <tr> 
                          <td width="12%" height="9">交通工具：</td>
                          <td><input name="txtTraffic" type="text"  class="text" size="64" maxlength="20"></td>
                        </tr>
                        <tr> 
                          <td width="12%" height="9">航空公司：</td>
                          <td><input name="txtAirways" type="text"  class="text" size="36" maxlength="20"> 
                          </td>
                        </tr>
                        <tr> 
                          <td width="12%" height="9">机票级别：</td>
                          <td><input name="radBerth" type="radio" value="无" checked>
                            无 
                            <input name="radBerth" type="radio" value="经济舱" checked>
                            经济舱 
                            <input type="radio" name="radBerth" value="商务舱">
                            商务舱(+30%) 
                            <input type="radio" name="radBerth" value="头等舱">
                            头等舱(+50%) </td>
                        </tr>
                        <tr> 
                          <td width="12%" height="8">酒店级别：</td>
                          <td width="88%"> <select class="text" name="selStarGrade">
                              <%
						      Response.Write "<option value=''></option>"
							  m_SQL = "SELECT F_ID,F_Value FROM Tour_StarGradeType order by F_Grade desc"
							  Set rst = conn.Execute(m_SQL)
							  Do While Not rst.Eof
							    Response.Write "<option value='"&rst(0)&"'>"&rst(1)&"</option>"
								rst.MoveNext
						      Loop
							  rst.Close
							 %>
                            </select> </td>
                        </tr>
                        <tr> 
                          <td width="12%" height="9">房间类型：</td>
                          <td><select class="text" name="selRoomType">
                              <%
							  Response.Write "<option value='0'></option>"
							  m_SQL = "SELECT F_ID,F_Value FROM Tour_HotelRoomType order by F_Grade"
							  Set rst = conn.Execute(m_SQL)
							  Do While Not rst.Eof
							    Response.Write "<option value='"&rst(0)&"'>"&rst(1)&"</option>"
								rst.MoveNext
						      Loop
							  rst.Close
							 %>
                            </select> </td>
                        </tr>
                        <tr> 
                          <td width="12%" >选择景点：</td>
                          <td> <%
						  m_SQL = "SELECT F_ID,F_SightName,F_CityName FROM Tour_TravelSight order by F_ID DESC"
						  Set rst = conn.Execute(m_SQL)
						  Do While Not rst.Eof
						    Response.write "<input type='checkbox' name='chkSightFlag' value='"&rst(0)&"'>"&rst(1)
							rst.MoveNext
						  Loop
						  rst.Close
						  %> </td>
                        </tr>
                        <tr> 
                          <td height="14">介　　绍： </td>
                          <td> <textarea name="txtContent" style="display:none" ></textarea> 
                            <IFRAME ID="LatticeEditDocument" SRC="eEditor/ewebeditor.asp?id=txtContent&style=news" FRAMEBORDER="0" SCROLLING="no" WIDTH="550" HEIGHT="350"></IFRAME> 
                          </td>
                        </tr>
                        <tr> 
                          <td>服务项目：</td>
                          <td><textarea name="event" cols="80" rows="5" class="text" id="event"></textarea></td>
                        </tr>
                        <tr> 
                          <td>注意事项：</td>
                          <td><textarea name="careful" cols="80" rows="5" class="text" id="careful"></textarea></td>
                        </tr>
                        <tr> 
                          <td>报名方法：</td>
                          <td><textarea name="way" cols="80" rows="5" class="text" id="way"></textarea></td>
                        </tr>
                        <tr> 
                          <td height="37" colspan="2"><input  type="submit" value="提交信息" name="B32"  class="button"> 
                            &nbsp; <input type="reset" value="从新来过" name="B32" class="button"></td>
                        </tr>
                      </table>
                      
                    </td>
                  </tr>
                </table></td>
            </form>
          </tr>
        </table>
        <%else%>
        <strong><font color=red><a name="anModify"></a></font></strong> 
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr> 
            <td height="32" align="center" bgcolor="ffffff"><strong><font color=red> 
        <%
		  if Request.QueryString("action")="IsInsert" then response.write "提示：记录添加成功！" 
		  if Request.QueryString("action")="IsDelete" then response.write "提示：记录删除成功！" 
		  if Request.QueryString("action")="IsModify" then response.write "提示：记录修改成功！" 
		  if Trim(Request.QueryString("action"))="edit" then response.write "提示：当前为修改状态！" 
	   %>
              </font></strong></td>
          </tr>
        </table>
        <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center" height="54">
          <tr> 
            <form name="form1" method="post" action="Tour_TravelLineManage.asp?pageno=<%=request("pageno")%>&ModifyID=<%=request("ModifyID")%>" onSubmit="return CheckData()">
              <td> <table width="100%" border="0" cellpadding="2" cellspacing="0">
                  <tr background="Images/mmTo.gif"> 
                    <td height="6" background="Images/mmTo.gif"> <span style="CURSOR: hand; FILTER: dropshadow(color=#FFFFFF, offx=1, offy=1, positive=1);  WIDTH: 100%">功能：修改记录</span></td>
                  </tr>
                  <tr> 
                    <td valign="top" bgcolor="fcfcfc">
					<table width="100%" border="0" cellspacing="2" cellpadding="0">
                        <tr> 
                          <td width="10%" height="19">线路名称：</td>
                          <td colspan="2"><input name="txtLineName" type="text"  class="text" value="<%= m_LineName %>" size="36" maxlength="50"> 
                          </td>
                        </tr>
						 <tr> 
                          <td width="10%" height="19">线路类型：</td>
                          <td colspan="2"><select class="text" name="selTraveltype">
                              <%
							  m_SQL = "SELECT F_ID,F_value FROM Tour_Traveltype"
							  Set rst = conn.Execute(m_SQL)
							  Do While Not rst.Eof
							     if m_typeid=rst("f_id") then
								 Response.Write "<option value='"&rst(0)&"' selected>"&rst(1)&"</option>"
								 else
							     Response.Write "<option value='"&rst(0)&"'>"&rst(1)&"</option>"
								 end if
								rst.MoveNext
						      Loop
							  rst.Close
							 %>
                            </select></td>
                        </tr>
                        <tr> 
                          <td width="10%" height="19">旅 行 社：</td>
                          <td colspan="2"> <select class="text" name="selTravelAgency">
                              <%
							  m_SQL = "SELECT F_ID,F_TravelAgencyName FROM Tour_TravelAgency"
							  Set rst = conn.Execute(m_SQL)
							  Do While Not rst.Eof
							   if Trim(m_TravelAgencyID) = trim(rst(0)) then
 						          Response.Write "<option selected value='"&rst(0)&"'>"&rst(1)&"</option>"
                                else
							      Response.Write "<option value='"&rst(0)&"'>"&rst(1)&"</option>"
								end if
								rst.MoveNext
						      Loop
							  rst.Close
							 %>
                            </select> <a href="Tour_TravelAgencyManage.asp">设置</a> 
                          </td>
                        </tr>
                        <tr> 
                          <td width="10%" height="19">目的城市：</td>
                          <td colspan="2"> <select class="text" name="selEndCityName">
                              <%
							  m_SQL = "SELECT F_ID,F_CityName FROM Tour_TravelCity"
							  Set rst = conn.Execute(m_SQL)
							  Do While Not rst.Eof
							    if Trim(m_EndCityName) = trim(rst(1)) then
							      Response.Write "<option selected value='"&rst(1)&"'>"&rst(1)&"</option>"
                                else
							      Response.Write "<option value='"&rst(1)&"'>"&rst(1)&"</option>"
								end if
								rst.MoveNext
						      Loop
							  rst.Close
							 %>
                            </select> <a href="Tour_TravelCityManage.asp">设置</a></td>
                        </tr>
                        <tr> 
                          <td width="10%" height="19">出发城市：</td>
                          <td colspan="2"><select class="text" name="selStartCityName">
                              <%
							  m_SQL = "SELECT F_ID,F_CityName FROM Tour_TravelCity"
							  Set rst = conn.Execute(m_SQL)
							  Do While Not rst.Eof
							    if Trim(m_StartCityName) = trim(rst(1)) then
							      Response.Write "<option selected value='"&rst(1)&"'>"&rst(1)&"</option>"
                                else
							      Response.Write "<option value='"&rst(1)&"'>"&rst(1)&"</option>"
								end if
								rst.MoveNext
						      Loop
							  rst.Close
							 %>
                            </select> <a href="Tour_TravelCityManage.asp">设置</a></td>
                        </tr>
                        <tr> 
                          <td width="10%" height="8">价　　格：</td>
                          <td colspan="2"><input name="txtPrice" type="text"  class="text" value="<%=m_Price%>" size="4" maxlength="5" onBlur="if (isNaN(this.value)){this.value='0';  alert('类型错误,请输入数值型！');this.focus(); }">
                            元</td>
                        </tr>
                        <tr> 
                          <td width="10%" height="8">会 员 格：</td>
                          <td colspan="2"><input name="txtMemberPrice" type="text"  class="text" value="<%=m_MemberPrice%>" size="4" maxlength="5" onBlur="if (isNaN(this.value)){this.value='0';  alert('类型错误,请输入数值型！');this.focus(); }">
                            元</td>
                        </tr>
                        <tr> 
                          <td width="10%" height="19">逗留日数：</td>
                          <td colspan="2"><input name="txtLinger" type="text"  class="text" value="<%= m_Linger %>" size="4" maxlength="2" onBlur="if (isNaN(this.value)){this.value='0';  alert('类型错误,请输入数值型！');this.focus(); }">
                            天</td>
                        </tr>
                        <tr> 
                          <td height="19" rowspan="2">每日安排：</td>
                          <td colspan="2" valign="middle" id="lookmoviepath"> 
                            <%
          set rst=server.createobject("adodb.recordset")
          sql="select * from tour_travellineday where f_travelline_id="&Request.QueryString("ModifyID")
          rst.open sql,conn,1,1
          i=0
          do while not rst.eof
          i=i+1
          %>
                            第<%=i%>天： 
                            <textarea name="lookmoviepathX<%=i%>" cols="60" rows="3"><%=rst("f_content")%></textarea> 
                            <a href="delurl.asp?id=<%=rst("f_id")%>&tid=<%=Request.QueryString("ModifyID")%>&pageno=<%=cstr(pageno)%>&action=lookurl"> 
                            删除</a> <br> <%
          rst.movenext
          loop
		  rst.close
		  set rst=nothing
          %> </td>
                        </tr>
                        <tr> 
                          <td width="6%" valign="middle" id="lookmoviepath"><font color="#FF0000">第<%=i+1%>天：<br>
                            (增加) </font></td>
                          <td width="84%" valign="middle" id="lookmoviepath"> 
                            <iframe name="I2" src="addurl.asp?pageno=<%=cstr(pageno)%>&action=lookurl&movieid=<%=Request.QueryString("ModifyID")%>" width="100%" height="55" scrolling="no" border="0" frameborder="0">浏览器不支持嵌入式框架，或被配置为不显示嵌入式框架。</iframe> 
                            <input type="hidden" name="LooknumX" value="<%=i%>"> 
                          </td>
                        </tr>
                        <tr> 
                          <td width="10%" height="22">出团时间：</td>
                          <td colspan="2"> <input name="selStartOffTime" type="text"  class="text" value="<%=m_StartOffTime%>" size="20" maxlength="50">
                            1,3 </td>
                        </tr>
                        <tr> 
                          <td width="10%" height="2">行程安排：</td>
                          <td colspan="2"><textarea name="txtRouting" cols="80" rows="5" class="text"><%= m_Routing %></textarea></td>
                        </tr>
                        <tr> 
                          <td width="10%" height="9">交通工具：</td>
                          <td colspan="2"><input name="txtTraffic" type="text"  class="text" value="<%= m_Traffic %>" size="64" maxlength="20"></td>
                        </tr>
                        <tr> 
                          <td width="10%" height="9">航空公司：</td>
                          <td colspan="2"><input name="txtAirways" type="text"  class="text" value="<%= m_Airways %>" size="36" maxlength="20"> 
                          </td>
                        </tr>
                        <tr> 
                          <td width="10%" height="9">机票级别：</td>
                          <td colspan="2"> <input name="radBerth" type="radio" value="无"  <%if m_Berth = "无" then Response.write "checked"%>>
                            无 
                            <input type="radio" name="radBerth" value="经济舱" <%if m_Berth = "经济舱" then Response.write "checked"%>>
                            经济舱 
                            <input type="radio" name="radBerth" value="商务舱" <%if m_Berth = "商务舱" then Response.write "checked"%>>
                            商务舱(+30%) 
                            <input type="radio" name="radBerth" value="头等舱" <%if m_Berth = "头等舱" then Response.write "checked"%>>
                            头等舱(+50%) </td>
                        </tr>
                        <tr> 
                          <td width="10%" height="8">酒店级别：</td>
                          <td colspan="2"> <select class="text" name="selStarGrade">
                              <%
							  Response.Write "<option value=''></option>"
							  m_SQL = "SELECT F_ID,F_Value FROM Tour_StarGradeType order by F_Grade desc"
							  Set rst = conn.Execute(m_SQL)
							  Do While Not rst.Eof
							    if Trim(m_StarGrade) = trim(rst(0)) then
							      Response.Write "<option selected value='"&rst(0)&"'>"&rst(1)&"</option>"
                                else
							      Response.Write "<option value='"&rst(0)&"'>"&rst(1)&"</option>"
								end if
								rst.MoveNext
						      Loop
							  rst.Close
							 %>
                            </select> </td>
                        </tr>
                        <tr> 
                          <td width="10%" height="9">房间类型：</td>
                          <td colspan="2"> <select class="text" name="selRoomType">
                              <%
							  Response.Write "<option value='0'></option>"
							  m_SQL = "SELECT F_ID,F_Value FROM Tour_HotelRoomType order by F_Grade"
							  Set rst = conn.Execute(m_SQL)
							  Do While Not rst.Eof
							    if Trim(m_RoomType) = trim(rst(0)) then
							      Response.Write "<option selected value='"&rst(0)&"'>"&rst(1)&"</option>"
							    else
								  Response.Write "<option value='"&rst(0)&"'>"&rst(1)&"</option>"
								end if
								rst.MoveNext
						      Loop
							  rst.Close
							 %>
                            </select> </td>
                        </tr>
                        <tr> 
                          <td width="10%" >选择景点：</td>
                          <td colspan="2"> <%
						  m_SQL = "SELECT F_ID,F_SightName,F_CityName FROM Tour_TravelSight order by F_ID DESC"
						  Set rst = conn.Execute(m_SQL)
						  Do While Not rst.Eof
						    if instr(m_SightFlag,rst("F_ID"))<>0 then 
						      Response.write "<input checked type='checkbox' name='chkSightFlag' value='"&rst(0)&"'>"&rst(1)
						    else
							  Response.write "<input type='checkbox' name='chkSightFlag' value='"&rst(0)&"'>"&rst(1)
                            end if
							rst.MoveNext
						  Loop
						  rst.Close
						  %> </td>
                        </tr>
                        <tr> 
                          <td>介　　绍： </td>
                          <td colspan="2"><textarea name="txtContent" style="display:none"><%= m_Intro %></textarea> 
                            <IFRAME ID="LatticeEditDocument" SRC="eEditor/ewebeditor.asp?id=txtContent&style=news" FRAMEBORDER="0" SCROLLING="no" WIDTH="550" HEIGHT="350"></IFRAME> 
                          </td>
                        </tr>
                        <tr> 
                          <td>服务项目：</td>
                          <td colspan="2"><textarea name="event" cols="80" rows="5" class="text" id="textarea4"><%= m_event %></textarea></td>
                        </tr>
                        <tr> 
                          <td>注意事项：</td>
                          <td colspan="2"><textarea name="careful" cols="80" rows="5" class="text" id="textarea5"><%= m_careful %></textarea></td>
                        </tr>
                        <tr> 
                          <td>报名方法：</td>
                          <td colspan="2"><textarea name="way" cols="80" rows="5" class="text" id="textarea6"><%= m_way %></textarea></td>
                        </tr>
                        <tr> 
                          <td height="37" colspan="3"><input  type="submit" value="提交信息" name="B32"  class="button"> 
                            &nbsp; <input type="reset" value="从新来过" name="B32" class="button"></td>
                        </tr>
                      </table>
					</td>
                  </tr>
                </table></td>
            </form>
          </tr>
        </table>
        <%end if%>
      </TD>
    </TR>
  </TBODY>
</TABLE>
</body>
</html>
<%
 set rs=nothing
 CloseDatabase
%>