<%@ 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">
	<link rel="stylesheet" href="<%=request.getContextPath()%>/js/bootstrap-datetimepicker/css/bootstrap-datetimepicker.min.css">
	<link rel="stylesheet" href="<%=request.getContextPath()%>/js/select2/css/select2.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>
	<script type="text/javascript" charset="utf-8" src="<%=request.getContextPath() %>/js/layer/layer.js"> </script>
	<script type="text/javascript" charset="utf-8" src="<%=request.getContextPath() %>/js/bootstrap-datetimepicker/js/bootstrap-datetimepicker.min.js"></script>
	<script type="text/javascript" charset="utf-8" src="<%=request.getContextPath() %>/js/bootstrap-datetimepicker/js/locales/bootstrap-datetimepicker.zh-CN.js"></script>
	<script type="text/javascript" charset="utf-8" src="<%=request.getContextPath() %>/js/select2/js/select2.min.js"></script>
</head>
<body>
<div class="container">
	<c:if test="${cabPush.id ==null }">
		<form class="form-horizontal" action="<%=request.getContextPath() %>/cabPush/addCabPush.do">
	</c:if>
	<c:if test="${cabPush.id !=null }">
		<form class="form-horizontal" action="<%=request.getContextPath() %>/cabPush/updateCabPush.do">
	</c:if>
		<c:if test="${cabPush.id ==null }">
			<legend>添加推送消息</legend>
		</c:if>
		<c:if test="${cabPush.id !=null }">
			<legend>修改推送消息</legend>
		</c:if>

		<input type="hidden" name="id" value="${cabPush.id }" class="form-control">
		  <div class="form-group-sm">
			<label class="control-label col-xs-2">推送内容:</label>
		    <div class="col-xs-10">
		    	<input type="text" name="content" value="${cabPush.content }" class="form-control" placeholder="推送内容">
		    </div>
		  </div>
			<div class="form-group-sm">
				<label class="col-xs-2 control-label">推送时间:</label>
				<div class="col-xs-10">
					<div class="date form_datetime input-group" data-date-format="yyyy-mm-dd hh:ii:00">
						<input class="form-control"  placeholder="推送时间" name="pushDate" value="<fmt:formatDate value="${cabPush.pushDate }" pattern="yyyy-MM-dd HH:mm:ss" />" readonly type="text" />
						<span class="input-group-addon"><span class="glyphicon glyphicon-remove"></span></span>
						<span class="input-group-addon"><span class="glyphicon glyphicon-th"></span></span>
					</div>
				</div>
			</div>
			<div class="form-group-sm">
				<label class="col-xs-2 control-label">推送类别:</label>
				<div class="col-xs-10">
					<div class="input-group col-xs-12" >
						<%--<input type="text" name="type" value="${cabPush.type }" class="form-control" readonly placeholder="推送类别">--%>
						<select id="sel1"  name="type" class="form-control">
							<option value="content" selected>资讯</option>
						</select>
					</div>

				</div>
			</div>
			<div class="form-group-sm">
				<label class="col-xs-2 control-label">类别ID:</label>
				<div class="col-xs-10">
					<div class="input-group" >
						<input type="text" name="typeId" id="addMatchId" value="${cabPush.typeId }" class="form-control" readonly placeholder="类别ID">
						<span class="input-group-addon"><span class="glyphicon glyphicon-remove" onclick="reset('addMatchId')"></span></span>
						<span class="input-group-addon"><span class="glyphicon glyphicon-th" onclick="showMatch()"></span></span>
					</div>
				</div>
			</div>
		  <div class="form-group-sm text-center" >
			<button type="submit" class="btn btn-sm btn-default">提交</button>
		  	<button type="reset" class="btn btn-sm btn-default">重置</button>
		  	<a type="reset" class="btn btn-sm btn-default">返回</a>
		  </div>
	</form>
</div>
<script>
	$("#sel1").select2();
	$(function(){
		$('.form_datetime').datetimepicker({
			weekStart: 1,
			todayBtn:  1,
			autoclose: 1,
			todayHighlight: 1,
			minuteStep:30,
			startView: 2,
			forceParse: 0,
			showMeridian: 1
		});
	});
	function showType(){
		layer.open({
			type: 1,
			content: '自定义HTML内容'
		});
	}
	function showMatch(){
		layer.open({
			type: 2,
			title: "选择推送资讯",
			shadeClose: true,
			shade: [0.8, '#393D49'],
			maxmin: false, //开启最大化最小化按钮
			area: ['800px', '700px'],
			content: "<%=request.getContextPath()%>/publish/getListModal.do",
			end: function(){
				var detailId = $('#addMatchId').val();
				if(detailId == -1){
					return;
				}
			}
		});
	}
	function reset(id){
		$("#"+id).val("");
	}
</script>
</body>
</html>
