<%@ page language="java" errorPage="/error.jsp" pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" %>
<%@ include file="/common/taglibs.jsp"%>
<!DOCTYPE html>
<html>
<!-- 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" />
<!-- date -->
<script src="${ctx }/scripts/lib/jquery-1.8.2.min.js"></script>
<script type="text/javascript">
	function checkValidate() {
		if ($("#groupname").val() == "") {
			alert("组名不能为空！");
			return false;
		}
	}
	$(document).ready(function () {
		function fn(selector, container) {
			$(selector).click(function () {
				var stats = $(this).prop('checked') || false;
				$(container).each(function (idx, item) {
					$(item).prop('checked', stats);
				});
			});

			$(container).click(function () {
				var chklen = $(container).filter(function (idx, el) {
					if ($(el).prop('checked')) {
						return el;
					}
				}).length;
				var chkStats = $(container).length === chklen;
				$(selector).prop('checked', chkStats);
			});
		};
		fn("#checkAll", "input[name='chkBtn']");
		$("#backBtn").click(function () {
			location.href = '<c:url value='/system/elementgroup?funcid=19'/>';
		});
	});
</script>

<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
	<style type="text/css">
		th {
			text-align: center;
		}

		td {
			text-align: center;
			vertical-align: middle;
		}
	</style>
</head>

<body>
	<section class="content">
		<div class="row">
			<div class="col-xs-12">
				<div class="box">
					<!-- /.box-header -->
					<div class="box-body table-responsive">
						<form:form modelAttribute="elementGroup" action="${ctx}/system/elementgroup/saveElementGroup" method="POST">
							<div class="form-group">
								<label>所属功能</label>
								<select name="itemId" class="func_belong" style="width: 200px;">
									<c:forEach items="${funcList}" var="func">
										<option value="${func.id }">${func.itemname}</option>
									</c:forEach>
								</select>
							</div>
							<div class="form-group">
								<label>校区可自定义</label>
								<label><input style="position: relative;top: 10px;" name="isOrgCustom" type="radio" value="1" checked/> &nbsp;是 </label>
								<label><input style="position: relative;top: 10px;" name="isOrgCustom" type="radio" value="0"/> &nbsp;否 </label>
							</div>
							<div class="form-group">
								<label>组名</label>
								<input name="groupcode" value="${elementGroup.groupcode }" />
								<label>组名备注</label>
								<input name="groupname" value="${elementGroup.groupname }" />
								<!--  type="submit" -->
							</div>
							<div align="left" style="margin-bottom: 8px;">
								<button type="submit" class="btn btn-primary" onclick="return checkValidate();">保存</button>&nbsp;
								<button type="button" class="btn btn-back" id="backBtn">返回</button>
							</div>
						</form:form>
</body>

</html>