<!--#include file="../inc/config.asp"-->
<!--#include file="../inc/conn.asp"-->
<!-- #include file="inc/Session.asp" -->
<!-- #include file="inc/function.asp" -->
<!-- #include file="inc/checkrole.asp" -->
<%
'''''''''''''''''''''''''''''''''''''''''''''''
call checkPrevilege(Session("Name"),"p19")
'''''''''''''''''''''''''''''''''''''''''''''''
dim act,table,id,title,hnum
id=Clng(request.QueryString("id"))
set rs=conn.execute("select * from t_route where id="&id)
if not rs.eof then
	title=rs("Title")
end if
rs.close
set rs=nothing
%>
<html>
<head>
<title>旅游线路管理</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<style type="text/css">
<!--
body {
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
	background-color: #FFFFFF;
}
.h_table{}
.h_table .tr{ height:30px;}
.h_table .tr .d1{ float:left; width:35%; line-height:30px;}
.h_table .tr .d2{ float:left; width:10%; line-height:30px;}
.h_table .tr .d3{ float:left; width:10%; line-height:30px;}
.h_table .tr .d4{ float:left; width:15%; line-height:30px;}
.h_table .tr .d5{ float:left; width:15%; line-height:30px;}
.h_table .tr .d6{ float:left; width:15%; line-height:30px;}
-->
</style>
<link href="style/global.css" rel="stylesheet" type="text/css">
<style type="text/css">
<!--
.style1 {color: #FF0000}
.style2 {color: #CCCCCC}
.style3 {color: #FFFFFF;
	font-weight: bold;
}
-->
</style>
<script language="javascript">
function check(obj){
	if(obj.Title.value==""){
		alert("名称不能为空!");
		obj.Title.focus();
		obj.Title.select();
		return false;
	}
	return true;
}
</script>
</head>

<body>
<%
table="t_hotel"
act=trim(request.QueryString("act"))
if(act="add") then
	call InnerKeys_AddOk
elseif(act="del") then
	call InnerKeys_DelPrice
elseif(act="mod") then
	call InnerKeys_ModPrice
end if
%>
<%
Sub InnerKeys_DelPrice
	dim id,pid
	id=Clng(request.QueryString("id"))
	pid=Clng(request.QueryString("pid"))
	if(id>0 and pid>0) then
		conn.execute("delete from t_route_price where id="&pid)
	end if
end Sub

Sub InnerKeys_AddOk
	dim j
	j=hnum+1
	if(request.Form("title")<>"") then
		set rs=server.createobject("adodb.recordset")
			rs.open "select top 1 * from t_route_price where 1=0",conn,3,3
			rs.addnew
			rs("RouteId")=id
			rs("Title")=request.Form("title")
			rs("Price1")=request.Form("price1")
			rs("Price2")=request.Form("price2")
			rs("Price3")=request.Form("price3")
			rs("Price4")=request.Form("price4")
			rs.update
			rs.close
			set rs=nothing
	else
		response.Write("<script>alert('名称不能为空!');history.back();</script>")
	end if
end Sub

Sub InnerKeys_ModPrice
	dim id,pid
	id=Clng(request.QueryString("id"))
	pid=Clng(request.QueryString("pid"))
	if(id>0 and pid>0) then
		set rs=server.createobject("adodb.recordset")
		rs.open "select * from t_route_price where id="&pid,conn,3,3
		rs("Title")=request.Form("title")
		rs("Price1")=request.Form("price1")
		rs("Price2")=request.Form("price2")
		rs("Price3")=request.Form("price3")
		rs("Price4")=request.Form("price4")
		rs.update
		rs.close
		set rs=nothing
	end if
end Sub
%>


<table width="100%" border="0" cellspacing="1" cellpadding="0">
    <tr>
      <td width="25%" height="22" align="center" bgcolor="#DDFFFF">人数/类型</td>
      <td width="18%" bgcolor="#DDFFFF">标准等</td>
      <td width="16%" bgcolor="#DDFFFF">豪华等</td>
      <td width="16%" bgcolor="#DDFFFF">豪华A等</td>
      <td width="16%" bgcolor="#DDFFFF">超豪华等</td>
      <td width="9%" align="center" bgcolor="#DDFFFF">操作</td>
  </tr>
</table>
<FORM method="POST" name="form1" action="?act=add&id=<%=id%>" style="margin:0 0 0 0;">
<table width="100%" border="0" cellspacing="1" cellpadding="0">
    <tr>
      <td width="25%" height="25" align="center"><input name="title" type="text" id="title" size="15"></td>
      <td width="18%"><input name="price1" type="text" id="price1" value="0" size="6">
        元</td>
      <td width="16%"><input name="price2" type="text" id="price2" value="0" size="6">
        元</td>
      <td width="16%"><input name="price3" type="text" id="price3" value="0" size="6">
        元</td>
      <td width="16%"><input name="price4" type="text" id="price4" value="0" size="6">
        元</td>
      <td width="9%" align="left"><input type=submit name=b1 value="添加"></td>
    </tr>
  </table>
</FORM>
<%
i=1
set prs=server.createobject("adodb.recordset")
prs.open "select Title,Price1,Price2,Price3,Price4,id from t_route_price where RouteId="&id,conn,3,1
while not prs.eof
%>
<FORM method="POST" name="form1" action="?act=mod&id=<%=id%>&pid=<%=prs(5)%>" style="margin:0 0 0 0;">
<table width="100%" border="0" cellspacing="1" cellpadding="0">

    <tr>
      <td width="25%" height="25" align="center"><input name="title" type="text" id="title" value="<%=prs(0)%>" size="15"></td>
      <td width="18%"><input name="price1" type="text" id="price1" value="<%=prs(1)%>" size="6">
        元</td>
      <td width="16%"><input name="price2" type="text" id="price2" value="<%=prs(2)%>" size="6">
        元</td>
      <td><input name="price3" type="text" id="price3" value="<%=prs(3)%>" size="6">
        元</td>
      <td width="16%"><input name="price4" type="text" id="price4" value="<%=prs(4)%>" size="6">
        元</td>
      <td width="9%" align="left">
      <input type="submit" value="更新" />
      <input type="button" onClick="location.href='?act=del&id=<%=id%>&pid=<%=prs(5)%>'" value="删除" />
      </td>
    </tr>    
  </table>
</FORM>
<%
	i=i+1
	prs.movenext
wend
prs.close
set prs=nothing
%>
</body>
</html>
<%
call connclose()
%>