<%@ 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>
<link rel="stylesheet" href="${ctx}/static/admin/js/jQuery-File-Upload-master/css/jquery.fileupload-ui.css">
<script src="${ctx}/static/admin/js/jQuery-File-Upload-master/js/vendor/jquery.ui.widget.js"></script>
<script src="${ctx}/static/admin/js/jQuery-File-Upload-master/js/jquery.iframe-transport.js"></script>
<script src="${ctx}/static/admin/js/jQuery-File-Upload-master/js/jquery.fileupload.js"></script>

<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/school/edit" method="post">
					<input type="hidden" name="id" value="${school.id}"/>
					<div class="control-group">
						<label class="control-label" for="">名称</label>
						<div class="controls">
							<input type="text" name="name" value="${school.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="${school.enable==true}">selected</c:if>>正常</option>
								<option value="0" <c:if test="${school.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="${school.province}"/>
							<input type="hidden" name="city" value="${school.city }"/>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="">电话</label>
						<div class="controls">
							<input type="text" name="phone" value="${school.phone}"/>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="">地址</label>
						<div class="controls">
							<input type="text" name="address" value="${school.address}"/>
						</div>
					</div>
					<div class="control-group">
						<label class="control-label" for="">描述</label>
						<div class="controls">
							<textarea class="input-xxlarge" name="description" rows="4">${school.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>
							<c:if test="${!empty school.logoUrl}">
								<img src="${ctx}/static/school_logo/${school.logoUrl }" id="target" alt="[Jcrop Example]" />
							</c:if>
					</div>
					<div class="control-group">
						<div class="controls">
							<input class="btn btn-primary" type="submit" value="保存"/>
							<a href="${ctx}/admin/school/list" class="btn">返回</a>
						</div>
					</div>
				</form>
				</div>
				</div>
			</div>
</body>
<script type="text/javascript">
$(document).ready(function(){
	$("#area-select").chinaprovinces({province:'${school.province}', city:'${school.city}', area:0, valueType:'name',change:function(province,city,area){
		$("#edit-form :input[name='province']").val(province);
		$("#edit-form :input[name='city']").val(city);
	}});
});
</script>
</html>