<%@ page language="java" contentType="text/html;charset=UTF-8" %> 
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt" %> 
<%@ page isELIgnored="false" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<title>赛事场馆编辑</title>
    <meta http-equiv="Content-Type" content="text/html;charset=utf-8"/>
    <meta name="viewport" content="width=device-width, initial-scale=1">
	<link rel="stylesheet" href="<%=request.getContextPath() %>/js/bootstrap/css/bootstrap.min.css">
	<link rel="stylesheet" href="<%=request.getContextPath() %>/js/bootstrap/css/bootstrap-theme.min.css">
    <script type="text/javascript" charset="utf-8" src="<%=request.getContextPath() %>/js/jquery/jquery-1.11.2.min.js"></script>
    <script type="text/javascript" charset="utf-8" src="<%=request.getContextPath() %>/js/bootstrap/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container-fluid"> 
	<div class="alert alert-success" role="alert" style="text-align: center;">
		<c:if test="${matchVenue.id ==null }">
			添加赛事场馆
		</c:if>
		<c:if test="${matchVenue.id !=null }">
			修改赛事场馆
		</c:if>
	</div>
		<c:if test="${matchVenue.id ==null }">
			<form class="form-horizontal" action="<%=request.getContextPath() %>/ckuMatchVenue/addVenue.do">
		</c:if>
		<c:if test="${matchVenue.id !=null }">
			<form class="form-horizontal" action="<%=request.getContextPath() %>/ckuMatchVenue/updateVenue.do">
		</c:if>
		<input type="hidden" name="id" value="${matchVenue.id }" class="form-control">
		  <div class="form-group">
		    <label class="col-sm-2 control-label">场馆名称:</label>
		    <div class="col-sm-10">
		    	<input type="text" name="venueName" value="${matchVenue.venueName }" class="form-control" placeholder="场馆名称">
		    </div>
		  </div>
		  <div class="form-group">
		    <label class="col-sm-2 control-label">场馆地址:</label>
		    <div class="col-sm-10">
		    	<input type="text" name="venueAddress" value="${matchVenue.venueAddress }" class="form-control" placeholder="场馆地址">
		    </div>
		  </div>
		  <div class="form-group">
		    <label class="col-sm-2 control-label">联系电话:</label>
		    <div class="col-sm-10">
		    	<input type="text" name="venuePhone" value="${matchVenue.venuePhone }" class="form-control" placeholder="联系电话">
		    </div>
		  </div>
		<c:if test="${matchVenue.id !=null }">
		  <div class="form-group">
		  <label class="col-sm-2 control-label">酒店图片:</label>
			<div class="row">
			<c:forEach var="imageList" items="${matchVenue.ckuImageList }" >
				<div class="col-xs-2 col-md-2">
					<a href="#" class="thumbnail"> 
						<img id="showImageList" src="${imageList.imageMinUrl}" />
							<button type="button" onclick="delect(${imageList.imageId})" class="btn btn-warning" >删除</button>
					</a>
				</div>
			</c:forEach>
			</div>
		</div>
	  </c:if>
		  <div class="form-group" style="text-align: center;">
			<button type="submit" class="btn btn-default">提交</button>
		  	<button type="reset" class="btn btn-default">重置</button>
		  	<a type="reset" class="btn btn-default">返回</a>
		  </div>
	</form>
</div>
</body>
<script type="text/javascript">
//删除图片
function delect(id){
	$.ajax({
		type:"POST",
		url:"<%=request.getContextPath() %>/ckuImage/del.do",
		data: {id:id}, 
		dataType: 'json',
        timeout: 30000,
        async:true,
        success: function(json){
        	if(json.rc==0){
    			window.location.reload();
    		}
        },
        error: function(xhr, type){
			
        }
	});
}

</script>
</html>
