<!--#include file="inc/config.asp"-->
<!--#include file="inc/conn.asp"-->
<!--#include file="inc/route_func.asp"-->
<%
dim id,rs,Stars,Title,Photo,MinPrice,MaxPrice,Address,Zbjd,Dlwz,JianJie,Demons,Tel,Hits,PubDate,OrderNum,Lat,Lng
if(request.QueryString("id")<>"") then
	id=Clng(request.QueryString("id"))
else
	response.Write("error")
	response.End()
end if
set rs=conn.execute("select Stars,Title,Photo,MinPrice,MaxPrice,Address,Zbjd,Dlwz,JianJie,Demons,Tel,Hits,PubDate,OrderNum,Lat,Lng from t_hotel where id="&id)
if not rs.eof then
	Stars=rs(0)
	Title=rs(1)
	Photo=rs(2)
	MinPrice=rs(3)
	MaxPrice=rs(4)
	Address=rs(5)
	Zbjd=rs(6)
	Dlwz=rs(7)
	JianJie=rs(8)
	Demons=rs(9)
	Tel=rs(10)
	Hits=rs(11)
	PubDate=rs(12)
	OrderNum=rs(13)
	Lat=rs(14)
	Lng=rs(15)
end if
rs.close
set rs=nothing
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title><%=Title%>-<%=SiteName%></title>
<meta name="description" content="description" />
<meta name="keywords" content="keywords" />
<link href="style/global.css" rel="stylesheet" type="text/css" />
<link href="style/show.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/jquery-1.5.1.min.js"></script>
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/marquee.js"></script>
<script type="text/javascript" src="<%=Map_Api%>"></script>
<script type="text/javascript" src="js/ffff.js"></script>
<script type="text/javascript">
function AddFav(){
	var f_title=encodeURIComponent('<%=Title%>');
	var f_type='hotel';
	var f_url=encodeURIComponent(this.location.href);
	var surl='/member/favorite_add.asp?f_title='+f_title+'&f_type='+f_type+'&f_url='+f_url;	
	var opt = {
			'url': surl,
			'dataType': 'xml',
			'async':false,
			'success': function (xml) {              //返回成功
          var r = xml.documentElement.getElementsByTagName("result");
        	var v = r[0].getAttribute("return");
					if(v=='success'){
						alert('成功添加收藏');
					}else{
						alert('出错了');
					}
			},
			'error': function () {                        //返回失败后
					alert('Error loading XML document');
			}
	};
	$.ajax(opt);
}
</script>
<style type="text/css">
<!--
.STYLE22 {color: #9900FF}
-->
</style>
</head>

<body>
<!--#include file="templet/head.htm"-->
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td class="postion">现在位置：<a href="/">首页</a> -&gt; <a href="hotel.asp">旅游酒店</a> -&gt;<%=Title%></td>
  </tr>
</table>
<table width="960" border="0" align="center" cellpadding="0" cellspacing="0">
  <tr>
    <td width="228" valign="top">
    <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0" class="border_yellow">
      <tr>
        <td width="88%" class="topic">酒店分类</td>
      </tr>
      <tr>
        <td bgcolor="#FFFFFF" class="pad5">
        <div class="routes_txt">
        	<ul>
						<%
            set rs=conn.execute("select id,title from t_hotel_catalog")
            while not rs.eof
            %>
            <li><a href="hotel.asp?id=<%=rs(0)%>"><%=rs(1)%></a></li>
            <%
              rs.movenext
            wend 
            rs.close
            set rs=nothing
            %>
          </ul>
          </div>
        </td>
      </tr>
    </table>    
      <div class="br"></div>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="7"><img src="images/topic_l.gif" width="7" height="32" /></td>
          <td width="213" background="images/topic2_bg.gif"><div class="right"><a href="/routes.asp"><img src="images/more.gif" width="49" height="13" border="0" /></a></div>
            <div class="bar_text3">热门线路</div></td>
          <td width="7"><img src="images/topic_r.gif" width="7" height="32" /></td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td style="border-left:1px solid #B8D5E3; border-right:1px solid #B8D5E3;"><div class="routes_txt">
            <ul>
              <%
							set rs=conn.execute("select top 6 id,Title,Price,Hits from t_route where IsRem=1")
							while not rs.eof
							%>
              <li><a href="/routes_show.asp?id=<%=rs(0)%>" class="STYLE20"><%=rs(1)%></a><span class="STYLE1"> ￥<%=rs(2)%>元/人</span></li>
              <%
								rs.movenext
							wend 
							rs.close
							set rs=nothing
							%>
            </ul>
          </div></td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="7"><img src="images/b_l.gif" width="7" height="6" /></td>
          <td background="images/b_bg.gif"></td>
          <td width="7"><img src="images/b_r.gif" width="7" height="6" /></td>
        </tr>
      </table>
      <div class="br"></div>
      <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td width="7"><img src="images/topic_l.gif" width="7" height="32" /></td>
          <td width="213" background="images/topic2_bg.gif"><div class="right"><a href="/hotel.asp"><img src="images/more.gif" width="49" height="13" border="0" /></a></div>
            <div class="bar_text3">推荐酒店</div></td>
          <td width="7"><img src="images/topic_r.gif" width="7" height="32" /></td>
        </tr>
        <tr>
          <td colspan="3" style="border-left:1px solid #B8D5E3; border-right:1px solid #B8D5E3;"><div class="routes_txt">
            <ul>
              <%
							set rs=conn.execute("select top 6 id,Title,MinPrice from t_hotel where IsRem=1")
							while not rs.eof
							%>
              <li><a href="/hotel_show.asp?id=<%=rs(0)%>" class="STYLE20"><%=rs(1)%></a><span class="STYLE1"> ￥<%=rs(2)%>元</span></li>
              <%
								rs.movenext
							wend 
							rs.close
							set rs=nothing
							%>
            </ul>
          </div></td>
        </tr>
        <tr>
          <td width="7"><img src="images/b_l.gif" width="7" height="6" /></td>
          <td background="images/b_bg.gif"></td>
          <td width="7"><img src="images/b_r.gif" width="7" height="6" /></td>
        </tr>
    </table></td>
    <td width="10">&nbsp;</td>
    <td valign="top" class="show_brd">
    <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td class="show_topic"><div class="show_txt"><%=Title%></div></td>
        </tr>
      </table>
    <table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" align="center" background="image/s_bj.gif"><form id="form2" name="form2" method="get" action="hotel_search.asp">
酒店名称：
<input name="key" type="text" id="key" value="<%=key%>" />
<input type="submit" name="button2" id="button2" value="搜索酒店" />
</form></td>
</tr>
</table>
    
      <table width="100%" border="0" cellspacing="0" cellpadding="0" align="center">
<tr>
<td width="26%" bgcolor="#FFFFFF" class="pad5"><div class="border"><a href="<%=Photo%>"><img src="<%=Photo%>" alt=" " width="280" height="180" border="0" /></a></div></td>
<td width="2%" valign="top">　</td>
<td width="72%" valign="top" class="pad5"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="4" colspan="2"></td>
</tr>
<tr>
<td height="25"><div align="center"><img src="images/dot_2.gif" width="9" height="6" /> 酒店星级：</div></td>
<td><img src="/images/star<%=Stars%>.gif" alt=" " /></td>
</tr>
<tr>
<td width="25%" height="25"><div align="center"><img src="images/dot_2.gif" width="9" height="6" /> 酒店位置：</div></td>
<td width="75%" class="hotel_desc"><%=Dlwz%></td>
</tr>
        	      
<tr>
<td height="25"><div align="center"><img src="images/dot_2.gif" width="9" height="6" /> 酒店地址：</div></td>
<td><%=Address%></td>
</tr>
<tr>
<td height="25"><div align="center"><img src="images/dot_2.gif" width="9" height="6" /> 周围景观：</div></td>
<td><%=Zbjd%></td>
</tr>
<tr>
<td height="25"><div align="center"><span class="STYLE1"><img src="images/dot_2.gif" width="9" height="6" /> 预订电话：</span></div></td>
<td><span class="STYLE31"><%=Tel%></span></td>
</tr>
<tr>
<td height="25"><div align="center"><img src="images/dot_2.gif" width="9" height="6" /> 价格范围：</div></td>
<td><span class="red"><%=MinPrice%></span>~<span class="red"><%=MaxPrice%></span>元</td>
</tr>
<tr>
<td height="25"><div align="center"><img src="images/dot_2.gif" width="9" height="6" /> 点击次数：</div></td>
<td><span class="STYLE1"><%=Hits%>次 <a href="javascript:AddFav()"><img src="images/fav_add.gif" height="20" /></a></span></td>
</tr>
</table></td>
</tr>
</table>
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td valign="top" class="show_subtitle">酒店简介</td>
      </tr>
      <tr>
        <td valign="top" class="show_content"><%=Demons%></td>
      </tr>
    </table>
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td valign="top" class="show_subtitle show_brd_top">[酒店相关图片]</td>
        </tr>
        <tr>
          <td valign="top" class="show_content">
          <div class="show_jdimgs">
          	<ul>
            	<%						
							set rs=server.createobject("adodb.recordset")
							rs.open "select top 8 id,Title,Photo from t_hotel_pic where HotelId="&id,conn,3,1
							while not rs.eof
							%>
<li><a href="<%=rs(2)%>" target="_blank"><img src="<%=rs(2)%>" width="160" height="120" alt="<%=rs(1)%>" border="0" /></a>
<h2><a href="<%=rs(2)%>" target="_blank"><%=rs(1)%></a></h2></li>
<%
                rs.movenext
              wend 
              rs.close
              set rs=nothing
              %>
            </ul>
          </div>
          </td>
        </tr>
    </table>
      <table width="100%" border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td valign="top" class="show_subtitle show_brd_top">[酒店客房报价]</td>
        </tr>
        <tr>
          <td valign="top" class="show_content">
          <table width="100%" align="center" cellpadding="0" cellspacing="1">
<tr>
<td bgcolor="#ebf4fe" height="30" width="16%" align="middle">房型</td>
<td bgcolor="#ebf4fe" width="8%" align="middle">状态</td>
<td bgcolor="#ebf4fe" width="8%" align="middle">早餐</td>
<td bgcolor="#ebf4fe" width="20%" align="middle">门市价</td>
<td bgcolor="#ebf4fe" width="20%" align="middle">散客折(5间房以下)</td>
<td bgcolor="#ebf4fe" width="20%" align="middle">团队折(5间房以上) </td>
<td bgcolor="#ebf4fe" width="8%" align="middle">预&nbsp;订</td>
</tr>

<%						
						set rs=server.createobject("adodb.recordset")
						rs.open "select id,Title,Status,BreakFast,Price1,Price2,Price3 from t_hotel_price where HotelId="&id,conn,3,1
						while not rs.eof
						%>
<tr>
<td height="30" align="middle" bgcolor="#F7F7F7"><%=rs(1)%></td>
<td height="30" align="middle" bgcolor="#F7F7F7"><%=rs(2)%></td>
<td height="30" align="middle" bgcolor="#F7F7F7"><%=rs(3)%></td>
<td height="30" align="middle" bgcolor="#F7F7F7">￥<span class="STYLE14"><%=rs(4)%></span> 元/间</td>
<td height="30" align="middle" bgcolor="#F7F7F7">￥<span class="STYLE14"><%=rs(5)%></span> 元/间</td>
<td height="30" align="middle" bgcolor="#F7F7F7">￥<span class="STYLE14"><%=rs(6)%></span> 元/间</td>
<td height="30" align="middle" bgcolor="#F7F7F7"><a href="/hotel_order.asp?id=<%=id%>&amp;p=<%=rs(0)%>"><img border="0" src="images/order.jpg" width="43" height="22" /></a></td>
</tr>
<%
							rs.movenext
						wend 
						rs.close
						set rs=nothing
						%>

</table>
          </td>
        </tr>
      </table>
      <table width="100%" border="0" cellspacing="0" cellpadding="0" class="esf_tab">
          <tr>
            <td width="17%" bgcolor="#EBF4FE" class="show_subtitle show_brd_top">[周边搜索&gt;&gt;]</td>
            <td width="83%" bgcolor="#EBF4FE" class="show_subtitle show_brd_top">
            <a class="s_near" href="javascript:SearchNear('饭店')" />饭店</a>
            <a class="s_near" href="javascript:SearchNear('公交')" />公交</a>
            <a class="s_near" href="javascript:SearchNear('购物')" />购物</a>
            <a class="s_near" href="javascript:SearchNear('银行')" />银行</a>
            </td>
          </tr>
        </table>
        <div class="br"></div>
        <table width="100%" border="0" cellspacing="0" cellpadding="0">
        <tr>
          <td height="400" style="padding:0px 5px;">
          <div id="mapDiv" name="mapDiv" style="width:100%;height:400px;"></div>
          <div class="txts" id="results" style="display: block"></div>          
          </td>
        </tr>
      </table></td>
  </tr>
</table>
<!--#include file="templet/root.htm"-->
<script type="text/javascript">
var map = new BMap.Map("mapDiv");
map.enableScrollWheelZoom();
window.openInfoWinFuns = null;
var cmarkers=[];
var options = {
  onSearchComplete: function(results){
    // 判断状态是否正确
    if (local.getStatus() == BMAP_STATUS_SUCCESS){
        var s = [];
        s.push('<div style="font-family: arial,sans-serif; border: 1px solid rgb(153, 153, 153); font-size: 12px;">');
        s.push('<div style="background: none repeat scroll 0% 0% rgb(255, 255, 255);">');
        s.push('<ol style="list-style: none outside none; padding: 0pt; margin: 0pt;">');
        openInfoWinFuns = [];
        for (var i = 0; i < results.getCurrentNumPois(); i ++){
            var marker = addMarker(results.getPoi(i).point,i);
            var openInfoWinFun = addInfoWindow(marker,results.getPoi(i),i);
            openInfoWinFuns.push(openInfoWinFun);
            // 默认打开第一标注的信息窗口
            var selected = "";
            if(i == 0){
                selected = "background-color:#f0f0f0;";
                openInfoWinFun();
            }
            s.push('<li id="list' + i + '" style="margin: 2px 0pt; padding: 0pt 5px 0pt 3px; cursor: pointer; overflow: hidden; line-height: 17px;' + selected + '" onclick="openInfoWinFuns[' + i + ']()">');
            s.push('<span style="width:1px;background:url(http://api.map.baidu.com/bmap/red_labels.gif) 0 ' + ( 2 - i*20 ) + 'px no-repeat;padding-left:10px;margin-right:3px"> </span>');
            s.push('<span style="color:#00c;text-decoration:underline">' + results.getPoi(i).title.replace(new RegExp(results.keyword,"g"),'<b>' + results.keyword + '</b>') + '</span>');
            s.push('<span style="color:#666;"> - ' + results.getPoi(i).address + '</span>');
            s.push('</li>');
            s.push('');
        }
        s.push('</ol></div></div>');
        document.getElementById("results").innerHTML = s.join("");
    }
  }
};
addCurrentMarker();

function addCurrentMarker(){
	<%if(Lat<>"") then%>
	var pt = new BMap.Point(<%=Lng%>,<%=Lat%>);
	var myIcon = new BMap.Icon("/images/house.png", new BMap.Size(23,22));
	var marker = new BMap.Marker(pt,{icon:myIcon});  // 创建标注
	///////////////////////////////////////////////
	var myCompOverlay = new ffff(pt,'<%=Title%>','<%=Title%>',1);
	myCompOverlay.addEventListener("click", function(){
	 
	});
		
	map.addOverlay(myCompOverlay); // 将标注添加到地图中
	map.centerAndZoom(pt, 15);
	<%else%>
		var myGeo = new BMap.Geocoder();
		myGeo.getPoint("<%=CityName_Cn%>", function(point){
			if (point) {
				map.centerAndZoom(point,15);		
			}
		}, "全国");
	<%end if%>
}
// 添加标注
function addMarker(point, index){
  var myIcon = new BMap.Icon("http://api.map.baidu.com/img/markers.png", new BMap.Size(23, 25), {
    offset: new BMap.Size(10, 25),
    imageOffset: new BMap.Size(0, 0 - index * 25)
  });
  var marker = new BMap.Marker(point, {icon: myIcon});
	cmarkers.push(marker);
  map.addOverlay(marker);
  return marker;
}
// 添加信息窗口
function addInfoWindow(marker,poi,index){
    var maxLen = 10;
    var name = null;
    if(poi.type == BMAP_POI_TYPE_NORMAL){
        name = "地址：  "
    }else if(poi.type == BMAP_POI_TYPE_BUSSTOP){
        name = "公交：  "
    }else if(poi.type == BMAP_POI_TYPE_SUBSTOP){
        name = "地铁：  "
    }
    // infowindow的标题
    var infoWindowTitle = '<div style="font-weight:bold;color:#CE5521;font-size:14px">'+poi.title+'</div>';
    // infowindow的显示信息
    var infoWindowHtml = [];
    infoWindowHtml.push('<table cellspacing="0" style="table-layout:fixed;width:100%;font:12px arial,simsun,sans-serif"><tbody>');
    infoWindowHtml.push('<tr>');
    infoWindowHtml.push('<td style="vertical-align:top;line-height:16px;width:38px;white-space:nowrap;word-break:keep-all">' + name + '</td>');
    infoWindowHtml.push('<td style="vertical-align:top;line-height:16px">' + poi.address + ' </td>');
    infoWindowHtml.push('</tr>');
    infoWindowHtml.push('</tbody></table>');
    var infoWindow = new BMap.InfoWindow(infoWindowHtml.join(""),{title:infoWindowTitle,width:200}); 
    var openInfoWinFun = function(){
        marker.openInfoWindow(infoWindow);
        for(var cnt = 0; cnt < maxLen; cnt++){
            if(!document.getElementById("list" + cnt)){continue;}
            if(cnt == index){
                document.getElementById("list" + cnt).style.backgroundColor = "#f0f0f0";
            }else{
                document.getElementById("list" + cnt).style.backgroundColor = "#fff";
            }
        }
    }
    marker.addEventListener("click", openInfoWinFun);
    return openInfoWinFun;
}
var local = new BMap.LocalSearch(map, options);
function SearchNear(val){
	for(var i=0;i<cmarkers.length;i++){
		map.removeOverlay(cmarkers[i]);
	}
	local.searchInBounds(val, map.getBounds());
}
</script>
</body>
</html>
<%
conn.execute("update t_hotel set Hits=Hits+1 where id="&id)
call connclose()
%>