<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@ include file="../common/common.jsp" %>
<title>央卫视剧场分析</title>
</head>
<body>
<%@ include file="../common/head.jsp" %>
<div class="screen main bg-gray">
	<div class="radius-tabs top">
		<a href="${basePath}special_analysis/index.do" class="button">专题广告分析</a>
		<a href="${basePath}theatre_analysis/index.do" class="button active">央卫视剧场分析</a>
	</div>
	<div class="search-form">
	    <form name="dataForm" class="search-form" action="export_list.do" method="post">
		<div class="search-group" style="margin: 0;">					
		    <div class="buttons button-wrap inline search-item" id="tabMenu">
				<span class="btn btn-disabled" data-day="0">全部</span><span class="btn" data-day="7">最近一周</span><span class="btn btn-disabled" data-day="90">最近三月</span><span class="btn btn-disabled" data-day="365">最近一年</span>
			</div>
			<span class="search-item pRight30"><div class="twoContent"><input type="text" name="startDate" id="start_time" class="text {text:'开始时间'}" size="10" /><span>-</span><input type="text" name="endDate" id="end_time" class="text {text:'结束时间'}" size="10" /></div></span>
			<div class="search-item pRight30"><input type="text" name="name" id="keyword" class="text {text:'请输入剧名'}"  value="${keyword}" /></div>
			<div class="search-item pRight30">
				<select id="mediaName" name="mediaName">
					<option value=""></option>
				</select>
			</div>
		</div>
		<div class="search-group">
			<div class="search-item pRight30">
					<select id="firstTheme" name="firstTheme">
						<option value=""></option>
					</select>
					<select id="secondTheme" name="secondTheme">
						<option value=""></option>
					</select>
			</div>
			<div class="search-item pRight30">
				<select id="mediaRank" name="channelSystem">
					<option value="">媒体等级</option>
					<option value="0">央视频道</option>
					<option value="1">一线卫视</option>
					<option value="2">二线卫视</option>
					<option value="3">三线卫视</option>
					<option value="4">四线卫视</option>
					<option value="5">五线卫视</option>
					<option value="6">六线卫视</option>
					<option value="7">七线卫视</option>
					<option value="8">卡通频道</option>
				</select>
			</div>
			<div class="search-item pRight30">
				<select id="theatreTime" name="theatreTime">
				    <option value="">剧场</option>
					<option value="0" selected="selected">日间剧场</option>
					<option value="1">黄金剧场</option>
					<option value="2">午夜剧场</option>
					<option value="3">凌晨剧场</option>
				</select>
			</div>
			<div class="search-item">
				<a href="javascript:search();" class="search-btn">搜 索</a>
				<a onclick="javascript:setBenchmark();" class="search-btn">对 标</a>
			</div>
		</div>
		</form>
	</div>
	<div class="table-content">
		<div class="hd-title">央卫视电视剧收视指标一览<a href="javascript:document.dataForm.submit();" style="line-height: 16px;" class="rFloat btn mBottom10">导出</a></div>
		<div class="">
			<table class="table table-gray" cellpadding="0" cellspacing="0" id="program_analysis_list_table">
				<thead>
					<tr>
						<th width="5%">序号</th>
						<th width="8%">剧名</th>
						<th width="7%">媒体</th>
						<th width="auto">题材</th>
						<th width="6%">细分题材</th>
						<th width="8%">剧场</th>
						<th width="6%">频道体系</th>
						<th width="10%">季度</th>
						<th width="7%">集次</th>
						<th width="5%">省网收视</th>
						<th width="5%">省到达千人</th>
						<th width="5%">频道收视率</th>
						<th width="7%">频道到达千人</th>
						<th width="7%">效果</th>
						<th width="7%"><input type="checkbox" class="checkbox {click:checkAll}" name="all" value="对标" /></th>
					</tr>
				</thead>
				<tbody id="program_analysis_list"></tbody>
			</table>
			<div class="mTop10">
				<div id="program_analysis_page" class="rFloat"></div>
				累计 <span id="program_analysis_count" class="blue">0</span> 条
			</div>
		</div>
	</div>
	<div class="table-content">
		<div class="hd-title" id="program_placement_div_1">央卫视电视剧收视明细<a href="javascript:document.detailForm.submit();" style="line-height: 16px;" class="rFloat btn mBottom10">导出</a></div>
		<div class="" id="program_placement_div_2">
            <form name="detailForm" action="export_detail_list.do" method="post">
                <input name="startDate" id="start_time_1" type="hidden"/>
                <input name="endDate" id="end_time_1" type="hidden"/>
                <input name="mediaName" id="mediaName_1" type="hidden"/>
                <input name="name" id="name_1" type="hidden"/>
                <input name="theatreTime" id="theatreTime_1" type="hidden"/>
                <input name="season" id="season_1" type="hidden"/>
            </form>
			<table class="table table-gray" cellpadding="0" cellspacing="0" id="program_placement_table">
				<thead id="program_placement_thead">
					<tr>
						<th width="4%">序号</th>
						<th width="7%">剧名</th>
						<th width="7%">媒体</th>
						<th width="7%">题材</th>
						<th width="7%">细分题材</th>
						<th width="4%">集数</th>
						<th width="7%">日期</th>
						<th width="7%">播出时间</th>
						<th width="7%">产品/栏目</th>
						<th width="5%">时长(分)</th>
						<th width="7%">进线预估</th>
						<th width="7%">省网收视</th>
						<th width="7%">省网到达千人</th>
						<th width="7%">市网收视</th>
						<th width="7%">市网到达千人</th>
					</tr>
				</thead>
				<tbody id="placement_detail_list"></tbody>
			</table>
			<div class="mTop10">
				<div id="placement_detail_page" class="rFloat"></div>
				累计 <span id="placement_detail_count" class="blue">0</span> 条
			</div>
		</div>
	</div>
	<div class="analyse-tabs">
		<%@ include file="../analysis/program_analysis_type1.jsp" %>
	</div>
</div>
<%@ include file="../common/footer.jsp" %>
<link rel="stylesheet" type="text/css" href="${staticPath}css/jquery.datetimepicker.css" />
<script type="text/javascript" src="${staticPath}js/common/jquery.datetimepicker.js"></script>
<script type="text/javascript" src="${staticPath}js/echart/echarts.common.min.js"></script>
<script type="text/javascript" src="${staticPath}js/echarts/esl.js"></script>
<script type="text/javascript" src="${staticPath}js/echarts/chartHead.js"></script>
<script type="text/javascript" src="${staticPath}js/echart/pie.js"></script>
<script type="text/javascript" src="${staticPath}js/analysis/theatre_analysis.js"></script>
<script type="text/javascript">
	var ztgg_analysis = "${menuMap['ztgg_analysis']}" || 0;
	$(function(){
		$.resetText();
		$(".text").input();
		$.checkbox();
		$(".select").uiSelect();
		$(".table").hoverTable(true, true);
		$("#start_time, #end_time").datetimepicker();
		changeTab(7);
		$("#tabMenu").tabMenu({removeClass:"btn-disabled",fun:function(obj, text){
				changeTab(obj.dataset.day);
			}});

		$("input[name=rating_ratio_35]").click(function(){
			getRatingChart(cur_type,1,$("input[name=rating_ratio_35]:checked").val());
		});

		$("input[name=rating_ratio_29]").click(function(){
			getRatingChart(cur_type,2,$("input[name=rating_ratio_35]:checked").val());
		});
	});

	// 媒体
	var mediaNameSelect = $('select[name="mediaName"]').select2({
		placeholder: "请选择播出媒体",
		allowClear: true,
		width:'120px',
		ajax:{
			url: _PUBLIC_ +'ad-media/select/list.do',
			dataType:'json',
			quietMillis:100,
			data:function(params){
				return {
					name : params.term,
					pageNo : params.page || 1,
					pageSize : 20
				}
			},
			processResults: function (data, params) {
				params.page = params.page || 1;
				return {
					results: data.results,
					pagination: {
						more: (params.page * 20) < data.total
					}
				};
			},
			cache: true
		}
	});
	// 媒体等级
	var mediaRankSelect = $('select[name="channelSystem"]').select2({
		placeholder: "请选择媒体等级",
		allowClear: true,
		width:'120px',
	});
	// 剧场
	var typeSelect = $('select[name="theatreTime"]').select2({
		placeholder: "请选择剧场",
		allowClear: true,
		width:'120px',
	});
	// 体裁select控件初始化
	var firstThemeSelect = $('select[name="firstTheme"]').select2({
		placeholder: "请输入体裁",
		allowClear: true,
		width:'120px',
		ajax:{
			url: _PUBLIC_ +'ad-select/top_category_by_type.do',
			dataType:'json',
			quietMillis:100,
			data:function(params){
				return {
					name : params.term,
					type : 1,
					pageNo : params.page || 1,
					pageSize : 20
				}
			},
			processResults: function (data, params) {
				params.page = params.page || 1;
				return {
					results: data.results,
					pagination: {
						more: (params.page * 20) < data.total
					}
				};
			},
			cache: true
		}
	});

	// 解绑细分体裁select控件初始化
	$('select[name="firstTheme"]').live('change',function(){
		$('select[name="secondTheme"]').html('<option value=""></option>');
	});

	// 细分体裁select控件初始化
	var secondThemeSelect = $('select[name="secondTheme"]').select2({
		placeholder: "请输入细分体裁",
		allowClear: true,
		width:'120px',
		ajax:{
			url: _PUBLIC_ +'ad-select/second_category_by_type.do',
			dataType:'json',
			quietMillis:100,
			data:function(params){
				return {
					name : params.term,
					type : 1,
					parentName : $('#firstTheme').val(),
					pageNo : params.page || 1,
					pageSize : 20
				}
			},
			processResults: function (data, params) {
				params.page = params.page || 1;
				return {
					results: data.results,
					pagination: {
						more: (params.page * 20) < data.total
					}
				};
			},
			cache: true
		}
	});
</script>
</body>
</html>