<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<!DOCTYPE html>
<html>
<head>
	<%@include file="/WEB-INF/views/include/head.jsp"%>
	<link href="${ctxStatic }/css/plugins/bootstrap-table/bootstrap-table.min.css?v=${version}" rel="stylesheet">
</head>
<body class="gray-bg">
<div class="wrapper wrapper-content animated fadeInRight">
	<div class="row">
		<div class="col-sm-12">
			<div class="ibox float-e-margins">
				<div class="ibox-content">
					<form id="searchForm" class="form-horizontal">
						<div class="form-group">
							<label class="col-sm-1 control-label">警号</label>
							<div class="col-sm-2">
								<input type="text" class="form-control" id="username" name="username" value="000087">
							</div>
							<label class="col-sm-1 control-label">机构编码</label>
							<div class="col-sm-2">
								<input type="text" class="form-control" id="jgdm" name="jgdm" value="450000000000">
							</div>
							<div class="col-sm-2">
								<button class="btn btn-primary" type="button" onclick="getUserInfo();">获取用户信息</button>
								<button class="btn btn-primary" type="button" onclick="getPoliceOrg();">获取机构信息</button>
								<button class="btn btn-primary" type="button" onclick="getPoliceOrgsByParent();">获取下级机构信息</button>
							</div>
						</div>
					</form>
				</div>
				<div class="content">

				</div>
			</div>
		</div>
	</div>
</div>
<%@include file="/WEB-INF/views/include/foot.jsp"%>
<script>

	function getUserInfo(){
		var username = $("#username").val();
		var loadIndex = layer.load(0, {shade: [0.3,'#808080']});
		$.ajax({
			type : 'POST',
			url : ctx +"/manage/getUserInfo.json",
			dataType : "json",
			data :{"username":username},
			success : function(json) {
				layer.close(loadIndex);
				$(".content").html(json);
			},error: function(xhr, ajaxOptions, thrownError){
				layer.close(loadIndex);
				ajaxError(xhr, ajaxOptions, thrownError);
			}
		});
	}

	function getPoliceOrg(){
		var jgdm = $("#jgdm").val();
		var loadIndex = layer.load(0, {shade: [0.3,'#808080']});
		$.ajax({
			type : 'POST',
			url : ctx +"/manage/getPoliceOrg.json",
			dataType : "json",
			data :{"jgdm":jgdm},
			success : function(json) {
				layer.close(loadIndex);
				$(".content").html(json);
			},error: function(xhr, ajaxOptions, thrownError){
				layer.close(loadIndex);
				ajaxError(xhr, ajaxOptions, thrownError);
			}
		});
	}

	function getPoliceOrgsByParent(){
		var sjjgbm = $("#jgdm").val();
		var loadIndex = layer.load(0, {shade: [0.3,'#808080']});
		$.ajax({
			type : 'POST',
			url : ctx +"/manage/getPoliceOrgsByParent.json",
			dataType : "json",
			data :{"sjjgbm":sjjgbm},
			success : function(json) {
				layer.close(loadIndex);
				$(".content").html(json);
			},error: function(xhr, ajaxOptions, thrownError){
				layer.close(loadIndex);
				ajaxError(xhr, ajaxOptions, thrownError);
			}
		});
	}

</script>
</body>
</html>
