<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<head>
<title>楼栋地址信息编辑</title>
<meta content='width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no' name='viewport'>
<!-- bootstrap 3.0.2 -->
<link href="<c:url value='/styles/lib/bootstrap.min.css'/>" rel="stylesheet" type="text/css" />
<!-- font Awesome -->
<link href="<c:url value='/styles/lib/font-awesome.min.css'/>" rel="stylesheet" type="text/css" />
<!-- Ionicons -->
<link href='<c:url value='/styles/lib/ionicons.min.css' />' rel="stylesheet" type="text/css" />
<!-- DATA TABLES -->
<link href="<c:url value='/styles/lib/datatables/dataTables.bootstrap.css' />" rel="stylesheet" type="text/css" />
<!-- Theme style -->
<link href="<c:url value='/styles/AdminLTE.css'/>" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="<c:url value='/scripts/lib/jquery-1.8.2.min.js'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/loading/jquery.blockUI.js'/>"></script>
<script type="text/javascript" src="<c:url value='/scripts/loading/loading.js'/>"></script>
<script src="http://map.qq.com/api/js?v=2.exp&key=SS7BZ-K25HU-OIBVV-BVGJD-6BLJK-WFFLJ"></script>
<script type="text/javascript" src="<c:url value='/scripts/admin/buildform.js'/>"></script>
</head>
<body>
	<input type="hidden" value="${ctx}" id="contextPath"> 
	<div class="col-md-6" style="float:left;width:45%;">
		<!-- general form elements disabled -->
		<div class="box box-warning">
			<div class="box-header" style="width:90%">
				<h3 class="box-title">楼栋地址信息编辑 &nbsp;&nbsp; <strong font-color="red">${errormsg}</strong></h3>
			</div>
			<!-- /.box-header -->
			<div class="box-body">
				<form:form action="${ctx}/busi/property/buildForm" modelAttribute="tbBuild" method="post" id="conditionform" >
					<form:hidden path="id" name="id" id="id"/>
					<form:hidden path="lng" name="lng" id="lng"/>
					<form:hidden path="lat" name="lat" id="lat"/>
					<input type="hidden" name="actType" value="save">
					<input type="hidden" name="funcid" value="${funcid}">
					
					<div class="form-group">
						<label><span style="color: red">*</span>楼栋名称</label>
						<form:input path="name" id="name" cssClass="form-control" />
					</div>
					<div class="form-group">
						<label><span style="color: red">*</span>所属项目</label>
						<select class="form-control" name="organizationId" id="organizationId" onchange="organizationChange();">
							
							<c:forEach items="${organizationList}" var="obj">
								<c:choose>
									<c:when test="${obj.id==tbBuild.organizationId }">
									<option value="${obj.id }" selected="selected">${obj.name}</option>
									</c:when>
									<c:otherwise>
									<option value="${obj.id }">${obj.name}</option>
									</c:otherwise>
								</c:choose>
							</c:forEach>
						</select>
						<c:forEach items="${organizationList}" var="obj">
						<input type="hidden" id="lnglat_${obj.id}" value="${obj.lng },${obj.lat}">
						</c:forEach>
					</div>
					<%--<div class="form-group">
						<label>VIP标识</label> 
						<select class="form-control" name="vip" >
							<c:forEach items="${vipGroup}" var="obj">
								<c:choose>
									<c:when test="${tbBuild.vip==obj.itemcode }">
									<option value="${obj.itemcode }" selected="selected">${obj.itemname}</option>
									</c:when>
									<c:otherwise>
									<option value="${obj.itemcode }">${obj.itemname}</option>
									</c:otherwise>
								</c:choose>
							</c:forEach>
						</select>
					</div>--%>
					<div class="form-group">
						<label><span style="color: red"></span>备注信息</label>
						<form:input path="remark" id="remark" cssClass="form-control" />
					</div>
					<div class="form-group">
						<label>地址 <span style="text-decoration:underline">地图点击获取位置</span></label> 
						<form:input path="address"  cssClass="form-control" id="address"  /> 
						<input type="hidden" name="latlng"  readonly="readonly"  
							value="${tbBuild.lng}, ${tbBuild.lat}"  id="latlng" style="width: 100%" maxlength="10"/>
					</div>
					<div class="form-group">
						<a class="btn btn-primary" href="#" id='btn-save'>保存</a>
						<a class="btn btn-back" href="<c:url value='/busi/property/buildList?funcid=${funcid}' />">返回</a>
					</div>
				</form:form>
			</div>
			<!-- /.box-body -->
		</div>
		<!-- /.box -->
	</div>
	
	<div class="col-md-6" style="padding-top: 20px;">
		<div style=" border: 1px solid #e5e5e5;padding: 0 10px 10px; height: 100%; border-top: 2px solid #f39c12;">
			<p style="font-weight: bold;margin-top:10px;">请点击地图，标记出详细地址</p>
			<div id="container" style="min-width:485px;min-height:400px;width:45%;margin-top:10px;"></div>
		</div>
	</div> 
</body>
</html>