<%@ page language="java" pageEncoding="utf-8"%>
<%@ taglib uri="/WEB-INF/taglib/c.tld" prefix="c"%>
<%@ include file="../../common/init.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%@ include file="../../common/top.jsp"%>
</head>
<body class="easyui-layout">
	<%@ include file="../../common/header.jsp"%>
	<%@ include file="../../leftMenu/exam-admin.jsp"%>
	<div data-options="region:'center',title:'首页 - 【考试管理】 - 学习中心管理'">
		<div class="easyui-layout" data-options="fit:true,border:false">
			<div data-options="region:'north',border:false" class="domain">
				<%@ include file="../../common/message.jsp"%>
				<c:if test="${isFinish==false}">
					<a href="${ctx}/admin/exam-param/campus/add" class="btn btn-success"> 
						<i class="icon-plus icon-white"></i> 添加 
					</a>
				</c:if>
			</div>
			<div class="border" data-options="region:'center'">
				<div class="table-container col7">
					<div class="tab-header">
						<em class="list-num"><input id="multi-checkbox" type="checkbox"/> </em> 
						<i class="list-text"><strong>ID</strong></i>
						<i class="list-text"><strong>名称</strong></i>
						<i class="list-text"><strong>省</strong></i>
						<i class="list-text"><strong>市</strong></i> 
						<i class="list-text"><strong>区县</strong></i>
						<p class="list-edit"><strong>操作</strong></p>
					</div>
					<c:forEach var="campus" items="${campusList}">
					<div class="tab-list" data-id="${campus.id}" >
						<em class="list-num list-checkbox"><input class="campus-checkbox" type="checkbox"></em> 
						<i class="list-text">${campus.id}</i>
						<i class="list-text" name="name">${campus.name}</i>
						<i class="list-text" name="classCode">${campus.province}</i>
						<i class="list-text" name="classType">${campus.city}</i>
						<i class="list-text" name="graduateType">${campus.district}</i>
						<p class="list-edit">
							<c:if test="${isFinish==false}">
							<a class="btn btn-small btn-danger delete-button">删除</a>
							</c:if>
						</p>
					</div>
					</c:forEach>
				</div>
			</div>
		</div>
	</div>
</body>
<script type="text/javascript">
$(document).ready(function(){
	$('.delete-button').click(function(){
		var listDiv = $(this).parent().parent();
		if(confirm('确认要删除该学习中心吗？')){
			$.post('${ctx}/admin/exam-param/campus/delete', {campusId: listDiv.attr('data-id')}, function(obj){
				if(obj.success){
					listDiv.remove();
					alert("删除成功");
				}else{
					alert(obj.message);
				}
			});
		}
	});
});

</script>
</html>