<%@ 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"%>
<title>Insert title here</title>
</head>

<body class="easyui-layout">
	<%@ include file="../common/header.jsp"%>
	<%@ include file="../leftMenu/sys-admin.jsp"%>
	<div data-options="region:'center',title:'首页 -【系统管理】- 学习中心管理'">
		<div class="easyui-layout" data-options="fit:true,border:false">
			<div data-options="region:'center'"
				style="border-color: #ccc; border-left: none;">
				<form id="edit-form" class="form-horizontal mr-t" enctype="multipart/form-data" action="${ctx}/admin/campus/edit" method="post">
					<input type="hidden" name="id" value="${campus.id}"/>
					<div class="control-group">
						<label class="control-label" for="">名称</label>
						<div class="controls">
							<input type="text" name="name" value="${campus.name}" placeholder="必填项" required/>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="">状态</label>
						<div class="controls">
							<select name="status">
								<option value="1" <c:if test="${campus.enable==true}">selected</c:if>>正常</option>
								<option value="0" <c:if test="${campus.enable==false}">selected</c:if>>停用</option>
							</select>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="">地区</label>
						<div class="controls">
							<span id="area-select"></span>
							<input type="hidden" name="province" value="${campus.province}"/>
							<input type="hidden" name="city" value="${campus.city }"/>
							<input type="hidden"  name="district" value="${campus.district }"/>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="">级别</label>
						<div class="controls">
							<select   id="level" name="schoolLevel">
							<c:forEach items="${levelList}" var="level">
								<option value="${level.value}" <c:if test="${campus.level.value==level.value}">selected</c:if>>${level.name}</option>
							</c:forEach>
							</select>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="">电话</label>
						<div class="controls">
							<input type="text" name="phone" value="${campus.phone}"/>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="">地址</label>
						<div class="controls">
							<input type="text" name="address" value="${campus.address}"/>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="">描述</label>
						<div class="controls">
							<textarea class="input-xxlarge" name="description" rows="4">${campus.description}</textarea>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="">学习中心LOGO</label>
						<div class="controls">
							<input id="fileupload" type="file" name="file" multiple>
							<!-- <input id="savebutton" type="button" value="保存"> -->
						</div>
						<!-- <div id="files"></div>
						<div id="pic-con">
							
						</div> -->
					</div>
					<div class="control-group">
						<div class="controls">
							<input class="btn btn-primary" type="submit" value="保存"/>
							<a href="${ctx}/admin/campus/list" class="btn">返回</a>
						</div>
					</div>
				</form>
				</div>
				</div>
			</div>
</body>
<script type="text/javascript">
$(document).ready(function(){
	$("#area-select").chinaprovinces({province:'${campus.province}', city:'${campus.city}', area:'${campus.district}', valueType:'name',change:function(province,city,area){
		$("#edit-form :input[name='province']").val(province);
		$("#edit-form :input[name='city']").val(city);
		$("#edit-form :input[name='district']").val(area);
	}});
	
	/* //$('#target').Jcrop();
	
	//文件上传地址
    var url = '${ctx}/admin/campus/save/pic';
    //初始化，主要是设置上传参数，以及事件处理方法(回调函数)
    $('#fileupload').fileupload({
        autoUpload: true,//是否自动上传
        url: url,//上传地址
        dataType: 'json',
        done: function (e,data) {//设置文件上传完毕事件的回调函数
        	$("#target").attr("src", "${ctx}/static/"+data.result.path);

        }
    }); */
});

</script>
</html>