<%@ 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/propertyform.js?1.2'/>"></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/propertyForm" modelAttribute="tbOrganization" method="post" id="conditionform">
					<form:hidden path="id" name="id" id="id" />
					<input type="hidden" name="actType" value="save">
					<input type="hidden" name="funcid" value="${funcid}">
					<input type="hidden" id="provinceCode_" value="${tbOrganization.provinceCode }">
					<input type="hidden" id="provinceName_" name="provinceName">
					<input type="hidden" id="cityCode_" value="${tbOrganization.cityCode }">
					<input type="hidden" id="cityName_" name="cityName">
					<input type="hidden" id="lng" name="lng" value="${tbOrganization.lng }">
					<input type="hidden" id="lat" name="lat" value="${tbOrganization.lat }">
					<input type="hidden" id="hdId" value="${tbOrganization.hdProjectId }">
					<input type="hidden" id="hdName" value="${tbOrganization.hdProjectName }">
					<input type="hidden" id="hdVoiceId" value="${tbOrganization.hdVoiceProjectId }">
					<input type="hidden" id="hdVoiceName" value="${tbOrganization.hdVoiceProjectName }">
					<input type="hidden" id="accountType" value="${tbOrganization.accountType }">
					<input type="hidden" name="isAdmin" value="${isAdmin}">
					<!-- <input type="hidden" name="passType" value="${passType}"> -->
					<c:if test="${flag=='default'}">
						<div class="form-group">
							<label><span style="color: red">*</span>所属运营中心</label>
							<select id="companySelect" name="companySelect" style="width:220px;">
								<option value="">选择运营中心</option>
								<c:forEach items="${companyList}" var="company">
									<option value="${company.id}">${company.name}</option>
								</c:forEach>
							</select>
						</div>
					</c:if>

					<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>
						<form:input path="code" id="code" cssClass="form-control" />
					</div>
					<div class="form-group">
						<label><span style="color: red">*</span>服务热线</label>
						<form:input path="telephone" id="telephone" cssClass="form-control" />
					</div>
					<div class="form-group">
						<label><span style="color: red">*</span>所在城市</label>
						<select id="provinceSelect" name="provinceSelect" style="width:100px;" onchange="chooseCity();">
							<option value="">请选择省</option>
						</select>
						<select id="citySelect" name="citySelect" style="width:175px;" onchange="getCityOnMap();">
							<option value="">请选择市</option>
						</select>
					</div>
					<div class="form-group">
						<label>地址 <span style="text-decoration:underline">地图点击获取位置</span></label>
						<form:input path="address" cssClass="form-control" id="address" onkeyup="initAddress(this.value,2);" />
					</div>
					<div class="form-group">
						<label>经纬度(根据地址自动获取，或是点击地图获取)</label><br>
						<input name="latlng" value="${tbOrganization.lng}, ${tbOrganization.lat}" id="latlng" value="" style="width: 100%" />
					</div>
					<!-- 派修关联校区 -->
					<div class="form-group">
						<label style="width:100%;"><span style="color: red"></span>派修关联校区</label>
						<c:if test="${isAdmin=='true'}">
							<input id="projectName" name="projectName" type="text" style="width:175px;padding-left: 15px;" placeholder="请输入校区名称关键字">
						</c:if>
						<c:if test="${isAdmin=='false'}">
							<input id="projectName" readonly="readonly" name="projectName" type="text" style="width:175px;padding-left: 15px;"
							 placeholder="请输入校区名称关键字">
						</c:if>
						<input type="hidden" id="hdProjectName" name="hdProjectName" value="">
						<c:if test="${isAdmin=='true'}">
							<select id="hdProjectSelect" name="hdProjectId" style="width:220px;" onchange="chooseHdProject();">
								<option value="">选择关联校区</option>
							</select>
						</c:if>
						<c:if test="${isAdmin=='false'}">
							<select disabled id="hdProjectSelect" name="hdProjectId" style="width:220px;" onchange="chooseHdProject();">
								<option value="">选择关联校区</option>
							</select>
						</c:if>
					</div>
					<!-- 声音 -->
					<div class="form-group">
						<label style="width:100%;"><span style="color: red"></span>客户声音关联校区</label>
						<c:if test="${isAdmin=='true'}">
							<input id="voiceProjectName" name="voiceProjectName" type="text" style="width:175px;padding-left: 15px;" placeholder="请输入校区名称关键字">
						</c:if>
						<c:if test="${isAdmin=='false'}">
							<input id="voiceProjectName" readonly="readonly" name="voiceProjectName" type="text" style="width:175px;padding-left: 15px;"
							 placeholder="请输入校区名称关键字">
						</c:if>
						<input type="hidden" id="hdVoiceProjectName" name="hdVoiceProjectName" value="">
						<c:if test="${isAdmin=='true'}">
							<select id="voiceSelect" name="hdVoiceProjectId" style="width:220px;" onchange="chooseVoice();">
								<option value="">选择关联校区</option>
							</select>
						</c:if>
						<c:if test="${isAdmin=='false'}">
							<select disabled id="voiceSelect" name="hdVoiceProjectId" style="width:220px;" onchange="chooseVoice();">
								<option value="">选择关联校区</option>
							</select>
						</c:if>
					</div>
					<div class="form-group">
						<label><span style="color: red"></span>账号类型</label>
						<div class="radio" style="width: 108px;display: inline-block;padding-left: 30px">
							<label>
								<c:if test="${isAdmin eq true}">
									<input style="height: 25px;" type="radio" name="accountType" value="1" checked="checked" <c:if test="${tbOrganization.accountType eq 1 }">checked="checked"</c:if>>
								</c:if>

								<c:if test="${isAdmin eq false}">
									<input disabled style="height: 25px;" type="radio" name="accountType" value="1" checked="checked" <c:if test="${tbOrganization.accountType eq 1 }">checked="checked"</c:if>>
								</c:if>
								个人
							</label>
						</div>
						<div class="radio" style="width: 108px;display: inline-block;margin-top: 10px;">
							<label>
								<c:if test="${isAdmin eq true}">
									<input style="height: 25px;" type="radio" name="accountType" value="0" >
								</c:if>
								<c:if test="${isAdmin eq false}">
									<input style="height: 25px;" disabled type="radio" name="accountType" value="0" >
								</c:if>
								企业
							</label>
						</div>
						
					</div>
					<div class="form-group" style="height: 45px;">
						<label><span style="color: red"></span>通行方案</label>
						<div class="radio" style="width: 78px;display: inline-block;padding-left: 30px">
							<label>
								<c:if test="${isAdmin eq true}">
									<input style="height: 25px;" type="radio" name="passType" value="" <c:if test="${empty tbOrganization.passType or tbOrganization.passType eq 0}">checked="checked"</c:if>>无
								</c:if>
								<c:if test="${isAdmin eq false}">
									<input disabled style="height: 25px;" type="radio" name="passType" value="" <c:if test="${empty tbOrganization.passType or tbOrganization.passType eq 0}">checked="checked"</c:if>>无
								</c:if>
							</label>
						</div>
						<div class="radio" style="width: 78px;display: inline-block;padding-left: 30px;margin-top: 10px;">
							<label>
								<c:if test="${isAdmin eq true}">
									<input style="height: 25px;" type="radio" name="passType" value="1" <c:if test="${tbOrganization.passType eq 1 }">checked="checked"</c:if>>face++
								</c:if>
								<c:if test="${isAdmin eq false}">
									<input disabled style="height: 25px;" type="radio" name="passType" value="1" <c:if test="${tbOrganization.passType eq 1 }">checked="checked"</c:if>>face++
								</c:if>
							</label>
						</div>
						<div class="radio" style="width: 108px;display: inline-block;padding-left: 30px;margin-top: 9px;">
							<label>
								<c:if test="${isAdmin eq true}">
									<input style="height: 25px;" type="radio" name="passType" value="2" <c:if test="${tbOrganization.passType eq 2 }">checked="checked"</c:if>>令令开门
								</c:if>
								<c:if test="${isAdmin eq false}">
									<input disabled style="height: 25px;" type="radio" name="passType" value="2" <c:if test="${tbOrganization.passType eq 2 }">checked="checked"</c:if>>令令开门
								</c:if>
							</label>
						</div>
						<div class="radio " style="width: 108px;display: inline-block;padding-left: 30px;margin-top: 9px;">
							<label>
								<c:if test="${isAdmin eq true}">
									<input style="height: 25px;" type="radio" name="passType" value="3" <c:if test="${tbOrganization.passType eq 3 }">checked="checked"</c:if>>访客单
								</c:if>
								<c:if test="${isAdmin eq false}">
									<input disabled style="height: 25px;" type="radio" name="passType" value="3" <c:if test="${tbOrganization.passType eq 3 }">checked="checked"</c:if>>访客单
								</c:if>
							</label>
						</div>
					</div>
					
					
					<div class="form-group">
						<label>问卷管理员账号</label>
						<c:if test="${isAdmin=='true'}">
							<form:input path="wjxAccount" id="wjxAccount" cssClass="form-control" />
						</c:if>
						<c:if test="${isAdmin=='false'}">
							<form:input path="wjxAccount" id="wjxAccount" cssClass="form-control" readonly="true"/>
						</c:if>
					</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/propertyList?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>