<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="../common/common.jsp" %>
<title>新增节目</title>
<link rel="stylesheet" type="text/css" href="${staticPath}css/jquery.datetimepicker.css" />
<style type="text/css">
.ulFrmTwo > li{height:30px;}
</style>
</head>
<body>
<form id="addProgramForm" encType="multipart/form-data">
<input type="hidden" name="id" value ="${id}" />
<div class="open-content open-pad">
	<ul class="ulFrmTwo clearfix2">
		<li>
			<span class="label labelW80 labelRight"><em>*</em>节目名称</span>
			<input id="programName" type="text" name="programName" class="text {text:'请输入节目名称'}" size="20" value="${data.programName}"/>
		</li>
		<li>
			<span class="label labelW80 labelRight"><em>*</em>节目类型</span>
			<input type="radio" class="radio {click:changeToVariety}"  name="type" value="1"  ${data.type == null || data.type == 1 ? "checked" : ""}/><label>综艺</label>
			<input type="radio" class="radio {click:changeToVariety}" name="type" value="2" ${data.type == 2 ? "checked" : ""}/><label>栏目</label>
			<input type="radio" class="radio {click:changeToVariety}" name="type" value="3" ${data.type == 3 ? "checked" : ""}/><label>电视剧</label>
			<input type="radio" class="radio {click:changeToVariety}" name="type" value="4" ${data.type == 4 ? "checked" : ""}/><label>电影</label>
		</li>
		<li>
			<span class="label labelW80 labelRight"><em>*</em>一级分类</span>
			<div class="select {onchange:getTwoCategory,height:100}">
				<%-- <select id="firstType" name="firstType">
				 <c:choose>
				  <c:when test="${data.firstType} == null">
				  	<option selected="selected">一级分类</option>
				  </c:when>
				   <c:otherwise> 
				   	<option>${data.firstType}</option>
				   </c:otherwise>	
				 </c:choose>
				</select> --%>
				<div class="search-item">
    				<input type="text" id="keywords1" arrow=true class="text textTips" name="keywords1" value="<c:if test="${!empty data.firstType}">${data.firstType}</c:if>" />
 				</div>
  			    <input type="hidden" name="firstType" id="firstType" />
			</div></li>
		<li>
			<span class="label labelW80 labelRight"><em>*</em>二级分类</span>
			<%-- <div class="select {height:100}">
				<select id="secondType" name="secondType">
				 <c:choose>
				  <c:when test="${data.secondType} == null">
				  	<option selected="selected">二级分类</option>
				  </c:when>
				   <c:otherwise> 
				   	<option>${data.secondType}</option>
				   </c:otherwise>	
				 </c:choose>
				</select>
			</div> --%>
			<div class="search-item">
      			 <input type="text" id="keywords2" arrow=true class="text textTips" name="keywords2" value="<c:if test="${!empty data.secondType}">${data.secondType}</c:if>" />
 			</div>
  			<input type="hidden" name="secondType" id="secondType"/>
		</li>
		<li class="variety ${data.type == 3 || data.type == 4 ? 'contentTxt' : '' }">
			<span class="label labelW80 labelRight"><em>*</em>播出周期</span>
			<input type="radio" class="radio {click:changeTobo}"  name="showCycle" value="1" ${data.showCycle == null ||data.showCycle == 1 ? "checked": "" } /><label>周播</label>
			<input type="radio" class="radio {click:changeTobo}" name="showCycle" value="2" ${data.showCycle == 2 ? "checked": "" }/><label>季播</label>
		</li>
		<li class="cycle-year  ${data.showCycle == 2 || data.type == 3 || data.type == 4  ? 'contentTxt' : '' }">
			<span class="label labelW80 labelRight"><em>*</em>年份</span>
			<input type="text" name="${data.showCycle == 2 || data.type == 3 || data.type == 4 ? '' : 'showYear'}" class="text {text:'请输入年份，如2017年'}" value="${data.showYear}" /> <span class="label">年</span>
		</li>
		<li class="cycle-month ${data.showCycle != 2  ? 'contentTxt' : '' }">
			<span class="label labelW80 labelRight"><em>*</em>第几季</span>
			<span class="label">第</span> <input type="text" name="${data.showCycle != 2 ? '' : 'showYear'}" class="text {text:'请输入季数，如1'}" value="${data.showYear}" /> <span class="label">季</span>
		</li>
		<li class="variety ${data.type == 3 || data.type == 4 ? 'contentTxt' : '' }">
			<span class="label labelW80 labelRight"><em>*</em>第几期</span>
			<span class="label">第</span> <input type="text" name="showPhase" class="text {text:'请输入期数，如2'}" value="${data.showPhase}" /> <span class="label">期</span>
		</li>
		<li class="tv ${data.type != 3 ? 'contentTxt' : '' }">
			<span class="label labelW80 labelRight"><em>*</em>集数</span>
			<span class="label">第</span> <input type="text" name="episode" class="text {text:'请输入期数，如2'}" value="${data.episode}" /> <span class="label">集</span>
		</li>
		<li>
			<span class="label labelW80 labelRight"><em>*</em>首播日期</span>
			<input type="text" name="showTime" id="showTime" class="text {text:'首播日期'}" value="<fmt:formatDate value="${data.showTime}" type="date"/> " />
		</li>
		<li class="variety-date ${data.type == 4 ? 'contentTxt' : '' }">
			<span class="label labelW80 labelRight"><em>*</em>开始时间</span>
			<input type="text" name="startTime" id="startTime" class="text {text:'开始时间'}" value="<fmt:formatDate value="${data.startTime}" type="time" pattern="HH:mm"/> "/>
		</li>
		<li class="variety-date ${data.type == 4 ? 'contentTxt' : '' }">
			<span class="label labelW80 labelRight"><em>*</em>结束时间</span>
			<input type="text" name="endTime" id="endTime" class="text {text:'结束时间'}" value="<fmt:formatDate value="${data.endTime}" type="time" pattern="HH:mm"/> " />
		</li>
	</ul>
</div>
<div class="open-fixed-buttons">
	<a href="javascript:programSave();" class="btn-radius">提交</a> <a href="javascript:top.$.closeWindow();" class="btn-radius cancel">取消</a>
</div>
</form>
<script type="text/javascript" src="${staticPath}js/common/jquery.datetimepicker.js"></script>
<script type="text/javascript" src="${staticPath}js/program/program.js"></script>
<script type="text/javascript">
var firstType="${data.firstType}", secondType = "${data.secondType}";
$(function(){
	$.resetText();
	$(".text").input();
	$.radio();
	$(".select").uiSelect();
	getOneCategory($("input[name='type']:checked").val());
	$("#startTime, #endTime").datetimepicker({format: 'H:i', timepicker: true, datepicker: false, step:1 });
	$("#showTime").datetimepicker();
});
</script>
</body>
</html>