<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Admin_Scenery.aspx.vb" Inherits="TourEx.Web.Admin_Scenery" %>
<%@ Import Namespace="TourEx.BLL" %>
<!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=utf-8" />
<title>无标题页</title>
<link rel="stylesheet" type="text/css" href="Css/Style.css"/>
<script type="text/javascript" src="../Sys/Js/jquery.js"></script>
<script type="text/javascript" src="../Sys/Js/AlertWindow.js"></script>
<script type="text/javascript" src="../Sys/Js/CreateSelect.js"></script>
<script type="text/javascript" src="../Sys/Js/jquery.validate.js"></script>
<script type="text/javascript" src="../Sys/Js/jquery.validate.check.js"></script>
<script type="text/javascript" src="../Sys/WebEdit/xheditor-zh-cn.min.js"></script>
<script type="text/javascript" src="../Sys/WebEdit/xheditor_plugins/ubb.min.js"></script>
<script type="text/javascript" src="http://union.mapbar.com/apis/maps/free?f=mapi&v=31.2&k=<%=WebSet.MapbarKey %>"></script> 
</head>
<body>
<ul class="navLocation">
	<li>您当前位置：<a href="Admin_Main.aspx">首页</a> &gt; <a href="Admin_SceneryList.aspx">景区管理</a> &gt; <asp:Label ID="navIgation" runat="server" Text=""></asp:Label></li>
</ul>
<form runat="server" id="TourExForm">
<asp:HiddenField ID="RanNum" runat="server" />
<div class="infoBox">
<table width="100%" border="0" cellpadding="0" cellspacing="1">
	<tr>
		<td class="infoBoxTd" width="120px">景区名称：</td>
		<td>
			<asp:TextBox ID="S_Name" runat="server" MaxLength="30" Width="300px" CssClass="formTitle"></asp:TextBox>
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">所属城市：</td>
		<td>
            <asp:DropDownList ID="S_CityID" runat="server">
            </asp:DropDownList>
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd" width="120px">景区级别：</td>
		<td>
            <asp:DropDownList ID="S_Level" runat="server">
            </asp:DropDownList>
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">景区类型：</td>
		<td colspan="10">
            <asp:CheckBoxList ID="S_Category" runat="server" 
                onclick="$('#Categorys').val($(':checked',this).length);" 
                RepeatDirection="Horizontal" RepeatLayout="Flow">
            </asp:CheckBoxList>
            <input id="Categorys" name="Categorys" type="hidden" value="0" />
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">适宜人群：</td>
		<td>
            <asp:CheckBoxList ID="S_FitCrowd" runat="server" RepeatDirection="Horizontal" 
                RepeatLayout="Flow">
            </asp:CheckBoxList>
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">景区地址：</td>
		<td>
			<asp:TextBox ID="S_Add" runat="server" MaxLength="50" Width="257px" CssClass="formTitle"></asp:TextBox>
			<asp:HiddenField ID="S_Nid" runat="server" />
			<a href="javascript:;" onclick="ShowWindow();">地址标注</a>
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">视频地址：</td>
		<td>
			<asp:TextBox ID="S_Video" runat="server" MaxLength="300" Width="300px" CssClass="formTitle"></asp:TextBox>
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">景区介绍：</td>
		<td>
			<asp:TextBox ID="S_Text" runat="server" TextMode="MultiLine"></asp:TextBox>
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">取票地点：</td>
		<td>
			<asp:TextBox ID="S_TakeWay" runat="server" MaxLength="30" Width="300px" CssClass="formTitle"></asp:TextBox>
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">交通指南：</td>
		<td>
			<asp:TextBox ID="S_Traffic" runat="server" TextMode="MultiLine" Height="80px" Width="300px" CssClass="formTextarea"></asp:TextBox>
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">购票须知：</td>
		<td>
			<asp:TextBox ID="S_BuyNotes" runat="server" TextMode="MultiLine" Height="80px" 
                Width="300px" CssClass="formTextarea"></asp:TextBox>
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">特色购物：</td>
		<td>
			<asp:TextBox ID="S_Shop" runat="server" TextMode="MultiLine" Height="80px" 
                Width="300px" CssClass="formTextarea"></asp:TextBox>
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">特色美食：</td>
		<td>
			<asp:TextBox ID="S_Gourmet" runat="server" TextMode="MultiLine" Height="80px" 
                Width="300px" CssClass="formTextarea"></asp:TextBox>
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">推荐：</td>
		<td><asp:CheckBox ID="S_Tj" runat="server" /></td>
	</tr>
	<tr>
		<td class="infoBoxTd">排序：</td>
		<td>
			<asp:TextBox ID="S_OrderId" runat="server" MaxLength="8" Width="50px" 
                CssClass="formTitle"></asp:TextBox>
		</td>
	</tr>
	<tr>
		<td class="infoBoxTd">&nbsp;
			
		</td>
		<td>
			<asp:Button ID="Button1" runat="server" Text="确定" CssClass="formInput01" />
		</td>
	</tr>
</table>
</div>
</form>
    <div id="promptWindow" class="promptWindow" align="center">
        <div class="titleBar">
        <span>地图标注</span><span onclick="HideWindow()" style="float: right;"><img src="Images/popclose.gif" /></span></div>
        <div class="mainContent" style="padding:20px 0;">
            <div id="mapbar" style="width:500px;height:300px;border:1px #C0CFED solid;"></div>
        </div>
    </div>
<script language="javascript" type="text/javascript">
	<!--    //
    var maplet = null;
    function initMap() {
        maplet = new Maplet("mapbar");
        var nid = ('<%=WebCache.Sys.Read("WebSet")(25) %>' == '' ? '116.38672,39.90805' : '<%=WebCache.Sys.Read("WebSet")(25) %>').split(',');
        maplet.centerAndZoom(new MPoint(nid[0], nid[1]), 8);
        maplet.addControl(new MStandardControl());
        MEvent.addListener(maplet, "edit", dragEnd);
        maplet.showOverview(false);
        if ($('#S_Nid').val() != '') {
            var marker = new MMarker(new MPoint(nid[0], nid[1]), new MIcon("http://union.mapbar.com/apidoc/images/tb1.gif", 32, 32));
            maplet.addOverlay(marker); //添加标注到地图
            marker.setEditable(true); //设置标注可编辑
            maplet.setMode("pan"); //pan: 移动模式，参数为 MPoint 对象，表示为地图移动后的中心点对象。
        } else {
            maplet.setMode("bookmark", onBookmark);
        }
    }
    function onBookmark(dataObj) {
        $('#S_Nid').val(dataObj.point.pid);
        var marker = new MMarker(dataObj.point, new MIcon("http://union.mapbar.com/apidoc/images/tb1.gif", 32, 32)); //创建标注
        maplet.addOverlay(marker); //添加标注到地图
        marker.setEditable(true); //设置标注可编辑
        maplet.setMode("pan"); //pan: 移动模式，参数为 MPoint 对象，表示为地图移动后的中心点对象。
    }
    function dragEnd(overlay) {
        $('#S_Nid').val(overlay.pt.pid);
    }
	var editor;
	$(function () {
	    $('#Categorys').val($(':checked',$('#S_Category')).length);
		editor = $('#S_Text').xheditor({tools:'full',width:'90%',height:'300',forcePtag:false,internalScript:true,inlineScript:true,linkTag:true,localUrl:'root',showBlocktag:true,beforeSetSource:ubb2html,beforeGetSource:html2ubb,upImgUrl:'../EditorUpLoad.aspx?r='+$('#RanNum').val(),upFlashUrl:'../EditorUpLoad.aspx?r='+$('#RanNum').val(),upMediaUrl:'../EditorUpLoad.aspx?r='+$('#RanNum').val(),focus:function(){$('#S_Text').val(editor.getSource());$('#S_Text').valid();},blur:function(){$('#S_Text').val(editor.getSource());$('#S_Text').valid();}});
		editor.setSource(html2ubb($('#S_Text').val()));
		$("#TourExForm").validate({
			rules:{
				S_Name: {required: true},
				Categorys: {required: true,min:1},
				S_Text: {required: true}
			},
			messages: {
				S_Name: {required: '请填写景区名称'},
				Categorys: {required: '请选择景区类型',min:'请选择景区类型'},
				S_Text: {required: '请填写景区介绍'}
			}
        });
        initMap();
	});
	//-->
</script>
</body>
</html>
